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

Side by Side Diff: ios/chrome/browser/updatable_config/updatable_config_base.mm

Issue 1440593004: Make operators on scoped_ptr match the ones defined for std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrequals: followupfix-after-rebase Created 5 years, 1 month 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 | « device/serial/serial_io_handler_win.cc ('k') | net/spdy/spdy_write_queue_unittest.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/chrome/browser/updatable_config/updatable_config_base.h" 5 #import "ios/chrome/browser/updatable_config/updatable_config_base.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #import "base/mac/bind_objc_block.h" 8 #import "base/mac/bind_objc_block.h"
9 #include "base/mac/scoped_nsobject.h" 9 #include "base/mac/scoped_nsobject.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 : owner_(owner), descriptor_(descriptor) {} 56 : owner_(owner), descriptor_(descriptor) {}
57 57
58 // Starts fetching |url| for updated configuration. 58 // Starts fetching |url| for updated configuration.
59 void Fetch(const GURL& url, net::URLRequestContextGetter* context) { 59 void Fetch(const GURL& url, net::URLRequestContextGetter* context) {
60 fetcher_ = net::URLFetcher::Create(url, net::URLFetcher::GET, this); 60 fetcher_ = net::URLFetcher::Create(url, net::URLFetcher::GET, this);
61 fetcher_->SetRequestContext(context); 61 fetcher_->SetRequestContext(context);
62 fetcher_->Start(); 62 fetcher_->Start();
63 } 63 }
64 64
65 void OnURLFetchComplete(const net::URLFetcher* fetcher) override { 65 void OnURLFetchComplete(const net::URLFetcher* fetcher) override {
66 DCHECK_EQ(fetcher_, fetcher); 66 DCHECK_EQ(fetcher_.get(), fetcher);
67 NSData* responseData = nil; 67 NSData* responseData = nil;
68 if (fetcher_->GetResponseCode() == net::HTTP_OK) { 68 if (fetcher_->GetResponseCode() == net::HTTP_OK) {
69 std::string response; 69 std::string response;
70 fetcher_->GetResponseAsString(&response); 70 fetcher_->GetResponseAsString(&response);
71 responseData = 71 responseData =
72 [NSData dataWithBytes:response.c_str() length:response.length()]; 72 [NSData dataWithBytes:response.c_str() length:response.length()];
73 } 73 }
74 fetcher_.reset(); 74 fetcher_.reset();
75 // If data was fetched, write the fetched data to local store in a 75 // If data was fetched, write the fetched data to local store in a
76 // separate thread. Then update the resource descriptor that configuration 76 // separate thread. Then update the resource descriptor that configuration
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 return; 260 return;
261 if (!_configFetcher) { 261 if (!_configFetcher) {
262 _configFetcher.reset( 262 _configFetcher.reset(
263 new ConfigFetcher(self, [_updatableResource descriptor])); 263 new ConfigFetcher(self, [_updatableResource descriptor]));
264 } 264 }
265 GURL url = net::GURLWithNSURL([[_updatableResource descriptor] updateURL]); 265 GURL url = net::GURLWithNSURL([[_updatableResource descriptor] updateURL]);
266 _configFetcher->Fetch(url, _requestContextGetter.get()); 266 _configFetcher->Fetch(url, _requestContextGetter.get());
267 } 267 }
268 268
269 @end 269 @end
OLDNEW
« no previous file with comments | « device/serial/serial_io_handler_win.cc ('k') | net/spdy/spdy_write_queue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698