| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 v8::Handle<v8::Value> toV8(EventTarget* impl, v8::Handle<v8::Object> creationCon
text, v8::Isolate* isolate) | 39 v8::Handle<v8::Value> toV8(EventTarget* impl, v8::Handle<v8::Object> creationCon
text, v8::Isolate* isolate) |
| 40 { | 40 { |
| 41 if (UNLIKELY(!impl)) | 41 if (UNLIKELY(!impl)) |
| 42 return v8::Null(isolate); | 42 return v8::Null(isolate); |
| 43 | 43 |
| 44 // FIXME: This naming seems broken. | 44 // FIXME: This naming seems broken. |
| 45 if (impl->interfaceName() == EventTargetNames::LocalDOMWindow) | 45 if (impl->interfaceName() == EventTargetNames::LocalDOMWindow) |
| 46 return toV8(static_cast<DOMWindow*>(impl), creationContext, isolate); | 46 return toV8(static_cast<DOMWindow*>(impl), creationContext, isolate); |
| 47 | 47 |
| 48 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper(impl, isolate); | 48 v8::Local<v8::Value> wrapper = DOMDataStore::getWrapper(impl, isolate); |
| 49 if (!wrapper.IsEmpty()) | 49 if (!wrapper.IsEmpty()) |
| 50 return wrapper; | 50 return wrapper; |
| 51 return impl->wrap(creationContext, isolate); | 51 return impl->wrap(creationContext, isolate); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void V8EventTarget::addEventListenerMethodEpilogueCustom(const v8::FunctionCallb
ackInfo<v8::Value>& info, EventTarget* impl) | 54 void V8EventTarget::addEventListenerMethodEpilogueCustom(const v8::FunctionCallb
ackInfo<v8::Value>& info, EventTarget* impl) |
| 55 { | 55 { |
| 56 if (info.Length() >= 2 && info[1]->IsObject() && !impl->toNode()) | 56 if (info.Length() >= 2 && info[1]->IsObject() && !impl->toNode()) |
| 57 addHiddenValueToArray(info.GetIsolate(), info.Holder(), info[1], V8Event
Target::eventListenerCacheIndex); | 57 addHiddenValueToArray(info.GetIsolate(), info.Holder(), info[1], V8Event
Target::eventListenerCacheIndex); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void V8EventTarget::removeEventListenerMethodEpilogueCustom(const v8::FunctionCa
llbackInfo<v8::Value>& info, EventTarget* impl) | 60 void V8EventTarget::removeEventListenerMethodEpilogueCustom(const v8::FunctionCa
llbackInfo<v8::Value>& info, EventTarget* impl) |
| 61 { | 61 { |
| 62 if (info.Length() >= 2 && info[1]->IsObject() && !impl->toNode()) | 62 if (info.Length() >= 2 && info[1]->IsObject() && !impl->toNode()) |
| 63 removeHiddenValueFromArray(info.GetIsolate(), info.Holder(), info[1], V8
EventTarget::eventListenerCacheIndex); | 63 removeHiddenValueFromArray(info.GetIsolate(), info.Holder(), info[1], V8
EventTarget::eventListenerCacheIndex); |
| 64 } | 64 } |
| 65 | 65 |
| 66 } // namespace blink | 66 } // namespace blink |
| OLD | NEW |