Index: third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h |
diff --git a/third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h b/third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h |
index 8b372cae97afd35f8b0ec46379b5dfb2c015b6bc..f1825983d3cfbdd350d95092a58f9afe7fc8f833 100644 |
--- a/third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h |
+++ b/third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h |
@@ -40,7 +40,7 @@ |
#include "v8/include/v8.h" |
#include "wtf/Allocator.h" |
#include "wtf/Noncopyable.h" |
-#include "wtf/PtrUtil.h" |
+#include "wtf/Optional.h" |
#include "wtf/StackUtil.h" |
#include "wtf/StdLibExtras.h" |
@@ -52,11 +52,11 @@ class DOMDataStore { |
public: |
DOMDataStore(v8::Isolate* isolate, bool isMainWorld) |
- : m_isMainWorld(isMainWorld), |
- // We never use |m_wrapperMap| when it's the main world. |
- m_wrapperMap(WTF::wrapUnique( |
- isMainWorld ? nullptr |
- : new DOMWrapperMap<ScriptWrappable>(isolate))) {} |
+ : m_isMainWorld(isMainWorld) { |
+ // We never use |m_wrapperMap| when it's the main world. |
+ if (!isMainWorld) |
+ m_wrapperMap.emplace(isolate); |
+ } |
static DOMDataStore& current(v8::Isolate* isolate) { |
return DOMWrapperWorld::current(isolate).domDataStore(); |
@@ -169,7 +169,7 @@ class DOMDataStore { |
} |
bool m_isMainWorld; |
- std::unique_ptr<DOMWrapperMap<ScriptWrappable>> m_wrapperMap; |
+ WTF::Optional<DOMWrapperMap<ScriptWrappable>> m_wrapperMap; |
}; |
template <> |