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

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

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: Patch for landing! 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
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 #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
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
OLDNEW
« no previous file with comments | « content/browser/devtools/devtools_power_handler.h ('k') | content/browser/devtools/render_view_devtools_agent_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698