Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp

Issue 2733763003: Reimplement [PutForwards] per spec (Closed)
Patch Set: avoid using v8::Maybe Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp
index 990560e9c7c46fd96cddd6b14e6bef88cef7c051..b6ddf3b8d85008fd1a8c7bff1097b9ebf44d6092 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp
@@ -70,19 +70,22 @@ static void locationAttributeSetter(v8::Local<v8::Value> v8Value, const v8::Func
ALLOW_UNUSED_LOCAL(isolate);
v8::Local<v8::Object> holder = info.Holder();
- TestInterfaceDocument* proxyImpl = V8TestInterfaceDocument::toImpl(holder);
- Location* impl = WTF::GetPtr(proxyImpl->location());
- if (!impl)
- return;
+ ALLOW_UNUSED_LOCAL(holder);
+ // [PutForwards] => location.href
ExceptionState exceptionState(isolate, ExceptionState::kSetterContext, "TestInterfaceDocument", "location");
-
- // Prepare the value to be set.
- V8StringResource<> cppValue = v8Value;
- if (!cppValue.Prepare())
+ v8::Local<v8::Value> target;
+ if (!holder->Get(isolate->GetCurrentContext(), V8String(isolate, "location")).ToLocal(&target))
+ return;
+ if (!target->IsObject()) {
+ exceptionState.ThrowTypeError("The attribute value is not an object");
+ return;
+ }
+ bool result;
+ if (!target.As<v8::Object>()->Set(isolate->GetCurrentContext(), V8String(isolate, "href"), v8Value).To(&result))
+ return;
+ if (!result)
return;
-
- impl->setHref(CurrentDOMWindow(info.GetIsolate()), EnteredDOMWindow(info.GetIsolate()), cppValue, exceptionState);
}
} // namespace TestInterfaceDocumentV8Internal

Powered by Google App Engine
This is Rietveld 408576698