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

Side by Side Diff: content/browser/download/save_package.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: Final nits. 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/download/save_package.h" 5 #include "content/browser/download/save_package.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 // Confirm above didn't delete the tab out from under us. 331 // Confirm above didn't delete the tab out from under us.
332 if (!download_created_callback.is_null()) 332 if (!download_created_callback.is_null())
333 download_created_callback.Run(download_); 333 download_created_callback.Run(download_);
334 334
335 // Check save type and process the save page job. 335 // Check save type and process the save page job.
336 if (save_type_ == SAVE_PAGE_TYPE_AS_COMPLETE_HTML) { 336 if (save_type_ == SAVE_PAGE_TYPE_AS_COMPLETE_HTML) {
337 // Get directory 337 // Get directory
338 DCHECK(!saved_main_directory_path_.empty()); 338 DCHECK(!saved_main_directory_path_.empty());
339 GetSavableResourceLinks(); 339 GetSavableResourceLinks();
340 } else if (save_type_ == SAVE_PAGE_TYPE_AS_MHTML) { 340 } else if (save_type_ == SAVE_PAGE_TYPE_AS_MHTML) {
341 web_contents()->GenerateMHTML(saved_main_file_path_, base::Bind( 341 web_contents()->GenerateMHTML(
342 &SavePackage::OnMHTMLGenerated, this)); 342 saved_main_file_path_, false /* use_binary_encoding */,
343 base::Bind(&SavePackage::OnMHTMLGenerated, this));
343 } else { 344 } else {
344 DCHECK_EQ(SAVE_PAGE_TYPE_AS_ONLY_HTML, save_type_); 345 DCHECK_EQ(SAVE_PAGE_TYPE_AS_ONLY_HTML, save_type_);
345 wait_state_ = NET_FILES; 346 wait_state_ = NET_FILES;
346 SaveFileCreateInfo::SaveFileSource save_source = page_url_.SchemeIsFile() ? 347 SaveFileCreateInfo::SaveFileSource save_source = page_url_.SchemeIsFile() ?
347 SaveFileCreateInfo::SAVE_FILE_FROM_FILE : 348 SaveFileCreateInfo::SAVE_FILE_FROM_FILE :
348 SaveFileCreateInfo::SAVE_FILE_FROM_NET; 349 SaveFileCreateInfo::SAVE_FILE_FROM_NET;
349 // Add this item to waiting list. 350 // Add this item to waiting list.
350 waiting_item_queue_.push_back( 351 waiting_item_queue_.push_back(
351 new SaveItem(page_url_, Referrer(), this, save_source, 352 new SaveItem(page_url_, Referrer(), this, save_source,
352 FrameTreeNode::kFrameTreeNodeInvalidId)); 353 FrameTreeNode::kFrameTreeNodeInvalidId));
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 } 1494 }
1494 1495
1495 void SavePackage::FinalizeDownloadEntry() { 1496 void SavePackage::FinalizeDownloadEntry() {
1496 DCHECK(download_); 1497 DCHECK(download_);
1497 1498
1498 download_manager_->OnSavePackageSuccessfullyFinished(download_); 1499 download_manager_->OnSavePackageSuccessfullyFinished(download_);
1499 StopObservation(); 1500 StopObservation();
1500 } 1501 }
1501 1502
1502 } // namespace content 1503 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/mhtml_generation_manager.cc ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698