| 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 // The plugin needs to be shutdown gracefully, i.e. NP_Shutdown needs to be | 256 // The plugin needs to be shutdown gracefully, i.e. NP_Shutdown needs to be |
| 257 // called on the plugin. The plugin process exits when it receives the | 257 // called on the plugin. The plugin process exits when it receives the |
| 258 // OnChannelError notification indicating that the browser plugin channel has | 258 // OnChannelError notification indicating that the browser plugin channel has |
| 259 // been destroyed. | 259 // been destroyed. |
| 260 process_->SetTerminateChildOnShutdown(false); | 260 process_->SetTerminateChildOnShutdown(false); |
| 261 | 261 |
| 262 ResourceMessageFilter::GetContextsCallback get_contexts_callback( | 262 ResourceMessageFilter::GetContextsCallback get_contexts_callback( |
| 263 base::Bind(&PluginProcessHost::GetContexts, | 263 base::Bind(&PluginProcessHost::GetContexts, |
| 264 base::Unretained(this))); | 264 base::Unretained(this))); |
| 265 | 265 |
| 266 // TODO(jam): right now we're passing NULL for appcache, blob storage, and | 266 // TODO(jam): right now we're passing NULL for appcache, blob storage, file |
| 267 // file system. If NPAPI plugins actually use this, we'll have to plumb them. | 267 // system and host zoom level context. If NPAPI plugins actually use this, |
| 268 // we'll have to plumb them. |
| 268 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter( | 269 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter( |
| 269 process_->GetData().id, PROCESS_TYPE_PLUGIN, NULL, NULL, NULL, NULL, | 270 process_->GetData().id, PROCESS_TYPE_PLUGIN, NULL, NULL, NULL, NULL, NULL, |
| 270 get_contexts_callback); | 271 get_contexts_callback); |
| 271 process_->AddFilter(resource_message_filter); | 272 process_->AddFilter(resource_message_filter); |
| 272 return true; | 273 return true; |
| 273 } | 274 } |
| 274 | 275 |
| 275 void PluginProcessHost::ForceShutdown() { | 276 void PluginProcessHost::ForceShutdown() { |
| 276 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 277 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 277 Send(new PluginProcessMsg_NotifyRenderersOfPendingShutdown()); | 278 Send(new PluginProcessMsg_NotifyRenderersOfPendingShutdown()); |
| 278 process_->ForceShutdown(); | 279 process_->ForceShutdown(); |
| 279 } | 280 } |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 | 428 |
| 428 void PluginProcessHost::GetContexts(const ResourceHostMsg_Request& request, | 429 void PluginProcessHost::GetContexts(const ResourceHostMsg_Request& request, |
| 429 ResourceContext** resource_context, | 430 ResourceContext** resource_context, |
| 430 net::URLRequestContext** request_context) { | 431 net::URLRequestContext** request_context) { |
| 431 *resource_context = | 432 *resource_context = |
| 432 resource_context_map_[request.origin_pid].resource_context; | 433 resource_context_map_[request.origin_pid].resource_context; |
| 433 *request_context = (*resource_context)->GetRequestContext(); | 434 *request_context = (*resource_context)->GetRequestContext(); |
| 434 } | 435 } |
| 435 | 436 |
| 436 } // namespace content | 437 } // namespace content |
| OLD | NEW |