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

Unified Diff: webkit/tools/test_shell/simple_resource_loader_bridge.cc

Issue 7833042: Finalize a CL originally by departed intern ycxiao@ that detaches the loading of cookies from the... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/simple_resource_loader_bridge.cc
===================================================================
--- webkit/tools/test_shell/simple_resource_loader_bridge.cc (revision 99705)
+++ webkit/tools/test_shell/simple_resource_loader_bridge.cc (working copy)
@@ -32,6 +32,7 @@
#include "webkit/tools/test_shell/simple_resource_loader_bridge.h"
+#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/file_path.h"
#include "base/file_util.h"
@@ -745,10 +746,13 @@
public:
void Set(const GURL& url, const std::string& cookie) {
DCHECK(MessageLoop::current() == g_io_thread->message_loop());
- g_request_context->cookie_store()->SetCookie(url, cookie);
+ g_request_context->cookie_store()->SetCookieWithOptionsAsync(
+ url, cookie, net::CookieOptions(),
+ net::CookieStore::SetCookiesCallback());
}
private:
+
friend class base::RefCountedThreadSafe<CookieSetter>;
~CookieSetter() {}
@@ -760,8 +764,9 @@
}
void Get(const GURL& url) {
- result_ = g_request_context->cookie_store()->GetCookies(url);
- event_.Signal();
+ g_request_context->cookie_store()->GetCookiesWithOptionsAsync(
+ url, net::CookieOptions(),
+ base::Bind(&CookieGetter::OnGetCookies, this));
}
std::string GetResult() {
@@ -771,6 +776,10 @@
}
private:
+ void OnGetCookies(const std::string& cookie_line) {
+ result_ = cookie_line;
+ event_.Signal();
+ }
friend class base::RefCountedThreadSafe<CookieGetter>;
~CookieGetter() {}
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698