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

Unified Diff: content/public/browser/mhtml_extra_parts.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/browser/BUILD.gn ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/mhtml_extra_parts.h
diff --git a/content/public/browser/mhtml_extra_parts.h b/content/public/browser/mhtml_extra_parts.h
new file mode 100644
index 0000000000000000000000000000000000000000..53cfb393112068e1bfaf52754e2a6990bd2a4a6e
--- /dev/null
+++ b/content/public/browser/mhtml_extra_parts.h
@@ -0,0 +1,35 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_PUBLIC_BROWSER_MHTML_EXTRA_PARTS_H_
+#define CONTENT_PUBLIC_BROWSER_MHTML_EXTRA_PARTS_H_
+
+#include "base/supports_user_data.h"
+#include "content/public/browser/web_contents.h"
+
+namespace content {
+
+// Interface class for adding an extra part to MHTML when doing MHTML
+// generation. To use it, get it from the web contents with FromWebContents,
+// then call AddExtraMHTMLPart to add a new part.
+class CONTENT_EXPORT MHTMLExtraParts : public base::SupportsUserData::Data {
+ public:
+ // Retrieves the extra data from the web contents.
+ static MHTMLExtraParts* FromWebContents(WebContents* contents);
+
+ // Add an extra MHTML part to the data structure stored by the WebContents.
+ // This will take care of generating the boundary line. This will also set
+ // the content-type and content-location headers to the values provided, and
+ // use the body provided.
+ virtual void AddExtraMHTMLPart(const std::string& content_type,
+ const std::string& content_location,
+ const std::string& body) = 0;
+
+ // Returns the number of extra parts added.
+ virtual int64_t size() = 0;
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_MHTML_EXTRA_DATA_H_
« no previous file with comments | « content/public/browser/BUILD.gn ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698