| Index: components/test_runner/web_task.cc
|
| diff --git a/components/test_runner/web_task.cc b/components/test_runner/web_task.cc
|
| index df3cb6993282249d8136522d4b2f5d382c32ad44..b7c6e4e38586c2ea6698138ea14db8412e3735c1 100644
|
| --- a/components/test_runner/web_task.cc
|
| +++ b/components/test_runner/web_task.cc
|
| @@ -4,42 +4,15 @@
|
|
|
| #include "components/test_runner/web_task.h"
|
|
|
| -#include <algorithm>
|
| -
|
| -#include "third_party/WebKit/public/web/WebKit.h"
|
| -
|
| namespace test_runner {
|
|
|
| -WebTask::WebTask(WebTaskList* list) : task_list_(list) {
|
| - task_list_->RegisterTask(this);
|
| -}
|
| -
|
| -WebTask::~WebTask() {
|
| - if (task_list_)
|
| - task_list_->UnregisterTask(this);
|
| -}
|
| -
|
| -WebTaskList::WebTaskList() {
|
| -}
|
| -
|
| -WebTaskList::~WebTaskList() {
|
| - RevokeAll();
|
| -}
|
| +WebCallbackTask::WebCallbackTask(const base::Closure& callback)
|
| + : callback_(callback) {}
|
|
|
| -void WebTaskList::RegisterTask(WebTask* task) {
|
| - tasks_.push_back(task);
|
| -}
|
| -
|
| -void WebTaskList::UnregisterTask(WebTask* task) {
|
| - std::vector<WebTask*>::iterator iter =
|
| - std::find(tasks_.begin(), tasks_.end(), task);
|
| - if (iter != tasks_.end())
|
| - tasks_.erase(iter);
|
| -}
|
| +WebCallbackTask::~WebCallbackTask() {}
|
|
|
| -void WebTaskList::RevokeAll() {
|
| - while (!tasks_.empty())
|
| - tasks_[0]->cancel();
|
| +void WebCallbackTask::run() {
|
| + callback_.Run();
|
| }
|
|
|
| } // namespace test_runner
|
|
|