     @handleUpdateFromChromeStorage key, change?.newValue for own key, change of changes
 
   handleUpdateFromChromeStorage: (key, value) ->
+    @log "handleUpdateFromChromeStorage: #{key}"
     # Note: value here is either null or a JSONified string.  Therefore, even falsy settings values (like
     # false, 0 or "") are truthy here.  Only null is falsy.
     if @shouldSyncKey key

  # Called after @cache has been initialized.  On extension pages, this will be called twice, but that does
  # not matter because it's idempotent.
  onLoaded: ->
    @isLoaded = true
    callback() while callback = @onLoadedCallbacks.pop()


# In all cases except Settings.defaults, values are stored as jsonified strings.

Settings =
  debug: false
  storage: chrome.storage.sync
  cache: {}
  isLoaded: false
