Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1164)

Unified Diff: mojo/dart/embedder/monitor.h

Issue 1245243002: Move dart_debugger into tonic and use it in mojo dart controller (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/dart/embedder/dart_debugger.cc ('k') | tonic/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/dart/embedder/monitor.h
diff --git a/mojo/dart/embedder/monitor.h b/mojo/dart/embedder/monitor.h
deleted file mode 100644
index a796bc370f2b3370e27884f9115eec00affd5f72..0000000000000000000000000000000000000000
--- a/mojo/dart/embedder/monitor.h
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef MOJO_DART_EMBEDDER_MONITOR_H_
-#define MOJO_DART_EMBEDDER_MONITOR_H_
-
-#include "base/synchronization/condition_variable.h"
-#include "base/synchronization/lock.h"
-
-namespace mojo {
-namespace dart {
-
-class Monitor {
- public:
- Monitor() {
- lock_ = new base::Lock();
- condition_variable_ = new base::ConditionVariable(lock_);
- }
-
- ~Monitor() {
- delete condition_variable_;
- delete lock_;
- }
-
- void Enter() {
- lock_->Acquire();
- }
-
- void Exit() {
- lock_->Release();
- }
-
- void Notify() {
- condition_variable_->Signal();
- }
-
- void Wait() {
- condition_variable_->Wait();
- }
-
- private:
- base::Lock* lock_;
- base::ConditionVariable* condition_variable_;
- DISALLOW_COPY_AND_ASSIGN(Monitor);
-};
-
-class MonitorLocker {
- public:
- explicit MonitorLocker(Monitor* monitor) : monitor_(monitor) {
- CHECK(monitor_);
- monitor_->Enter();
- }
-
- virtual ~MonitorLocker() {
- monitor_->Exit();
- }
-
- void Wait() {
- return monitor_->Wait();
- }
-
- void Notify() {
- monitor_->Notify();
- }
-
- private:
- Monitor* const monitor_;
-
- DISALLOW_COPY_AND_ASSIGN(MonitorLocker);
-};
-
-} // namespace dart
-} // namespace mojo
-
-
-#endif // MOJO_DART_EMBEDDER_MONITOR_H_
« no previous file with comments | « mojo/dart/embedder/dart_debugger.cc ('k') | tonic/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698