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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp

Issue 2497133002: Add a SECURITY_CHECK that HTMLFrameElementBase is a consistent state.
Patch Set: Created 4 years, 1 month 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 | « no previous file | 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Simon Hausmann (hausmann@kde.org) 4 * (C) 2000 Simon Hausmann (hausmann@kde.org)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 20 matching lines...) Expand all
31 #include "core/frame/FrameView.h" 31 #include "core/frame/FrameView.h"
32 #include "core/frame/LocalFrame.h" 32 #include "core/frame/LocalFrame.h"
33 #include "core/frame/RemoteFrame.h" 33 #include "core/frame/RemoteFrame.h"
34 #include "core/frame/RemoteFrameView.h" 34 #include "core/frame/RemoteFrameView.h"
35 #include "core/frame/csp/ContentSecurityPolicy.h" 35 #include "core/frame/csp/ContentSecurityPolicy.h"
36 #include "core/html/parser/HTMLParserIdioms.h" 36 #include "core/html/parser/HTMLParserIdioms.h"
37 #include "core/loader/FrameLoader.h" 37 #include "core/loader/FrameLoader.h"
38 #include "core/loader/FrameLoaderClient.h" 38 #include "core/loader/FrameLoaderClient.h"
39 #include "core/page/FocusController.h" 39 #include "core/page/FocusController.h"
40 #include "core/page/Page.h" 40 #include "core/page/Page.h"
41 #include "wtf/Assertions.h"
41 42
42 namespace blink { 43 namespace blink {
43 44
44 using namespace HTMLNames; 45 using namespace HTMLNames;
45 46
46 HTMLFrameElementBase::HTMLFrameElementBase(const QualifiedName& tagName, 47 HTMLFrameElementBase::HTMLFrameElementBase(const QualifiedName& tagName,
47 Document& document) 48 Document& document)
48 : HTMLFrameOwnerElement(tagName, document), 49 : HTMLFrameOwnerElement(tagName, document),
49 m_scrollingMode(ScrollbarAuto), 50 m_scrollingMode(ScrollbarAuto),
50 m_marginWidth(-1), 51 m_marginWidth(-1),
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 return InsertionShouldCallDidNotifySubtreeInsertions; 181 return InsertionShouldCallDidNotifySubtreeInsertions;
181 } 182 }
182 183
183 void HTMLFrameElementBase::didNotifySubtreeInsertionsToDocument() { 184 void HTMLFrameElementBase::didNotifySubtreeInsertionsToDocument() {
184 if (!document().frame()) 185 if (!document().frame())
185 return; 186 return;
186 187
187 if (!SubframeLoadingDisabler::canLoadFrame(*this)) 188 if (!SubframeLoadingDisabler::canLoadFrame(*this))
188 return; 189 return;
189 190
191 // If there's a content frame already attached, the DOM is already in an
192 // inconsistent state. It's dangerous to continue, so just abort.
193 SECURITY_CHECK(!contentFrame());
194
190 setNameAndOpenURL(); 195 setNameAndOpenURL();
191 } 196 }
192 197
193 void HTMLFrameElementBase::attachLayoutTree(const AttachContext& context) { 198 void HTMLFrameElementBase::attachLayoutTree(const AttachContext& context) {
194 HTMLFrameOwnerElement::attachLayoutTree(context); 199 HTMLFrameOwnerElement::attachLayoutTree(context);
195 200
196 if (layoutPart()) { 201 if (layoutPart()) {
197 if (Frame* frame = contentFrame()) { 202 if (Frame* frame = contentFrame()) {
198 if (frame->isLocalFrame()) 203 if (frame->isLocalFrame())
199 setWidget(toLocalFrame(frame)->view()); 204 setWidget(toLocalFrame(frame)->view());
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 m_marginWidth = marginWidth; 266 m_marginWidth = marginWidth;
262 frameOwnerPropertiesChanged(); 267 frameOwnerPropertiesChanged();
263 } 268 }
264 269
265 void HTMLFrameElementBase::setMarginHeight(int marginHeight) { 270 void HTMLFrameElementBase::setMarginHeight(int marginHeight) {
266 m_marginHeight = marginHeight; 271 m_marginHeight = marginHeight;
267 frameOwnerPropertiesChanged(); 272 frameOwnerPropertiesChanged();
268 } 273 }
269 274
270 } // namespace blink 275 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698