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

Unified Diff: content/browser/devtools/protocol/memory_handler.cc

Issue 2515613006: [DevTools] Move Memory, SystemInfo and Tethering domains to new generator. (Closed)
Patch Set: fixed review comments Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/devtools/protocol/memory_handler.cc
diff --git a/content/browser/devtools/protocol/memory_handler.cc b/content/browser/devtools/protocol/memory_handler.cc
index 58a12fd9c29a43edccd4caecc9838241215d7f45..2a92df14e623d8c2282b08cf4dee2a7bfdd527fa 100644
--- a/content/browser/devtools/protocol/memory_handler.cc
+++ b/content/browser/devtools/protocol/memory_handler.cc
@@ -10,17 +10,24 @@
#include "content/public/common/content_features.h"
namespace content {
-namespace devtools {
-namespace memory {
+namespace protocol {
MemoryHandler::MemoryHandler() {}
MemoryHandler::~MemoryHandler() {}
-MemoryHandler::Response MemoryHandler::SetPressureNotificationsSuppressed(
+void MemoryHandler::Wire(UberDispatcher* dispatcher) {
+ Memory::Dispatcher::wire(dispatcher, this);
+}
+
+Response MemoryHandler::Disable() {
+ return Response::OK();
+}
+
+Response MemoryHandler::SetPressureNotificationsSuppressed(
bool suppressed) {
if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) {
- return Response::InvalidParams(
+ return Response::Error(
"Cannot enable/disable notifications when memory coordinator is "
"enabled");
}
@@ -29,15 +36,15 @@ MemoryHandler::Response MemoryHandler::SetPressureNotificationsSuppressed(
return Response::OK();
}
-MemoryHandler::Response MemoryHandler::SimulatePressureNotification(
+Response MemoryHandler::SimulatePressureNotification(
const std::string& level) {
base::MemoryPressureListener::MemoryPressureLevel parsed_level;
- if (level == kPressureLevelModerate) {
+ if (level == protocol::Memory::PressureLevelEnum::Moderate) {
parsed_level = base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE;
- } else if (level == kPressureLevelCritical) {
+ } else if (level == protocol::Memory::PressureLevelEnum::Critical) {
parsed_level = base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL;
} else {
- return Response::InternalError(base::StringPrintf(
+ return Response::InvalidParams(base::StringPrintf(
"Invalid memory pressure level '%s'", level.c_str()));
}
@@ -46,13 +53,5 @@ MemoryHandler::Response MemoryHandler::SimulatePressureNotification(
return Response::OK();
}
-MemoryHandler::Response MemoryHandler::GetDOMCounters(
- int* documents,
- int* nodes,
- int* event_listeners) {
- return Response::FallThrough();
-}
-
-} // namespace memory
-} // namespace devtools
+} // namespace protocol
} // namespace content
« no previous file with comments | « content/browser/devtools/protocol/memory_handler.h ('k') | content/browser/devtools/protocol/system_info_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698