summaryrefslogtreecommitdiffstats
path: root/content/browser/download/mhtml_generation_manager.h
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-04 02:54:23 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-04 02:54:23 +0000
commitdb2bc32956cf5321848976789f727eda66c6ae16 (patch)
treec2cf4191a97a98192fa0ca22ffe6e47327f47d3e /content/browser/download/mhtml_generation_manager.h
parentc4a56c29980508acd77500c219309e9b25cbf6d8 (diff)
downloadchromium_src-db2bc32956cf5321848976789f727eda66c6ae16.zip
chromium_src-db2bc32956cf5321848976789f727eda66c6ae16.tar.gz
chromium_src-db2bc32956cf5321848976789f727eda66c6ae16.tar.bz2
Make MHTMLGenerationManager observe RenderProcessHosts rather than use notifications.
BUG=170921 TEST=everything still works Review URL: https://codereview.chromium.org/123993002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242993 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/download/mhtml_generation_manager.h')
-rw-r--r--content/browser/download/mhtml_generation_manager.h30
1 files changed, 5 insertions, 25 deletions
diff --git a/content/browser/download/mhtml_generation_manager.h b/content/browser/download/mhtml_generation_manager.h
index 5525d99..0fff4a3 100644
--- a/content/browser/download/mhtml_generation_manager.h
+++ b/content/browser/download/mhtml_generation_manager.h
@@ -10,8 +10,6 @@
#include "base/memory/singleton.h"
#include "base/platform_file.h"
#include "base/process/process.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
#include "ipc/ipc_platform_file.h"
namespace base {
@@ -19,9 +17,10 @@ class FilePath;
}
namespace content {
+
class WebContents;
-class MHTMLGenerationManager : public NotificationObserver {
+class MHTMLGenerationManager {
public:
static MHTMLGenerationManager* GetInstance();
@@ -47,23 +46,7 @@ class MHTMLGenerationManager : public NotificationObserver {
private:
friend struct DefaultSingletonTraits<MHTMLGenerationManager>;
-
- struct Job{
- Job();
- ~Job();
-
- // The handles to file the MHTML is saved to, for the browser and renderer
- // processes.
- base::PlatformFile browser_file;
- IPC::PlatformFileForTransit renderer_file;
-
- // The IDs mapping to a specific contents.
- int process_id;
- int routing_id;
-
- // The callback to call once generation is complete.
- GenerateMHTMLCallback callback;
- };
+ class Job;
MHTMLGenerationManager();
virtual ~MHTMLGenerationManager();
@@ -92,14 +75,11 @@ class MHTMLGenerationManager : public NotificationObserver {
// Creates an register a new job.
int NewJob(WebContents* web_contents, const GenerateMHTMLCallback& callback);
- // Implementation of NotificationObserver.
- virtual void Observe(int type,
- const NotificationSource& source,
- const NotificationDetails& details) OVERRIDE;
+ // Called when the render process connected to a job exits.
+ void RenderProcessExited(Job* job);
typedef std::map<int, Job> IDToJobMap;
IDToJobMap id_to_job_;
- NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(MHTMLGenerationManager);
};