OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
45 namespace blink { | 45 namespace blink { |
46 | 46 |
47 class Node; | 47 class Node; |
48 | 48 |
49 class DOMDataStore { | 49 class DOMDataStore { |
50 WTF_MAKE_NONCOPYABLE(DOMDataStore); | 50 WTF_MAKE_NONCOPYABLE(DOMDataStore); |
51 USING_FAST_MALLOC(DOMDataStore); | 51 USING_FAST_MALLOC(DOMDataStore); |
52 | 52 |
53 public: | 53 public: |
54 DOMDataStore(v8::Isolate* isolate, bool isMainWorld) | 54 DOMDataStore(v8::Isolate* isolate, bool isMainWorld) |
55 : m_isMainWorld(isMainWorld) | 55 : m_isMainWorld(isMainWorld), |
56 // We never use |m_wrapperMap| when it's the main world. | 56 // We never use |m_wrapperMap| when it's the main world. |
Nico
2016/10/05 01:20:08
Oh, looks like I missed this one when I reflowed c
| |
57 , | |
58 m_wrapperMap(wrapUnique( | 57 m_wrapperMap(wrapUnique( |
59 isMainWorld ? nullptr | 58 isMainWorld ? nullptr |
60 : new DOMWrapperMap<ScriptWrappable>(isolate))) {} | 59 : new DOMWrapperMap<ScriptWrappable>(isolate))) {} |
61 | 60 |
62 static DOMDataStore& current(v8::Isolate* isolate) { | 61 static DOMDataStore& current(v8::Isolate* isolate) { |
63 return DOMWrapperWorld::current(isolate).domDataStore(); | 62 return DOMWrapperWorld::current(isolate).domDataStore(); |
64 } | 63 } |
65 | 64 |
66 static bool setReturnValue(v8::ReturnValue<v8::Value> returnValue, | 65 static bool setReturnValue(v8::ReturnValue<v8::Value> returnValue, |
67 ScriptWrappable* object) { | 66 ScriptWrappable* object) { |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
250 DOMWrapperMap<ScriptWrappable>::PersistentValueMapTraits::DisposeWeak( | 249 DOMWrapperMap<ScriptWrappable>::PersistentValueMapTraits::DisposeWeak( |
251 const v8::WeakCallbackInfo<WeakCallbackDataType>& data) { | 250 const v8::WeakCallbackInfo<WeakCallbackDataType>& data) { |
252 auto wrapperTypeInfo = reinterpret_cast<WrapperTypeInfo*>( | 251 auto wrapperTypeInfo = reinterpret_cast<WrapperTypeInfo*>( |
253 data.GetInternalField(v8DOMWrapperTypeIndex)); | 252 data.GetInternalField(v8DOMWrapperTypeIndex)); |
254 wrapperTypeInfo->wrapperDestroyed(); | 253 wrapperTypeInfo->wrapperDestroyed(); |
255 } | 254 } |
256 | 255 |
257 } // namespace blink | 256 } // namespace blink |
258 | 257 |
259 #endif // DOMDataStore_h | 258 #endif // DOMDataStore_h |
OLD | NEW |