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

Side by Side Diff: chrome/app/breakpad_win.cc

Issue 6697004: Add an exception wrapper to the WindowProc functions so... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/app/breakpad_win.h" 5 #include "chrome/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 10
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 // If the UI layout is right-to-left, we need to pass the appropriate MB_XXX 431 // If the UI layout is right-to-left, we need to pass the appropriate MB_XXX
432 // flags so that an RTL message box is displayed. 432 // flags so that an RTL message box is displayed.
433 UINT flags = MB_OKCANCEL | MB_ICONWARNING; 433 UINT flags = MB_OKCANCEL | MB_ICONWARNING;
434 if (dlg_strings[2] == ASCIIToWide(env_vars::kRtlLocale)) 434 if (dlg_strings[2] == ASCIIToWide(env_vars::kRtlLocale))
435 flags |= MB_RIGHT | MB_RTLREADING; 435 flags |= MB_RIGHT | MB_RTLREADING;
436 436
437 return WrapMessageBoxWithSEH(dlg_strings[1].c_str(), dlg_strings[0].c_str(), 437 return WrapMessageBoxWithSEH(dlg_strings[1].c_str(), dlg_strings[0].c_str(),
438 flags, exit_now); 438 flags, exit_now);
439 } 439 }
440 440
441 // Crashes the process after generating a dump for the provided exception. Note
442 // that the crash reporter should be initialized before calling this function
443 // for it to do anything.
cpu_(ooo_6.6-7.5) 2011/03/16 00:09:22 should it be: __declspec(dllexport) int __cdecl Cr
rvargas (doing something else) 2011/03/16 00:25:07 Extern "C" is fine. On 2011/03/16 00:09:22, cpu w
444 extern "C" int __declspec(dllexport) CrashForException(
445 EXCEPTION_POINTERS* info) {
446 if (g_breakpad) {
447 g_breakpad->WriteMinidumpForException(info);
448 ::ExitProcess(ResultCodes::KILLED);
449 }
450 return EXCEPTION_CONTINUE_SEARCH;
451 }
452
441 // Determine whether configuration management allows loading the crash reporter. 453 // Determine whether configuration management allows loading the crash reporter.
442 // Since the configuration management infrastructure is not initialized at this 454 // Since the configuration management infrastructure is not initialized at this
443 // point, we read the corresponding registry key directly. The return status 455 // point, we read the corresponding registry key directly. The return status
444 // indicates whether policy data was successfully read. If it is true, |result| 456 // indicates whether policy data was successfully read. If it is true, |result|
445 // contains the value set by policy. 457 // contains the value set by policy.
446 static bool MetricsReportingControlledByPolicy(bool* result) { 458 static bool MetricsReportingControlledByPolicy(bool* result) {
447 std::wstring key_name = UTF8ToWide(policy::key::kMetricsReportingEnabled); 459 std::wstring key_name = UTF8ToWide(policy::key::kMetricsReportingEnabled);
448 DWORD value = 0; 460 DWORD value = 0;
449 // TODO(joshia): why hkcu_policy_key opens HKEY_LOCAL_MACHINE? 461 // TODO(joshia): why hkcu_policy_key opens HKEY_LOCAL_MACHINE?
450 base::win::RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE, 462 base::win::RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE,
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 if (QueueUserWorkItem( 614 if (QueueUserWorkItem(
603 &InitCrashReporterThread, 615 &InitCrashReporterThread,
604 info, 616 info,
605 WT_EXECUTELONGFUNCTION) == 0) { 617 WT_EXECUTELONGFUNCTION) == 0) {
606 // We failed to queue to the worker pool, initialize in this thread. 618 // We failed to queue to the worker pool, initialize in this thread.
607 InitCrashReporterThread(info); 619 InitCrashReporterThread(info);
608 } 620 }
609 } 621 }
610 } 622 }
611 } 623 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698