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

Side by Side Diff: components/crash/app/breakpad_win.cc

Issue 689063002: Cleanup: Replace base::ASCIIToWide with base::ASCIIToUTF16. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, fix typo Created 6 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 unified diff | Download patch
« no previous file with comments | « apps/launcher.cc ('k') | components/policy/core/common/policy_loader_win_unittest.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/crash/app/breakpad_win.h" 5 #include "components/crash/app/breakpad_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <shellapi.h> 8 #include <shellapi.h>
9 #include <tchar.h> 9 #include <tchar.h>
10 #include <userenv.h> 10 #include <userenv.h>
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 } 501 }
502 502
503 void InitCrashReporter(const std::string& process_type_switch) { 503 void InitCrashReporter(const std::string& process_type_switch) {
504 const CommandLine& command = *CommandLine::ForCurrentProcess(); 504 const CommandLine& command = *CommandLine::ForCurrentProcess();
505 if (command.HasSwitch(switches::kDisableBreakpad)) 505 if (command.HasSwitch(switches::kDisableBreakpad))
506 return; 506 return;
507 507
508 // Disable the message box for assertions. 508 // Disable the message box for assertions.
509 _CrtSetReportMode(_CRT_ASSERT, 0); 509 _CrtSetReportMode(_CRT_ASSERT, 0);
510 510
511 std::wstring process_type = base::ASCIIToWide(process_type_switch); 511 base::string16 process_type = base::ASCIIToUTF16(process_type_switch);
512 if (process_type.empty()) 512 if (process_type.empty())
513 process_type = L"browser"; 513 process_type = L"browser";
514 514
515 wchar_t exe_path[MAX_PATH]; 515 wchar_t exe_path[MAX_PATH];
516 exe_path[0] = 0; 516 exe_path[0] = 0;
517 GetModuleFileNameW(NULL, exe_path, MAX_PATH); 517 GetModuleFileNameW(NULL, exe_path, MAX_PATH);
518 518
519 bool is_per_user_install = 519 bool is_per_user_install =
520 GetCrashReporterClient()->GetIsPerUserInstall(base::FilePath(exe_path)); 520 GetCrashReporterClient()->GetIsPerUserInstall(base::FilePath(exe_path));
521 521
(...skipping 26 matching lines...) Expand all
548 std::string pipe_name_ascii; 548 std::string pipe_name_ascii;
549 if (!env->GetVar(kPipeNameVar, &pipe_name_ascii)) { 549 if (!env->GetVar(kPipeNameVar, &pipe_name_ascii)) {
550 // Breakpad is not enabled. Configuration is managed or the user 550 // Breakpad is not enabled. Configuration is managed or the user
551 // did not allow Google Update to send crashes. We need to use 551 // did not allow Google Update to send crashes. We need to use
552 // our default crash handler instead, but only for the 552 // our default crash handler instead, but only for the
553 // browser/service processes. 553 // browser/service processes.
554 if (default_filter) 554 if (default_filter)
555 InitDefaultCrashCallback(default_filter); 555 InitDefaultCrashCallback(default_filter);
556 return; 556 return;
557 } 557 }
558 std::wstring pipe_name = base::ASCIIToWide(pipe_name_ascii); 558 base::string16 pipe_name = base::ASCIIToUTF16(pipe_name_ascii);
559 559
560 #ifdef _WIN64 560 #ifdef _WIN64
561 // The protocol for connecting to the out-of-process Breakpad crash 561 // The protocol for connecting to the out-of-process Breakpad crash
562 // reporter is different for x86-32 and x86-64: the message sizes 562 // reporter is different for x86-32 and x86-64: the message sizes
563 // are different because the message struct contains a pointer. As 563 // are different because the message struct contains a pointer. As
564 // a result, there are two different named pipes to connect to. The 564 // a result, there are two different named pipes to connect to. The
565 // 64-bit one is distinguished with an "-x64" suffix. 565 // 64-bit one is distinguished with an "-x64" suffix.
566 pipe_name += L"-x64"; 566 pipe_name += L"-x64";
567 #endif 567 #endif
568 568
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 extern "C" void __declspec(dllexport) __cdecl 690 extern "C" void __declspec(dllexport) __cdecl
691 UnregisterNonABICompliantCodeRange(void* start) { 691 UnregisterNonABICompliantCodeRange(void* start) {
692 ExceptionHandlerRecord* record = 692 ExceptionHandlerRecord* record =
693 reinterpret_cast<ExceptionHandlerRecord*>(start); 693 reinterpret_cast<ExceptionHandlerRecord*>(start);
694 694
695 CHECK(RtlDeleteFunctionTable(&record->runtime_function)); 695 CHECK(RtlDeleteFunctionTable(&record->runtime_function));
696 } 696 }
697 #endif 697 #endif
698 698
699 } // namespace breakpad 699 } // namespace breakpad
OLDNEW
« no previous file with comments | « apps/launcher.cc ('k') | components/policy/core/common/policy_loader_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698