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

Unified Diff: content/browser/browser_process_sub_thread.cc

Issue 106223002: chrome power profiler chrome side changes (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years 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
Index: content/browser/browser_process_sub_thread.cc
diff --git a/content/browser/browser_process_sub_thread.cc b/content/browser/browser_process_sub_thread.cc
index 9a5b78a9edb0096cf39c4b9160294ba85379b82e..fe7c93698b1d81392ec4ca6df5fa90289d79f55d 100644
--- a/content/browser/browser_process_sub_thread.cc
+++ b/content/browser/browser_process_sub_thread.cc
@@ -9,6 +9,7 @@
#include "build/build_config.h"
#include "content/browser/browser_child_process_host_impl.h"
#include "content/browser/notification_service_impl.h"
+#include "content/browser/power_profiler/power_profiler_service.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request.h"
@@ -42,12 +43,18 @@ void BrowserProcessSubThread::Init() {
base::ThreadRestrictions::SetIOAllowed(false);
base::ThreadRestrictions::DisallowWaiting();
}
+ if (BrowserThread::CurrentlyOn(BrowserThread::POWER_PROFILER)) {
+ power_profiler_service_.reset(new PowerProfilerService);
pfeldman 2014/01/09 11:38:58 You should either use lazy_init, singleton or Brow
+ }
}
void BrowserProcessSubThread::CleanUp() {
if (BrowserThread::CurrentlyOn(BrowserThread::IO))
IOThreadPreCleanUp();
+ if (BrowserThread::CurrentlyOn(BrowserThread::POWER_PROFILER))
+ PowerProfilerThreadPreCleanUp();
+
BrowserThreadImpl::CleanUp();
notification_service_.reset();
@@ -72,4 +79,8 @@ void BrowserProcessSubThread::IOThreadPreCleanUp() {
#endif // !defined(OS_IOS)
}
+void BrowserProcessSubThread::PowerProfilerThreadPreCleanUp() {
+ power_profiler_service_.reset();
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698