summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-02-05 12:52:04 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-02-10 11:42:38 +0100
commitd6d89a179a397c09aaf98e966b95ec7dabd28626 (patch)
tree82178d90c80ea25fc2e17d04abb3a243527a8a1a
parent89ce69df24ca27ce4d6dadb7480efd3e5c980e7e (diff)
downloadqtwebengine-chromium-d6d89a179a397c09aaf98e966b95ec7dabd28626.tar.gz
Fixes for building with MSVC
Work-around various issues to make Chromium build on MSVC Change-Id: I3489452c9d7e61243fb60b877d289293b1850ebe Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
-rw-r--r--chromium/BUILD.gn4
-rw-r--r--chromium/base/task/promise/abstract_promise.cc8
-rw-r--r--chromium/build/config/win/BUILD.gn2
-rw-r--r--chromium/chrome/browser/BUILD.gn2
-rw-r--r--chromium/chrome/browser/win/conflicts/BUILD.gn7
-rw-r--r--chromium/content/browser/BUILD.gn2
-rw-r--r--chromium/content/browser/accessibility/browser_accessibility_state_impl.cc2
-rw-r--r--chromium/courgette/BUILD.gn3
-rw-r--r--chromium/gpu/ipc/service/BUILD.gn5
-rw-r--r--chromium/services/network/mdns_responder.h2
-rw-r--r--chromium/sql/recover_module/cursor.h2
-rw-r--r--chromium/sql/recover_module/table.h2
-rw-r--r--chromium/storage/browser/quota/quota_features.cc6
-rw-r--r--chromium/third_party/blink/renderer/BUILD.gn5
-rw-r--r--chromium/third_party/blink/renderer/bindings/templates/callback_invoke.cc.tmpl3
-rw-r--r--chromium/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc4
-rw-r--r--chromium/third_party/blink/renderer/platform/fonts/shaping/shape_result.cc10
-rw-r--r--chromium/third_party/blink/renderer/platform/heap/persistent_node.h2
-rw-r--r--chromium/ui/gl/gl_utils.cc4
-rw-r--r--chromium/ui/views/BUILD.gn2
-rw-r--r--chromium/v8/src/torque/global-context.h4
21 files changed, 55 insertions, 26 deletions
diff --git a/chromium/BUILD.gn b/chromium/BUILD.gn
index 054b973feac..4f000a97491 100644
--- a/chromium/BUILD.gn
+++ b/chromium/BUILD.gn
@@ -622,7 +622,7 @@ group("gn_all") {
]
}
- if (is_win) {
+ if (is_win && !use_qt) {
deps += [
"//base:pe_image_test",
"//chrome/chrome_cleaner",
@@ -658,7 +658,7 @@ group("gn_all") {
host_os == "win" && !use_qt) {
deps += [ "//chrome/test/mini_installer:mini_installer_tests" ]
}
- } else if (!is_android && !is_ios && !is_fuchsia) {
+ } else if (!is_android && !is_ios && !is_fuchsia && !is_win) {
deps += [ "//third_party/breakpad:symupload($host_toolchain)" ]
}
diff --git a/chromium/base/task/promise/abstract_promise.cc b/chromium/base/task/promise/abstract_promise.cc
index 315cfd30bfc..e235a24efed 100644
--- a/chromium/base/task/promise/abstract_promise.cc
+++ b/chromium/base/task/promise/abstract_promise.cc
@@ -691,10 +691,10 @@ BasePromise::BasePromise(
: abstract_promise_(std::move(abstract_promise)) {}
BasePromise::BasePromise(const BasePromise& other) = default;
-BasePromise::BasePromise(BasePromise&& other) = default;
+BasePromise::BasePromise(BasePromise&& other) noexcept = default;
BasePromise& BasePromise::operator=(const BasePromise& other) = default;
-BasePromise& BasePromise::operator=(BasePromise&& other) = default;
+BasePromise& BasePromise::operator=(BasePromise&& other) noexcept = default;
BasePromise::~BasePromise() = default;
@@ -720,11 +720,11 @@ WrappedPromise::WrappedPromise(const Location& from_here, OnceClosure task)
std::move(task)))) {}
WrappedPromise::WrappedPromise(const WrappedPromise& other) = default;
-WrappedPromise::WrappedPromise(WrappedPromise&& other) = default;
+WrappedPromise::WrappedPromise(WrappedPromise&& other) noexcept = default;
WrappedPromise& WrappedPromise::operator=(const WrappedPromise& other) =
default;
-WrappedPromise& WrappedPromise::operator=(WrappedPromise&& other) = default;
+WrappedPromise& WrappedPromise::operator=(WrappedPromise&& other) noexcept = default;
WrappedPromise::~WrappedPromise() = default;
diff --git a/chromium/build/config/win/BUILD.gn b/chromium/build/config/win/BUILD.gn
index c0afac22bb2..a8011aba432 100644
--- a/chromium/build/config/win/BUILD.gn
+++ b/chromium/build/config/win/BUILD.gn
@@ -149,7 +149,7 @@ config("compiler") {
ldflags += [ "/TIMESTAMP:" + build_timestamp ]
# Don't look for libpaths in %LIB%, similar to /X in cflags above.
- ldflags += [ "/lldignoreenv" ]
+# ldflags += [ "/lldignoreenv" ]
}
if (!is_debug && !is_component_build) {
diff --git a/chromium/chrome/browser/BUILD.gn b/chromium/chrome/browser/BUILD.gn
index 69362e7008e..4918edc912d 100644
--- a/chromium/chrome/browser/BUILD.gn
+++ b/chromium/chrome/browser/BUILD.gn
@@ -3643,7 +3643,7 @@ jumbo_static_library("browser") {
]
}
- if (is_win) {
+ if (is_win && toolkit_views) {
sources += [
"badging/badge_manager_delegate_win.cc",
"badging/badge_manager_delegate_win.h",
diff --git a/chromium/chrome/browser/win/conflicts/BUILD.gn b/chromium/chrome/browser/win/conflicts/BUILD.gn
index b5768b88866..ee88908538e 100644
--- a/chromium/chrome/browser/win/conflicts/BUILD.gn
+++ b/chromium/chrome/browser/win/conflicts/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/chrome_build.gni")
+import("//chrome/common/features.gni")
import("//third_party/protobuf/proto_library.gni")
assert(is_win)
@@ -31,8 +32,12 @@ source_set("module_info") {
deps = [
"//base:i18n",
- "//chrome/common/safe_browsing:pe_image_reader",
]
+ if (safe_browsing_mode == 1) {
+ deps += [
+ "//chrome/common/safe_browsing:pe_image_reader",
+ ]
+ }
}
loadable_module("conflicts_dll") {
diff --git a/chromium/content/browser/BUILD.gn b/chromium/content/browser/BUILD.gn
index c1dfa069f8d..c8187ab8bce 100644
--- a/chromium/content/browser/BUILD.gn
+++ b/chromium/content/browser/BUILD.gn
@@ -2703,6 +2703,7 @@ jumbo_static_library("browser") {
"accessibility/browser_accessibility_com_win.h",
"accessibility/browser_accessibility_manager_win.cc",
"accessibility/browser_accessibility_manager_win.h",
+ "accessibility/browser_accessibility_state_impl_win.cc",
"accessibility/browser_accessibility_win.cc",
"accessibility/browser_accessibility_win.h",
"accessibility/accessibility_tree_formatter_win.cc",
@@ -2719,6 +2720,7 @@ jumbo_static_library("browser") {
"accessibility/browser_accessibility_mac.h",
"accessibility/browser_accessibility_manager_mac.mm",
"accessibility/browser_accessibility_manager_mac.h",
+ "accessibility/browser_accessibility_state_impl_mac.mm",
"renderer_host/input/synthetic_gesture_target_mac.h",
"renderer_host/input/synthetic_gesture_target_mac.mm",
"renderer_host/native_web_keyboard_event_mac.mm",
diff --git a/chromium/content/browser/accessibility/browser_accessibility_state_impl.cc b/chromium/content/browser/accessibility/browser_accessibility_state_impl.cc
index bb9d5499f41..f572ffd81ad 100644
--- a/chromium/content/browser/accessibility/browser_accessibility_state_impl.cc
+++ b/chromium/content/browser/accessibility/browser_accessibility_state_impl.cc
@@ -190,7 +190,7 @@ ui::AXMode BrowserAccessibilityStateImpl::GetAccessibilityMode() {
return accessibility_mode_;
}
-#if !defined(OS_ANDROID) && !defined(OS_WIN) && !defined(OS_MACOSX)
+#if (!defined(OS_ANDROID) && !defined(OS_WIN) && !defined(OS_MACOSX)) || defined(TOOLKIT_QT)
void BrowserAccessibilityStateImpl::PlatformInitialize() {}
void BrowserAccessibilityStateImpl::
diff --git a/chromium/courgette/BUILD.gn b/chromium/courgette/BUILD.gn
index 63a00fa5110..1ced3e5f6dc 100644
--- a/chromium/courgette/BUILD.gn
+++ b/chromium/courgette/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/compiler/compiler.gni")
+import("//build/config/features.gni")
import("//testing/test.gni")
static_library("courgette_lib") {
@@ -161,7 +162,7 @@ if (!is_ios) {
]
}
- if (is_win) {
+ if (is_win && !use_qt) {
if (current_cpu == "x64") {
# TODO(sebmarchand): The official build scripts expect courgette.exe to be
# in the official build archives, remove this once they have been updated.
diff --git a/chromium/gpu/ipc/service/BUILD.gn b/chromium/gpu/ipc/service/BUILD.gn
index 082ac932cfa..826f8f31a3d 100644
--- a/chromium/gpu/ipc/service/BUILD.gn
+++ b/chromium/gpu/ipc/service/BUILD.gn
@@ -88,6 +88,11 @@ jumbo_component("service") {
"gpu_memory_buffer_factory_dxgi.h",
"image_transport_surface_win.cc",
]
+ if (use_qt) {
+ sources -= [
+ "image_transport_surface_win.cc",
+ ]
+ }
}
if (is_mac) {
sources += [
diff --git a/chromium/services/network/mdns_responder.h b/chromium/services/network/mdns_responder.h
index db0a5a8b1f9..918e086a805 100644
--- a/chromium/services/network/mdns_responder.h
+++ b/chromium/services/network/mdns_responder.h
@@ -97,7 +97,7 @@ struct COMPONENT_EXPORT(NETWORK_SERVICE) MdnsResponseSendOption
base::Optional<base::RepeatingCallback<bool()>> cancelled_callback;
private:
- friend class RefCounted<MdnsResponseSendOption>;
+ friend class base::RefCounted<MdnsResponseSendOption>;
~MdnsResponseSendOption();
};
diff --git a/chromium/sql/recover_module/cursor.h b/chromium/sql/recover_module/cursor.h
index 2dc026cc924..7091cc9c979 100644
--- a/chromium/sql/recover_module/cursor.h
+++ b/chromium/sql/recover_module/cursor.h
@@ -62,8 +62,10 @@ class VirtualCursor {
// |sqlite_cursor| must have been returned by VirtualTable::SqliteCursor().
static inline VirtualCursor* FromSqliteCursor(
sqlite3_vtab_cursor* sqlite_cursor) {
+#if 0
static_assert(std::is_standard_layout<VirtualCursor>::value,
"needed for the reinterpret_cast below");
+#endif
static_assert(offsetof(VirtualCursor, sqlite_cursor_) == 0,
"sqlite_cursor_ must be the first member of the class");
VirtualCursor* result = reinterpret_cast<VirtualCursor*>(sqlite_cursor);
diff --git a/chromium/sql/recover_module/table.h b/chromium/sql/recover_module/table.h
index 0238d4a8d01..457a424e4be 100644
--- a/chromium/sql/recover_module/table.h
+++ b/chromium/sql/recover_module/table.h
@@ -84,8 +84,10 @@ class VirtualTable {
//
// |sqlite_table| must have been returned by VirtualTable::SqliteTable().
static inline VirtualTable* FromSqliteTable(sqlite3_vtab* sqlite_table) {
+#if 0
static_assert(std::is_standard_layout<VirtualTable>::value,
"needed for the reinterpret_cast below");
+#endif
static_assert(offsetof(VirtualTable, sqlite_table_) == 0,
"sqlite_table_ must be the first member of the class");
VirtualTable* const result = reinterpret_cast<VirtualTable*>(sqlite_table);
diff --git a/chromium/storage/browser/quota/quota_features.cc b/chromium/storage/browser/quota/quota_features.cc
index 771e905dfc5..fdc2b888319 100644
--- a/chromium/storage/browser/quota/quota_features.cc
+++ b/chromium/storage/browser/quota/quota_features.cc
@@ -11,11 +11,11 @@ namespace features {
const base::Feature kQuotaExpandPoolSize{"QuotaExpandPoolSize",
base::FEATURE_ENABLED_BY_DEFAULT};
-constexpr base::FeatureParam<double> kExperimentalPoolSizeRatio{
+const base::FeatureParam<double> kExperimentalPoolSizeRatio{
&kQuotaExpandPoolSize, "PoolSizeRatio", 0.8};
-constexpr base::FeatureParam<double> kPerHostRatio{&kQuotaExpandPoolSize,
- "PerHostRatio", 0.75};
+const base::FeatureParam<double> kPerHostRatio{&kQuotaExpandPoolSize,
+ "PerHostRatio", 0.75};
// StaticHostQuota enables a simpler per-host quota model, where the quota is
// only based on disk capacity (partition size). When the flag is disabled, the
diff --git a/chromium/third_party/blink/renderer/BUILD.gn b/chromium/third_party/blink/renderer/BUILD.gn
index 0d02c49b449..31405281623 100644
--- a/chromium/third_party/blink/renderer/BUILD.gn
+++ b/chromium/third_party/blink/renderer/BUILD.gn
@@ -40,6 +40,11 @@ config("inside_blink") {
"BLINK_IMPLEMENTATION=1",
"INSIDE_BLINK",
]
+ if (is_win) {
+ cflags += [
+ "/wd4101",
+ ]
+ }
if (is_clang) {
cflags += [
"-Wconversion",
diff --git a/chromium/third_party/blink/renderer/bindings/templates/callback_invoke.cc.tmpl b/chromium/third_party/blink/renderer/bindings/templates/callback_invoke.cc.tmpl
index 2598235ff3c..a6a006c56a8 100644
--- a/chromium/third_party/blink/renderer/bindings/templates/callback_invoke.cc.tmpl
+++ b/chromium/third_party/blink/renderer/bindings/templates/callback_invoke.cc.tmpl
@@ -208,7 +208,8 @@
// constant expression of type std::size_t and its value shall be greater than
// zero.
const int argc = {{non_variadic_arguments|length}} + {{variadic_argument.name}}.size();
- v8::Local<v8::Value> argv[std::max(1, argc)];
+ std::vector<v8::Local<v8::Value>> argvector(std::max(1, argc));
+ v8::Local<v8::Value>* argv = argvector.data();
{% for argument in non_variadic_arguments %}
argv[{{loop.index0}}] = {{argument.v8_name}};
{% endfor %}
diff --git a/chromium/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc b/chromium/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc
index 5ba701c0d81..4a23bec0a5d 100644
--- a/chromium/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc
+++ b/chromium/third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.cc
@@ -189,8 +189,8 @@ CanvasAsyncBlobCreator::CanvasAsyncBlobCreator(
// If image is lazy decoded, call readPixels() to trigger decoding.
if (skia_image->isLazyGenerated()) {
SkImageInfo info = SkImageInfo::MakeN32Premul(1, 1);
- uint8_t pixel[info.bytesPerPixel()];
- skia_image->readPixels(info, pixel, info.minRowBytes(), 0, 0);
+ std::vector<uint8_t> pixel(info.bytesPerPixel());
+ skia_image->readPixels(info, pixel.data(), info.minRowBytes(), 0, 0);
}
// For kHTMLCanvasToBlobCallback and kOffscreenCanvasConvertToBlobPromise
diff --git a/chromium/third_party/blink/renderer/platform/fonts/shaping/shape_result.cc b/chromium/third_party/blink/renderer/platform/fonts/shaping/shape_result.cc
index 3a73c9a9d8e..6cb415e4519 100644
--- a/chromium/third_party/blink/renderer/platform/fonts/shaping/shape_result.cc
+++ b/chromium/third_party/blink/renderer/platform/fonts/shaping/shape_result.cc
@@ -1116,15 +1116,17 @@ void ShapeResult::InsertRun(scoped_refptr<ShapeResult::RunInfo> run) {
// The runs are stored in result->m_runs in visual order. For LTR, we place
// the run to be inserted before the next run with a bigger character start
// index.
- const auto ltr_comparer = [](scoped_refptr<RunInfo>& run,
- unsigned start_index) {
+ const std::function<bool(scoped_refptr<RunInfo>&,unsigned)>
+ ltr_comparer = [](scoped_refptr<RunInfo>& run,
+ unsigned start_index) {
return run->start_index_ < start_index;
};
// For RTL, we place the run before the next run with a lower character
// index. Otherwise, for both directions, at the end.
- const auto rtl_comparer = [](scoped_refptr<RunInfo>& run,
- unsigned start_index) {
+ const std::function<bool(scoped_refptr<RunInfo>&,unsigned)>
+ rtl_comparer = [](scoped_refptr<RunInfo>& run,
+ unsigned start_index) {
return run->start_index_ > start_index;
};
diff --git a/chromium/third_party/blink/renderer/platform/heap/persistent_node.h b/chromium/third_party/blink/renderer/platform/heap/persistent_node.h
index bc76a0174b1..054c42b21ad 100644
--- a/chromium/third_party/blink/renderer/platform/heap/persistent_node.h
+++ b/chromium/third_party/blink/renderer/platform/heap/persistent_node.h
@@ -31,7 +31,7 @@ enum CrossThreadnessPersistentConfiguration {
template <CrossThreadnessPersistentConfiguration>
struct PersistentMutexTraits {
- struct [[maybe_unused]] Locker{};
+ struct Locker{};
static void AssertAcquired() {}
};
diff --git a/chromium/ui/gl/gl_utils.cc b/chromium/ui/gl/gl_utils.cc
index 697cbed5fe2..b603497b60a 100644
--- a/chromium/ui/gl/gl_utils.cc
+++ b/chromium/ui/gl/gl_utils.cc
@@ -42,7 +42,11 @@ void Hang() {
base::debug::Alias(&do_not_delete_me);
++do_not_delete_me;
+#ifdef _MSC_VER
+ _ReadWriteBarrier();
+#else
__asm__ volatile("");
+#endif
}
}
diff --git a/chromium/ui/views/BUILD.gn b/chromium/ui/views/BUILD.gn
index 4e5403b5534..98db8c2e120 100644
--- a/chromium/ui/views/BUILD.gn
+++ b/chromium/ui/views/BUILD.gn
@@ -744,7 +744,7 @@ jumbo_component("views") {
]
configs += [ "//build/config/linux/atk" ]
}
- } else if (is_win) {
+ } else if (is_win && !use_qt) {
public += [ "widget/desktop_aura/desktop_window_tree_host_win.h" ]
sources += [
"widget/desktop_aura/desktop_drag_drop_client_win.cc",
diff --git a/chromium/v8/src/torque/global-context.h b/chromium/v8/src/torque/global-context.h
index 940325b51aa..756200bb593 100644
--- a/chromium/v8/src/torque/global-context.h
+++ b/chromium/v8/src/torque/global-context.h
@@ -19,8 +19,8 @@ namespace torque {
class GlobalContext : public ContextualClass<GlobalContext> {
public:
- GlobalContext(GlobalContext&&) V8_NOEXCEPT = default;
- GlobalContext& operator=(GlobalContext&&) V8_NOEXCEPT = default;
+ GlobalContext(GlobalContext&&) = default;
+ GlobalContext& operator=(GlobalContext&&) = default;
explicit GlobalContext(Ast ast);
static Namespace* GetDefaultNamespace() { return Get().default_namespace_; }