summaryrefslogtreecommitdiffstats
path: root/webkit/appcache
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/appcache')
-rw-r--r--webkit/appcache/appcache_frontend_impl.cc7
-rw-r--r--webkit/appcache/appcache_frontend_impl.h2
-rw-r--r--webkit/appcache/appcache_group_unittest.cc4
-rw-r--r--webkit/appcache/appcache_host_unittest.cc4
-rw-r--r--webkit/appcache/appcache_interfaces.h9
-rw-r--r--webkit/appcache/appcache_request_handler_unittest.cc3
-rw-r--r--webkit/appcache/appcache_update_job_unittest.cc4
-rw-r--r--webkit/appcache/web_application_cache_host_impl.cc6
-rw-r--r--webkit/appcache/web_application_cache_host_impl.h1
9 files changed, 39 insertions, 1 deletions
diff --git a/webkit/appcache/appcache_frontend_impl.cc b/webkit/appcache/appcache_frontend_impl.cc
index 3535bf1..2365a912d 100644
--- a/webkit/appcache/appcache_frontend_impl.cc
+++ b/webkit/appcache/appcache_frontend_impl.cc
@@ -53,6 +53,13 @@ void AppCacheFrontendImpl::OnProgressEventRaised(
}
}
+void AppCacheFrontendImpl::OnLogMessage(int host_id, LogLevel log_level,
+ const std::string& message) {
+ WebApplicationCacheHostImpl* host = GetHost(host_id);
+ if (host)
+ host->OnLogMessage(log_level, message);
+}
+
void AppCacheFrontendImpl::OnContentBlocked(int host_id) {
WebApplicationCacheHostImpl* host = GetHost(host_id);
if (host)
diff --git a/webkit/appcache/appcache_frontend_impl.h b/webkit/appcache/appcache_frontend_impl.h
index 99e5c2c..6617082 100644
--- a/webkit/appcache/appcache_frontend_impl.h
+++ b/webkit/appcache/appcache_frontend_impl.h
@@ -21,6 +21,8 @@ class AppCacheFrontendImpl : public AppCacheFrontend {
virtual void OnProgressEventRaised(const std::vector<int>& host_ids,
const GURL& url,
int num_total, int num_complete);
+ virtual void OnLogMessage(int host_id, LogLevel log_level,
+ const std::string& message);
virtual void OnContentBlocked(int host_id);
};
diff --git a/webkit/appcache/appcache_group_unittest.cc b/webkit/appcache/appcache_group_unittest.cc
index b1c7425..a88808d 100644
--- a/webkit/appcache/appcache_group_unittest.cc
+++ b/webkit/appcache/appcache_group_unittest.cc
@@ -38,6 +38,10 @@ class TestAppCacheFrontend : public appcache::AppCacheFrontend {
int num_total, int num_complete) {
}
+ virtual void OnLogMessage(int host_id, appcache::LogLevel log_level,
+ const std::string& message) {
+ }
+
virtual void OnContentBlocked(int host_id) {
}
diff --git a/webkit/appcache/appcache_host_unittest.cc b/webkit/appcache/appcache_host_unittest.cc
index b618ce9..f2e8a04 100644
--- a/webkit/appcache/appcache_host_unittest.cc
+++ b/webkit/appcache/appcache_host_unittest.cc
@@ -57,6 +57,10 @@ class AppCacheHostTest : public testing::Test {
last_event_id_ = PROGRESS_EVENT;
}
+ virtual void OnLogMessage(int host_id, appcache::LogLevel log_level,
+ const std::string& message) {
+ }
+
virtual void OnContentBlocked(int host_id) {
}
diff --git a/webkit/appcache/appcache_interfaces.h b/webkit/appcache/appcache_interfaces.h
index 5f1c369..a57ba67 100644
--- a/webkit/appcache/appcache_interfaces.h
+++ b/webkit/appcache/appcache_interfaces.h
@@ -44,6 +44,12 @@ enum EventID {
OBSOLETE_EVENT
};
+enum LogLevel {
+ LOG_INFO,
+ LOG_WARNING,
+ LOG_ERROR,
+};
+
// Interface used by backend (browser-process) to talk to frontend (renderer).
class AppCacheFrontend {
public:
@@ -57,7 +63,8 @@ class AppCacheFrontend {
const GURL& url,
int num_total, int num_complete) = 0;
virtual void OnContentBlocked(int host_id) = 0;
-
+ virtual void OnLogMessage(int host_id, LogLevel log_level,
+ const std::string& message) = 0;
virtual ~AppCacheFrontend() {}
};
diff --git a/webkit/appcache/appcache_request_handler_unittest.cc b/webkit/appcache/appcache_request_handler_unittest.cc
index 85db41a..1793209 100644
--- a/webkit/appcache/appcache_request_handler_unittest.cc
+++ b/webkit/appcache/appcache_request_handler_unittest.cc
@@ -36,6 +36,9 @@ class AppCacheRequestHandlerTest : public testing::Test {
const GURL& url,
int num_total, int num_complete) {}
+ virtual void OnLogMessage(int host_id, appcache::LogLevel log_level,
+ const std::string& message) {}
+
virtual void OnContentBlocked(int host_id) {}
};
diff --git a/webkit/appcache/appcache_update_job_unittest.cc b/webkit/appcache/appcache_update_job_unittest.cc
index 665150a..06ac167 100644
--- a/webkit/appcache/appcache_update_job_unittest.cc
+++ b/webkit/appcache/appcache_update_job_unittest.cc
@@ -216,6 +216,10 @@ class MockFrontend : public AppCacheFrontend {
}
}
+ virtual void OnLogMessage(int host_id, appcache::LogLevel log_level,
+ const std::string& message) {
+ }
+
virtual void OnContentBlocked(int host_id) {
}
diff --git a/webkit/appcache/web_application_cache_host_impl.cc b/webkit/appcache/web_application_cache_host_impl.cc
index 267f20b..0f1258d 100644
--- a/webkit/appcache/web_application_cache_host_impl.cc
+++ b/webkit/appcache/web_application_cache_host_impl.cc
@@ -92,6 +92,12 @@ 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_);
diff --git a/webkit/appcache/web_application_cache_host_impl.h b/webkit/appcache/web_application_cache_host_impl.h
index ccba47e..6f19b0d 100644
--- a/webkit/appcache/web_application_cache_host_impl.h
+++ b/webkit/appcache/web_application_cache_host_impl.h
@@ -36,6 +36,7 @@ class WebApplicationCacheHostImpl : public WebKit::WebApplicationCacheHost {
void OnStatusChanged(appcache::Status);
void OnEventRaised(appcache::EventID);
void OnProgressEventRaised(const GURL& url, int num_total, int num_complete);
+ void OnLogMessage(LogLevel log_level, const std::string& message);
virtual void OnContentBlocked() {}
// WebApplicationCacheHost methods