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

Side by Side Diff: Source/core/page/PageSerializer.h

Issue 68613003: Merges the two different page serializers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 class Page; 48 class Page;
49 class RenderObject; 49 class RenderObject;
50 class Resource; 50 class Resource;
51 class SharedBuffer; 51 class SharedBuffer;
52 class StylePropertySet; 52 class StylePropertySet;
53 class StyleRule; 53 class StyleRule;
54 class StyleRuleFontFace; 54 class StyleRuleFontFace;
55 55
56 struct SerializedResource; 56 struct SerializedResource;
57 57
58 // This hash map is used to map resource URL of original link to its local
59 // file path.
60 typedef HashMap<WTF::String, WTF::String> LinkLocalPathMap;
abarth-chromium 2013/11/14 16:55:03 WTF::String -> String. There's no need to use the
61
58 // This class is used to serialize a page contents back to text (typically HTML) . 62 // This class is used to serialize a page contents back to text (typically HTML) .
59 // It serializes all the page frames and retrieves resources such as images and CSS stylesheets. 63 // It serializes all the page frames and retrieves resources such as images and CSS stylesheets.
60 class PageSerializer { 64 class PageSerializer {
61 public: 65 public:
62 explicit PageSerializer(Vector<SerializedResource>*); 66 explicit PageSerializer(Vector<SerializedResource>*, HashMap<WTF::String, WT F::String>* = 0, WTF::String = "");
abarth-chromium 2013/11/14 16:55:03 Why not use the LinkLocalPathMap type here? No ne
63 67
64 // Initiates the serialization of the frame's page. All serialized content a nd retrieved 68 // Initiates the serialization of the frame's page. All serialized content a nd retrieved
65 // resources are added to the Vector passed to the constructor. The first re source in that 69 // resources are added to the Vector passed to the constructor. The first re source in that
66 // vector is the top frame serialized content. 70 // vector is the top frame serialized content.
67 void serialize(Page*); 71 void serialize(Page*);
68 72
69 KURL urlForBlankFrame(Frame*); 73 KURL urlForBlankFrame(Frame*);
70 74
71 private: 75 private:
72 void serializeFrame(Frame*); 76 void serializeFrame(Frame*);
73 77
74 // Serializes the stylesheet back to text and adds it to the resources if UR L is not-empty. 78 // Serializes the stylesheet back to text and adds it to the resources if UR L is not-empty.
75 // It also adds any resources included in that stylesheet (including any imp orted stylesheets and their own resources). 79 // It also adds any resources included in that stylesheet (including any imp orted stylesheets and their own resources).
76 void serializeCSSStyleSheet(CSSStyleSheet*, const KURL&); 80 void serializeCSSStyleSheet(CSSStyleSheet*, const KURL&);
77 81
78 bool shouldAddURL(const KURL&); 82 bool shouldAddURL(const KURL&);
79 83
80 void addToResources(Resource *, PassRefPtr<SharedBuffer>, const KURL&); 84 void addToResources(Resource *, PassRefPtr<SharedBuffer>, const KURL&);
81 void addImageToResources(ImageResource*, RenderObject*, const KURL&); 85 void addImageToResources(ImageResource*, RenderObject*, const KURL&);
82 void addFontToResources(FontResource*); 86 void addFontToResources(FontResource*);
83 87
84 void retrieveResourcesForProperties(const StylePropertySet*, Document*); 88 void retrieveResourcesForProperties(const StylePropertySet*, Document*);
85 void retrieveResourcesForCSSValue(CSSValue*, Document*); 89 void retrieveResourcesForCSSValue(CSSValue*, Document*);
86 90
87 Vector<SerializedResource>* m_resources; 91 Vector<SerializedResource>* m_resources;
88 ListHashSet<KURL> m_resourceURLs; 92 ListHashSet<KURL> m_resourceURLs;
89 HashMap<Frame*, KURL> m_blankFrameURLs; 93 HashMap<Frame*, KURL> m_blankFrameURLs;
94 LinkLocalPathMap* m_URLs;
95 WTF::String m_directory;
90 unsigned m_blankFrameCounter; 96 unsigned m_blankFrameCounter;
91 }; 97 };
92 98
93 } 99 }
94 100
95 #endif 101 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698