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

Side by Side Diff: chrome/tools/crash_service/caps/main_win.cc

Issue 890213002: Add basic support for CAPS exe (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cast Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <windows.h> 5 #include <windows.h>
6 6
7 #include "base/at_exit.h"
8 #include "base/files/file_path.h"
9 #include "base/path_service.h"
10 #include "base/version.h"
11 #include "chrome/tools/crash_service/caps/exit_codes.h"
12 #include "chrome/tools/crash_service/caps/logger_win.h"
13 #include "chrome/tools/crash_service/caps/process_singleton_win.h"
14
7 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev, wchar_t*, int) { 15 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev, wchar_t*, int) {
8 return 0; 16 base::AtExitManager at_exit_manager;
17 base::FilePath dir_exe;
18 if (!PathService::Get(base::DIR_EXE, &dir_exe))
19 return caps::EC_INIT_ERROR;
20
21 // What directory we write depends if we are being run from the actual
22 // location (a versioned directory) or from a build output directory.
23 base::Version version(dir_exe.BaseName().MaybeAsASCII());
24 auto data_path = version.IsValid() ? dir_exe.DirName() : dir_exe;
25
26 // Start logging.
27 caps::Logger logger(data_path);
28
29 // Check for an existing running instance.
30 caps::ProcessSingleton process_singleton;
31 if (process_singleton.other_instance())
32 return caps::EC_EXISTING_INSTANCE;
33
34 return caps::EC_NORMAL_EXIT;
9 } 35 }
36
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698