OLD | NEW |
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 #include "content/browser/devtools/devtools_power_handler.h" | 5 #include "content/browser/devtools/devtools_power_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "content/browser/devtools/devtools_protocol_constants.h" | 9 #include "content/browser/devtools/devtools_protocol_constants.h" |
10 #include "content/browser/power_profiler/power_profiler_service.h" | 10 #include "content/browser/power_profiler/power_profiler_service.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 scoped_refptr<DevToolsProtocol::Response> | 73 scoped_refptr<DevToolsProtocol::Response> |
74 DevToolsPowerHandler::OnCanProfilePower( | 74 DevToolsPowerHandler::OnCanProfilePower( |
75 scoped_refptr<DevToolsProtocol::Command> command) { | 75 scoped_refptr<DevToolsProtocol::Command> command) { |
76 base::DictionaryValue* result = new base::DictionaryValue(); | 76 base::DictionaryValue* result = new base::DictionaryValue(); |
77 result->SetBoolean(devtools::kResult, | 77 result->SetBoolean(devtools::kResult, |
78 PowerProfilerService::GetInstance()->IsAvailable()); | 78 PowerProfilerService::GetInstance()->IsAvailable()); |
79 | 79 |
80 return command->SuccessResponse(result); | 80 return command->SuccessResponse(result); |
81 } | 81 } |
82 | 82 |
| 83 void DevToolsPowerHandler::OnClientDetached() { |
| 84 PowerProfilerService::GetInstance()->RemoveObserver(this); |
| 85 } |
| 86 |
83 } // namespace content | 87 } // namespace content |
OLD | NEW |