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

Unified Diff: third_party/WebKit/Source/platform/loader/fetch/Resource.h

Issue 2807533003: [WIP2] off-main-thread loading
Patch Set: call set_is_secure_context in EmbeddedSharedWorkerStub::CreateWorkerFetchContext() Created 3 years, 8 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/platform/loader/fetch/Resource.h
diff --git a/third_party/WebKit/Source/platform/loader/fetch/Resource.h b/third_party/WebKit/Source/platform/loader/fetch/Resource.h
index 0054b138e7b1deeeee0105eaa03f6bee4a0089ac..0293217e0aac6b7b4a17a3afa3e846f76f715f1b 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/Resource.h
+++ b/third_party/WebKit/Source/platform/loader/fetch/Resource.h
@@ -48,6 +48,7 @@
namespace blink {
+class FetchContext;
class FetchParameters;
class ResourceClient;
class ResourceFetcher;
@@ -99,6 +100,14 @@ class PLATFORM_EXPORT Resource : public GarbageCollectedFinalized<Resource>,
kReloadAlways,
};
+ class ResourceCallback {
+ public:
+ virtual ~ResourceCallback() {}
+ virtual void Schedule(Resource*) = 0;
+ virtual void Cancel(Resource*) = 0;
+ virtual bool IsScheduled(Resource*) const = 0;
+ };
+
virtual ~Resource();
DECLARE_VIRTUAL_TRACE();
@@ -336,8 +345,13 @@ class PLATFORM_EXPORT Resource : public GarbageCollectedFinalized<Resource>,
Type,
const AtomicString& fetch_initiator_name);
+ void FinishPendingClients();
+
protected:
- Resource(const ResourceRequest&, Type, const ResourceLoaderOptions&);
+ Resource(const ResourceRequest&,
+ Type,
+ const ResourceLoaderOptions&,
+ FetchContext* = nullptr);
virtual void CheckNotify();
@@ -352,8 +366,6 @@ class PLATFORM_EXPORT Resource : public GarbageCollectedFinalized<Resource>,
void SetEncodedSize(size_t);
void SetDecodedSize(size_t);
- void FinishPendingClients();
-
virtual void DidAddClient(ResourceClient*);
void WillAddClientOrObserver(PreloadReferencePolicy);
@@ -408,7 +420,6 @@ class PLATFORM_EXPORT Resource : public GarbageCollectedFinalized<Resource>,
};
private:
- class ResourceCallback;
class CachedMetadataHandlerImpl;
class ServiceWorkerResponseCachedMetadataHandler;
@@ -421,6 +432,8 @@ class PLATFORM_EXPORT Resource : public GarbageCollectedFinalized<Resource>,
String ReasonNotDeletable() const;
+ ResourceCallback& GetResourceCallback();
+
// MemoryCoordinatorClient overrides:
void OnPurgeMemory() override;
@@ -475,6 +488,7 @@ class PLATFORM_EXPORT Resource : public GarbageCollectedFinalized<Resource>,
double response_timestamp_;
TaskRunnerTimer<Resource> cancel_timer_;
+ Member<FetchContext> fetch_context_;
ResourceRequest resource_request_;
Member<ResourceLoader> loader_;
@@ -489,7 +503,8 @@ class ResourceFactory {
public:
virtual Resource* Create(const ResourceRequest&,
const ResourceLoaderOptions&,
- const String&) const = 0;
+ const String&,
+ FetchContext*) const = 0;
Resource::Type GetType() const { return type_; }
protected:

Powered by Google App Engine
This is Rietveld 408576698