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

Side by Side Diff: chrome/browser/android/offline_pages/offline_page_mhtml_archiver.cc

Issue 1542413002: Switch to standard integer types in chrome/browser/, part 1 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h" 5 #include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 archives_dir.Append(GenerateFileName(url, base::UTF16ToUTF8(title)))); 107 archives_dir.Append(GenerateFileName(url, base::UTF16ToUTF8(title))));
108 108
109 web_contents_->GenerateMHTML( 109 web_contents_->GenerateMHTML(
110 file_path, base::Bind(&OfflinePageMHTMLArchiver::OnGenerateMHTMLDone, 110 file_path, base::Bind(&OfflinePageMHTMLArchiver::OnGenerateMHTMLDone,
111 weak_ptr_factory_.GetWeakPtr(), url, file_path)); 111 weak_ptr_factory_.GetWeakPtr(), url, file_path));
112 } 112 }
113 113
114 void OfflinePageMHTMLArchiver::OnGenerateMHTMLDone( 114 void OfflinePageMHTMLArchiver::OnGenerateMHTMLDone(
115 const GURL& url, 115 const GURL& url,
116 const base::FilePath& file_path, 116 const base::FilePath& file_path,
117 int64 file_size) { 117 int64_t file_size) {
118 if (file_size < 0) { 118 if (file_size < 0) {
119 ReportFailure(ArchiverResult::ERROR_ARCHIVE_CREATION_FAILED); 119 ReportFailure(ArchiverResult::ERROR_ARCHIVE_CREATION_FAILED);
120 } else { 120 } else {
121 callback_.Run(this, ArchiverResult::SUCCESSFULLY_CREATED, url, file_path, 121 callback_.Run(this, ArchiverResult::SUCCESSFULLY_CREATED, url, file_path,
122 file_size); 122 file_size);
123 } 123 }
124 } 124 }
125 125
126 void OfflinePageMHTMLArchiver::ReportFailure(ArchiverResult result) { 126 void OfflinePageMHTMLArchiver::ReportFailure(ArchiverResult result) {
127 DCHECK(result != ArchiverResult::SUCCESSFULLY_CREATED); 127 DCHECK(result != ArchiverResult::SUCCESSFULLY_CREATED);
128 callback_.Run(this, result, GURL(), base::FilePath(), 0); 128 callback_.Run(this, result, GURL(), base::FilePath(), 0);
129 } 129 }
130 130
131 } // namespace offline_pages 131 } // namespace offline_pages
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698