diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-13 00:18:06 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-13 00:18:06 +0000 |
commit | 88a1fb47ae5abed1c518cdb63836199431ac5af7 (patch) | |
tree | 6bd2be5124623c48546122c80b94a3b203352fe1 /chrome/browser | |
parent | 226183d33f7e52d01d38cad1cfb2e70b938ae74e (diff) | |
download | chromium_src-88a1fb47ae5abed1c518cdb63836199431ac5af7.zip chromium_src-88a1fb47ae5abed1c518cdb63836199431ac5af7.tar.gz chromium_src-88a1fb47ae5abed1c518cdb63836199431ac5af7.tar.bz2 |
Get rid of the gears in renderer process code. This allows me to do some cleanup in how resource dispatching happens in a future cl.
Review URL: http://codereview.chromium.org/42158
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11601 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/chrome_plugin_host.cc | 45 | ||||
-rw-r--r-- | chrome/browser/renderer_host/browser_render_process_host.cc | 8 | ||||
-rw-r--r-- | chrome/browser/sandbox_policy.cc | 31 | ||||
-rw-r--r-- | chrome/browser/sandbox_policy.h | 3 |
4 files changed, 15 insertions, 72 deletions
diff --git a/chrome/browser/chrome_plugin_host.cc b/chrome/browser/chrome_plugin_host.cc index ed801e6..7372796 100644 --- a/chrome/browser/chrome_plugin_host.cc +++ b/chrome/browser/chrome_plugin_host.cc @@ -682,44 +682,29 @@ CPProcessType STDCALL CPB_GetProcessType(CPID id) { } 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); - - 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); + 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()); + 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, diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index 4a525a7..877e0a7 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -261,7 +261,6 @@ bool BrowserRenderProcessHost::Init() { switches::kSilentDumpOnDCHECK, switches::kDisablePopupBlocking, switches::kUseLowFragHeapCrt, - switches::kGearsInRenderer, switches::kEnableVideo, }; @@ -362,13 +361,6 @@ bool BrowserRenderProcessHost::Init() { return false; } - if (browser_command_line.HasSwitch(switches::kGearsInRenderer)) { - if (!AddPolicyForGearsInRenderer(policy)) { - NOTREACHED(); - return false; - } - } - if (!AddDllEvictionPolicy(policy)) { NOTREACHED(); return false; diff --git a/chrome/browser/sandbox_policy.cc b/chrome/browser/sandbox_policy.cc index 8d39650..d491aff 100644 --- a/chrome/browser/sandbox_policy.cc +++ b/chrome/browser/sandbox_policy.cc @@ -161,37 +161,6 @@ bool AddDllEvictionPolicy(sandbox::TargetPolicy* policy) { return true; } -bool AddPolicyForGearsInRenderer(sandbox::TargetPolicy* policy) { - sandbox::ResultCode result; - - // TODO(mpcomplete): need to restrict access to database files only. This - // is just temporary for debugging purposes. - std::wstring plugin_data; - if (!PathService::Get(chrome::DIR_USER_DATA, &plugin_data)) - return false; - if (!win_util::ConvertToLongPath(plugin_data, &plugin_data)) - return false; - - file_util::AppendToPath(&plugin_data, L"*"); - result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, - sandbox::TargetPolicy::FILES_ALLOW_ANY, - plugin_data.c_str()); - if (result != sandbox::SBOX_ALL_OK) - return false; - - std::wstring temppath; - if (!file_util::GetTempDir(&temppath)) - return false; - file_util::AppendToPath(&temppath, L"*"); - result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, - sandbox::TargetPolicy::FILES_ALLOW_ANY, - temppath.c_str()); - if (result != sandbox::SBOX_ALL_OK) - return false; - - return true; -} - bool AddGenericPolicy(sandbox::TargetPolicy* policy) { sandbox::ResultCode result; diff --git a/chrome/browser/sandbox_policy.h b/chrome/browser/sandbox_policy.h index f0e3346..393e4bf 100644 --- a/chrome/browser/sandbox_policy.h +++ b/chrome/browser/sandbox_policy.h @@ -17,9 +17,6 @@ bool AddGenericPolicy(sandbox::TargetPolicy* policy); // Adds policy rules for unloaded the known dlls that cause chrome to crash. bool AddDllEvictionPolicy(sandbox::TargetPolicy* policy); -// Adds policy rules for running Gears in the renderer process. -bool AddPolicyForGearsInRenderer(sandbox::TargetPolicy* policy); - // Adds the custom policy rules for a given plugin. If dll is activex-shim, // then clsid is the clsid of ActiveX control. Otherwise clsid is ignored. // |trusted_plugins| contains the comma separate list of plugins that should |