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

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

Issue 823533004: Move memory histograms generation to MetricsMemoryDetails. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Better class comment. Created 5 years, 11 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 "chrome/browser/ui/webui/about_ui.h" 5 #include "chrome/browser/ui/webui/about_ui.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 DISALLOW_COPY_AND_ASSIGN(AboutDnsHandler); 638 DISALLOW_COPY_AND_ASSIGN(AboutDnsHandler);
639 }; 639 };
640 640
641 void FinishMemoryDataRequest( 641 void FinishMemoryDataRequest(
642 const std::string& path, 642 const std::string& path,
643 const content::URLDataSource::GotDataCallback& callback) { 643 const content::URLDataSource::GotDataCallback& callback) {
644 if (path == kStringsJsPath) { 644 if (path == kStringsJsPath) {
645 // The AboutMemoryHandler cleans itself up, but |StartFetch()| will want 645 // The AboutMemoryHandler cleans itself up, but |StartFetch()| will want
646 // the refcount to be greater than 0. 646 // the refcount to be greater than 0.
647 scoped_refptr<AboutMemoryHandler> handler(new AboutMemoryHandler(callback)); 647 scoped_refptr<AboutMemoryHandler> handler(new AboutMemoryHandler(callback));
648 // TODO(jamescook): Maybe this shouldn't update UMA? 648 handler->StartFetch();
649 handler->StartFetch(MemoryDetails::UPDATE_USER_METRICS);
650 } else { 649 } else {
651 int id = IDR_ABOUT_MEMORY_HTML; 650 int id = IDR_ABOUT_MEMORY_HTML;
652 if (path == kMemoryJsPath) { 651 if (path == kMemoryJsPath) {
653 id = IDR_ABOUT_MEMORY_JS; 652 id = IDR_ABOUT_MEMORY_JS;
654 } else if (path == kMemoryCssPath) { 653 } else if (path == kMemoryCssPath) {
655 id = IDR_ABOUT_MEMORY_CSS; 654 id = IDR_ABOUT_MEMORY_CSS;
656 } 655 }
657 656
658 std::string result = 657 std::string result =
659 ResourceBundle::GetSharedInstance().GetRawDataResource(id).as_string(); 658 ResourceBundle::GetSharedInstance().GetRawDataResource(id).as_string();
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
1166 Profile* profile = Profile::FromWebUI(web_ui); 1165 Profile* profile = Profile::FromWebUI(web_ui);
1167 1166
1168 #if defined(ENABLE_THEMES) 1167 #if defined(ENABLE_THEMES)
1169 // Set up the chrome://theme/ source. 1168 // Set up the chrome://theme/ source.
1170 ThemeSource* theme = new ThemeSource(profile); 1169 ThemeSource* theme = new ThemeSource(profile);
1171 content::URLDataSource::Add(profile, theme); 1170 content::URLDataSource::Add(profile, theme);
1172 #endif 1171 #endif
1173 1172
1174 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); 1173 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile));
1175 } 1174 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698