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 <map> | 7 #include <map> |
8 #include <queue> | 8 #include <queue> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 RenderFrameHost* rfh = ftn->current_frame_host(); | 181 RenderFrameHost* rfh = ftn->current_frame_host(); |
182 | 182 |
183 // Get notified if the target of the IPC message dies between responding. | 183 // Get notified if the target of the IPC message dies between responding. |
184 observed_renderer_process_host_.RemoveAll(); | 184 observed_renderer_process_host_.RemoveAll(); |
185 observed_renderer_process_host_.Add(rfh->GetProcess()); | 185 observed_renderer_process_host_.Add(rfh->GetProcess()); |
186 | 186 |
187 // Tell the renderer to skip (= deduplicate) already covered MHTML parts. | 187 // Tell the renderer to skip (= deduplicate) already covered MHTML parts. |
188 ipc_params.salt = salt_; | 188 ipc_params.salt = salt_; |
189 ipc_params.digests_of_uris_to_skip = digests_of_already_serialized_uris_; | 189 ipc_params.digests_of_uris_to_skip = digests_of_already_serialized_uris_; |
190 | 190 |
191 ipc_params.destination_file = IPC::GetFileHandleForProcess( | 191 ipc_params.destination_file = IPC::GetPlatformFileForTransit( |
192 browser_file_.GetPlatformFile(), rfh->GetProcess()->GetHandle(), | 192 browser_file_.GetPlatformFile(), false); // |close_source_handle|. |
193 false); // |close_source_handle|. | |
194 ipc_params.frame_routing_id_to_content_id = | 193 ipc_params.frame_routing_id_to_content_id = |
195 CreateFrameRoutingIdToContentId(rfh->GetSiteInstance()); | 194 CreateFrameRoutingIdToContentId(rfh->GetSiteInstance()); |
196 | 195 |
197 // Send the IPC asking the renderer to serialize the frame. | 196 // Send the IPC asking the renderer to serialize the frame. |
198 DCHECK_EQ(FrameTreeNode::kFrameTreeNodeInvalidId, | 197 DCHECK_EQ(FrameTreeNode::kFrameTreeNodeInvalidId, |
199 frame_tree_node_id_of_busy_frame_); | 198 frame_tree_node_id_of_busy_frame_); |
200 frame_tree_node_id_of_busy_frame_ = frame_tree_node_id; | 199 frame_tree_node_id_of_busy_frame_ = frame_tree_node_id; |
201 rfh->Send(new FrameMsg_SerializeAsMHTML(rfh->GetRoutingID(), ipc_params)); | 200 rfh->Send(new FrameMsg_SerializeAsMHTML(rfh->GetRoutingID(), ipc_params)); |
202 return true; | 201 return true; |
203 } | 202 } |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 return iter->second; | 415 return iter->second; |
417 } | 416 } |
418 | 417 |
419 void MHTMLGenerationManager::RenderProcessExited(Job* job) { | 418 void MHTMLGenerationManager::RenderProcessExited(Job* job) { |
420 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 419 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
421 DCHECK(job); | 420 DCHECK(job); |
422 JobFinished(job, JobStatus::FAILURE); | 421 JobFinished(job, JobStatus::FAILURE); |
423 } | 422 } |
424 | 423 |
425 } // namespace content | 424 } // namespace content |
OLD | NEW |