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