| OLD | NEW |
| 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_COMMON_WEAK_BINDING_SET_H_ |
| 6 #define MOJO_COMMON_WEAK_BINDING_SET_H_ |
| 7 |
| 5 #include <algorithm> | 8 #include <algorithm> |
| 6 #include <vector> | 9 #include <vector> |
| 7 | 10 |
| 8 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 9 #include "mojo/public/cpp/bindings/binding.h" | 12 #include "mojo/public/cpp/bindings/binding.h" |
| 10 | 13 |
| 11 namespace mojo { | 14 namespace mojo { |
| 12 | 15 |
| 13 template <typename Interface> | 16 template <typename Interface> |
| 14 class WeakBinding; | 17 class WeakBinding; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 void OnConnectionError() override { delete this; } | 84 void OnConnectionError() override { delete this; } |
| 82 | 85 |
| 83 private: | 86 private: |
| 84 mojo::Binding<Interface> binding_; | 87 mojo::Binding<Interface> binding_; |
| 85 base::WeakPtrFactory<WeakBinding> weak_ptr_factory_; | 88 base::WeakPtrFactory<WeakBinding> weak_ptr_factory_; |
| 86 | 89 |
| 87 DISALLOW_COPY_AND_ASSIGN(WeakBinding); | 90 DISALLOW_COPY_AND_ASSIGN(WeakBinding); |
| 88 }; | 91 }; |
| 89 | 92 |
| 90 } // namespace mojo | 93 } // namespace mojo |
| 94 |
| 95 #endif // MOJO_COMMON_WEAK_BINDING_SET_H_ |
| OLD | NEW |