summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/web_application_cache_host_impl.cc
diff options
context:
space:
mode:
authormichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-25 00:46:02 +0000
committermichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-25 00:46:02 +0000
commitdf4cd1577cbd126d827a72cb0a15dcbe38a62a8b (patch)
treecdefa81e8266d3198ad9716824addc802a35b6a7 /webkit/appcache/web_application_cache_host_impl.cc
parent2febbc7bc136af7212814e3495c135ec9fa98345 (diff)
downloadchromium_src-df4cd1577cbd126d827a72cb0a15dcbe38a62a8b.zip
chromium_src-df4cd1577cbd126d827a72cb0a15dcbe38a62a8b.tar.gz
chromium_src-df4cd1577cbd126d827a72cb0a15dcbe38a62a8b.tar.bz2
AppCache: Output some information to the javascript console.
BUG=13685 TEST=manual Review URL: http://codereview.chromium.org/2805030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50796 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/web_application_cache_host_impl.cc')
-rw-r--r--webkit/appcache/web_application_cache_host_impl.cc22
1 files changed, 16 insertions, 6 deletions
diff --git a/webkit/appcache/web_application_cache_host_impl.cc b/webkit/appcache/web_application_cache_host_impl.cc
index 0f1258d..15ef1db 100644
--- a/webkit/appcache/web_application_cache_host_impl.cc
+++ b/webkit/appcache/web_application_cache_host_impl.cc
@@ -92,12 +92,6 @@ void WebApplicationCacheHostImpl::OnProgressEventRaised(
client_->notifyEventListener(WebApplicationCacheHost::ProgressEvent);
}
-void WebApplicationCacheHostImpl::OnLogMessage(
- LogLevel log_level, const std::string& message) {
- // TODO(michaeln): Widen the webkit api with this addition.
- // client_->notifyLogMessage(log_level, message);
-}
-
void WebApplicationCacheHostImpl::willStartMainResourceRequest(
WebURLRequest& request) {
request.setAppCacheHostID(host_id_);
@@ -112,6 +106,9 @@ void WebApplicationCacheHostImpl::willStartSubResourceRequest(
}
void WebApplicationCacheHostImpl::selectCacheWithoutManifest() {
+ if (document_response_.appCacheID() != kNoCacheId)
+ LogLoadedFromCacheMessage();
+
// Reset any previous status values we've received from the backend
// since we're now selecting a new cache.
has_status_ = false;
@@ -124,6 +121,9 @@ void WebApplicationCacheHostImpl::selectCacheWithoutManifest() {
bool WebApplicationCacheHostImpl::selectCacheWithManifest(
const WebURL& manifest_url) {
+ if (document_response_.appCacheID() != kNoCacheId)
+ LogLoadedFromCacheMessage();
+
// Reset any previous status values we've received from the backend
// since we're now selecting a new cache.
has_status_ = false;
@@ -237,4 +237,14 @@ bool WebApplicationCacheHostImpl::swapCache() {
return backend_->SwapCache(host_id_);
}
+void WebApplicationCacheHostImpl::LogLoadedFromCacheMessage() {
+ DCHECK(!document_response_.appCacheManifestURL().isEmpty());
+ GURL manifest_url = document_response_.appCacheManifestURL();
+ std::string message = StringPrintf(
+ "Document %s was loaded from appcache %s",
+ document_url_.spec().c_str(),
+ manifest_url.spec().c_str());
+ OnLogMessage(LOG_INFO, message);
+}
+
} // appcache namespace