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

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

Issue 1203873004: Retrieve resources from media and supports query rules while serializing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address nits Created 5 years, 6 months 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
« no previous file with comments | « no previous file | Source/core/page/PageSerializer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 27 matching lines...) Expand all
38 #include "wtf/HashMap.h" 38 #include "wtf/HashMap.h"
39 #include "wtf/ListHashSet.h" 39 #include "wtf/ListHashSet.h"
40 #include "wtf/PassOwnPtr.h" 40 #include "wtf/PassOwnPtr.h"
41 #include "wtf/Vector.h" 41 #include "wtf/Vector.h"
42 42
43 namespace blink { 43 namespace blink {
44 44
45 class Attribute; 45 class Attribute;
46 class FontResource; 46 class FontResource;
47 class ImageResource; 47 class ImageResource;
48 class CSSRule;
48 class CSSStyleSheet; 49 class CSSStyleSheet;
49 class CSSValue; 50 class CSSValue;
50 class Document; 51 class Document;
51 class LocalFrame; 52 class LocalFrame;
52 class Page; 53 class Page;
53 class LayoutObject; 54 class LayoutObject;
54 class Resource; 55 class Resource;
55 class SharedBuffer; 56 class SharedBuffer;
56 class StylePropertySet; 57 class StylePropertySet;
57 58
(...skipping 21 matching lines...) Expand all
79 80
80 Delegate* delegate(); 81 Delegate* delegate();
81 82
82 private: 83 private:
83 void serializeFrame(LocalFrame*); 84 void serializeFrame(LocalFrame*);
84 85
85 // Serializes the stylesheet back to text and adds it to the resources if UR L is not-empty. 86 // Serializes the stylesheet back to text and adds it to the resources if UR L is not-empty.
86 // It also adds any resources included in that stylesheet (including any imp orted stylesheets and their own resources). 87 // It also adds any resources included in that stylesheet (including any imp orted stylesheets and their own resources).
87 void serializeCSSStyleSheet(CSSStyleSheet&, const KURL&); 88 void serializeCSSStyleSheet(CSSStyleSheet&, const KURL&);
88 89
90 // Serializes the css rule (including any imported stylesheets), adding refe renced resources.
91 void serializeCSSRule(CSSRule*);
92
89 bool shouldAddURL(const KURL&); 93 bool shouldAddURL(const KURL&);
90 94
91 void addToResources(Resource *, PassRefPtr<SharedBuffer>, const KURL&); 95 void addToResources(Resource *, PassRefPtr<SharedBuffer>, const KURL&);
92 void addImageToResources(ImageResource*, LayoutObject*, const KURL&); 96 void addImageToResources(ImageResource*, LayoutObject*, const KURL&);
93 void addFontToResources(FontResource*); 97 void addFontToResources(FontResource*);
94 98
95 void retrieveResourcesForProperties(const StylePropertySet*, Document&); 99 void retrieveResourcesForProperties(const StylePropertySet*, Document&);
96 void retrieveResourcesForCSSValue(CSSValue*, Document&); 100 void retrieveResourcesForCSSValue(CSSValue*, Document&);
97 101
98 Vector<SerializedResource>* m_resources; 102 Vector<SerializedResource>* m_resources;
99 ListHashSet<KURL> m_resourceURLs; 103 ListHashSet<KURL> m_resourceURLs;
100 104
101 using BlankFrameURLMap = WillBeHeapHashMap<RawPtrWillBeMember<LocalFrame>, K URL>; 105 using BlankFrameURLMap = WillBeHeapHashMap<RawPtrWillBeMember<LocalFrame>, K URL>;
102 BlankFrameURLMap m_blankFrameURLs; 106 BlankFrameURLMap m_blankFrameURLs;
103 unsigned m_blankFrameCounter; 107 unsigned m_blankFrameCounter;
104 108
105 OwnPtr<Delegate> m_delegate; 109 OwnPtr<Delegate> m_delegate;
106 }; 110 };
107 111
108 } // namespace blink 112 } // namespace blink
109 113
110 #endif // PageSerializer_h 114 #endif // PageSerializer_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/page/PageSerializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698