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

Unified Diff: net/url_request/url_request_test_util.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/url_request/url_request_test_util.h ('k') | net/url_request/url_request_unittest.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.cc
diff --git a/net/url_request/url_request_test_util.cc b/net/url_request/url_request_test_util.cc
index e3627c454651c0ea83abbb45c8d0389af2748a80..aedda63c35567fb75e9e6f59f4e15d7e789e67de 100644
--- a/net/url_request/url_request_test_util.cc
+++ b/net/url_request/url_request_test_util.cc
@@ -11,24 +11,13 @@
#include "net/http/http_network_session.h"
TestCookiePolicy::TestCookiePolicy(int options_bit_mask)
- : ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)),
- options_(options_bit_mask),
- callback_(NULL) {
+ : options_(options_bit_mask) {
}
TestCookiePolicy::~TestCookiePolicy() {}
int TestCookiePolicy::CanGetCookies(const GURL& url,
- const GURL& first_party,
- net::CompletionCallback* callback) {
- if ((options_ & ASYNC) && callback) {
- callback_ = callback;
- MessageLoop::current()->PostTask(FROM_HERE,
- method_factory_.NewRunnableMethod(
- &TestCookiePolicy::DoGetCookiesPolicy, url, first_party));
- return net::ERR_IO_PENDING;
- }
-
+ const GURL& first_party) const {
if (options_ & NO_GET_COOKIES)
return net::ERR_ACCESS_DENIED;
@@ -37,17 +26,7 @@ int TestCookiePolicy::CanGetCookies(const GURL& url,
int TestCookiePolicy::CanSetCookie(const GURL& url,
const GURL& first_party,
- const std::string& cookie_line,
- net::CompletionCallback* callback) {
- if ((options_ & ASYNC) && callback) {
- callback_ = callback;
- MessageLoop::current()->PostTask(FROM_HERE,
- method_factory_.NewRunnableMethod(
- &TestCookiePolicy::DoSetCookiePolicy, url, first_party,
- cookie_line));
- return net::ERR_IO_PENDING;
- }
-
+ const std::string& cookie_line) const {
if (options_ & NO_SET_COOKIE)
return net::ERR_ACCESS_DENIED;
@@ -57,28 +36,6 @@ int TestCookiePolicy::CanSetCookie(const GURL& url,
return net::OK;
}
-void TestCookiePolicy::DoGetCookiesPolicy(const GURL& url,
- const GURL& first_party) {
- int policy = CanGetCookies(url, first_party, NULL);
-
- DCHECK(callback_);
- net::CompletionCallback* callback = callback_;
- callback_ = NULL;
- callback->Run(policy);
-}
-
-void TestCookiePolicy::DoSetCookiePolicy(const GURL& url,
- const GURL& first_party,
- const std::string& cookie_line) {
- int policy = CanSetCookie(url, first_party, cookie_line, NULL);
-
- DCHECK(callback_);
- net::CompletionCallback* callback = callback_;
- callback_ = NULL;
- callback->Run(policy);
-}
-
-
TestURLRequestContext::TestURLRequestContext()
: ALLOW_THIS_IN_INITIALIZER_LIST(context_storage_(this)) {
context_storage_.set_host_resolver(
« no previous file with comments | « net/url_request/url_request_test_util.h ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698