-Check the pointer is not null before using,
otherwise this causes the render process crashes.
-Add some macro.
reference:
https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/274002/
Change-Id: I617b8c7ee002e9b3e185aa27c17d19c9c90bb4e5
Signed-off-by: wangjing <jing124.wang@samsung.com>
#include "third_party/blink/public/platform/cross_variant_mojo_util.h"
#include "third_party/blink/public/platform/scheduler/web_agent_group_scheduler.h"
#include "third_party/blink/public/platform/web_common.h"
#include "third_party/blink/public/platform/cross_variant_mojo_util.h"
#include "third_party/blink/public/platform/scheduler/web_agent_group_scheduler.h"
#include "third_party/blink/public/platform/web_common.h"
+#if BUILDFLAG(IS_TIZEN_TV)
#include "third_party/blink/renderer/core/scroll/scroll_types.h"
#include "third_party/blink/renderer/core/scroll/scroll_types.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/display/mojom/screen_orientation.mojom-shared.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/display/mojom/screen_orientation.mojom-shared.h"
bool ScrollManager::LogicalScroll(mojom::blink::ScrollDirection direction,
ui::ScrollGranularity granularity,
Node* start_node,
bool ScrollManager::LogicalScroll(mojom::blink::ScrollDirection direction,
ui::ScrollGranularity granularity,
Node* start_node,
- Node* mouse_press_node,
- float data) {
+ Node* mouse_press_node
+#if BUILDFLAG(IS_TIZEN_TV)
+ ,
+ float data
+#endif
+ ) {
Node* node = start_node;
if (!node)
Node* node = start_node;
if (!node)
ScrollableArea* scrollable_area = ScrollableArea::GetForScrolling(box);
DCHECK(scrollable_area);
ScrollableArea* scrollable_area = ScrollableArea::GetForScrolling(box);
DCHECK(scrollable_area);
+#if BUILDFLAG(IS_TIZEN_TV)
+ if (!scrollable_area) {
+ LOG(ERROR) << " Scrollable area is NULL";
+ return false;
+ }
+#endif
+
ScrollOffset delta =
ToScrollDelta(physical_direction,
ScrollableArea::DirectionBasedScrollDelta(granularity));
ScrollOffset delta =
ToScrollDelta(physical_direction,
ScrollableArea::DirectionBasedScrollDelta(granularity));
area->OnScrollFinished();
},
WrapWeakPersistent(scrollable_area)));
area->OnScrollFinished();
},
WrapWeakPersistent(scrollable_area)));
+#if BUILDFLAG(IS_TIZEN_TV)
ScrollResult result = scrollable_area->UserScroll(
granularity,
ToScrollDelta(physical_direction, data),
std::move(callback));
ScrollResult result = scrollable_area->UserScroll(
granularity,
ToScrollDelta(physical_direction, data),
std::move(callback));
+#else
+ ScrollResult result = scrollable_area->UserScroll(
+ granularity,
+ ToScrollDelta(physical_direction,
+ ScrollableArea::DirectionBasedScrollDelta(granularity)),
+ std::move(callback));
+#endif
if (result.DidScroll())
return true;
if (result.DidScroll())
return true;
bool LogicalScroll(mojom::blink::ScrollDirection,
ui::ScrollGranularity,
Node* start_node,
bool LogicalScroll(mojom::blink::ScrollDirection,
ui::ScrollGranularity,
Node* start_node,
- Node* mouse_press_node,
- float data = 1.0);
+ Node* mouse_press_node
+#if BUILDFLAG(IS_TIZEN_TV)
+ ,
+ float data = 1.0
+#endif
+ );
// Performs a logical scroll that chains, crossing frames, starting from
// the given node or a reasonable default (focus/last clicked).
// Performs a logical scroll that chains, crossing frames, starting from
// the given node or a reasonable default (focus/last clicked).