Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5985)

Unified Diff: chrome/renderer/webworker_context_proxy.cc

Issue 20413: old1 (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/webworker_context_proxy.h ('k') | chrome/worker/webworker_context_stub.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/webworker_context_proxy.cc
===================================================================
--- chrome/renderer/webworker_context_proxy.cc (revision 0)
+++ chrome/renderer/webworker_context_proxy.cc (revision 0)
@@ -0,0 +1,50 @@
+// 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/renderer/webworker_context_proxy.h"
+
+#include "chrome/common/render_messages.h"
+#include "chrome/common/worker_messages.h"
+#include "chrome/renderer/render_view.h"
+
+WebWorkerContextProxyImpl::WebWorkerContextProxyImpl(RenderView* render_view)
+ : render_view_(render_view), route_id_(MSG_ROUTING_NONE) {
+}
+
+WebWorkerContextProxyImpl::~WebWorkerContextProxyImpl() {
+}
+
+void WebWorkerContextProxyImpl::StartWorkerContext(
+ const GURL& script_url,
+ const std::string& user_agent,
+ const std::string& source_code) {
+ render_view_->Send(
+ new ViewHostMsg_CreateDedicatedWorker(script_url, &route_id_));
+ if (route_id_ == MSG_ROUTING_NONE)
+ return;
+
+ Send(new WorkerMsg_StartContext(route_id_, user_agent, source_code));
+}
+
+void WebWorkerContextProxyImpl::TerminateWorkerContext() {
+}
+
+void WebWorkerContextProxyImpl::PostMessageToWorkerContext(const std::string&) {
+}
+
+bool WebWorkerContextProxyImpl::HasPendingActivity() const {
+ return true;
+}
+
+void WebWorkerContextProxyImpl::WorkerObjectDestroyed() {
+}
+
+bool WebWorkerContextProxyImpl::Send(IPC::Message* msg) {
+ // For now we proxy all messages to the worker process through the browser.
+ // Revisit if we find this slow.
+ // TODO(jabdelmalek): handle sync messages.
+ IPC::Message* wrapped_msg = new ViewHostMsg_ForwardToWorker(*msg);
+ delete msg;
+ return render_view_->Send(wrapped_msg);
+}
« no previous file with comments | « chrome/renderer/webworker_context_proxy.h ('k') | chrome/worker/webworker_context_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698