Home | History | Annotate | Download | only in app
      1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_APP_BREAKPAD_WIN_H_
      6 #define CHROME_APP_BREAKPAD_WIN_H_
      7 
      8 #include <windows.h>
      9 #include <string>
     10 #include <vector>
     11 
     12 namespace google_breakpad {
     13 
     14 struct CustomInfoEntry;
     15 }
     16 
     17 namespace breakpad_win {
     18 
     19 // A pointer to the custom entries that we send in the event of a crash. We need
     20 // this pointer, along with the offsets into it below (and some private ones),
     21 // so that we can keep the data updated as the state of the browser changes.
     22 extern std::vector<google_breakpad::CustomInfoEntry>* g_custom_entries;
     23 
     24 // These two are here because they are needed by breakpad_field_trial_win as
     25 // well as breakpad_unittest_win.
     26 extern size_t g_num_of_experiments_offset;
     27 extern size_t g_experiment_chunks_offset;
     28 
     29 }  // namespace breakpad_win
     30 
     31 // The maximum number of 64-char URL chunks we will report.
     32 static const int kMaxUrlChunks = 8;
     33 
     34 void InitCrashReporter();
     35 
     36 // Intercepts a crash but does not process it, just ask if we want to restart
     37 // the browser or not.
     38 void InitDefaultCrashCallback(LPTOP_LEVEL_EXCEPTION_FILTER filter);
     39 
     40 // If chrome has been restarted because it crashed, this function will display
     41 // a dialog asking for permission to continue execution or to exit now.
     42 bool ShowRestartDialogIfCrashed(bool* exit_now);
     43 
     44 // Helper to convert a vector of wstrings to corresponding vector of cstrings.
     45 // Note that |cstrings| will reference memory owned by |wstrings|. Consequently
     46 // |wstrings| must outlive |cstrings|, and |wstrings| should not be mutated.
     47 void StringVectorToCStringVector(const std::vector<std::wstring>& wstrings,
     48                                  std::vector<const wchar_t*>* cstrings);
     49 
     50 namespace testing {
     51 
     52 // Testing entry point for calling a function from the unnamed namespace.
     53 void InitCustomInfoEntries();
     54 
     55 }
     56 
     57 #endif  // CHROME_APP_BREAKPAD_WIN_H_
     58