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 28 matching lines...) Expand all Loading... |
39 #include "wtf/StdLibExtras.h" | 39 #include "wtf/StdLibExtras.h" |
40 #include <v8.h> | 40 #include <v8.h> |
41 | 41 |
42 namespace blink { | 42 namespace blink { |
43 | 43 |
44 class Node; | 44 class Node; |
45 | 45 |
46 class DOMDataStore { | 46 class DOMDataStore { |
47 WTF_MAKE_NONCOPYABLE(DOMDataStore); | 47 WTF_MAKE_NONCOPYABLE(DOMDataStore); |
48 public: | 48 public: |
49 explicit DOMDataStore(bool isMainWorld) | 49 DOMDataStore(v8::Isolate* isolate, bool isMainWorld) |
50 : m_isMainWorld(isMainWorld) | 50 : m_isMainWorld(isMainWorld) |
51 , m_wrapperMap(v8::Isolate::GetCurrent()) { } | 51 , m_wrapperMap(isolate) { } |
52 ~DOMDataStore() | 52 ~DOMDataStore() |
53 { | 53 { |
54 // We never actually destruct the main world's DOMDataStore. | 54 // We never actually destruct the main world's DOMDataStore. |
55 ASSERT(!m_isMainWorld); | 55 ASSERT(!m_isMainWorld); |
56 m_wrapperMap.clear(); | 56 m_wrapperMap.clear(); |
57 } | 57 } |
58 | 58 |
59 static DOMDataStore& current(v8::Isolate* isolate) | 59 static DOMDataStore& current(v8::Isolate* isolate) |
60 { | 60 { |
61 return DOMWrapperWorld::current(isolate).domDataStore(); | 61 return DOMWrapperWorld::current(isolate).domDataStore(); |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 v8::UniquePersistent<v8::Object> value, | 276 v8::UniquePersistent<v8::Object> value, |
277 ScriptWrappableBase* key) | 277 ScriptWrappableBase* key) |
278 { | 278 { |
279 RELEASE_ASSERT(!value.IsEmpty()); // See crbug.com/368095. | 279 RELEASE_ASSERT(!value.IsEmpty()); // See crbug.com/368095. |
280 releaseObject(v8::Local<v8::Object>::New(isolate, value)); | 280 releaseObject(v8::Local<v8::Object>::New(isolate, value)); |
281 } | 281 } |
282 | 282 |
283 } // namespace blink | 283 } // namespace blink |
284 | 284 |
285 #endif // DOMDataStore_h | 285 #endif // DOMDataStore_h |
OLD | NEW |