summaryrefslogtreecommitdiffstats
path: root/chrome/plugin/chrome_plugin_host.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-20 05:23:36 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-20 05:23:36 +0000
commit514e711ea07b6a1aef47ebf20250a37bd632402c (patch)
tree632f5e8902cc4231e9c14d0ad28035d63a0c964d /chrome/plugin/chrome_plugin_host.cc
parent4acbad918766b81f1da3f10e2ae8aa2b10bb0593 (diff)
downloadchromium_src-514e711ea07b6a1aef47ebf20250a37bd632402c.zip
chromium_src-514e711ea07b6a1aef47ebf20250a37bd632402c.tar.gz
chromium_src-514e711ea07b6a1aef47ebf20250a37bd632402c.tar.bz2
Refactor code from RenderThread and PluginThread and move it to ChildThread. ChildProcess now owns the ChildThread, which removes duplicate code and simplifies things.
Clean up ChildProcess, there really was no need for all the templates and statics in it and its subclasses. Review URL: http://codereview.chromium.org/21502 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10080 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin/chrome_plugin_host.cc')
-rw-r--r--chrome/plugin/chrome_plugin_host.cc17
1 files changed, 8 insertions, 9 deletions
diff --git a/chrome/plugin/chrome_plugin_host.cc b/chrome/plugin/chrome_plugin_host.cc
index 159d4b2..f1d2794 100644
--- a/chrome/plugin/chrome_plugin_host.cc
+++ b/chrome/plugin/chrome_plugin_host.cc
@@ -138,7 +138,7 @@ class PluginRequestHandlerProxy
CPError Start() {
bridge_.reset(
- PluginThread::GetPluginThread()->resource_dispatcher()->CreateBridge(
+ PluginThread::current()->resource_dispatcher()->CreateBridge(
cprequest_->method,
GURL(cprequest_->url),
GURL(cprequest_->url), // TODO(jackson): policy url?
@@ -252,9 +252,9 @@ void STDCALL CPB_SetKeepProcessAlive(CPID id, CPBool keep_alive) {
if (desired_value != g_keep_process_alive) {
g_keep_process_alive = desired_value;
if (g_keep_process_alive)
- PluginProcess::AddRefProcess();
+ PluginProcess::current()->AddRefProcess();
else
- PluginProcess::ReleaseProcess();
+ PluginProcess::current()->ReleaseProcess();
}
}
@@ -276,7 +276,7 @@ CPError STDCALL CPB_GetCookies(CPID id, CPBrowsingContext context,
if (webplugin) {
cookies_str = webplugin->GetCookies(GURL(url), GURL(url));
} else {
- PluginThread::GetPluginThread()->Send(
+ PluginThread::current()->Send(
new PluginProcessHostMsg_GetCookies(context, GURL(url), &cookies_str));
}
@@ -507,10 +507,9 @@ CPError STDCALL CPB_SendMessage(CPID id, const void *data, uint32 data_len) {
CHECK(ChromePluginLib::IsPluginThread());
const uint8* data_ptr = static_cast<const uint8*>(data);
std::vector<uint8> v(data_ptr, data_ptr + data_len);
- if (!PluginThread::GetPluginThread()->Send(
- new PluginProcessHostMsg_PluginMessage(v))) {
+ if (!PluginThread::current()->Send(new PluginProcessHostMsg_PluginMessage(v)))
return CPERR_FAILURE;
- }
+
return CPERR_SUCCESS;
}
@@ -520,7 +519,7 @@ CPError STDCALL CPB_SendSyncMessage(CPID id, const void *data, uint32 data_len,
const uint8* data_ptr = static_cast<const uint8*>(data);
std::vector<uint8> v(data_ptr, data_ptr + data_len);
std::vector<uint8> r;
- if (!PluginThread::GetPluginThread()->Send(
+ if (!PluginThread::current()->Send(
new PluginProcessHostMsg_PluginSyncMessage(v, &r))) {
return CPERR_FAILURE;
}
@@ -540,7 +539,7 @@ CPError STDCALL CPB_SendSyncMessage(CPID id, const void *data, uint32 data_len,
CPError STDCALL CPB_PluginThreadAsyncCall(CPID id,
void (*func)(void *),
void *user_data) {
- MessageLoop *message_loop = PluginThread::GetPluginThread()->message_loop();
+ MessageLoop *message_loop = PluginThread::current()->message_loop();
if (!message_loop) {
return CPERR_FAILURE;
}