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

Side by Side Diff: content/browser/devtools/protocol/memory_handler.cc

Issue 2590293003: [DevTools] Rework DevToolsSession interaction with domain handlers. (Closed)
Patch Set: addressed comments Created 3 years, 12 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/protocol/memory_handler.h" 5 #include "content/browser/devtools/protocol/memory_handler.h"
6 6
7 #include "base/memory/memory_pressure_listener.h" 7 #include "base/memory/memory_pressure_listener.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "content/browser/memory/memory_pressure_controller_impl.h" 9 #include "content/browser/memory/memory_pressure_controller_impl.h"
10 #include "content/public/common/content_features.h" 10 #include "content/public/common/content_features.h"
11 11
12 namespace content { 12 namespace content {
13 namespace protocol { 13 namespace protocol {
14 14
15 MemoryHandler::MemoryHandler() {} 15 MemoryHandler::MemoryHandler()
16 : DevToolsDomainHandler(Memory::Metainfo::domainName) {
17 }
16 18
17 MemoryHandler::~MemoryHandler() {} 19 MemoryHandler::~MemoryHandler() {}
18 20
19 void MemoryHandler::Wire(UberDispatcher* dispatcher) { 21 void MemoryHandler::Wire(UberDispatcher* dispatcher) {
20 Memory::Dispatcher::wire(dispatcher, this); 22 Memory::Dispatcher::wire(dispatcher, this);
21 } 23 }
22 24
25 void MemoryHandler::SetRenderFrameHost(RenderFrameHostImpl* host) {
26 }
27
23 Response MemoryHandler::Disable() { 28 Response MemoryHandler::Disable() {
24 return Response::OK(); 29 return Response::OK();
25 } 30 }
26 31
27 Response MemoryHandler::SetPressureNotificationsSuppressed( 32 Response MemoryHandler::SetPressureNotificationsSuppressed(
28 bool suppressed) { 33 bool suppressed) {
29 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) { 34 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) {
30 return Response::Error( 35 return Response::Error(
31 "Cannot enable/disable notifications when memory coordinator is " 36 "Cannot enable/disable notifications when memory coordinator is "
32 "enabled"); 37 "enabled");
(...skipping 15 matching lines...) Expand all
48 "Invalid memory pressure level '%s'", level.c_str())); 53 "Invalid memory pressure level '%s'", level.c_str()));
49 } 54 }
50 55
51 MemoryPressureControllerImpl::GetInstance() 56 MemoryPressureControllerImpl::GetInstance()
52 ->SimulatePressureNotificationInAllProcesses(parsed_level); 57 ->SimulatePressureNotificationInAllProcesses(parsed_level);
53 return Response::OK(); 58 return Response::OK();
54 } 59 }
55 60
56 } // namespace protocol 61 } // namespace protocol
57 } // namespace content 62 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698