Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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)) |
| 799 return static_cast<EventTarget*>(window); | 799 return static_cast<EventTarget*>(window); |
|
jbroman
2017/02/10 16:04:27
nit: While you're here, you could remove this stat
adithyas
2017/02/10 18:39:49
Removed it.
| |
| 800 if (V8EventTarget::hasInstance(value, isolate)) { | 800 if (V8EventTarget::hasInstance(value, isolate)) { |
| 801 v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(value); | 801 v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(value); |
| 802 return toWrapperTypeInfo(object)->toEventTarget(object); | 802 return EventTarget::toEventTarget(object); |
|
jbroman
2017/02/10 16:03:16
Given that, you can inline the other toEventTarget
adithyas
2017/02/10 18:39:49
Done! I'll remove the wrapperType eventTargetInher
| |
| 803 } | 803 } |
| 804 return 0; | 804 return 0; |
| 805 } | 805 } |
| 806 | 806 |
| 807 void toFlexibleArrayBufferView(v8::Isolate* isolate, | 807 void toFlexibleArrayBufferView(v8::Isolate* isolate, |
| 808 v8::Local<v8::Value> value, | 808 v8::Local<v8::Value> value, |
| 809 FlexibleArrayBufferView& result, | 809 FlexibleArrayBufferView& result, |
| 810 void* storage) { | 810 void* storage) { |
| 811 ASSERT(value->IsArrayBufferView()); | 811 ASSERT(value->IsArrayBufferView()); |
| 812 v8::Local<v8::ArrayBufferView> buffer = value.As<v8::ArrayBufferView>(); | 812 v8::Local<v8::ArrayBufferView> buffer = value.As<v8::ArrayBufferView>(); |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1013 if (!v8Call(v8::JSON::Parse(isolate, v8String(isolate, stringifiedJSON)), | 1013 if (!v8Call(v8::JSON::Parse(isolate, v8String(isolate, stringifiedJSON)), |
| 1014 parsed, tryCatch)) { | 1014 parsed, tryCatch)) { |
| 1015 if (tryCatch.HasCaught()) | 1015 if (tryCatch.HasCaught()) |
| 1016 exceptionState.rethrowV8Exception(tryCatch.Exception()); | 1016 exceptionState.rethrowV8Exception(tryCatch.Exception()); |
| 1017 } | 1017 } |
| 1018 | 1018 |
| 1019 return parsed; | 1019 return parsed; |
| 1020 } | 1020 } |
| 1021 | 1021 |
| 1022 } // namespace blink | 1022 } // namespace blink |
| OLD | NEW |