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 "mojo/public/cpp/bindings/interface_id.h" 9 10namespace mojo { 11 12class PipeControlMessageHandlerDelegate { 13 public: 14 // The implementation of the following methods should return false if the 15 // notification is unexpected. In that case, the user of this delegate is 16 // expected to close the message pipe. 17 virtual bool OnPeerAssociatedEndpointClosed(InterfaceId id) = 0; 18 virtual bool OnAssociatedEndpointClosedBeforeSent(InterfaceId id) = 0; 19 20 protected: 21 virtual ~PipeControlMessageHandlerDelegate() {} 22}; 23 24} // namespace mojo 25 26#endif // MOJO_PUBLIC_CPP_BINDINGS_PIPE_CONTROL_MESSAGE_HANDLER_DELEGATE_H_ 27