| 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 #include "mojo/edk/js/handle.h" | 5 #include "mojo/edk/js/handle.h" |
| 6 | 6 |
| 7 #include "mojo/edk/js/handle_close_observer.h" | 7 #include "mojo/edk/js/handle_close_observer.h" |
| 8 | 8 |
| 9 namespace mojo { | 9 namespace mojo { |
| 10 namespace edk { | 10 namespace edk { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 } | 30 } |
| 31 | 31 |
| 32 void HandleWrapper::RemoveCloseObserver(HandleCloseObserver* observer) { | 32 void HandleWrapper::RemoveCloseObserver(HandleCloseObserver* observer) { |
| 33 close_observers_.RemoveObserver(observer); | 33 close_observers_.RemoveObserver(observer); |
| 34 } | 34 } |
| 35 | 35 |
| 36 void HandleWrapper::NotifyCloseObservers() { | 36 void HandleWrapper::NotifyCloseObservers() { |
| 37 if (!handle_.is_valid()) | 37 if (!handle_.is_valid()) |
| 38 return; | 38 return; |
| 39 | 39 |
| 40 FOR_EACH_OBSERVER(HandleCloseObserver, close_observers_, OnWillCloseHandle()); | 40 for (auto& observer : close_observers_) |
| 41 observer.OnWillCloseHandle(); |
| 41 } | 42 } |
| 42 | 43 |
| 43 } // namespace js | 44 } // namespace js |
| 44 } // namespace edk | 45 } // namespace edk |
| 45 } // namespace mojo | 46 } // namespace mojo |
| 46 | 47 |
| 47 namespace gin { | 48 namespace gin { |
| 48 | 49 |
| 49 v8::Handle<v8::Value> Converter<mojo::Handle>::ToV8(v8::Isolate* isolate, | 50 v8::Handle<v8::Value> Converter<mojo::Handle>::ToV8(v8::Isolate* isolate, |
| 50 const mojo::Handle& val) { | 51 const mojo::Handle& val) { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 75 return Converter<mojo::Handle>::ToV8(isolate, val); | 76 return Converter<mojo::Handle>::ToV8(isolate, val); |
| 76 } | 77 } |
| 77 | 78 |
| 78 bool Converter<mojo::MessagePipeHandle>::FromV8(v8::Isolate* isolate, | 79 bool Converter<mojo::MessagePipeHandle>::FromV8(v8::Isolate* isolate, |
| 79 v8::Handle<v8::Value> val, | 80 v8::Handle<v8::Value> val, |
| 80 mojo::MessagePipeHandle* out) { | 81 mojo::MessagePipeHandle* out) { |
| 81 return Converter<mojo::Handle>::FromV8(isolate, val, out); | 82 return Converter<mojo::Handle>::FromV8(isolate, val, out); |
| 82 } | 83 } |
| 83 | 84 |
| 84 } // namespace gin | 85 } // namespace gin |
| OLD | NEW |