| 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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 } | 387 } |
| 388 | 388 |
| 389 void MHTMLGenerationManager::SaveMHTML(WebContents* web_contents, | 389 void MHTMLGenerationManager::SaveMHTML(WebContents* web_contents, |
| 390 const MHTMLGenerationParams& params, | 390 const MHTMLGenerationParams& params, |
| 391 const GenerateMHTMLCallback& callback) { | 391 const GenerateMHTMLCallback& callback) { |
| 392 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 392 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 393 | 393 |
| 394 Job* job = NewJob(web_contents, params, callback); | 394 Job* job = NewJob(web_contents, params, callback); |
| 395 TRACE_EVENT_NESTABLE_ASYNC_BEGIN2( | 395 TRACE_EVENT_NESTABLE_ASYNC_BEGIN2( |
| 396 "page-serialization", "SavingMhtmlJob", job, "url", | 396 "page-serialization", "SavingMhtmlJob", job, "url", |
| 397 web_contents->GetLastCommittedURL().possibly_invalid_spec().c_str(), | 397 web_contents->GetLastCommittedURL().possibly_invalid_spec(), |
| 398 "file", params.file_path.value().c_str()); | 398 "file", params.file_path.AsUTF8Unsafe()); |
| 399 | 399 |
| 400 BrowserThread::PostTaskAndReplyWithResult( | 400 BrowserThread::PostTaskAndReplyWithResult( |
| 401 BrowserThread::FILE, FROM_HERE, | 401 BrowserThread::FILE, FROM_HERE, |
| 402 base::Bind(&MHTMLGenerationManager::CreateFile, params.file_path), | 402 base::Bind(&MHTMLGenerationManager::CreateFile, params.file_path), |
| 403 base::Bind(&MHTMLGenerationManager::OnFileAvailable, | 403 base::Bind(&MHTMLGenerationManager::OnFileAvailable, |
| 404 base::Unretained(this), // Safe b/c |this| is a singleton. | 404 base::Unretained(this), // Safe b/c |this| is a singleton. |
| 405 job->id())); | 405 job->id())); |
| 406 } | 406 } |
| 407 | 407 |
| 408 void MHTMLGenerationManager::OnSerializeAsMHTMLResponse( | 408 void MHTMLGenerationManager::OnSerializeAsMHTMLResponse( |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 return iter->second; | 530 return iter->second; |
| 531 } | 531 } |
| 532 | 532 |
| 533 void MHTMLGenerationManager::RenderProcessExited(Job* job) { | 533 void MHTMLGenerationManager::RenderProcessExited(Job* job) { |
| 534 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 534 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 535 DCHECK(job); | 535 DCHECK(job); |
| 536 JobFinished(job, JobStatus::FAILURE); | 536 JobFinished(job, JobStatus::FAILURE); |
| 537 } | 537 } |
| 538 | 538 |
| 539 } // namespace content | 539 } // namespace content |
| OLD | NEW |