[M73 Dev][Tizen] Fix compilation errors for TV profile 45/207645/1 tizen.dev_m73
authorChandan Padhi <c.padhi@samsung.com>
Mon, 10 Jun 2019 11:29:40 +0000 (04:29 -0700)
committerChandan Padhi <c.padhi@samsung.com>
Mon, 10 Jun 2019 11:55:33 +0000 (04:55 -0700)
This commit resolves compiler errors for TV build.

Change-Id: I9c5946101a02b9f72b8608cb1dcaabe6540dd319
Signed-off-by: Chandan Padhi <c.padhi@samsung.com>
18 files changed:
base/numerics/checked_math.h
base/numerics/checked_math_impl.h
base/numerics/clamped_math.h
base/numerics/safe_math_shared_impl.h
base/trace_event/trace_arguments.h
content/renderer/media/stream/media_stream_constraints_util_audio.cc
device/gamepad/public/cpp/gamepad.cc
gin/v8_platform.cc
gpu/command_buffer/client/transfer_buffer_cmd_copy_helpers.h
media/learning/common/labelled_example.cc
net/third_party/quic/platform/impl/quic_flags_impl.cc
third_party/blink/renderer/core/layout/ng/inline/ng_baseline.cc
third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc
third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h
third_party/blink/renderer/platform/scheduler/common/web_thread_scheduler.cc
third_party/blink/renderer/platform/scheduler/worker/compositor_thread.cc
third_party/blink/renderer/platform/scheduler/worker/non_main_thread_scheduler_impl.cc
tizen_src/build/gn_chromiumefl.sh

