| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/web/webui/url_fetcher_block_adapter.h" | 5 #import "ios/web/webui/url_fetcher_block_adapter.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "net/url_request/url_fetcher.h" | 8 #include "net/url_request/url_fetcher.h" |
| 9 #include "net/url_request/url_request_context_getter.h" | 9 #include "net/url_request/url_request_context_getter.h" |
| 10 | 10 |
| 11 #if !defined(__has_feature) || !__has_feature(objc_arc) | 11 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 12 #error "This file requires ARC support." | 12 #error "This file requires ARC support." |
| 13 #endif | 13 #endif |
| 14 | 14 |
| 15 namespace web { | 15 namespace web { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 36 std::string response; | 36 std::string response; |
| 37 if (!source->GetResponseAsString(&response)) { | 37 if (!source->GetResponseAsString(&response)) { |
| 38 DLOG(WARNING) << "String for resource URL not found" << source->GetURL(); | 38 DLOG(WARNING) << "String for resource URL not found" << source->GetURL(); |
| 39 } | 39 } |
| 40 NSData* data = | 40 NSData* data = |
| 41 [NSData dataWithBytes:response.c_str() length:response.length()]; | 41 [NSData dataWithBytes:response.c_str() length:response.length()]; |
| 42 completion_handler_.get()(data, this); | 42 completion_handler_.get()(data, this); |
| 43 } | 43 } |
| 44 | 44 |
| 45 } // namespace web | 45 } // namespace web |
| OLD | NEW |