| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "net/url_request/url_request_test_util.h" | 5 #include "net/url_request/url_request_test_util.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 return allow; | 468 return allow; |
| 469 } | 469 } |
| 470 | 470 |
| 471 bool TestNetworkDelegate::OnCanSetCookie(const net::URLRequest& request, | 471 bool TestNetworkDelegate::OnCanSetCookie(const net::URLRequest& request, |
| 472 const std::string& cookie_line, | 472 const std::string& cookie_line, |
| 473 net::CookieOptions* options) { | 473 net::CookieOptions* options) { |
| 474 bool allow = true; | 474 bool allow = true; |
| 475 if (cookie_options_bit_mask_ & NO_SET_COOKIE) | 475 if (cookie_options_bit_mask_ & NO_SET_COOKIE) |
| 476 allow = false; | 476 allow = false; |
| 477 | 477 |
| 478 if (cookie_options_bit_mask_ & FORCE_SESSION) | |
| 479 options->set_force_session(); | |
| 480 | |
| 481 if (!allow) { | 478 if (!allow) { |
| 482 blocked_set_cookie_count_++; | 479 blocked_set_cookie_count_++; |
| 483 } else { | 480 } else { |
| 484 set_cookie_count_++; | 481 set_cookie_count_++; |
| 485 } | 482 } |
| 486 | 483 |
| 487 return allow; | 484 return allow; |
| 488 } | 485 } |
| 489 | 486 |
| 490 bool TestNetworkDelegate::OnCanAccessFile(const net::URLRequest& request, | 487 bool TestNetworkDelegate::OnCanAccessFile(const net::URLRequest& request, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 515 | 512 |
| 516 ScopedCustomUrlRequestTestHttpHost::~ScopedCustomUrlRequestTestHttpHost() { | 513 ScopedCustomUrlRequestTestHttpHost::~ScopedCustomUrlRequestTestHttpHost() { |
| 517 DCHECK_EQ(value_, new_value_); | 514 DCHECK_EQ(value_, new_value_); |
| 518 value_ = old_value_; | 515 value_ = old_value_; |
| 519 } | 516 } |
| 520 | 517 |
| 521 // static | 518 // static |
| 522 const std::string& ScopedCustomUrlRequestTestHttpHost::value() { | 519 const std::string& ScopedCustomUrlRequestTestHttpHost::value() { |
| 523 return value_; | 520 return value_; |
| 524 } | 521 } |
| OLD | NEW |