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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/webworker_context_proxy.h ('k') | chrome/worker/webworker_context_stub.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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/renderer/webworker_context_proxy.h"
6
7 #include "chrome/common/render_messages.h"
8 #include "chrome/common/worker_messages.h"
9 #include "chrome/renderer/render_view.h"
10
11 WebWorkerContextProxyImpl::WebWorkerContextProxyImpl(RenderView* render_view)
12 : render_view_(render_view), route_id_(MSG_ROUTING_NONE) {
13 }
14
15 WebWorkerContextProxyImpl::~WebWorkerContextProxyImpl() {
16 }
17
18 void WebWorkerContextProxyImpl::StartWorkerContext(
19 const GURL& script_url,
20 const std::string& user_agent,
21 const std::string& source_code) {
22 render_view_->Send(
23 new ViewHostMsg_CreateDedicatedWorker(script_url, &route_id_));
24 if (route_id_ == MSG_ROUTING_NONE)
25 return;
26
27 Send(new WorkerMsg_StartContext(route_id_, user_agent, source_code));
28 }
29
30 void WebWorkerContextProxyImpl::TerminateWorkerContext() {
31 }
32
33 void WebWorkerContextProxyImpl::PostMessageToWorkerContext(const std::string&) {
34 }
35
36 bool WebWorkerContextProxyImpl::HasPendingActivity() const {
37 return true;
38 }
39
40 void WebWorkerContextProxyImpl::WorkerObjectDestroyed() {
41 }
42
43 bool WebWorkerContextProxyImpl::Send(IPC::Message* msg) {
44 // For now we proxy all messages to the worker process through the browser.
45 // Revisit if we find this slow.
46 // TODO(jabdelmalek): handle sync messages.
47 IPC::Message* wrapped_msg = new ViewHostMsg_ForwardToWorker(*msg);
48 delete msg;
49 return render_view_->Send(wrapped_msg);
50 }
OLDNEW
« 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