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

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

Issue 1172183002: Move StartsWith[ASCII] to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util3
Patch Set: merger Created 5 years, 6 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 } 197 }
198 198
199 bool OnBeginJSONRequest(const std::string& path, 199 bool OnBeginJSONRequest(const std::string& path,
200 const WebUIDataSource::GotDataCallback& callback) { 200 const WebUIDataSource::GotDataCallback& callback) {
201 if (path == "json/categories") { 201 if (path == "json/categories") {
202 return TracingController::GetInstance()->GetCategories( 202 return TracingController::GetInstance()->GetCategories(
203 base::Bind(OnGotCategories, callback)); 203 base::Bind(OnGotCategories, callback));
204 } 204 }
205 205
206 const char* beginRecordingPath = "json/begin_recording?"; 206 const char* beginRecordingPath = "json/begin_recording?";
207 if (StartsWithASCII(path, beginRecordingPath, true)) { 207 if (base::StartsWithASCII(path, beginRecordingPath, true)) {
208 std::string data = path.substr(strlen(beginRecordingPath)); 208 std::string data = path.substr(strlen(beginRecordingPath));
209 return BeginRecording(data, callback); 209 return BeginRecording(data, callback);
210 } 210 }
211 if (path == "json/get_buffer_percent_full") { 211 if (path == "json/get_buffer_percent_full") {
212 return TracingController::GetInstance()->GetTraceBufferUsage( 212 return TracingController::GetInstance()->GetTraceBufferUsage(
213 base::Bind(OnTraceBufferUsageResult, callback)); 213 base::Bind(OnTraceBufferUsageResult, callback));
214 } 214 }
215 if (path == "json/get_buffer_status") { 215 if (path == "json/get_buffer_status") {
216 return TracingController::GetInstance()->GetTraceBufferUsage( 216 return TracingController::GetInstance()->GetTraceBufferUsage(
217 base::Bind(OnTraceBufferStatusResult, callback)); 217 base::Bind(OnTraceBufferStatusResult, callback));
(...skipping 23 matching lines...) Expand all
241 GetMonitoringStatus(callback); 241 GetMonitoringStatus(callback);
242 return true; 242 return true;
243 } 243 }
244 244
245 LOG(ERROR) << "Unhandled request to " << path; 245 LOG(ERROR) << "Unhandled request to " << path;
246 return false; 246 return false;
247 } 247 }
248 248
249 bool OnTracingRequest(const std::string& path, 249 bool OnTracingRequest(const std::string& path,
250 const WebUIDataSource::GotDataCallback& callback) { 250 const WebUIDataSource::GotDataCallback& callback) {
251 if (StartsWithASCII(path, "json/", true)) { 251 if (base::StartsWithASCII(path, "json/", true)) {
252 if (!OnBeginJSONRequest(path, callback)) { 252 if (!OnBeginJSONRequest(path, callback)) {
253 std::string error("##ERROR##"); 253 std::string error("##ERROR##");
254 callback.Run(base::RefCountedString::TakeString(&error)); 254 callback.Run(base::RefCountedString::TakeString(&error));
255 } 255 }
256 return true; 256 return true;
257 } 257 }
258 return false; 258 return false;
259 } 259 }
260 260
261 } // namespace 261 } // namespace
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 web_ui()->CallJavascriptFunction("onUploadComplete", 347 web_ui()->CallJavascriptFunction("onUploadComplete",
348 base::StringValue(feedback)); 348 base::StringValue(feedback));
349 } else { 349 } else {
350 web_ui()->CallJavascriptFunction("onUploadError", 350 web_ui()->CallJavascriptFunction("onUploadError",
351 base::StringValue(feedback)); 351 base::StringValue(feedback));
352 } 352 }
353 trace_uploader_.reset(); 353 trace_uploader_.reset();
354 } 354 }
355 355
356 } // namespace content 356 } // 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