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

Unified Diff: content/browser/download/mhtml_generation_manager.h

Issue 8674002: Switch MHTMLGenerationManager to use a Callback. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/download/mhtml_generation_manager.h
diff --git a/content/browser/download/mhtml_generation_manager.h b/content/browser/download/mhtml_generation_manager.h
index eeb6b04b0491f24d396d33fd41c008aadeb136f6..01906570bd1e8d175d2fdaa27bf2860779a6c50b 100644
--- a/content/browser/download/mhtml_generation_manager.h
+++ b/content/browser/download/mhtml_generation_manager.h
@@ -24,24 +24,24 @@ class CONTENT_EXPORT MHTMLGenerationManager
MHTMLGenerationManager();
~MHTMLGenerationManager();
+ typedef base::Callback<void(const FilePath& /* path to the MHTML file */,
+ int64 /* size of the file */)> GenerateMHTMLCallback;
+
// Instructs the render view to generate a MHTML representation of the current
// page for |tab_contents|.
- void GenerateMHTML(TabContents* tab_contents, const FilePath& file);
+ void GenerateMHTML(TabContents* tab_contents,
+ const FilePath& file,
+ const GenerateMHTMLCallback& callback);
// Notification from the renderer that the MHTML generation finished.
// |mhtml_data_size| contains the size in bytes of the generated MHTML data,
// or -1 in case of failure.
void MHTMLGenerated(int job_id, int64 mhtml_data_size);
- // The details sent along with the MHTML_GENERATED notification.
- struct NotificationDetails {
- FilePath file_path;
- int64 file_size;
- };
-
private:
struct Job{
Job();
+ ~Job();
FilePath file_path;
@@ -53,6 +53,9 @@ class CONTENT_EXPORT MHTMLGenerationManager
// The IDs mapping to a specific tab.
int process_id;
int routing_id;
+
+ // The callback to call once generation is complete.
+ GenerateMHTMLCallback callback;
};
// Called on the file thread to create |file|.
« no previous file with comments | « content/browser/download/mhtml_generation_browsertest.cc ('k') | content/browser/download/mhtml_generation_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698