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

Unified Diff: remoting/host/setup/me2me_native_messaging_host_main.cc

Issue 186763004: Add breakpad support for me2me and it2me native messaging host on Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Linux build break in Official Chrome build. Created 6 years, 9 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: remoting/host/setup/me2me_native_messaging_host_main.cc
diff --git a/remoting/host/setup/me2me_native_messaging_host_main.cc b/remoting/host/setup/me2me_native_messaging_host_main.cc
index 59f198b61f9d941ee21d16ae82a82bfb9194bc8b..5e0e0e26b08734fc3b08aa8d1cf7fbaa33a10ecb 100644
--- a/remoting/host/setup/me2me_native_messaging_host_main.cc
+++ b/remoting/host/setup/me2me_native_messaging_host_main.cc
@@ -10,10 +10,16 @@
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "net/url_request/url_fetcher.h"
+#include "remoting/base/breakpad.h"
#include "remoting/host/host_exit_codes.h"
#include "remoting/host/logging.h"
#include "remoting/host/pairing_registry_delegate.h"
#include "remoting/host/setup/me2me_native_messaging_host.h"
+#include "remoting/host/usage_stats_consent.h"
+
+#if defined(OS_MACOSX)
+#include "base/mac/scoped_nsautorelease_pool.h"
+#endif // defined(OS_MACOSX)
#if defined(OS_WIN)
#include "base/win/registry.h"
@@ -54,6 +60,20 @@ bool IsProcessElevated() {
#endif // defined(OS_WIN)
int StartMe2MeNativeMessagingHost() {
+#if defined(OS_MACOSX)
+ // Needed so we don't leak objects when threads are created.
+ base::mac::ScopedNSAutoreleasePool pool;
+#endif // defined(OS_MACOSX)
+
+#if defined(REMOTING_ENABLE_BREAKPAD)
+ // Initialize Breakpad as early as possible. On Mac the command-line needs to
+ // be initialized first, so that the preference for crash-reporting can be
+ // looked up in the config file.
+ if (IsUsageStatsAllowed()) {
+ InitializeCrashReporting();
+ }
+#endif // defined(REMOTING_ENABLE_BREAKPAD)
+
// Mac OS X requires that the main thread be a UI message loop in order to
// receive distributed notifications from the System Preferences pane. An
// IO thread is needed for the pairing registry and URL context getter.

Powered by Google App Engine
This is Rietveld 408576698