summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authormichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-25 21:15:31 +0000
committermichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-25 21:15:31 +0000
commit697af4a94a9351f6994d9207356930f373cf3a6e (patch)
tree501a3d73683bf94694da5a540c5b6b88501ba961 /chrome
parent2a8132263c53c361e4a7618af889492407dbb8e2 (diff)
downloadchromium_src-697af4a94a9351f6994d9207356930f373cf3a6e.zip
chromium_src-697af4a94a9351f6994d9207356930f373cf3a6e.tar.gz
chromium_src-697af4a94a9351f6994d9207356930f373cf3a6e.tar.bz2
Provide more info to the renderer process in appcache progress events.
BUG=39370 TEST= yes, updated unittests Review URL: http://codereview.chromium.org/2166006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48197 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/appcache/appcache_frontend_proxy.cc8
-rw-r--r--chrome/browser/appcache/appcache_frontend_proxy.h3
-rw-r--r--chrome/common/appcache/appcache_dispatcher.cc6
-rw-r--r--chrome/common/appcache/appcache_dispatcher.h2
-rw-r--r--chrome/common/render_messages_internal.h10
5 files changed, 28 insertions, 1 deletions
diff --git a/chrome/browser/appcache/appcache_frontend_proxy.cc b/chrome/browser/appcache/appcache_frontend_proxy.cc
index d81244c..89822d0 100644
--- a/chrome/browser/appcache/appcache_frontend_proxy.cc
+++ b/chrome/browser/appcache/appcache_frontend_proxy.cc
@@ -18,9 +18,17 @@ void AppCacheFrontendProxy::OnStatusChanged(const std::vector<int>& host_ids,
void AppCacheFrontendProxy::OnEventRaised(const std::vector<int>& host_ids,
appcache::EventID event_id) {
+ DCHECK(event_id != appcache::PROGRESS_EVENT); // See OnProgressEventRaised.
sender_->Send(new AppCacheMsg_EventRaised(host_ids, event_id));
}
+void AppCacheFrontendProxy::OnProgressEventRaised(
+ const std::vector<int>& host_ids,
+ const GURL& url, int num_total, int num_complete) {
+ sender_->Send(new AppCacheMsg_ProgressEventRaised(
+ host_ids, url, num_total, num_complete));
+}
+
void AppCacheFrontendProxy::OnContentBlocked(int host_id) {
sender_->Send(new AppCacheMsg_ContentBlocked(host_id));
}
diff --git a/chrome/browser/appcache/appcache_frontend_proxy.h b/chrome/browser/appcache/appcache_frontend_proxy.h
index 234e36cf..2b6bc2e 100644
--- a/chrome/browser/appcache/appcache_frontend_proxy.h
+++ b/chrome/browser/appcache/appcache_frontend_proxy.h
@@ -24,6 +24,9 @@ class AppCacheFrontendProxy : public appcache::AppCacheFrontend {
appcache::Status status);
virtual void OnEventRaised(const std::vector<int>& host_ids,
appcache::EventID event_id);
+ virtual void OnProgressEventRaised(const std::vector<int>& host_ids,
+ const GURL& url,
+ int num_total, int num_complete);
virtual void OnContentBlocked(int host_id);
private:
diff --git a/chrome/common/appcache/appcache_dispatcher.cc b/chrome/common/appcache/appcache_dispatcher.cc
index eabb690..41d027a 100644
--- a/chrome/common/appcache/appcache_dispatcher.cc
+++ b/chrome/common/appcache/appcache_dispatcher.cc
@@ -13,6 +13,7 @@ bool AppCacheDispatcher::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(AppCacheMsg_CacheSelected, OnCacheSelected)
IPC_MESSAGE_HANDLER(AppCacheMsg_StatusChanged, OnStatusChanged)
IPC_MESSAGE_HANDLER(AppCacheMsg_EventRaised, OnEventRaised)
+ IPC_MESSAGE_HANDLER(AppCacheMsg_ProgressEventRaised, OnProgressEventRaised)
IPC_MESSAGE_HANDLER(AppCacheMsg_ContentBlocked, OnContentBlocked)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -34,6 +35,11 @@ void AppCacheDispatcher::OnEventRaised(const std::vector<int>& host_ids,
frontend_impl_.OnEventRaised(host_ids, event_id);
}
+void AppCacheDispatcher::OnProgressEventRaised(
+ const std::vector<int>& host_ids,
+ const GURL& url, int num_total, int num_complete) {
+ frontend_impl_.OnProgressEventRaised(host_ids, url, num_total, num_complete);
+}
void AppCacheDispatcher::OnContentBlocked(int host_id) {
frontend_impl_.OnContentBlocked(host_id);
}
diff --git a/chrome/common/appcache/appcache_dispatcher.h b/chrome/common/appcache/appcache_dispatcher.h
index 4f3b50c..0ecd328 100644
--- a/chrome/common/appcache/appcache_dispatcher.h
+++ b/chrome/common/appcache/appcache_dispatcher.h
@@ -31,6 +31,8 @@ class AppCacheDispatcher {
appcache::Status status);
void OnEventRaised(const std::vector<int>& host_ids,
appcache::EventID event_id);
+ void OnProgressEventRaised(const std::vector<int>& host_ids,
+ const GURL& url, int num_total, int num_complete);
void OnContentBlocked(int host_id);
AppCacheBackendProxy backend_proxy_;
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index 828c0e9..48d198e 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -613,11 +613,19 @@ IPC_BEGIN_MESSAGES(View)
std::vector<int> /* host_ids */,
appcache::Status)
- // Notifies the renderer of an AppCache event.
+ // Notifies the renderer of an AppCache event other than the
+ // progress event which has a seperate message.
IPC_MESSAGE_CONTROL2(AppCacheMsg_EventRaised,
std::vector<int> /* host_ids */,
appcache::EventID)
+ // Notifies the renderer of an AppCache progress event.
+ IPC_MESSAGE_CONTROL4(AppCacheMsg_ProgressEventRaised,
+ std::vector<int> /* host_ids */,
+ GURL /* url being processed */,
+ int /* total */,
+ int /* complete */)
+
// Notifies the renderer of the fact that AppCache access was blocked.
IPC_MESSAGE_CONTROL1(AppCacheMsg_ContentBlocked,
int /* host_id */)