summaryrefslogtreecommitdiffstats
path: root/webkit/glue
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-12 00:22:46 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-12 00:22:46 +0000
commitc2d9865134afd8c10f392b3bc0b3e9206f9d87a3 (patch)
tree4e1a015e79f642c51938902e263e1694d7058835 /webkit/glue
parenta0c2a06993ded904d18f29acbce37f896ec82701 (diff)
downloadchromium_src-c2d9865134afd8c10f392b3bc0b3e9206f9d87a3.zip
chromium_src-c2d9865134afd8c10f392b3bc0b3e9206f9d87a3.tar.gz
chromium_src-c2d9865134afd8c10f392b3bc0b3e9206f9d87a3.tar.bz2
Pass the referrer policy with the referrer for the save package code path
BUG=124750 TEST=none. That code path doesn't actually use referrers, it just passes empty GURL()s around. But it might one day. And then it supports referrer policies. Hurray. Review URL: https://chromiumcodereview.appspot.com/10387090 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136723 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r--webkit/glue/dom_operations.cc5
-rw-r--r--webkit/glue/dom_operations.h18
-rw-r--r--webkit/glue/dom_operations_unittest.cc8
3 files changed, 20 insertions, 11 deletions
diff --git a/webkit/glue/dom_operations.cc b/webkit/glue/dom_operations.cc
index 9468f2b..cedf58e 100644
--- a/webkit/glue/dom_operations.cc
+++ b/webkit/glue/dom_operations.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -98,7 +98,8 @@ void GetSavableResourceLinkForElement(
return;
result->resources_list->push_back(u);
// Insert referrer for above new resource link.
- result->referrers_list->push_back(GURL());
+ result->referrer_urls_list->push_back(GURL());
+ result->referrer_policies_list->push_back(WebKit::WebReferrerPolicyDefault);
}
// Get all savable resource links from current WebFrameImpl object pointer.
diff --git a/webkit/glue/dom_operations.h b/webkit/glue/dom_operations.h
index eb99966..bfaa40a 100644
--- a/webkit/glue/dom_operations.h
+++ b/webkit/glue/dom_operations.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -9,6 +9,7 @@
#include <vector>
#include "googleurl/src/gurl.h"
+#include "third_party/WebKit/Source/Platform/chromium/public/WebReferrerPolicy.h"
#include "webkit/glue/webkit_glue_export.h"
namespace WebKit {
@@ -30,16 +31,21 @@ struct SavableResourcesResult {
std::vector<GURL>* resources_list;
// vector which contains corresponding all referral links of sub resource,
// it matched with links one by one.
- std::vector<GURL>* referrers_list;
+ std::vector<GURL>* referrer_urls_list;
+ // and the corresponding referrer policies.
+ std::vector<WebKit::WebReferrerPolicy>* referrer_policies_list;
// vector which contains all savable links of main frame and sub frames.
std::vector<GURL>* frames_list;
// Constructor.
- SavableResourcesResult(std::vector<GURL>* resources_list,
- std::vector<GURL>* referrers_list,
- std::vector<GURL>* frames_list)
+ SavableResourcesResult(
+ std::vector<GURL>* resources_list,
+ std::vector<GURL>* referrer_urls_list,
+ std::vector<WebKit::WebReferrerPolicy>* referrer_policies_list,
+ std::vector<GURL>* frames_list)
: resources_list(resources_list),
- referrers_list(referrers_list),
+ referrer_urls_list(referrer_urls_list),
+ referrer_policies_list(referrer_policies_list),
frames_list(frames_list) { }
private:
diff --git a/webkit/glue/dom_operations_unittest.cc b/webkit/glue/dom_operations_unittest.cc
index 8d8d96b..05aeb76 100644
--- a/webkit/glue/dom_operations_unittest.cc
+++ b/webkit/glue/dom_operations_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -46,10 +46,12 @@ void DomOperationsTests::GetSavableResourceLinksForPage(
test_shell_->WaitTestFinished();
// Get all savable resource links for the page.
std::vector<GURL> resources_list;
- std::vector<GURL> referrers_list;
+ std::vector<GURL> referrer_urls_list;
+ std::vector<WebKit::WebReferrerPolicy> referrer_policies_list;
std::vector<GURL> frames_list;
webkit_glue::SavableResourcesResult result(&resources_list,
- &referrers_list,
+ &referrer_urls_list,
+ &referrer_policies_list,
&frames_list);
const char* savable_schemes[] = {