summaryrefslogtreecommitdiffstats
path: root/content/renderer
diff options
context:
space:
mode:
authorkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-06 01:34:28 +0000
committerkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-06 01:34:28 +0000
commitd2f46b1d31044a6cb76b2a4695cadfd8ed786d2f (patch)
treea955a91e6d074aeb7c91c0cb75d289dbcd39ca3d /content/renderer
parent5def89eb4f851f06ed7d322ec5308aae6d50fd6b (diff)
downloadchromium_src-d2f46b1d31044a6cb76b2a4695cadfd8ed786d2f.zip
chromium_src-d2f46b1d31044a6cb76b2a4695cadfd8ed786d2f.tar.gz
chromium_src-d2f46b1d31044a6cb76b2a4695cadfd8ed786d2f.tar.bz2
Implement ServiceWorkerVersion::DispatchInstallEvent()
This doesn't hook any blink code yet, but sends InstallEvent to the child process and dispatches callback for InstallEventFinished response. This depends on: https://codereview.chromium.org/139923005/ BUG=313530 TEST=ServiceWorkerBrowserTest.Install Review URL: https://codereview.chromium.org/142863009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249201 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer')
-rw-r--r--content/renderer/service_worker/service_worker_script_context.cc15
-rw-r--r--content/renderer/service_worker/service_worker_script_context.h3
2 files changed, 18 insertions, 0 deletions
diff --git a/content/renderer/service_worker/service_worker_script_context.cc b/content/renderer/service_worker/service_worker_script_context.cc
index 90d656e..34c858b 100644
--- a/content/renderer/service_worker/service_worker_script_context.cc
+++ b/content/renderer/service_worker/service_worker_script_context.cc
@@ -29,6 +29,7 @@ void ServiceWorkerScriptContext::OnMessageReceived(
current_request_id_ = request_id;
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(ServiceWorkerScriptContext, message)
+ IPC_MESSAGE_HANDLER(ServiceWorkerMsg_InstallEvent, OnInstallEvent)
IPC_MESSAGE_HANDLER(ServiceWorkerMsg_FetchEvent, OnFetchEvent)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -36,11 +37,25 @@ void ServiceWorkerScriptContext::OnMessageReceived(
current_request_id_ = -1;
}
+void ServiceWorkerScriptContext::DidHandleInstallEvent(int request_id) {
+ Send(request_id, ServiceWorkerHostMsg_InstallEventFinished());
+}
+
void ServiceWorkerScriptContext::Send(int request_id,
const IPC::Message& message) {
embedded_context_->SendMessageToBrowser(request_id, message);
}
+void ServiceWorkerScriptContext::OnInstallEvent(
+ int active_version_embedded_worker_id) {
+ // TODO(kinuko): Uncomment this when blink side becomes ready.
+ // proxy_->dispatchInstallEvent(current_request_id_);
+
+ // TODO(kinuko): this should be called asynchronously from blink side
+ // when blink-side plumbing is done.
+ DidHandleInstallEvent(current_request_id_);
+}
+
void ServiceWorkerScriptContext::OnFetchEvent(
const ServiceWorkerFetchRequest& request) {
NOTIMPLEMENTED();
diff --git a/content/renderer/service_worker/service_worker_script_context.h b/content/renderer/service_worker/service_worker_script_context.h
index 9bed978..20c7584 100644
--- a/content/renderer/service_worker/service_worker_script_context.h
+++ b/content/renderer/service_worker/service_worker_script_context.h
@@ -33,10 +33,13 @@ class ServiceWorkerScriptContext {
void OnMessageReceived(int request_id, const IPC::Message& message);
+ void DidHandleInstallEvent(int request_id);
+
private:
// Send message back to the browser.
void Send(int request_id, const IPC::Message& message);
+ void OnInstallEvent(int active_version_embedded_worker_id);
void OnFetchEvent(const ServiceWorkerFetchRequest& request);
// Not owned; embedded_context_ owns this.