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

Unified Diff: third_party/WebKit/Source/core/frame/FrameSerializer.cpp

Issue 1541463002: Rename [Web]PageSerializer[Test|Client|Impl] to ...FrameSerializer... (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mhtml-deduplication-of-resources
Patch Set: Rebasing... Created 5 years 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/core/frame/FrameSerializer.cpp
diff --git a/third_party/WebKit/Source/core/page/PageSerializer.cpp b/third_party/WebKit/Source/core/frame/FrameSerializer.cpp
similarity index 93%
rename from third_party/WebKit/Source/core/page/PageSerializer.cpp
rename to third_party/WebKit/Source/core/frame/FrameSerializer.cpp
index a3fe2fea67075906a0059065ed74c24180d8f5a8..5c484d06037b3200e7475fa150c8dc3961025702 100644
--- a/third_party/WebKit/Source/core/page/PageSerializer.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameSerializer.cpp
@@ -28,7 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "core/page/PageSerializer.h"
+#include "core/frame/FrameSerializer.h"
#include "core/HTMLNames.h"
#include "core/InputTypeNames.h"
@@ -57,7 +57,6 @@
#include "core/html/HTMLMetaElement.h"
#include "core/html/HTMLStyleElement.h"
#include "core/html/ImageDocument.h"
-#include "core/page/Page.h"
#include "core/style/StyleFetchedImage.h"
#include "core/style/StyleImage.h"
#include "platform/SerializedResource.h"
@@ -84,7 +83,7 @@ static bool shouldIgnoreElement(const Element& element)
class SerializerMarkupAccumulator : public MarkupAccumulator {
STACK_ALLOCATED();
public:
- SerializerMarkupAccumulator(PageSerializer::Delegate&, const Document&, WillBeHeapVector<RawPtrWillBeMember<Node>>&);
+ SerializerMarkupAccumulator(FrameSerializer::Delegate&, const Document&, WillBeHeapVector<RawPtrWillBeMember<Node>>&);
~SerializerMarkupAccumulator() override;
protected:
@@ -103,10 +102,10 @@ private:
const String& attributeName,
const String& attributeValue);
- PageSerializer::Delegate& m_delegate;
+ FrameSerializer::Delegate& m_delegate;
RawPtrWillBeMember<const Document> m_document;
- // FIXME: |PageSerializer| uses |m_nodes| for collecting nodes in document
+ // FIXME: |FrameSerializer| uses |m_nodes| for collecting nodes in document
// included into serialized text then extracts image, object, etc. The size
// of this vector isn't small for large document. It is better to use
// callback like functionality.
@@ -116,7 +115,7 @@ private:
WillBeHeapHashSet<RawPtrWillBeMember<const Element>> m_elementsWithRewrittenLinks;
};
-SerializerMarkupAccumulator::SerializerMarkupAccumulator(PageSerializer::Delegate& delegate, const Document& document, WillBeHeapVector<RawPtrWillBeMember<Node>>& nodes)
+SerializerMarkupAccumulator::SerializerMarkupAccumulator(FrameSerializer::Delegate& delegate, const Document& document, WillBeHeapVector<RawPtrWillBeMember<Node>>& nodes)
: MarkupAccumulator(ResolveAllURLs)
, m_delegate(delegate)
, m_document(&document)
@@ -240,7 +239,7 @@ void SerializerMarkupAccumulator::appendRewrittenAttribute(
// "Webpage, Complete" method of saving a page. It will take some work but it
// needs to be done if we want to continue to support non-MHTML saved pages.
-PageSerializer::PageSerializer(
+FrameSerializer::FrameSerializer(
Vector<SerializedResource>& resources,
Delegate& delegate)
: m_resources(&resources)
@@ -248,7 +247,7 @@ PageSerializer::PageSerializer(
{
}
-void PageSerializer::serializeFrame(const LocalFrame& frame)
+void FrameSerializer::serializeFrame(const LocalFrame& frame)
{
ASSERT(frame.document());
Document& document = *frame.document();
@@ -306,7 +305,7 @@ void PageSerializer::serializeFrame(const LocalFrame& frame)
}
}
-void PageSerializer::serializeCSSStyleSheet(CSSStyleSheet& styleSheet, const KURL& url)
+void FrameSerializer::serializeCSSStyleSheet(CSSStyleSheet& styleSheet, const KURL& url)
{
StringBuilder cssText;
cssText.appendLiteral("@charset \"");
@@ -336,7 +335,7 @@ void PageSerializer::serializeCSSStyleSheet(CSSStyleSheet& styleSheet, const KUR
}
}
-void PageSerializer::serializeCSSRule(CSSRule* rule)
+void FrameSerializer::serializeCSSRule(CSSRule* rule)
{
ASSERT(rule->parentStyleSheet()->ownerDocument());
Document& document = *rule->parentStyleSheet()->ownerDocument();
@@ -384,13 +383,13 @@ void PageSerializer::serializeCSSRule(CSSRule* rule)
}
}
-bool PageSerializer::shouldAddURL(const KURL& url)
+bool FrameSerializer::shouldAddURL(const KURL& url)
{
return url.isValid() && !m_resourceURLs.contains(url) && !url.protocolIsData()
&& !m_delegate.shouldSkipResource(url);
}
-void PageSerializer::addToResources(Resource* resource, PassRefPtr<SharedBuffer> data, const KURL& url)
+void FrameSerializer::addToResources(Resource* resource, PassRefPtr<SharedBuffer> data, const KURL& url)
{
if (!data) {
WTF_LOG_ERROR("No data for resource %s", url.string().utf8().data());
@@ -402,7 +401,7 @@ void PageSerializer::addToResources(Resource* resource, PassRefPtr<SharedBuffer>
m_resourceURLs.add(url);
}
-void PageSerializer::addImageToResources(ImageResource* image, const KURL& url)
+void FrameSerializer::addImageToResources(ImageResource* image, const KURL& url)
{
if (!shouldAddURL(url))
return;
@@ -414,7 +413,7 @@ void PageSerializer::addImageToResources(ImageResource* image, const KURL& url)
addToResources(image, data, url);
}
-void PageSerializer::addFontToResources(FontResource* font)
+void FrameSerializer::addFontToResources(FontResource* font)
{
if (!font || !shouldAddURL(font->url()) || !font->isLoaded() || !font->resourceBuffer())
return;
@@ -424,7 +423,7 @@ void PageSerializer::addFontToResources(FontResource* font)
addToResources(font, data, font->url());
}
-void PageSerializer::retrieveResourcesForProperties(const StylePropertySet* styleDeclaration, Document& document)
+void FrameSerializer::retrieveResourcesForProperties(const StylePropertySet* styleDeclaration, Document& document)
{
if (!styleDeclaration)
return;
@@ -439,7 +438,7 @@ void PageSerializer::retrieveResourcesForProperties(const StylePropertySet* styl
}
}
-void PageSerializer::retrieveResourcesForCSSValue(CSSValue* cssValue, Document& document)
+void FrameSerializer::retrieveResourcesForCSSValue(CSSValue* cssValue, Document& document)
{
if (cssValue->isImageValue()) {
CSSImageValue* imageValue = toCSSImageValue(cssValue);
@@ -467,7 +466,7 @@ void PageSerializer::retrieveResourcesForCSSValue(CSSValue* cssValue, Document&
// Returns MOTW (Mark of the Web) declaration before html tag which is in
// HTML comment, e.g. "<!-- saved from url=(%04d)%s -->"
// See http://msdn2.microsoft.com/en-us/library/ms537628(VS.85).aspx.
-String PageSerializer::markOfTheWebDeclaration(const KURL& url)
+String FrameSerializer::markOfTheWebDeclaration(const KURL& url)
{
StringBuilder builder;
bool emitsMinus = false;
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameSerializer.h ('k') | third_party/WebKit/Source/core/page/PageSerializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698