Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/custom/V8MessageChannelCustom.cpp |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8MessageChannelCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8MessageChannelCustom.cpp |
| index bf00ad2f1470477e52ea16e9177e47f4ba5fe191..678943e617d9662802201e245cee5d8d32e66c5a 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/custom/V8MessageChannelCustom.cpp |
| +++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8MessageChannelCustom.cpp |
| @@ -31,8 +31,8 @@ |
| #include "bindings/core/v8/V8MessageChannel.h" |
| #include "bindings/core/v8/V8Binding.h" |
| -#include "bindings/core/v8/V8HiddenValue.h" |
| #include "bindings/core/v8/V8MessagePort.h" |
| +#include "bindings/core/v8/V8PrivateProperty.h" |
| #include "core/dom/MessageChannel.h" |
| #include "core/workers/WorkerGlobalScope.h" |
| #include "wtf/RefPtr.h" |
| @@ -41,8 +41,9 @@ namespace blink { |
| void V8MessageChannel::constructorCustom( |
| const v8::FunctionCallbackInfo<v8::Value>& info) { |
| - ExecutionContext* context = currentExecutionContext(info.GetIsolate()); |
| + v8::Isolate* isolate = info.GetIsolate(); |
| + ExecutionContext* context = currentExecutionContext(isolate); |
| MessageChannel* channel = MessageChannel::create(context); |
| v8::Local<v8::Object> wrapper = info.Holder(); |
| @@ -50,17 +51,16 @@ void V8MessageChannel::constructorCustom( |
| // Create references from the MessageChannel wrapper to the two |
| // MessagePort wrappers to make sure that the MessagePort wrappers |
| // stay alive as long as the MessageChannel wrapper is around. |
| - ScriptState* scriptState = ScriptState::current(info.GetIsolate()); |
| - V8HiddenValue::setHiddenValue( |
| - scriptState, wrapper, V8HiddenValue::port1(info.GetIsolate()), |
| - ToV8(channel->port1(), info.Holder(), info.GetIsolate())); |
| - V8HiddenValue::setHiddenValue( |
| - scriptState, wrapper, V8HiddenValue::port2(info.GetIsolate()), |
| - ToV8(channel->port2(), info.Holder(), info.GetIsolate())); |
| + ScriptState* scriptState = ScriptState::current(isolate); |
| + V8PrivateProperty::getMessagePort1(isolate).set( |
| + scriptState->context(), wrapper, |
|
Yuki
2017/03/28 14:10:50
For v8::Private APIs, you should simply use the cu
peria
2017/03/29 03:53:31
Done.
|
| + ToV8(channel->port1(), info.Holder(), isolate)); |
| + V8PrivateProperty::getMessagePort2(isolate).set( |
| + scriptState->context(), wrapper, |
| + ToV8(channel->port2(), info.Holder(), isolate)); |
| - v8SetReturnValue(info, |
| - V8DOMWrapper::associateObjectWithWrapper( |
| - info.GetIsolate(), channel, &wrapperTypeInfo, wrapper)); |
| + v8SetReturnValue(info, V8DOMWrapper::associateObjectWithWrapper( |
| + isolate, channel, &wrapperTypeInfo, wrapper)); |
| } |
| } // namespace blink |