Commit b3aa6a4a authored by koz@chromium.org's avatar koz@chromium.org

Revert 111566 - Breaks compile on win dbg.

Add a referrer class to be used in the browser process whenever passing around referrers

TBR=jochen

Review URL: http://codereview.chromium.org/8690007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111574 0039d316-1c4b-4281-b951-d872f2087c98
parent 66a2bd78
// Copyright (c) 2011 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.
#include "testing/gtest/include/gtest/gtest.h"
#include "content/public/common/referrer.h"
namespace {
const char* kTestURL = "http://google.com/";
// Check that copying Referrer objects works.
TEST(ReferrerTest, Copy) {
content::Referrer r1(GURL(kTestURL), WebKit::WebReferrerPolicyAlways);
content::Referrer r2;
r2 = r1;
EXPECT_EQ(GURL(kTestURL), r2.url);
EXPECT_EQ(WebKit::WebReferrerPolicyAlways, r2.policy);
}
} // namespace
......@@ -51,7 +51,6 @@
'public/common/page_zoom.h',
'public/common/pepper_plugin_info.cc',
'public/common/pepper_plugin_info.h',
'public/common/referrer.h',
'public/common/renderer_preferences.cc',
'public/common/renderer_preferences.h',
'public/common/resource_dispatcher_delegate.h',
......
......@@ -229,7 +229,6 @@
'common/hi_res_timer_manager_unittest.cc',
'common/net/url_fetcher_impl_unittest.cc',
'common/page_zoom_unittest.cc',
'common/referrer_unittest.cc',
'common/resource_dispatcher_unittest.cc',
'gpu/gpu_info_collector_unittest.cc',
'gpu/gpu_info_collector_unittest_win.cc',
......
// Copyright (c) 2011 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.
#ifndef CONTENT_PUBLIC_COMMON_REFERRER_H_
#define CONTENT_PUBLIC_COMMON_REFERRER_H_
#pragma once
#include "content/common/content_export.h"
#include "googleurl/src/gurl.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebReferrerPolicy.h"
namespace content {
// This struct holds a referrer URL, as well as the referrer policy to be
// applied to this URL. When passing around referrers that will eventually end
// up being used for URL requests, always use this struct.
struct CONTENT_EXPORT Referrer {
Referrer(const GURL& url, WebKit::WebReferrerPolicy policy)
: url(url),
policy(policy) {
}
Referrer()
: policy(WebKit::WebReferrerPolicyDefault) {
}
GURL url;
WebKit::WebReferrerPolicy policy;
};
} // namespace content
#endif // CONTENT_PUBLIC_COMMON_REFERRER_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment