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

Unified Diff: ipc/ipc_channel_win.cc

Issue 7486007: Fix NamedProxyLauncher on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 4 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 | « ipc/ipc_channel_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_win.cc
diff --git a/ipc/ipc_channel_win.cc b/ipc/ipc_channel_win.cc
index e56235da3d16fba598bfdc56375b8373e2f66955..3a85a1651fb40b7750dbfa3e7a010c0c21938f8d 100644
--- a/ipc/ipc_channel_win.cc
+++ b/ipc/ipc_channel_win.cc
@@ -93,8 +93,19 @@ bool Channel::ChannelImpl::Send(Message* message) {
return true;
}
+// static
+bool Channel::ChannelImpl::IsNamedServerInitialized(
+ const std::string& channel_id) {
+ if (WaitNamedPipe(PipeName(channel_id).c_str(), 1))
+ return true;
+ // If ERROR_SEM_TIMEOUT occurred, the pipe exists but is handling another
+ // connection.
+ return GetLastError() == ERROR_SEM_TIMEOUT;
+}
+
+// static
const std::wstring Channel::ChannelImpl::PipeName(
- const std::string& channel_id) const {
+ const std::string& channel_id) {
std::string name("\\\\.\\pipe\\chrome.");
return ASCIIToWide(name.append(channel_id));
}
@@ -411,4 +422,9 @@ bool Channel::Send(Message* message) {
return channel_impl_->Send(message);
}
+// static
+bool Channel::IsNamedServerInitialized(const std::string& channel_id) {
+ return ChannelImpl::IsNamedServerInitialized(channel_id);
+}
+
} // namespace IPC
« no previous file with comments | « ipc/ipc_channel_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698