OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
310 return false; | 310 return false; |
311 | 311 |
312 TONATIVE_DEFAULT(v8::Local<v8::Number>, v8Number, v8Value->ToNumber(), false ); | 312 TONATIVE_DEFAULT(v8::Local<v8::Number>, v8Number, v8Value->ToNumber(), false ); |
313 if (v8Number.IsEmpty()) | 313 if (v8Number.IsEmpty()) |
314 return false; | 314 return false; |
315 double d = v8Number->Value(); | 315 double d = v8Number->Value(); |
316 doubleToInteger(d, value); | 316 doubleToInteger(d, value); |
317 return true; | 317 return true; |
318 } | 318 } |
319 | 319 |
320 bool Dictionary::get(const String& key, RefPtrWillBeMember<DOMWindow>& value) co nst | 320 bool Dictionary::get(const String& key, RefPtrWillBeMember<LocalDOMWindow>& valu e) const |
321 { | 321 { |
322 v8::Local<v8::Value> v8Value; | 322 v8::Local<v8::Value> v8Value; |
323 if (!getKey(key, v8Value)) | 323 if (!getKey(key, v8Value)) |
324 return false; | 324 return false; |
325 | 325 |
326 // We need to handle a DOMWindow specially, because a DOMWindow wrapper | 326 // We need to handle a LocalDOMWindow specially, because a LocalDOMWindow wr apper |
eseidel
2014/06/17 17:08:11
Are you sure you want to change these?
kenrb
2014/06/17 17:21:47
Not really. I'll change them back on my next rebas
| |
327 // exists on a prototype chain of v8Value. | 327 // exists on a prototype chain of v8Value. |
328 value = toDOMWindow(v8Value, m_isolate); | 328 value = toDOMWindow(v8Value, m_isolate); |
329 return true; | 329 return true; |
330 } | 330 } |
331 | 331 |
332 bool Dictionary::get(const String& key, RefPtrWillBeMember<Storage>& value) cons t | 332 bool Dictionary::get(const String& key, RefPtrWillBeMember<Storage>& value) cons t |
333 { | 333 { |
334 v8::Local<v8::Value> v8Value; | 334 v8::Local<v8::Value> v8Value; |
335 if (!getKey(key, v8Value)) | 335 if (!getKey(key, v8Value)) |
336 return false; | 336 return false; |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
517 return true; | 517 return true; |
518 } | 518 } |
519 | 519 |
520 bool Dictionary::get(const String& key, RefPtrWillBeMember<EventTarget>& value) const | 520 bool Dictionary::get(const String& key, RefPtrWillBeMember<EventTarget>& value) const |
521 { | 521 { |
522 v8::Local<v8::Value> v8Value; | 522 v8::Local<v8::Value> v8Value; |
523 if (!getKey(key, v8Value)) | 523 if (!getKey(key, v8Value)) |
524 return false; | 524 return false; |
525 | 525 |
526 value = nullptr; | 526 value = nullptr; |
527 // We need to handle a DOMWindow specially, because a DOMWindow wrapper | 527 // We need to handle a LocalDOMWindow specially, because a LocalDOMWindow wr apper |
528 // exists on a prototype chain of v8Value. | 528 // exists on a prototype chain of v8Value. |
529 if (v8Value->IsObject()) { | 529 if (v8Value->IsObject()) { |
530 v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(v8Value); | 530 v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(v8Value); |
531 v8::Handle<v8::Object> window = V8Window::findInstanceInPrototypeChain(w rapper, m_isolate); | 531 v8::Handle<v8::Object> window = V8Window::findInstanceInPrototypeChain(w rapper, m_isolate); |
532 if (!window.IsEmpty()) { | 532 if (!window.IsEmpty()) { |
533 value = toWrapperTypeInfo(window)->toEventTarget(window); | 533 value = toWrapperTypeInfo(window)->toEventTarget(window); |
534 return true; | 534 return true; |
535 } | 535 } |
536 } | 536 } |
537 | 537 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
735 | 735 |
736 return *this; | 736 return *this; |
737 } | 737 } |
738 | 738 |
739 void Dictionary::ConversionContext::throwTypeError(const String& detail) | 739 void Dictionary::ConversionContext::throwTypeError(const String& detail) |
740 { | 740 { |
741 exceptionState().throwTypeError(detail); | 741 exceptionState().throwTypeError(detail); |
742 } | 742 } |
743 | 743 |
744 } // namespace WebCore | 744 } // namespace WebCore |
OLD | NEW |