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

Side by Side Diff: mojo/public/cpp/bindings/tests/binding_unittest.cc

Issue 1682113003: Mojo C++ bindings: Generate InterfaceHandle<> instead of InterfacePtr<>. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebase ontop of master, address trung's comments Created 4 years, 10 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 // Note: This file tests both binding.h (mojo::Binding) and strong_binding.h 5 // Note: This file tests both binding.h (mojo::Binding) and strong_binding.h
6 // (mojo::StrongBinding). 6 // (mojo::StrongBinding).
7 7
8 #include "mojo/public/cpp/bindings/binding.h" 8 #include "mojo/public/cpp/bindings/binding.h"
9 #include "mojo/public/cpp/bindings/strong_binding.h" 9 #include "mojo/public/cpp/bindings/strong_binding.h"
10 #include "mojo/public/cpp/environment/environment.h" 10 #include "mojo/public/cpp/environment/environment.h"
(...skipping 26 matching lines...) Expand all
37 : was_deleted_(was_deleted) {} 37 : was_deleted_(was_deleted) {}
38 ~ServiceImpl() override { 38 ~ServiceImpl() override {
39 if (was_deleted_) 39 if (was_deleted_)
40 *was_deleted_ = true; 40 *was_deleted_ = true;
41 } 41 }
42 42
43 private: 43 private:
44 // sample::Service implementation 44 // sample::Service implementation
45 void Frobinate(sample::FooPtr foo, 45 void Frobinate(sample::FooPtr foo,
46 BazOptions options, 46 BazOptions options,
47 sample::PortPtr port, 47 mojo::InterfaceHandle<sample::Port> port,
48 const FrobinateCallback& callback) override { 48 const FrobinateCallback& callback) override {
49 callback.Run(1); 49 callback.Run(1);
50 } 50 }
51 void GetPort(InterfaceRequest<sample::Port> port) override {} 51 void GetPort(InterfaceRequest<sample::Port> port) override {}
52 52
53 bool* const was_deleted_; 53 bool* const was_deleted_;
54 54
55 MOJO_DISALLOW_COPY_AND_ASSIGN(ServiceImpl); 55 MOJO_DISALLOW_COPY_AND_ASSIGN(ServiceImpl);
56 }; 56 };
57 57
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 329
330 // Tests that StrongBinding::Unbind() compiles. 330 // Tests that StrongBinding::Unbind() compiles.
331 TEST_F(BindingTest, StrongBindingUnbindCompile) { 331 TEST_F(BindingTest, StrongBindingUnbindCompile) {
332 ServiceImpl impl; 332 ServiceImpl impl;
333 sample::ServicePtr ptr; 333 sample::ServicePtr ptr;
334 StrongBinding<sample::Service> binding(&impl, GetProxy(&ptr)); 334 StrongBinding<sample::Service> binding(&impl, GetProxy(&ptr));
335 binding.Unbind(); 335 binding.Unbind();
336 } 336 }
337 337
338 } // namespace 338 } // namespace
339 } // mojo 339 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/tests/array_unittest.cc ('k') | mojo/public/cpp/bindings/tests/handle_passing_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698