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

Unified Diff: util/win/exception_handler_server.h

Issue 1432563003: win: crashpad_handler should create its own pipe name in ephemeral mode (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: --help 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
« no previous file with comments | « util/win/command_line_test.cc ('k') | util/win/exception_handler_server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/win/exception_handler_server.h
diff --git a/util/win/exception_handler_server.h b/util/win/exception_handler_server.h
index d4a81f16caf99796e2eb433c1987ee5524a05090..46141414fd670234c3ecd98426d10cdc7c61a6ea 100644
--- a/util/win/exception_handler_server.h
+++ b/util/win/exception_handler_server.h
@@ -20,6 +20,7 @@
#include "base/basictypes.h"
#include "base/synchronization/lock.h"
+#include "util/file/file_io.h"
#include "util/win/address_types.h"
#include "util/win/scoped_handle.h"
@@ -62,15 +63,31 @@ class ExceptionHandlerServer {
//! \brief Constructs the exception handling server.
//!
- //! \param[in] pipe_name The name of the pipe to listen on. Must be of the
- //! form "\\.\pipe\<some_name>".
//! \param[in] persistent `true` if Run() should not return until Stop() is
//! called. If `false`, Run() will return when all clients have exited,
//! although Run() will always wait for the first client to connect.
- ExceptionHandlerServer(const std::string& pipe_name, bool persistent);
+ explicit ExceptionHandlerServer(bool persistent);
~ExceptionHandlerServer();
+ //! \brief Sets the pipe name to listen for client registrations on.
+ //!
+ //! Either this method or CreatePipe(), but not both, must be called before
+ //! Run().
+ //!
+ //! \param[in] pipe_name The name of the pipe to listen on. Must be of the
+ //! form "\\.\pipe\<some_name>".
+ void SetPipeName(const std::wstring& pipe_name);
+
+ //! \brief Creates a randomized pipe name to listen for client registrations
+ //! on and returns its name.
+ //!
+ //! Either this method or CreatePipe(), but not both, must be called before
+ //! Run().
+ //!
+ //! \return The pipe name that will be listened on.
+ std::wstring CreatePipe();
+
//! \brief Runs the exception-handling server.
//!
//! \param[in] delegate The interface to which the exceptions are delegated
@@ -89,8 +106,9 @@ class ExceptionHandlerServer {
static void __stdcall OnNonCrashDumpEvent(void* ctx, BOOLEAN);
static void __stdcall OnProcessEnd(void* ctx, BOOLEAN);
- std::string pipe_name_;
+ std::wstring pipe_name_;
ScopedKernelHANDLE port_;
+ ScopedFileHandle first_pipe_instance_;
base::Lock clients_lock_;
std::set<internal::ClientData*> clients_;
« no previous file with comments | « util/win/command_line_test.cc ('k') | util/win/exception_handler_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698