OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/render_frame_message_filter.h" | 5 #include "content/browser/frame_host/render_frame_message_filter.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 void RenderFrameMessageFilter::GetPluginsCallback( | 479 void RenderFrameMessageFilter::GetPluginsCallback( |
480 IPC::Message* reply_msg, | 480 IPC::Message* reply_msg, |
481 const url::Origin& main_frame_origin, | 481 const url::Origin& main_frame_origin, |
482 const std::vector<WebPluginInfo>& all_plugins) { | 482 const std::vector<WebPluginInfo>& all_plugins) { |
483 // Filter the plugin list. | 483 // Filter the plugin list. |
484 PluginServiceFilter* filter = PluginServiceImpl::GetInstance()->GetFilter(); | 484 PluginServiceFilter* filter = PluginServiceImpl::GetInstance()->GetFilter(); |
485 std::vector<WebPluginInfo> plugins; | 485 std::vector<WebPluginInfo> plugins; |
486 | 486 |
487 int child_process_id = -1; | 487 int child_process_id = -1; |
488 int routing_id = MSG_ROUTING_NONE; | 488 int routing_id = MSG_ROUTING_NONE; |
489 GURL policy_url = | 489 |
| 490 GURL plugin_content_url = |
490 main_frame_origin.unique() ? GURL() : GURL(main_frame_origin.Serialize()); | 491 main_frame_origin.unique() ? GURL() : GURL(main_frame_origin.Serialize()); |
491 // In this loop, copy the WebPluginInfo (and do not use a reference) because | 492 // In this loop, copy the WebPluginInfo (and do not use a reference) because |
492 // the filter might mutate it. | 493 // the filter might mutate it. |
493 for (WebPluginInfo plugin : all_plugins) { | 494 for (WebPluginInfo plugin : all_plugins) { |
494 // TODO(crbug.com/621724): Pass an url::Origin instead of a GURL. | 495 // TODO(crbug.com/621724): Pass an url::Origin instead of a GURL. |
495 if (!filter || | 496 if (!filter || |
496 filter->IsPluginAvailable(child_process_id, routing_id, | 497 filter->IsPluginAvailable(child_process_id, routing_id, |
497 resource_context_, policy_url, policy_url, | 498 resource_context_, plugin_content_url, |
498 &plugin)) { | 499 main_frame_origin, &plugin)) { |
499 plugins.push_back(plugin); | 500 plugins.push_back(plugin); |
500 } | 501 } |
501 } | 502 } |
502 | 503 |
503 FrameHostMsg_GetPlugins::WriteReplyParams(reply_msg, plugins); | 504 FrameHostMsg_GetPlugins::WriteReplyParams(reply_msg, plugins); |
504 Send(reply_msg); | 505 Send(reply_msg); |
505 } | 506 } |
506 | 507 |
507 void RenderFrameMessageFilter::OnGetPluginInfo( | 508 void RenderFrameMessageFilter::OnGetPluginInfo(int render_frame_id, |
508 int render_frame_id, | 509 const GURL& url, |
509 const GURL& url, | 510 const url::Origin& page_url, |
510 const GURL& page_url, | 511 const std::string& mime_type, |
511 const std::string& mime_type, | 512 bool* found, |
512 bool* found, | 513 WebPluginInfo* info, |
513 WebPluginInfo* info, | 514 std::string* actual_mime_type) { |
514 std::string* actual_mime_type) { | |
515 bool allow_wildcard = true; | 515 bool allow_wildcard = true; |
516 *found = plugin_service_->GetPluginInfo( | 516 *found = plugin_service_->GetPluginInfo( |
517 render_process_id_, render_frame_id, resource_context_, | 517 render_process_id_, render_frame_id, resource_context_, |
518 url, page_url, mime_type, allow_wildcard, | 518 url, page_url, mime_type, allow_wildcard, |
519 nullptr, info, actual_mime_type); | 519 nullptr, info, actual_mime_type); |
520 } | 520 } |
521 | 521 |
522 void RenderFrameMessageFilter::OnOpenChannelToPepperPlugin( | 522 void RenderFrameMessageFilter::OnOpenChannelToPepperPlugin( |
523 const base::FilePath& path, | 523 const base::FilePath& path, |
524 IPC::Message* reply_msg) { | 524 IPC::Message* reply_msg) { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 net::URLRequestContext* context = | 599 net::URLRequestContext* context = |
600 GetContentClient()->browser()->OverrideRequestContextForURL( | 600 GetContentClient()->browser()->OverrideRequestContextForURL( |
601 url, resource_context_); | 601 url, resource_context_); |
602 if (!context) | 602 if (!context) |
603 context = request_context_->GetURLRequestContext(); | 603 context = request_context_->GetURLRequestContext(); |
604 | 604 |
605 return context; | 605 return context; |
606 } | 606 } |
607 | 607 |
608 } // namespace content | 608 } // namespace content |
OLD | NEW |