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

Side by Side Diff: content/browser/devtools/devtools_power_handler.h

Issue 341853002: [PowerProfiler] Power profiler service keeps running even after devtools frontend has been closed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@power-profiler-devtools-crash-fix
Patch Set: Created 6 years, 6 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 | content/browser/devtools/devtools_power_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 #ifndef CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_POWER_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_POWER_HANDLER_H_
6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_POWER_HANDLER_H_ 6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_POWER_HANDLER_H_
7 7
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "content/browser/devtools/devtools_protocol.h" 9 #include "content/browser/devtools/devtools_protocol.h"
10 #include "content/browser/power_profiler/power_profiler_observer.h" 10 #include "content/browser/power_profiler/power_profiler_observer.h"
11 11
12 namespace content { 12 namespace content {
13 13
14 class DevToolsAgentHost;
15
14 // This class provides power information to DevTools. 16 // This class provides power information to DevTools.
15 class DevToolsPowerHandler 17 class DevToolsPowerHandler
16 : public DevToolsProtocol::Handler, 18 : public DevToolsProtocol::Handler,
17 public PowerProfilerObserver { 19 public PowerProfilerObserver {
18 public: 20 public:
19 DevToolsPowerHandler(); 21 DevToolsPowerHandler(DevToolsAgentHost*);
yurys 2014/06/18 15:20:59 should be explicit
20 virtual ~DevToolsPowerHandler(); 22 virtual ~DevToolsPowerHandler();
21 23
22 // PowerProfilerObserver override. 24 // PowerProfilerObserver override.
23 virtual void OnPowerEvent(const PowerEventVector&) OVERRIDE; 25 virtual void OnPowerEvent(const PowerEventVector&) OVERRIDE;
24 26
25 private: 27 private:
26 scoped_refptr<DevToolsProtocol::Response> OnStart( 28 scoped_refptr<DevToolsProtocol::Response> OnStart(
27 scoped_refptr<DevToolsProtocol::Command> command); 29 scoped_refptr<DevToolsProtocol::Command> command);
28 scoped_refptr<DevToolsProtocol::Response> OnEnd( 30 scoped_refptr<DevToolsProtocol::Response> OnEnd(
29 scoped_refptr<DevToolsProtocol::Command> command); 31 scoped_refptr<DevToolsProtocol::Command> command);
30 scoped_refptr<DevToolsProtocol::Response> OnCanProfilePower( 32 scoped_refptr<DevToolsProtocol::Response> OnCanProfilePower(
31 scoped_refptr<DevToolsProtocol::Command> command); 33 scoped_refptr<DevToolsProtocol::Command> command);
34 void OnDevToolsStateChanged(content::DevToolsAgentHost* agent_host,
35 bool attached);
36
37 DevToolsAgentHost* devtools_agent_host_;
38 base::Callback<void(content::DevToolsAgentHost*, bool)> devtools_callback_;
32 39
33 DISALLOW_COPY_AND_ASSIGN(DevToolsPowerHandler); 40 DISALLOW_COPY_AND_ASSIGN(DevToolsPowerHandler);
34 }; 41 };
35 42
36 } // namespace content 43 } // namespace content
37 44
38 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_POWER_HANDLER_H_ 45 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_POWER_HANDLER_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/devtools/devtools_power_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698