diff options
author | michaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-30 18:32:58 +0000 |
---|---|---|
committer | michaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-30 18:32:58 +0000 |
commit | 49837a1cc3f5c7779a7482480d466577b65281f4 (patch) | |
tree | 850942eb9babdbd651e4b45892c012e185585379 /webkit/appcache/appcache_host.cc | |
parent | 3d7409b276eda72842e106fc7feb5d59464887f5 (diff) | |
download | chromium_src-49837a1cc3f5c7779a7482480d466577b65281f4.zip chromium_src-49837a1cc3f5c7779a7482480d466577b65281f4.tar.gz chromium_src-49837a1cc3f5c7779a7482480d466577b65281f4.tar.bz2 |
Minor AppCache mods
* Add some more logging to the console window for when a cache is first created and when a master entry is added.
* Relocate the code that generates the log message for when a document is loaded from an appcache to the browser process.
* Use a Singleton<T> instead of a static global for an IDMap<T> used in child processes.
* Call the recently added webkit API for reporting progress events.
BUG=39370,13685
TEST=some existing automated tests apply, manual tests for the console logging
Review URL: http://codereview.chromium.org/2877005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51274 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_host.cc')
-rw-r--r-- | webkit/appcache/appcache_host.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/webkit/appcache/appcache_host.cc b/webkit/appcache/appcache_host.cc index 6d0336b..8553324 100644 --- a/webkit/appcache/appcache_host.cc +++ b/webkit/appcache/appcache_host.cc @@ -5,6 +5,7 @@ #include "webkit/appcache/appcache_host.h" #include "base/logging.h" +#include "base/string_util.h" #include "webkit/appcache/appcache.h" #include "webkit/appcache/appcache_backend_impl.h" #include "webkit/appcache/appcache_request_handler.h" @@ -313,8 +314,14 @@ void AppCacheHost::FinishCacheSelection( // context being navigated. DCHECK(cache->owning_group()); DCHECK(new_master_entry_url_.is_empty()); - AssociateCache(cache); AppCacheGroup* owing_group = cache->owning_group(); + const char* kFormatString = + "Document was loaded from appcache with manifest %s"; + frontend_->OnLogMessage( + host_id_, LOG_INFO, + StringPrintf( + kFormatString, owing_group->manifest_url().spec().c_str())); + AssociateCache(cache); if (!owing_group->is_obsolete() && !owing_group->is_being_deleted()) { owing_group->StartUpdateWithHost(this); ObserveGroupBeingUpdated(owing_group); @@ -327,6 +334,12 @@ void AppCacheHost::FinishCacheSelection( // resource from which document was loaded as the new master resourse. DCHECK(!group->is_obsolete()); DCHECK(new_master_entry_url_.is_valid()); + const char* kFormatString = group->HasCache() ? + "Adding master entry to appcache with manifest %s" : + "Creating appcache with manifest %s"; + frontend_->OnLogMessage( + host_id_, LOG_INFO, + StringPrintf(kFormatString, group->manifest_url().spec().c_str())); AssociateCache(NULL); // The UpdateJob may produce one for us later. group->StartUpdateWithNewMasterEntry(this, new_master_entry_url_); ObserveGroupBeingUpdated(group); |