diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-17 19:15:35 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-17 19:15:35 +0000 |
commit | 6f516083864319feeb02ae4dc32609216455366b (patch) | |
tree | 285a57fee02c581e22d272951633d4a56a7846e6 /content/renderer/websharedworker_proxy.h | |
parent | 6421fe84fee932545c65ab77b7dcdc60be28accc (diff) | |
download | chromium_src-6f516083864319feeb02ae4dc32609216455366b.zip chromium_src-6f516083864319feeb02ae4dc32609216455366b.tar.gz chromium_src-6f516083864319feeb02ae4dc32609216455366b.tar.bz2 |
Move a bunch of gpu/worker/plugin renderer code to content. I temporarily disabled the sad plugin code while I add a renderer chrome interface in a follow up.
TBR=avi
Review URL: http://codereview.chromium.org/6713005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78579 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/websharedworker_proxy.h')
-rw-r--r-- | content/renderer/websharedworker_proxy.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/content/renderer/websharedworker_proxy.h b/content/renderer/websharedworker_proxy.h new file mode 100644 index 0000000..acc8dca --- /dev/null +++ b/content/renderer/websharedworker_proxy.h @@ -0,0 +1,58 @@ +// 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 CONTENT_RENDERER_WEBSHAREDWORKER_PROXY_H_ +#define CONTENT_RENDERER_WEBSHAREDWORKER_PROXY_H_ +#pragma once + +#include "base/basictypes.h" +#include "content/renderer/webworker_base.h" +#include "googleurl/src/gurl.h" +#include "third_party/WebKit/Source/WebKit/chromium/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 WebSharedWorkerProxy : public WebKit::WebSharedWorker, + private WebWorkerBase { + public: + // If the worker not loaded yet, route_id == MSG_ROUTING_NONE + WebSharedWorkerProxy(ChildThread* child_thread, + unsigned long long document_id, + bool exists, + int route_id, + int render_view_route_id); + + // Implementations of WebSharedWorker APIs + virtual bool isStarted(); + virtual void connect(WebKit::WebMessagePortChannel* channel, + ConnectListener* listener); + virtual void startWorkerContext(const WebKit::WebURL& script_url, + const WebKit::WebString& name, + const WebKit::WebString& user_agent, + const WebKit::WebString& source_code, + long long script_resource_appcache_id); + virtual void terminateWorkerContext(); + virtual void clientDestroyed(); + + // IPC::Channel::Listener implementation. + virtual bool OnMessageReceived(const IPC::Message& message); + + private: + void OnWorkerCreated(); + + // The id for the placeholder worker instance we've stored on the + // browser process (we need to pass this same route id back in when creating + // the worker). + int pending_route_id_; + ConnectListener* connect_listener_; + + DISALLOW_COPY_AND_ASSIGN(WebSharedWorkerProxy); +}; + +#endif // CONTENT_RENDERER_WEBSHAREDWORKER_PROXY_H_ |