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

Side by Side Diff: webkit/glue/webworker_impl.cc

Issue 27157: Initial checkin of the out of process worker implementation.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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 | « webkit/glue/webworker_impl.h ('k') | webkit/glue/webworkerclient.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 "config.h"
6
7 #if ENABLE(WORKERS)
8
9 #include "base/compiler_specific.h"
10 #include "webkit/glue/glue_util.h"
11 #include "webkit/glue/webworkerclient.h"
12 #include "webkit/glue/webworker_impl.h"
13
14
15 WebWorker* WebWorker::Create(WebWorkerClient* client) {
16 return new WebWorkerImpl(client);
17 }
18
19
20 WebWorkerImpl::WebWorkerImpl(WebWorkerClient* client) : client_(client) {
21 }
22
23 WebWorkerImpl::~WebWorkerImpl() {
24 }
25
26 void WebWorkerImpl::StartWorkerContext(const GURL& script_url,
27 const string16& user_agent,
28 const string16& source_code) {
29 // TODO(jianli): implement WorkerContextProxy here (i.e. create WorkerThread
30 // etc). The WebKit code uses worker_object_proxy_ when it wants to talk to
31 // code running in the renderer process.
32 }
33
34 void WebWorkerImpl::TerminateWorkerContext() {
35 }
36
37 void WebWorkerImpl::PostMessageToWorkerContext(const string16& message) {
38 }
39
40 void WebWorkerImpl::WorkerObjectDestroyed() {
41 }
42
43 void WebWorkerImpl::postMessageToWorkerObject(const WebCore::String& message) {
44 client_->PostMessageToWorkerObject(webkit_glue::StringToString16(message));
45 }
46
47 void WebWorkerImpl::postExceptionToWorkerObject(
48 const WebCore::String& errorMessage,
49 int lineNumber,
50 const WebCore::String& sourceURL) {
51 client_->PostExceptionToWorkerObject(
52 webkit_glue::StringToString16(errorMessage),
53 lineNumber,
54 webkit_glue::StringToString16(sourceURL));
55 }
56
57 void WebWorkerImpl::postConsoleMessageToWorkerObject(
58 WebCore::MessageDestination destination,
59 WebCore::MessageSource source,
60 WebCore::MessageLevel level,
61 const WebCore::String& message,
62 int lineNumber,
63 const WebCore::String& sourceURL) {
64 client_->PostConsoleMessageToWorkerObject(
65 destination,
66 source,
67 level,
68 webkit_glue::StringToString16(message),
69 lineNumber,
70 webkit_glue::StringToString16(sourceURL));
71 }
72
73 void WebWorkerImpl::confirmMessageFromWorkerObject(bool hasPendingActivity) {
74 client_->ConfirmMessageFromWorkerObject(hasPendingActivity);
75 }
76
77 void WebWorkerImpl::reportPendingActivity(bool hasPendingActivity) {
78 client_->ReportPendingActivity(hasPendingActivity);
79 }
80
81 void WebWorkerImpl::workerContextDestroyed() {
82 client_->WorkerContextDestroyed();
83 }
84
85 #else
86
87 WebWorker* WebWorker::Create(WebWorkerClient* client) {
88 return NULL;
89 }
90
91 #endif
OLDNEW
« no previous file with comments | « webkit/glue/webworker_impl.h ('k') | webkit/glue/webworkerclient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698