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

Unified Diff: Source/core/dom/DocumentInit.cpp

Issue 18808004: Refactoring: Extract DocumentInit for capture Document construction parameter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed webkit_unit_tests build failure. Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/DocumentInit.h ('k') | Source/core/editing/markup.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DocumentInit.cpp
diff --git a/Source/core/dom/DocumentOrderedList.h b/Source/core/dom/DocumentInit.cpp
similarity index 63%
copy from Source/core/dom/DocumentOrderedList.h
copy to Source/core/dom/DocumentInit.cpp
index 8dde172864e28b463855a252fcc75ff453bc6312..adf48c24b6932eab4b95cb7beeda5751a70223a3 100644
--- a/Source/core/dom/DocumentOrderedList.h
+++ b/Source/core/dom/DocumentInit.cpp
@@ -25,36 +25,41 @@
*
*/
-#ifndef DocumentOrderedList_h
-#define DocumentOrderedList_h
+#include "config.h"
+#include "core/dom/DocumentInit.h"
-#include "wtf/FastAllocBase.h"
-#include "wtf/ListHashSet.h"
+#include "core/html/HTMLImportsController.h"
+#include "core/page/Frame.h"
namespace WebCore {
-class Node;
-
-class DocumentOrderedList {
- WTF_MAKE_NONCOPYABLE(DocumentOrderedList); WTF_MAKE_FAST_ALLOCATED;
-public:
- DocumentOrderedList() { }
-
- void add(Node*);
- void parserAdd(Node*);
- void remove(Node*);
- bool isEmpty() const { return m_nodes.isEmpty(); }
- void clear() { m_nodes.clear(); }
+bool DocumentInit::shouldSetURL() const
+{
+ return (m_frame && m_frame->ownerElement()) || !m_url.isEmpty();
+}
- typedef ListHashSet<Node*, 32>::iterator iterator;
+bool DocumentInit::shouldTreatURLAsSrcdocDocument() const
+{
+ return m_frame->loader()->shouldTreatURLAsSrcdocDocument(m_url);
+}
- iterator begin() { return m_nodes.begin(); }
- iterator end() { return m_nodes.end(); }
+SandboxFlags DocumentInit::sandboxFlags() const
+{
+ return m_frame->loader()->effectiveSandboxFlags();
+}
-private:
- ListHashSet<Node*, 32> m_nodes;
-};
+Settings* DocumentInit::settings() const
+{
+ return m_frame->settings();
+}
+Frame* DocumentInit::ownerFrame() const
+{
+ Frame* ownerFrame = m_frame->tree()->parent();
+ if (!ownerFrame)
+ ownerFrame = m_frame->loader()->opener();
+ return ownerFrame;
}
-#endif
+} // namespace WebCore
+
« no previous file with comments | « Source/core/dom/DocumentInit.h ('k') | Source/core/editing/markup.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698