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

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

Issue 189573002: Convert HTMLFrameOwnerElement and FocusController to use Frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Missed a null check 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
« no previous file with comments | « Source/bindings/v8/BindingSecurity.cpp ('k') | Source/core/dom/Document.cpp » ('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) 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 if (!htmlDocument->hasNamedItem(key) && !htmlDocument->hasExtraNamedItem(key )) 427 if (!htmlDocument->hasNamedItem(key) && !htmlDocument->hasExtraNamedItem(key ))
428 return v8Undefined(); 428 return v8Undefined();
429 429
430 RefPtr<HTMLCollection> items = htmlDocument->documentNamedItems(key); 430 RefPtr<HTMLCollection> items = htmlDocument->documentNamedItems(key);
431 if (items->isEmpty()) 431 if (items->isEmpty())
432 return v8Undefined(); 432 return v8Undefined();
433 433
434 if (items->hasExactlyOneItem()) { 434 if (items->hasExactlyOneItem()) {
435 Element* element = items->item(0); 435 Element* element = items->item(0);
436 ASSERT(element); 436 ASSERT(element);
437 LocalFrame* frame = 0; 437 Frame* frame = 0;
438 if (isHTMLIFrameElement(*element) && (frame = toHTMLIFrameElement(*eleme nt).contentFrame())) 438 if (isHTMLIFrameElement(*element) && (frame = toHTMLIFrameElement(*eleme nt).contentFrame()))
439 return toV8(frame->domWindow(), creationContext, isolate); 439 return toV8(frame->domWindow(), creationContext, isolate);
440 return toV8(element, creationContext, isolate); 440 return toV8(element, creationContext, isolate);
441 } 441 }
442 return toV8(items.release(), creationContext, isolate); 442 return toV8(items.release(), creationContext, isolate);
443 } 443 }
444 444
445 static void getter(v8::Local<v8::String> property, const v8::PropertyCallbackInf o<v8::Value>& info) 445 static void getter(v8::Local<v8::String> property, const v8::PropertyCallbackInf o<v8::Value>& info)
446 { 446 {
447 // FIXME: Consider passing StringImpl directly. 447 // FIXME: Consider passing StringImpl directly.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 void V8WindowShell::updateSecurityOrigin(SecurityOrigin* origin) 498 void V8WindowShell::updateSecurityOrigin(SecurityOrigin* origin)
499 { 499 {
500 ASSERT(m_world->isMainWorld()); 500 ASSERT(m_world->isMainWorld());
501 if (!m_perContextData) 501 if (!m_perContextData)
502 return; 502 return;
503 v8::HandleScope handleScope(m_isolate); 503 v8::HandleScope handleScope(m_isolate);
504 setSecurityToken(origin); 504 setSecurityToken(origin);
505 } 505 }
506 506
507 } // WebCore 507 } // WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/BindingSecurity.cpp ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698