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

Unified Diff: mojo/edk/system/platform_handle_dispatcher.cc

Issue 1350023003: Add a Mojo EDK for Chrome that uses one OS pipe per message pipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
Index: mojo/edk/system/platform_handle_dispatcher.cc
diff --git a/third_party/mojo/src/mojo/edk/system/platform_handle_dispatcher.cc b/mojo/edk/system/platform_handle_dispatcher.cc
similarity index 94%
copy from third_party/mojo/src/mojo/edk/system/platform_handle_dispatcher.cc
copy to mojo/edk/system/platform_handle_dispatcher.cc
index 681b40686344d6a6ee3433b9210317f84bfa41e6..a6f830512abb1c2eed3c56dcbb7d1fae7260e9c9 100644
--- a/third_party/mojo/src/mojo/edk/system/platform_handle_dispatcher.cc
+++ b/mojo/edk/system/platform_handle_dispatcher.cc
@@ -15,14 +15,14 @@ namespace {
const size_t kInvalidPlatformHandleIndex = static_cast<size_t>(-1);
-struct SerializedPlatformHandleDispatcher {
+struct MOJO_ALIGNAS(8) SerializedPlatformHandleDispatcher {
size_t platform_handle_index; // (Or |kInvalidPlatformHandleIndex|.)
};
} // namespace
embedder::ScopedPlatformHandle PlatformHandleDispatcher::PassPlatformHandle() {
- MutexLocker locker(&mutex());
+ base::AutoLock locker(lock());
return platform_handle_.Pass();
}
@@ -32,7 +32,6 @@ Dispatcher::Type PlatformHandleDispatcher::GetType() const {
// static
scoped_refptr<PlatformHandleDispatcher> PlatformHandleDispatcher::Deserialize(
- Channel* channel,
const void* source,
size_t size,
embedder::PlatformHandleVector* platform_handles) {
@@ -73,18 +72,17 @@ PlatformHandleDispatcher::~PlatformHandleDispatcher() {
}
void PlatformHandleDispatcher::CloseImplNoLock() {
- mutex().AssertHeld();
+ lock().AssertAcquired();
platform_handle_.reset();
}
scoped_refptr<Dispatcher>
PlatformHandleDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock() {
- mutex().AssertHeld();
+ lock().AssertAcquired();
return Create(platform_handle_.Pass());
}
void PlatformHandleDispatcher::StartSerializeImplNoLock(
- Channel* /*channel*/,
size_t* max_size,
size_t* max_platform_handles) {
DCHECK(HasOneRef()); // Only one ref => no need to take the lock.
@@ -93,7 +91,6 @@ void PlatformHandleDispatcher::StartSerializeImplNoLock(
}
bool PlatformHandleDispatcher::EndSerializeAndCloseImplNoLock(
- Channel* /*channel*/,
void* destination,
size_t* actual_size,
embedder::PlatformHandleVector* platform_handles) {

Powered by Google App Engine
This is Rietveld 408576698