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

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

Issue 15714004: Use const_iterator while iterating const std::set<>& (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 7 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
« no previous file with comments | « no previous file | no next file » | 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 "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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 std::set<std::string> ret; 515 std::set<std::string> ret;
516 OnKnownCategoriesCollected(ret); 516 OnKnownCategoriesCollected(ret);
517 } 517 }
518 } 518 }
519 519
520 void TracingMessageHandler::OnKnownCategoriesCollected( 520 void TracingMessageHandler::OnKnownCategoriesCollected(
521 const std::set<std::string>& known_categories) { 521 const std::set<std::string>& known_categories) {
522 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 522 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
523 523
524 scoped_ptr<base::ListValue> categories(new base::ListValue()); 524 scoped_ptr<base::ListValue> categories(new base::ListValue());
525 for (std::set<std::string>::iterator iter = known_categories.begin(); 525 for (std::set<std::string>::const_iterator iter = known_categories.begin();
526 iter != known_categories.end(); 526 iter != known_categories.end();
527 ++iter) { 527 ++iter) {
528 categories->AppendString(*iter); 528 categories->AppendString(*iter);
529 } 529 }
530 530
531 web_ui()->CallJavascriptFunction( 531 web_ui()->CallJavascriptFunction(
532 "tracingController.onKnownCategoriesCollected", *categories); 532 "tracingController.onKnownCategoriesCollected", *categories);
533 } 533 }
534 534
535 } // namespace 535 } // namespace
536 536
537 537
538 //////////////////////////////////////////////////////////////////////////////// 538 ////////////////////////////////////////////////////////////////////////////////
539 // 539 //
540 // TracingUI 540 // TracingUI
541 // 541 //
542 //////////////////////////////////////////////////////////////////////////////// 542 ////////////////////////////////////////////////////////////////////////////////
543 543
544 TracingUI::TracingUI(WebUI* web_ui) : WebUIController(web_ui) { 544 TracingUI::TracingUI(WebUI* web_ui) : WebUIController(web_ui) {
545 web_ui->AddMessageHandler(new TracingMessageHandler()); 545 web_ui->AddMessageHandler(new TracingMessageHandler());
546 546
547 // Set up the chrome://tracing/ source. 547 // Set up the chrome://tracing/ source.
548 BrowserContext* browser_context = 548 BrowserContext* browser_context =
549 web_ui->GetWebContents()->GetBrowserContext(); 549 web_ui->GetWebContents()->GetBrowserContext();
550 WebUIDataSource::Add(browser_context, CreateTracingHTMLSource()); 550 WebUIDataSource::Add(browser_context, CreateTracingHTMLSource());
551 } 551 }
552 552
553 } // namespace content 553 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698