| Index: third_party/WebKit/Source/web/WebFrameSerializer.cpp
|
| diff --git a/third_party/WebKit/Source/web/WebFrameSerializer.cpp b/third_party/WebKit/Source/web/WebFrameSerializer.cpp
|
| index 09fab010910923bea9bed94a704d40d0052a75d2..0846f86f77f11b4daefaf05dc49e5fa6c851caff 100644
|
| --- a/third_party/WebKit/Source/web/WebFrameSerializer.cpp
|
| +++ b/third_party/WebKit/Source/web/WebFrameSerializer.cpp
|
| @@ -47,12 +47,16 @@
|
| #include "platform/SharedBuffer.h"
|
| #include "platform/mhtml/MHTMLArchive.h"
|
| #include "platform/mhtml/MHTMLParser.h"
|
| +#include "platform/network/ResourceResponse.h"
|
| #include "platform/weborigin/KURL.h"
|
| #include "public/platform/WebString.h"
|
| #include "public/platform/WebURL.h"
|
| +#include "public/platform/WebURLResponse.h"
|
| #include "public/platform/WebVector.h"
|
| +#include "public/web/WebDataSource.h"
|
| #include "public/web/WebDocument.h"
|
| #include "public/web/WebFrame.h"
|
| +#include "public/web/WebFrameSerializerCacheControlPolicy.h"
|
| #include "public/web/WebFrameSerializerClient.h"
|
| #include "web/WebFrameSerializerImpl.h"
|
| #include "web/WebLocalFrameImpl.h"
|
| @@ -138,16 +142,27 @@ bool MHTMLFrameSerializerDelegate::shouldSkipResource(const KURL& url)
|
|
|
| } // namespace
|
|
|
| -WebData WebFrameSerializer::generateMHTMLHeader(
|
| - const WebString& boundary, WebLocalFrame* frame)
|
| +bool WebFrameSerializer::generateMHTMLHeader(
|
| + const WebString& boundary, WebFrameSerializerCacheControlPolicy cacheControlPolicy,
|
| + WebLocalFrame* frame, WebData* data)
|
| {
|
| - Document* document = toWebLocalFrameImpl(frame)->frame()->document();
|
| + WebLocalFrameImpl* webLocalFrameImpl = toWebLocalFrameImpl(frame);
|
| + DCHECK(webLocalFrameImpl);
|
| +
|
| + if (cacheControlPolicy == WebFrameSerializerCacheControlPolicy::FailForNoStoreMainFrame) {
|
| + const ResourceResponse& response = webLocalFrameImpl->dataSource()->response().toResourceResponse();
|
| + if (response.cacheControlContainsNoStore())
|
| + return false;
|
| + }
|
| +
|
| + Document* document = webLocalFrameImpl->frame()->document();
|
|
|
| RefPtr<SharedBuffer> buffer = SharedBuffer::create();
|
| MHTMLArchive::generateMHTMLHeader(
|
| boundary, document->title(), document->suggestedMIMEType(),
|
| *buffer);
|
| - return buffer.release();
|
| + *data = buffer.release();
|
| + return true;
|
| }
|
|
|
| WebData WebFrameSerializer::generateMHTMLParts(
|
|
|