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

Side by Side Diff: ios/web/webui/url_fetcher_block_adapter.mm

Issue 2260023004: [ARC] [Split this CL] Convert ios/web/webui to ARC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ios-web-net
Patch Set: Created 4 years, 4 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
« no previous file with comments | « ios/web/webui/url_data_source_ios.mm ('k') | ios/web/webui/web_ui_ios_data_source_impl.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "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)
12 #error "This file requires ARC support."
13 #endif
14
11 namespace web { 15 namespace web {
12 16
13 URLFetcherBlockAdapter::URLFetcherBlockAdapter( 17 URLFetcherBlockAdapter::URLFetcherBlockAdapter(
14 const GURL& url, 18 const GURL& url,
15 net::URLRequestContextGetter* request_context, 19 net::URLRequestContextGetter* request_context,
16 web::URLFetcherBlockAdapterCompletion completion_handler) 20 web::URLFetcherBlockAdapterCompletion completion_handler)
17 : url_(url), 21 : url_(url),
18 request_context_(request_context), 22 request_context_(request_context),
19 completion_handler_([completion_handler copy]) { 23 completion_handler_([completion_handler copy]) {
20 } 24 }
(...skipping 11 matching lines...) Expand all
32 std::string response; 36 std::string response;
33 if (!source->GetResponseAsString(&response)) { 37 if (!source->GetResponseAsString(&response)) {
34 DLOG(WARNING) << "String for resource URL not found" << source->GetURL(); 38 DLOG(WARNING) << "String for resource URL not found" << source->GetURL();
35 } 39 }
36 NSData* data = 40 NSData* data =
37 [NSData dataWithBytes:response.c_str() length:response.length()]; 41 [NSData dataWithBytes:response.c_str() length:response.length()];
38 completion_handler_.get()(data, this); 42 completion_handler_.get()(data, this);
39 } 43 }
40 44
41 } // namespace web 45 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/webui/url_data_source_ios.mm ('k') | ios/web/webui/web_ui_ios_data_source_impl.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698