| Index: components/offline_pages/core/background/offliner_stub.cc
|
| diff --git a/components/offline_pages/core/background/offliner_stub.cc b/components/offline_pages/core/background/offliner_stub.cc
|
| index 3b3c1f56164da0ca94ff8a3f7633e756edf5b49b..4598a0e4283fc7c7f9e07ef7d11156ace35b2466 100644
|
| --- a/components/offline_pages/core/background/offliner_stub.cc
|
| +++ b/components/offline_pages/core/background/offliner_stub.cc
|
| @@ -19,17 +19,22 @@ OfflinerStub::OfflinerStub()
|
| OfflinerStub::~OfflinerStub() {}
|
|
|
| bool OfflinerStub::LoadAndSave(const SavePageRequest& request,
|
| - const CompletionCallback& callback) {
|
| + const CompletionCallback& completion_callback,
|
| + const ProgressCallback& progress_callback) {
|
| if (disable_loading_)
|
| return false;
|
|
|
| - callback_ = callback;
|
| + completion_callback_ = completion_callback;
|
| + progress_callback_ = progress_callback;
|
|
|
| // Post the callback on the run loop.
|
| if (enable_callback_) {
|
| + const int64_t arbitrary_size = 153LL;
|
| base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(callback, request, Offliner::RequestStatus::SAVED));
|
| + FROM_HERE, base::Bind(progress_callback_, request, arbitrary_size));
|
| + base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| + FROM_HERE, base::Bind(completion_callback_, request,
|
| + Offliner::RequestStatus::SAVED));
|
| }
|
| return true;
|
| }
|
| @@ -41,8 +46,8 @@ void OfflinerStub::Cancel() {
|
| bool OfflinerStub::HandleTimeout(const SavePageRequest& request) {
|
| if (snapshot_on_last_retry_) {
|
| base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(callback_, request, Offliner::RequestStatus::SAVED));
|
| + FROM_HERE, base::Bind(completion_callback_, request,
|
| + Offliner::RequestStatus::SAVED));
|
| return true;
|
| }
|
| return false;
|
|
|