OLD | NEW |
1 # High-level overview of Save-Page-As code | 1 # High-level overview of Save-Page-As code |
2 | 2 |
3 This document describes code under `//content/browser/downloads` | 3 This document describes code under `//content/browser/downloads` |
4 restricting the scope only to code handling Save-Page-As functionality | 4 restricting the scope only to code handling Save-Page-As functionality |
5 (i.e. leaving out other downloads-related code). | 5 (i.e. leaving out other downloads-related code). |
6 This document focuses on high-level overview and aspects of the code that | 6 This document focuses on high-level overview and aspects of the code that |
7 span multiple compilation units (hoping that individual compilation units | 7 span multiple compilation units (hoping that individual compilation units |
8 are described by their code comments or by their code structure). | 8 are described by their code comments or by their code structure). |
9 | 9 |
10 ## Classes overview | 10 ## Classes overview |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 frame to write its portion of MHTML to a file handle. Other | 94 frame to write its portion of MHTML to a file handle. Other |
95 classes (i.e. `SavePackage` and/or `SaveFileManager`) are not | 95 classes (i.e. `SavePackage` and/or `SaveFileManager`) are not |
96 used at this step at all. | 96 used at this step at all. |
97 | 97 |
98 * Step 3: When done `MHTMLGenerationManager` destroys | 98 * Step 3: When done `MHTMLGenerationManager` destroys |
99 `MHTMLGenerationManager::Job` instance and calls a completion | 99 `MHTMLGenerationManager::Job` instance and calls a completion |
100 callback which in case of Save-Page-As will end up in | 100 callback which in case of Save-Page-As will end up in |
101 `SavePackage::OnMHTMLGenerated`. | 101 `SavePackage::OnMHTMLGenerated`. |
102 | 102 |
103 Note: MHTML format is by default disabled in Save-Page-As UI on Windows, MacOS | 103 Note: MHTML format is by default disabled in Save-Page-As UI on Windows, MacOS |
104 and Linux (it is the default on ChromeOS), but for testing this can be easily | 104 and Linux (it is the default on Chrome OS), but for testing this can be easily |
105 changed using `--save-page-as-mhtml` command line switch. | 105 changed using `--save-page-as-mhtml` command line switch. |
106 | 106 |
107 | 107 |
108 ### HTML Only | 108 ### HTML Only |
109 | 109 |
110 Very high-level flow of saving a page as "HTML Only": | 110 Very high-level flow of saving a page as "HTML Only": |
111 | 111 |
112 * `SavePackage` creates only a single `SaveItem` (always `SAVE_FILE_FROM_NET`) | 112 * `SavePackage` creates only a single `SaveItem` (always `SAVE_FILE_FROM_NET`) |
113 and asks `SaveFileManager` to process it | 113 and asks `SaveFileManager` to process it |
114 (as in the Complete HTML individual SaveItem handling above.). | 114 (as in the Complete HTML individual SaveItem handling above.). |
(...skipping 16 matching lines...) Expand all Loading... |
131 | 131 |
132 * Blink: | 132 * Blink: |
133 * `//third_party/WebKit/public/web/WebFrameSerializer...` | 133 * `//third_party/WebKit/public/web/WebFrameSerializer...` |
134 * `//third_party/WebKit/Source/web/WebFrameSerializerImpl...` | 134 * `//third_party/WebKit/Source/web/WebFrameSerializerImpl...` |
135 (used for Complete HTML today; should use `FrameSerializer` instead in | 135 (used for Complete HTML today; should use `FrameSerializer` instead in |
136 the long-term - see https://crbug.com/328354). | 136 the long-term - see https://crbug.com/328354). |
137 * `//third_party/WebKit/Source/core/frame/FrameSerializer...` | 137 * `//third_party/WebKit/Source/core/frame/FrameSerializer...` |
138 (used for MHTML today) | 138 (used for MHTML today) |
139 * `//third_party/WebKit/Source/platform/mhtml/MHTMLArchive...` | 139 * `//third_party/WebKit/Source/platform/mhtml/MHTMLArchive...` |
140 | 140 |
OLD | NEW |