| Index: third_party/WebKit/public/platform/modules/device_orientation/WebDeviceOrientationData.h
|
| diff --git a/third_party/WebKit/public/platform/modules/device_orientation/WebDeviceOrientationListener.h b/third_party/WebKit/public/platform/modules/device_orientation/WebDeviceOrientationData.h
|
| similarity index 62%
|
| copy from third_party/WebKit/public/platform/modules/device_orientation/WebDeviceOrientationListener.h
|
| copy to third_party/WebKit/public/platform/modules/device_orientation/WebDeviceOrientationData.h
|
| index e0b0ac6f96a5f0e2e6b0f552d05e284c0945d0e4..aea1d63791221d19bd85b732e7067317ac0d7ab8 100644
|
| --- a/third_party/WebKit/public/platform/modules/device_orientation/WebDeviceOrientationListener.h
|
| +++ b/third_party/WebKit/public/platform/modules/device_orientation/WebDeviceOrientationData.h
|
| @@ -1,5 +1,5 @@
|
| /*
|
| - * Copyright (C) 2013 Google Inc. All rights reserved.
|
| + * Copyright (C) 2017 Google Inc. All rights reserved.
|
| *
|
| * Redistribution and use in source and binary forms, with or without
|
| * modification, are permitted provided that the following conditions are
|
| @@ -28,25 +28,44 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#ifndef WebDeviceOrientationListener_h
|
| -#define WebDeviceOrientationListener_h
|
| +#ifndef WebDeviceOrientationData_h
|
| +#define WebDeviceOrientationData_h
|
|
|
| -#include "public/platform/WebPlatformEventListener.h"
|
| -
|
| -namespace device {
|
| -class OrientationData;
|
| -}
|
| +#include <string.h>
|
|
|
| namespace blink {
|
|
|
| -class WebDeviceOrientationListener : public WebPlatformEventListener {
|
| +#pragma pack(push, 1)
|
| +
|
| +class WebDeviceOrientationData {
|
| public:
|
| - // This method is called every time new device orientation data is available.
|
| - virtual void DidChangeDeviceOrientation(const device::OrientationData&) = 0;
|
| + WebDeviceOrientationData() {
|
| + // Make sure to zero out the memory so that there are no uninitialized bits.
|
| + // This object is used in the shared memory buffer and is memory copied by
|
| + // two processes. Valgrind will complain if we copy around memory that is
|
| + // only partially initialized.
|
| + memset(this, 0, sizeof(*this));
|
| + }
|
| +
|
| + ~WebDeviceOrientationData() {}
|
| +
|
| + double alpha;
|
| + double beta;
|
| + double gamma;
|
|
|
| - virtual ~WebDeviceOrientationListener() {}
|
| + bool has_alpha : 1;
|
| + bool has_beta : 1;
|
| + bool has_gamma : 1;
|
| +
|
| + bool absolute : 1;
|
| };
|
|
|
| +static_assert(sizeof(WebDeviceOrientationData) ==
|
| + (3 * sizeof(double) + 1 * sizeof(char)),
|
| + "WebDeviceOrientationData has wrong size");
|
| +
|
| +#pragma pack(pop)
|
| +
|
| } // namespace blink
|
|
|
| -#endif // WebDeviceOrientationListener_h
|
| +#endif // WebDeviceOrientationData_h
|
|
|