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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 1899803002: Offline Pages: Use 'binary encoding' to create MHTML, instead of base64. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 4915 matching lines...) Expand 10 before | Expand all | Expand 10 after
4926 if (IsMainFrame()) { 4926 if (IsMainFrame()) {
4927 data = 4927 data =
4928 WebFrameSerializer::generateMHTMLHeader(mhtml_boundary, GetWebFrame()); 4928 WebFrameSerializer::generateMHTMLHeader(mhtml_boundary, GetWebFrame());
4929 if (file.WriteAtCurrentPos(data.data(), data.size()) < 0) { 4929 if (file.WriteAtCurrentPos(data.data(), data.size()) < 0) {
4930 success = false; 4930 success = false;
4931 } 4931 }
4932 } 4932 }
4933 4933
4934 // Generate MHTML parts. 4934 // Generate MHTML parts.
4935 if (success) { 4935 if (success) {
4936 data = WebFrameSerializer::generateMHTMLParts(mhtml_boundary, GetWebFrame(), 4936 data = WebFrameSerializer::generateMHTMLParts(
4937 false, &delegate); 4937 mhtml_boundary, GetWebFrame(), params.mhtml_binary_encoding, &delegate);
4938 // TODO(jcivelli): write the chunks in deferred tasks to give a chance to 4938 // TODO(jcivelli): write the chunks in deferred tasks to give a chance to
4939 // the message loop to process other events. 4939 // the message loop to process other events.
4940 if (file.WriteAtCurrentPos(data.data(), data.size()) < 0) { 4940 if (file.WriteAtCurrentPos(data.data(), data.size()) < 0) {
4941 success = false; 4941 success = false;
4942 } 4942 }
4943 } 4943 }
4944 4944
4945 // Generate MHTML footer if needed. 4945 // Generate MHTML footer if needed.
4946 if (success && params.is_last_frame) { 4946 if (success && params.is_last_frame) {
4947 data = WebFrameSerializer::generateMHTMLFooter(mhtml_boundary); 4947 data = WebFrameSerializer::generateMHTMLFooter(mhtml_boundary);
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
6048 int match_count, 6048 int match_count,
6049 int ordinal, 6049 int ordinal,
6050 const WebRect& selection_rect, 6050 const WebRect& selection_rect,
6051 bool final_status_update) { 6051 bool final_status_update) {
6052 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, 6052 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count,
6053 selection_rect, ordinal, 6053 selection_rect, ordinal,
6054 final_status_update)); 6054 final_status_update));
6055 } 6055 }
6056 6056
6057 } // namespace content 6057 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698