15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/browser/crash_upload_list.h"
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
72a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/files/file_path.h"
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/path_service.h"
9eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch#include "chrome/common/chrome_paths.h"
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(OS_WIN)
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "chrome/browser/crash_upload_list_win.h"
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
14eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch// static
15eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdochconst char* CrashUploadList::kReporterLogFilename = "uploads.log";
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// static
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)CrashUploadList* CrashUploadList::Create(Delegate* delegate) {
19eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  base::FilePath crash_dir_path;
20eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dir_path);
21eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  base::FilePath upload_log_path =
22eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch      crash_dir_path.AppendASCII(kReporterLogFilename);
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#if defined(OS_WIN)
24eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  return new CrashUploadListWin(delegate, upload_log_path);
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#else
26eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  return new CrashUploadList(delegate, upload_log_path);
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
30eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen MurdochCrashUploadList::CrashUploadList(Delegate* delegate,
31eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch                                 const base::FilePath& upload_log_path)
32a3f7b4e666c476898878fa745f637129375cd889Ben Murdoch    : UploadList(delegate, upload_log_path) {}
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)CrashUploadList::~CrashUploadList() {}
35