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

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

Issue 2249373002: Make Resource MemoryCoordinatorClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comment Created 4 years, 4 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 62dd4414551373d1dcc984aa6ed98989df105781..8afe8b58435182827fc7fcfebc17641a44633f25 100644
--- a/third_party/WebKit/Source/core/fetch/Resource.h
+++ b/third_party/WebKit/Source/core/fetch/Resource.h
@@ -26,6 +26,7 @@
#include "core/CoreExport.h"
#include "core/fetch/CachedMetadataHandler.h"
#include "core/fetch/ResourceLoaderOptions.h"
+#include "platform/MemoryCoordinator.h"
#include "platform/SharedBuffer.h"
#include "platform/Timer.h"
#include "platform/network/ResourceError.h"
@@ -54,7 +55,8 @@ class SecurityOrigin;
// A resource that is held in the cache. Classes who want to use this object should derive
// from ResourceClient, to get the function calls in case the requested data has arrived.
// This class also does the actual communication with the loader to obtain the resource from the network.
-class CORE_EXPORT Resource : public GarbageCollectedFinalized<Resource> {
+class CORE_EXPORT Resource : public GarbageCollectedFinalized<Resource>, public MemoryCoordinatorClient {
+ USING_GARBAGE_COLLECTED_MIXIN(Resource);
WTF_MAKE_NONCOPYABLE(Resource);
public:
// |Type| enum values are used in UMAs, so do not change the values of
@@ -306,6 +308,9 @@ private:
String reasonNotDeletable() const;
+ // MemoryCoordinatorClient overrides:
+ void prepareToSuspend() override;
+
Member<CachedMetadataHandlerImpl> m_cacheHandler;
RefPtr<SecurityOrigin> m_fetcherSecurityOrigin;

Powered by Google App Engine
This is Rietveld 408576698