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

Side by Side Diff: content/browser/tracing/tracing_ui.cc

Issue 1242023005: Remove legacy StartsWithASCII function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y Created 5 years, 5 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/tracing/tracing_ui.h" 5 #include "content/browser/tracing/tracing_ui.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 } 200 }
201 201
202 bool OnBeginJSONRequest(const std::string& path, 202 bool OnBeginJSONRequest(const std::string& path,
203 const WebUIDataSource::GotDataCallback& callback) { 203 const WebUIDataSource::GotDataCallback& callback) {
204 if (path == "json/categories") { 204 if (path == "json/categories") {
205 return TracingController::GetInstance()->GetCategories( 205 return TracingController::GetInstance()->GetCategories(
206 base::Bind(OnGotCategories, callback)); 206 base::Bind(OnGotCategories, callback));
207 } 207 }
208 208
209 const char* beginRecordingPath = "json/begin_recording?"; 209 const char* beginRecordingPath = "json/begin_recording?";
210 if (base::StartsWithASCII(path, beginRecordingPath, true)) { 210 if (base::StartsWith(path, beginRecordingPath,
211 base::CompareCase::SENSITIVE)) {
211 std::string data = path.substr(strlen(beginRecordingPath)); 212 std::string data = path.substr(strlen(beginRecordingPath));
212 return BeginRecording(data, callback); 213 return BeginRecording(data, callback);
213 } 214 }
214 if (path == "json/get_buffer_percent_full") { 215 if (path == "json/get_buffer_percent_full") {
215 return TracingController::GetInstance()->GetTraceBufferUsage( 216 return TracingController::GetInstance()->GetTraceBufferUsage(
216 base::Bind(OnTraceBufferUsageResult, callback)); 217 base::Bind(OnTraceBufferUsageResult, callback));
217 } 218 }
218 if (path == "json/get_buffer_status") { 219 if (path == "json/get_buffer_status") {
219 return TracingController::GetInstance()->GetTraceBufferUsage( 220 return TracingController::GetInstance()->GetTraceBufferUsage(
220 base::Bind(OnTraceBufferStatusResult, callback)); 221 base::Bind(OnTraceBufferStatusResult, callback));
(...skipping 25 matching lines...) Expand all
246 GetMonitoringStatus(callback); 247 GetMonitoringStatus(callback);
247 return true; 248 return true;
248 } 249 }
249 250
250 LOG(ERROR) << "Unhandled request to " << path; 251 LOG(ERROR) << "Unhandled request to " << path;
251 return false; 252 return false;
252 } 253 }
253 254
254 bool OnTracingRequest(const std::string& path, 255 bool OnTracingRequest(const std::string& path,
255 const WebUIDataSource::GotDataCallback& callback) { 256 const WebUIDataSource::GotDataCallback& callback) {
256 if (base::StartsWithASCII(path, "json/", true)) { 257 if (base::StartsWith(path, "json/", base::CompareCase::SENSITIVE)) {
257 if (!OnBeginJSONRequest(path, callback)) { 258 if (!OnBeginJSONRequest(path, callback)) {
258 std::string error("##ERROR##"); 259 std::string error("##ERROR##");
259 callback.Run(base::RefCountedString::TakeString(&error)); 260 callback.Run(base::RefCountedString::TakeString(&error));
260 } 261 }
261 return true; 262 return true;
262 } 263 }
263 return false; 264 return false;
264 } 265 }
265 266
266 } // namespace 267 } // namespace
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 web_ui()->CallJavascriptFunction("onUploadComplete", 378 web_ui()->CallJavascriptFunction("onUploadComplete",
378 base::StringValue(feedback)); 379 base::StringValue(feedback));
379 } else { 380 } else {
380 web_ui()->CallJavascriptFunction("onUploadError", 381 web_ui()->CallJavascriptFunction("onUploadError",
381 base::StringValue(feedback)); 382 base::StringValue(feedback));
382 } 383 }
383 trace_uploader_.reset(); 384 trace_uploader_.reset();
384 } 385 }
385 386
386 } // namespace content 387 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/session_history_browsertest.cc ('k') | content/browser/webui/shared_resources_data_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698