| 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 // OnChannelError notification indicating that the browser plugin channel has | 234 // OnChannelError notification indicating that the browser plugin channel has |
| 235 // been destroyed. | 235 // been destroyed. |
| 236 process_->SetTerminateChildOnShutdown(false); | 236 process_->SetTerminateChildOnShutdown(false); |
| 237 | 237 |
| 238 ResourceMessageFilter::GetContextsCallback get_contexts_callback( | 238 ResourceMessageFilter::GetContextsCallback get_contexts_callback( |
| 239 base::Bind(&PluginProcessHost::GetContexts, | 239 base::Bind(&PluginProcessHost::GetContexts, |
| 240 base::Unretained(this))); | 240 base::Unretained(this))); |
| 241 | 241 |
| 242 // TODO(jam): right now we're passing NULL for appcache, blob storage, and | 242 // TODO(jam): right now we're passing NULL for appcache, blob storage, and |
| 243 // file system. If NPAPI plugins actually use this, we'll have to plumb them. | 243 // file system. If NPAPI plugins actually use this, we'll have to plumb them. |
| 244 // TODO(wjmaclean): we're also passing NULL for the host zoom level context. |
| 244 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter( | 245 ResourceMessageFilter* resource_message_filter = new ResourceMessageFilter( |
| 245 process_->GetData().id, PROCESS_TYPE_PLUGIN, NULL, NULL, NULL, NULL, | 246 process_->GetData().id, PROCESS_TYPE_PLUGIN, NULL, NULL, NULL, NULL, NULL, |
| 246 get_contexts_callback); | 247 get_contexts_callback); |
| 247 process_->AddFilter(resource_message_filter); | 248 process_->AddFilter(resource_message_filter); |
| 248 return true; | 249 return true; |
| 249 } | 250 } |
| 250 | 251 |
| 251 void PluginProcessHost::ForceShutdown() { | 252 void PluginProcessHost::ForceShutdown() { |
| 252 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 253 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 253 Send(new PluginProcessMsg_NotifyRenderersOfPendingShutdown()); | 254 Send(new PluginProcessMsg_NotifyRenderersOfPendingShutdown()); |
| 254 process_->ForceShutdown(); | 255 process_->ForceShutdown(); |
| 255 } | 256 } |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 | 398 |
| 398 void PluginProcessHost::GetContexts(const ResourceHostMsg_Request& request, | 399 void PluginProcessHost::GetContexts(const ResourceHostMsg_Request& request, |
| 399 ResourceContext** resource_context, | 400 ResourceContext** resource_context, |
| 400 net::URLRequestContext** request_context) { | 401 net::URLRequestContext** request_context) { |
| 401 *resource_context = | 402 *resource_context = |
| 402 resource_context_map_[request.origin_pid].resource_context; | 403 resource_context_map_[request.origin_pid].resource_context; |
| 403 *request_context = (*resource_context)->GetRequestContext(); | 404 *request_context = (*resource_context)->GetRequestContext(); |
| 404 } | 405 } |
| 405 | 406 |
| 406 } // namespace content | 407 } // namespace content |
| OLD | NEW |