summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/renderer/render_view.cc13
-rw-r--r--chrome/renderer/render_view.h3
-rw-r--r--chrome/renderer/websharedworker_proxy.cc14
-rw-r--r--chrome/renderer/websharedworker_proxy.h6
-rw-r--r--chrome/renderer/websharedworkerrepository_impl.cc10
-rw-r--r--chrome/renderer/websharedworkerrepository_impl.h6
-rw-r--r--chrome/worker/webworkerclient_proxy.cc5
-rw-r--r--chrome/worker/webworkerclient_proxy.h1
8 files changed, 44 insertions, 14 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index c4af4c9..fc74190 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -56,6 +56,7 @@
#include "chrome/renderer/visitedlink_slave.h"
#include "chrome/renderer/webplugin_delegate_pepper.h"
#include "chrome/renderer/webplugin_delegate_proxy.h"
+#include "chrome/renderer/websharedworker_proxy.h"
#include "chrome/renderer/webworker_proxy.h"
#include "grit/generated_resources.h"
#include "grit/renderer_resources.h"
@@ -148,6 +149,7 @@ using WebKit::WebScriptSource;
using WebKit::WebSearchableFormData;
using WebKit::WebSecurityOrigin;
using WebKit::WebSettings;
+using WebKit::WebSharedWorker;
using WebKit::WebSize;
using WebKit::WebString;
using WebKit::WebTextAffinity;
@@ -1783,6 +1785,17 @@ WebWorker* RenderView::createWorker(WebFrame* frame, WebWorkerClient* client) {
return new WebWorkerProxy(client, RenderThread::current(), routing_id_);
}
+WebSharedWorker* RenderView::createSharedWorker(
+ WebFrame* frame, const WebURL& url, const WebString& name,
+ unsigned long long documentId) {
+
+ // TODO(atwilson): Call to the browser process to check if there's an existing
+ // worker (passing MSG_ROUTING_NONE for now, to indicate no existing worker).
+ int worker_route_id = MSG_ROUTING_NONE;
+ return new WebSharedWorkerProxy(
+ RenderThread::current(), worker_route_id, routing_id_);
+}
+
WebMediaPlayer* RenderView::createMediaPlayer(
WebFrame* frame, WebMediaPlayerClient* client) {
scoped_refptr<media::FilterFactoryCollection> factory =
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index f162b99..3991da9 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -261,6 +261,9 @@ class RenderView : public RenderWidget,
WebKit::WebFrame* frame, const WebKit::WebPluginParams& params);
virtual WebKit::WebWorker* createWorker(
WebKit::WebFrame* frame, WebKit::WebWorkerClient* client);
+ virtual WebKit::WebSharedWorker* createSharedWorker(
+ WebKit::WebFrame* frame, const WebKit::WebURL& url,
+ const WebKit::WebString& name, unsigned long long documentId);
virtual WebKit::WebMediaPlayer* createMediaPlayer(
WebKit::WebFrame* frame, WebKit::WebMediaPlayerClient* client);
virtual void willClose(WebKit::WebFrame* frame);
diff --git a/chrome/renderer/websharedworker_proxy.cc b/chrome/renderer/websharedworker_proxy.cc
index ee08901..c0ecba4 100644
--- a/chrome/renderer/websharedworker_proxy.cc
+++ b/chrome/renderer/websharedworker_proxy.cc
@@ -10,8 +10,8 @@
#include "webkit/api/public/WebURL.h"
WebSharedWorkerProxy::WebSharedWorkerProxy(ChildThread* child_thread,
- int route_id,
- int render_view_route_id)
+ int route_id,
+ int render_view_route_id)
: WebWorkerBase(child_thread, route_id, render_view_route_id) {
}
@@ -27,6 +27,16 @@ void WebSharedWorkerProxy::startWorkerContext(
CreateWorkerContext(script_url, true, name, user_agent, source_code);
}
+void WebSharedWorkerProxy::terminateWorkerContext() {
+ // This API should only be invoked from worker context.
+ NOTREACHED();
+}
+
+void WebSharedWorkerProxy::clientDestroyed() {
+ // This API should only be invoked from worker context.
+ NOTREACHED();
+}
+
void WebSharedWorkerProxy::connect(WebKit::WebMessagePortChannel* channel) {
WebMessagePortChannelImpl* webchannel =
static_cast<WebMessagePortChannelImpl*>(channel);
diff --git a/chrome/renderer/websharedworker_proxy.h b/chrome/renderer/websharedworker_proxy.h
index 8ffe63c..b9ab065 100644
--- a/chrome/renderer/websharedworker_proxy.h
+++ b/chrome/renderer/websharedworker_proxy.h
@@ -21,8 +21,8 @@ class WebSharedWorkerProxy : public WebKit::WebSharedWorker,
private WebWorkerBase {
public:
WebSharedWorkerProxy(ChildThread* child_thread,
- int route_id,
- int render_view_route_id);
+ int route_id,
+ int render_view_route_id);
// Implementations of WebSharedWorker APIs
virtual bool isStarted();
@@ -31,6 +31,8 @@ class WebSharedWorkerProxy : public WebKit::WebSharedWorker,
const WebKit::WebString& name,
const WebKit::WebString& user_agent,
const WebKit::WebString& source_code);
+ virtual void terminateWorkerContext();
+ virtual void clientDestroyed();
// IPC::Channel::Listener proxyementation.
void OnMessageReceived(const IPC::Message& message);
diff --git a/chrome/renderer/websharedworkerrepository_impl.cc b/chrome/renderer/websharedworkerrepository_impl.cc
index 15aea07..24664b7 100644
--- a/chrome/renderer/websharedworkerrepository_impl.cc
+++ b/chrome/renderer/websharedworkerrepository_impl.cc
@@ -4,11 +4,11 @@
#include "chrome/renderer/websharedworkerrepository_impl.h"
-WebKit::WebSharedWorker* WebSharedWorkerRepositoryImpl::lookup(
- const WebKit::WebURL& url,
- const WebKit::WebString& name,
- DocumentID document) {
- return NULL;
+#include "chrome/renderer/websharedworker_proxy.h"
+
+void WebSharedWorkerRepositoryImpl::addSharedWorker(
+ WebKit::WebSharedWorker* worker, DocumentID document) {
+ // TODO(atwilson): Track shared worker creation here.
}
void WebSharedWorkerRepositoryImpl::documentDetached(
diff --git a/chrome/renderer/websharedworkerrepository_impl.h b/chrome/renderer/websharedworkerrepository_impl.h
index a0cda6d..4083202 100644
--- a/chrome/renderer/websharedworkerrepository_impl.h
+++ b/chrome/renderer/websharedworkerrepository_impl.h
@@ -12,12 +12,8 @@ namespace WebKit {
}
class WebSharedWorkerRepositoryImpl : public WebKit::WebSharedWorkerRepository {
- virtual WebKit::WebSharedWorker* lookup(const WebKit::WebURL& url,
- const WebKit::WebString& name,
- DocumentID document);
-
+ virtual void addSharedWorker(WebKit::WebSharedWorker*, DocumentID document);
virtual void documentDetached(DocumentID document);
-
virtual bool hasSharedWorkers(DocumentID document);
};
diff --git a/chrome/worker/webworkerclient_proxy.cc b/chrome/worker/webworkerclient_proxy.cc
index baff23c..35b2a28 100644
--- a/chrome/worker/webworkerclient_proxy.cc
+++ b/chrome/worker/webworkerclient_proxy.cc
@@ -91,6 +91,11 @@ void WebWorkerClientProxy::reportPendingActivity(bool has_pending_activity) {
route_id_, has_pending_activity));
}
+void WebWorkerClientProxy::workerContextClosed() {
+ // TODO(atwilson): Notify WorkerProcessHost that the worker context is closing
+ // (needed for shared workers so we don't allow new connections).
+}
+
void WebWorkerClientProxy::workerContextDestroyed() {
Send(new WorkerHostMsg_WorkerContextDestroyed(route_id_));
// Tell the stub that the worker has shutdown - frees this object.
diff --git a/chrome/worker/webworkerclient_proxy.h b/chrome/worker/webworkerclient_proxy.h
index b422912..1f91b7e 100644
--- a/chrome/worker/webworkerclient_proxy.h
+++ b/chrome/worker/webworkerclient_proxy.h
@@ -46,6 +46,7 @@ class WebWorkerClientProxy : public WebKit::WebWorkerClient {
const WebKit::WebString& source_url);
virtual void confirmMessageFromWorkerObject(bool has_pending_activity);
virtual void reportPendingActivity(bool has_pending_activity);
+ virtual void workerContextClosed();
virtual void workerContextDestroyed();
virtual WebKit::WebWorker* createWorker(WebKit::WebWorkerClient* client);