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

Unified Diff: net/url_request/url_request_test_util.h

Issue 6995013: More progress towards removing content settings code from the content layer. We can't use Cookie... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments and sync Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/url_request/url_request_http_job.cc ('k') | net/url_request/url_request_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_test_util.h
===================================================================
--- net/url_request/url_request_test_util.h (revision 84789)
+++ net/url_request/url_request_test_util.h (working copy)
@@ -19,7 +19,6 @@
#include "base/utf_string_conversions.h"
#include "net/base/cert_verifier.h"
#include "net/base/cookie_monster.h"
-#include "net/base/cookie_policy.h"
#include "net/base/host_resolver.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
@@ -45,29 +44,6 @@
//-----------------------------------------------------------------------------
-class TestCookiePolicy : public net::CookiePolicy {
- public:
- enum Options {
- NO_GET_COOKIES = 1 << 0,
- NO_SET_COOKIE = 1 << 1,
- FORCE_SESSION = 1 << 2,
- };
-
- explicit TestCookiePolicy(int options_bit_mask);
- virtual ~TestCookiePolicy();
-
- // net::CookiePolicy:
- virtual int CanGetCookies(const GURL& url, const GURL& first_party) const;
- virtual int CanSetCookie(const GURL& url,
- const GURL& first_party,
- const std::string& cookie_line) const;
-
- private:
- int options_;
-};
-
-//-----------------------------------------------------------------------------
-
class TestURLRequestContext : public net::URLRequestContext {
public:
TestURLRequestContext();
@@ -96,6 +72,12 @@
class TestDelegate : public net::URLRequest::Delegate {
public:
+ enum Options {
+ NO_GET_COOKIES = 1 << 0,
+ NO_SET_COOKIE = 1 << 1,
+ FORCE_SESSION = 1 << 2,
+ };
+
TestDelegate();
virtual ~TestDelegate();
@@ -116,6 +98,7 @@
void set_allow_certificate_errors(bool val) {
allow_certificate_errors_ = val;
}
+ void set_cookie_options(int o) {cookie_options_bit_mask_ = o; }
void set_username(const string16& u) { username_ = u; }
void set_password(const string16& p) { password_ = p; }
@@ -135,19 +118,19 @@
// net::URLRequest::Delegate:
virtual void OnReceivedRedirect(net::URLRequest* request, const GURL& new_url,
- bool* defer_redirect);
+ bool* defer_redirect) OVERRIDE;
virtual void OnAuthRequired(net::URLRequest* request,
- net::AuthChallengeInfo* auth_info);
+ net::AuthChallengeInfo* auth_info) OVERRIDE;
virtual void OnSSLCertificateError(net::URLRequest* request,
int cert_error,
- net::X509Certificate* cert);
- virtual void OnGetCookies(net::URLRequest* request, bool blocked_by_policy);
- virtual void OnSetCookie(net::URLRequest* request,
- const std::string& cookie_line,
- const net::CookieOptions& options,
- bool blocked_by_policy);
- virtual void OnResponseStarted(net::URLRequest* request);
- virtual void OnReadCompleted(net::URLRequest* request, int bytes_read);
+ net::X509Certificate* cert) OVERRIDE;
+ virtual bool CanGetCookies(net::URLRequest* request) OVERRIDE;
+ virtual bool CanSetCookie(net::URLRequest* request,
+ const std::string& cookie_line,
+ net::CookieOptions* options) OVERRIDE;
+ virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE;
+ virtual void OnReadCompleted(net::URLRequest* request,
+ int bytes_read) OVERRIDE;
private:
static const int kBufferSize = 4096;
@@ -164,6 +147,7 @@
bool quit_on_complete_;
bool quit_on_redirect_;
bool allow_certificate_errors_;
+ int cookie_options_bit_mask_;
string16 username_;
string16 password_;
« no previous file with comments | « net/url_request/url_request_http_job.cc ('k') | net/url_request/url_request_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698