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

Unified Diff: chrome/browser/net/cookie_policy_browsertest.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 | « chrome/browser/fast_shutdown_uitest.cc ('k') | chrome/browser/net/sqlite_persistent_cookie_store.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/cookie_policy_browsertest.cc
===================================================================
--- chrome/browser/net/cookie_policy_browsertest.cc (revision 99705)
+++ chrome/browser/net/cookie_policy_browsertest.cc (working copy)
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/bind.h"
#include "base/task.h"
#include "base/synchronization/waitable_event.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
@@ -29,12 +30,21 @@
cookies_(cookies) {}
virtual void Run() {
- *cookies_ =
- context_getter_->GetURLRequestContext()->cookie_store()->
- GetCookies(url_);
- event_->Signal();
+ net::CookieOptions options;
+ context_getter_->GetURLRequestContext()->cookie_store()
+ ->GetCookiesWithOptionsAsync(
+ url_, options, base::Bind(&GetCookiesTask::GetCookiesCallback,
+ base::Unretained(cookies_),
+ base::Unretained(event_)));
}
+ static void GetCookiesCallback(std::string* cookies_out,
+ base::WaitableEvent* event,
+ const std::string& cookies) {
+ *cookies_out = cookies;
+ event->Signal();
+ }
+
private:
const GURL& url_;
net::URLRequestContextGetter* const context_getter_;
« no previous file with comments | « chrome/browser/fast_shutdown_uitest.cc ('k') | chrome/browser/net/sqlite_persistent_cookie_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698