| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 void AddCloseObserver(HandleCloseObserver* observer); | 37 void AddCloseObserver(HandleCloseObserver* observer); |
| 38 void RemoveCloseObserver(HandleCloseObserver* observer); | 38 void RemoveCloseObserver(HandleCloseObserver* observer); |
| 39 | 39 |
| 40 protected: | 40 protected: |
| 41 HandleWrapper(MojoHandle handle); | 41 HandleWrapper(MojoHandle handle); |
| 42 ~HandleWrapper() override; | 42 ~HandleWrapper() override; |
| 43 void NotifyCloseObservers(); | 43 void NotifyCloseObservers(); |
| 44 | 44 |
| 45 mojo::ScopedHandle handle_; | 45 mojo::ScopedHandle handle_; |
| 46 MojoHandle handle_value_; |
| 46 base::ObserverList<HandleCloseObserver> close_observers_; | 47 base::ObserverList<HandleCloseObserver> close_observers_; |
| 47 }; | 48 }; |
| 48 | 49 |
| 49 } // namespace js | 50 } // namespace js |
| 50 } // namespace edk | 51 } // namespace edk |
| 51 } // namespace mojo | 52 } // namespace mojo |
| 52 | 53 |
| 53 namespace gin { | 54 namespace gin { |
| 54 | 55 |
| 55 // Note: It's important to use this converter rather than the one for | 56 // Note: It's important to use this converter rather than the one for |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 return false; | 98 return false; |
| 98 } | 99 } |
| 99 *out = gin::Handle<mojo::edk::js::HandleWrapper>(val, object); | 100 *out = gin::Handle<mojo::edk::js::HandleWrapper>(val, object); |
| 100 return true; | 101 return true; |
| 101 } | 102 } |
| 102 }; | 103 }; |
| 103 | 104 |
| 104 } // namespace gin | 105 } // namespace gin |
| 105 | 106 |
| 106 #endif // MOJO_EDK_JS_HANDLE_H_ | 107 #endif // MOJO_EDK_JS_HANDLE_H_ |
| OLD | NEW |