diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-01 20:33:27 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-01 20:33:27 +0000 |
commit | 982e781d80d395cd9749de92d2efd6a309168cd3 (patch) | |
tree | 74cb4e36be8cf047c25812649a4f3a2f5325520f /chrome/worker | |
parent | 52049d5cfde95de013f8f333f940fef4ecd31533 (diff) | |
download | chromium_src-982e781d80d395cd9749de92d2efd6a309168cd3.zip chromium_src-982e781d80d395cd9749de92d2efd6a309168cd3.tar.gz chromium_src-982e781d80d395cd9749de92d2efd6a309168cd3.tar.bz2 |
Call WebWorkerClient on the main thread. This makes it consistent with the rest of the WebKit API, which is single threaded. Also a bunch of small fixes to make layout tests pass: the dll was being unloaded while its functions were still queued to be dispatched, and a string allocated in the dll was being GC'd in test shell.
BUG=11011
Review URL: http://codereview.chromium.org/102005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15087 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/worker')
-rw-r--r-- | chrome/worker/webworkerclient_proxy.cc | 10 | ||||
-rw-r--r-- | chrome/worker/webworkerclient_proxy.h | 5 |
2 files changed, 2 insertions, 13 deletions
diff --git a/chrome/worker/webworkerclient_proxy.cc b/chrome/worker/webworkerclient_proxy.cc index fa2bd39..4e154e2 100644 --- a/chrome/worker/webworkerclient_proxy.cc +++ b/chrome/worker/webworkerclient_proxy.cc @@ -20,7 +20,6 @@ WebWorkerClientProxy::WebWorkerClientProxy(const GURL& url, int route_id) : url_(url), route_id_(route_id), ALLOW_THIS_IN_INITIALIZER_LIST(impl_(WebWorker::create(this))) { - AddRef(); WorkerThread::current()->AddRoute(route_id_, this); ChildProcess::current()->AddRefProcess(); } @@ -67,18 +66,11 @@ void WebWorkerClientProxy::reportPendingActivity(bool has_pending_activity) { void WebWorkerClientProxy::workerContextDestroyed() { Send(new WorkerHostMsg_WorkerContextDestroyed(route_id_)); - impl_ = NULL; - WorkerThread::current()->message_loop()->ReleaseSoon(FROM_HERE, this); + delete this; } bool WebWorkerClientProxy::Send(IPC::Message* message) { - if (MessageLoop::current() != WorkerThread::current()->message_loop()) { - WorkerThread::current()->message_loop()->PostTask(FROM_HERE, - NewRunnableMethod(this, &WebWorkerClientProxy::Send, message)); - return true; - } - return WorkerThread::current()->Send(message); } diff --git a/chrome/worker/webworkerclient_proxy.h b/chrome/worker/webworkerclient_proxy.h index f650d58..ccf9557 100644 --- a/chrome/worker/webworkerclient_proxy.h +++ b/chrome/worker/webworkerclient_proxy.h @@ -6,7 +6,6 @@ #define CHROME_WORKER_WEBWORKERCLIENT_PROXY_H_ #include "base/basictypes.h" -#include "base/ref_counted.h" #include "chrome/common/ipc_channel.h" #include "googleurl/src/gurl.h" #include "third_party/WebKit/WebKit/chromium/public/WebWorkerClient.h" @@ -21,8 +20,7 @@ class WebWorker; // IPCs that are sent to the renderer, where they're converted back to function // calls by WebWorkerProxy. class WebWorkerClientProxy : public WebKit::WebWorkerClient, - public IPC::Channel::Listener, - public base::RefCounted<WebWorkerClientProxy> { + public IPC::Channel::Listener { public: WebWorkerClientProxy(const GURL& url, int route_id); @@ -47,7 +45,6 @@ class WebWorkerClientProxy : public WebKit::WebWorkerClient, virtual void OnMessageReceived(const IPC::Message& message); private: - friend class base::RefCounted<WebWorkerClientProxy>; ~WebWorkerClientProxy (); bool Send(IPC::Message* message); |