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

Unified Diff: webkit/glue/webworkerclient_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/webworkerclient.h ('k') | webkit/glue/webworkerclient_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webworkerclient_impl.h
===================================================================
--- webkit/glue/webworkerclient_impl.h (revision 0)
+++ webkit/glue/webworkerclient_impl.h (revision 0)
@@ -0,0 +1,61 @@
+// 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_WEBWORKERCLIENT_IMPL_H_
+#define WEBKIT_GLUE_WEBWORKERCLIENT_IMPL_H_
+
+#if ENABLE(WORKERS)
+
+#include "base/scoped_ptr.h"
+#include "webkit/glue/webworkerclient.h"
+
+#include "WorkerContextProxy.h"
+
+class WebWorker;
+
+// The purpose of this class is to provide a WorkerContextProxy
+// implementation that we can give to WebKit. Internally, it converts the
+// data types to Chrome compatible ones so that renderer code can use it over
+// IPC.
+class WebWorkerClientImpl : public WebCore::WorkerContextProxy,
+ public WebWorkerClient {
+ public:
+ WebWorkerClientImpl(WebCore::Worker* worker);
+
+ void set_webworker(WebWorker* webworker);
+
+ // WebCore::WorkerContextProxy implementation
+ void startWorkerContext(const WebCore::KURL& scriptURL,
+ const WebCore::String& userAgent,
+ const WebCore::String& sourceCode);
+ void terminateWorkerContext();
+ void postMessageToWorkerContext(const WebCore::String& message);
+ bool hasPendingActivity() const;
+ void workerObjectDestroyed();
+
+ // WebWorkerClient implementation.
+ void PostMessageToWorkerObject(const string16& message);
+ void PostExceptionToWorkerObject(const string16& error_message,
+ int line_number,
+ const string16& source_url);
+ void PostConsoleMessageToWorkerObject(int destination,
+ int source,
+ int level,
+ const string16& message,
+ int line_number,
+ const string16& source_url);
+ void ConfirmMessageFromWorkerObject(bool has_pending_activity);
+ void ReportPendingActivity(bool has_pending_activity);
+ void WorkerContextDestroyed();
+
+ private:
+ virtual ~WebWorkerClientImpl();
+
+ WebCore::Worker* worker_;
+ scoped_ptr<WebWorker> webworker_;
+};
+
+#endif
+
+#endif // WEBKIT_GLUE_WEBWORKERCLIENT_IMPL_H_
« no previous file with comments | « webkit/glue/webworkerclient.h ('k') | webkit/glue/webworkerclient_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698