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_EDK_JS_HANDLE_H_ | 5 #ifndef MOJO_EDK_JS_HANDLE_H_ |
6 #define MOJO_EDK_JS_HANDLE_H_ | 6 #define MOJO_EDK_JS_HANDLE_H_ |
7 | 7 |
8 #include "base/observer_list.h" | 8 #include "base/observer_list.h" |
9 #include "gin/converter.h" | 9 #include "gin/converter.h" |
10 #include "gin/handle.h" | 10 #include "gin/handle.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 void AddCloseObserver(HandleCloseObserver* observer); | 33 void AddCloseObserver(HandleCloseObserver* observer); |
34 void RemoveCloseObserver(HandleCloseObserver* observer); | 34 void RemoveCloseObserver(HandleCloseObserver* observer); |
35 | 35 |
36 protected: | 36 protected: |
37 HandleWrapper(MojoHandle handle); | 37 HandleWrapper(MojoHandle handle); |
38 ~HandleWrapper() override; | 38 ~HandleWrapper() override; |
39 void NotifyCloseObservers(); | 39 void NotifyCloseObservers(); |
40 | 40 |
41 mojo::ScopedHandle handle_; | 41 mojo::ScopedHandle handle_; |
42 ObserverList<HandleCloseObserver> close_observers_; | 42 base::ObserverList<HandleCloseObserver> close_observers_; |
43 }; | 43 }; |
44 | 44 |
45 } // namespace js | 45 } // namespace js |
46 } // namespace mojo | 46 } // namespace mojo |
47 | 47 |
48 namespace gin { | 48 namespace gin { |
49 | 49 |
50 // Note: It's important to use this converter rather than the one for | 50 // Note: It's important to use this converter rather than the one for |
51 // MojoHandle, since that will do a simple int32 conversion. It's unfortunate | 51 // MojoHandle, since that will do a simple int32 conversion. It's unfortunate |
52 // there's no way to prevent against accidental use. | 52 // there's no way to prevent against accidental use. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 return false; | 89 return false; |
90 } | 90 } |
91 *out = gin::Handle<mojo::js::HandleWrapper>(val, object); | 91 *out = gin::Handle<mojo::js::HandleWrapper>(val, object); |
92 return true; | 92 return true; |
93 } | 93 } |
94 }; | 94 }; |
95 | 95 |
96 } // namespace gin | 96 } // namespace gin |
97 | 97 |
98 #endif // MOJO_EDK_JS_HANDLE_H_ | 98 #endif // MOJO_EDK_JS_HANDLE_H_ |
OLD | NEW |