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

Side by Side Diff: chrome/browser/supervised_user/experimental/safe_search_url_reporter.cc

Issue 2779893005: Continue to clean c_str() calls. (Closed)
Patch Set: Revert changes in font_service_app.cc Created 3 years, 8 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/supervised_user/experimental/safe_search_url_reporter.h " 5 #include "chrome/browser/supervised_user/experimental/safe_search_url_reporter.h "
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 (*it)->url_fetcher.get(), 142 (*it)->url_fetcher.get(),
143 data_use_measurement::DataUseUserData::SUPERVISED_USER); 143 data_use_measurement::DataUseUserData::SUPERVISED_USER);
144 (*it)->url_fetcher->SetRequestContext(context_); 144 (*it)->url_fetcher->SetRequestContext(context_);
145 (*it)->url_fetcher->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | 145 (*it)->url_fetcher->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
146 net::LOAD_DO_NOT_SAVE_COOKIES); 146 net::LOAD_DO_NOT_SAVE_COOKIES);
147 (*it)->url_fetcher->SetAutomaticallyRetryOnNetworkChanges(kNumRetries); 147 (*it)->url_fetcher->SetAutomaticallyRetryOnNetworkChanges(kNumRetries);
148 (*it)->url_fetcher->AddExtraRequestHeader( 148 (*it)->url_fetcher->AddExtraRequestHeader(
149 base::StringPrintf(kAuthorizationHeaderFormat, access_token.c_str())); 149 base::StringPrintf(kAuthorizationHeaderFormat, access_token.c_str()));
150 150
151 base::DictionaryValue dict; 151 base::DictionaryValue dict;
152 dict.SetStringWithoutPathExpansion(kUrlKey, (*it)->url.spec().c_str()); 152 dict.SetStringWithoutPathExpansion(kUrlKey, (*it)->url.spec());
153 153
154 std::string body; 154 std::string body;
155 base::JSONWriter::Write(dict, &body); 155 base::JSONWriter::Write(dict, &body);
156 (*it)->url_fetcher->SetUploadData("application/json", body); 156 (*it)->url_fetcher->SetUploadData("application/json", body);
157 157
158 (*it)->url_fetcher->Start(); 158 (*it)->url_fetcher->Start();
159 } 159 }
160 160
161 void SafeSearchURLReporter::OnGetTokenFailure( 161 void SafeSearchURLReporter::OnGetTokenFailure(
162 const OAuth2TokenService::Request* request, 162 const OAuth2TokenService::Request* request,
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 return; 205 return;
206 } 206 }
207 207
208 DispatchResult(it, true); 208 DispatchResult(it, true);
209 } 209 }
210 210
211 void SafeSearchURLReporter::DispatchResult(ReportIterator it, bool success) { 211 void SafeSearchURLReporter::DispatchResult(ReportIterator it, bool success) {
212 (*it)->callback.Run(success); 212 (*it)->callback.Run(success);
213 reports_.erase(it); 213 reports_.erase(it);
214 } 214 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_avatar_icon_util.cc ('k') | chrome/browser/ui/browser_window_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698