提交 4d27846f 编写于 作者: E Eric Seidel

Remove Heap.h

Had to move a couple macros into Handle.h
(which we won't be able to remove for
a while yet), but otherwise Heap is dead.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/681113004
上级 26813e1c
......@@ -79,14 +79,6 @@ protected:
HashCountedSet<IntSize> m_sizes; // A count of how many times a given image size is in use.
RenderObjectSizeCountMap m_clients; // A map from RenderObjects (with entry count) to image sizes.
HashMap<IntSize, RefPtr<Image> > m_images; // A cache of Image objects by image size.
#if ENABLE(OILPAN)
// FIXME: Oilpan: when/if we can make the renderer point directly to the CSSImageGenerator value using
// a member we don't need to have this hack where we keep a persistent to the instance as long as
// there are clients in the RenderObjectSizeCountMap.
GC_PLUGIN_IGNORE("366546")
OwnPtr<Persistent<CSSImageGeneratorValue> > m_keepAlive;
#endif
};
DEFINE_CSS_VALUE_TYPE_CASTS(CSSImageGeneratorValue, isImageGeneratorValue());
......
......@@ -25,6 +25,8 @@
#include "core/events/EventTarget.h"
#include "platform/heap/Handle.h"
#include "wtf/Forward.h"
#include "wtf/LinkedHashSet.h"
#include "wtf/ListHashSet.h"
#include "wtf/RefCounted.h"
#include "wtf/RefPtr.h"
......
......@@ -22,8 +22,11 @@
#include "platform/heap/Handle.h"
#include "wtf/Forward.h"
#include "wtf/LinkedHashSet.h"
#include "wtf/ListHashSet.h"
#include "wtf/RefCounted.h"
namespace blink {
class Document;
......
......@@ -32,12 +32,13 @@
#include "bindings/core/v8/ScriptState.h"
#include "bindings/core/v8/ScriptWrappable.h"
#include "core/inspector/ConsoleAPITypes.h"
#include "core/inspector/ScriptCallStack.h"
#include "core/frame/ConsoleTypes.h"
#include "core/frame/DOMWindowProperty.h"
#include "core/inspector/ConsoleAPITypes.h"
#include "core/inspector/ScriptCallStack.h"
#include "platform/heap/Handle.h"
#include "wtf/Forward.h"
#include "wtf/HashCountedSet.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
......
......@@ -124,10 +124,6 @@ private:
Timer<AsyncMethodRunner<TargetClass> > m_timer;
// FIXME: oilpan: AsyncMethodRunner should be moved to the heap and m_object should be traced.
// This raw pointer is safe as long as AsyncMethodRunner<X> is held by the X itself
// (That's the case in the current code base).
GC_PLUGIN_IGNORE("363031")
TargetClass* m_object;
TargetMethod m_method;
......
......@@ -174,7 +174,6 @@ public:
// FIXME: Oilpan: Make private and remove this ignore once PersistentHeapSupplementable is removed again.
protected:
GC_PLUGIN_IGNORE("")
typename SupplementableTraits<T, isGarbageCollected>::SupplementMap m_supplements;
#if ENABLE(ASSERT)
......@@ -193,7 +192,7 @@ class Supplement : public SupplementBase<T, false> { };
// This class is used to make an off-heap class supplementable with off-heap
// supplements (Supplement).
template<typename T>
class GC_PLUGIN_IGNORE("http://crbug.com/395036") Supplementable : public SupplementableBase<T, false> {
class Supplementable : public SupplementableBase<T, false> {
};
} // namespace blink
......
......@@ -124,10 +124,6 @@ public:
private:
virtual void fired() override { (m_object->*m_function)(this); }
// FIXME: oilpan: TimerBase should be moved to the heap and m_object should be traced.
// This raw pointer is safe as long as Timer<X> is held by the X itself (That's the case
// in the current code base).
GC_PLUGIN_IGNORE("363031")
TimerFiredClass* m_object;
TimerFiredFunction m_function;
};
......@@ -180,10 +176,8 @@ private:
(m_object->*m_function)(this);
}
// FIXME: oilpan: TimerBase should be moved to the heap and m_object should be traced.
// This raw pointer is safe as long as Timer<X> is held by the X itself (That's the case
// in the current code base).
GC_PLUGIN_IGNORE("363031")
TimerFiredClass* m_object;
TimerFiredFunction m_function;
......
......@@ -31,7 +31,6 @@
#ifndef Handle_h
#define Handle_h
#include "platform/heap/Heap.h"
#include "platform/heap/ThreadState.h"
#include "platform/heap/Visitor.h"
#include "wtf/Functional.h"
......@@ -41,6 +40,62 @@
#include "wtf/RefCounted.h"
#include "wtf/TypeTraits.h"
// Classes that contain heap references but aren't themselves heap
// allocated, have some extra macros available which allows their use
// to be restricted to cases where the garbage collector is able
// to discover their heap references.
//
// STACK_ALLOCATED(): Use if the object is only stack allocated. Heap objects
// should be in Members but you do not need the trace method as they are on
// the stack. (Down the line these might turn in to raw pointers, but for
// now Members indicates that we have thought about them and explicitly
// taken care of them.)
//
// DISALLOW_ALLOCATION(): Cannot be allocated with new operators but can
// be a part object. If it has Members you need a trace method and the
// containing object needs to call that trace method.
//
// ALLOW_ONLY_INLINE_ALLOCATION(): Allows only placement new operator.
// This disallows general allocation of this object but allows to put
// the object as a value object in collections. If these have Members you
// need to have a trace method. That trace method will be called
// automatically by the Heap collections.
//
#define DISALLOW_ALLOCATION() \
private: \
void* operator new(size_t) = delete; \
void* operator new(size_t, NotNullTag, void*) = delete; \
void* operator new(size_t, void*) = delete;
#define ALLOW_ONLY_INLINE_ALLOCATION() \
public: \
void* operator new(size_t, NotNullTag, void* location) { return location; } \
void* operator new(size_t, void* location) { return location; } \
private: \
void* operator new(size_t) = delete;
#define STATIC_ONLY(Type) \
private: \
Type() = delete;
// These macros insert annotations that the Blink GC plugin for clang uses for
// verification. STACK_ALLOCATED is used to declare that objects of this type
// are always stack allocated. GC_PLUGIN_IGNORE is used to make the plugin
// ignore a particular class or field when checking for proper usage. When using
// GC_PLUGIN_IGNORE a bug-number should be provided as an argument where the
// bug describes what needs to happen to remove the GC_PLUGIN_IGNORE again.
#if COMPILER(CLANG)
#define STACK_ALLOCATED() \
private: \
__attribute__((annotate("blink_stack_allocated"))) \
void* operator new(size_t) = delete; \
void* operator new(size_t, NotNullTag, void*) = delete; \
void* operator new(size_t, void*) = delete;
#else
#define STACK_ALLOCATED() DISALLOW_ALLOCATION()
#endif
namespace blink {
template<typename T> class HeapTerminatedArray;
......@@ -210,7 +265,7 @@ private:
//
// We have to construct and destruct Persistent with default RootsAccessor in
// the same thread.
template<typename T, typename RootsAccessor /* = ThreadLocalPersistents<ThreadingTrait<T>::Affinity > */ >
template<typename T, typename RootsAccessor = ThreadLocalPersistents<ThreadingTrait<T>::Affinity > >
class Persistent : public PersistentBase<RootsAccessor, Persistent<T, RootsAccessor> > {
WTF_DISALLOW_CONSTRUCTION_FROM_ZERO(Persistent);
WTF_DISALLOW_ZERO_ASSIGNMENT(Persistent);
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册