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

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

Issue 1853543002: Add -ifsameorigin to autoplay experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@autoplay
Patch Set: comment. Created 4 years, 7 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 return toLayoutPart(object); 281 return toLayoutPart(object);
282 } 282 }
283 283
284 Settings* Frame::settings() const 284 Settings* Frame::settings() const
285 { 285 {
286 if (m_host) 286 if (m_host)
287 return &m_host->settings(); 287 return &m_host->settings();
288 return nullptr; 288 return nullptr;
289 } 289 }
290 290
291 bool Frame::isCrossOrigin() const
292 {
293 // Check to see if the frame can script into the top level document.
294 const SecurityOrigin* securityOrigin = securityContext()->getSecurityOrigin( );
295 Frame* top = tree().top();
296 return top && !securityOrigin->canAccess(top->securityContext()->getSecurity Origin());
297 }
298
291 Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner) 299 Frame::Frame(FrameClient* client, FrameHost* host, FrameOwner* owner)
292 : m_treeNode(this) 300 : m_treeNode(this)
293 , m_host(host) 301 , m_host(host)
294 , m_owner(owner) 302 , m_owner(owner)
295 , m_client(client) 303 , m_client(client)
296 , m_isLoading(false) 304 , m_isLoading(false)
297 { 305 {
298 InstanceCounters::incrementCounter(InstanceCounters::FrameCounter); 306 InstanceCounters::incrementCounter(InstanceCounters::FrameCounter);
299 307
300 ASSERT(page()); 308 ASSERT(page());
301 309
302 if (m_owner) 310 if (m_owner)
303 m_owner->setContentFrame(*this); 311 m_owner->setContentFrame(*this);
304 else 312 else
305 page()->setMainFrame(this); 313 page()->setMainFrame(this);
306 } 314 }
307 315
308 } // namespace blink 316 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698