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

Side by Side Diff: chrome/browser/extensions/blacklist_state_fetcher.cc

Issue 1117703002: Adjust URLFetcher::Create API so that object is returned as scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix another failure missed by my regex Created 5 years, 7 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
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 #include "chrome/browser/extensions/blacklist_state_fetcher.h" 5 #include "chrome/browser/extensions/blacklist_state_fetcher.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/safe_browsing/protocol_manager_helper.h" 10 #include "chrome/browser/safe_browsing/protocol_manager_helper.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 void BlacklistStateFetcher::SendRequest(const std::string& id) { 133 void BlacklistStateFetcher::SendRequest(const std::string& id) {
134 DCHECK_CURRENTLY_ON(BrowserThread::UI); 134 DCHECK_CURRENTLY_ON(BrowserThread::UI);
135 135
136 ClientCRXListInfoRequest request; 136 ClientCRXListInfoRequest request;
137 request.set_id(id); 137 request.set_id(id);
138 std::string request_str; 138 std::string request_str;
139 request.SerializeToString(&request_str); 139 request.SerializeToString(&request_str);
140 140
141 GURL request_url = RequestUrl(); 141 GURL request_url = RequestUrl();
142 net::URLFetcher* fetcher = net::URLFetcher::Create(url_fetcher_id_++, 142 net::URLFetcher* fetcher =
143 request_url, 143 net::URLFetcher::Create(url_fetcher_id_++, request_url,
144 net::URLFetcher::POST, 144 net::URLFetcher::POST, this).release();
Ryan Sleevi 2015/04/30 18:23:44 ditto line 145
145 this);
146 requests_[fetcher] = id; 145 requests_[fetcher] = id;
147 fetcher->SetAutomaticallyRetryOn5xx(false); // Don't retry on error. 146 fetcher->SetAutomaticallyRetryOn5xx(false); // Don't retry on error.
148 fetcher->SetRequestContext(url_request_context_getter_.get()); 147 fetcher->SetRequestContext(url_request_context_getter_.get());
149 fetcher->SetUploadData("application/octet-stream", request_str); 148 fetcher->SetUploadData("application/octet-stream", request_str);
150 fetcher->Start(); 149 fetcher->Start();
151 } 150 }
152 151
153 void BlacklistStateFetcher::SetSafeBrowsingConfig( 152 void BlacklistStateFetcher::SetSafeBrowsingConfig(
154 const SafeBrowsingProtocolConfig& config) { 153 const SafeBrowsingProtocolConfig& config) {
155 safe_browsing_config_.reset(new SafeBrowsingProtocolConfig(config)); 154 safe_browsing_config_.reset(new SafeBrowsingProtocolConfig(config));
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 callback_it != range.second; 219 callback_it != range.second;
221 ++callback_it) { 220 ++callback_it) {
222 callback_it->second.Run(state); 221 callback_it->second.Run(state);
223 } 222 }
224 223
225 callbacks_.erase(range.first, range.second); 224 callbacks_.erase(range.first, range.second);
226 } 225 }
227 226
228 } // namespace extensions 227 } // namespace extensions
229 228
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698