| OLD | NEW |
| 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 <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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 | 489 |
| 490 void TracingMessageHandler::OnTraceBufferPercentFullReply(float percent_full) { | 490 void TracingMessageHandler::OnTraceBufferPercentFullReply(float percent_full) { |
| 491 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 491 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 492 web_ui()->CallJavascriptFunction( | 492 web_ui()->CallJavascriptFunction( |
| 493 "tracingController.onRequestBufferPercentFullComplete", | 493 "tracingController.onRequestBufferPercentFullComplete", |
| 494 *scoped_ptr<base::Value>(new base::FundamentalValue(percent_full))); | 494 *scoped_ptr<base::Value>(new base::FundamentalValue(percent_full))); |
| 495 } | 495 } |
| 496 | 496 |
| 497 void TracingMessageHandler::OnGetKnownCategories(const base::ListValue* list) { | 497 void TracingMessageHandler::OnGetKnownCategories(const base::ListValue* list) { |
| 498 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 498 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 499 if (!TraceController::GetInstance()->GetKnownCategoriesAsync(this)) { | 499 if (!TraceController::GetInstance()->GetKnownCategoryGroupsAsync(this)) { |
| 500 std::set<std::string> ret; | 500 std::set<std::string> ret; |
| 501 OnKnownCategoriesCollected(ret); | 501 OnKnownCategoriesCollected(ret); |
| 502 } | 502 } |
| 503 } | 503 } |
| 504 | 504 |
| 505 void TracingMessageHandler::OnKnownCategoriesCollected( | 505 void TracingMessageHandler::OnKnownCategoriesCollected( |
| 506 const std::set<std::string>& known_categories) { | 506 const std::set<std::string>& known_categories) { |
| 507 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 507 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 508 | 508 |
| 509 scoped_ptr<base::ListValue> categories(new base::ListValue()); | 509 scoped_ptr<base::ListValue> categories(new base::ListValue()); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 529 TracingUI::TracingUI(WebUI* web_ui) : WebUIController(web_ui) { | 529 TracingUI::TracingUI(WebUI* web_ui) : WebUIController(web_ui) { |
| 530 web_ui->AddMessageHandler(new TracingMessageHandler()); | 530 web_ui->AddMessageHandler(new TracingMessageHandler()); |
| 531 | 531 |
| 532 // Set up the chrome://tracing/ source. | 532 // Set up the chrome://tracing/ source. |
| 533 BrowserContext* browser_context = | 533 BrowserContext* browser_context = |
| 534 web_ui->GetWebContents()->GetBrowserContext(); | 534 web_ui->GetWebContents()->GetBrowserContext(); |
| 535 WebUIDataSource::Add(browser_context, CreateTracingHTMLSource()); | 535 WebUIDataSource::Add(browser_context, CreateTracingHTMLSource()); |
| 536 } | 536 } |
| 537 | 537 |
| 538 } // namespace content | 538 } // namespace content |
| OLD | NEW |