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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
225 observed_renderer_process_host_.Add(rfh->GetProcess()); | 225 observed_renderer_process_host_.Add(rfh->GetProcess()); |
226 | 226 |
227 // Tell the renderer to skip (= deduplicate) already covered MHTML parts. | 227 // Tell the renderer to skip (= deduplicate) already covered MHTML parts. |
228 ipc_params.salt = salt_; | 228 ipc_params.salt = salt_; |
229 ipc_params.digests_of_uris_to_skip = digests_of_already_serialized_uris_; | 229 ipc_params.digests_of_uris_to_skip = digests_of_already_serialized_uris_; |
230 | 230 |
231 ipc_params.destination_file = IPC::GetPlatformFileForTransit( | 231 ipc_params.destination_file = IPC::GetPlatformFileForTransit( |
232 browser_file_.GetPlatformFile(), false); // |close_source_handle|. | 232 browser_file_.GetPlatformFile(), false); // |close_source_handle|. |
233 ipc_params.frame_routing_id_to_content_id = | 233 ipc_params.frame_routing_id_to_content_id = |
234 CreateFrameRoutingIdToContentId(rfh->GetSiteInstance()); | 234 CreateFrameRoutingIdToContentId(rfh->GetSiteInstance()); |
235 if (params_.extra_data.size() > 0) { | |
236 // TODO(petewil): only need this on the main frame. How do I check which | |
237 // frame this is? | |
238 ipc_params.extra_data = params_.extra_data; | |
fgorski
2017/02/07 22:06:08
do we really want to pass the data over IPC?
Did y
| |
239 } | |
235 | 240 |
236 // Send the IPC asking the renderer to serialize the frame. | 241 // Send the IPC asking the renderer to serialize the frame. |
237 DCHECK_EQ(FrameTreeNode::kFrameTreeNodeInvalidId, | 242 DCHECK_EQ(FrameTreeNode::kFrameTreeNodeInvalidId, |
238 frame_tree_node_id_of_busy_frame_); | 243 frame_tree_node_id_of_busy_frame_); |
239 frame_tree_node_id_of_busy_frame_ = frame_tree_node_id; | 244 frame_tree_node_id_of_busy_frame_ = frame_tree_node_id; |
240 rfh->Send(new FrameMsg_SerializeAsMHTML(rfh->GetRoutingID(), ipc_params)); | 245 rfh->Send(new FrameMsg_SerializeAsMHTML(rfh->GetRoutingID(), ipc_params)); |
241 TRACE_EVENT_NESTABLE_ASYNC_BEGIN1("page-serialization", "WaitingOnRenderer", | 246 TRACE_EVENT_NESTABLE_ASYNC_BEGIN1("page-serialization", "WaitingOnRenderer", |
242 this, "frame tree node id", | 247 this, "frame tree node id", |
243 frame_tree_node_id); | 248 frame_tree_node_id); |
244 DCHECK(wait_on_renderer_start_time_.is_null()); | 249 DCHECK(wait_on_renderer_start_time_.is_null()); |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
545 return iter->second.get(); | 550 return iter->second.get(); |
546 } | 551 } |
547 | 552 |
548 void MHTMLGenerationManager::RenderProcessExited(Job* job) { | 553 void MHTMLGenerationManager::RenderProcessExited(Job* job) { |
549 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 554 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
550 DCHECK(job); | 555 DCHECK(job); |
551 JobFinished(job, MhtmlSaveStatus::RENDER_PROCESS_EXITED); | 556 JobFinished(job, MhtmlSaveStatus::RENDER_PROCESS_EXITED); |
552 } | 557 } |
553 | 558 |
554 } // namespace content | 559 } // namespace content |
OLD | NEW |