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

Side by Side Diff: third_party/WebKit/Source/core/frame/Frame.cpp

Issue 2009453002: service worker: Don't control a subframe of an insecure context (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 298
299 void Frame::didChangeVisibilityState() 299 void Frame::didChangeVisibilityState()
300 { 300 {
301 HeapVector<Member<Frame>> childFrames; 301 HeapVector<Member<Frame>> childFrames;
302 for (Frame* child = tree().firstChild(); child; child = child->tree().nextSi bling()) 302 for (Frame* child = tree().firstChild(); child; child = child->tree().nextSi bling())
303 childFrames.append(child); 303 childFrames.append(child);
304 for (size_t i = 0; i < childFrames.size(); ++i) 304 for (size_t i = 0; i < childFrames.size(); ++i)
305 childFrames[i]->didChangeVisibilityState(); 305 childFrames[i]->didChangeVisibilityState();
306 } 306 }
307 307
308 bool Frame::canHaveSecureChild(String* errorMessage) const
309 {
310 for (const Frame* parent = this; parent; parent = parent->tree().parent()) {
311 if (!parent->securityContext()->getSecurityOrigin()->isPotentiallyTrustw orthy(errorMessage))
312 return false;
313 }
314 return true;
315 }
316
308 Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner) 317 Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner)
309 : m_treeNode(this) 318 : m_treeNode(this)
310 , m_host(host) 319 , m_host(host)
311 , m_owner(owner) 320 , m_owner(owner)
312 , m_client(client) 321 , m_client(client)
313 , m_isLoading(false) 322 , m_isLoading(false)
314 { 323 {
315 InstanceCounters::incrementCounter(InstanceCounters::FrameCounter); 324 InstanceCounters::incrementCounter(InstanceCounters::FrameCounter);
316 325
317 ASSERT(page()); 326 ASSERT(page());
318 327
319 if (m_owner) 328 if (m_owner)
320 m_owner->setContentFrame(*this); 329 m_owner->setContentFrame(*this);
321 else 330 else
322 page()->setMainFrame(this); 331 page()->setMainFrame(this);
323 } 332 }
324 333
325 } // namespace blink 334 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698