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

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

Issue 2845513002: [WIP] Add Resource::IsShareable
Patch Set: fix Created 3 years, 7 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 537d295485a5693ab14c937d77bd04f72eb61a1c..8ce429ce9634e33f3309569b7ad403c6af716505 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/Resource.h
+++ b/third_party/WebKit/Source/platform/loader/fetch/Resource.h
@@ -307,6 +307,11 @@ class PLATFORM_EXPORT Resource : public GarbageCollectedFinalized<Resource>,
}
virtual bool CanReuse(const FetchParameters&) const { return true; }
+ virtual bool IsShareable() const {
+ // MemoryCache works only on the main thread, so we don't add a resource
+ // on another thread.
+ return IsMainThread() && options_.data_buffering_policy != kDoNotBufferData;
+ }
// If cache-aware loading is activated, this callback is called when the first
// disk-cache-only request failed due to cache miss. After this callback,

Powered by Google App Engine
This is Rietveld 408576698