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

Side by Side Diff: Source/core/timing/ConsoleMemory.cpp

Issue 1063513007: Oilpan: have Console be on the heap by default. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Console public inherits DOMWindowProperty Created 5 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/timing/ConsoleMemory.h ('k') | Source/core/workers/WorkerConsole.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 2015 The Chromium Authors. All rights reserved. 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 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 "config.h" 5 #include "config.h"
6 #include "core/timing/ConsoleMemory.h" 6 #include "core/timing/ConsoleMemory.h"
7 7
8 #include "core/frame/Console.h" 8 #include "core/frame/Console.h"
9 #include "core/timing/MemoryInfo.h" 9 #include "core/timing/MemoryInfo.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(ConsoleMemory);
14
15 DEFINE_TRACE(ConsoleMemory) 13 DEFINE_TRACE(ConsoleMemory)
16 { 14 {
17 visitor->trace(m_memory); 15 visitor->trace(m_memory);
18 WillBeHeapSupplement<Console>::trace(visitor); 16 HeapSupplement<Console>::trace(visitor);
19 } 17 }
20 18
21 // static 19 // static
22 ConsoleMemory& ConsoleMemory::from(Console& console) 20 ConsoleMemory& ConsoleMemory::from(Console& console)
23 { 21 {
24 ConsoleMemory* supplement = static_cast<ConsoleMemory*>(WillBeHeapSupplement <Console>::from(console, supplementName())); 22 ConsoleMemory* supplement = static_cast<ConsoleMemory*>(HeapSupplement<Conso le>::from(console, supplementName()));
25 if (!supplement) { 23 if (!supplement) {
26 supplement = new ConsoleMemory(); 24 supplement = new ConsoleMemory();
27 provideTo(console, supplementName(), adoptPtrWillBeNoop(supplement)); 25 provideTo(console, supplementName(), supplement);
28 } 26 }
29 return *supplement; 27 return *supplement;
30 } 28 }
31 29
32 // static 30 // static
33 MemoryInfo* ConsoleMemory::memory(Console& console) 31 MemoryInfo* ConsoleMemory::memory(Console& console)
34 { 32 {
35 return ConsoleMemory::from(console).memory(); 33 return ConsoleMemory::from(console).memory();
36 } 34 }
37 35
38 MemoryInfo* ConsoleMemory::memory() 36 MemoryInfo* ConsoleMemory::memory()
39 { 37 {
40 if (!m_memory) 38 if (!m_memory)
41 m_memory = MemoryInfo::create(); 39 m_memory = MemoryInfo::create();
42 40
43 return m_memory.get(); 41 return m_memory.get();
44 } 42 }
45 43
46 } // namespace blink 44 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/timing/ConsoleMemory.h ('k') | Source/core/workers/WorkerConsole.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698