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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 10387090: Pass the referrer policy with the referrer for the save package code path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 8 years, 7 months 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 | Annotate | Revision Log
« no previous file with comments | « content/common/view_messages.h ('k') | webkit/glue/dom_operations.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 4408 matching lines...) Expand 10 before | Expand all | Expand 10 after
4419 void RenderViewImpl::OnPluginActionAt(const gfx::Point& location, 4419 void RenderViewImpl::OnPluginActionAt(const gfx::Point& location,
4420 const WebPluginAction& action) { 4420 const WebPluginAction& action) {
4421 if (webview()) 4421 if (webview())
4422 webview()->performPluginAction(action, location); 4422 webview()->performPluginAction(action, location);
4423 } 4423 }
4424 4424
4425 void RenderViewImpl::OnGetAllSavableResourceLinksForCurrentPage( 4425 void RenderViewImpl::OnGetAllSavableResourceLinksForCurrentPage(
4426 const GURL& page_url) { 4426 const GURL& page_url) {
4427 // Prepare list to storage all savable resource links. 4427 // Prepare list to storage all savable resource links.
4428 std::vector<GURL> resources_list; 4428 std::vector<GURL> resources_list;
4429 std::vector<GURL> referrers_list; 4429 std::vector<GURL> referrer_urls_list;
4430 std::vector<WebKit::WebReferrerPolicy> referrer_policies_list;
4430 std::vector<GURL> frames_list; 4431 std::vector<GURL> frames_list;
4431 webkit_glue::SavableResourcesResult result(&resources_list, 4432 webkit_glue::SavableResourcesResult result(&resources_list,
4432 &referrers_list, 4433 &referrer_urls_list,
4434 &referrer_policies_list,
4433 &frames_list); 4435 &frames_list);
4434 4436
4435 // FIXME(rdsmith): When GetAllSavableResourceLinksForCurrentPage starts to 4437 // webkit/ doesn't know about content::Referrer.
4436 // return referrers, it should also return the referrer policies.
4437 if (!webkit_glue::GetAllSavableResourceLinksForCurrentPage( 4438 if (!webkit_glue::GetAllSavableResourceLinksForCurrentPage(
4438 webview(), 4439 webview(),
4439 page_url, 4440 page_url,
4440 &result, 4441 &result,
4441 content::GetSavableSchemes())) { 4442 content::GetSavableSchemes())) {
4442 // If something is wrong when collecting all savable resource links, 4443 // If something is wrong when collecting all savable resource links,
4443 // send empty list to embedder(browser) to tell it failed. 4444 // send empty list to embedder(browser) to tell it failed.
4444 referrers_list.clear(); 4445 referrer_urls_list.clear();
4446 referrer_policies_list.clear();
4445 resources_list.clear(); 4447 resources_list.clear();
4446 frames_list.clear(); 4448 frames_list.clear();
4447 } 4449 }
4448 4450
4451 std::vector<content::Referrer> referrers_list;
4452 for (unsigned i = 0; i < referrer_urls_list.size(); ++i) {
4453 referrers_list.push_back(
4454 content::Referrer(referrer_urls_list[i], referrer_policies_list[i]));
benjhayden 2012/05/11 23:05:37 Do you want to defend against referrer_policies_li
4455 }
4456
4449 // Send result of all savable resource links to embedder. 4457 // Send result of all savable resource links to embedder.
4450 Send(new ViewHostMsg_SendCurrentPageAllSavableResourceLinks(routing_id(), 4458 Send(new ViewHostMsg_SendCurrentPageAllSavableResourceLinks(routing_id(),
4451 resources_list, 4459 resources_list,
4452 referrers_list, 4460 referrers_list,
4453 frames_list)); 4461 frames_list));
4454 } 4462 }
4455 4463
4456 void RenderViewImpl::OnGetSerializedHtmlDataForCurrentPageWithLocalLinks( 4464 void RenderViewImpl::OnGetSerializedHtmlDataForCurrentPageWithLocalLinks(
4457 const std::vector<GURL>& links, 4465 const std::vector<GURL>& links,
4458 const std::vector<FilePath>& local_paths, 4466 const std::vector<FilePath>& local_paths,
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
5311 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { 5319 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const {
5312 return !!RenderThreadImpl::current()->compositor_thread(); 5320 return !!RenderThreadImpl::current()->compositor_thread();
5313 } 5321 }
5314 5322
5315 void RenderViewImpl::OnJavaBridgeInit() { 5323 void RenderViewImpl::OnJavaBridgeInit() {
5316 DCHECK(!java_bridge_dispatcher_.get()); 5324 DCHECK(!java_bridge_dispatcher_.get());
5317 #if defined(ENABLE_JAVA_BRIDGE) 5325 #if defined(ENABLE_JAVA_BRIDGE)
5318 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); 5326 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this));
5319 #endif 5327 #endif
5320 } 5328 }
OLDNEW
« no previous file with comments | « content/common/view_messages.h ('k') | webkit/glue/dom_operations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698