Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/modules/v8/custom/V8ExtendableMessageEventCustom.cpp |
| diff --git a/third_party/WebKit/Source/bindings/modules/v8/custom/V8ServiceWorkerMessageEventCustom.cpp b/third_party/WebKit/Source/bindings/modules/v8/custom/V8ExtendableMessageEventCustom.cpp |
| similarity index 75% |
| copy from third_party/WebKit/Source/bindings/modules/v8/custom/V8ServiceWorkerMessageEventCustom.cpp |
| copy to third_party/WebKit/Source/bindings/modules/v8/custom/V8ExtendableMessageEventCustom.cpp |
| index 6caffeb536c1e5e59b09fdea5838c980f39ada4d..b09992e9bba5ec24ac62910b9565a4648ef9d6c7 100644 |
| --- a/third_party/WebKit/Source/bindings/modules/v8/custom/V8ServiceWorkerMessageEventCustom.cpp |
| +++ b/third_party/WebKit/Source/bindings/modules/v8/custom/V8ExtendableMessageEventCustom.cpp |
| @@ -1,19 +1,19 @@ |
| -// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "bindings/modules/v8/V8ServiceWorkerMessageEvent.h" |
| +#include "bindings/modules/v8/V8ExtendableMessageEvent.h" |
| #include "bindings/core/v8/SerializedScriptValue.h" |
| #include "bindings/core/v8/SerializedScriptValueFactory.h" |
| #include "bindings/core/v8/V8HiddenValue.h" |
| -#include "bindings/modules/v8/V8ServiceWorkerMessageEventInit.h" |
| +#include "bindings/modules/v8/V8ExtendableMessageEventInit.h" |
| namespace blink { |
| -void V8ServiceWorkerMessageEvent::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& info) |
| +void V8ExtendableMessageEvent::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& info) |
|
bashi
2016/02/10 08:23:03
Is it possible to share the implementation with V8
nhiroki
2016/02/10 09:48:41
Thank you for your suggestion. I'm now trying to t
bashi
2016/02/10 10:21:07
Oops, I'll add it. Sorry for inconvenience.
|
| { |
| - ExceptionState exceptionState(ExceptionState::ConstructionContext, "ServiceWorkerMessageEvent", info.Holder(), info.GetIsolate()); |
| + ExceptionState exceptionState(ExceptionState::ConstructionContext, "ExtendableMessageEvent", info.Holder(), info.GetIsolate()); |
| if (UNLIKELY(info.Length() < 1)) { |
| setMinimumArityTypeError(exceptionState, 1, info.Length()); |
| exceptionState.throwIfNeeded(); |
| @@ -24,21 +24,21 @@ void V8ServiceWorkerMessageEvent::constructorCustom(const v8::FunctionCallbackIn |
| if (!type.prepare()) |
| return; |
| - ServiceWorkerMessageEventInit eventInitDict; |
| + ExtendableMessageEventInit eventInitDict; |
| if (!isUndefinedOrNull(info[1])) { |
| if (!info[1]->IsObject()) { |
| exceptionState.throwTypeError("parameter 2 ('eventInitDict') is not an object."); |
| exceptionState.throwIfNeeded(); |
| return; |
| } |
| - V8ServiceWorkerMessageEventInit::toImpl(info.GetIsolate(), info[1], eventInitDict, exceptionState); |
| + V8ExtendableMessageEventInit::toImpl(info.GetIsolate(), info[1], eventInitDict, exceptionState); |
| if (exceptionState.throwIfNeeded()) |
| return; |
| } |
| - RefPtrWillBeRawPtr<ServiceWorkerMessageEvent> impl = ServiceWorkerMessageEvent::create(type, eventInitDict); |
| + RefPtrWillBeRawPtr<ExtendableMessageEvent> impl = ExtendableMessageEvent::create(type, eventInitDict); |
| v8::Local<v8::Object> wrapper = info.Holder(); |
| - wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8ServiceWorkerMessageEvent::wrapperTypeInfo, wrapper); |
| + wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8ExtendableMessageEvent::wrapperTypeInfo, wrapper); |
| // TODO(bashi): Workaround for http://crbug.com/529941. We need to store |
| // |data| as a hidden value to avoid cycle references. |
| @@ -51,9 +51,9 @@ void V8ServiceWorkerMessageEvent::constructorCustom(const v8::FunctionCallbackIn |
| v8SetReturnValue(info, wrapper); |
| } |
| -void V8ServiceWorkerMessageEvent::dataAttributeGetterCustom(const v8::FunctionCallbackInfo<v8::Value>& info) |
| +void V8ExtendableMessageEvent::dataAttributeGetterCustom(const v8::FunctionCallbackInfo<v8::Value>& info) |
| { |
| - ServiceWorkerMessageEvent* event = V8ServiceWorkerMessageEvent::toImpl(info.Holder()); |
| + ExtendableMessageEvent* event = V8ExtendableMessageEvent::toImpl(info.Holder()); |
| v8::Isolate* isolate = info.GetIsolate(); |
| ScriptState* scriptState = ScriptState::current(isolate); |
| v8::Local<v8::Value> result = V8HiddenValue::getHiddenValue(scriptState, info.Holder(), V8HiddenValue::data(isolate)); |