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

Side by Side Diff: content/browser/power_profiler/power_profiler_observer.cc

Issue 106223002: chrome power profiler chrome side changes (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 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
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/public/browser/power_profiler_observer.h"
6
7 #include "content/public/browser/browser_thread.h"
8 #include "content/public/browser/power_profiler_service.h"
9
10 namespace content {
11
12 PowerProfilerObserver::PowerProfilerObserver() : resolution_(NORMAL) {
13 }
14
15 PowerProfilerObserver::~PowerProfilerObserver() {
16 }
17
18 bool PowerProfilerObserver::Register() {
19 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
20
21 if (!PowerProfilerService::GetInstance()->IsAvailable())
22 return false;
23
24 PowerProfilerService::GetInstance()->AddObserver(this);
25
26 return true;
27 }
28
29 void PowerProfilerObserver::Unregister() {
30 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
31
32 PowerProfilerService::GetInstance()->RemoveObserver(this);
33 }
34
35 void PowerProfilerObserver::SetResolution(Resolution resolution) {
36 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
37
38 resolution_ = resolution;
39 PowerProfilerService::GetInstance()->UpdateResolution();
40 }
41
42 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698