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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp

Issue 2687873005: Remove eventTargetInheritance from WrapperTypeInfo (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 return window->frame(); 788 return window->frame();
789 // We return 0 here because |context| is detached from the Frame. If we 789 // We return 0 here because |context| is detached from the Frame. If we
790 // did return |frame| we could get in trouble because the frame could be 790 // did return |frame| we could get in trouble because the frame could be
791 // navigated to another security origin. 791 // navigated to another security origin.
792 return nullptr; 792 return nullptr;
793 } 793 }
794 794
795 EventTarget* toEventTarget(v8::Isolate* isolate, v8::Local<v8::Value> value) { 795 EventTarget* toEventTarget(v8::Isolate* isolate, v8::Local<v8::Value> value) {
796 // We need to handle a DOMWindow specially, because a DOMWindow wrapper 796 // We need to handle a DOMWindow specially, because a DOMWindow wrapper
797 // exists on a prototype chain of v8Value. 797 // exists on a prototype chain of v8Value.
798 if (DOMWindow* window = toDOMWindow(isolate, value)) 798 if (DOMWindow* window = toDOMWindow(isolate, value))
Yuki 2017/02/13 05:48:00 I think we no longer need this hack. https://crre
799 return window; 799 return window;
800 if (V8EventTarget::hasInstance(value, isolate)) { 800 return V8EventTarget::toImplWithTypeCheck(isolate, value);
801 v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(value);
802 const WrapperTypeInfo* wrapperTypeInfo = toWrapperTypeInfo(object);
803 if (wrapperTypeInfo->eventTargetInheritance ==
804 WrapperTypeInfo::NotInheritFromEventTarget)
805 return nullptr;
806 return static_cast<EventTarget*>(toScriptWrappable(object));
807 }
808 return nullptr;
809 } 801 }
810 802
811 void toFlexibleArrayBufferView(v8::Isolate* isolate, 803 void toFlexibleArrayBufferView(v8::Isolate* isolate,
812 v8::Local<v8::Value> value, 804 v8::Local<v8::Value> value,
813 FlexibleArrayBufferView& result, 805 FlexibleArrayBufferView& result,
814 void* storage) { 806 void* storage) {
815 ASSERT(value->IsArrayBufferView()); 807 ASSERT(value->IsArrayBufferView());
816 v8::Local<v8::ArrayBufferView> buffer = value.As<v8::ArrayBufferView>(); 808 v8::Local<v8::ArrayBufferView> buffer = value.As<v8::ArrayBufferView>();
817 if (!storage) { 809 if (!storage) {
818 result.setFull(V8ArrayBufferView::toImpl(buffer)); 810 result.setFull(V8ArrayBufferView::toImpl(buffer));
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1017 if (!v8Call(v8::JSON::Parse(isolate, v8String(isolate, stringifiedJSON)), 1009 if (!v8Call(v8::JSON::Parse(isolate, v8String(isolate, stringifiedJSON)),
1018 parsed, tryCatch)) { 1010 parsed, tryCatch)) {
1019 if (tryCatch.HasCaught()) 1011 if (tryCatch.HasCaught())
1020 exceptionState.rethrowV8Exception(tryCatch.Exception()); 1012 exceptionState.rethrowV8Exception(tryCatch.Exception());
1021 } 1013 }
1022 1014
1023 return parsed; 1015 return parsed;
1024 } 1016 }
1025 1017
1026 } // namespace blink 1018 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698