| 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 } | 308 } |
| 309 | 309 |
| 310 bool Dictionary::get(const String& key, RefPtr<DOMWindow>& value) const | 310 bool Dictionary::get(const String& key, RefPtr<DOMWindow>& value) const |
| 311 { | 311 { |
| 312 v8::Local<v8::Value> v8Value; | 312 v8::Local<v8::Value> v8Value; |
| 313 if (!getKey(key, v8Value)) | 313 if (!getKey(key, v8Value)) |
| 314 return false; | 314 return false; |
| 315 | 315 |
| 316 // We need to handle a DOMWindow specially, because a DOMWindow wrapper | 316 // We need to handle a DOMWindow specially, because a DOMWindow wrapper |
| 317 // exists on a prototype chain of v8Value. | 317 // exists on a prototype chain of v8Value. |
| 318 value = 0; | 318 value = toNativeDOMWindow(v8Value, m_isolate); |
| 319 if (v8Value->IsObject()) { | |
| 320 v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(v8Value); | |
| 321 v8::Handle<v8::Object> window = wrapper->FindInstanceInPrototypeChain(V8
Window::domTemplate(m_isolate, worldTypeInMainThread(m_isolate))); | |
| 322 if (!window.IsEmpty()) | |
| 323 value = V8Window::toNative(window); | |
| 324 } | |
| 325 return true; | 319 return true; |
| 326 } | 320 } |
| 327 | 321 |
| 328 bool Dictionary::get(const String& key, RefPtr<Storage>& value) const | 322 bool Dictionary::get(const String& key, RefPtr<Storage>& value) const |
| 329 { | 323 { |
| 330 v8::Local<v8::Value> v8Value; | 324 v8::Local<v8::Value> v8Value; |
| 331 if (!getKey(key, v8Value)) | 325 if (!getKey(key, v8Value)) |
| 332 return false; | 326 return false; |
| 333 | 327 |
| 334 value = 0; | 328 value = 0; |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 { | 754 { |
| 761 if (forConstructor()) { | 755 if (forConstructor()) { |
| 762 exceptionState().throwTypeError(detail); | 756 exceptionState().throwTypeError(detail); |
| 763 } else { | 757 } else { |
| 764 ASSERT(!methodName().isEmpty()); | 758 ASSERT(!methodName().isEmpty()); |
| 765 exceptionState().throwTypeError(ExceptionMessages::failedToExecute(inter
faceName(), methodName(), detail)); | 759 exceptionState().throwTypeError(ExceptionMessages::failedToExecute(inter
faceName(), methodName(), detail)); |
| 766 } | 760 } |
| 767 } | 761 } |
| 768 | 762 |
| 769 } // namespace WebCore | 763 } // namespace WebCore |
| OLD | NEW |