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

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: Use HasSubstr instead of ContainsRegex when appropriate. 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 4907 matching lines...) Expand 10 before | Expand all | Expand 10 after
4918 if (IsMainFrame()) { 4918 if (IsMainFrame()) {
4919 data = 4919 data =
4920 WebFrameSerializer::generateMHTMLHeader(mhtml_boundary, GetWebFrame()); 4920 WebFrameSerializer::generateMHTMLHeader(mhtml_boundary, GetWebFrame());
4921 if (file.WriteAtCurrentPos(data.data(), data.size()) < 0) { 4921 if (file.WriteAtCurrentPos(data.data(), data.size()) < 0) {
4922 success = false; 4922 success = false;
4923 } 4923 }
4924 } 4924 }
4925 4925
4926 // Generate MHTML parts. 4926 // Generate MHTML parts.
4927 if (success) { 4927 if (success) {
4928 data = WebFrameSerializer::generateMHTMLParts(mhtml_boundary, GetWebFrame(), 4928 data = WebFrameSerializer::generateMHTMLParts(
4929 false, &delegate); 4929 mhtml_boundary, GetWebFrame(), params.mhtml_binary_encoding, &delegate);
4930 // TODO(jcivelli): write the chunks in deferred tasks to give a chance to 4930 // TODO(jcivelli): write the chunks in deferred tasks to give a chance to
4931 // the message loop to process other events. 4931 // the message loop to process other events.
4932 if (file.WriteAtCurrentPos(data.data(), data.size()) < 0) { 4932 if (file.WriteAtCurrentPos(data.data(), data.size()) < 0) {
4933 success = false; 4933 success = false;
4934 } 4934 }
4935 } 4935 }
4936 4936
4937 // Generate MHTML footer if needed. 4937 // Generate MHTML footer if needed.
4938 if (success && params.is_last_frame) { 4938 if (success && params.is_last_frame) {
4939 data = WebFrameSerializer::generateMHTMLFooter(mhtml_boundary); 4939 data = WebFrameSerializer::generateMHTMLFooter(mhtml_boundary);
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
6040 int match_count, 6040 int match_count,
6041 int ordinal, 6041 int ordinal,
6042 const WebRect& selection_rect, 6042 const WebRect& selection_rect,
6043 bool final_status_update) { 6043 bool final_status_update) {
6044 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, 6044 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count,
6045 selection_rect, ordinal, 6045 selection_rect, ordinal,
6046 final_status_update)); 6046 final_status_update));
6047 } 6047 }
6048 6048
6049 } // namespace content 6049 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698