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

Side by Side Diff: components/offline_pages/background/add_request_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/add_request_task.h"
6
7 #include "base/bind.h"
8 #include "components/offline_pages/background/save_page_request.h"
9
10 namespace offline_pages {
11
12 AddRequestTask::AddRequestTask(RequestQueueStore* store,
13 const SavePageRequest& request,
14 const RequestQueueStore::AddCallback& callback)
15 : store_(store),
16 request_(request),
17 callback_(callback),
18 weak_ptr_factory_(this) {}
19
20 AddRequestTask::~AddRequestTask() {}
21
22 void AddRequestTask::Run() {
23 AddRequest();
24 }
25
26 void AddRequestTask::AddRequest() {
27 store_->AddRequest(request_, base::Bind(&AddRequestTask::CompleteWithResult,
28 weak_ptr_factory_.GetWeakPtr()));
29 }
30
31 void AddRequestTask::CompleteWithResult(ItemActionStatus status) {
32 callback_.Run(status);
33 TaskComplete();
34 }
35
36 } // namespace offline_pages
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698