OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007-2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2007-2011 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 { | 283 { |
284 if (info.Length() < 1) | 284 if (info.Length() < 1) |
285 return; | 285 return; |
286 | 286 |
287 | 287 |
288 v8::Local<v8::Value> value = info[0]; | 288 v8::Local<v8::Value> value = info[0]; |
289 EventTarget* target = V8EventTarget::toImplWithTypeCheck(info.GetIsolate(),
value); | 289 EventTarget* target = V8EventTarget::toImplWithTypeCheck(info.GetIsolate(),
value); |
290 | 290 |
291 // We need to handle a LocalDOMWindow specially, because a LocalDOMWindow wr
apper exists on a prototype chain. | 291 // We need to handle a LocalDOMWindow specially, because a LocalDOMWindow wr
apper exists on a prototype chain. |
292 if (!target) | 292 if (!target) |
293 target = toDOMWindow(value, info.GetIsolate()); | 293 target = toDOMWindow(info.GetIsolate(), value); |
294 | 294 |
295 if (!target || !target->executionContext()) | 295 if (!target || !target->executionContext()) |
296 return; | 296 return; |
297 | 297 |
298 InjectedScriptHost* host = V8InjectedScriptHost::toImpl(info.Holder()); | 298 InjectedScriptHost* host = V8InjectedScriptHost::toImpl(info.Holder()); |
299 Vector<EventListenerInfo> listenersArray; | 299 Vector<EventListenerInfo> listenersArray; |
300 host->getEventListenersImpl(target, listenersArray); | 300 host->getEventListenersImpl(target, listenersArray); |
301 | 301 |
302 v8::Local<v8::Object> result = v8::Object::New(info.GetIsolate()); | 302 v8::Local<v8::Object> result = v8::Object::New(info.GetIsolate()); |
303 for (size_t i = 0; i < listenersArray.size(); ++i) { | 303 for (size_t i = 0; i < listenersArray.size(); ++i) { |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 void V8InjectedScriptHost::setNonEnumPropertyMethodCustom(const v8::FunctionCall
backInfo<v8::Value>& info) | 505 void V8InjectedScriptHost::setNonEnumPropertyMethodCustom(const v8::FunctionCall
backInfo<v8::Value>& info) |
506 { | 506 { |
507 if (info.Length() < 3 || !info[0]->IsObject() || !info[1]->IsString()) | 507 if (info.Length() < 3 || !info[0]->IsObject() || !info[1]->IsString()) |
508 return; | 508 return; |
509 | 509 |
510 v8::Local<v8::Object> object = info[0]->ToObject(info.GetIsolate()); | 510 v8::Local<v8::Object> object = info[0]->ToObject(info.GetIsolate()); |
511 object->ForceSet(info[1], info[2], v8::DontEnum); | 511 object->ForceSet(info[1], info[2], v8::DontEnum); |
512 } | 512 } |
513 | 513 |
514 } // namespace blink | 514 } // namespace blink |
OLD | NEW |