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

Side by Side Diff: remoting/host/it2me/it2me_native_messaging_host_main.cc

Issue 1458323002: Simplify It2Me host shutdown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "remoting/host/it2me/it2me_native_messaging_host_main.h" 5 #include "remoting/host/it2me/it2me_native_messaging_host_main.h"
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/i18n/icu_util.h" 9 #include "base/i18n/icu_util.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "base/run_loop.h" 11 #include "base/run_loop.h"
12 #include "net/socket/ssl_server_socket.h" 12 #include "net/socket/ssl_server_socket.h"
13 #include "remoting/base/breakpad.h" 13 #include "remoting/base/breakpad.h"
14 #include "remoting/host/chromoting_host_context.h" 14 #include "remoting/host/chromoting_host_context.h"
15 #include "remoting/host/host_exit_codes.h" 15 #include "remoting/host/host_exit_codes.h"
16 #include "remoting/host/it2me/it2me_native_messaging_host.h" 16 #include "remoting/host/it2me/it2me_native_messaging_host.h"
17 #include "remoting/host/logging.h" 17 #include "remoting/host/logging.h"
18 #include "remoting/host/native_messaging/native_messaging_pipe.h" 18 #include "remoting/host/native_messaging/native_messaging_pipe.h"
19 #include "remoting/host/native_messaging/pipe_messaging_channel.h" 19 #include "remoting/host/native_messaging/pipe_messaging_channel.h"
20 #include "remoting/host/resources.h" 20 #include "remoting/host/resources.h"
21 #include "remoting/host/usage_stats_consent.h" 21 #include "remoting/host/usage_stats_consent.h"
22 22
23 #if defined(OS_LINUX) 23 #if defined(OS_LINUX)
24 #include <gtk/gtk.h> 24 #include <gtk/gtk.h>
25 #include <X11/Xlib.h> 25 #include <X11/Xlib.h>
26
27 #include "base/linux_util.h"
26 #endif // defined(OS_LINUX) 28 #endif // defined(OS_LINUX)
27 29
28 #if defined(OS_MACOSX) 30 #if defined(OS_MACOSX)
29 #include "base/mac/scoped_nsautorelease_pool.h" 31 #include "base/mac/scoped_nsautorelease_pool.h"
30 #endif // defined(OS_MACOSX) 32 #endif // defined(OS_MACOSX)
31 33
32 #if defined(OS_WIN) 34 #if defined(OS_WIN)
33 #include <commctrl.h> 35 #include <commctrl.h>
34 #endif // defined(OS_WIN) 36 #endif // defined(OS_WIN)
35 37
(...skipping 30 matching lines...) Expand all
66 remoting::LoadResources(""); 68 remoting::LoadResources("");
67 69
68 #if defined(OS_LINUX) 70 #if defined(OS_LINUX)
69 // Required in order for us to run multiple X11 threads. 71 // Required in order for us to run multiple X11 threads.
70 XInitThreads(); 72 XInitThreads();
71 73
72 // Required for any calls into GTK functions, such as the Disconnect and 74 // Required for any calls into GTK functions, such as the Disconnect and
73 // Continue windows. Calling with nullptr arguments because we don't have 75 // Continue windows. Calling with nullptr arguments because we don't have
74 // any command line arguments for gtk to consume. 76 // any command line arguments for gtk to consume.
75 gtk_init(nullptr, nullptr); 77 gtk_init(nullptr, nullptr);
78
79 // Need to prime the host OS version value for linux to prevent IO on the
80 // network thread. base::GetLinuxDistro() caches the result.
81 base::GetLinuxDistro();
76 #endif // OS_LINUX 82 #endif // OS_LINUX
77 83
78 // Enable support for SSL server sockets, which must be done while still 84 // Enable support for SSL server sockets, which must be done while still
79 // single-threaded. 85 // single-threaded.
80 net::EnableSSLServerSockets(); 86 net::EnableSSLServerSockets();
81 87
82 #if defined(OS_WIN) 88 #if defined(OS_WIN)
83 // GetStdHandle() returns pseudo-handles for stdin and stdout even if 89 // GetStdHandle() returns pseudo-handles for stdin and stdout even if
84 // the hosting executable specifies "Windows" subsystem. However the returned 90 // the hosting executable specifies "Windows" subsystem. However the returned
85 // handles are invalid in that case unless standard input and output are 91 // handles are invalid in that case unless standard input and output are
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 // This object instance is required by Chrome code (such as MessageLoop). 143 // This object instance is required by Chrome code (such as MessageLoop).
138 base::AtExitManager exit_manager; 144 base::AtExitManager exit_manager;
139 145
140 base::CommandLine::Init(argc, argv); 146 base::CommandLine::Init(argc, argv);
141 remoting::InitHostLogging(); 147 remoting::InitHostLogging();
142 148
143 return StartIt2MeNativeMessagingHost(); 149 return StartIt2MeNativeMessagingHost();
144 } 150 }
145 151
146 } // namespace remoting 152 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/it2me/it2me_native_messaging_host.cc ('k') | remoting/host/it2me/it2me_native_messaging_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698