| Index: content/browser/plugin_process_host.cc
|
| diff --git a/content/browser/plugin_process_host.cc b/content/browser/plugin_process_host.cc
|
| index b2a2a3a4cf7118185e52606194d0529db5d188ae..25cdc7508bed5ceefe8190e825db9bfb0c2d7561 100644
|
| --- a/content/browser/plugin_process_host.cc
|
| +++ b/content/browser/plugin_process_host.cc
|
| @@ -21,12 +21,10 @@
|
| #include "base/string_util.h"
|
| #include "base/utf_string_conversions.h"
|
| #include "chrome/browser/browser_process.h"
|
| -#include "chrome/browser/chrome_plugin_browsing_context.h"
|
| #include "chrome/browser/net/url_request_tracking.h"
|
| #include "chrome/browser/plugin_download_helper.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/common/chrome_paths.h"
|
| -#include "chrome/common/chrome_plugin_lib.h"
|
| #include "chrome/common/chrome_switches.h"
|
| #include "chrome/common/logging_chrome.h"
|
| #include "chrome/common/net/url_request_context_getter.h"
|
| @@ -34,13 +32,11 @@
|
| #include "chrome/common/render_messages.h"
|
| #include "chrome/common/render_messages_params.h"
|
| #include "content/browser/browser_thread.h"
|
| -#include "content/browser/child_process_security_policy.h"
|
| #include "content/browser/plugin_service.h"
|
| #include "content/browser/renderer_host/resource_dispatcher_host.h"
|
| #include "content/browser/renderer_host/resource_message_filter.h"
|
| #include "content/common/resource_messages.h"
|
| #include "ipc/ipc_switches.h"
|
| -#include "net/base/cookie_store.h"
|
| #include "net/base/io_buffer.h"
|
| #include "net/url_request/url_request.h"
|
| #include "net/url_request/url_request_context.h"
|
| @@ -60,28 +56,6 @@
|
| static const char kDefaultPluginFinderURL[] =
|
| "https://dl-ssl.google.com/edgedl/chrome/plugins/plugins2.xml";
|
|
|
| -namespace {
|
| -
|
| -// Helper class that we pass to ResourceMessageFilter so that it can find the
|
| -// right net::URLRequestContext for a request.
|
| -class PluginURLRequestContextOverride
|
| - : public ResourceMessageFilter::URLRequestContextOverride {
|
| - public:
|
| - PluginURLRequestContextOverride() {
|
| - }
|
| -
|
| - virtual net::URLRequestContext* GetRequestContext(
|
| - const ResourceHostMsg_Request& resource_request) {
|
| - return CPBrowsingContextManager::GetInstance()->ToURLRequestContext(
|
| - resource_request.request_context);
|
| - }
|
| -
|
| - private:
|
| - virtual ~PluginURLRequestContextOverride() {}
|
| -};
|
| -
|
| -} // namespace
|
| -
|
| #if defined(OS_WIN)
|
| void PluginProcessHost::OnPluginWindowDestroyed(HWND window, HWND parent) {
|
| // The window is destroyed at this point, we just care about its parent, which
|
| @@ -121,8 +95,7 @@ void PluginProcessHost::OnMapNativeViewId(gfx::NativeViewId id,
|
| PluginProcessHost::PluginProcessHost()
|
| : BrowserChildProcessHost(
|
| PLUGIN_PROCESS,
|
| - PluginService::GetInstance()->resource_dispatcher_host(),
|
| - new PluginURLRequestContextOverride()),
|
| + PluginService::GetInstance()->resource_dispatcher_host()),
|
| ALLOW_THIS_IN_INITIALIZER_LIST(resolve_proxy_msg_helper_(this, NULL))
|
| #if defined(OS_MACOSX)
|
| , plugin_cursor_visible_(true)
|
| @@ -241,12 +214,6 @@ bool PluginProcessHost::Init(const webkit::npapi::WebPluginInfo& info,
|
| cmd_line->AppendSwitchASCII(switches::kLang, locale);
|
| }
|
|
|
| - // Gears requires the data dir to be available on startup.
|
| - FilePath data_dir =
|
| - PluginService::GetInstance()->GetChromePluginDataDir();
|
| - DCHECK(!data_dir.empty());
|
| - cmd_line->AppendSwitchPath(switches::kPluginDataDir, data_dir);
|
| -
|
| cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id());
|
|
|
| SetCrashReporterCommandLine(cmd_line);
|
| @@ -287,28 +254,12 @@ void PluginProcessHost::ForceShutdown() {
|
| BrowserChildProcessHost::ForceShutdown();
|
| }
|
|
|
| -void PluginProcessHost::OnProcessLaunched() {
|
| - FilePath gears_path;
|
| - if (PathService::Get(chrome::FILE_GEARS_PLUGIN, &gears_path)) {
|
| - FilePath::StringType gears_path_lc = StringToLowerASCII(gears_path.value());
|
| - FilePath::StringType plugin_path_lc =
|
| - StringToLowerASCII(info_.path.value());
|
| - if (plugin_path_lc == gears_path_lc) {
|
| - // Give Gears plugins "background" priority. See http://b/1280317.
|
| - SetProcessBackgrounded();
|
| - }
|
| - }
|
| -}
|
| -
|
| bool PluginProcessHost::OnMessageReceived(const IPC::Message& msg) {
|
| bool handled = true;
|
| IPC_BEGIN_MESSAGE_MAP(PluginProcessHost, msg)
|
| IPC_MESSAGE_HANDLER(PluginProcessHostMsg_ChannelCreated, OnChannelCreated)
|
| IPC_MESSAGE_HANDLER(PluginProcessHostMsg_GetPluginFinderUrl,
|
| OnGetPluginFinderUrl)
|
| - IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginMessage, OnPluginMessage)
|
| - IPC_MESSAGE_HANDLER(PluginProcessHostMsg_GetCookies, OnGetCookies)
|
| - IPC_MESSAGE_HANDLER(PluginProcessHostMsg_AccessFiles, OnAccessFiles)
|
| IPC_MESSAGE_HANDLER_DELAY_REPLY(PluginProcessHostMsg_ResolveProxy,
|
| OnResolveProxy)
|
| #if defined(OS_WIN)
|
| @@ -379,43 +330,6 @@ void PluginProcessHost::OpenChannelToPlugin(Client* client) {
|
| RequestPluginChannel(client);
|
| }
|
|
|
| -void PluginProcessHost::OnGetCookies(uint32 request_context,
|
| - const GURL& url,
|
| - std::string* cookies) {
|
| - net::URLRequestContext* context = CPBrowsingContextManager::GetInstance()->
|
| - ToURLRequestContext(request_context);
|
| - // TODO(mpcomplete): remove fallback case when Gears support is prevalent.
|
| - if (!context)
|
| - context = Profile::GetDefaultRequestContext()->GetURLRequestContext();
|
| -
|
| - // Note: We don't have a first_party_for_cookies check because plugins bypass
|
| - // third-party cookie blocking.
|
| - if (context && context->cookie_store()) {
|
| - *cookies = context->cookie_store()->GetCookies(url);
|
| - } else {
|
| - DLOG(ERROR) << "Could not serve plugin cookies request.";
|
| - cookies->clear();
|
| - }
|
| -}
|
| -
|
| -void PluginProcessHost::OnAccessFiles(int renderer_id,
|
| - const std::vector<std::string>& files,
|
| - bool* allowed) {
|
| - ChildProcessSecurityPolicy* policy =
|
| - ChildProcessSecurityPolicy::GetInstance();
|
| -
|
| - for (size_t i = 0; i < files.size(); ++i) {
|
| - const FilePath path = FilePath::FromWStringHack(UTF8ToWide(files[i]));
|
| - if (!policy->CanReadFile(renderer_id, path)) {
|
| - VLOG(1) << "Denied unauthorized request for file " << files[i];
|
| - *allowed = false;
|
| - return;
|
| - }
|
| - }
|
| -
|
| - *allowed = true;
|
| -}
|
| -
|
| void PluginProcessHost::OnResolveProxy(const GURL& url,
|
| IPC::Message* reply_msg) {
|
| resolve_proxy_msg_helper_.Start(url, reply_msg);
|
| @@ -469,15 +383,3 @@ void PluginProcessHost::OnGetPluginFinderUrl(std::string* plugin_finder_url) {
|
| plugin_finder_url->clear();
|
| }
|
| }
|
| -
|
| -void PluginProcessHost::OnPluginMessage(
|
| - const std::vector<uint8>& data) {
|
| - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| -
|
| - ChromePluginLib *chrome_plugin = ChromePluginLib::Find(info_.path);
|
| - if (chrome_plugin) {
|
| - void *data_ptr = const_cast<void*>(reinterpret_cast<const void*>(&data[0]));
|
| - uint32 data_len = static_cast<uint32>(data.size());
|
| - chrome_plugin->functions().on_message(data_ptr, data_len);
|
| - }
|
| -}
|
|
|