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

Side by Side Diff: util/win/exception_handler_server.h

Issue 1314093002: Refactor handler/main for Windows, implement CrashHandlerExceptionServer (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@crash-handler-exe
Patch Set: fixes2 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 unified diff | Download patch
« no previous file with comments | « snapshot/win/process_snapshot_win.cc ('k') | util/win/exception_handler_server.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Crashpad Authors. All rights reserved. 1 // Copyright 2015 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 //! \param[in] exception_information_address The address in the client's 50 //! \param[in] exception_information_address The address in the client's
51 //! address space of an ExceptionInformation structure. 51 //! address space of an ExceptionInformation structure.
52 //! \return The exit code that should be used when terminating the client 52 //! \return The exit code that should be used when terminating the client
53 //! process. 53 //! process.
54 virtual unsigned int ExceptionHandlerServerException( 54 virtual unsigned int ExceptionHandlerServerException(
55 HANDLE process, 55 HANDLE process,
56 WinVMAddress exception_information_address) = 0; 56 WinVMAddress exception_information_address) = 0;
57 }; 57 };
58 58
59 //! \brief Constructs the exception handling server. 59 //! \brief Constructs the exception handling server.
60 //! 60 ExceptionHandlerServer();
61 //! \param[in] delegate The interface to which the exceptions are delegated
62 //! when they are caught in Run(). Ownership is not transferred and it
63 //! must outlive this object.
64 explicit ExceptionHandlerServer(Delegate* delegate);
65 ~ExceptionHandlerServer(); 61 ~ExceptionHandlerServer();
66 62
67 //! \brief Runs the exception-handling server. 63 //! \brief Runs the exception-handling server.
68 //! 64 //!
65 //! \param[in] delegate The interface to which the exceptions are delegated
66 //! when they are caught in Run(). Ownership is not transferred.
69 //! \param[in] pipe_name The name of the pipe to listen on. Must be of the 67 //! \param[in] pipe_name The name of the pipe to listen on. Must be of the
70 //! form "\\.\pipe\<some_name>". 68 //! form "\\.\pipe\<some_name>".
71 void Run(const std::string& pipe_name); 69 void Run(Delegate* delegate, const std::string& pipe_name);
72 70
73 //! \brief Stops the exception-handling server. Returns immediately. The 71 //! \brief Stops the exception-handling server. Returns immediately. The
74 //! object must not be destroyed until Run() returns. 72 //! object must not be destroyed until Run() returns.
75 void Stop(); 73 void Stop();
76 74
77 private: 75 private:
78 static bool ServiceClientConnection( 76 static bool ServiceClientConnection(
79 const internal::PipeServiceContext& service_context); 77 const internal::PipeServiceContext& service_context);
80 static DWORD __stdcall PipeServiceProc(void* ctx); 78 static DWORD __stdcall PipeServiceProc(void* ctx);
81 static void __stdcall OnDumpEvent(void* ctx, BOOLEAN); 79 static void __stdcall OnDumpEvent(void* ctx, BOOLEAN);
82 static void __stdcall OnProcessEnd(void* ctx, BOOLEAN); 80 static void __stdcall OnProcessEnd(void* ctx, BOOLEAN);
83 81
84 Delegate* delegate_; // Weak.
85 ScopedKernelHANDLE port_; 82 ScopedKernelHANDLE port_;
86 83
87 base::Lock clients_lock_; 84 base::Lock clients_lock_;
88 std::set<internal::ClientData*> clients_; 85 std::set<internal::ClientData*> clients_;
89 86
90 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerServer); 87 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerServer);
91 }; 88 };
92 89
93 } // namespace crashpad 90 } // namespace crashpad
94 91
95 #endif // CRASHPAD_UTIL_WIN_EXCEPTION_HANDLER_SERVER_H_ 92 #endif // CRASHPAD_UTIL_WIN_EXCEPTION_HANDLER_SERVER_H_
OLDNEW
« no previous file with comments | « snapshot/win/process_snapshot_win.cc ('k') | util/win/exception_handler_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698