Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 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 IOS_CHROME_BROWSER_CRASH_REPORT_BREAKPAD_HELPER_H_ | |
| 6 #define IOS_CHROME_BROWSER_CRASH_REPORT_BREAKPAD_HELPER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 @class NSString; | |
| 11 | |
| 12 namespace breakpad_helper { | |
| 13 | |
| 14 // Starts the crash handlers. This must be run as soon as possible to catch | |
| 15 // early crashes. | |
| 16 void Start(const std::string& channel_name); | |
| 17 | |
| 18 // Enable/Disable crash handling. | |
|
lpromero
2015/07/08 13:37:15
Enables/Disables. Here and in several methods belo
| |
| 19 void SetEnabled(bool enabled); | |
| 20 | |
| 21 // Enable/Disable uploading crash reports. | |
| 22 void SetUploadingEnabled(bool enabled); | |
| 23 | |
| 24 // Returns true if uploading crash reports is enabled. | |
| 25 bool IsUploadingEnabled(); | |
| 26 | |
| 27 // Cleans up all stored crash reports. | |
| 28 void CleanupCrashReports(); | |
| 29 | |
| 30 // Add a key/value pair the next crash report. If async is false, this function | |
| 31 // will wait until the key is registered before returning. | |
| 32 void AddReportParameter(NSString* key, NSString* value, bool async); | |
| 33 | |
| 34 // Remove the key/value pair associated to key from the next crash report. | |
| 35 void RemoveReportParameter(NSString* key); | |
| 36 | |
| 37 // Returns the number of crash reports waiting to send to the server. This | |
| 38 // function will wait for an operation to complete on a background thread. | |
| 39 int GetCrashReportCount(); | |
| 40 | |
| 41 // Gets the number of crash reports on a background thread and invokes | |
| 42 // |callback| with the result when complete. | |
| 43 void GetCrashReportCount(void (^callback)(int)); | |
| 44 | |
| 45 // Check if there is currently a crash report to upload. This function will wait | |
| 46 // for an operation to complete on a background thread. | |
| 47 bool HasReportToUpload(); | |
| 48 | |
| 49 // Sets a key if |background| is true, unset if false. This will allow tracking | |
| 50 // of crashes that occur when the app is backgrounded. | |
| 51 void SetCurrentlyInBackground(bool background); | |
| 52 | |
| 53 // Sets a key if |signedIn| is true, unset if false. The key indicates that the | |
| 54 // user is signed-in. | |
| 55 void SetCurrentlySignedIn(bool signedIn); | |
| 56 | |
| 57 // Sets a key to indicate the number of memory warnings the application has | |
| 58 // received over its lifetime, or unset the key if the count is zero. | |
| 59 void SetMemoryWarningCount(int count); | |
| 60 | |
| 61 // Sets a key indicating a memory warning is deemed to be in progress (if value | |
| 62 // is 'true'), otherwise remove the key. | |
| 63 void SetMemoryWarningInProgress(bool value); | |
| 64 | |
| 65 // Sets a key indicating the current free memory amount in KB. 0 does not remove | |
| 66 // the key as getting no memory is important information. | |
| 67 void SetCurrentFreeMemoryInKB(int value); | |
| 68 | |
| 69 // Sets a key indicating the current free disk space in KB. 0 does not remove | |
| 70 // the key as getting no free disk space is important information. | |
| 71 void SetCurrentFreeDiskInKB(int value); | |
| 72 | |
| 73 // Sets a key indicating application is using Flywheel Data Reduction Proxy. | |
| 74 void SetDataReductionProxyIsEnabled(bool value); | |
| 75 | |
| 76 // Increases a key indicating the number of PDF tabs opened. If value is TRUE, | |
| 77 // the counter is increased. If value is FALSE, the counter is decreased. If | |
| 78 // counter falls to 0, the entry is removed. This function does not keep | |
| 79 // previous state. If SetCurrentTabIsPDF is called twice with TRUE, the counter | |
| 80 // will be incremented twice. | |
| 81 void SetCurrentTabIsPDF(bool value); | |
| 82 | |
| 83 // Sets a key in browser_state dictionary to store the device orientation. | |
| 84 // Each values is 1 digit: first is the UI orientation from the Foundation | |
| 85 // UIInterfaceOrientation enum (values decimal from 1 to 4) and the second is | |
| 86 // the device orientation with values from the Foundation UIDeviceOrientation | |
| 87 // enum (values decimal from 0 to 7). | |
| 88 void SetCurrentOrientation(int statusBarOrientation, int deviceOrientation); | |
| 89 | |
| 90 // Sets a key in browser to store the playback state of media player (audio or | |
| 91 // video). This function records a new start. This function is called for each | |
| 92 // stream in the media (once or twice for audio, two or three times for video). | |
| 93 void MediaStreamPlaybackDidStart(); | |
| 94 | |
| 95 // Sets a key in browser to store the playback state of media player (audio or | |
| 96 // video). This function records a stop or pause. This function must be called | |
| 97 // the same number of times as MediaStreamPlaybackDidStart. | |
| 98 void MediaStreamPlaybackDidStop(); | |
| 99 | |
| 100 // Informs the crash report helper that crash restoration is about to begin. | |
| 101 void WillStartCrashRestoration(); | |
| 102 | |
| 103 // Starts uploading crash reports. Sets the upload interval to 1 second, and | |
| 104 // sets a key in uploaded reports to allow tracking of reports that are uploaded | |
| 105 // in recovery mode. | |
| 106 void StartUploadingReportsInRecoveryMode(); | |
| 107 | |
| 108 // Resets the Breakpad configuration from the main bundle. | |
| 109 void RestoreDefaultConfiguration(); | |
| 110 | |
| 111 } // namespace breakpad_helper | |
| 112 | |
| 113 #endif // IOS_CHROME_BROWSER_CRASH_REPORT_BREAKPAD_HELPER_H_ | |
| OLD | NEW |