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

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

Issue 2697543003: Remove ToEventTarget (Closed)
Patch Set: Code review changes 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
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 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 Frame* toFrameIfNotDetached(v8::Local<v8::Context> context) { 785 Frame* toFrameIfNotDetached(v8::Local<v8::Context> context) {
786 DOMWindow* window = toDOMWindow(context); 786 DOMWindow* window = toDOMWindow(context);
787 if (window && window->isCurrentlyDisplayedInFrame()) 787 if (window && window->isCurrentlyDisplayedInFrame())
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) {
796 // We need to handle a DOMWindow specially, because a DOMWindow wrapper
797 // exists on a prototype chain of v8Value.
798 if (DOMWindow* window = toDOMWindow(isolate, value))
799 return window;
800 return V8EventTarget::toImplWithTypeCheck(isolate, value);
801 }
802
803 void toFlexibleArrayBufferView(v8::Isolate* isolate, 795 void toFlexibleArrayBufferView(v8::Isolate* isolate,
804 v8::Local<v8::Value> value, 796 v8::Local<v8::Value> value,
805 FlexibleArrayBufferView& result, 797 FlexibleArrayBufferView& result,
806 void* storage) { 798 void* storage) {
807 ASSERT(value->IsArrayBufferView()); 799 ASSERT(value->IsArrayBufferView());
808 v8::Local<v8::ArrayBufferView> buffer = value.As<v8::ArrayBufferView>(); 800 v8::Local<v8::ArrayBufferView> buffer = value.As<v8::ArrayBufferView>();
809 if (!storage) { 801 if (!storage) {
810 result.setFull(V8ArrayBufferView::toImpl(buffer)); 802 result.setFull(V8ArrayBufferView::toImpl(buffer));
811 return; 803 return;
812 } 804 }
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 if (!v8Call(v8::JSON::Parse(isolate, v8String(isolate, stringifiedJSON)), 1001 if (!v8Call(v8::JSON::Parse(isolate, v8String(isolate, stringifiedJSON)),
1010 parsed, tryCatch)) { 1002 parsed, tryCatch)) {
1011 if (tryCatch.HasCaught()) 1003 if (tryCatch.HasCaught())
1012 exceptionState.rethrowV8Exception(tryCatch.Exception()); 1004 exceptionState.rethrowV8Exception(tryCatch.Exception());
1013 } 1005 }
1014 1006
1015 return parsed; 1007 return parsed;
1016 } 1008 }
1017 1009
1018 } // namespace blink 1010 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698