| OLD | NEW |
| 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 #ifndef MOJO_DART_EMBEDDER_MONITOR_H_ | 5 #ifndef SKY_ENGINE_CORE_SCRIPT_MONITOR_H_ |
| 6 #define MOJO_DART_EMBEDDER_MONITOR_H_ | 6 #define SKY_ENGINE_CORE_SCRIPT_MONITOR_H_ |
| 7 | 7 |
| 8 #include "base/synchronization/condition_variable.h" | 8 #include "base/synchronization/condition_variable.h" |
| 9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
| 10 | 10 |
| 11 namespace mojo { | 11 namespace blink { |
| 12 namespace dart { | |
| 13 | 12 |
| 14 class Monitor { | 13 class Monitor { |
| 15 public: | 14 public: |
| 16 Monitor() { | 15 Monitor() { |
| 17 lock_ = new base::Lock(); | 16 lock_ = new base::Lock(); |
| 18 condition_variable_ = new base::ConditionVariable(lock_); | 17 condition_variable_ = new base::ConditionVariable(lock_); |
| 19 } | 18 } |
| 20 | 19 |
| 21 ~Monitor() { | 20 ~Monitor() { |
| 22 delete condition_variable_; | 21 delete condition_variable_; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 void Notify() { | 62 void Notify() { |
| 64 monitor_->Notify(); | 63 monitor_->Notify(); |
| 65 } | 64 } |
| 66 | 65 |
| 67 private: | 66 private: |
| 68 Monitor* const monitor_; | 67 Monitor* const monitor_; |
| 69 | 68 |
| 70 DISALLOW_COPY_AND_ASSIGN(MonitorLocker); | 69 DISALLOW_COPY_AND_ASSIGN(MonitorLocker); |
| 71 }; | 70 }; |
| 72 | 71 |
| 73 } // namespace dart | 72 } // namespace blink |
| 74 } // namespace mojo | |
| 75 | 73 |
| 76 | 74 |
| 77 #endif // MOJO_DART_EMBEDDER_MONITOR_H_ | 75 #endif // SKY_ENGINE_CORE_SCRIPT_MONITOR_H_ |
| OLD | NEW |