Bug 1577831 - remove `using namespace std;` from IPC glue code; r=jld
authorNathan Froyd <froydnj@mozilla.com>
Sat, 31 Aug 2019 00:00:12 +0000
changeset 551544 3a41fd305c3ce85b9f534f15cd90dfd4ae82c0d1
parent 551543 da9a6db4b59b15ff3805a97f1a530551acb6b27a
child 551545 97ec7ec089c4e91acd34d7324711cc9c556b1117
push id11865
push userbtara@mozilla.com
push dateMon, 02 Sep 2019 08:54:37 +0000
treeherdermozilla-beta@37f59c4671b3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjld
bugs1577831
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1577831 - remove `using namespace std;` from IPC glue code; r=jld Just some minor prefixing needs to be done to enable this. Differential Revision: https://phabricator.services.mozilla.com/D44220
ipc/glue/MessageChannel.cpp
ipc/glue/MessageLink.cpp
ipc/glue/Transport_posix.cpp
ipc/glue/Transport_win.cpp
--- a/ipc/glue/MessageChannel.cpp
+++ b/ipc/glue/MessageChannel.cpp
@@ -103,17 +103,16 @@ static mozilla::LazyLogModule sLogModule
  * complexity. One issue is that replies can be received out of order. It's also
  * more difficult to determine whether one message is nested inside
  * another. Consequently, intr handling uses mOutOfTurnReplies and
  * mRemoteStackDepthGuess, which are not needed for sync messages.
  */
 
 using namespace mozilla;
 using namespace mozilla::ipc;
-using namespace std;
 
 using mozilla::MonitorAutoLock;
 using mozilla::MonitorAutoUnlock;
 using mozilla::dom::AutoNoJSAPI;
 using mozilla::dom::ScriptSettingsInitialized;
 
 #define IPC_ASSERT(_cond, ...)                                           \
   do {                                                                   \
--- a/ipc/glue/MessageLink.cpp
+++ b/ipc/glue/MessageLink.cpp
@@ -15,17 +15,16 @@
 #include "mozilla/DebugOnly.h"
 #include "nsDebug.h"
 #include "nsExceptionHandler.h"
 #include "nsISupportsImpl.h"
 #include "nsPrintfCString.h"
 #include "nsXULAppAPI.h"
 
 using namespace mozilla;
-using namespace std;
 
 // We rely on invariants about the lifetime of the transport:
 //
 //  - outlives this MessageChannel
 //  - deleted on the IO thread
 //
 // These invariants allow us to send messages directly through the
 // transport without having to worry about orphaned Send() tasks on
--- a/ipc/glue/Transport_posix.cpp
+++ b/ipc/glue/Transport_posix.cpp
@@ -9,26 +9,24 @@
 #include <string>
 
 #include "base/eintr_wrapper.h"
 
 #include "mozilla/ipc/Transport.h"
 #include "mozilla/ipc/FileDescriptor.h"
 #include "ProtocolUtils.h"
 
-using namespace std;
-
 using base::ProcessHandle;
 
 namespace mozilla {
 namespace ipc {
 
 nsresult CreateTransport(base::ProcessId aProcIdOne, TransportDescriptor* aOne,
                          TransportDescriptor* aTwo) {
-  wstring id = IPC::Channel::GenerateVerifiedChannelID(std::wstring());
+  std::wstring id = IPC::Channel::GenerateVerifiedChannelID(std::wstring());
   // Use MODE_SERVER to force creation of the socketpair
   Transport t(id, Transport::MODE_SERVER, nullptr);
   int fd1 = t.GetFileDescriptor();
   int fd2, dontcare;
   t.GetClientFileDescriptorMapping(&fd2, &dontcare);
   if (fd1 < 0 || fd2 < 0) {
     return NS_ERROR_TRANSPORT_INIT;
   }
--- a/ipc/glue/Transport_win.cpp
+++ b/ipc/glue/Transport_win.cpp
@@ -4,26 +4,24 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "base/message_loop.h"
 
 #include "mozilla/ipc/Transport.h"
 #include "mozilla/ipc/ProtocolUtils.h"
 
-using namespace std;
-
 using base::ProcessHandle;
 
 namespace mozilla {
 namespace ipc {
 
 nsresult CreateTransport(base::ProcessId aProcIdOne, TransportDescriptor* aOne,
                          TransportDescriptor* aTwo) {
-  wstring id = IPC::Channel::GenerateVerifiedChannelID(std::wstring());
+  std::wstring id = IPC::Channel::GenerateVerifiedChannelID(std::wstring());
   // Use MODE_SERVER to force creation of the pipe
   Transport t(id, Transport::MODE_SERVER, nullptr);
   HANDLE serverPipe = t.GetServerPipeHandle();
   if (!serverPipe) {
     return NS_ERROR_TRANSPORT_INIT;
   }
 
   // NB: we create the server pipe immediately, instead of just