Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/child/service_worker/embedded_worker_dispatcher.h" | |
| 6 | |
| 7 #include "content/child/service_worker/embedded_worker_stub.h" | |
| 8 #include "content/common/service_worker_messages.h" | |
| 9 | |
| 10 namespace content { | |
| 11 | |
| 12 EmbeddedWorkerDispatcher::EmbeddedWorkerDispatcher() {} | |
| 13 EmbeddedWorkerDispatcher::~EmbeddedWorkerDispatcher() {} | |
| 14 | |
| 15 bool EmbeddedWorkerDispatcher::OnMessageReceived( | |
| 16 const IPC::Message& message) { | |
| 17 bool handled = true; | |
| 18 IPC_BEGIN_MESSAGE_MAP(EmbeddedWorkerDispatcher, message) | |
| 19 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_CreateWorker, OnCreateWorker) | |
| 20 IPC_MESSAGE_UNHANDLED(handled = false) | |
| 21 IPC_END_MESSAGE_MAP() | |
| 22 return handled; | |
| 23 } | |
| 24 | |
| 25 void EmbeddedWorkerDispatcher::OnCreateWorker( | |
| 26 const GURL& script_url, | |
| 27 int route_id) { | |
| 28 // The stub owns itself and manages its lifetime. | |
| 29 new EmbeddedWorkerStub(script_url, route_id); | |
|
michaeln
2013/11/04 22:04:51
Its odd to see something newed and the ptr value n
| |
| 30 } | |
| 31 | |
| 32 } // namespace content | |
| OLD | NEW |