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

Unified Diff: chrome/tools/crash_service/caps/main_win.cc

Issue 1921973006: Revert of Remove CAPS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/caps/main_win.cc
diff --git a/chrome/tools/crash_service/caps/main_win.cc b/chrome/tools/crash_service/caps/main_win.cc
new file mode 100644
index 0000000000000000000000000000000000000000..61461652a1054b35aa320c3b24335188702da8e2
--- /dev/null
+++ b/chrome/tools/crash_service/caps/main_win.cc
@@ -0,0 +1,36 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <windows.h>
+
+#include "base/at_exit.h"
+#include "base/files/file_path.h"
+#include "base/path_service.h"
+#include "base/version.h"
+#include "chrome/tools/crash_service/caps/exit_codes.h"
+#include "chrome/tools/crash_service/caps/logger_win.h"
+#include "chrome/tools/crash_service/caps/process_singleton_win.h"
+
+int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev, wchar_t*, int) {
+ base::AtExitManager at_exit_manager;
+ base::FilePath dir_exe;
+ if (!PathService::Get(base::DIR_EXE, &dir_exe))
+ return caps::EC_INIT_ERROR;
+
+ // What directory we write depends if we are being run from the actual
+ // location (a versioned directory) or from a build output directory.
+ base::Version version(dir_exe.BaseName().MaybeAsASCII());
+ auto data_path = version.IsValid() ? dir_exe.DirName() : dir_exe;
+
+ // Start logging.
+ caps::Logger logger(data_path);
+
+ // Check for an existing running instance.
+ caps::ProcessSingleton process_singleton;
+ if (process_singleton.other_instance())
+ return caps::EC_EXISTING_INSTANCE;
+
+ return caps::EC_NORMAL_EXIT;
+}
+
« no previous file with comments | « chrome/tools/crash_service/caps/logger_win.cc ('k') | chrome/tools/crash_service/caps/process_singleton_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698