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

Unified Diff: Source/core/html/imports/HTMLImport.h

Issue 211363004: [Refactring] Turn HTMLImport::m_sync from bool to an enum. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Removed the default parameter Created 6 years, 9 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 | « no previous file | Source/core/html/imports/HTMLImportChild.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/imports/HTMLImport.h
diff --git a/Source/core/html/imports/HTMLImport.h b/Source/core/html/imports/HTMLImport.h
index 8c463aa462a776f698c41473948b296fdf13333f..40b25f6d1ede7f362c7d14b605394f6588374ff7 100644
--- a/Source/core/html/imports/HTMLImport.h
+++ b/Source/core/html/imports/HTMLImport.h
@@ -101,6 +101,11 @@ class KURL;
// This represents the import tree data structure.
class HTMLImport : public TreeNode<HTMLImport> {
public:
+ enum SyncMode {
+ Sync = 0,
+ Async = 1
+ };
+
static bool isMaster(Document*);
virtual ~HTMLImport() { }
@@ -109,7 +114,7 @@ public:
Document* master();
HTMLImportsController* controller();
bool isRoot() const { return !isChild(); }
- bool isSync() const { return m_sync; }
+ bool isSync() const { return SyncMode(m_sync) == Sync; }
const HTMLImportState& state() const { return m_state; }
void appendChild(HTMLImport*);
@@ -129,7 +134,7 @@ public:
protected:
// Stating from most conservative state.
// It will be corrected through state update flow.
- explicit HTMLImport(bool sync = false)
+ explicit HTMLImport(SyncMode sync)
: m_sync(sync)
{ }
@@ -144,13 +149,13 @@ protected:
private:
HTMLImportState m_state;
- bool m_sync : 1;
+ unsigned m_sync : 1;
};
// An abstract class to decouple its sublcass HTMLImportsController.
class HTMLImportRoot : public HTMLImport {
public:
- HTMLImportRoot() { }
+ HTMLImportRoot() : HTMLImport(Sync) { }
virtual void scheduleRecalcState() = 0;
virtual HTMLImportsController* toController() = 0;
« no previous file with comments | « no previous file | Source/core/html/imports/HTMLImportChild.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698