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

Side by Side Diff: components/offline_pages/background/offliner_stub.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/offliner_stub.h"
6
7 #include "base/bind.h"
8 #include "base/threading/thread_task_runner_handle.h"
9 #include "components/offline_pages/background/save_page_request.h"
10
11 namespace offline_pages {
12
13 OfflinerStub::OfflinerStub()
14 : disable_loading_(false), enable_callback_(false), cancel_called_(false) {}
15
16 OfflinerStub::~OfflinerStub() {}
17
18 bool OfflinerStub::LoadAndSave(const SavePageRequest& request,
19 const CompletionCallback& callback) {
20 if (disable_loading_)
21 return false;
22
23 callback_ = callback;
24
25 // Post the callback on the run loop.
26 if (enable_callback_) {
27 base::ThreadTaskRunnerHandle::Get()->PostTask(
28 FROM_HERE,
29 base::Bind(callback, request, Offliner::RequestStatus::SAVED));
30 }
31 return true;
32 }
33
34 void OfflinerStub::Cancel() {
35 cancel_called_ = true;
36 }
37
38 } // namespace offline_pages
OLDNEW
« no previous file with comments | « components/offline_pages/background/offliner_stub.h ('k') | components/offline_pages/background/pick_request_task.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698