Index: chrome/worker/webworker_context_stub.cc |
=================================================================== |
--- chrome/worker/webworker_context_stub.cc (revision 0) |
+++ chrome/worker/webworker_context_stub.cc (revision 0) |
@@ -0,0 +1,33 @@ |
+// Copyright (c) 2009 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 "chrome/worker/webworker_context_stub.h" |
+ |
+#include "chrome/common/ipc_logging.h" |
+#include "chrome/common/worker_messages.h" |
+#include "chrome/worker/worker_thread.h" |
+#include "webkit/glue/webworker.h" |
+ |
+ |
+WebWorkerContextStub::WebWorkerContextStub(const GURL& url, int route_id) |
+ : url_(url), |
+ route_id_(route_id), |
+ wrapper_(CreateWebWorkerContextWrapper()) { |
+} |
+ |
+WebWorkerContextStub::~WebWorkerContextStub() { |
+ thread_->OnWorkerDestruction(this); |
+} |
+ |
+void WebWorkerContextStub::OnMessageReceived(const IPC::Message& message) { |
+ IPC_BEGIN_MESSAGE_MAP(WebWorkerContextStub, message) |
+ IPC_MESSAGE_HANDLER(WorkerMsg_StartContext, OnStartContext) |
+ IPC_END_MESSAGE_MAP() |
+} |
+ |
+void WebWorkerContextStub::OnStartContext(const std::string& user_agent, |
+ const std::string& source_code) { |
+ wrapper_->StartWorkerContext(url_, user_agent, source_code); |
+ |
+} |