mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Linux: Fix Check failed: generated_timestamp < total_latency_stage.end_time (see issue #3102)
This commit is contained in:
@@ -182,6 +182,11 @@ gfx::Vector2d CefBrowserPlatformDelegateNativeAura::GetUiWheelEventOffset(
|
|||||||
return gfx::Vector2d(deltaX, deltaY);
|
return gfx::Vector2d(deltaX, deltaY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
base::TimeTicks CefBrowserPlatformDelegateNativeAura::GetEventTimeStamp() {
|
||||||
|
return base::TimeTicks::Now();
|
||||||
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
int CefBrowserPlatformDelegateNativeAura::TranslateUiEventModifiers(
|
int CefBrowserPlatformDelegateNativeAura::TranslateUiEventModifiers(
|
||||||
uint32 cef_modifiers) {
|
uint32 cef_modifiers) {
|
||||||
|
@@ -66,9 +66,9 @@ class CefBrowserPlatformDelegateNativeAura
|
|||||||
int deltaX,
|
int deltaX,
|
||||||
int deltaY) const;
|
int deltaY) const;
|
||||||
virtual gfx::Vector2d GetUiWheelEventOffset(int deltaX, int deltaY) const;
|
virtual gfx::Vector2d GetUiWheelEventOffset(int deltaX, int deltaY) const;
|
||||||
virtual base::TimeTicks GetEventTimeStamp() const = 0;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
static base::TimeTicks GetEventTimeStamp();
|
||||||
static int TranslateUiEventModifiers(uint32 cef_modifiers);
|
static int TranslateUiEventModifiers(uint32 cef_modifiers);
|
||||||
static int TranslateUiChangedButtonFlags(uint32 cef_modifiers);
|
static int TranslateUiChangedButtonFlags(uint32 cef_modifiers);
|
||||||
|
|
||||||
|
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
#include "libcef/browser/native/browser_platform_delegate_native_linux.h"
|
#include "libcef/browser/native/browser_platform_delegate_native_linux.h"
|
||||||
|
|
||||||
#include <sys/sysinfo.h>
|
|
||||||
|
|
||||||
#include "libcef/browser/browser_host_base.h"
|
#include "libcef/browser/browser_host_base.h"
|
||||||
#include "libcef/browser/context.h"
|
#include "libcef/browser/context.h"
|
||||||
#include "libcef/browser/native/menu_runner_linux.h"
|
#include "libcef/browser/native/menu_runner_linux.h"
|
||||||
@@ -30,18 +28,6 @@
|
|||||||
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h"
|
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
// Returns the number of seconds since system boot.
|
|
||||||
long GetSystemUptime() {
|
|
||||||
struct sysinfo info;
|
|
||||||
if (sysinfo(&info) == 0)
|
|
||||||
return info.uptime;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
CefBrowserPlatformDelegateNativeLinux::CefBrowserPlatformDelegateNativeLinux(
|
CefBrowserPlatformDelegateNativeLinux::CefBrowserPlatformDelegateNativeLinux(
|
||||||
const CefWindowInfo& window_info,
|
const CefWindowInfo& window_info,
|
||||||
SkColor background_color)
|
SkColor background_color)
|
||||||
@@ -328,8 +314,3 @@ CefBrowserPlatformDelegateNativeLinux::TranslateWebKeyEvent(
|
|||||||
}
|
}
|
||||||
return content::NativeWebKeyboardEvent(ui_event);
|
return content::NativeWebKeyboardEvent(ui_event);
|
||||||
}
|
}
|
||||||
|
|
||||||
base::TimeTicks CefBrowserPlatformDelegateNativeLinux::GetEventTimeStamp()
|
|
||||||
const {
|
|
||||||
return base::TimeTicks() + base::TimeDelta::FromSeconds(GetSystemUptime());
|
|
||||||
}
|
|
||||||
|
@@ -41,7 +41,6 @@ class CefBrowserPlatformDelegateNativeLinux
|
|||||||
ui::KeyEvent TranslateUiKeyEvent(const CefKeyEvent& key_event) const override;
|
ui::KeyEvent TranslateUiKeyEvent(const CefKeyEvent& key_event) const override;
|
||||||
content::NativeWebKeyboardEvent TranslateWebKeyEvent(
|
content::NativeWebKeyboardEvent TranslateWebKeyEvent(
|
||||||
const CefKeyEvent& key_event) const override;
|
const CefKeyEvent& key_event) const override;
|
||||||
base::TimeTicks GetEventTimeStamp() const override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// True if the host window has been created.
|
// True if the host window has been created.
|
||||||
|
@@ -486,10 +486,6 @@ gfx::Vector2d CefBrowserPlatformDelegateNativeWin::GetUiWheelEventOffset(
|
|||||||
return gfx::Vector2d(scrollDeltaX, scrollDeltaY);
|
return gfx::Vector2d(scrollDeltaX, scrollDeltaY);
|
||||||
}
|
}
|
||||||
|
|
||||||
base::TimeTicks CefBrowserPlatformDelegateNativeWin::GetEventTimeStamp() const {
|
|
||||||
return base::TimeTicks::Now();
|
|
||||||
}
|
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void CefBrowserPlatformDelegateNativeWin::RegisterWindowClass() {
|
void CefBrowserPlatformDelegateNativeWin::RegisterWindowClass() {
|
||||||
static bool registered = false;
|
static bool registered = false;
|
||||||
|
@@ -41,7 +41,6 @@ class CefBrowserPlatformDelegateNativeWin
|
|||||||
// CefBrowserPlatformDelegateNativeAura methods:
|
// CefBrowserPlatformDelegateNativeAura methods:
|
||||||
ui::KeyEvent TranslateUiKeyEvent(const CefKeyEvent& key_event) const override;
|
ui::KeyEvent TranslateUiKeyEvent(const CefKeyEvent& key_event) const override;
|
||||||
gfx::Vector2d GetUiWheelEventOffset(int deltaX, int deltaY) const override;
|
gfx::Vector2d GetUiWheelEventOffset(int deltaX, int deltaY) const override;
|
||||||
base::TimeTicks GetEventTimeStamp() const override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void RegisterWindowClass();
|
static void RegisterWindowClass();
|
||||||
|
Reference in New Issue
Block a user