OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 enum SyncMode { | 99 enum SyncMode { |
100 Sync = 0, | 100 Sync = 0, |
101 Async = 1 | 101 Async = 1 |
102 }; | 102 }; |
103 | 103 |
104 virtual ~HTMLImport() { } | 104 virtual ~HTMLImport() { } |
105 | 105 |
106 // FIXME: Consider returning HTMLImportTreeRoot. | 106 // FIXME: Consider returning HTMLImportTreeRoot. |
107 HTMLImport* root(); | 107 HTMLImport* root(); |
108 bool precedes(HTMLImport*); | 108 bool precedes(HTMLImport*); |
109 bool isRoot() const { return !isChild(); } | 109 bool isRoot() const { return !parent(); } |
110 bool isSync() const { return SyncMode(m_sync) == Sync; } | 110 bool isSync() const { return SyncMode(m_sync) == Sync; } |
111 bool formsCycle() const; | 111 bool formsCycle() const; |
112 const HTMLImportState& state() const { return m_state; } | 112 const HTMLImportState& state() const { return m_state; } |
113 | 113 |
114 void appendImport(HTMLImport*); | 114 void appendImport(HTMLImport*); |
115 | 115 |
116 virtual bool isChild() const { return false; } | |
117 virtual Document* document() const = 0; | 116 virtual Document* document() const = 0; |
118 virtual bool isDone() const = 0; // FIXME: Should be renamed to haveFinished
Loading() | 117 virtual bool isDone() const = 0; // FIXME: Should be renamed to haveFinished
Loading() |
119 virtual HTMLImportLoader* loader() const { return 0; } | 118 virtual HTMLImportLoader* loader() const { return 0; } |
120 virtual void stateWillChange() { } | 119 virtual void stateWillChange() { } |
121 virtual void stateDidChange(); | 120 virtual void stateDidChange(); |
122 | 121 |
123 protected: | 122 protected: |
124 // Stating from most conservative state. | 123 // Stating from most conservative state. |
125 // It will be corrected through state update flow. | 124 // It will be corrected through state update flow. |
126 explicit HTMLImport(SyncMode sync) | 125 explicit HTMLImport(SyncMode sync) |
127 : m_sync(sync) | 126 : m_sync(sync) |
128 { } | 127 { } |
129 | 128 |
130 static void recalcTreeState(HTMLImport* root); | 129 static void recalcTreeState(HTMLImport* root); |
131 | 130 |
132 #if !defined(NDEBUG) | 131 #if !defined(NDEBUG) |
133 void show(); | 132 void show(); |
134 void showTree(HTMLImport* highlight, unsigned depth); | 133 void showTree(HTMLImport* highlight, unsigned depth); |
135 virtual void showThis(); | 134 virtual void showThis(); |
136 #endif | 135 #endif |
137 | 136 |
138 private: | 137 private: |
139 HTMLImportState m_state; | 138 HTMLImportState m_state; |
140 unsigned m_sync : 1; | 139 unsigned m_sync : 1; |
141 }; | 140 }; |
142 | 141 |
143 } // namespace WebCore | 142 } // namespace WebCore |
144 | 143 |
145 #endif // HTMLImport_h | 144 #endif // HTMLImport_h |
OLD | NEW |