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

Side by Side Diff: components/offline_pages/core/background/offliner_stub.cc

Issue 2715433006: [Offline Pages] Turn Offliner::Cancel into an async operation to resolve conflicting assumptions (Closed)
Patch Set: Created 3 years, 9 months 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/offline_pages/core/background/offliner_stub.h" 5 #include "components/offline_pages/core/background/offliner_stub.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/threading/thread_task_runner_handle.h" 8 #include "base/threading/thread_task_runner_handle.h"
9 #include "components/offline_pages/core/background/save_page_request.h" 9 #include "components/offline_pages/core/background/save_page_request.h"
10 10
(...skipping 13 matching lines...) Expand all
24 24
25 // Post the callback on the run loop. 25 // Post the callback on the run loop.
26 if (enable_callback_) { 26 if (enable_callback_) {
27 base::ThreadTaskRunnerHandle::Get()->PostTask( 27 base::ThreadTaskRunnerHandle::Get()->PostTask(
28 FROM_HERE, 28 FROM_HERE,
29 base::Bind(callback, request, Offliner::RequestStatus::SAVED)); 29 base::Bind(callback, request, Offliner::RequestStatus::SAVED));
30 } 30 }
31 return true; 31 return true;
32 } 32 }
33 33
34 void OfflinerStub::Cancel() { 34 void OfflinerStub::Cancel(const CancelCallback& callback) {
35 cancel_called_ = true; 35 cancel_called_ = true;
36 callback.Run(0L);
fgorski 2017/02/27 18:07:25 0LL?
chili 2017/02/28 00:44:14 Done.
36 } 37 }
37 38
38 } // namespace offline_pages 39 } // namespace offline_pages
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698