| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #import "ios/net/crn_http_protocol_handler.h" | 5 #import "ios/net/crn_http_protocol_handler.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/mac/bind_objc_block.h" | 9 #include "base/mac/bind_objc_block.h" |
| 10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 return; | 672 return; |
| 673 } | 673 } |
| 674 | 674 |
| 675 const URLRequestContext* context = | 675 const URLRequestContext* context = |
| 676 tracker_ ? tracker_->GetRequestContext() | 676 tracker_ ? tracker_->GetRequestContext() |
| 677 : g_protocol_handler_delegate->GetDefaultURLRequestContext() | 677 : g_protocol_handler_delegate->GetDefaultURLRequestContext() |
| 678 ->GetURLRequestContext(); | 678 ->GetURLRequestContext(); |
| 679 DCHECK(context); | 679 DCHECK(context); |
| 680 | 680 |
| 681 net_request_ = | 681 net_request_ = |
| 682 context->CreateRequest(url, DEFAULT_PRIORITY, this, nullptr).release(); | 682 context->CreateRequest(url, DEFAULT_PRIORITY, this).release(); |
| 683 net_request_->set_method(base::SysNSStringToUTF8([request_ HTTPMethod])); | 683 net_request_->set_method(base::SysNSStringToUTF8([request_ HTTPMethod])); |
| 684 | 684 |
| 685 net_request_->set_first_party_for_cookies( | 685 net_request_->set_first_party_for_cookies( |
| 686 GURLWithNSURL([request_ mainDocumentURL])); | 686 GURLWithNSURL([request_ mainDocumentURL])); |
| 687 | 687 |
| 688 #if !defined(NDEBUG) | 688 #if !defined(NDEBUG) |
| 689 DVLOG(2) << "From client:"; | 689 DVLOG(2) << "From client:"; |
| 690 LogNSURLRequest(request_); | 690 LogNSURLRequest(request_); |
| 691 #endif // !defined(NDEBUG) | 691 #endif // !defined(NDEBUG) |
| 692 | 692 |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 943 - (void)stopLoading { | 943 - (void)stopLoading { |
| 944 g_protocol_handler_delegate->GetDefaultURLRequestContext() | 944 g_protocol_handler_delegate->GetDefaultURLRequestContext() |
| 945 ->GetNetworkTaskRunner() | 945 ->GetNetworkTaskRunner() |
| 946 ->PostTask(FROM_HERE, | 946 ->PostTask(FROM_HERE, |
| 947 base::Bind(&net::HttpProtocolHandlerCore::Cancel, _core)); | 947 base::Bind(&net::HttpProtocolHandlerCore::Cancel, _core)); |
| 948 [_protocolProxy invalidate]; | 948 [_protocolProxy invalidate]; |
| 949 _protocolProxy.reset(); | 949 _protocolProxy.reset(); |
| 950 } | 950 } |
| 951 | 951 |
| 952 @end | 952 @end |
| OLD | NEW |