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

Unified Diff: mojo/edk/system/core_test_base.h

Issue 1234683002: Convert some more |base::Lock|s to |mojo::system::Mutex|s. (Closed) Base URL: https://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 | « no previous file | mojo/edk/system/core_test_base.cc » ('j') | mojo/edk/system/endpoint_relayer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/core_test_base.h
diff --git a/mojo/edk/system/core_test_base.h b/mojo/edk/system/core_test_base.h
index ce3291870878279ae39ee1f8c5ca26ea81e2db8c..e2375cde3d716471b6d53db7fcc2d484cc18538a 100644
--- a/mojo/edk/system/core_test_base.h
+++ b/mojo/edk/system/core_test_base.h
@@ -5,8 +5,8 @@
#ifndef MOJO_EDK_SYSTEM_CORE_TEST_BASE_H_
#define MOJO_EDK_SYSTEM_CORE_TEST_BASE_H_
-#include "base/synchronization/lock.h"
#include "mojo/edk/embedder/simple_platform_support.h"
+#include "mojo/edk/system/mutex.h"
#include "mojo/public/c/system/types.h"
#include "mojo/public/cpp/system/macros.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -88,24 +88,24 @@ class CoreTestBase_MockHandleInfo {
void AwakableWasAdded(Awakable*);
private:
- mutable base::Lock lock_; // Protects the following members.
- unsigned ctor_call_count_;
- unsigned dtor_call_count_;
- unsigned close_call_count_;
- unsigned write_message_call_count_;
- unsigned read_message_call_count_;
- unsigned write_data_call_count_;
- unsigned begin_write_data_call_count_;
- unsigned end_write_data_call_count_;
- unsigned read_data_call_count_;
- unsigned begin_read_data_call_count_;
- unsigned end_read_data_call_count_;
- unsigned add_awakable_call_count_;
- unsigned remove_awakable_call_count_;
- unsigned cancel_all_awakables_call_count_;
-
- bool add_awakable_allowed_;
- std::vector<Awakable*> added_awakables_;
+ mutable Mutex mutex_;
+ unsigned ctor_call_count_ MOJO_GUARDED_BY(mutex_);
+ unsigned dtor_call_count_ MOJO_GUARDED_BY(mutex_);
+ unsigned close_call_count_ MOJO_GUARDED_BY(mutex_);
+ unsigned write_message_call_count_ MOJO_GUARDED_BY(mutex_);
+ unsigned read_message_call_count_ MOJO_GUARDED_BY(mutex_);
+ unsigned write_data_call_count_ MOJO_GUARDED_BY(mutex_);
+ unsigned begin_write_data_call_count_ MOJO_GUARDED_BY(mutex_);
+ unsigned end_write_data_call_count_ MOJO_GUARDED_BY(mutex_);
+ unsigned read_data_call_count_ MOJO_GUARDED_BY(mutex_);
+ unsigned begin_read_data_call_count_ MOJO_GUARDED_BY(mutex_);
+ unsigned end_read_data_call_count_ MOJO_GUARDED_BY(mutex_);
+ unsigned add_awakable_call_count_ MOJO_GUARDED_BY(mutex_);
+ unsigned remove_awakable_call_count_ MOJO_GUARDED_BY(mutex_);
+ unsigned cancel_all_awakables_call_count_ MOJO_GUARDED_BY(mutex_);
+
+ bool add_awakable_allowed_ MOJO_GUARDED_BY(mutex_);
+ std::vector<Awakable*> added_awakables_ MOJO_GUARDED_BY(mutex_);
MOJO_DISALLOW_COPY_AND_ASSIGN(CoreTestBase_MockHandleInfo);
};
« no previous file with comments | « no previous file | mojo/edk/system/core_test_base.cc » ('j') | mojo/edk/system/endpoint_relayer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698