Chromium Code Reviews| Index: content/child/service_worker/embedded_worker_dispatcher.cc |
| diff --git a/content/child/service_worker/embedded_worker_dispatcher.cc b/content/child/service_worker/embedded_worker_dispatcher.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ad662dcf4b31ac7379ad81082c28d0af238c98e6 |
| --- /dev/null |
| +++ b/content/child/service_worker/embedded_worker_dispatcher.cc |
| @@ -0,0 +1,32 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "content/child/service_worker/embedded_worker_dispatcher.h" |
| + |
| +#include "content/child/service_worker/embedded_worker_stub.h" |
| +#include "content/common/service_worker_messages.h" |
| + |
| +namespace content { |
| + |
| +EmbeddedWorkerDispatcher::EmbeddedWorkerDispatcher() {} |
| +EmbeddedWorkerDispatcher::~EmbeddedWorkerDispatcher() {} |
| + |
| +bool EmbeddedWorkerDispatcher::OnMessageReceived( |
| + const IPC::Message& message) { |
| + bool handled = true; |
| + IPC_BEGIN_MESSAGE_MAP(EmbeddedWorkerDispatcher, message) |
| + IPC_MESSAGE_HANDLER(ServiceWorkerMsg_CreateWorker, OnCreateWorker) |
| + IPC_MESSAGE_UNHANDLED(handled = false) |
| + IPC_END_MESSAGE_MAP() |
| + return handled; |
| +} |
| + |
| +void EmbeddedWorkerDispatcher::OnCreateWorker( |
| + const GURL& script_url, |
| + int route_id) { |
| + // The stub owns itself and manages its lifetime. |
| + new EmbeddedWorkerStub(script_url, route_id); |
|
michaeln
2013/11/04 22:04:51
Its odd to see something newed and the ptr value n
|
| +} |
| + |
| +} // namespace content |