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

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

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 #ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_GET_REQUESTS_TASK_H_
6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_GET_REQUESTS_TASK_H_
7
8 #include <memory>
9 #include <vector>
10
11 #include "base/memory/weak_ptr.h"
12 #include "components/offline_pages/background/request_queue_store.h"
13 #include "components/offline_pages/core/task.h"
14
15 namespace offline_pages {
16
17 class GetRequestsTask : public Task {
18 public:
19 GetRequestsTask(RequestQueueStore* store,
20 const RequestQueueStore::GetRequestsCallback& callback);
21 ~GetRequestsTask() override;
22
23 // Task implementation:
24 void Run() override;
25
26 private:
27 // Step 1: Read the requests from he store.
28 void ReadRequest();
29 // Step 2: Calls the callback with result, completes the task.
30 void CompleteWithResult(
31 bool success,
32 std::vector<std::unique_ptr<SavePageRequest>> requests);
33
34 // Store from which requests will be read.
35 RequestQueueStore* store_;
36 // Callback used to return the read results.
37 RequestQueueStore::GetRequestsCallback callback_;
38
39 base::WeakPtrFactory<GetRequestsTask> weak_ptr_factory_;
40 DISALLOW_COPY_AND_ASSIGN(GetRequestsTask);
41 };
42
43 } // namespace offline_pages
44
45 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_GET_REQUESTS_TASK_H_
OLDNEW
« no previous file with comments | « components/offline_pages/background/device_conditions.h ('k') | components/offline_pages/background/get_requests_task.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698