diff --git a/brightray/brightray.gypi b/brightray/brightray.gypi index 13b990077a37..264f8dc9db35 100644 --- a/brightray/brightray.gypi +++ b/brightray/brightray.gypi @@ -231,10 +231,8 @@ 'msvs_settings': { 'VCCLCompilerTool': { 'RuntimeLibrary': '2', # /MD (nondebug DLL) - # 1, optimizeMinSpace, Minimize Size (/O1) - 'Optimization': '1', - # 2, favorSize - Favor small code (/Os) - 'FavorSizeOrSpeed': '2', + 'Optimization': '2', # /O2 + 'WholeProgramOptimization': 'true', # /GL # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx 'InlineFunctionExpansion': '2', # 2 = max # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx @@ -246,6 +244,9 @@ # "/Oy /Oy-" and warnings about overriding. 'AdditionalOptions': ['/Oy-', '/d2guard4'], }, + 'VCLibrarianTool': { + 'LinkTimeCodeGeneration': 'true', # /LTCG + }, 'VCLinkerTool': { # Control Flow Guard is a security feature in Windows # 8.1 and higher designed to prevent exploitation of @@ -256,6 +257,9 @@ 'AdditionalOptions': ['/guard:cf'], # Turn off incremental linking to save binary size. 'LinkIncremental': '1', # /INCREMENTAL:NO + 'LinkTimeCodeGeneration': '1', # /LTCG + 'OptimizeReferences': 2, # /OPT:REF + 'EnableCOMDATFolding': 2, # /OPT:ICF }, }, 'conditions': [ @@ -280,6 +284,18 @@ '-Wl,--gc-sections', ], }], # OS=="linux" + ['OS=="linux" and target_arch in ["ia32", "x64", "arm64"]', { + 'cflags': [ + '-flto=thin', + ], + 'ldflags': [ + '-flto=thin', + '-fuse-ld=lld', # Chromium Clang uses lld for doing LTO + '-Wl,--lto-O0', # this could be removed in future; see https://codereview.chromium.org/2939923004 + '-Wl,-mllvm,-function-sections', + '-Wl,-mllvm,-data-sections', + ], + }], ], }, # Release_Base 'conditions': [ diff --git a/brightray/browser/win/win32_desktop_notifications/desktop_notification_controller.cc b/brightray/browser/win/win32_desktop_notifications/desktop_notification_controller.cc index 8dea03f1fc64..358074c602be 100644 --- a/brightray/browser/win/win32_desktop_notifications/desktop_notification_controller.cc +++ b/brightray/browser/win/win32_desktop_notifications/desktop_notification_controller.cc @@ -174,7 +174,7 @@ void DesktopNotificationController::AnimateAll() { if (SystemParametersInfo(SPI_GETWORKAREA, 0, &work_area, 0)) { ScreenMetrics metrics; POINT origin = { work_area.right, - work_area.bottom - metrics.Y(toast_margin_) }; + work_area.bottom - metrics.Y(toast_margin_) }; auto hdwp = BeginDeferWindowPos(static_cast(instances_.size())); @@ -231,7 +231,7 @@ void DesktopNotificationController::AnimateAll() { // Set new toast positions if (!instances_.empty()) { ScreenMetrics metrics; - auto margin = metrics.Y(toast_margin_); + auto margin = metrics.Y(toast_margin_); int target_pos = 0; for (auto&& inst : instances_) { @@ -305,7 +305,7 @@ void DesktopNotificationController::CreateToast(NotificationLink&& data) { auto toast = Toast::Get(item.hwnd); toast_pos = toast->GetVerticalPosition() + toast->GetHeight() + - scr.Y(toast_margin_); + scr.Y(toast_margin_); } instances_.push_back({ hwnd, move(data) }); diff --git a/brightray/browser/win/win32_desktop_notifications/desktop_notification_controller.h b/brightray/browser/win/win32_desktop_notifications/desktop_notification_controller.h index 643a61f5331e..1e76e1e1ad2e 100644 --- a/brightray/browser/win/win32_desktop_notifications/desktop_notification_controller.h +++ b/brightray/browser/win/win32_desktop_notifications/desktop_notification_controller.h @@ -36,8 +36,7 @@ class DesktopNotificationController { TimerID_Animate = 1 }; - template - static constexpr T toast_margin_ = 20; + static constexpr int toast_margin_ = 20; // Wrapper around `NotificationData` which makes sure that // the `controller` member is cleared when the controller object diff --git a/vendor/libchromiumcontent b/vendor/libchromiumcontent index 2bdad005879d..69984b41aaae 160000 --- a/vendor/libchromiumcontent +++ b/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit 2bdad005879d7557731f85c626b46bd3ebe6e3a9 +Subproject commit 69984b41aaae78be9186ba880b84cf1e75d379a2