diff options
author | pmonette <pmonette@chromium.org> | 2016-01-07 16:21:16 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-08 00:22:31 +0000 |
commit | 502a83e013988cb8202844650e0e423ec2d8ee78 (patch) | |
tree | bec66a12ca8a6b9edd9a657431db9e1f94ba7adf /chrome | |
parent | ab0c1304c9f3b0c248f154680db5449f1a5497c8 (diff) | |
download | chromium_src-502a83e013988cb8202844650e0e423ec2d8ee78.zip chromium_src-502a83e013988cb8202844650e0e423ec2d8ee78.tar.gz chromium_src-502a83e013988cb8202844650e0e423ec2d8ee78.tar.bz2 |
Switched Kasko to use the new buildflag system.
Moved gyp build to third_party/kasko
Also fixed some build issues that came with rebasing to tip of tree.
Review URL: https://codereview.chromium.org/1526213002
Cr-Commit-Position: refs/heads/master@{#368212}
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/BUILD.gn | 1 | ||||
-rw-r--r-- | chrome/app/DEPS | 1 | ||||
-rw-r--r-- | chrome/app/kasko_client.cc | 5 | ||||
-rw-r--r-- | chrome/app/kasko_client.h | 6 | ||||
-rw-r--r-- | chrome/app/main_dll_loader_win.cc | 19 | ||||
-rw-r--r-- | chrome/browser/BUILD.gn | 2 | ||||
-rw-r--r-- | chrome/browser/DEPS | 1 | ||||
-rw-r--r-- | chrome/browser/chrome_browser_main_win.cc | 10 | ||||
-rw-r--r-- | chrome/browser/chrome_browser_main_win.h | 3 | ||||
-rw-r--r-- | chrome/chrome.gyp | 36 | ||||
-rw-r--r-- | chrome/chrome_browser.gypi | 10 | ||||
-rw-r--r-- | chrome/chrome_common.gypi | 1 | ||||
-rw-r--r-- | chrome/chrome_dll.gypi | 1 | ||||
-rw-r--r-- | chrome/chrome_exe.gypi | 10 | ||||
-rw-r--r-- | chrome/chrome_tests_unit.gypi | 1 | ||||
-rw-r--r-- | chrome/chrome_watcher/DEPS | 1 | ||||
-rw-r--r-- | chrome/chrome_watcher/chrome_watcher.gypi | 8 | ||||
-rw-r--r-- | chrome/chrome_watcher/chrome_watcher_main.cc | 19 | ||||
-rw-r--r-- | chrome/common/BUILD.gn | 1 | ||||
-rw-r--r-- | chrome/common/DEPS | 1 | ||||
-rw-r--r-- | chrome/common/crash_keys.cc | 4 | ||||
-rw-r--r-- | chrome/common/crash_keys.h | 3 | ||||
-rw-r--r-- | chrome/test/BUILD.gn | 1 |
23 files changed, 56 insertions, 89 deletions
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn index 11eb786..cc14b81 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn @@ -316,6 +316,7 @@ if (is_mac || is_win) { "//base/trace_event/etw_manifest:chrome_events_win", "//chrome/app/theme:chrome_unscaled_resources", "//chrome_elf", + "//components/crash/content/app", "//content/app/resources", "//crypto", "//net:net_resources", diff --git a/chrome/app/DEPS b/chrome/app/DEPS index f7be0ec..5d647ee 100644 --- a/chrome/app/DEPS +++ b/chrome/app/DEPS @@ -32,4 +32,5 @@ include_rules = [ "+sandbox", "+syzygy/kasko/api", "+third_party/crashpad/crashpad", + "+third_party/kasko", ] diff --git a/chrome/app/kasko_client.cc b/chrome/app/kasko_client.cc index afc5c07..ab44bac 100644 --- a/chrome/app/kasko_client.cc +++ b/chrome/app/kasko_client.cc @@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if defined(KASKO) #include "chrome/app/kasko_client.h" +#if BUILDFLAG(ENABLE_KASKO) + #include <windows.h> #include <stddef.h> @@ -115,4 +116,4 @@ extern "C" void __declspec(dllexport) ReportCrashWithProtobuf( nullptr, nullptr); } -#endif // defined(KASKO) +#endif // BUILDFLAG(ENABLE_KASKO) diff --git a/chrome/app/kasko_client.h b/chrome/app/kasko_client.h index 9f3da7d..aeb816f 100644 --- a/chrome/app/kasko_client.h +++ b/chrome/app/kasko_client.h @@ -5,7 +5,9 @@ #ifndef CHROME_APP_KASKO_CLIENT_H_ #define CHROME_APP_KASKO_CLIENT_H_ -#if defined(KASKO) +#include "third_party/kasko/kasko_features.h" + +#if BUILDFLAG(ENABLE_KASKO) #include "base/macros.h" #include "syzygy/kasko/api/minidump_type.h" @@ -28,6 +30,6 @@ class KaskoClient { DISALLOW_COPY_AND_ASSIGN(KaskoClient); }; -#endif // KASKO +#endif // BUILDFLAG(ENABLE_KASKO) #endif // CHROME_APP_KASKO_CLIENT_H_ diff --git a/chrome/app/main_dll_loader_win.cc b/chrome/app/main_dll_loader_win.cc index 3ab9f69..8ef34fe 100644 --- a/chrome/app/main_dll_loader_win.cc +++ b/chrome/app/main_dll_loader_win.cc @@ -122,7 +122,10 @@ void ClearDidRun(const base::FilePath& dll_path) { typedef int (*InitMetro)(); -#if defined(KASKO) +#if BUILDFLAG(ENABLE_KASKO) + +// For ::GetProfileType(). +#pragma comment(lib, "userenv.lib") // For ::GetProfileType(). #pragma comment(lib, "userenv.lib") @@ -156,7 +159,7 @@ std::wstring GetProfileType() { return profile_type; } -#endif // KASKO +#endif // BUILDFLAG(ENABLE_KASKO) } // namespace @@ -317,9 +320,9 @@ class ChromeDllLoader : public MainDllLoader { private: scoped_ptr<ChromeWatcherClient> chrome_watcher_client_; -#if defined(KASKO) +#if BUILDFLAG(ENABLE_KASKO) scoped_ptr<KaskoClient> kasko_client_; -#endif // KASKO +#endif }; void ChromeDllLoader::OnBeforeLaunch(const std::string& process_type, @@ -340,7 +343,7 @@ void ChromeDllLoader::OnBeforeLaunch(const std::string& process_type, chrome_watcher_client_.reset(new ChromeWatcherClient( base::Bind(&GenerateChromeWatcherCommandLine, exe_path))); if (chrome_watcher_client_->LaunchWatcher()) { -#if defined(KASKO) +#if BUILDFLAG(ENABLE_KASKO) kasko::api::MinidumpType minidump_type = kasko::api::SMALL_DUMP_TYPE; if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kFullMemoryCrashReport)) { @@ -359,7 +362,7 @@ void ChromeDllLoader::OnBeforeLaunch(const std::string& process_type, kasko_client_.reset( new KaskoClient(chrome_watcher_client_.get(), minidump_type)); -#endif // KASKO +#endif // BUILDFLAG(ENABLE_KASKO) } } } @@ -382,9 +385,9 @@ int ChromeDllLoader::OnBeforeExit(int return_code, ClearDidRun(dll_path); } -#if defined(KASKO) +#if BUILDFLAG(ENABLE_KASKO) kasko_client_.reset(); -#endif // KASKO +#endif chrome_watcher_client_.reset(); return return_code; diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index dad6c5b..427c725 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn @@ -369,6 +369,7 @@ source_set("browser") { "//storage/common", "//third_party/WebKit/public:image_resources", "//third_party/WebKit/public:resources", + "//third_party/kasko", "//third_party/leveldatabase", "//third_party/libaddressinput", "//third_party/libyuv", @@ -843,6 +844,7 @@ source_set("browser") { ] deps += [ ":chrome_process_finder", + "//chrome/chrome_watcher:client", "//chrome/common:version_header", "//chrome/installer/util:strings", "//chrome_elf", diff --git a/chrome/browser/DEPS b/chrome/browser/DEPS index 1f815d0..dfcf809 100644 --- a/chrome/browser/DEPS +++ b/chrome/browser/DEPS @@ -171,6 +171,7 @@ include_rules = [ "+sync/util", # Sync utilities like GetSessionName. "+syzygy/kasko", "+third_party/cros_system_api", + "+third_party/kasko", "+win8/util", # chrome only needs switches from cc. All usage of the compositor is from diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc index 0a1238b..30a71e4 100644 --- a/chrome/browser/chrome_browser_main_win.cc +++ b/chrome/browser/chrome_browser_main_win.cc @@ -74,7 +74,7 @@ #include "chrome/browser/google/did_run_updater_win.h" #endif -#if defined(KASKO) +#if BUILDFLAG(ENABLE_KASKO) #include "syzygy/kasko/api/reporter.h" #endif @@ -122,7 +122,7 @@ void ExecuteFontCacheBuildTask(const base::FilePath& path) { new ChromeUtilityHostMsg_BuildDirectWriteFontCache(path)); } -#if defined(KASKO) +#if BUILDFLAG(ENABLE_KASKO) void ObserveFailedCrashReportDirectory(const base::FilePath& path, bool error) { DCHECK(!error); if (error) @@ -155,7 +155,7 @@ void StartFailedKaskoCrashReportWatcher(base::FilePathWatcher* watcher) { ObserveFailedCrashReportDirectory(permanent_failure_directory, false); } } -#endif +#endif // BUILDFLAG(ENABLE_KASKO) void DetectFaultTolerantHeap() { enum FTHFlags { @@ -385,13 +385,13 @@ void ChromeBrowserMainPartsWin::PostBrowserStart() { InitializeChromeElf(); -#if defined(KASKO) +#if BUILDFLAG(ENABLE_KASKO) content::BrowserThread::PostDelayedTask( content::BrowserThread::FILE, FROM_HERE, base::Bind(&StartFailedKaskoCrashReportWatcher, base::Unretained(&failed_kasko_crash_report_watcher_)), base::TimeDelta::FromMinutes(5)); -#endif +#endif // BUILDFLAG(ENABLE_KASKO) #if defined(GOOGLE_CHROME_BUILD) did_run_updater_.reset(new DidRunUpdater); diff --git a/chrome/browser/chrome_browser_main_win.h b/chrome/browser/chrome_browser_main_win.h index 254b487..c948edb 100644 --- a/chrome/browser/chrome_browser_main_win.h +++ b/chrome/browser/chrome_browser_main_win.h @@ -10,6 +10,7 @@ #include "base/files/file_path_watcher.h" #include "base/macros.h" #include "chrome/browser/chrome_browser_main.h" +#include "third_party/kasko/kasko_features.h" class DidRunUpdater; @@ -72,7 +73,7 @@ class ChromeBrowserMainPartsWin : public ChromeBrowserMainParts { #if defined(GOOGLE_CHROME_BUILD) scoped_ptr<DidRunUpdater> did_run_updater_; #endif -#if defined(KASKO) +#if BUILDFLAG(ENABLE_KASKO) // Cleans up Kasko crash reports that exceeded the maximum upload attempts. base::FilePathWatcher failed_kasko_crash_report_watcher_; #endif diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index 6694fb5..6beaddd 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -773,41 +773,5 @@ }, ], }], - ['kasko==1', { - 'variables': { - 'kasko_exe_dir': '<(DEPTH)/third_party/kasko/binaries', - }, - 'targets': [ - { - 'target_name': 'kasko_dll', - 'type': 'none', - 'outputs': [ - '<(PRODUCT_DIR)/kasko.dll', - '<(PRODUCT_DIR)/kasko.dll.pdb', - ], - 'copies': [ - { - 'destination': '<(PRODUCT_DIR)', - 'files': [ - '<(kasko_exe_dir)/kasko.dll', - '<(kasko_exe_dir)/kasko.dll.pdb', - ], - }, - ], - 'direct_dependent_settings': { - 'msvs_settings': { - 'VCLinkerTool': { - 'AdditionalDependencies': [ - 'kasko.dll.lib', - ], - 'AdditionalLibraryDirectories': [ - '<(DEPTH)/third_party/kasko/binaries' - ], - }, - }, - }, - }, - ], - }], ], # 'conditions' } diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index c402751..6063186 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -3816,24 +3816,18 @@ '../google_update/google_update.gyp:google_update', '../third_party/iaccessible2/iaccessible2.gyp:iaccessible2', '../third_party/isimpledom/isimpledom.gyp:isimpledom', + '../third_party/kasko/kasko.gyp:kasko', '../ui/metro_viewer/metro_viewer.gyp:metro_viewer_messages', '../ui/views/controls/webview/webview.gyp:webview', '../ui/views/views.gyp:views', '../win8/win8.gyp:metro_viewer', ], 'export_dependent_settings': [ + '../third_party/kasko/kasko.gyp:kasko', '../ui/views/controls/webview/webview.gyp:webview', '../ui/views/views.gyp:views', ], 'conditions': [ - ['kasko==1', { - 'dependencies': [ - 'kasko_dll', - ], - 'export_dependent_settings': [ - 'kasko_dll', - ], - }], ['branding!="Chrome"', { 'dependencies!': [ '../google_update/google_update.gyp:google_update', diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi index cbf6331..bac564e 100644 --- a/chrome/chrome_common.gypi +++ b/chrome/chrome_common.gypi @@ -352,6 +352,7 @@ '<(DEPTH)/skia/skia.gyp:skia_library', '<(DEPTH)/third_party/icu/icu.gyp:icui18n', '<(DEPTH)/third_party/icu/icu.gyp:icuuc', + '<(DEPTH)/third_party/kasko/kasko.gyp:kasko_features', '<(DEPTH)/third_party/zlib/google/zip.gyp:zip', '<(DEPTH)/ui/gfx/ipc/gfx_ipc.gyp:gfx_ipc', '<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources', diff --git a/chrome/chrome_dll.gypi b/chrome/chrome_dll.gypi index b6e7634..a0aa2c1 100644 --- a/chrome/chrome_dll.gypi +++ b/chrome/chrome_dll.gypi @@ -351,6 +351,7 @@ '<@(chromium_child_dependencies)', '../components/components.gyp:browser_watcher_client', '../content/content.gyp:content_app_child', + '../third_party/kasko/kasko.gyp:kasko', 'chrome_version_resources', 'policy_path_parser', ], diff --git a/chrome/chrome_exe.gypi b/chrome/chrome_exe.gypi index 4cec0e7..fda73bc 100644 --- a/chrome/chrome_exe.gypi +++ b/chrome/chrome_exe.gypi @@ -105,20 +105,13 @@ '../components/components.gyp:browser_watcher_client', '../components/components.gyp:crash_component', '../third_party/crashpad/crashpad/handler/handler.gyp:crashpad_handler_lib', + '../third_party/kasko/kasko.gyp:kasko', ], 'sources': [ 'app/chrome_crash_reporter_client.cc', 'app/chrome_crash_reporter_client.h', ], 'conditions': [ - ['kasko==1', { - 'dependencies': [ - 'kasko_dll', - ], - 'sources': [ - 'app/chrome_crash_reporter_client.cc', - ], - }], ['win_console_app==1', { 'defines': ['WIN_CONSOLE_APP'], }], @@ -433,6 +426,7 @@ '../components/components.gyp:crash_core_common', '../components/components.gyp:flags_ui_switches', '../sandbox/sandbox.gyp:sandbox', + '../third_party/kasko/kasko.gyp:kasko_features', '../ui/gfx/gfx.gyp:gfx', '../win8/metro_driver/metro_driver.gyp:metro_driver', '../win8/delegate_execute/delegate_execute.gyp:*', diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi index 19f47ce..65c11d4 100644 --- a/chrome/chrome_tests_unit.gypi +++ b/chrome/chrome_tests_unit.gypi @@ -2889,6 +2889,7 @@ '../components/components.gyp:crash_core_common', '../components/components.gyp:flags_ui_switches', '../content/content.gyp:content_app_both', + '../third_party/kasko/kasko.gyp:kasko_features', # 2) test-specific support libraries: '../base/base.gyp:run_all_unittests', '../testing/gmock.gyp:gmock', diff --git a/chrome/chrome_watcher/DEPS b/chrome/chrome_watcher/DEPS index d7f5402..7bc4be6 100644 --- a/chrome/chrome_watcher/DEPS +++ b/chrome/chrome_watcher/DEPS @@ -3,4 +3,5 @@ include_rules = [ "+chrome/installer/util", "+components/browser_watcher", "+syzygy/kasko/api", + "+third_party/kasko", ] diff --git a/chrome/chrome_watcher/chrome_watcher.gypi b/chrome/chrome_watcher/chrome_watcher.gypi index 9836501..f676a26 100644 --- a/chrome/chrome_watcher/chrome_watcher.gypi +++ b/chrome/chrome_watcher/chrome_watcher.gypi @@ -64,13 +64,7 @@ 'installer_util', '../base/base.gyp:base', '../components/components.gyp:browser_watcher', - ], - 'conditions': [ - ['kasko==1', { - 'dependencies': [ - 'kasko_dll', - ], - }], + '../third_party/kasko/kasko.gyp:kasko', ], 'msvs_settings': { 'VCLinkerTool': { diff --git a/chrome/chrome_watcher/chrome_watcher_main.cc b/chrome/chrome_watcher/chrome_watcher_main.cc index 01e916b..e28de01 100644 --- a/chrome/chrome_watcher/chrome_watcher_main.cc +++ b/chrome/chrome_watcher/chrome_watcher_main.cc @@ -37,8 +37,9 @@ #include "components/browser_watcher/endsession_watcher_window_win.h" #include "components/browser_watcher/exit_code_watcher_win.h" #include "components/browser_watcher/window_hang_monitor_win.h" +#include "third_party/kasko/kasko_features.h" -#ifdef KASKO +#if BUILDFLAG(ENABLE_KASKO) #include "syzygy/kasko/api/reporter.h" #endif @@ -194,7 +195,7 @@ void OnWindowEvent( } } -#ifdef KASKO +#if BUILDFLAG(ENABLE_KASKO) // Helper function for determining the crash server to use. Defaults to the // standard crash server, but can be overridden via an environment variable. // Enables easy integration testing. @@ -342,7 +343,7 @@ void OnCrashReportUpload(void* context, // TODO(erikwright): Copy minidump to some "last dump" location? } -#endif // KASKO +#endif // BUILDFLAG(ENABLE_KASKO) } // namespace @@ -371,7 +372,7 @@ extern "C" int WatcherMain(const base::char16* registry_path, base::Callback<void(const base::Process&)> on_hung_callback; -#ifdef KASKO +#if BUILDFLAG(ENABLE_KASKO) base::string16 crash_server; GetKaskoCrashServerUrl(&crash_server); @@ -389,14 +390,14 @@ extern "C" int WatcherMain(const base::char16* registry_path, .value() .c_str(), &OnCrashReportUpload, nullptr); -#ifdef KASKO_HANG_REPORTS +#if BUILDFLAG(ENABLE_KASKO_HANG_REPORTS) if (launched_kasko && base::StringPiece16(channel_name) == installer::kChromeChannelCanary) { on_hung_callback = base::Bind(&DumpHungBrowserProcess, main_thread_id, channel_name); } -#endif // KASKO_HANG_REPORTS -#endif // KASKO +#endif // BUILDFLAG(ENABLE_KASKO_HANG_REPORTS) +#endif // BUILDFLAG(ENABLE_KASKO) // Run a UI message loop on the main thread. base::MessageLoop msg_loop(base::MessageLoop::TYPE_UI); @@ -420,10 +421,10 @@ extern "C" int WatcherMain(const base::char16* registry_path, run_loop.Run(); } -#ifdef KASKO +#if BUILDFLAG(ENABLE_KASKO) if (launched_kasko) kasko::api::ShutdownReporter(); -#endif // KASKO +#endif // BUILDFLAG(ENABLE_KASKO) // Wind logging down. logging::LogEventProvider::Uninitialize(); diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn index df5e371..61c533f 100644 --- a/chrome/common/BUILD.gn +++ b/chrome/common/BUILD.gn @@ -102,6 +102,7 @@ static_library("common") { "//net", "//skia", "//third_party/icu", + "//third_party/kasko:kasko_features", "//third_party/zlib:zip", "//ui/accessibility", "//ui/base", diff --git a/chrome/common/DEPS b/chrome/common/DEPS index d45be94..84bf958 100644 --- a/chrome/common/DEPS +++ b/chrome/common/DEPS @@ -32,6 +32,7 @@ include_rules = [ "+ppapi/c", "+ppapi/shared_impl", "+ppapi/thunk", + "+third_party/kasko", # FIXME - refactor code and remove these dependencies "+chrome/installer", diff --git a/chrome/common/crash_keys.cc b/chrome/common/crash_keys.cc index bdef33f..2254305 100644 --- a/chrome/common/crash_keys.cc +++ b/chrome/common/crash_keys.cc @@ -76,7 +76,7 @@ const char kSendAction[] = "sendaction"; } // namespace mac #endif -#if defined(KASKO) +#if BUILDFLAG(ENABLE_KASKO) const char kKaskoGuid[] = "kasko-guid"; const char kKaskoEquivalentGuid[] = "kasko-equivalent-guid"; #endif @@ -141,7 +141,7 @@ size_t RegisterChromeCrashKeys() { // media/: { "VideoCaptureDeviceQTKit", kSmallSize }, #endif -#if defined(KASKO) +#if BUILDFLAG(ENABLE_KASKO) { kKaskoGuid, kSmallSize }, { kKaskoEquivalentGuid, kSmallSize }, #endif diff --git a/chrome/common/crash_keys.h b/chrome/common/crash_keys.h index 01219e4..335b8d3 100644 --- a/chrome/common/crash_keys.h +++ b/chrome/common/crash_keys.h @@ -15,6 +15,7 @@ #include "base/macros.h" #include "build/build_config.h" #include "components/crash/core/common/crash_keys.h" +#include "third_party/kasko/kasko_features.h" namespace base { class CommandLine; @@ -118,7 +119,7 @@ extern const char kSendAction[]; } // namespace mac #endif -#if defined(KASKO) +#if BUILDFLAG(ENABLE_KASKO) // Used to correlate a report sent via Kasko with one sent via Breakpad. extern const char kKaskoGuid[]; extern const char kKaskoEquivalentGuid[]; diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index e8d2a0f..58b218b 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn @@ -2154,6 +2154,7 @@ if (is_win || (is_linux && !is_chromeos)) { "//chrome/child", "//components/crash/core/common", "//components/flags_ui:switches", + "//third_party/kasko:kasko_features", ] if (cld_version == 2) { # Use whatever CLD2 data access mode that the |