summaryrefslogtreecommitdiffstats
path: root/components/offline_pages
diff options
context:
space:
mode:
authorfgorski <fgorski@chromium.org>2015-07-20 12:36:03 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-20 19:37:48 +0000
commit9ab9562994dac25758ecef36e3ecf554120b3647 (patch)
treec54674b8d8222291120ee3b2edc3ce235e2e55df /components/offline_pages
parentd1675a044172980b439a57e9dcf2c1a47943ad54 (diff)
downloadchromium_src-9ab9562994dac25758ecef36e3ecf554120b3647.zip
chromium_src-9ab9562994dac25758ecef36e3ecf554120b3647.tar.gz
chromium_src-9ab9562994dac25758ecef36e3ecf554120b3647.tar.bz2
[Offline pages] Adding OfflinePageModelFactory
BUG=491352 Review URL: https://codereview.chromium.org/1231013003 Cr-Commit-Position: refs/heads/master@{#339485}
Diffstat (limited to 'components/offline_pages')
-rw-r--r--components/offline_pages/offline_page_model.cc5
-rw-r--r--components/offline_pages/offline_page_model.h4
2 files changed, 5 insertions, 4 deletions
diff --git a/components/offline_pages/offline_page_model.cc b/components/offline_pages/offline_page_model.cc
index 564e71b..09633fb 100644
--- a/components/offline_pages/offline_page_model.cc
+++ b/components/offline_pages/offline_page_model.cc
@@ -10,6 +10,7 @@
#include "base/files/file_util.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/sequenced_task_runner.h"
#include "components/offline_pages/offline_page_item.h"
#include "components/offline_pages/offline_page_metadata_store.h"
#include "url/gurl.h"
@@ -50,7 +51,7 @@ SavePageResult ToSavePageResult(ArchiverResult archiver_result) {
OfflinePageModel::OfflinePageModel(
scoped_ptr<OfflinePageMetadataStore> store,
- const scoped_refptr<base::SingleThreadTaskRunner>& task_runner)
+ const scoped_refptr<base::SequencedTaskRunner>& task_runner)
: store_(store.Pass()),
task_runner_(task_runner),
weak_ptr_factory_(this) {
@@ -187,7 +188,7 @@ void OfflinePageModel::OnLoadDoneForDeletion(
void OfflinePageModel::DeleteArchiverFile(const base::FilePath& file_path,
bool* success) {
DCHECK(success);
- DCHECK(task_runner_->BelongsToCurrentThread());
+ DCHECK(task_runner_->RunsTasksOnCurrentThread());
*success = base::DeleteFile(file_path, false);
}
diff --git a/components/offline_pages/offline_page_model.h b/components/offline_pages/offline_page_model.h
index 93ee5eb..f24d8f8 100644
--- a/components/offline_pages/offline_page_model.h
+++ b/components/offline_pages/offline_page_model.h
@@ -84,7 +84,7 @@ class OfflinePageModel : public KeyedService {
// All blocking calls/disk access will happen on the provided |task_runner|.
OfflinePageModel(
scoped_ptr<OfflinePageMetadataStore> store,
- const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
+ const scoped_refptr<base::SequencedTaskRunner>& task_runner);
~OfflinePageModel() override;
// KeyedService implementation.
@@ -146,7 +146,7 @@ class OfflinePageModel : public KeyedService {
// Persistent store for offline page metadata.
scoped_ptr<OfflinePageMetadataStore> store_;
- scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+ scoped_refptr<base::SequencedTaskRunner> task_runner_;
// Pending archivers owned by this model.
PendingArchivers pending_archivers_;