Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1058)

Unified Diff: chrome/browser/chrome_plugin_host.cc

Issue 42158: Get rid of the gears in renderer process code. This allows me to do some cle... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/renderer_host/browser_render_process_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_plugin_host.cc
===================================================================
--- chrome/browser/chrome_plugin_host.cc (revision 11593)
+++ chrome/browser/chrome_plugin_host.cc (working copy)
@@ -682,44 +682,29 @@
}
CPError STDCALL CPB_SendMessage(CPID id, const void *data, uint32 data_len) {
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kGearsInRenderer)) {
- ChromePluginLib* plugin = ChromePluginLib::FromCPID(id);
- CHECK(plugin);
+ CHECK(ChromePluginLib::IsPluginThread());
+ ChromePluginLib* plugin = ChromePluginLib::FromCPID(id);
+ CHECK(plugin);
- const unsigned char* data_ptr = static_cast<const unsigned char*>(data);
- std::vector<uint8> v(data_ptr, data_ptr + data_len);
- for (RenderProcessHost::iterator it = RenderProcessHost::begin();
- it != RenderProcessHost::end(); ++it) {
- it->second->Send(new ViewMsg_PluginMessage(plugin->filename(), v));
- }
-
- return CPERR_SUCCESS;
- } else {
- CHECK(ChromePluginLib::IsPluginThread());
- ChromePluginLib* plugin = ChromePluginLib::FromCPID(id);
- CHECK(plugin);
-
- PluginService* service = PluginService::GetInstance();
- if (!service)
+ PluginService* service = PluginService::GetInstance();
+ if (!service)
return CPERR_FAILURE;
- PluginProcessHost *host =
- service->FindOrStartPluginProcess(plugin->filename(), std::string());
- if (!host)
+ PluginProcessHost *host =
+ service->FindOrStartPluginProcess(plugin->filename(), std::string());
Matt Perry 2009/03/13 00:38:15 indent this too please
+ if (!host)
return CPERR_FAILURE;
- const unsigned char* data_ptr = static_cast<const unsigned char*>(data);
- std::vector<uint8> v(data_ptr, data_ptr + data_len);
+ const unsigned char* data_ptr = static_cast<const unsigned char*>(data);
+ std::vector<uint8> v(data_ptr, data_ptr + data_len);
#if defined(OS_WIN)
- if (!host->Send(new PluginProcessMsg_PluginMessage(v)))
- return CPERR_FAILURE;
+ if (!host->Send(new PluginProcessMsg_PluginMessage(v)))
+ return CPERR_FAILURE;
#else
- // TODO(port): Implement PluginProcessMsg.
- NOTIMPLEMENTED();
+ // TODO(port): Implement PluginProcessMsg.
+ NOTIMPLEMENTED();
#endif
- return CPERR_SUCCESS;
- }
+ return CPERR_SUCCESS;
}
CPError STDCALL CPB_SendSyncMessage(CPID id, const void *data, uint32 data_len,
« no previous file with comments | « no previous file | chrome/browser/renderer_host/browser_render_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698