Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(555)

Side by Side Diff: components/offline_pages/background/get_requests_task.cc

Issue 2489443002: Move all components/offline_pages/ files into component/offline_pages/core (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/offline_pages/background/get_requests_task.h"
6
7 #include <vector>
8
9 #include "base/bind.h"
10
11 namespace offline_pages {
12
13 GetRequestsTask::GetRequestsTask(
14 RequestQueueStore* store,
15 const RequestQueueStore::GetRequestsCallback& callback)
16 : store_(store), callback_(callback), weak_ptr_factory_(this) {}
17
18 GetRequestsTask::~GetRequestsTask() {}
19
20 void GetRequestsTask::Run() {
21 ReadRequest();
22 }
23
24 void GetRequestsTask::ReadRequest() {
25 store_->GetRequests(base::Bind(&GetRequestsTask::CompleteWithResult,
26 weak_ptr_factory_.GetWeakPtr()));
27 }
28
29 void GetRequestsTask::CompleteWithResult(
30 bool success,
31 std::vector<std::unique_ptr<SavePageRequest>> requests) {
32 callback_.Run(success, std::move(requests));
33 TaskComplete();
34 }
35
36 } // namespace offline_pages
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698