| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/plugin_process_host.h" | 5 #include "content/browser/plugin_process_host.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #elif defined(OS_POSIX) | 9 #elif defined(OS_POSIX) |
| 10 #include <utility> // for pair<> | 10 #include <utility> // for pair<> |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 | 241 |
| 242 std::string locale = GetContentClient()->browser()->GetApplicationLocale(); | 242 std::string locale = GetContentClient()->browser()->GetApplicationLocale(); |
| 243 if (!locale.empty()) { | 243 if (!locale.empty()) { |
| 244 // Pass on the locale so the null plugin will use the right language in the | 244 // Pass on the locale so the null plugin will use the right language in the |
| 245 // prompt to install the desired plugin. | 245 // prompt to install the desired plugin. |
| 246 cmd_line->AppendSwitchASCII(switches::kLang, locale); | 246 cmd_line->AppendSwitchASCII(switches::kLang, locale); |
| 247 } | 247 } |
| 248 | 248 |
| 249 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); | 249 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); |
| 250 | 250 |
| 251 process_->Launch( | |
| 252 new PluginSandboxedProcessLauncherDelegate(process_->GetHost()), | |
| 253 cmd_line); | |
| 254 | |
| 255 // The plugin needs to be shutdown gracefully, i.e. NP_Shutdown needs to be | 251 // The plugin needs to be shutdown gracefully, i.e. NP_Shutdown needs to be |
| 256 // called on the plugin. The plugin process exits when it receives the | 252 // called on the plugin. The plugin process exits when it receives the |
| 257 // OnChannelError notification indicating that the browser plugin channel has | 253 // OnChannelError notification indicating that the browser plugin channel has |
| 258 // been destroyed. | 254 // been destroyed. |
| 259 process_->SetTerminateChildOnShutdown(false); | 255 bool terminate_on_shutdown = false; |
| 256 process_->Launch( |
| 257 new PluginSandboxedProcessLauncherDelegate(process_->GetHost()), |
| 258 cmd_line, |
| 259 terminate_on_shutdown); |
| 260 | 260 |
| 261 ResourceMessageFilter::GetContextsCallback get_contexts_callback( | 261 ResourceMessageFilter::GetContextsCallback get_contexts_callback( |
| 262 base::Bind(&PluginProcessHost::GetContexts, | 262 base::Bind(&PluginProcessHost::GetContexts, |
| 263 base::Unretained(this))); | 263 base::Unretained(this))); |
| 264 | 264 |
| 265 // TODO(jam): right now we're passing NULL for appcache, blob storage, file | 265 // TODO(jam): right now we're passing NULL for appcache, blob storage, file |
| 266 // system and host zoom level context. If NPAPI plugins actually use this, | 266 // system and host zoom level context. If NPAPI plugins actually use this, |
| 267 // we'll have to plumb them. | 267 // we'll have to plumb them. |
| 268 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter( | 268 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter( |
| 269 process_->GetData().id, PROCESS_TYPE_PLUGIN, NULL, NULL, NULL, NULL, NULL, | 269 process_->GetData().id, PROCESS_TYPE_PLUGIN, NULL, NULL, NULL, NULL, NULL, |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 | 427 |
| 428 void PluginProcessHost::GetContexts(const ResourceHostMsg_Request& request, | 428 void PluginProcessHost::GetContexts(const ResourceHostMsg_Request& request, |
| 429 ResourceContext** resource_context, | 429 ResourceContext** resource_context, |
| 430 net::URLRequestContext** request_context) { | 430 net::URLRequestContext** request_context) { |
| 431 *resource_context = | 431 *resource_context = |
| 432 resource_context_map_[request.origin_pid].resource_context; | 432 resource_context_map_[request.origin_pid].resource_context; |
| 433 *request_context = (*resource_context)->GetRequestContext(); | 433 *request_context = (*resource_context)->GetRequestContext(); |
| 434 } | 434 } |
| 435 | 435 |
| 436 } // namespace content | 436 } // namespace content |
| OLD | NEW |