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

Side by Side Diff: webkit/tools/test_shell/simple_resource_loader_bridge.cc

Issue 7008025: Apply third party cookie blocking to all kinds of cookies (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 9 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/base/static_cookie_policy_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This file contains an implementation of the ResourceLoaderBridge class. 5 // This file contains an implementation of the ResourceLoaderBridge class.
6 // The class is implemented using net::URLRequest, meaning it is a "simple" 6 // The class is implemented using net::URLRequest, meaning it is a "simple"
7 // version that directly issues requests. The more complicated one used in the 7 // version that directly issues requests. The more complicated one used in the
8 // browser uses IPC. 8 // browser uses IPC.
9 // 9 //
10 // Because net::URLRequest only provides an asynchronous resource loading API, 10 // Because net::URLRequest only provides an asynchronous resource loading API,
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 454
455 virtual bool CanSetCookie(net::URLRequest* request, 455 virtual bool CanSetCookie(net::URLRequest* request,
456 const std::string& cookie_line, 456 const std::string& cookie_line,
457 net::CookieOptions* options) { 457 net::CookieOptions* options) {
458 StaticCookiePolicy::Type policy_type = g_accept_all_cookies ? 458 StaticCookiePolicy::Type policy_type = g_accept_all_cookies ?
459 StaticCookiePolicy::ALLOW_ALL_COOKIES : 459 StaticCookiePolicy::ALLOW_ALL_COOKIES :
460 StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES; 460 StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES;
461 461
462 StaticCookiePolicy policy(policy_type); 462 StaticCookiePolicy policy(policy_type);
463 int rv = policy.CanSetCookie( 463 int rv = policy.CanSetCookie(
464 request->url(), request->first_party_for_cookies(), cookie_line); 464 request->url(), request->first_party_for_cookies());
465 return rv == net::OK; 465 return rv == net::OK;
466 } 466 }
467 467
468 virtual void OnReadCompleted(net::URLRequest* request, int bytes_read) { 468 virtual void OnReadCompleted(net::URLRequest* request, int bytes_read) {
469 if (request->status().is_success() && bytes_read > 0) { 469 if (request->status().is_success() && bytes_read > 0) {
470 OnReceivedData(bytes_read); 470 OnReceivedData(bytes_read);
471 } else { 471 } else {
472 Done(); 472 Done();
473 } 473 }
474 } 474 }
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 913
914 // static 914 // static
915 scoped_refptr<base::MessageLoopProxy> 915 scoped_refptr<base::MessageLoopProxy>
916 SimpleResourceLoaderBridge::GetIoThread() { 916 SimpleResourceLoaderBridge::GetIoThread() {
917 if (!EnsureIOThread()) { 917 if (!EnsureIOThread()) {
918 LOG(DFATAL) << "Failed to create IO thread."; 918 LOG(DFATAL) << "Failed to create IO thread.";
919 return NULL; 919 return NULL;
920 } 920 }
921 return g_io_thread->message_loop_proxy(); 921 return g_io_thread->message_loop_proxy();
922 } 922 }
OLDNEW
« no previous file with comments | « net/base/static_cookie_policy_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698