| OLD | NEW |
| 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 <set> | 10 #include <set> |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // been created. | 70 // been created. |
| 71 void OnFileAvailable(int job_id, base::File browser_file); | 71 void OnFileAvailable(int job_id, base::File browser_file); |
| 72 | 72 |
| 73 // Called on the UI thread when a job has been finished. | 73 // Called on the UI thread when a job has been finished. |
| 74 void JobFinished(Job* job, JobStatus job_status); | 74 void JobFinished(Job* job, JobStatus job_status); |
| 75 | 75 |
| 76 // Called on the UI thread after the file got finalized and we have its size. | 76 // Called on the UI thread after the file got finalized and we have its size. |
| 77 void OnFileClosed(int job_id, JobStatus job_status, int64_t file_size); | 77 void OnFileClosed(int job_id, JobStatus job_status, int64_t file_size); |
| 78 | 78 |
| 79 // Creates and registers a new job. | 79 // Creates and registers a new job. |
| 80 int NewJob(WebContents* web_contents, | 80 Job* NewJob(WebContents* web_contents, |
| 81 const MHTMLGenerationParams& params, | 81 const MHTMLGenerationParams& params, |
| 82 const GenerateMHTMLCallback& callback); | 82 const GenerateMHTMLCallback& callback); |
| 83 | 83 |
| 84 // Finds job by id. Returns nullptr if no job with a given id was found. | 84 // Finds job by id. Returns nullptr if no job with a given id was found. |
| 85 Job* FindJob(int job_id); | 85 Job* FindJob(int job_id); |
| 86 | 86 |
| 87 // Called when the render process connected to a job exits. | 87 // Called when the render process connected to a job exits. |
| 88 void RenderProcessExited(Job* job); | 88 void RenderProcessExited(Job* job); |
| 89 | 89 |
| 90 typedef std::map<int, Job*> IDToJobMap; | 90 typedef std::map<int, Job*> IDToJobMap; |
| 91 IDToJobMap id_to_job_; | 91 IDToJobMap id_to_job_; |
| 92 | 92 |
| 93 int next_job_id_; | 93 int next_job_id_; |
| 94 | 94 |
| 95 DISALLOW_COPY_AND_ASSIGN(MHTMLGenerationManager); | 95 DISALLOW_COPY_AND_ASSIGN(MHTMLGenerationManager); |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 } // namespace content | 98 } // namespace content |
| 99 | 99 |
| 100 #endif // CONTENT_BROWSER_DOWNLOAD_MHTML_GENERATION_MANAGER_H_ | 100 #endif // CONTENT_BROWSER_DOWNLOAD_MHTML_GENERATION_MANAGER_H_ |
| OLD | NEW |