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

Side by Side Diff: content/browser/download/mhtml_extra_parts_impl.h

Issue 2683493002: Get signals working in the EXTRA_DATA section of MHTML (Closed)
Patch Set: Merge changelist with tip of tree Created 3 years, 8 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 | « content/browser/BUILD.gn ('k') | content/browser/download/mhtml_extra_parts_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_PARTS_IMPL_H_
6 #define CONTENT_BROWSER_DOWNLOAD_MHTML_EXTRA_PARTS_IMPL_H_
7
8 #include "content/public/browser/mhtml_extra_parts.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 an 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. This allows arbitrary extra MHTML parts to be added into the
23 // complete file. For instance, this might be used for gathering load time
24 // signals in debug code for analysis.
25 class MHTMLExtraPartsImpl : public content::MHTMLExtraParts {
26 public:
27 MHTMLExtraPartsImpl();
28 ~MHTMLExtraPartsImpl() override;
29
30 // Return the vector of parts to be serialized.
31 const std::vector<MHTMLExtraDataPart>& parts() const { return parts_; }
32
33 // Return the number of extra parts added.
34 int64_t size() override;
35
36 // Creates a MHTMLExtraDataPart and adds it to our vector of parts.
37 void AddExtraMHTMLPart(const std::string& content_type,
38 const std::string& content_location,
39 const std::string& body) override;
40
41 private:
42 std::vector<MHTMLExtraDataPart> parts_;
43 };
44
45 } // namespace content
46
47 #endif // CONTENT_BROWSER_DOWNLOAD_MHTML_EXTRA_PARTS_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/download/mhtml_extra_parts_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698