Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(432)

Side by Side Diff: content/browser/plugin_process_host.cc

Issue 1481583002: Narrow the interface to ResourceMessageFilter::GetContexts() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clarify when |origin_pid| argument is used. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 } 415 }
416 sent_requests_.pop_front(); 416 sent_requests_.pop_front();
417 } 417 }
418 418
419 void PluginProcessHost::OnChannelDestroyed(int renderer_id) { 419 void PluginProcessHost::OnChannelDestroyed(int renderer_id) {
420 resource_context_map_[renderer_id].ref_count--; 420 resource_context_map_[renderer_id].ref_count--;
421 if (!resource_context_map_[renderer_id].ref_count) 421 if (!resource_context_map_[renderer_id].ref_count)
422 resource_context_map_.erase(renderer_id); 422 resource_context_map_.erase(renderer_id);
423 } 423 }
424 424
425 void PluginProcessHost::GetContexts(const ResourceHostMsg_Request& request, 425 void PluginProcessHost::GetContexts(ResourceType resource_type,
426 int origin_pid,
426 ResourceContext** resource_context, 427 ResourceContext** resource_context,
427 net::URLRequestContext** request_context) { 428 net::URLRequestContext** request_context) {
428 *resource_context = 429 *resource_context =
429 resource_context_map_[request.origin_pid].resource_context; 430 resource_context_map_[origin_pid].resource_context;
430 *request_context = (*resource_context)->GetRequestContext(); 431 *request_context = (*resource_context)->GetRequestContext();
431 } 432 }
432 433
433 } // namespace content 434 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698