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

Side by Side Diff: mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h

Issue 2064903002: Mojo: Report bindings validation errors via MojoNotifyBadMessage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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_LIB_ASSOCIATED_INTERFACE_PTR_STATE_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_ASSOCIATED_INTERFACE_PTR_STATE_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_ASSOCIATED_INTERFACE_PTR_STATE_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_ASSOCIATED_INTERFACE_PTR_STATE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> // For |std::swap()|. 10 #include <algorithm> // For |std::swap()|.
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 DCHECK(!endpoint_client_); 86 DCHECK(!endpoint_client_);
87 DCHECK(!proxy_); 87 DCHECK(!proxy_);
88 DCHECK_EQ(0u, version_); 88 DCHECK_EQ(0u, version_);
89 DCHECK(info.is_valid()); 89 DCHECK(info.is_valid());
90 90
91 version_ = info.version(); 91 version_ = info.version();
92 endpoint_client_.reset(new InterfaceEndpointClient( 92 endpoint_client_.reset(new InterfaceEndpointClient(
93 info.PassHandle(), nullptr, 93 info.PassHandle(), nullptr,
94 base::WrapUnique(new typename Interface::ResponseValidator_()), false, 94 base::WrapUnique(new typename Interface::ResponseValidator_()), false,
95 std::move(runner))); 95 std::move(runner)));
96 endpoint_client_->set_interface_name(Interface::Name_);
96 proxy_.reset(new Proxy(endpoint_client_.get())); 97 proxy_.reset(new Proxy(endpoint_client_.get()));
97 proxy_->serialization_context()->router = endpoint_client_->router(); 98 proxy_->serialization_context()->router = endpoint_client_->router();
98 } 99 }
99 100
100 // After this method is called, the object is in an invalid state and 101 // After this method is called, the object is in an invalid state and
101 // shouldn't be reused. 102 // shouldn't be reused.
102 AssociatedInterfacePtrInfo<Interface> PassInterface() { 103 AssociatedInterfacePtrInfo<Interface> PassInterface() {
103 ScopedInterfaceEndpointHandle handle = endpoint_client_->PassHandle(); 104 ScopedInterfaceEndpointHandle handle = endpoint_client_->PassHandle();
104 endpoint_client_.reset(); 105 endpoint_client_.reset();
105 proxy_.reset(); 106 proxy_.reset();
(...skipping 28 matching lines...) Expand all
134 135
135 uint32_t version_; 136 uint32_t version_;
136 137
137 DISALLOW_COPY_AND_ASSIGN(AssociatedInterfacePtrState); 138 DISALLOW_COPY_AND_ASSIGN(AssociatedInterfacePtrState);
138 }; 139 };
139 140
140 } // namespace internal 141 } // namespace internal
141 } // namespace mojo 142 } // namespace mojo
142 143
143 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_ASSOCIATED_INTERFACE_PTR_STATE_H_ 144 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_ASSOCIATED_INTERFACE_PTR_STATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698