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

Side by Side Diff: net/url_request/url_request_test_util.h

Issue 6749044: Remove async functionality from net::CookiePolicy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 9 years, 8 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 | « net/url_request/url_request_http_job.cc ('k') | net/url_request/url_request_test_util.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ 5 #ifndef NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_
6 #define NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ 6 #define NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <stdlib.h> 9 #include <stdlib.h>
10 10
(...skipping 29 matching lines...) Expand all
40 40
41 using base::TimeDelta; 41 using base::TimeDelta;
42 42
43 //----------------------------------------------------------------------------- 43 //-----------------------------------------------------------------------------
44 44
45 class TestCookiePolicy : public net::CookiePolicy { 45 class TestCookiePolicy : public net::CookiePolicy {
46 public: 46 public:
47 enum Options { 47 enum Options {
48 NO_GET_COOKIES = 1 << 0, 48 NO_GET_COOKIES = 1 << 0,
49 NO_SET_COOKIE = 1 << 1, 49 NO_SET_COOKIE = 1 << 1,
50 ASYNC = 1 << 2, 50 FORCE_SESSION = 1 << 2,
51 FORCE_SESSION = 1 << 3,
52 }; 51 };
53 52
54 explicit TestCookiePolicy(int options_bit_mask); 53 explicit TestCookiePolicy(int options_bit_mask);
55 virtual ~TestCookiePolicy(); 54 virtual ~TestCookiePolicy();
56 55
57 // net::CookiePolicy: 56 // net::CookiePolicy:
58 virtual int CanGetCookies(const GURL& url, const GURL& first_party, 57 virtual int CanGetCookies(const GURL& url, const GURL& first_party) const;
59 net::CompletionCallback* callback); 58 virtual int CanSetCookie(const GURL& url,
60 virtual int CanSetCookie(const GURL& url, const GURL& first_party, 59 const GURL& first_party,
61 const std::string& cookie_line, 60 const std::string& cookie_line) const;
62 net::CompletionCallback* callback);
63 61
64 private: 62 private:
65 void DoGetCookiesPolicy(const GURL& url, const GURL& first_party);
66 void DoSetCookiePolicy(const GURL& url, const GURL& first_party,
67 const std::string& cookie_line);
68
69 ScopedRunnableMethodFactory<TestCookiePolicy> method_factory_;
70 int options_; 63 int options_;
71 net::CompletionCallback* callback_;
72 }; 64 };
73 65
74 //----------------------------------------------------------------------------- 66 //-----------------------------------------------------------------------------
75 67
76 class TestURLRequestContext : public net::URLRequestContext { 68 class TestURLRequestContext : public net::URLRequestContext {
77 public: 69 public:
78 TestURLRequestContext(); 70 TestURLRequestContext();
79 explicit TestURLRequestContext(const std::string& proxy); 71 explicit TestURLRequestContext(const std::string& proxy);
80 TestURLRequestContext(const std::string& proxy, 72 TestURLRequestContext(const std::string& proxy,
81 net::HostResolver* host_resolver); 73 net::HostResolver* host_resolver);
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 virtual void OnReadCompleted(net::URLRequest* request, int bytes_read); 202 virtual void OnReadCompleted(net::URLRequest* request, int bytes_read);
211 virtual void OnURLRequestDestroyed(net::URLRequest* request); 203 virtual void OnURLRequestDestroyed(net::URLRequest* request);
212 virtual net::URLRequestJob* OnMaybeCreateURLRequestJob( 204 virtual net::URLRequestJob* OnMaybeCreateURLRequestJob(
213 net::URLRequest* request); 205 net::URLRequest* request);
214 206
215 int last_os_error_; 207 int last_os_error_;
216 int error_count_; 208 int error_count_;
217 }; 209 };
218 210
219 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ 211 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_
OLDNEW
« 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