| OLD | NEW |
| 1 /* | 1 /* |
| 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 // Override operator new to allocate CSSValue subtype objects onto | 37 // Override operator new to allocate CSSValue subtype objects onto |
| 38 // a dedicated heap. | 38 // a dedicated heap. |
| 39 GC_PLUGIN_IGNORE("crbug.com/443854") | 39 GC_PLUGIN_IGNORE("crbug.com/443854") |
| 40 void* operator new(size_t size) | 40 void* operator new(size_t size) |
| 41 { | 41 { |
| 42 return allocateObject(size, false); | 42 return allocateObject(size, false); |
| 43 } | 43 } |
| 44 static void* allocateObject(size_t size, bool isEager) | 44 static void* allocateObject(size_t size, bool isEager) |
| 45 { | 45 { |
| 46 ThreadState* state = ThreadStateFor<ThreadingTrait<CSSValue>::Affinity>:
:state(); | 46 ThreadState* state = ThreadStateFor<ThreadingTrait<CSSValue>::Affinity>:
:state(); |
| 47 return Heap::allocateOnHeapIndex(state, size, isEager ? BlinkGC::EagerSw
eepHeapIndex : BlinkGC::CSSValueHeapIndex, GCInfoTrait<CSSValue>::index()); | 47 Address address = Heap::allocateOnHeapIndex(state, size, isEager ? Blink
GC::EagerSweepHeapIndex : BlinkGC::CSSValueHeapIndex, GCInfoTrait<CSSValue>::ind
ex()); |
| 48 const char* typeName = WTF_HEAP_PROFILER_TYPE_NAME(CSSValue); |
| 49 HeapAllocHooks::allocationHookIfEnabled(address, size, typeName); |
| 50 return address; |
| 48 } | 51 } |
| 49 #else | 52 #else |
| 50 USING_FAST_MALLOC_WITH_TYPE_NAME(blink::CSSValue); | 53 USING_FAST_MALLOC_WITH_TYPE_NAME(blink::CSSValue); |
| 51 public: | 54 public: |
| 52 // Override RefCounted's deref() to ensure operator delete is called on | 55 // Override RefCounted's deref() to ensure operator delete is called on |
| 53 // the appropriate subclass type. | 56 // the appropriate subclass type. |
| 54 void deref() | 57 void deref() |
| 55 { | 58 { |
| 56 if (derefBase()) | 59 if (derefBase()) |
| 57 destroy(); | 60 destroy(); |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 return false; | 270 return false; |
| 268 return first->equals(*second); | 271 return first->equals(*second); |
| 269 } | 272 } |
| 270 | 273 |
| 271 #define DEFINE_CSS_VALUE_TYPE_CASTS(thisType, predicate) \ | 274 #define DEFINE_CSS_VALUE_TYPE_CASTS(thisType, predicate) \ |
| 272 DEFINE_TYPE_CASTS(thisType, CSSValue, value, value->predicate, value.predica
te) | 275 DEFINE_TYPE_CASTS(thisType, CSSValue, value, value->predicate, value.predica
te) |
| 273 | 276 |
| 274 } // namespace blink | 277 } // namespace blink |
| 275 | 278 |
| 276 #endif // CSSValue_h | 279 #endif // CSSValue_h |
| OLD | NEW |