Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |