OLD | NEW |
| (Empty) |
1 // Copyright 2015 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 "core/timing/ConsoleMemory.h" | |
6 | |
7 #include "core/frame/Console.h" | |
8 #include "core/timing/MemoryInfo.h" | |
9 | |
10 namespace blink { | |
11 | |
12 // static | |
13 ConsoleMemory& ConsoleMemory::from(Console& console) | |
14 { | |
15 ConsoleMemory* supplement = static_cast<ConsoleMemory*>(Supplement<Console>:
:from(console, supplementName())); | |
16 if (!supplement) { | |
17 supplement = new ConsoleMemory(); | |
18 provideTo(console, supplementName(), supplement); | |
19 } | |
20 return *supplement; | |
21 } | |
22 | |
23 // static | |
24 MemoryInfo* ConsoleMemory::memory(Console& console) | |
25 { | |
26 return ConsoleMemory::from(console).memory(); | |
27 } | |
28 | |
29 MemoryInfo* ConsoleMemory::memory() | |
30 { | |
31 return MemoryInfo::create(); | |
32 } | |
33 | |
34 } // namespace blink | |
OLD | NEW |