| OLD | NEW |
| 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/setup/me2me_native_messaging_host_main.h" | 5 #include "remoting/host/setup/me2me_native_messaging_host_main.h" |
| 6 | 6 |
| 7 #include <cstdint> | 7 #include <cstdint> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #if defined(OS_MACOSX) | 37 #if defined(OS_MACOSX) |
| 38 #include "base/mac/scoped_nsautorelease_pool.h" | 38 #include "base/mac/scoped_nsautorelease_pool.h" |
| 39 #endif // defined(OS_MACOSX) | 39 #endif // defined(OS_MACOSX) |
| 40 | 40 |
| 41 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
| 42 #include "base/win/registry.h" | 42 #include "base/win/registry.h" |
| 43 #include "remoting/host/pairing_registry_delegate_win.h" | 43 #include "remoting/host/pairing_registry_delegate_win.h" |
| 44 #include "remoting/host/win/elevation_helpers.h" | 44 #include "remoting/host/win/elevation_helpers.h" |
| 45 #endif // defined(OS_WIN) | 45 #endif // defined(OS_WIN) |
| 46 | 46 |
| 47 #if defined(OS_LINUX) | 47 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 48 #include <glib-object.h> | 48 #include <glib-object.h> |
| 49 #endif // defined(OS_LINUX) | 49 #endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 50 | 50 |
| 51 using remoting::protocol::PairingRegistry; | 51 using remoting::protocol::PairingRegistry; |
| 52 | 52 |
| 53 namespace remoting { | 53 namespace remoting { |
| 54 | 54 |
| 55 int Me2MeNativeMessagingHostMain(int argc, char** argv) { | 55 int Me2MeNativeMessagingHostMain(int argc, char** argv) { |
| 56 // This object instance is required by Chrome code (such as MessageLoop). | 56 // This object instance is required by Chrome code (such as MessageLoop). |
| 57 base::AtExitManager exit_manager; | 57 base::AtExitManager exit_manager; |
| 58 | 58 |
| 59 base::CommandLine::Init(argc, argv); | 59 base::CommandLine::Init(argc, argv); |
| 60 remoting::InitHostLogging(); | 60 remoting::InitHostLogging(); |
| 61 | 61 |
| 62 #if defined(OS_MACOSX) | 62 #if defined(OS_MACOSX) |
| 63 // Needed so we don't leak objects when threads are created. | 63 // Needed so we don't leak objects when threads are created. |
| 64 base::mac::ScopedNSAutoreleasePool pool; | 64 base::mac::ScopedNSAutoreleasePool pool; |
| 65 #endif // defined(OS_MACOSX) | 65 #endif // defined(OS_MACOSX) |
| 66 | 66 |
| 67 #if defined(OS_LINUX) | 67 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 68 // g_type_init will be deprecated in 2.36. 2.35 is the development | 68 // g_type_init will be deprecated in 2.36. 2.35 is the development |
| 69 // version for 2.36, hence do not call g_type_init starting 2.35. | 69 // version for 2.36, hence do not call g_type_init starting 2.35. |
| 70 // http://developer.gnome.org/gobject/unstable/gobject-Type-Information.html#g-t
ype-init | 70 // http://developer.gnome.org/gobject/unstable/gobject-Type-Information.html#g-t
ype-init |
| 71 #if !GLIB_CHECK_VERSION(2, 35, 0) | 71 #if !GLIB_CHECK_VERSION(2, 35, 0) |
| 72 g_type_init(); | 72 g_type_init(); |
| 73 #endif | 73 #endif |
| 74 #endif // defined(OS_LINUX) | 74 #endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 75 | 75 |
| 76 // Required to find the ICU data file, used by some file_util routines. | 76 // Required to find the ICU data file, used by some file_util routines. |
| 77 base::i18n::InitializeICU(); | 77 base::i18n::InitializeICU(); |
| 78 | 78 |
| 79 #if defined(REMOTING_ENABLE_BREAKPAD) | 79 #if defined(REMOTING_ENABLE_BREAKPAD) |
| 80 // Initialize Breakpad as early as possible. On Mac the command-line needs to | 80 // Initialize Breakpad as early as possible. On Mac the command-line needs to |
| 81 // be initialized first, so that the preference for crash-reporting can be | 81 // be initialized first, so that the preference for crash-reporting can be |
| 82 // looked up in the config file. | 82 // looked up in the config file. |
| 83 if (IsUsageStatsAllowed()) { | 83 if (IsUsageStatsAllowed()) { |
| 84 InitializeCrashReporting(); | 84 InitializeCrashReporting(); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 // Run the loop until channel is alive. | 267 // Run the loop until channel is alive. |
| 268 run_loop.Run(); | 268 run_loop.Run(); |
| 269 | 269 |
| 270 // Block until tasks blocking shutdown have completed their execution. | 270 // Block until tasks blocking shutdown have completed their execution. |
| 271 base::TaskScheduler::GetInstance()->Shutdown(); | 271 base::TaskScheduler::GetInstance()->Shutdown(); |
| 272 | 272 |
| 273 return kSuccessExitCode; | 273 return kSuccessExitCode; |
| 274 } | 274 } |
| 275 | 275 |
| 276 } // namespace remoting | 276 } // namespace remoting |
| OLD | NEW |