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

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

Issue 99523009: Move DumpProcessWithoutCrash to base, so we can use it from net and content (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 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 | Annotate | Revision Log
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/breakpad/app/breakpad_win.h" 5 #include "components/breakpad/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>
11 #include <winnt.h> 11 #include <winnt.h>
12 12
13 #include <algorithm> 13 #include <algorithm>
14 #include <vector> 14 #include <vector>
15 15
16 #include "base/base_switches.h" 16 #include "base/base_switches.h"
17 #include "base/basictypes.h" 17 #include "base/basictypes.h"
18 #include "base/command_line.h" 18 #include "base/command_line.h"
19 #include "base/debug/crash_logging.h" 19 #include "base/debug/crash_logging.h"
20 #include "base/debug/dump_without_crashing.h"
20 #include "base/environment.h" 21 #include "base/environment.h"
21 #include "base/memory/scoped_ptr.h" 22 #include "base/memory/scoped_ptr.h"
22 #include "base/strings/string16.h" 23 #include "base/strings/string16.h"
23 #include "base/strings/string_split.h" 24 #include "base/strings/string_split.h"
24 #include "base/strings/string_util.h" 25 #include "base/strings/string_util.h"
25 #include "base/strings/stringprintf.h" 26 #include "base/strings/stringprintf.h"
26 #include "base/strings/utf_string_conversions.h" 27 #include "base/strings/utf_string_conversions.h"
27 #include "base/win/metro.h" 28 #include "base/win/metro.h"
28 #include "base/win/pe_image.h" 29 #include "base/win/pe_image.h"
29 #include "base/win/registry.h" 30 #include "base/win/registry.h"
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 g_dumphandler_no_crash = new google_breakpad::ExceptionHandler(temp_dir, 739 g_dumphandler_no_crash = new google_breakpad::ExceptionHandler(temp_dir,
739 &FilterCallbackWhenNoCrash, 740 &FilterCallbackWhenNoCrash,
740 &DumpDoneCallbackWhenNoCrash, 741 &DumpDoneCallbackWhenNoCrash,
741 NULL, 742 NULL,
742 // Set the handler to none so this handler would not be added to 743 // Set the handler to none so this handler would not be added to
743 // |handler_stack_| in |ExceptionHandler| which is a list of exception 744 // |handler_stack_| in |ExceptionHandler| which is a list of exception
744 // handlers. 745 // handlers.
745 google_breakpad::ExceptionHandler::HANDLER_NONE, 746 google_breakpad::ExceptionHandler::HANDLER_NONE,
746 dump_type, pipe_name.c_str(), custom_info); 747 dump_type, pipe_name.c_str(), custom_info);
747 748
749 base::debug::SetDumpWithoutCrashingFunction(&DumpProcessWithoutCrash);
750
748 if (g_breakpad->IsOutOfProcess()) { 751 if (g_breakpad->IsOutOfProcess()) {
749 // Tells breakpad to handle breakpoint and single step exceptions. 752 // Tells breakpad to handle breakpoint and single step exceptions.
750 // This might break JIT debuggers, but at least it will always 753 // This might break JIT debuggers, but at least it will always
751 // generate a crashdump for these exceptions. 754 // generate a crashdump for these exceptions.
752 g_breakpad->set_handle_debug_exceptions(true); 755 g_breakpad->set_handle_debug_exceptions(true);
753 756
754 #ifndef _WIN64 757 #ifndef _WIN64
755 if (process_type != L"browser" && 758 if (process_type != L"browser" &&
756 !GetBreakpadClient()->IsRunningUnattended()) { 759 !GetBreakpadClient()->IsRunningUnattended()) {
757 // Initialize the hook TerminateProcess to catch unexpected exits. 760 // Initialize the hook TerminateProcess to catch unexpected exits.
758 InitTerminateProcessHooks(); 761 InitTerminateProcessHooks();
759 } 762 }
760 #endif 763 #endif
761 } 764 }
762 } 765 }
763 766
764 } // namespace breakpad 767 } // namespace breakpad
OLDNEW
« no previous file with comments | « components/breakpad/app/breakpad_mac.mm ('k') | remoting/client/plugin/pepper_plugin_thread_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698