Home | History | Annotate | Download | only in bindings
      1 // Copyright 2015 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_PIPE_CONTROL_MESSAGE_HANDLER_DELEGATE_H_
      6 #define MOJO_PUBLIC_CPP_BINDINGS_PIPE_CONTROL_MESSAGE_HANDLER_DELEGATE_H_
      7 
      8 #include "base/optional.h"
      9 #include "mojo/public/cpp/bindings/disconnect_reason.h"
     10 #include "mojo/public/cpp/bindings/interface_id.h"
     11 
     12 namespace mojo {
     13 
     14 class PipeControlMessageHandlerDelegate {
     15  public:
     16   // The implementation of the following methods should return false if the
     17   // notification is unexpected. In that case, the user of this delegate is
     18   // expected to close the message pipe.
     19   virtual bool OnPeerAssociatedEndpointClosed(
     20       InterfaceId id,
     21       const base::Optional<DisconnectReason>& reason) = 0;
     22 
     23  protected:
     24   virtual ~PipeControlMessageHandlerDelegate() {}
     25 };
     26 
     27 }  // namespace mojo
     28 
     29 #endif  // MOJO_PUBLIC_CPP_BINDINGS_PIPE_CONTROL_MESSAGE_HANDLER_DELEGATE_H_
     30