summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-05 20:11:13 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-05 20:11:13 +0000
commit0e1e30e2f72e301d808a841128cb14e936748b95 (patch)
tree5c76d493079336d5dbef73a7ddbf06f81c59d5e8
parent9be7801f04c10701bebea2d721eb6441b18c0ecf (diff)
downloadchromium_src-0e1e30e2f72e301d808a841128cb14e936748b95.zip
chromium_src-0e1e30e2f72e301d808a841128cb14e936748b95.tar.gz
chromium_src-0e1e30e2f72e301d808a841128cb14e936748b95.tar.bz2
Have WebWorkerProxy send messages directly through RenderThread, instead of RenderWidget, since that could lead to the terminateworker message being dropped.
Review URL: http://codereview.chromium.org/39176 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11021 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/renderer/render_view.cc2
-rw-r--r--chrome/renderer/webworker_proxy.cc11
-rw-r--r--chrome/renderer/webworker_proxy.h3
3 files changed, 6 insertions, 10 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index debff4dc..ae76377 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -1978,7 +1978,7 @@ void RenderView::OnMissingPluginStatus(WebPluginDelegate* delegate,
WebWorker* RenderView::CreateWebWorker(WebWorkerClient* client) {
#if defined(OS_WIN)
- return new WebWorkerProxy(this, client);
+ return new WebWorkerProxy(client);
#else
// TODO(port): out of process workers
NOTIMPLEMENTED();
diff --git a/chrome/renderer/webworker_proxy.cc b/chrome/renderer/webworker_proxy.cc
index c271e40..cf6477a 100644
--- a/chrome/renderer/webworker_proxy.cc
+++ b/chrome/renderer/webworker_proxy.cc
@@ -9,11 +9,8 @@
#include "chrome/renderer/render_thread.h"
#include "webkit/glue/webworkerclient.h"
-WebWorkerProxy::WebWorkerProxy(
- IPC::Message::Sender* sender, WebWorkerClient* client)
- : sender_(sender),
- route_id_(MSG_ROUTING_NONE),
- client_(client) {
+WebWorkerProxy::WebWorkerProxy(WebWorkerClient* client)
+ : route_id_(MSG_ROUTING_NONE), client_(client) {
}
WebWorkerProxy::~WebWorkerProxy() {
@@ -23,7 +20,7 @@ void WebWorkerProxy::StartWorkerContext(
const GURL& script_url,
const string16& user_agent,
const string16& source_code) {
- sender_->Send(
+ RenderThread::current()->Send(
new ViewHostMsg_CreateDedicatedWorker(script_url, &route_id_));
if (route_id_ == MSG_ROUTING_NONE)
return;
@@ -62,7 +59,7 @@ bool WebWorkerProxy::Send(IPC::Message* message) {
// TODO(jabdelmalek): handle sync messages if we need them.
IPC::Message* wrapped_msg = new ViewHostMsg_ForwardToWorker(*message);
delete message;
- return sender_->Send(wrapped_msg);
+ return RenderThread::current()->Send(wrapped_msg);
}
void WebWorkerProxy::OnMessageReceived(const IPC::Message& message) {
diff --git a/chrome/renderer/webworker_proxy.h b/chrome/renderer/webworker_proxy.h
index 6967ea0..97a6bb3 100644
--- a/chrome/renderer/webworker_proxy.h
+++ b/chrome/renderer/webworker_proxy.h
@@ -24,7 +24,7 @@ class Message;
class WebWorkerProxy : public WebWorker,
public IPC::Channel::Listener {
public:
- WebWorkerProxy(IPC::Message::Sender* sender, WebWorkerClient* client);
+ WebWorkerProxy(WebWorkerClient* client);
virtual ~WebWorkerProxy();
// WebWorker implementation.
@@ -43,7 +43,6 @@ class WebWorkerProxy : public WebWorker,
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