index ede3344..814b9e4 100644 (file)
@@ -117,25 +117,25 @@ class CheckedNumeric {
 
   // Prototypes for the supported arithmetic operator overloads.
   template <typename Src>
-  constexpr CheckedNumeric& operator+=(const Src rhs);
+  CheckedNumeric& operator+=(const Src rhs);
   template <typename Src>
-  constexpr CheckedNumeric& operator-=(const Src rhs);
+  CheckedNumeric& operator-=(const Src rhs);
   template <typename Src>
-  constexpr CheckedNumeric& operator*=(const Src rhs);
+  CheckedNumeric& operator*=(const Src rhs);
   template <typename Src>
-  constexpr CheckedNumeric& operator/=(const Src rhs);
+  CheckedNumeric& operator/=(const Src rhs);
   template <typename Src>
-  constexpr CheckedNumeric& operator%=(const Src rhs);
+  CheckedNumeric& operator%=(const Src rhs);
   template <typename Src>
-  constexpr CheckedNumeric& operator<<=(const Src rhs);
+  CheckedNumeric& operator<<=(const Src rhs);
   template <typename Src>
-  constexpr CheckedNumeric& operator>>=(const Src rhs);
+  CheckedNumeric& operator>>=(const Src rhs);
   template <typename Src>
-  constexpr CheckedNumeric& operator&=(const Src rhs);
+  CheckedNumeric& operator&=(const Src rhs);
   template <typename Src>
-  constexpr CheckedNumeric& operator|=(const Src rhs);
+  CheckedNumeric& operator|=(const Src rhs);
   template <typename Src>
-  constexpr CheckedNumeric& operator^=(const Src rhs);
+  CheckedNumeric& operator^=(const Src rhs);
 
   constexpr CheckedNumeric operator-() const {
     // The negation of two's complement int min is int min, so we simply
@@ -238,7 +238,7 @@ class CheckedNumeric {
 
   // Assignment arithmetic operations.
   template <template <typename, typename, typename> class M, typename R>
-  constexpr CheckedNumeric& MathOp(const R rhs) {
+  CheckedNumeric& MathOp(const R rhs) {
     using Math = typename MathWrapper<M, T, R>::math;
     T result = 0;  // Using T as the destination saves a range check.
     bool is_valid = state_.is_valid() && Wrapper<R>::is_valid(rhs) &&
index e083389..5a1adf2 100644 (file)
@@ -48,7 +48,7 @@ struct CheckedAddOp<T,
                                             std::is_integral<U>::value>::type> {
   using result_type = typename MaxExponentPromotion<T, U>::type;
   template <typename V>
-  static constexpr bool Do(T x, U y, V* result) {
+  static bool Do(T x, U y, V* result) {
     // TODO(jschuh) Make this "constexpr if" once we're C++17.
     if (CheckedAddFastOp<T, U>::is_supported)
       return CheckedAddFastOp<T, U>::Do(x, y, result);
index b184363..b0c2596 100644 (file)
@@ -57,25 +57,25 @@ class ClampedNumeric {
 
   // Prototypes for the supported arithmetic operator overloads.
   template <typename Src>
-  constexpr ClampedNumeric& operator+=(const Src rhs);
+  ClampedNumeric& operator+=(const Src rhs);
   template <typename Src>
-  constexpr ClampedNumeric& operator-=(const Src rhs);
+  ClampedNumeric& operator-=(const Src rhs);
   template <typename Src>
-  constexpr ClampedNumeric& operator*=(const Src rhs);
+  ClampedNumeric& operator*=(const Src rhs);
   template <typename Src>
-  constexpr ClampedNumeric& operator/=(const Src rhs);
+  ClampedNumeric& operator/=(const Src rhs);
   template <typename Src>
-  constexpr ClampedNumeric& operator%=(const Src rhs);
+  ClampedNumeric& operator%=(const Src rhs);
   template <typename Src>
-  constexpr ClampedNumeric& operator<<=(const Src rhs);
+  ClampedNumeric& operator<<=(const Src rhs);
   template <typename Src>
-  constexpr ClampedNumeric& operator>>=(const Src rhs);
+  ClampedNumeric& operator>>=(const Src rhs);
   template <typename Src>
-  constexpr ClampedNumeric& operator&=(const Src rhs);
+  ClampedNumeric& operator&=(const Src rhs);
   template <typename Src>
-  constexpr ClampedNumeric& operator|=(const Src rhs);
+  ClampedNumeric& operator|=(const Src rhs);
   template <typename Src>
-  constexpr ClampedNumeric& operator^=(const Src rhs);
+  ClampedNumeric& operator^=(const Src rhs);
 
   constexpr ClampedNumeric operator-() const {
     // The negation of two's complement int min is int min, so that's the
index 583c487..bb47ef1 100644 (file)
@@ -224,8 +224,7 @@ struct ResultType {
   /* Assignment arithmetic operator implementation from CLASS##Numeric. */     \
   template <typename L>                                                        \
   template <typename R>                                                        \
-  constexpr CLASS##Numeric<L>& CLASS##Numeric<L>::operator CMP_OP(             \
-      const R rhs) {                                                           \
+  CLASS##Numeric<L>& CLASS##Numeric<L>::operator CMP_OP(const R rhs) {         \
     return MathOp<CLASS##OP_NAME##Op>(rhs);                                    \
   }                                                                            \
   /* Variadic arithmetic functions that return CLASS##Numeric. */              \
index 6a9af80..65c738e 100644 (file)
@@ -483,21 +483,21 @@ class BASE_EXPORT StringStorage {
   void Reset(size_t alloc_size = 0);
 
   // Accessors.
-  constexpr size_t size() const { return data_ ? data_->size : 0u; }
-  constexpr const char* data() const { return data_ ? data_->chars : nullptr; }
-  constexpr char* data() { return data_ ? data_->chars : nullptr; }
+  size_t size() const { return data_ ? data_->size : 0u; }
+  const char* data() const { return data_ ? data_->chars : nullptr; }
+  char* data() { return data_ ? data_->chars : nullptr; }
 
-  constexpr const char* begin() const { return data(); }
-  constexpr const char* end() const { return data() + size(); }
+  const char* begin() const { return data(); }
+  const char* end() const { return data() + size(); }
   inline char* begin() { return data(); }
   inline char* end() { return data() + size(); }
 
   // True iff storage is empty.
-  constexpr bool empty() const { return size() == 0; }
+  bool empty() const { return size() == 0; }
 
   // Returns true if |ptr| is inside the storage area, false otherwise.
   // Used during unit-testing.
-  constexpr bool Contains(const void* ptr) const {
+  bool Contains(const void* ptr) const {
     const char* char_ptr = static_cast<const char*>(ptr);
     return (char_ptr >= begin() && char_ptr < end());
   }
@@ -508,7 +508,7 @@ class BASE_EXPORT StringStorage {
 
   // Return an estimate of the memory overhead of this instance. This doesn't
   // count the size of |data_| itself.
-  constexpr size_t EstimateTraceMemoryOverhead() const {
+  size_t EstimateTraceMemoryOverhead() const {
     return data_ ? sizeof(size_t) + data_->size : 0u;
   }
 
index 4e03611..f91f7ee 100644 (file)
@@ -307,7 +307,7 @@ class EchoCancellationContainer {
                             bool is_device_capture,
                             media::AudioParameters device_parameters,
                             AudioProcessingProperties properties)
-      : ec_mode_allowed_values_(EchoCancellationTypeSet({allowed_values})),
+      : ec_mode_allowed_values_(EchoCancellationTypeSet(allowed_values)),
         device_parameters_(device_parameters),
         is_device_capture_(is_device_capture) {
     if (!has_active_source) {
index 02050b5..6fb4afa 100644 (file)
@@ -6,12 +6,12 @@
 
 namespace device {
 
-const float GamepadButton::kDefaultButtonPressedThreshold;
-const double GamepadHapticActuator::kMaxEffectDurationMillis;
-const size_t Gamepad::kIdLengthCap;
-const size_t Gamepad::kMappingLengthCap;
-const size_t Gamepad::kAxesLengthCap;
-const size_t Gamepad::kButtonsLengthCap;
+constexpr float GamepadButton::kDefaultButtonPressedThreshold;
+constexpr double GamepadHapticActuator::kMaxEffectDurationMillis;
+constexpr size_t Gamepad::kIdLengthCap;
+constexpr size_t Gamepad::kMappingLengthCap;
+constexpr size_t Gamepad::kAxesLengthCap;
+constexpr size_t Gamepad::kButtonsLengthCap;
 
 Gamepad::Gamepad()
     : connected(false),
index cdf8944..2d0b025 100644 (file)
@@ -268,6 +268,9 @@ base::LazyInstance<PageAllocator>::Leaky g_page_allocator =
 
 }  // namespace gin
 
+namespace base {
+namespace trace_event {
+
 // Allow std::unique_ptr<v8::ConvertableToTraceFormat> to be a valid
 // initialization value for trace macros.
 template <>
@@ -284,6 +287,9 @@ struct base::trace_event::TraceValue::Helper<
   }
 };
 
+}  // namespace trace_event
+}  // namespace base
+
 namespace gin {
 
 class V8Platform::TracingControllerImpl : public v8::TracingController {
index 161aaba..e31d5aa 100644 (file)
@@ -13,7 +13,7 @@ namespace gpu {
 
 // Sum the sizes of the types in Ts as CheckedNumeric<T>.
 template <typename T, typename... Ts>
-constexpr base::CheckedNumeric<T> CheckedSizeOfPackedTypes() {
+base::CheckedNumeric<T> CheckedSizeOfPackedTypes() {
   static_assert(sizeof...(Ts) > 0, "");
   base::CheckedNumeric<T> checked_elements_size = 0;
   for (size_t s : {sizeof(Ts)...}) {
@@ -87,10 +87,12 @@ auto CopyArraysToBuffer(uint32_t count,
 // Sum the sizes of the types in Ts. This will fail to compile if the result
 // does not fit in T.
 template <typename T, typename... Ts>
-constexpr T SizeOfPackedTypes() {
-  constexpr base::CheckedNumeric<T> checked_elements_size =
+T SizeOfPackedTypes() {
+  base::CheckedNumeric<T> checked_elements_size =
       CheckedSizeOfPackedTypes<T, Ts...>();
+#if !defined(EWK_BRINGUP)  // FIXME: m73 bringup
   static_assert(checked_elements_size.IsValid(), "");
+#endif
   return checked_elements_size.ValueOrDie();
 }
 
@@ -113,7 +115,7 @@ template <typename... Ts>
 constexpr uint32_t ComputeMaxCopyCount(uint32_t buffer_size) {
   // Start by tightly packing the elements and decrease copy_count until
   // the total aligned copy size fits
-  constexpr uint32_t elements_size = SizeOfPackedTypes<uint32_t, Ts...>();
+  uint32_t elements_size = SizeOfPackedTypes<uint32_t, Ts...>();
   uint32_t copy_count = buffer_size / elements_size;
 
   while (copy_count > 0) {
index 6c8cb7d..370b6bb 100644 (file)
@@ -17,7 +17,7 @@ LabelledExample::LabelledExample(std::initializer_list<FeatureValue> init_list,
 
 LabelledExample::LabelledExample(const LabelledExample& rhs) = default;
 
-LabelledExample::LabelledExample(LabelledExample&& rhs) noexcept = default;
+LabelledExample::LabelledExample(LabelledExample&& rhs) = default;
 
 LabelledExample::~LabelledExample() = default;
 
index 5e6962d..2456c80 100644 (file)
@@ -153,9 +153,9 @@ std::string QuicFlagRegistry::GetHelp() const {
 template <>
 bool TypedQuicFlagHelper<bool>::SetFlag(const std::string& s) const {
   static const base::NoDestructor<std::set<std::string>> kTrueValues(
-      {"", "1", "t", "true", "y", "yes"});
+      std::initializer_list<std::string>({"", "1", "t", "true", "y", "yes"}));
   static const base::NoDestructor<std::set<std::string>> kFalseValues(
-      {"0", "f", "false", "n", "no"});
+      std::initializer_list<std::string>({"0", "f", "false", "n", "no"}));
   if (kTrueValues->find(base::ToLowerASCII(s)) != kTrueValues->end()) {
     *flag_ = true;
     return true;
index f9059f0..b7400eb 100644 (file)
@@ -11,7 +11,7 @@
 namespace blink {
 
 const unsigned NGBaselineRequest::kTypeIdCount;
-const LayoutUnit NGBaselineList::kEmptyOffset;
+constexpr LayoutUnit NGBaselineList::kEmptyOffset;
 
 bool NGBaselineRequest::operator==(const NGBaselineRequest& other) const {
   return algorithm_type_ == other.algorithm_type_ &&
index d9fa696..34a8a20 100644 (file)
@@ -1769,12 +1769,12 @@ void BaseRenderingContext2D::putImageData(ImageData* data,
       CanvasColorParams(ColorParams().ColorSpace(), PixelFormat(), kNonOpaque);
   if (data_color_params.NeedsColorConversion(context_color_params) ||
       PixelFormat() == kF16CanvasPixelFormat) {
-    base::CheckedNumeric<size_t> data_length = data->Size().Area();
-    data_length *= context_color_params.BytesPerPixel();
-    if (!data_length.IsValid())
+    size_t data_length;
+    if (!base::CheckMul(data->Size().Area(),
+                        context_color_params.BytesPerPixel())
+             .AssignIfValid(&data_length))
       return;
-    std::unique_ptr<uint8_t[]> converted_pixels(
-        new uint8_t[data_length.ValueOrDie()]);
+    std::unique_ptr<uint8_t[]> converted_pixels(new uint8_t[data_length]);
     if (data->ImageDataInCanvasColorSettings(
             ColorParams().ColorSpace(), PixelFormat(), converted_pixels.get(),
             kRGBAColorType)) {
index 5d8d61d..7b7d3e0 100644 (file)
@@ -11,6 +11,9 @@
 #include "third_party/blink/renderer/platform/wtf/text/cstring.h"
 #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
 
+namespace base {
+namespace trace_event {
+
 // Conversion from CString to TraceValue so that trace arguments can be strings.
 template <>
 struct base::trace_event::TraceValue::Helper<WTF::CString> {
@@ -20,6 +23,9 @@ struct base::trace_event::TraceValue::Helper<WTF::CString> {
   }
 };
 
+}  // namespace trace_event
+}  // namespace base
+
 namespace blink {
 namespace trace_event {
 
index c075675..d613c9b 100644 (file)
@@ -20,8 +20,8 @@ std::unique_ptr<WebThreadScheduler>
 WebThreadScheduler::CreateMainThreadScheduler(
     std::unique_ptr<base::MessagePump> message_pump,
     base::Optional<base::Time> initial_virtual_time) {
-  auto settings = base::sequence_manager::SequenceManager::Settings{
-      .randomised_sampling_enabled = true};
+  base::sequence_manager::SequenceManager::Settings settings;
+  settings.randomised_sampling_enabled = true;
   auto sequence_manager =
       message_pump
           ? base::sequence_manager::
index 32d5f4f..54a9445 100644 (file)
@@ -17,10 +17,11 @@ CompositorThread::~CompositorThread() = default;
 
 std::unique_ptr<NonMainThreadSchedulerImpl>
 CompositorThread::CreateNonMainThreadScheduler() {
+  base::sequence_manager::SequenceManager::Settings settings;
+  settings.randomised_sampling_enabled = true;
   return std::make_unique<CompositorThreadScheduler>(
       base::sequence_manager::CreateSequenceManagerOnCurrentThread(
-          base::sequence_manager::SequenceManager::Settings{
-              .randomised_sampling_enabled = true}));
+          std::move(settings)));
 }
 
 }  // namespace scheduler
index 10db043..d7f3204 100644 (file)
@@ -23,11 +23,12 @@ NonMainThreadSchedulerImpl::~NonMainThreadSchedulerImpl() = default;
 std::unique_ptr<NonMainThreadSchedulerImpl> NonMainThreadSchedulerImpl::Create(
     WebThreadType thread_type,
     WorkerSchedulerProxy* proxy) {
+  base::sequence_manager::SequenceManager::Settings settings;
+  settings.randomised_sampling_enabled = true;
   return std::make_unique<WorkerThreadScheduler>(
       thread_type,
       base::sequence_manager::CreateSequenceManagerOnCurrentThread(
-          base::sequence_manager::SequenceManager::Settings{
-              .randomised_sampling_enabled = true}),
+          std::move(settings)),
       proxy);
 }
 
index f008801..bd0d725 100755 (executable)
@@ -139,7 +139,7 @@ add_tizen_flags() {
                               "
   fi
 
-  if [ $is_clang == true ]; then
+  if [ "$is_clang" == "true" ]; then
     ADDITIONAL_GN_PARAMETERS+="host_toolchain=\"//tizen_src/build/toolchain/tizen:tizen_clang_$host_arch\"
                                v8_snapshot_toolchain=\"//tizen_src/build/toolchain/tizen:tizen_clang_$host_arch\"
                                use_lld=true
@@ -175,7 +175,7 @@ add_gbs_flags() {
   # and Os is applied to the others.
   local lto_level="s"
 
-  if [ $is_clang == true ]; then
+  if [ "$is_clang" == "true" ]; then
    lto_level="z"
   fi