summaryrefslogtreecommitdiffstats
path: root/content/renderer/mhtml_generator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/renderer/mhtml_generator.cc')
-rw-r--r--content/renderer/mhtml_generator.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/content/renderer/mhtml_generator.cc b/content/renderer/mhtml_generator.cc
index b5b9423..6c5f262 100644
--- a/content/renderer/mhtml_generator.cc
+++ b/content/renderer/mhtml_generator.cc
@@ -33,18 +33,18 @@ void MHTMLGenerator::OnSavePageAsMHTML(
base::PlatformFile file =
IPC::PlatformFileForTransitToPlatformFile(file_for_transit);
file_ = file;
- bool success = GenerateMHTML();
- NotifyBrowser(job_id, success);
+ int64 size = GenerateMHTML();
+ NotifyBrowser(job_id, size);
}
-void MHTMLGenerator::NotifyBrowser(int job_id, bool success) {
- render_view()->Send(new ViewHostMsg_SavedPageAsMHTML(job_id, success));
+void MHTMLGenerator::NotifyBrowser(int job_id, int64 data_size) {
+ render_view()->Send(new ViewHostMsg_SavedPageAsMHTML(job_id, data_size));
file_ = base::kInvalidPlatformFileValue;
}
// TODO(jcivelli): write the chunks in deferred tasks to give a chance to the
// message loop to process other events.
-bool MHTMLGenerator::GenerateMHTML() {
+int64 MHTMLGenerator::GenerateMHTML() {
WebKit::WebCString mhtml =
WebKit::WebPageSerializer::serializeToMHTML(render_view()->webview());
const size_t chunk_size = 1024;
@@ -57,8 +57,8 @@ bool MHTMLGenerator::GenerateMHTML() {
data + total_bytes_written,
copy_size);
if (bytes_written == -1)
- return false;
+ return -1;
total_bytes_written += bytes_written;
}
- return true;
+ return total_bytes_written;
}