summaryrefslogtreecommitdiffstats
path: root/mojo/common/message_pump_mojo_handler.h
blob: 5809051e1d9561fcbb61e93fcce43b592db6c078 (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
29
// Copyright 2013 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.

#ifndef MOJO_COMMON_MESSAGE_PUMP_MOJO_HANDLER_H_
#define MOJO_COMMON_MESSAGE_PUMP_MOJO_HANDLER_H_

#include "mojo/common/mojo_common_export.h"
#include "mojo/public/cpp/system/core.h"

namespace mojo {
namespace common {

// Used by MessagePumpMojo to notify when a handle is either ready or has become
// invalid.
class MOJO_COMMON_EXPORT MessagePumpMojoHandler {
 public:
  virtual void OnHandleReady(const Handle& handle) = 0;

  virtual void OnHandleError(const Handle& handle, MojoResult result) = 0;

 protected:
  virtual ~MessagePumpMojoHandler() {}
};

}  // namespace common
}  // namespace mojo

#endif  // MOJO_COMMON_MESSAGE_PUMP_MOJO_HANDLER_H_