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

Side by Side Diff: components/memory_coordinator/child/blink_memory_coordinator_client.cc

Issue 2094583002: Add MemoryCoordinator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gyp 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/memory_coordinator/child/blink_memory_coordinator_client.h"
6
7 #include "third_party/WebKit/public/platform/Platform.h"
8 #include "third_party/WebKit/public/web/WebMemoryCoordinator.h"
9
10 namespace memory_coordinator {
11
12 BlinkMemoryCoordinatorClient::BlinkMemoryCoordinatorClient() {}
13
14 BlinkMemoryCoordinatorClient::~BlinkMemoryCoordinatorClient() {}
15
16 void BlinkMemoryCoordinatorClient::OnMemoryStateChange(
17 mojom::MemoryState state) {
18 if (!blink::Platform::current()) {
19 return;
20 }
21
22 switch (state) {
23 case mojom::MemoryState::NORMAL:
24 blink::WebMemoryCoordinator::setAllocationMode(
haraken 2016/06/27 02:17:07 As commented in the other place, I want to make th
bashi 2016/06/27 03:49:29 That requires duplicate enums in public/web which
haraken 2016/06/27 04:48:33 But you're already introducing WebMemoryAllocation
bashi 2016/06/27 06:36:46 It's not going to be the same as mojom::MemoryStat
25 blink::WebMemoryAllocationMode::Normal);
26 break;
27 case mojom::MemoryState::THROTTLED:
28 blink::WebMemoryCoordinator::setAllocationMode(
29 blink::WebMemoryAllocationMode::Throttled);
30 break;
31 case mojom::MemoryState::UNKNOWN:
32 default:
33 LOG(WARNING) << "Unrecognized memory state: " << state;
34 }
35 }
36
37 } // namespace memory_coordinator
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698