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

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

Issue 2163073002: Avoid crashing if MHTMLGenerationManager::JobFinished is called twice. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Posting the injection ->UI->FILE->UI. Created 4 years, 5 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 <set> 10 #include <set>
(...skipping 10 matching lines...) Expand all
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
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_
OLDNEW
« 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