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 10 matching lines...) Expand all Loading... |
21 class FilePath; | 21 class FilePath; |
22 } | 22 } |
23 | 23 |
24 namespace content { | 24 namespace content { |
25 | 25 |
26 class RenderFrameHostImpl; | 26 class RenderFrameHostImpl; |
27 class WebContents; | 27 class WebContents; |
28 | 28 |
29 // The class and all of its members live on the UI thread. Only static methods | 29 // The class and all of its members live on the UI thread. Only static methods |
30 // are executed on other threads. | 30 // are executed on other threads. |
| 31 // |
| 32 // MHTMLGenerationManager is a singleton. Each call to SaveMHTML method creates |
| 33 // a new instance of MHTMLGenerationManager::Job that tracks generation of a |
| 34 // single MHTML file. |
31 class MHTMLGenerationManager { | 35 class MHTMLGenerationManager { |
32 public: | 36 public: |
33 static MHTMLGenerationManager* GetInstance(); | 37 static MHTMLGenerationManager* GetInstance(); |
34 | 38 |
35 // GenerateMHTMLCallback is called to report completion and status of MHTML | 39 // GenerateMHTMLCallback is called to report completion and status of MHTML |
36 // generation. On success |file_size| indicates the size of the | 40 // generation. On success |file_size| indicates the size of the |
37 // generated file. On failure |file_size| is -1. | 41 // generated file. On failure |file_size| is -1. |
38 typedef base::Callback<void(int64_t file_size)> GenerateMHTMLCallback; | 42 typedef base::Callback<void(int64_t file_size)> GenerateMHTMLCallback; |
39 | 43 |
40 // Instructs the RenderFrames in |web_contents| to generate a MHTML | 44 // Instructs the RenderFrames in |web_contents| to generate a MHTML |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 IDToJobMap id_to_job_; | 91 IDToJobMap id_to_job_; |
88 | 92 |
89 int next_job_id_; | 93 int next_job_id_; |
90 | 94 |
91 DISALLOW_COPY_AND_ASSIGN(MHTMLGenerationManager); | 95 DISALLOW_COPY_AND_ASSIGN(MHTMLGenerationManager); |
92 }; | 96 }; |
93 | 97 |
94 } // namespace content | 98 } // namespace content |
95 | 99 |
96 #endif // CONTENT_BROWSER_DOWNLOAD_MHTML_GENERATION_MANAGER_H_ | 100 #endif // CONTENT_BROWSER_DOWNLOAD_MHTML_GENERATION_MANAGER_H_ |
OLD | NEW |