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

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

Issue 724563003: Avoid touching members in InterfaceImpl::ErrorHandlerImpl after calling OnConnectionError (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « mojo/public/cpp/bindings/binding.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_INTERFACE_IMPL_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_IMPL_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_IMPL_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_IMPL_H_
7 7
8 #include "mojo/public/cpp/bindings/binding.h" 8 #include "mojo/public/cpp/bindings/binding.h"
9 #include "mojo/public/cpp/bindings/interface_request.h" 9 #include "mojo/public/cpp/bindings/interface_request.h"
10 #include "mojo/public/cpp/environment/environment.h" 10 #include "mojo/public/cpp/environment/environment.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } 52 }
53 53
54 private: 54 private:
55 class ErrorHandlerImpl : public ErrorHandler { 55 class ErrorHandlerImpl : public ErrorHandler {
56 public: 56 public:
57 explicit ErrorHandlerImpl(InterfaceImpl* impl) : impl_(impl) {} 57 explicit ErrorHandlerImpl(InterfaceImpl* impl) : impl_(impl) {}
58 ~ErrorHandlerImpl() override {} 58 ~ErrorHandlerImpl() override {}
59 59
60 // ErrorHandler implementation: 60 // ErrorHandler implementation:
61 void OnConnectionError() override { 61 void OnConnectionError() override {
62 bool delete_on_error = delete_on_error_;
62 impl_->OnConnectionError(); 63 impl_->OnConnectionError();
63 if (delete_on_error_) 64 if (delete_on_error)
64 delete impl_; 65 delete impl_;
65 } 66 }
66 67
67 void set_delete_on_error(bool delete_on_error) { 68 void set_delete_on_error(bool delete_on_error) {
68 delete_on_error_ = delete_on_error; 69 delete_on_error_ = delete_on_error;
69 } 70 }
70 71
71 private: 72 private:
72 InterfaceImpl* impl_; 73 InterfaceImpl* impl_;
73 bool delete_on_error_ = false; 74 bool delete_on_error_ = false;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 Impl* WeakBindToRequest( 169 Impl* WeakBindToRequest(
169 Impl* instance, 170 Impl* instance,
170 InterfaceRequest<Interface>* request, 171 InterfaceRequest<Interface>* request,
171 const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) { 172 const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) {
172 return WeakBindToPipe(instance, request->PassMessagePipe(), waiter); 173 return WeakBindToPipe(instance, request->PassMessagePipe(), waiter);
173 } 174 }
174 175
175 } // namespace mojo 176 } // namespace mojo
176 177
177 #endif // MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_IMPL_H_ 178 #endif // MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_IMPL_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/binding.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698