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

Unified Diff: chrome/tools/crash_service/main.cc

Issue 26688006: Move CrashService class to breakpad component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 years, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/tools/crash_service/main.cc
diff --git a/chrome/tools/crash_service/main.cc b/chrome/tools/crash_service/main.cc
index c4889c71e978d5e8343233b3a55e677fc5b9eaed..a06599367ccf0ea1121d98310112a137dae60a0e 100644
--- a/chrome/tools/crash_service/main.cc
+++ b/chrome/tools/crash_service/main.cc
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/tools/crash_service/crash_service.h"
-
#include <windows.h>
#include <stdlib.h>
#include <tchar.h>
@@ -12,6 +10,10 @@
#include "base/command_line.h"
#include "base/file_util.h"
#include "base/logging.h"
+#include "base/path_service.h"
+#include "chrome/common/chrome_constants.h"
+#include "chrome/common/chrome_paths.h"
+#include "components/breakpad/tools/crash_service.h"
namespace {
@@ -39,6 +41,8 @@ int __stdcall wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd_line,
CommandLine::Init(0, NULL);
+ chrome::RegisterPathProvider();
+
// We use/create a directory under the user's temp folder, for logging.
base::FilePath operating_dir;
GetCrashServiceDirectory(&operating_dir);
@@ -55,8 +59,24 @@ int __stdcall wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd_line,
VLOG(1) << "session start. cmdline is [" << cmd_line << "]";
- CrashService crash_service(operating_dir.value());
- if (!crash_service.Initialize(::GetCommandLineW()))
+ // The dumps path is typically : '<user profile>\Local settings\
Robert Sesek 2013/10/17 13:16:05 Does path case matter in windows? I think it's |Lo
jochen (gone - plz use gerrit) 2013/10/17 16:47:39 Done.
+ // Application data\Goggle\Chrome\Crash Reports' and the report path is
+ // Application data\Google\Chrome\Reported Crashes.txt
+ base::FilePath user_data_dir;
+ if (!PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) {
+ LOG(ERROR) << "could not get DIR_USER_DATA";
+ return false;
+ }
+ base::FilePath report_path = user_data_dir.Append(chrome::kCrashReportLog);
+
+ base::FilePath dumps_path;
+ if (!PathService::Get(chrome::DIR_CRASH_DUMPS, &dumps_path)) {
+ LOG(ERROR) << "could not get DIR_CRASH_DUMPS";
+ return 1;
+ }
+
+ breakpad::CrashService crash_service;
+ if (!crash_service.Initialize(operating_dir, report_path, dumps_path))
return 1;
VLOG(1) << "ready to process crash requests";

Powered by Google App Engine
This is Rietveld 408576698