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

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

Issue 334283004: Rename DOMWindow to LocalDOMWindow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 6 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/v8/Dictionary.h ('k') | Source/bindings/v8/NPV8Object.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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 DOMWindow specially, because a DOMWindow wrapper
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 }
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « Source/bindings/v8/Dictionary.h ('k') | Source/bindings/v8/NPV8Object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698