Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Side by Side Diff: mojo/public/cpp/bindings/pipe_control_message_handler_delegate.h

Issue 2649573004: Mojo bindings: merge the control messages of sending disconnect reason and notifying endpoint close… (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_PIPE_CONTROL_MESSAGE_HANDLER_DELEGATE_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_PIPE_CONTROL_MESSAGE_HANDLER_DELEGATE_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_PIPE_CONTROL_MESSAGE_HANDLER_DELEGATE_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_PIPE_CONTROL_MESSAGE_HANDLER_DELEGATE_H_
7 7
8 #include "base/optional.h"
9 #include "mojo/public/cpp/bindings/disconnect_reason.h"
8 #include "mojo/public/cpp/bindings/interface_id.h" 10 #include "mojo/public/cpp/bindings/interface_id.h"
9 11
10 namespace mojo { 12 namespace mojo {
11 13
12 class PipeControlMessageHandlerDelegate { 14 class PipeControlMessageHandlerDelegate {
13 public: 15 public:
14 // The implementation of the following methods should return false if the 16 // The implementation of the following methods should return false if the
15 // notification is unexpected. In that case, the user of this delegate is 17 // notification is unexpected. In that case, the user of this delegate is
16 // expected to close the message pipe. 18 // expected to close the message pipe.
17 virtual bool OnPeerAssociatedEndpointClosed(InterfaceId id) = 0; 19 virtual bool OnPeerAssociatedEndpointClosed(
20 InterfaceId id,
21 const base::Optional<DisconnectReason>& reason) = 0;
18 virtual bool OnAssociatedEndpointClosedBeforeSent(InterfaceId id) = 0; 22 virtual bool OnAssociatedEndpointClosedBeforeSent(InterfaceId id) = 0;
19 23
20 protected: 24 protected:
21 virtual ~PipeControlMessageHandlerDelegate() {} 25 virtual ~PipeControlMessageHandlerDelegate() {}
22 }; 26 };
23 27
24 } // namespace mojo 28 } // namespace mojo
25 29
26 #endif // MOJO_PUBLIC_CPP_BINDINGS_PIPE_CONTROL_MESSAGE_HANDLER_DELEGATE_H_ 30 #endif // MOJO_PUBLIC_CPP_BINDINGS_PIPE_CONTROL_MESSAGE_HANDLER_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698