| Index: third_party/WebKit/Source/web/WebFrameSerializerImpl.h
|
| diff --git a/third_party/WebKit/Source/web/WebPageSerializerImpl.h b/third_party/WebKit/Source/web/WebFrameSerializerImpl.h
|
| similarity index 75%
|
| rename from third_party/WebKit/Source/web/WebPageSerializerImpl.h
|
| rename to third_party/WebKit/Source/web/WebFrameSerializerImpl.h
|
| index 212135c164db21dcc3941ee77a3cf331348911a8..0a403ddb8044f6b00fa4fa41e559626bef630194 100644
|
| --- a/third_party/WebKit/Source/web/WebPageSerializerImpl.h
|
| +++ b/third_party/WebKit/Source/web/WebFrameSerializerImpl.h
|
| @@ -28,9 +28,14 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#ifndef WebPageSerializerImpl_h
|
| -#define WebPageSerializerImpl_h
|
| +#ifndef WebFrameSerializerImpl_h
|
| +#define WebFrameSerializerImpl_h
|
|
|
| +#include "public/platform/WebString.h"
|
| +#include "public/platform/WebURL.h"
|
| +#include "public/web/WebFrameSerializer.h"
|
| +#include "public/web/WebFrameSerializerClient.h"
|
| +#include "web/WebEntities.h"
|
| #include "wtf/Forward.h"
|
| #include "wtf/HashMap.h"
|
| #include "wtf/Vector.h"
|
| @@ -38,12 +43,6 @@
|
| #include "wtf/text/StringHash.h"
|
| #include "wtf/text/WTFString.h"
|
|
|
| -#include "public/platform/WebString.h"
|
| -#include "public/platform/WebURL.h"
|
| -#include "public/web/WebPageSerializer.h"
|
| -#include "public/web/WebPageSerializerClient.h"
|
| -#include "web/WebEntities.h"
|
| -
|
| namespace WTF {
|
| class TextEncoding;
|
| }
|
| @@ -58,7 +57,7 @@ class WebLocalFrameImpl;
|
|
|
| // Responsible for serializing the specified frame into html
|
| // (replacing links with paths to local files).
|
| -class WebPageSerializerImpl {
|
| +class WebFrameSerializerImpl {
|
| STACK_ALLOCATED();
|
| public:
|
| // Do serialization action.
|
| @@ -66,8 +65,8 @@ public:
|
| // Returns false to indicate that no data has been serialized (i.e. because
|
| // the target frame didn't have a valid url).
|
| //
|
| - // Synchronously calls WebPageSerializerClient methods to report
|
| - // serialization results. See WebPageSerializerClient comments for more
|
| + // Synchronously calls WebFrameSerializerClient methods to report
|
| + // serialization results. See WebFrameSerializerClient comments for more
|
| // details.
|
| bool serialize();
|
|
|
| @@ -77,16 +76,16 @@ public:
|
| // individual chunks of data to be saved.
|
| // The parameter urlsToLocalPaths contains a mapping between original URLs
|
| // of saved resources and corresponding local file paths.
|
| - WebPageSerializerImpl(
|
| + WebFrameSerializerImpl(
|
| WebLocalFrame*,
|
| - WebPageSerializerClient*,
|
| + WebFrameSerializerClient*,
|
| const WebVector<std::pair<WebURL, WebString>>& urlsToLocalPaths);
|
|
|
| private:
|
| // Specified frame which need to be serialized;
|
| RawPtrWillBeMember<WebLocalFrameImpl> m_specifiedWebLocalFrameImpl;
|
| - // Pointer of WebPageSerializerClient
|
| - WebPageSerializerClient* m_client;
|
| + // Pointer of WebFrameSerializerClient
|
| + WebFrameSerializerClient* m_client;
|
| // This hash map is used to map resource URL of original link to its local
|
| // file path.
|
| typedef HashMap<WTF::String, WTF::String> LinkLocalPathMap;
|
| @@ -126,25 +125,34 @@ private:
|
|
|
| // Before we begin serializing open tag of a element, we give the target
|
| // element a chance to do some work prior to add some additional data.
|
| - WTF::String preActionBeforeSerializeOpenTag(const Element*,
|
| - SerializeDomParam* param,
|
| - bool* needSkip);
|
| + WTF::String preActionBeforeSerializeOpenTag(
|
| + const Element*,
|
| + SerializeDomParam*,
|
| + bool* needSkip);
|
| +
|
| // After we finish serializing open tag of a element, we give the target
|
| // element a chance to do some post work to add some additional data.
|
| - WTF::String postActionAfterSerializeOpenTag(const Element*,
|
| - SerializeDomParam* param);
|
| + WTF::String postActionAfterSerializeOpenTag(
|
| + const Element*,
|
| + SerializeDomParam*);
|
| +
|
| // Before we begin serializing end tag of a element, we give the target
|
| // element a chance to do some work prior to add some additional data.
|
| - WTF::String preActionBeforeSerializeEndTag(const Element*,
|
| - SerializeDomParam* param,
|
| - bool* needSkip);
|
| + WTF::String preActionBeforeSerializeEndTag(
|
| + const Element*,
|
| + SerializeDomParam*,
|
| + bool* needSkip);
|
| +
|
| // After we finish serializing end tag of a element, we give the target
|
| // element a chance to do some post work to add some additional data.
|
| - WTF::String postActionAfterSerializeEndTag(const Element*,
|
| - SerializeDomParam* param);
|
| + WTF::String postActionAfterSerializeEndTag(
|
| + const Element*,
|
| + SerializeDomParam*);
|
| +
|
| // Save generated html content to data buffer.
|
| - void saveHTMLContentToBuffer(const WTF::String& content,
|
| - SerializeDomParam* param);
|
| + void saveHTMLContentToBuffer(
|
| + const WTF::String& content,
|
| + SerializeDomParam*);
|
|
|
| enum FlushOption {
|
| ForceFlush,
|
| @@ -152,20 +160,27 @@ private:
|
| };
|
|
|
| // Flushes the content buffer by encoding and sending the content to the
|
| - // WebPageSerializerClient. Content is not flushed if the buffer is not full
|
| + // WebFrameSerializerClient. Content is not flushed if the buffer is not full
|
| // unless force is 1.
|
| - void encodeAndFlushBuffer(WebPageSerializerClient::PageSerializationStatus status,
|
| - SerializeDomParam* param,
|
| - FlushOption);
|
| + void encodeAndFlushBuffer(
|
| + WebFrameSerializerClient::FrameSerializationStatus,
|
| + SerializeDomParam*,
|
| + FlushOption);
|
| +
|
| // Serialize open tag of an specified element.
|
| - void openTagToString(Element*,
|
| - SerializeDomParam* param);
|
| + void openTagToString(
|
| + Element*,
|
| + SerializeDomParam*);
|
| +
|
| // Serialize end tag of an specified element.
|
| - void endTagToString(Element*,
|
| - SerializeDomParam* param);
|
| + void endTagToString(
|
| + Element*,
|
| + SerializeDomParam*);
|
| +
|
| // Build content for a specified node
|
| - void buildContentForNode(Node*,
|
| - SerializeDomParam* param);
|
| + void buildContentForNode(
|
| + Node*,
|
| + SerializeDomParam*);
|
| };
|
|
|
| } // namespace blink
|
|
|