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

Side by Side Diff: chrome/chrome_watcher/chrome_watcher_main.cc

Issue 2491463002: Revert of Windows install_static refactor. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « chrome/chrome_watcher/DEPS ('k') | chrome/chrome_watcher/chrome_watcher_main_api.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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 #include <sddl.h> 6 #include <sddl.h>
7 7
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/at_exit.h" 10 #include "base/at_exit.h"
(...skipping 15 matching lines...) Expand all
26 #include "base/strings/string_number_conversions.h" 26 #include "base/strings/string_number_conversions.h"
27 #include "base/strings/string_piece.h" 27 #include "base/strings/string_piece.h"
28 #include "base/strings/utf_string_conversions.h" 28 #include "base/strings/utf_string_conversions.h"
29 #include "base/synchronization/waitable_event.h" 29 #include "base/synchronization/waitable_event.h"
30 #include "base/threading/platform_thread.h" 30 #include "base/threading/platform_thread.h"
31 #include "base/threading/thread.h" 31 #include "base/threading/thread.h"
32 #include "base/threading/thread_task_runner_handle.h" 32 #include "base/threading/thread_task_runner_handle.h"
33 #include "base/time/time.h" 33 #include "base/time/time.h"
34 #include "base/win/scoped_handle.h" 34 #include "base/win/scoped_handle.h"
35 #include "base/win/win_util.h" 35 #include "base/win/win_util.h"
36
36 #include "chrome/chrome_watcher/chrome_watcher_main_api.h" 37 #include "chrome/chrome_watcher/chrome_watcher_main_api.h"
37 #include "chrome/common/chrome_constants.h" 38 #include "chrome/installer/util/util_constants.h"
38 #include "chrome/install_static/install_details.h"
39 #include "components/browser_watcher/endsession_watcher_window_win.h" 39 #include "components/browser_watcher/endsession_watcher_window_win.h"
40 #include "components/browser_watcher/exit_code_watcher_win.h" 40 #include "components/browser_watcher/exit_code_watcher_win.h"
41 #include "components/browser_watcher/window_hang_monitor_win.h" 41 #include "components/browser_watcher/window_hang_monitor_win.h"
42 42
43 namespace { 43 namespace {
44 44
45 // Use the same log facility as Chrome for convenience. 45 // Use the same log facility as Chrome for convenience.
46 // {7FE69228-633E-4f06-80C1-527FEA23E3A7} 46 // {7FE69228-633E-4f06-80C1-527FEA23E3A7}
47 const GUID kChromeWatcherTraceProviderName = { 47 const GUID kChromeWatcherTraceProviderName = {
48 0x7fe69228, 0x633e, 0x4f06, 48 0x7fe69228, 0x633e, 0x4f06,
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 } 180 }
181 181
182 } // namespace 182 } // namespace
183 183
184 // The main entry point to the watcher, declared as extern "C" to avoid name 184 // The main entry point to the watcher, declared as extern "C" to avoid name
185 // mangling. 185 // mangling.
186 extern "C" int WatcherMain(const base::char16* registry_path, 186 extern "C" int WatcherMain(const base::char16* registry_path,
187 HANDLE process_handle, 187 HANDLE process_handle,
188 DWORD main_thread_id, 188 DWORD main_thread_id,
189 HANDLE on_initialized_event_handle, 189 HANDLE on_initialized_event_handle,
190 const base::char16* browser_data_directory) { 190 const base::char16* browser_data_directory,
191 install_static::InstallDetails::InitializeFromPrimaryModule( 191 const base::char16* channel_name) {
192 chrome::kChromeElfDllName);
193 base::Process process(process_handle); 192 base::Process process(process_handle);
194 base::win::ScopedHandle on_initialized_event(on_initialized_event_handle); 193 base::win::ScopedHandle on_initialized_event(on_initialized_event_handle);
195 194
196 // The exit manager is in charge of calling the dtors of singletons. 195 // The exit manager is in charge of calling the dtors of singletons.
197 base::AtExitManager exit_manager; 196 base::AtExitManager exit_manager;
198 // Initialize the commandline singleton from the environment. 197 // Initialize the commandline singleton from the environment.
199 base::CommandLine::Init(0, nullptr); 198 base::CommandLine::Init(0, nullptr);
200 199
201 logging::LogEventProvider::Initialize(kChromeWatcherTraceProviderName); 200 logging::LogEventProvider::Initialize(kChromeWatcherTraceProviderName);
202 201
(...skipping 16 matching lines...) Expand all
219 218
220 // Wind logging down. 219 // Wind logging down.
221 logging::LogEventProvider::Uninitialize(); 220 logging::LogEventProvider::Uninitialize();
222 221
223 return 0; 222 return 0;
224 } 223 }
225 224
226 static_assert( 225 static_assert(
227 std::is_same<decltype(&WatcherMain), ChromeWatcherMainFunction>::value, 226 std::is_same<decltype(&WatcherMain), ChromeWatcherMainFunction>::value,
228 "WatcherMain() has wrong type"); 227 "WatcherMain() has wrong type");
OLDNEW
« no previous file with comments | « chrome/chrome_watcher/DEPS ('k') | chrome/chrome_watcher/chrome_watcher_main_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698