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

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

Issue 1465183005: Rename mojo::TokenSerializer to mojo::Broker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix win component Created 5 years, 1 month 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/simple_broker.cc
diff --git a/mojo/edk/system/simple_token_serializer_win.cc b/mojo/edk/system/simple_broker.cc
similarity index 79%
rename from mojo/edk/system/simple_token_serializer_win.cc
rename to mojo/edk/system/simple_broker.cc
index e318ad15cae81ad19a59b54e8b6a380f7ae248df..0760704bfcee8b23212fa24a23592603a0c6211c 100644
--- a/mojo/edk/system/simple_token_serializer_win.cc
+++ b/mojo/edk/system/simple_broker.cc
@@ -2,33 +2,35 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "mojo/edk/system/simple_token_serializer_win.h"
-
-#include <windows.h>
+#include "mojo/edk/system/simple_broker.h"
#include "base/process/process.h"
#include "mojo/edk/embedder/platform_channel_pair.h"
+#if defined(OS_WIN)
+#include <windows.h>
+#endif
+
namespace mojo {
namespace edk {
-SimpleTokenSerializer::SimpleTokenSerializer() {
+SimpleBroker::SimpleBroker() {
}
-SimpleTokenSerializer::~SimpleTokenSerializer() {
+SimpleBroker::~SimpleBroker() {
}
-void SimpleTokenSerializer::CreatePlatformChannelPair(
+#if defined(OS_WIN)
+void SimpleBroker::CreatePlatformChannelPair(
ScopedPlatformHandle* server, ScopedPlatformHandle* client) {
PlatformChannelPair channel_pair;
*server = channel_pair.PassServerHandle();
*client = channel_pair.PassClientHandle();
}
-void SimpleTokenSerializer::HandleToToken(
- const PlatformHandle* platform_handles,
- size_t count,
- uint64_t* tokens) {
+void SimpleBroker::HandleToToken(const PlatformHandle* platform_handles,
+ size_t count,
+ uint64_t* tokens) {
// Since we're not sure which process might ultimately deserialize the message
// we can't duplicate the handle now. Instead, write the process ID and handle
// now and let the receiver duplicate it.
@@ -47,9 +49,9 @@ void SimpleTokenSerializer::HandleToToken(
}
}
-void SimpleTokenSerializer::TokenToHandle(const uint64_t* tokens,
- size_t count,
- PlatformHandle* handles) {
+void SimpleBroker::TokenToHandle(const uint64_t* tokens,
+ size_t count,
+ PlatformHandle* handles) {
for (size_t i = 0; i < count; ++i) {
DWORD pid = tokens[i] >> 32;
#if defined(_WIN64)
@@ -73,6 +75,7 @@ void SimpleTokenSerializer::TokenToHandle(const uint64_t* tokens,
}
}
}
+#endif
} // namespace edk
} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698