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

Unified Diff: third_party/WebKit/public/platform/WebMemoryPressureLevel.h

Issue 2086833005: align WebMemoryPressureLevel with MemoryPressureListener::MemoryPressureLevel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add static_assert check Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/public/platform/DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/public/platform/WebMemoryPressureLevel.h
diff --git a/third_party/WebKit/public/platform/WebMemoryPressureLevel.h b/third_party/WebKit/public/platform/WebMemoryPressureLevel.h
index 7247eb4070c23f0a0084e02489b0bed11422f928..6911f856b9795f49cff60da1cc1d88644985e486 100644
--- a/third_party/WebKit/public/platform/WebMemoryPressureLevel.h
+++ b/third_party/WebKit/public/platform/WebMemoryPressureLevel.h
@@ -5,16 +5,28 @@
#ifndef WebMemoryPressureLevel_h
#define WebMemoryPressureLevel_h
+#include "base/memory/memory_pressure_listener.h"
+
namespace blink {
// These number must correspond to
// base::MemoryPressureListener::MemoryPressureLevel.
enum WebMemoryPressureLevel {
- WebMemoryPressureLevelNone = -1,
- WebMemoryPressureLevelModerate = 0,
- WebMemoryPressureLevelCritical = 2,
+ WebMemoryPressureLevelNone,
+ WebMemoryPressureLevelModerate,
+ WebMemoryPressureLevelCritical,
};
+static_assert(static_cast<WebMemoryPressureLevel>(
bashi 2016/06/23 05:07:37 Can you put these static aseerts in RenderThreadIm
+ base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE) ==
+ WebMemoryPressureLevelNone, "none level not align");
+static_assert(static_cast<WebMemoryPressureLevel>(
+ base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE) ==
+ WebMemoryPressureLevelModerate, "moderate level not align");
+static_assert(static_cast<WebMemoryPressureLevel>(
+ base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL) ==
+ WebMemoryPressureLevelCritical, "critical level not align");
+
} // namespace blink
#endif
« no previous file with comments | « third_party/WebKit/public/platform/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698