OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_BROWSER_DOWNLOAD_MHTML_EXTRA_DATA_IMPL_H_ | |
6 #define CONTENT_BROWSER_DOWNLOAD_MHTML_EXTRA_DATA_IMPL_H_ | |
7 | |
8 #include "content/public/browser/mhtml_extra_data.h" | |
9 | |
10 namespace content { | |
11 | |
12 // Data fields used to build an additional MHTML part in the output file. | |
13 struct MHTMLExtraDataPart { | |
14 std::string content_type; | |
15 std::string content_location; | |
16 std::string body; | |
17 }; | |
18 | |
19 // Class used as a data object for WebContents UserData to represent a MHTML | |
20 // part that we plan to write into the output MHTML file. Each MHTMLExtraPart | |
21 // object in the contained vector lets us hold enough information to generate | |
22 // one MHTML part. Arbitrary extra MHTML parts to be added into the complete | |
Dmitry Titov
2017/03/29 18:53:06
incomplete sentence...
Pete Williamson
2017/03/29 22:05:42
Done.
| |
23 // file. For instance, this might be used for gathering load time signals in | |
24 // debug code for analysis. | |
25 class MHTMLExtraDataImpl : public content::MHTMLExtraData { | |
26 public: | |
27 MHTMLExtraDataImpl(); | |
28 ~MHTMLExtraDataImpl() override; | |
29 | |
30 // Return the vector of parts to be disassembled. | |
Dmitry Titov
2017/03/29 18:53:06
disassembled?
Pete Williamson
2017/03/29 22:05:42
Oops, serialized. Fixed.
| |
31 std::vector<MHTMLExtraDataPart>& parts() { return parts_; } | |
32 const std::vector<MHTMLExtraDataPart>& parts() const { return parts_; } | |
33 | |
34 void AddExtraMHTMLPart(const std::string& content_type, | |
Dmitry Titov
2017/03/29 18:53:06
This shoudl have a comment saying it's implementat
Pete Williamson
2017/03/29 22:05:42
I don't think I understood your suggestion, but I
| |
35 const std::string& content_location, | |
36 const std::string& body) override; | |
37 | |
38 private: | |
39 std::vector<MHTMLExtraDataPart> parts_; | |
40 }; | |
41 | |
42 } // namespace content | |
43 | |
44 #endif // CONTENT_BROWSER_DOWNLOAD_MHTML_EXTRA_DATA_IMPL_H_ | |
OLD | NEW |