OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 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 "chrome/worker/webworker_context_stub.h" |
| 6 |
| 7 #include "chrome/common/ipc_logging.h" |
| 8 #include "chrome/common/worker_messages.h" |
| 9 #include "chrome/worker/worker_thread.h" |
| 10 #include "webkit/glue/webworker.h" |
| 11 |
| 12 |
| 13 WebWorkerContextStub::WebWorkerContextStub(const GURL& url, int route_id) |
| 14 : url_(url), |
| 15 route_id_(route_id), |
| 16 wrapper_(CreateWebWorkerContextWrapper()) { |
| 17 } |
| 18 |
| 19 WebWorkerContextStub::~WebWorkerContextStub() { |
| 20 thread_->OnWorkerDestruction(this); |
| 21 } |
| 22 |
| 23 void WebWorkerContextStub::OnMessageReceived(const IPC::Message& message) { |
| 24 IPC_BEGIN_MESSAGE_MAP(WebWorkerContextStub, message) |
| 25 IPC_MESSAGE_HANDLER(WorkerMsg_StartContext, OnStartContext) |
| 26 IPC_END_MESSAGE_MAP() |
| 27 } |
| 28 |
| 29 void WebWorkerContextStub::OnStartContext(const std::string& user_agent, |
| 30 const std::string& source_code) { |
| 31 wrapper_->StartWorkerContext(url_, user_agent, source_code); |
| 32 |
| 33 } |
OLD | NEW |