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

Side by Side Diff: third_party/WebKit/Source/platform/heap/Heap.cpp

Issue 1375643002: [tracing] directly use memory-infra from blink -> base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 23 matching lines...) Expand all
34 #include "platform/ScriptForbiddenScope.h" 34 #include "platform/ScriptForbiddenScope.h"
35 #include "platform/TraceEvent.h" 35 #include "platform/TraceEvent.h"
36 #include "platform/heap/BlinkGCMemoryDumpProvider.h" 36 #include "platform/heap/BlinkGCMemoryDumpProvider.h"
37 #include "platform/heap/CallbackStack.h" 37 #include "platform/heap/CallbackStack.h"
38 #include "platform/heap/MarkingVisitor.h" 38 #include "platform/heap/MarkingVisitor.h"
39 #include "platform/heap/PageMemory.h" 39 #include "platform/heap/PageMemory.h"
40 #include "platform/heap/PagePool.h" 40 #include "platform/heap/PagePool.h"
41 #include "platform/heap/SafePoint.h" 41 #include "platform/heap/SafePoint.h"
42 #include "platform/heap/ThreadState.h" 42 #include "platform/heap/ThreadState.h"
43 #include "public/platform/Platform.h" 43 #include "public/platform/Platform.h"
44 #include "public/platform/WebMemoryAllocatorDump.h"
45 #include "public/platform/WebProcessMemoryDump.h"
46 #include "wtf/Assertions.h" 44 #include "wtf/Assertions.h"
47 #include "wtf/DataLog.h" 45 #include "wtf/DataLog.h"
48 #include "wtf/LeakAnnotations.h" 46 #include "wtf/LeakAnnotations.h"
49 #include "wtf/MainThread.h" 47 #include "wtf/MainThread.h"
50 #include "wtf/Partitions.h" 48 #include "wtf/Partitions.h"
51 #include "wtf/PassOwnPtr.h" 49 #include "wtf/PassOwnPtr.h"
52 #if ENABLE(GC_PROFILING) 50 #if ENABLE(GC_PROFILING)
53 #include "platform/TracedValue.h" 51 #include "platform/TracedValue.h"
54 #include "wtf/HashMap.h" 52 #include "wtf/HashMap.h"
55 #include "wtf/HashSet.h" 53 #include "wtf/HashSet.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 s_markedObjectSizeAtLastCompleteSweep = 0; 166 s_markedObjectSizeAtLastCompleteSweep = 0;
169 s_wrapperCount = 0; 167 s_wrapperCount = 0;
170 s_wrapperCountAtLastGC = 0; 168 s_wrapperCountAtLastGC = 0;
171 s_collectedWrapperCount = 0; 169 s_collectedWrapperCount = 0;
172 s_partitionAllocSizeAtLastGC = WTF::Partitions::totalSizeOfCommittedPages(); 170 s_partitionAllocSizeAtLastGC = WTF::Partitions::totalSizeOfCommittedPages();
173 s_estimatedMarkingTimePerByte = 0.0; 171 s_estimatedMarkingTimePerByte = 0.0;
174 172
175 GCInfoTable::init(); 173 GCInfoTable::init();
176 174
177 if (Platform::current() && Platform::current()->currentThread()) 175 if (Platform::current() && Platform::current()->currentThread())
178 Platform::current()->registerMemoryDumpProvider(BlinkGCMemoryDumpProvide r::instance()); 176 base::trace_event::MemoryDumpProvider::RegisterOnCurrentThread(BlinkGCMe moryDumpProvider::instance());
179 } 177 }
180 178
181 void Heap::shutdown() 179 void Heap::shutdown()
182 { 180 {
183 if (Platform::current() && Platform::current()->currentThread()) 181 if (Platform::current() && Platform::current()->currentThread())
184 Platform::current()->unregisterMemoryDumpProvider(BlinkGCMemoryDumpProvi der::instance()); 182 base::trace_event::MemoryDumpProvider::Unregister(BlinkGCMemoryDumpProvi der::instance());
185 s_shutdownCalled = true; 183 s_shutdownCalled = true;
186 ThreadState::shutdownHeapIfNecessary(); 184 ThreadState::shutdownHeapIfNecessary();
187 } 185 }
188 186
189 void Heap::doShutdown() 187 void Heap::doShutdown()
190 { 188 {
191 // We don't want to call doShutdown() twice. 189 // We don't want to call doShutdown() twice.
192 if (!s_markingStack) 190 if (!s_markingStack)
193 return; 191 return;
194 192
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 size_t Heap::s_objectSizeAtLastGC = 0; 784 size_t Heap::s_objectSizeAtLastGC = 0;
787 size_t Heap::s_markedObjectSize = 0; 785 size_t Heap::s_markedObjectSize = 0;
788 size_t Heap::s_markedObjectSizeAtLastCompleteSweep = 0; 786 size_t Heap::s_markedObjectSizeAtLastCompleteSweep = 0;
789 size_t Heap::s_wrapperCount = 0; 787 size_t Heap::s_wrapperCount = 0;
790 size_t Heap::s_wrapperCountAtLastGC = 0; 788 size_t Heap::s_wrapperCountAtLastGC = 0;
791 size_t Heap::s_collectedWrapperCount = 0; 789 size_t Heap::s_collectedWrapperCount = 0;
792 size_t Heap::s_partitionAllocSizeAtLastGC = 0; 790 size_t Heap::s_partitionAllocSizeAtLastGC = 0;
793 double Heap::s_estimatedMarkingTimePerByte = 0.0; 791 double Heap::s_estimatedMarkingTimePerByte = 0.0;
794 792
795 } // namespace blink 793 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698