OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 20 matching lines...) Expand all Loading... |
31 #ifndef ScriptWrappable_h | 31 #ifndef ScriptWrappable_h |
32 #define ScriptWrappable_h | 32 #define ScriptWrappable_h |
33 | 33 |
34 #include "bindings/v8/V8Utilities.h" | 34 #include "bindings/v8/V8Utilities.h" |
35 #include "bindings/v8/WrapperTypeInfo.h" | 35 #include "bindings/v8/WrapperTypeInfo.h" |
36 #include "core/dom/WebCoreMemoryInstrumentation.h" | 36 #include "core/dom/WebCoreMemoryInstrumentation.h" |
37 #include <v8.h> | 37 #include <v8.h> |
38 | 38 |
39 namespace WebCore { | 39 namespace WebCore { |
40 | 40 |
41 class ScriptWrappable { | 41 class ScriptWrappable : public MemoryReporterTag { |
42 friend class WeakHandleListener<ScriptWrappable>; | 42 friend class WeakHandleListener<ScriptWrappable>; |
43 public: | 43 public: |
44 ScriptWrappable() : m_maskedStorage(0) { } | 44 ScriptWrappable() : m_maskedStorage(0) { } |
45 | 45 |
46 // Wrappables need to be initialized with their most derrived type for which | 46 // Wrappables need to be initialized with their most derrived type for which |
47 // bindings exist, in much the same way that certain other types need to be | 47 // bindings exist, in much the same way that certain other types need to be |
48 // adopted and so forth. The overloaded initializeScriptWrappableForInterfac
e() | 48 // adopted and so forth. The overloaded initializeScriptWrappableForInterfac
e() |
49 // functions are implemented by the generated V8 bindings code. Declaring th
e | 49 // functions are implemented by the generated V8 bindings code. Declaring th
e |
50 // extern function in the template avoids making a centralized header of all | 50 // extern function in the template avoids making a centralized header of all |
51 // the bindings in the universe. C++11's extern template feature may provide | 51 // the bindings in the universe. C++11's extern template feature may provide |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 key->disposeWrapper(value, isolate, info); | 197 key->disposeWrapper(value, isolate, info); |
198 // FIXME: I noticed that 50%~ of minor GC cycle times can be consumed | 198 // FIXME: I noticed that 50%~ of minor GC cycle times can be consumed |
199 // inside key->deref(), which causes Node destructions. We should | 199 // inside key->deref(), which causes Node destructions. We should |
200 // make Node destructions incremental. | 200 // make Node destructions incremental. |
201 info->derefObject(object); | 201 info->derefObject(object); |
202 } | 202 } |
203 | 203 |
204 } // namespace WebCore | 204 } // namespace WebCore |
205 | 205 |
206 #endif // ScriptWrappable_h | 206 #endif // ScriptWrappable_h |
OLD | NEW |