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

Side by Side Diff: client/crashpad_client_win.cc

Issue 1314683008: win: Add version to client registration request (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: 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
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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 const std::map<std::string, std::string>& annotations, 98 const std::map<std::string, std::string>& annotations,
99 const std::vector<std::string>& arguments) { 99 const std::vector<std::string>& arguments) {
100 LOG(FATAL) << "SetHandler should be used on Windows"; 100 LOG(FATAL) << "SetHandler should be used on Windows";
101 return false; 101 return false;
102 } 102 }
103 103
104 bool CrashpadClient::SetHandler(const std::string& ipc_port) { 104 bool CrashpadClient::SetHandler(const std::string& ipc_port) {
105 ClientToServerMessage message; 105 ClientToServerMessage message;
106 memset(&message, 0, sizeof(message)); 106 memset(&message, 0, sizeof(message));
107 message.type = ClientToServerMessage::kRegister; 107 message.type = ClientToServerMessage::kRegister;
108 message.registration.version = RegistrationRequest::kMessageVersion;
108 message.registration.client_process_id = GetCurrentProcessId(); 109 message.registration.client_process_id = GetCurrentProcessId();
109 message.registration.exception_information = 110 message.registration.exception_information =
110 reinterpret_cast<WinVMAddress>(&g_exception_information); 111 reinterpret_cast<WinVMAddress>(&g_exception_information);
111 112
112 ServerToClientMessage response = {0}; 113 ServerToClientMessage response = {0};
113 114
114 if (!SendToCrashHandlerServer( 115 if (!SendToCrashHandlerServer(
115 base::UTF8ToUTF16(ipc_port), message, &response)) { 116 base::UTF8ToUTF16(ipc_port), message, &response)) {
116 return false; 117 return false;
117 } 118 }
118 119
119 // The server returns these already duplicated to be valid in this process. 120 // The server returns these already duplicated to be valid in this process.
120 g_signal_exception = 121 g_signal_exception =
121 reinterpret_cast<HANDLE>(response.registration.request_report_event); 122 reinterpret_cast<HANDLE>(response.registration.request_report_event);
122 return true; 123 return true;
123 } 124 }
124 125
125 bool CrashpadClient::UseHandler() { 126 bool CrashpadClient::UseHandler() {
126 if (g_signal_exception == INVALID_HANDLE_VALUE) 127 if (g_signal_exception == INVALID_HANDLE_VALUE)
127 return false; 128 return false;
128 // In theory we could store the previous handler but it is not clear what 129 // In theory we could store the previous handler but it is not clear what
129 // use we have for it. 130 // use we have for it.
130 SetUnhandledExceptionFilter(&UnhandledExceptionHandler); 131 SetUnhandledExceptionFilter(&UnhandledExceptionHandler);
131 return true; 132 return true;
132 } 133 }
133 134
134 } // namespace crashpad 135 } // namespace crashpad
OLDNEW
« no previous file with comments | « no previous file | util/win/exception_handler_server.cc » ('j') | util/win/registration_protocol_win.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698