Commit 7c83ed40 authored by Eugene But's avatar Eugene But Committed by Commit Bot

Pass non-const DownloadTask* to OnDownloadUpdated.

Implementors of DownloadTaskObserver::OnDownloadUpdated should be able
to call RemoveObserver on a ppased task, if the download is complete.

Bug: 780646
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I86f2058e35e9caeb09e32505ef05486f855646eb
Reviewed-on: https://chromium-review.googlesource.com/798312Reviewed-by: default avatarGregory Chatzinoff <gchatz@chromium.org>
Commit-Queue: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520684}
parent d80a03d4
...@@ -49,7 +49,7 @@ const char kMimeType[] = "application/pdf"; ...@@ -49,7 +49,7 @@ const char kMimeType[] = "application/pdf";
class MockDownloadTaskObserver : public DownloadTaskObserver { class MockDownloadTaskObserver : public DownloadTaskObserver {
public: public:
MOCK_METHOD1(OnDownloadUpdated, void(const DownloadTask* task)); MOCK_METHOD1(OnDownloadUpdated, void(DownloadTask* task));
}; };
// Mocks DownloadTaskImpl::Delegate's OnTaskUpdated and OnTaskDestroyed methods // Mocks DownloadTaskImpl::Delegate's OnTaskUpdated and OnTaskDestroyed methods
......
...@@ -21,7 +21,7 @@ class DownloadTaskObserver { ...@@ -21,7 +21,7 @@ class DownloadTaskObserver {
// if the download has failed, DownloadTask::GetPercentComplete() to check // if the download has failed, DownloadTask::GetPercentComplete() to check
// the download progress, and DownloadTask::GetResponseWriter() to obtain the // the download progress, and DownloadTask::GetResponseWriter() to obtain the
// downloaded data. // downloaded data.
virtual void OnDownloadUpdated(const DownloadTask* task) {} virtual void OnDownloadUpdated(DownloadTask* task) {}
DownloadTaskObserver() = default; DownloadTaskObserver() = default;
virtual ~DownloadTaskObserver() = default; virtual ~DownloadTaskObserver() = default;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment