| Index: Source/bindings/core/v8/Dictionary.h
|
| diff --git a/Source/bindings/core/v8/Dictionary.h b/Source/bindings/core/v8/Dictionary.h
|
| index 5860f34414e00be8276216d35edc9ca8d684d6e0..172f8199eb8656e268472375e6359e68430a15ce 100644
|
| --- a/Source/bindings/core/v8/Dictionary.h
|
| +++ b/Source/bindings/core/v8/Dictionary.h
|
| @@ -29,6 +29,7 @@
|
| #include "bindings/core/v8/ExceptionMessages.h"
|
| #include "bindings/core/v8/ExceptionState.h"
|
| #include "bindings/core/v8/Nullable.h"
|
| +#include "bindings/core/v8/ScriptState.h"
|
| #include "bindings/core/v8/ScriptValue.h"
|
| #include "bindings/core/v8/V8Binding.h"
|
| #include "bindings/core/v8/V8BindingMacros.h"
|
| @@ -44,12 +45,12 @@ namespace blink {
|
| // Dictionary class provides ways to retrieve property values as C++ objects
|
| // from a V8 object. Instances of this class must not outlive V8's handle scope
|
| // because they hold a V8 value without putting it on persistent handles.
|
| -class Dictionary {
|
| +class Dictionary : public ScriptState::Observer {
|
| ALLOW_ONLY_INLINE_ALLOCATION();
|
| public:
|
| Dictionary();
|
| Dictionary(const v8::Handle<v8::Value>& options, v8::Isolate*, ExceptionState&);
|
| - ~Dictionary();
|
| + virtual ~Dictionary();
|
|
|
| Dictionary& operator=(const Dictionary&);
|
|
|
| @@ -120,11 +121,21 @@ public:
|
| bool hasProperty(const String&) const;
|
|
|
| v8::Isolate* isolate() const { return m_isolate; }
|
| + // Used by DictionaryHelper. This context could be an empty handle and
|
| + // should be used only for V8 APIs which return MaybeLocal<T>.
|
| + v8::Local<v8::Context> context() const { return m_context; }
|
|
|
| bool getKey(const String& key, v8::Local<v8::Value>&) const;
|
|
|
| private:
|
| + // ScriptState::Observer implementation
|
| + virtual void willDisposeScriptState(ScriptState*) override;
|
| +
|
| + void subscribeScriptStateDisposal();
|
| + void unsubscribeScriptStateDisposal();
|
| +
|
| v8::Handle<v8::Value> m_options;
|
| + v8::Local<v8::Context> m_context;
|
| v8::Isolate* m_isolate;
|
| ExceptionState* m_exceptionState;
|
| };
|
|
|