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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameSerializer.h

Issue 1977303003: Adds a feature to MHTML serialization that omits subframes and subresources marked no-store. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no-store
Patch Set: Adds an image subresource to the test. Created 4 years, 7 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
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // return true and populate |rewrittenLink| with a desired value of the 78 // return true and populate |rewrittenLink| with a desired value of the
79 // html attribute value to be used in place of the original link. 79 // html attribute value to be used in place of the original link.
80 // (i.e. in place of img.src or iframe.src or object.data). 80 // (i.e. in place of img.src or iframe.src or object.data).
81 // 81 //
82 // If no link rewriting is desired, this method should return false. 82 // If no link rewriting is desired, this method should return false.
83 virtual bool rewriteLink(const Element&, String& rewrittenLink) 83 virtual bool rewriteLink(const Element&, String& rewrittenLink)
84 { 84 {
85 return false; 85 return false;
86 } 86 }
87 87
88 // Tells whether to skip serialization of a subresource with a given URI . 88 // Tells whether to skip serialization of a subresource or CSSStyleSheet
89 // Used to deduplicate resources across multiple frames. 89 // with a given URI. Used to deduplicate resources across multiple frame s.
90 virtual bool shouldSkipResource(const KURL&) 90 virtual bool shouldSkipResourceWithURL(const KURL&)
91 { 91 {
92 return false; 92 return false;
93 } 93 }
94
95 // Tells whether to skip serialization of a subresource.
96 virtual bool shouldSkipResource(Resource*)
Łukasz Anforowicz 2016/05/18 17:27:25 nit: I wonder we can avoid introducing a new metho
dewittj 2016/05/19 04:13:17 Only other way that would work is if you had: shou
Łukasz Anforowicz 2016/05/19 17:00:13 This is fine. Thanks for looking into this.
dewittj 2016/05/19 18:18:35 Acknowledged.
97 {
98 return false;
99 }
94 }; 100 };
95 101
96 // Constructs a serializer that will write output to the given vector of 102 // Constructs a serializer that will write output to the given vector of
97 // SerializedResources and uses the Delegate for controlling some 103 // SerializedResources and uses the Delegate for controlling some
98 // serialization aspects. Callers need to ensure that both arguments stay 104 // serialization aspects. Callers need to ensure that both arguments stay
99 // alive until the FrameSerializer gets destroyed. 105 // alive until the FrameSerializer gets destroyed.
100 FrameSerializer(Vector<SerializedResource>&, Delegate&); 106 FrameSerializer(Vector<SerializedResource>&, Delegate&);
101 107
102 // Initiates the serialization of the frame. All serialized content and 108 // Initiates the serialization of the frame. All serialized content and
103 // retrieved resources are added to the Vector passed to the constructor. 109 // retrieved resources are added to the Vector passed to the constructor.
(...skipping 22 matching lines...) Expand all
126 132
127 Vector<SerializedResource>* m_resources; 133 Vector<SerializedResource>* m_resources;
128 HashSet<KURL> m_resourceURLs; 134 HashSet<KURL> m_resourceURLs;
129 135
130 Delegate& m_delegate; 136 Delegate& m_delegate;
131 }; 137 };
132 138
133 } // namespace blink 139 } // namespace blink
134 140
135 #endif // FrameSerializer_h 141 #endif // FrameSerializer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698