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

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 2086833005: align WebMemoryPressureLevel with MemoryPressureListener::MemoryPressureLevel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: check in render_thread_impl.cc 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/public/platform/WebMemoryPressureLevel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer/render_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 static_assert(static_cast<v8::MemoryPressureLevel>( 255 static_assert(static_cast<v8::MemoryPressureLevel>(
256 base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE) == 256 base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE) ==
257 v8::MemoryPressureLevel::kNone, "none level not align"); 257 v8::MemoryPressureLevel::kNone, "none level not align");
258 static_assert(static_cast<v8::MemoryPressureLevel>( 258 static_assert(static_cast<v8::MemoryPressureLevel>(
259 base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE) == 259 base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE) ==
260 v8::MemoryPressureLevel::kModerate, "moderate level not align"); 260 v8::MemoryPressureLevel::kModerate, "moderate level not align");
261 static_assert(static_cast<v8::MemoryPressureLevel>( 261 static_assert(static_cast<v8::MemoryPressureLevel>(
262 base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL) == 262 base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL) ==
263 v8::MemoryPressureLevel::kCritical, "critical level not align"); 263 v8::MemoryPressureLevel::kCritical, "critical level not align");
264 264
265 // WebMemoryPressureLevel should correspond to base::MemoryPressureListener.
266 static_assert(static_cast<blink::WebMemoryPressureLevel>(
267 base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE) ==
268 blink::WebMemoryPressureLevelNone,
269 "blink::WebMemoryPressureLevelNone not align");
270 static_assert(static_cast<blink::WebMemoryPressureLevel>(
271 base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE) ==
272 blink::WebMemoryPressureLevelModerate,
273 "blink::WebMemoryPressureLevelModerate not align");
274 static_assert(static_cast<blink::WebMemoryPressureLevel>(
275 base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL) ==
276 blink::WebMemoryPressureLevelCritical,
277 "blink::WebMemoryPressureLevelCritical not align");
278
265 class WebThreadForCompositor : public WebThreadImplForWorkerScheduler { 279 class WebThreadForCompositor : public WebThreadImplForWorkerScheduler {
266 public: 280 public:
267 explicit WebThreadForCompositor(base::Thread::Options options) 281 explicit WebThreadForCompositor(base::Thread::Options options)
268 : WebThreadImplForWorkerScheduler("Compositor", options) { 282 : WebThreadImplForWorkerScheduler("Compositor", options) {
269 Init(); 283 Init();
270 } 284 }
271 ~WebThreadForCompositor() override {} 285 ~WebThreadForCompositor() override {}
272 286
273 private: 287 private:
274 // WebThreadImplForWorkerScheduler: 288 // WebThreadImplForWorkerScheduler:
(...skipping 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after
2213 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical) 2227 v8_memory_pressure_level == v8::MemoryPressureLevel::kCritical)
2214 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate; 2228 v8_memory_pressure_level = v8::MemoryPressureLevel::kModerate;
2215 2229
2216 blink::mainThreadIsolate()->MemoryPressureNotification( 2230 blink::mainThreadIsolate()->MemoryPressureNotification(
2217 v8_memory_pressure_level); 2231 v8_memory_pressure_level);
2218 blink::MemoryPressureNotificationToWorkerThreadIsolates( 2232 blink::MemoryPressureNotificationToWorkerThreadIsolates(
2219 v8_memory_pressure_level); 2233 v8_memory_pressure_level);
2220 } 2234 }
2221 2235
2222 } // namespace content 2236 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/public/platform/WebMemoryPressureLevel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698