Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 // | 59 // |
| 60 // Contents of the header (i.e. title and mime type) will be based | 60 // Contents of the header (i.e. title and mime type) will be based |
| 61 // on |topLevelFrame|. | 61 // on |topLevelFrame|. |
| 62 // | 62 // |
| 63 // Same |boundary| needs to used for all generateMHTMLHeader and | 63 // Same |boundary| needs to used for all generateMHTMLHeader and |
| 64 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same | 64 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same |
| 65 // MHTML document (see also generateMHTMLBoundary method). | 65 // MHTML document (see also generateMHTMLBoundary method). |
| 66 BLINK_EXPORT static WebData generateMHTMLHeader( | 66 BLINK_EXPORT static WebData generateMHTMLHeader( |
| 67 const WebString& boundary, WebLocalFrame* topLevelFrame); | 67 const WebString& boundary, WebLocalFrame* topLevelFrame); |
| 68 | 68 |
| 69 // Enumerates and returns URLs of MHTML resources that would be generated | |
| 70 // for the given frame by generateMHTMLParts. | |
| 71 BLINK_EXPORT static WebVector<WebURL> enumerateMHTMLResources( | |
| 72 WebLocalFrame*); | |
| 73 | |
| 69 // Generates and returns MHTML parts for the given frame and all the | 74 // Generates and returns MHTML parts for the given frame and all the |
| 70 // savable resources underneath. | 75 // savable resources underneath. |
| 71 // | 76 // |
| 72 // Same |boundary| needs to used for all generateMHTMLHeader and | 77 // Same |boundary| needs to used for all generateMHTMLHeader and |
| 73 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same | 78 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same |
| 74 // MHTML document (see also generateMHTMLBoundary method). | 79 // MHTML document (see also generateMHTMLBoundary method). |
| 75 // | 80 // |
| 76 // |frameToContentID| is used for 1) emitting cid: scheme uri links for | 81 // |frameToContentID| is used for 1) emitting cid: scheme uri links for |
| 77 // subframes and 2) emitting MIME Content-ID headers. | 82 // subframes and 2) emitting MIME Content-ID headers. |
| 78 // See rfc2557 - section 8.3 - "Use of the Content-ID header and CID URLs". | 83 // See rfc2557 - section 8.3 - "Use of the Content-ID header and CID URLs". |
| 79 // Format note - |frameToContentID| should contain strings of the form | 84 // Format note - |frameToContentID| should contain strings of the form |
| 80 // "<foo@bar.com>" (i.e. the strings should include the angle brackets). | 85 // "<foo@bar.com>" (i.e. the strings should include the angle brackets). |
| 86 // | |
| 87 // |resourcesToSkip| specifies which resources to skip (this skipping | |
| 88 // is not applied to the uri of the frame being serialized). | |
| 81 BLINK_EXPORT static WebData generateMHTMLParts( | 89 BLINK_EXPORT static WebData generateMHTMLParts( |
| 82 const WebString& boundary, WebLocalFrame*, bool useBinaryEncoding, | 90 const WebString& boundary, WebLocalFrame*, bool useBinaryEncoding, |
| 83 const WebVector<std::pair<WebFrame*, WebString>>& frameToContentID); | 91 const WebVector<std::pair<WebFrame*, WebString>>& frameToContentID, |
| 92 const WebVector<WebURL>& resourcesToSkip); | |
| 84 | 93 |
| 85 // Generates and returns an MHTML footer. | 94 // Generates and returns an MHTML footer. |
| 86 // | 95 // |
| 87 // Same |boundary| needs to used for all generateMHTMLHeader and | 96 // Same |boundary| needs to used for all generateMHTMLHeader and |
| 88 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same | 97 // generateMHTMLParts and generateMHTMLFooter calls that belong to the same |
| 89 // MHTML document (see also generateMHTMLBoundary method). | 98 // MHTML document (see also generateMHTMLBoundary method). |
| 90 BLINK_EXPORT static WebData generateMHTMLFooter(const WebString& boundary); | 99 BLINK_EXPORT static WebData generateMHTMLFooter(const WebString& boundary); |
| 91 | 100 |
| 92 // IMPORTANT: | 101 // IMPORTANT: |
| 93 // The API below is an older implementation of a pageserialization that | 102 // The API below is an older implementation of a pageserialization that |
| 94 // will be removed soon. | 103 // will be removed soon. |
| 95 | 104 |
| 96 // This function will serialize the specified frame to HTML data. | 105 // This function will serialize the specified frame to HTML data. |
| 97 // We have a data buffer to temporary saving generated html data. We will | 106 // We have a data buffer to temporary saving generated html data. We will |
| 98 // sequentially call WebPageSeriazlierClient once the data buffer is full. | 107 // sequentially call WebPageSeriazlierClient once the data buffer is full. |
|
ncarter (slow)
2015/12/04 21:52:39
"Seriazlier"
Łukasz Anforowicz
2015/12/04 22:55:43
Done.
| |
| 99 // | 108 // |
| 100 // Return false means if no data has been serialized (i.e. because | 109 // Return false means if no data has been serialized (i.e. because |
| 101 // the target frame didn't have a valid url). | 110 // the target frame didn't have a valid url). |
| 102 // | 111 // |
| 103 // The parameter frame specifies which frame need to be serialized. | 112 // The parameter frame specifies which frame need to be serialized. |
| 104 // The parameter client specifies the pointer of interface | 113 // The parameter client specifies the pointer of interface |
| 105 // WebPageSerializerClient providing a sink interface to receive the | 114 // WebPageSerializerClient providing a sink interface to receive the |
| 106 // individual chunks of data to be saved. | 115 // individual chunks of data to be saved. |
| 107 // The parameter links contain original URLs of all saved links. | 116 // The parameter links contain original URLs of all saved links. |
| 108 // The parameter localPaths contain corresponding local file paths of all | 117 // The parameter localPaths contain corresponding local file paths of all |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 123 BLINK_EXPORT static WebString generateMetaCharsetDeclaration(const WebString & charset); | 132 BLINK_EXPORT static WebString generateMetaCharsetDeclaration(const WebString & charset); |
| 124 // Generate the MOTW declaration. | 133 // Generate the MOTW declaration. |
| 125 BLINK_EXPORT static WebString generateMarkOfTheWebDeclaration(const WebURL&) ; | 134 BLINK_EXPORT static WebString generateMarkOfTheWebDeclaration(const WebURL&) ; |
| 126 // Generate the default base tag declaration. | 135 // Generate the default base tag declaration. |
| 127 BLINK_EXPORT static WebString generateBaseTagDeclaration(const WebString& ba seTarget); | 136 BLINK_EXPORT static WebString generateBaseTagDeclaration(const WebString& ba seTarget); |
| 128 }; | 137 }; |
| 129 | 138 |
| 130 } // namespace blink | 139 } // namespace blink |
| 131 | 140 |
| 132 #endif | 141 #endif |
| OLD | NEW |