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

Side by Side Diff: content/browser/download/mhtml_generation_manager.h

Issue 2731293004: Move the writing of the MHTML footer to the browser process. (Closed)
Patch Set: More minor changes Created 3 years, 9 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 #ifndef CONTENT_BROWSER_DOWNLOAD_MHTML_GENERATION_MANAGER_H_ 4 #ifndef CONTENT_BROWSER_DOWNLOAD_MHTML_GENERATION_MANAGER_H_
5 #define CONTENT_BROWSER_DOWNLOAD_MHTML_GENERATION_MANAGER_H_ 5 #define CONTENT_BROWSER_DOWNLOAD_MHTML_GENERATION_MANAGER_H_
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 static base::File CreateFile(const base::FilePath& file_path); 69 static base::File CreateFile(const base::FilePath& file_path);
70 70
71 // Called on the UI thread when the file that should hold the MHTML data has 71 // Called on the UI thread when the file that should hold the MHTML data has
72 // been created. 72 // been created.
73 void OnFileAvailable(int job_id, base::File browser_file); 73 void OnFileAvailable(int job_id, base::File browser_file);
74 74
75 // Called on the UI thread when a job has been finished. 75 // Called on the UI thread when a job has been finished.
76 void JobFinished(Job* job, MhtmlSaveStatus save_status); 76 void JobFinished(Job* job, MhtmlSaveStatus save_status);
77 77
78 // Called on the UI thread after the file got finalized and we have its size. 78 // Called on the UI thread after the file got finalized and we have its size.
79 void OnFileClosed(int job_id, MhtmlSaveStatus save_status, int64_t file_size); 79 void OnFileClosed(
80 int job_id,
81 const std::tuple<MhtmlSaveStatus, int64_t>& save_status_size);
80 82
81 // Creates and registers a new job. 83 // Creates and registers a new job.
82 Job* NewJob(WebContents* web_contents, 84 Job* NewJob(WebContents* web_contents,
83 const MHTMLGenerationParams& params, 85 const MHTMLGenerationParams& params,
84 const GenerateMHTMLCallback& callback); 86 const GenerateMHTMLCallback& callback);
85 87
86 // Finds job by id. Returns nullptr if no job with a given id was found. 88 // Finds job by id. Returns nullptr if no job with a given id was found.
87 Job* FindJob(int job_id); 89 Job* FindJob(int job_id);
88 90
89 // Called when the render process connected to a job exits. 91 // Called when the render process connected to a job exits.
90 void RenderProcessExited(Job* job); 92 void RenderProcessExited(Job* job);
91 93
92 std::map<int, std::unique_ptr<Job>> id_to_job_; 94 std::map<int, std::unique_ptr<Job>> id_to_job_;
93 95
94 int next_job_id_; 96 int next_job_id_;
95 97
96 DISALLOW_COPY_AND_ASSIGN(MHTMLGenerationManager); 98 DISALLOW_COPY_AND_ASSIGN(MHTMLGenerationManager);
97 }; 99 };
98 100
99 } // namespace content 101 } // namespace content
100 102
101 #endif // CONTENT_BROWSER_DOWNLOAD_MHTML_GENERATION_MANAGER_H_ 103 #endif // CONTENT_BROWSER_DOWNLOAD_MHTML_GENERATION_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/content_settings/content_settings_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