summaryrefslogtreecommitdiffstats
path: root/chrome/browser/crash_upload_list.h
diff options
context:
space:
mode:
authorasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-01 15:58:50 +0000
committerasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-01 15:58:50 +0000
commitb35b1dd3737b7d6bc9aeca0666772c9a9aded78a (patch)
treee70a28ade2edaaba53060a2f352a452466ca5f12 /chrome/browser/crash_upload_list.h
parent6e1272138cd494e23c6e350fbd6041ead147bf5b (diff)
downloadchromium_src-b35b1dd3737b7d6bc9aeca0666772c9a9aded78a.zip
chromium_src-b35b1dd3737b7d6bc9aeca0666772c9a9aded78a.tar.gz
chromium_src-b35b1dd3737b7d6bc9aeca0666772c9a9aded78a.tar.bz2
Implement CrashUploadListWin to enable chrome://crashes on Windows.
Added new class CrashUploadListWin, subclass of CrashUploadList which has the Windows platform-specific logic to read crash logs from Windows Event Log. Added static CrashUploadList::Create() factory method which returns an instance of CrashUploadListWin on Windows and an instance of CrashUploadList on other platforms. Also implemented the max_count parameter in CrashUploadList::GetUploadedCrashes(), which was part of the interface but was ignored by the code. BUG=73468 TEST=Open chrome://crashes under Windows after one or more crash reports were uploaded. See the crash reports listed. Review URL: http://codereview.chromium.org/6771021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80165 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/crash_upload_list.h')
-rw-r--r--chrome/browser/crash_upload_list.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/chrome/browser/crash_upload_list.h b/chrome/browser/crash_upload_list.h
index 9d5d243..c8b30d1 100644
--- a/chrome/browser/crash_upload_list.h
+++ b/chrome/browser/crash_upload_list.h
@@ -32,6 +32,10 @@ class CrashUploadList : public base::RefCountedThreadSafe<CrashUploadList> {
virtual ~Delegate() {}
};
+ // Static factory method that creates the platform-specific implementation
+ // of the crash upload list with the given callback delegate.
+ static CrashUploadList* Create(Delegate* delegate);
+
// Creates a new crash upload list with the given callback delegate.
explicit CrashUploadList(Delegate* delegate);
@@ -49,17 +53,28 @@ class CrashUploadList : public base::RefCountedThreadSafe<CrashUploadList> {
void GetUploadedCrashes(unsigned int max_count,
std::vector<CrashInfo>* crashes);
+ protected:
+ virtual ~CrashUploadList();
+
+ // Reads the upload log and stores the entries in crashes_.
+ virtual void LoadCrashList();
+
+ // Returns a reference to the list of crashes.
+ std::vector<CrashInfo>& crashes();
+
private:
friend class base::RefCountedThreadSafe<CrashUploadList>;
- virtual ~CrashUploadList();
- // Reads the upload log and stores the lines in log_entries_.
- void LoadUploadLog();
+ // Manages the background thread work for LoadCrashListAsynchronously().
+ void LoadCrashListAndInformDelegateOfCompletion();
// Calls the delegate's callback method, if there is a delegate.
void InformDelegateOfCompletion();
- std::vector<std::string> log_entries_;
+ // Parses crash log lines, converting them to CrashInfo entries.
+ void ParseLogEntries(const std::vector<std::string>& log_entries);
+
+ std::vector<CrashInfo> crashes_;
Delegate* delegate_;
DISALLOW_COPY_AND_ASSIGN(CrashUploadList);