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

Unified Diff: third_party/WebKit/Source/core/fetch/Resource.h

Issue 1802123002: Unify Resource loading status tracking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: third_party/WebKit/Source/core/fetch/Resource.h
diff --git a/third_party/WebKit/Source/core/fetch/Resource.h b/third_party/WebKit/Source/core/fetch/Resource.h
index de7f4d70cc27b8cf8f3512838623d5e1cff7cd3a..26dd259804def1682654ecd0fd7dbf8814ba84fd 100644
--- a/third_party/WebKit/Source/core/fetch/Resource.h
+++ b/third_party/WebKit/Source/core/fetch/Resource.h
@@ -77,9 +77,10 @@ public:
};
enum Status {
- Unknown, // let cache decide what to do with it
- Pending, // only partially loaded
- Cached, // regular case
+ NotStarted,
+ LoadStartScheduled, // scheduled but not yet started, only used by fonts.
+ Pending, // load in progress
+ Cached, // load completed successfully
LoadError,
DecodeError
};
@@ -155,11 +156,10 @@ public:
size_t decodedSize() const { return m_decodedSize; }
size_t overheadSize() const;
- bool isLoaded() const { return !m_loading; } // FIXME. Method name is inaccurate. Loading might not have started yet.
+ bool isLoaded() const { return m_status > Pending; }
- bool isLoading() const { return m_loading; }
- void setLoading(bool b) { m_loading = b; }
- virtual bool stillNeedsLoad() const { return false; }
+ bool isLoading() const { return m_status == Pending; }
+ bool stillNeedsLoad() const { return m_status < Pending; }
ResourceLoader* loader() const { return m_loader.get(); }
@@ -356,10 +356,6 @@ private:
String m_cacheIdentifier;
unsigned m_preloadResult : 2; // PreloadResult
- unsigned m_requestedFromNetworkingLayer : 1;
-
- unsigned m_loading : 1;
-
unsigned m_type : 4; // Type
unsigned m_status : 3; // Status

Powered by Google App Engine
This is Rietveld 408576698