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

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

Issue 192004: Change the default cookie policy to be closer to the default in WebKit's Dump... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | « webkit/tools/test_shell/simple_resource_loader_bridge.h ('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 25298)
+++ webkit/tools/test_shell/simple_resource_loader_bridge.cc (working copy)
@@ -38,6 +38,7 @@
#include "base/timer.h"
#include "base/thread.h"
#include "base/waitable_event.h"
+#include "net/base/cookie_policy.h"
#include "net/base/io_buffer.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
@@ -52,6 +53,7 @@
#include "webkit/tools/test_shell/test_shell_request_context.h"
using webkit_glue::ResourceLoaderBridge;
+using net::CookiePolicy;
using net::HttpResponseHeaders;
namespace {
@@ -653,6 +655,7 @@
request_context = new TestShellRequestContext();
}
request_context->AddRef();
+ SimpleResourceLoaderBridge::SetAcceptAllCookies(false);
}
// static
@@ -665,6 +668,7 @@
}
}
+// static
void SimpleResourceLoaderBridge::SetCookie(const GURL& url,
const GURL& first_party_for_cookies,
const std::string& cookie) {
@@ -680,6 +684,7 @@
cookie_setter.get(), &CookieSetter::Set, url, cookie));
}
+// static
std::string SimpleResourceLoaderBridge::GetCookies(
const GURL& url, const GURL& first_party_for_cookies) {
// Proxy to IO thread to synchronize w/ network loading
@@ -697,6 +702,7 @@
return getter->GetResult();
}
+// static
bool SimpleResourceLoaderBridge::EnsureIOThread() {
if (io_thread)
return true;
@@ -709,3 +715,10 @@
options.message_loop_type = MessageLoop::TYPE_IO;
return io_thread->StartWithOptions(options);
}
+
+// static
+void SimpleResourceLoaderBridge::SetAcceptAllCookies(bool accept_all_cookies) {
+ CookiePolicy::Type policy_type = accept_all_cookies ?
+ CookiePolicy::ALLOW_ALL_COOKIES : CookiePolicy::BLOCK_THIRD_PARTY_COOKIES;
+ request_context->cookie_policy()->set_type(policy_type);
+}
« no previous file with comments | « webkit/tools/test_shell/simple_resource_loader_bridge.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698