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

Unified Diff: webkit/glue/webworker_impl.h

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, 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 | « webkit/glue/webworker.h ('k') | webkit/glue/webworker_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webworker_impl.h
===================================================================
--- webkit/glue/webworker_impl.h (revision 0)
+++ webkit/glue/webworker_impl.h (revision 0)
@@ -0,0 +1,57 @@
+// 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.
+
+#ifndef WEBKIT_GLUE_WEBWORKER_IMPL_H_
+#define WEBKIT_GLUE_WEBWORKER_IMPL_H_
+
+#if ENABLE(WORKERS)
+
+#include "webkit/glue/webworker.h"
+
+#include "ScriptExecutionContext.h"
+#include "WorkerObjectProxy.h"
+
+// This class is used by the worker process code to talk to the WebCore::Worker
+// implementation. It can't use it directly since it uses WebKit types, so this
+// class converts the data types. When the WebCore::Worker object wants to call
+// WebCore::WorkerObjectProxy, this class will conver to Chrome data types first
+// and then call the supplied WebWorkerClient.
+class WebWorkerImpl: public WebCore::WorkerObjectProxy,
+ public WebWorker {
+ public:
+ WebWorkerImpl(WebWorkerClient* client);
+ virtual ~WebWorkerImpl();
+
+ // WebCore::WorkerObjectProxy implementation.
+ void postMessageToWorkerObject(const WebCore::String& message);
+ void postExceptionToWorkerObject(const WebCore::String& errorMessage,
+ int lineNumber,
+ const WebCore::String& sourceURL);
+ void postConsoleMessageToWorkerObject(WebCore::MessageDestination destination,
+ WebCore::MessageSource source,
+ WebCore::MessageLevel level,
+ const WebCore::String& message,
+ int lineNumber,
+ const WebCore::String& sourceURL);
+ void confirmMessageFromWorkerObject(bool hasPendingActivity);
+ void reportPendingActivity(bool hasPendingActivity);
+ void workerContextDestroyed();
+
+ // WebWorker implementation.
+ void StartWorkerContext(const GURL& script_url,
+ const string16& user_agent,
+ const string16& source_code);
+ void TerminateWorkerContext();
+ void PostMessageToWorkerContext(const string16& message);
+ void WorkerObjectDestroyed();
+
+ private:
+ WebWorkerClient* client_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebWorkerImpl);
+};
+
+#endif
+
+#endif // WEBKIT_GLUE_WEBWORKER_IMPL_H_
« no previous file with comments | « webkit/glue/webworker.h ('k') | webkit/glue/webworker_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698