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

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

Issue 1503403003: win: Fix a few sign mismatch warnings in crashpad. (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad.git@master
Patch Set: Created 5 years 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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 340
341 PCHECK(first_pipe_instance_.is_valid()) << "CreateNamedPipe"; 341 PCHECK(first_pipe_instance_.is_valid()) << "CreateNamedPipe";
342 342
343 SetPipeName(pipe_name); 343 SetPipeName(pipe_name);
344 return pipe_name; 344 return pipe_name;
345 } 345 }
346 346
347 void ExceptionHandlerServer::Run(Delegate* delegate) { 347 void ExceptionHandlerServer::Run(Delegate* delegate) {
348 uint64_t shutdown_token = base::RandUint64(); 348 uint64_t shutdown_token = base::RandUint64();
349 ScopedKernelHANDLE thread_handles[kPipeInstances]; 349 ScopedKernelHANDLE thread_handles[kPipeInstances];
350 for (int i = 0; i < arraysize(thread_handles); ++i) { 350 for (size_t i = 0; i < arraysize(thread_handles); ++i) {
351 HANDLE pipe; 351 HANDLE pipe;
352 if (first_pipe_instance_.is_valid()) { 352 if (first_pipe_instance_.is_valid()) {
353 pipe = first_pipe_instance_.release(); 353 pipe = first_pipe_instance_.release();
354 } else { 354 } else {
355 pipe = CreateNamedPipeInstance(pipe_name_, i == 0); 355 pipe = CreateNamedPipeInstance(pipe_name_, i == 0);
356 PCHECK(pipe != INVALID_HANDLE_VALUE) << "CreateNamedPipe"; 356 PCHECK(pipe != INVALID_HANDLE_VALUE) << "CreateNamedPipe";
357 } 357 }
358 358
359 // Ownership of this object (and the pipe instance) is given to the new 359 // Ownership of this object (and the pipe instance) is given to the new
360 // thread. We close the thread handles at the end of the scope. They clean 360 // thread. We close the thread handles at the end of the scope. They clean
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 // process handle can be signalled *before* the dump request is signalled. 392 // process handle can be signalled *before* the dump request is signalled.
393 internal::ClientData* client = reinterpret_cast<internal::ClientData*>(key); 393 internal::ClientData* client = reinterpret_cast<internal::ClientData*>(key);
394 base::AutoLock lock(clients_lock_); 394 base::AutoLock lock(clients_lock_);
395 clients_.erase(client); 395 clients_.erase(client);
396 delete client; 396 delete client;
397 if (!persistent_ && clients_.empty()) 397 if (!persistent_ && clients_.empty())
398 break; 398 break;
399 } 399 }
400 400
401 // Signal to the named pipe instances that they should terminate. 401 // Signal to the named pipe instances that they should terminate.
402 for (int i = 0; i < arraysize(thread_handles); ++i) { 402 for (size_t i = 0; i < arraysize(thread_handles); ++i) {
403 ClientToServerMessage message; 403 ClientToServerMessage message;
404 memset(&message, 0, sizeof(message)); 404 memset(&message, 0, sizeof(message));
405 message.type = ClientToServerMessage::kShutdown; 405 message.type = ClientToServerMessage::kShutdown;
406 message.shutdown.token = shutdown_token; 406 message.shutdown.token = shutdown_token;
407 ServerToClientMessage response; 407 ServerToClientMessage response;
408 SendToCrashHandlerServer(pipe_name_, 408 SendToCrashHandlerServer(pipe_name_,
409 reinterpret_cast<ClientToServerMessage&>(message), 409 reinterpret_cast<ClientToServerMessage&>(message),
410 &response); 410 &response);
411 } 411 }
412 412
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 void __stdcall ExceptionHandlerServer::OnProcessEnd(void* ctx, BOOLEAN) { 593 void __stdcall ExceptionHandlerServer::OnProcessEnd(void* ctx, BOOLEAN) {
594 // This function is executed on the thread pool. 594 // This function is executed on the thread pool.
595 internal::ClientData* client = reinterpret_cast<internal::ClientData*>(ctx); 595 internal::ClientData* client = reinterpret_cast<internal::ClientData*>(ctx);
596 base::AutoLock lock(*client->lock()); 596 base::AutoLock lock(*client->lock());
597 597
598 // Post back to the main thread to have it delete this client record. 598 // Post back to the main thread to have it delete this client record.
599 PostQueuedCompletionStatus(client->port(), 0, ULONG_PTR(client), nullptr); 599 PostQueuedCompletionStatus(client->port(), 0, ULONG_PTR(client), nullptr);
600 } 600 }
601 601
602 } // namespace crashpad 602 } // namespace crashpad
OLDNEW
« snapshot/win/process_reader_win.cc ('K') | « snapshot/win/process_reader_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698