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

Unified Diff: chrome/renderer/webworker_proxy.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 | « chrome/renderer/renderer.vcproj ('k') | chrome/renderer/webworker_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/webworker_proxy.h
===================================================================
--- chrome/renderer/webworker_proxy.h (revision 0)
+++ chrome/renderer/webworker_proxy.h (revision 0)
@@ -0,0 +1,56 @@
+// 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 CHROME_RENDERER_WEBWORKER_PROXY_H_
+#define CHROME_RENDERER_WEBWORKER_PROXY_H_
+
+#include "base/basictypes.h"
+#include "chrome/common/ipc_channel.h"
+#include "webkit/glue/webworker.h"
+
+class GURL;
+class RenderView;
+
+namespace IPC {
+class Message;
+}
+
+// This class provides an implementation of WebWorker that the renderer provides
+// to the glue. This class converts function calls to IPC messages that are
+// dispatched in the worker process by WebWorkerClientProxy. It also receives
+// IPC messages from WebWorkerClientProxy which it converts to function calls to
+// WebWorkerClient.
+class WebWorkerProxy : public WebWorker,
+ public IPC::Channel::Listener {
+ public:
+ WebWorkerProxy(IPC::Message::Sender* sender, WebWorkerClient* client);
+ virtual ~WebWorkerProxy();
+
+ // WebWorker implementation.
+ // These functions are called by WebKit (after the data types have been
+ // converted by glue code).
+ virtual void StartWorkerContext(const GURL& script_url,
+ const string16& user_agent,
+ const string16& source_code);
+ virtual void TerminateWorkerContext();
+ virtual void PostMessageToWorkerContext(const string16& message);
+ virtual void WorkerObjectDestroyed();
+
+ // IPC::Channel::Listener implementation.
+ void OnMessageReceived(const IPC::Message& message);
+
+ private:
+ bool Send(IPC::Message* message);
+
+ IPC::Message::Sender* sender_;
+ int route_id_;
+
+ // Used to communicate to the WebCore::Worker object in response to IPC
+ // messages.
+ WebWorkerClient* client_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebWorkerProxy);
+};
+
+#endif // CHROME_RENDERER_WEBWORKER_PROXY_H_
« no previous file with comments | « chrome/renderer/renderer.vcproj ('k') | chrome/renderer/webworker_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698