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

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

Issue 201383002: Use new is*Element() helper functions more in bindings/ code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Minor clean up Created 6 years, 9 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/V8GCController.cpp ('k') | no next file » | 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) 2008, 2009, 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 { 418 {
419 if (!htmlDocument->hasNamedItem(key) && !htmlDocument->hasExtraNamedItem(key )) 419 if (!htmlDocument->hasNamedItem(key) && !htmlDocument->hasExtraNamedItem(key ))
420 return v8Undefined(); 420 return v8Undefined();
421 421
422 RefPtr<HTMLCollection> items = htmlDocument->documentNamedItems(key); 422 RefPtr<HTMLCollection> items = htmlDocument->documentNamedItems(key);
423 if (items->isEmpty()) 423 if (items->isEmpty())
424 return v8Undefined(); 424 return v8Undefined();
425 425
426 if (items->hasExactlyOneItem()) { 426 if (items->hasExactlyOneItem()) {
427 Element* element = items->item(0); 427 Element* element = items->item(0);
428 ASSERT(element);
428 LocalFrame* frame = 0; 429 LocalFrame* frame = 0;
429 if (element->hasTagName(HTMLNames::iframeTag) && (frame = toHTMLIFrameEl ement(element)->contentFrame())) 430 if (isHTMLIFrameElement(*element) && (frame = toHTMLIFrameElement(*eleme nt).contentFrame()))
430 return toV8(frame->domWindow(), creationContext, isolate); 431 return toV8(frame->domWindow(), creationContext, isolate);
431 return toV8(element, creationContext, isolate); 432 return toV8(element, creationContext, isolate);
432 } 433 }
433 return toV8(items.release(), creationContext, isolate); 434 return toV8(items.release(), creationContext, isolate);
434 } 435 }
435 436
436 static void getter(v8::Local<v8::String> property, const v8::PropertyCallbackInf o<v8::Value>& info) 437 static void getter(v8::Local<v8::String> property, const v8::PropertyCallbackInf o<v8::Value>& info)
437 { 438 {
438 // FIXME: Consider passing StringImpl directly. 439 // FIXME: Consider passing StringImpl directly.
439 AtomicString name = toCoreAtomicString(property); 440 AtomicString name = toCoreAtomicString(property);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 void V8WindowShell::updateSecurityOrigin(SecurityOrigin* origin) 490 void V8WindowShell::updateSecurityOrigin(SecurityOrigin* origin)
490 { 491 {
491 ASSERT(m_world->isMainWorld()); 492 ASSERT(m_world->isMainWorld());
492 if (!m_perContextData) 493 if (!m_perContextData)
493 return; 494 return;
494 v8::HandleScope handleScope(m_isolate); 495 v8::HandleScope handleScope(m_isolate);
495 setSecurityToken(origin); 496 setSecurityToken(origin);
496 } 497 }
497 498
498 } // WebCore 499 } // WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8GCController.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698