summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/websharedworker_impl.h
diff options
context:
space:
mode:
authoratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-30 18:11:47 +0000
committeratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-30 18:11:47 +0000
commitab3505360bf6612d18915a39a0fec74b00642e82 (patch)
tree7a39d15a688b8e52c839fb9151851b2a37533ed0 /chrome/renderer/websharedworker_impl.h
parent06b9e3b77773477b5ee889ded41d10741d6b0647 (diff)
downloadchromium_src-ab3505360bf6612d18915a39a0fec74b00642e82.zip
chromium_src-ab3505360bf6612d18915a39a0fec74b00642e82.tar.gz
chromium_src-ab3505360bf6612d18915a39a0fec74b00642e82.tar.bz2
Initial pass of shared workers renderer-side code
Added initial interface hooks betweek WebKit code and renderer-side worker code. The proper messages are generated to fire off a shared worker, but they are currently ignored by the browser process. BUG=26233 TEST=none (will enable layout tests when basic functionality available) Review URL: http://codereview.chromium.org/340036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30599 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/websharedworker_impl.h')
-rw-r--r--chrome/renderer/websharedworker_impl.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/chrome/renderer/websharedworker_impl.h b/chrome/renderer/websharedworker_impl.h
new file mode 100644
index 0000000..14d122d89
--- /dev/null
+++ b/chrome/renderer/websharedworker_impl.h
@@ -0,0 +1,49 @@
+// 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_WEBSHAREDWORKER_IMPL_H_
+#define CHROME_RENDERER_WEBSHAREDWORKER_IMPL_H_
+
+#include "base/basictypes.h"
+#include "chrome/renderer/webworker_base.h"
+#include "googleurl/src/gurl.h"
+#include "webkit/api/public/WebSharedWorker.h"
+
+class ChildThread;
+
+// Implementation of the WebSharedWorker APIs. This object is intended to only
+// live long enough to allow the caller to send a "connect" event to the worker
+// thread. Once the connect event has been sent, all future communication will
+// happen via the WebMessagePortChannel, and the WebSharedWorker instance will
+// be freed.
+class WebSharedWorkerImpl : public WebKit::WebSharedWorker,
+ private WebWorkerBase {
+ public:
+ WebSharedWorkerImpl(const GURL& url,
+ const string16& name,
+ ChildThread* child_thread,
+ int route_id,
+ int render_view_route_id);
+
+ // Implementations of WebSharedWorker APIs
+ virtual bool isStarted();
+ virtual void connect(WebKit::WebMessagePortChannel* channel);
+ virtual void startWorkerContext(const WebKit::WebURL& script_url,
+ const WebKit::WebString& user_agent,
+ const WebKit::WebString& source_code);
+
+ // IPC::Channel::Listener implementation.
+ void OnMessageReceived(const IPC::Message& message);
+
+ private:
+ void OnWorkerCreated();
+
+ // The name and URL that uniquely identify this worker.
+ GURL url_;
+ string16 name_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebSharedWorkerImpl);
+};
+
+#endif // CHROME_RENDERER_WEBSHAREDWORKER_IMPL_H_