summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell/simple_resource_loader_bridge.cc
diff options
context:
space:
mode:
authorerikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-13 17:38:38 +0000
committererikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-13 17:38:38 +0000
commit218aa6a199672545356f7fd49c7937b3272fdac6 (patch)
tree6cb100bbc31e79cae1708214b277f0ba97afa7d2 /webkit/tools/test_shell/simple_resource_loader_bridge.cc
parent41eccabc09eca87bfedc1f8c7b70370ec1d3b8b5 (diff)
downloadchromium_src-218aa6a199672545356f7fd49c7937b3272fdac6.zip
chromium_src-218aa6a199672545356f7fd49c7937b3272fdac6.tar.gz
chromium_src-218aa6a199672545356f7fd49c7937b3272fdac6.tar.bz2
Third try at committing this.
Patchset 1 is the original patch ( http://codereview.chromium.org/7833042/ ). Patchset 2 is the original patch plus a fix to a memory leak from the initial commit ( http://codereview.chromium.org/7831056/ ) On the first try there was a memory leak in a test. I fixed that, but made a mistake in the commit (the committed code did not correspond to the reviewed code). Both commits were reverted. I then landed a new CL ( http://codereview.chromium.org/7860039/ ) that contained the correct changes combining the first two CLs. This caused an error in heapchecker for which a suppression has subsequently been defined ( http://codereview.chromium.org/7780010 ). In summary, all of this is reviewed, minus some lint fixes. BUG=68657 TEST=net_unittests / DeferredCookieTaskTest.* and CookieMonsterTest.* TBR=estade Review URL: http://codereview.chromium.org/7891008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100932 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/simple_resource_loader_bridge.cc')
-rw-r--r--webkit/tools/test_shell/simple_resource_loader_bridge.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/webkit/tools/test_shell/simple_resource_loader_bridge.cc b/webkit/tools/test_shell/simple_resource_loader_bridge.cc
index 73f9160..9a433a2 100644
--- a/webkit/tools/test_shell/simple_resource_loader_bridge.cc
+++ b/webkit/tools/test_shell/simple_resource_loader_bridge.cc
@@ -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,7 +746,9 @@ class CookieSetter : public base::RefCountedThreadSafe<CookieSetter> {
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:
@@ -760,8 +763,9 @@ class CookieGetter : public base::RefCountedThreadSafe<CookieGetter> {
}
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 +775,10 @@ class CookieGetter : public base::RefCountedThreadSafe<CookieGetter> {
}
private:
+ void OnGetCookies(const std::string& cookie_line) {
+ result_ = cookie_line;
+ event_.Signal();
+ }
friend class base::RefCountedThreadSafe<CookieGetter>;
~CookieGetter() {}