| Index: third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
|
| diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
|
| index 8c5fbea3b7acbaf24b5ff48310298d3fbbfb94ed..9713e4ab261e94ba38788bb0533eca38e912b11a 100644
|
| --- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
|
| +++ b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
|
| @@ -744,9 +744,12 @@ Resource* ResourceFetcher::createResourceForLoading(
|
| }
|
| resource->setCacheIdentifier(cacheIdentifier);
|
|
|
| - // Don't add main resource to cache to prevent reuse.
|
| - if (factory.type() != Resource::MainResource)
|
| + // - Don't add main resource to cache to prevent reuse.
|
| + // - Don't add the resource if its body will not be stored.
|
| + if (factory.type() != Resource::MainResource &&
|
| + request.options().dataBufferingPolicy != DoNotBufferData) {
|
| memoryCache()->add(resource);
|
| + }
|
| return resource;
|
| }
|
|
|
|
|