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 <memory> |
10 #include <set> | 11 #include <set> |
11 #include <string> | 12 #include <string> |
12 | 13 |
13 #include "base/files/file.h" | 14 #include "base/files/file.h" |
14 #include "base/macros.h" | 15 #include "base/macros.h" |
15 #include "base/memory/singleton.h" | 16 #include "base/memory/singleton.h" |
16 #include "base/process/process.h" | 17 #include "base/process/process.h" |
17 #include "content/public/common/mhtml_generation_params.h" | 18 #include "content/public/common/mhtml_generation_params.h" |
18 #include "ipc/ipc_platform_file.h" | 19 #include "ipc/ipc_platform_file.h" |
19 | 20 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 Job* NewJob(WebContents* web_contents, | 82 Job* NewJob(WebContents* web_contents, |
82 const MHTMLGenerationParams& params, | 83 const MHTMLGenerationParams& params, |
83 const GenerateMHTMLCallback& callback); | 84 const GenerateMHTMLCallback& callback); |
84 | 85 |
85 // Finds job by id. Returns nullptr if no job with a given id was found. | 86 // Finds job by id. Returns nullptr if no job with a given id was found. |
86 Job* FindJob(int job_id); | 87 Job* FindJob(int job_id); |
87 | 88 |
88 // Called when the render process connected to a job exits. | 89 // Called when the render process connected to a job exits. |
89 void RenderProcessExited(Job* job); | 90 void RenderProcessExited(Job* job); |
90 | 91 |
91 typedef std::map<int, Job*> IDToJobMap; | 92 std::map<int, std::unique_ptr<Job>> id_to_job_; |
92 IDToJobMap id_to_job_; | |
93 | 93 |
94 int next_job_id_; | 94 int next_job_id_; |
95 | 95 |
96 DISALLOW_COPY_AND_ASSIGN(MHTMLGenerationManager); | 96 DISALLOW_COPY_AND_ASSIGN(MHTMLGenerationManager); |
97 }; | 97 }; |
98 | 98 |
99 } // namespace content | 99 } // namespace content |
100 | 100 |
101 #endif // CONTENT_BROWSER_DOWNLOAD_MHTML_GENERATION_MANAGER_H_ | 101 #endif // CONTENT_BROWSER_DOWNLOAD_MHTML_GENERATION_MANAGER_H_ |
OLD | NEW |