Chromium Code Reviews| 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" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 IDToJobMap::iterator iter = id_to_job_.find(job_id); | 96 IDToJobMap::iterator iter = id_to_job_.find(job_id); |
| 97 if (iter == id_to_job_.end()) { | 97 if (iter == id_to_job_.end()) { |
| 98 NOTREACHED(); | 98 NOTREACHED(); |
| 99 return; | 99 return; |
| 100 } | 100 } |
| 101 | 101 |
| 102 Job& job = iter->second; | 102 Job& job = iter->second; |
| 103 job.browser_file = browser_file; | 103 job.browser_file = browser_file; |
| 104 job.renderer_file = renderer_file; | 104 job.renderer_file = renderer_file; |
| 105 | 105 |
| 106 RenderViewHostImpl* rvh = RenderViewHostImpl::FromID( | 106 content::RenderViewHostImpl* rvh = content::RenderViewHostImpl::FromID( |
|
jam
2012/03/05 23:59:28
nit: using since we'll eventually move this file t
Jói
2012/03/06 16:38:55
Done.
| |
| 107 job.process_id, job.routing_id); | 107 job.process_id, job.routing_id); |
| 108 if (!rvh) { | 108 if (!rvh) { |
| 109 // The tab went away. | 109 // The tab went away. |
| 110 JobFinished(job_id, -1); | 110 JobFinished(job_id, -1); |
| 111 return; | 111 return; |
| 112 } | 112 } |
| 113 | 113 |
| 114 rvh->Send(new ViewMsg_SavePageAsMHTML(rvh->GetRoutingID(), job_id, | 114 rvh->Send(new ViewMsg_SavePageAsMHTML(rvh->GetRoutingID(), job_id, |
| 115 renderer_file)); | 115 renderer_file)); |
| 116 } | 116 } |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 129 base::Bind(&MHTMLGenerationManager::CloseFile, base::Unretained(this), | 129 base::Bind(&MHTMLGenerationManager::CloseFile, base::Unretained(this), |
| 130 job.browser_file)); | 130 job.browser_file)); |
| 131 | 131 |
| 132 id_to_job_.erase(job_id); | 132 id_to_job_.erase(job_id); |
| 133 } | 133 } |
| 134 | 134 |
| 135 void MHTMLGenerationManager::CloseFile(base::PlatformFile file) { | 135 void MHTMLGenerationManager::CloseFile(base::PlatformFile file) { |
| 136 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 136 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 137 base::ClosePlatformFile(file); | 137 base::ClosePlatformFile(file); |
| 138 } | 138 } |
| OLD | NEW |