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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 return file_size; | 314 return file_size; |
315 } | 315 } |
316 | 316 |
317 MHTMLGenerationManager* MHTMLGenerationManager::GetInstance() { | 317 MHTMLGenerationManager* MHTMLGenerationManager::GetInstance() { |
318 return base::Singleton<MHTMLGenerationManager>::get(); | 318 return base::Singleton<MHTMLGenerationManager>::get(); |
319 } | 319 } |
320 | 320 |
321 MHTMLGenerationManager::MHTMLGenerationManager() : next_job_id_(0) {} | 321 MHTMLGenerationManager::MHTMLGenerationManager() : next_job_id_(0) {} |
322 | 322 |
323 MHTMLGenerationManager::~MHTMLGenerationManager() { | 323 MHTMLGenerationManager::~MHTMLGenerationManager() { |
324 STLDeleteValues(&id_to_job_); | 324 base::STLDeleteValues(&id_to_job_); |
325 } | 325 } |
326 | 326 |
327 void MHTMLGenerationManager::SaveMHTML(WebContents* web_contents, | 327 void MHTMLGenerationManager::SaveMHTML(WebContents* web_contents, |
328 const MHTMLGenerationParams& params, | 328 const MHTMLGenerationParams& params, |
329 const GenerateMHTMLCallback& callback) { | 329 const GenerateMHTMLCallback& callback) { |
330 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 330 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
331 | 331 |
332 int job_id = NewJob(web_contents, params, callback); | 332 int job_id = NewJob(web_contents, params, callback); |
333 | 333 |
334 BrowserThread::PostTaskAndReplyWithResult( | 334 BrowserThread::PostTaskAndReplyWithResult( |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 return iter->second; | 452 return iter->second; |
453 } | 453 } |
454 | 454 |
455 void MHTMLGenerationManager::RenderProcessExited(Job* job) { | 455 void MHTMLGenerationManager::RenderProcessExited(Job* job) { |
456 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 456 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
457 DCHECK(job); | 457 DCHECK(job); |
458 JobFinished(job, JobStatus::FAILURE); | 458 JobFinished(job, JobStatus::FAILURE); |
459 } | 459 } |
460 | 460 |
461 } // namespace content | 461 } // namespace content |
OLD | NEW |