Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Side by Side Diff: Source/bindings/v8/Dictionary.cpp

Issue 109473008: Remove custom signatures from V8 bindings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/bindings/tests/results/V8TestObjectPython.cpp ('k') | Source/bindings/v8/V8Binding.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestObjectPython.cpp ('k') | Source/bindings/v8/V8Binding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698