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

Unified Diff: chrome/browser/browser_about_handler.cc

Issue 113473: Automatically adapt to faster/slower uploads of renderer histograms... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/histogram.cc ('k') | chrome/browser/browser_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_about_handler.cc
===================================================================
--- chrome/browser/browser_about_handler.cc (revision 17103)
+++ chrome/browser/browser_about_handler.cc (working copy)
@@ -24,6 +24,7 @@
#include "chrome/browser/net/dns_global.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/browser/renderer_host/render_view_host.h"
+#include "chrome/common/histogram_synchronizer.h"
#include "chrome/common/jstemplate_builder.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
@@ -45,6 +46,9 @@
#include "chrome/browser/views/about_network_dialog.h"
#endif
+using base::Time;
+using base::TimeDelta;
+
namespace {
// The paths used for the about pages.
@@ -137,16 +141,14 @@
}
std::string AboutHistograms(const std::string& query) {
- std::string data;
- for (RenderProcessHost::iterator it = RenderProcessHost::begin();
- it != RenderProcessHost::end(); ++it) {
- it->second->Send(new ViewMsg_GetRendererHistograms());
- }
+ TimeDelta wait_time = TimeDelta::FromMilliseconds(10000);
- // TODO(raman): Delay page layout until we get respnoses
- // back from renderers, and not have to use a fixed size delay.
- PlatformThread::Sleep(1000);
+ HistogramSynchronizer* current_synchronizer =
+ HistogramSynchronizer::CurrentSynchronizer();
+ DCHECK(current_synchronizer != NULL);
+ current_synchronizer->FetchRendererHistogramsSynchronously(wait_time);
+ std::string data;
StatisticsRecorder::WriteHTMLGraph(query, &data);
return data;
}
« no previous file with comments | « base/histogram.cc ('k') | chrome/browser/browser_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698