summaryrefslogtreecommitdiffstats
path: root/chrome/test/signaling_task.h
blob: 23063e1124621769ba9c585f45b010b0eac65f79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// A simple callback that you can use to wait for events on a thread.

#ifndef CHROME_TEST_SIGNALING_TASK_H_
#define CHROME_TEST_SIGNALING_TASK_H_
#pragma once

#include "base/waitable_event.h"

using base::WaitableEvent;

class SignalingTask : public Task {
 public:
  explicit SignalingTask(WaitableEvent* event) : event_(event) {
  }

  virtual void Run() {
    event_->Signal();
  }

 private:
  WaitableEvent* event_;
};

#endif  // CHROME_TEST_SIGNALING_TASK_H_