| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/offline_pages/offline_page_model.h" | 5 #include "components/offline_pages/offline_page_model.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 } | 539 } |
| 540 | 540 |
| 541 OfflinePageStorageManager* OfflinePageModel::GetStorageManager() { | 541 OfflinePageStorageManager* OfflinePageModel::GetStorageManager() { |
| 542 return storage_manager_.get(); | 542 return storage_manager_.get(); |
| 543 } | 543 } |
| 544 | 544 |
| 545 bool OfflinePageModel::is_loaded() const { | 545 bool OfflinePageModel::is_loaded() const { |
| 546 return is_loaded_; | 546 return is_loaded_; |
| 547 } | 547 } |
| 548 | 548 |
| 549 // Implementation of StorageManagerClient. |
| 550 bool OfflinePageModel::IsLoaded() const { |
| 551 return is_loaded(); |
| 552 } |
| 553 |
| 549 void OfflinePageModel::OnCreateArchiveDone(const GURL& requested_url, | 554 void OfflinePageModel::OnCreateArchiveDone(const GURL& requested_url, |
| 550 int64_t offline_id, | 555 int64_t offline_id, |
| 551 const ClientId& client_id, | 556 const ClientId& client_id, |
| 552 const base::Time& start_time, | 557 const base::Time& start_time, |
| 553 const SavePageCallback& callback, | 558 const SavePageCallback& callback, |
| 554 OfflinePageArchiver* archiver, | 559 OfflinePageArchiver* archiver, |
| 555 ArchiverResult archiver_result, | 560 ArchiverResult archiver_result, |
| 556 const GURL& url, | 561 const GURL& url, |
| 557 const base::FilePath& file_path, | 562 const base::FilePath& file_path, |
| 558 int64_t file_size) { | 563 int64_t file_size) { |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 void OfflinePageModel::RunWhenLoaded(const base::Closure& task) { | 836 void OfflinePageModel::RunWhenLoaded(const base::Closure& task) { |
| 832 if (!is_loaded_) { | 837 if (!is_loaded_) { |
| 833 delayed_tasks_.push_back(task); | 838 delayed_tasks_.push_back(task); |
| 834 return; | 839 return; |
| 835 } | 840 } |
| 836 | 841 |
| 837 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, task); | 842 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, task); |
| 838 } | 843 } |
| 839 | 844 |
| 840 } // namespace offline_pages | 845 } // namespace offline_pages |
| OLD | NEW |