| 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 | 4 |
| 5 #include "content/browser/download/mhtml_generation_manager.h" | 5 #include "content/browser/download/mhtml_generation_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/platform_file.h" | 8 #include "base/platform_file.h" |
| 9 #include "content/browser/renderer_host/render_process_host_impl.h" | 9 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 10 #include "content/browser/renderer_host/render_view_host_impl.h" | 10 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 12 #include "content/public/browser/notification_service.h" | 12 #include "content/public/browser/notification_service.h" |
| 13 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
| 14 #include "content/common/view_messages.h" | 14 #include "content/common/view_messages.h" |
| 15 #include "content/public/browser/notification_types.h" | 15 #include "content/public/browser/notification_types.h" |
| 16 | 16 |
| 17 using content::BrowserThread; | 17 using content::BrowserThread; |
| 18 using content::RenderViewHostImpl; |
| 18 using content::WebContents; | 19 using content::WebContents; |
| 19 | 20 |
| 20 MHTMLGenerationManager::Job::Job() | 21 MHTMLGenerationManager::Job::Job() |
| 21 : browser_file(base::kInvalidPlatformFileValue), | 22 : browser_file(base::kInvalidPlatformFileValue), |
| 22 renderer_file(IPC::InvalidPlatformFileForTransit()), | 23 renderer_file(IPC::InvalidPlatformFileForTransit()), |
| 23 process_id(-1), | 24 process_id(-1), |
| 24 routing_id(-1) { | 25 routing_id(-1) { |
| 25 } | 26 } |
| 26 | 27 |
| 27 MHTMLGenerationManager::Job::~Job() { | 28 MHTMLGenerationManager::Job::~Job() { |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 base::Bind(&MHTMLGenerationManager::CloseFile, base::Unretained(this), | 130 base::Bind(&MHTMLGenerationManager::CloseFile, base::Unretained(this), |
| 130 job.browser_file)); | 131 job.browser_file)); |
| 131 | 132 |
| 132 id_to_job_.erase(job_id); | 133 id_to_job_.erase(job_id); |
| 133 } | 134 } |
| 134 | 135 |
| 135 void MHTMLGenerationManager::CloseFile(base::PlatformFile file) { | 136 void MHTMLGenerationManager::CloseFile(base::PlatformFile file) { |
| 136 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 137 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 137 base::ClosePlatformFile(file); | 138 base::ClosePlatformFile(file); |
| 138 } | 139 } |
| OLD | NEW |