From 374cf948e4a1c7b72e7c4a4805d95eb5c91d0ced Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 13 Nov 2013 17:29:35 +0800 Subject: [PATCH] Make the crash reporter available for both browser and renderer. --- atom.gyp | 12 ++++++------ {browser => common}/api/atom_api_crash_reporter.cc | 6 +++--- {browser => common}/api/atom_api_crash_reporter.h | 6 +++--- common/api/atom_extensions.h | 2 +- {browser => common}/api/lib/crash-reporter.coffee | 0 {browser => common/crash_reporter}/crash_reporter.h | 6 +++--- {browser => common/crash_reporter}/crash_reporter_mac.mm | 2 +- {browser => common/crash_reporter}/crash_reporter_win.cc | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) rename {browser => common}/api/atom_api_crash_reporter.cc (87%) rename {browser => common}/api/atom_api_crash_reporter.h (80%) rename {browser => common}/api/lib/crash-reporter.coffee (100%) rename {browser => common/crash_reporter}/crash_reporter.h (76%) rename {browser => common/crash_reporter}/crash_reporter_mac.mm (98%) rename {browser => common/crash_reporter}/crash_reporter_win.cc (89%) diff --git a/atom.gyp b/atom.gyp index 6ab9b7d..67047a3 100644 --- a/atom.gyp +++ b/atom.gyp @@ -14,7 +14,6 @@ 'browser/api/lib/atom-delegate.coffee', 'browser/api/lib/auto-updater.coffee', 'browser/api/lib/browser-window.coffee', - 'browser/api/lib/crash-reporter.coffee', 'browser/api/lib/dialog.coffee', 'browser/api/lib/ipc.coffee', 'browser/api/lib/menu.coffee', @@ -26,6 +25,7 @@ 'browser/atom/rpc-server.coffee', 'common/api/lib/callbacks-registry.coffee', 'common/api/lib/clipboard.coffee', + 'common/api/lib/crash-reporter.coffee', 'common/api/lib/id-weak-map.coffee', 'common/api/lib/shell.coffee', 'renderer/api/lib/ipc.coffee', @@ -41,8 +41,6 @@ 'browser/api/atom_api_auto_updater.h', 'browser/api/atom_api_browser_ipc.cc', 'browser/api/atom_api_browser_ipc.h', - 'browser/api/atom_api_crash_reporter.h', - 'browser/api/atom_api_crash_reporter.cc', 'browser/api/atom_api_dialog.cc', 'browser/api/atom_api_dialog.h', 'browser/api/atom_api_event.cc', @@ -87,9 +85,6 @@ 'browser/browser_mac.mm', 'browser/browser_win.cc', 'browser/browser_observer.h', - 'browser/crash_reporter.h', - 'browser/crash_reporter_mac.mm', - 'browser/crash_reporter_win.cc', 'browser/native_window.cc', 'browser/native_window.h', 'browser/native_window_mac.h', @@ -132,6 +127,8 @@ 'common/api/api_messages.h', 'common/api/atom_api_clipboard.cc', 'common/api/atom_api_clipboard.h', + 'common/api/atom_api_crash_reporter.cc', + 'common/api/atom_api_crash_reporter.h', 'common/api/atom_api_id_weak_map.cc', 'common/api/atom_api_id_weak_map.h', 'common/api/atom_api_shell.cc', @@ -143,6 +140,9 @@ 'common/api/atom_extensions.h', 'common/api/object_life_monitor.cc', 'common/api/object_life_monitor.h', + 'common/crash_reporter/crash_reporter.h', + 'common/crash_reporter/crash_reporter_mac.mm', + 'common/crash_reporter/crash_reporter_win.cc', 'common/draggable_region.cc', 'common/draggable_region.h', 'common/node_bindings.cc', diff --git a/browser/api/atom_api_crash_reporter.cc b/common/api/atom_api_crash_reporter.cc similarity index 87% rename from browser/api/atom_api_crash_reporter.cc rename to common/api/atom_api_crash_reporter.cc index 1c5d85d..b849f6e 100644 --- a/browser/api/atom_api_crash_reporter.cc +++ b/common/api/atom_api_crash_reporter.cc @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser/api/atom_api_crash_reporter.h" +#include "common/api/atom_api_crash_reporter.h" -#include "browser/crash_reporter.h" +#include "common/crash_reporter/crash_reporter.h" #include "common/v8_conversions.h" #include "vendor/node/src/node.h" #include "vendor/node/src/node_internals.h" @@ -43,4 +43,4 @@ void CrashReporter::Initialize(v8::Handle target) { } // namespace atom -NODE_MODULE(atom_browser_crash_reporter, atom::api::CrashReporter::Initialize) +NODE_MODULE(atom_common_crash_reporter, atom::api::CrashReporter::Initialize) diff --git a/browser/api/atom_api_crash_reporter.h b/common/api/atom_api_crash_reporter.h similarity index 80% rename from browser/api/atom_api_crash_reporter.h rename to common/api/atom_api_crash_reporter.h index 7b42a0d..95ab0c0 100644 --- a/browser/api/atom_api_crash_reporter.h +++ b/common/api/atom_api_crash_reporter.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ATOM_BROWSER_API_ATOM_API_CRASH_REPORTER_H_ -#define ATOM_BROWSER_API_ATOM_API_CRASH_REPORTER_H_ +#ifndef ATOM_COMMON_API_ATOM_API_CRASH_REPORTER_H_ +#define ATOM_COMMON_API_ATOM_API_CRASH_REPORTER_H_ #include "base/basictypes.h" #include "v8/include/v8.h" @@ -28,4 +28,4 @@ class CrashReporter { } // namespace atom -#endif // ATOM_BROWSER_API_ATOM_API_CRASH_REPORTER_H_ +#endif // ATOM_COMMON_API_ATOM_API_CRASH_REPORTER_H_ diff --git a/common/api/atom_extensions.h b/common/api/atom_extensions.h index edf2cfd..c373d49 100644 --- a/common/api/atom_extensions.h +++ b/common/api/atom_extensions.h @@ -11,7 +11,6 @@ NODE_EXT_LIST_START // Module names start with `atom_browser_` can only be used by browser process. NODE_EXT_LIST_ITEM(atom_browser_app) NODE_EXT_LIST_ITEM(atom_browser_auto_updater) -NODE_EXT_LIST_ITEM(atom_browser_crash_reporter) NODE_EXT_LIST_ITEM(atom_browser_dialog) NODE_EXT_LIST_ITEM(atom_browser_ipc) NODE_EXT_LIST_ITEM(atom_browser_menu) @@ -26,6 +25,7 @@ NODE_EXT_LIST_ITEM(atom_renderer_ipc) // Module names start with `atom_common_` can be used by both browser and // renderer processes. NODE_EXT_LIST_ITEM(atom_common_clipboard) +NODE_EXT_LIST_ITEM(atom_common_crash_reporter) NODE_EXT_LIST_ITEM(atom_common_id_weak_map) NODE_EXT_LIST_ITEM(atom_common_shell) NODE_EXT_LIST_ITEM(atom_common_v8_util) diff --git a/browser/api/lib/crash-reporter.coffee b/common/api/lib/crash-reporter.coffee similarity index 100% rename from browser/api/lib/crash-reporter.coffee rename to common/api/lib/crash-reporter.coffee diff --git a/browser/crash_reporter.h b/common/crash_reporter/crash_reporter.h similarity index 76% rename from browser/crash_reporter.h rename to common/crash_reporter/crash_reporter.h index 14b6c7a..dbb7bb5 100644 --- a/browser/crash_reporter.h +++ b/common/crash_reporter/crash_reporter.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ATOM_BROWSER_CRASH_REPORTER_H_ -#define ATOM_BROWSER_CRASH_REPORTER_H_ +#ifndef ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_H_ +#define ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_H_ #include @@ -23,4 +23,4 @@ class CrashReporter { } // namespace crash_reporter -#endif // ATOM_BROWSER_CRASH_REPORTER_H_ +#endif // ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_H_ diff --git a/browser/crash_reporter_mac.mm b/common/crash_reporter/crash_reporter_mac.mm similarity index 98% rename from browser/crash_reporter_mac.mm rename to common/crash_reporter/crash_reporter_mac.mm index 46bdd7b..5c27936 100644 --- a/browser/crash_reporter_mac.mm +++ b/common/crash_reporter/crash_reporter_mac.mm @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser/crash_reporter.h" +#include "common/crash_reporter/crash_reporter.h" #include "browser/browser.h" #include "base/mac/mac_util.h" diff --git a/browser/crash_reporter_win.cc b/common/crash_reporter/crash_reporter_win.cc similarity index 89% rename from browser/crash_reporter_win.cc rename to common/crash_reporter/crash_reporter_win.cc index ca3c7e6..e5187f0 100644 --- a/browser/crash_reporter_win.cc +++ b/common/crash_reporter/crash_reporter_win.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "browser/crash_reporter.h" +#include "common/crash_reporter/crash_reporter.h" namespace crash_reporter { -- 2.7.4