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

Side by Side Diff: chrome/browser/ui/webui/tracing_ui.cc

Issue 9447003: Revert 123140 - Use SequencedWorkerPool for disk operations in TraceSubscriberStdio. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/automation/automation_provider.cc ('k') | chrome/test/base/tracing.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 (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 "chrome/browser/ui/webui/tracing_ui.h" 5 #include "chrome/browser/ui/webui/tracing_ui.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 // WebUIMessageHandler implementation. 67 // WebUIMessageHandler implementation.
68 virtual void RegisterMessages(); 68 virtual void RegisterMessages();
69 69
70 // SelectFileDialog::Listener implementation 70 // SelectFileDialog::Listener implementation
71 virtual void FileSelected(const FilePath& path, int index, void* params); 71 virtual void FileSelected(const FilePath& path, int index, void* params);
72 virtual void FileSelectionCanceled(void* params); 72 virtual void FileSelectionCanceled(void* params);
73 73
74 // TraceSubscriber implementation. 74 // TraceSubscriber implementation.
75 virtual void OnEndTracingComplete(); 75 virtual void OnEndTracingComplete();
76 virtual void OnTraceDataCollected( 76 virtual void OnTraceDataCollected(const std::string& trace_fragment);
77 const scoped_refptr<base::RefCountedString>& trace_fragment);
78 virtual void OnTraceBufferPercentFullReply(float percent_full); 77 virtual void OnTraceBufferPercentFullReply(float percent_full);
79 78
80 // GpuDataManagerObserver implementation. 79 // GpuDataManagerObserver implementation.
81 virtual void OnGpuInfoUpdate() OVERRIDE; 80 virtual void OnGpuInfoUpdate() OVERRIDE;
82 81
83 // Messages. 82 // Messages.
84 void OnTracingControllerInitialized(const ListValue* list); 83 void OnTracingControllerInitialized(const ListValue* list);
85 void OnBeginTracing(const ListValue* list); 84 void OnBeginTracing(const ListValue* list);
86 void OnEndTracingAsync(const ListValue* list); 85 void OnEndTracingAsync(const ListValue* list);
87 void OnBeginRequestBufferPercentFull(const ListValue* list); 86 void OnBeginRequestBufferPercentFull(const ListValue* list);
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 } 372 }
374 } 373 }
375 374
376 void TracingMessageHandler::OnEndTracingComplete() { 375 void TracingMessageHandler::OnEndTracingComplete() {
377 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 376 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
378 trace_enabled_ = false; 377 trace_enabled_ = false;
379 web_ui()->CallJavascriptFunction("tracingController.onEndTracingComplete"); 378 web_ui()->CallJavascriptFunction("tracingController.onEndTracingComplete");
380 } 379 }
381 380
382 void TracingMessageHandler::OnTraceDataCollected( 381 void TracingMessageHandler::OnTraceDataCollected(
383 const scoped_refptr<base::RefCountedString>& trace_fragment) { 382 const std::string& trace_fragment) {
384 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 383 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
385 384
386 base::debug::TraceResultBuffer::SimpleOutput output; 385 base::debug::TraceResultBuffer::SimpleOutput output;
387 base::debug::TraceResultBuffer trace_buffer; 386 base::debug::TraceResultBuffer trace_buffer;
388 trace_buffer.SetOutputCallback(output.GetCallback()); 387 trace_buffer.SetOutputCallback(output.GetCallback());
389 output.Append("tracingController.onTraceDataCollected("); 388 output.Append("tracingController.onTraceDataCollected(");
390 trace_buffer.Start(); 389 trace_buffer.Start();
391 trace_buffer.AddFragment(trace_fragment->data()); 390 trace_buffer.AddFragment(trace_fragment);
392 trace_buffer.Finish(); 391 trace_buffer.Finish();
393 output.Append(");"); 392 output.Append(");");
394 393
395 web_ui()->GetWebContents()->GetRenderViewHost()-> 394 web_ui()->GetWebContents()->GetRenderViewHost()->
396 ExecuteJavascriptInWebFrame(string16(), UTF8ToUTF16(output.json_output)); 395 ExecuteJavascriptInWebFrame(string16(), UTF8ToUTF16(output.json_output));
397 } 396 }
398 397
399 void TracingMessageHandler::OnTraceBufferPercentFullReply(float percent_full) { 398 void TracingMessageHandler::OnTraceBufferPercentFullReply(float percent_full) {
400 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 399 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
401 web_ui()->CallJavascriptFunction( 400 web_ui()->CallJavascriptFunction(
(...skipping 10 matching lines...) Expand all
412 // 411 //
413 //////////////////////////////////////////////////////////////////////////////// 412 ////////////////////////////////////////////////////////////////////////////////
414 413
415 TracingUI::TracingUI(content::WebUI* web_ui) : WebUIController(web_ui) { 414 TracingUI::TracingUI(content::WebUI* web_ui) : WebUIController(web_ui) {
416 web_ui->AddMessageHandler(new TracingMessageHandler()); 415 web_ui->AddMessageHandler(new TracingMessageHandler());
417 416
418 // Set up the chrome://tracing/ source. 417 // Set up the chrome://tracing/ source.
419 Profile::FromWebUI(web_ui)-> 418 Profile::FromWebUI(web_ui)->
420 GetChromeURLDataManager()->AddDataSource(CreateTracingHTMLSource()); 419 GetChromeURLDataManager()->AddDataSource(CreateTracingHTMLSource());
421 } 420 }
OLDNEW
« no previous file with comments | « chrome/browser/automation/automation_provider.cc ('k') | chrome/test/base/tracing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698