Commit f9996da5 authored by Dave Tapuska's avatar Dave Tapuska Committed by Commit Bot

Move cc::TouchAction IPC mojo definition into CC.

In order to use cc::TouchAction on the blink mojom API we require it the
definition to move to somewhere blink can depend on (not content).

Being that touch_action is defined in CC it seems natural to introduce it
there.

BUG=1008432

Change-Id: I62ab198a169bd242d36e27a5357636800e296593
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1867036Reviewed-by: default avatarKen Rockot <rockot@google.com>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatardanakj <danakj@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708796}
parent 377a2412
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//cc/cc.gni")
cc_component("ipc") {
output_name = "cc_ipc"
sources = [
"cc_param_traits.cc",
"cc_param_traits_macros.h",
]
defines = [ "IS_CC_IPC_IMPL" ]
public_deps = [
"//base",
"//cc",
"//ipc",
]
}
per-file *_param_traits*.*=set noparent
per-file *_param_traits*.*=file://ipc/SECURITY_OWNERS
# cc/ipc
[TOC]
## Overview
cc/ipc provides Chrome IPC legacy param trait validators. cc based
structures that are defined in C++ and have mojo based NativeEnum
definitions require validators. See cc/mojom for the mojo definitions.
Eventually all cc based structures should be defined solely in
mojo and then this directory can be removed. However, this will
not happen until all structures are sent via mojo only.
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cc/ipc/cc_param_traits_macros.h"
#include "ipc/param_traits_write_macros.h"
namespace IPC {
#undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_
#include "cc/ipc/cc_param_traits_macros.h"
} // namespace IPC
// Generate param traits read methods.
#include "ipc/param_traits_read_macros.h"
namespace IPC {
#undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_
#include "cc/ipc/cc_param_traits_macros.h"
} // namespace IPC
// Generate param traits log methods.
#include "ipc/param_traits_log_macros.h"
namespace IPC {
#undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_
#include "cc/ipc/cc_param_traits_macros.h"
} // namespace IPC
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CC_IPC_CC_PARAM_TRAITS_MACROS_H_
#define CC_IPC_CC_PARAM_TRAITS_MACROS_H_
#include "base/component_export.h"
#include "cc/input/touch_action.h"
#include "ipc/ipc_message_macros.h"
#undef IPC_MESSAGE_EXPORT
#define IPC_MESSAGE_EXPORT COMPONENT_EXPORT(CC_IPC)
IPC_ENUM_TRAITS_MAX_VALUE(cc::TouchAction, cc::TouchAction::kTouchActionMax)
#endif // CC_IPC_CC_PARAM_TRAITS_MACROS_H_
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//mojo/public/tools/bindings/mojom.gni")
mojom("mojom") {
sources = [
"touch_action.mojom",
]
public_deps = [
"//mojo/public/mojom/base",
]
}
per-file *.mojom=set noparent
per-file *.mojom=file://ipc/SECURITY_OWNERS
per-file *.typemap=set noparent
per-file *.typemap=file://ipc/SECURITY_OWNERS
# cc/mojom
[TOC]
## Overview
cc/mojom provides the mojom typemaps for cc types. This directory is where
cc types that appear as part of mojo APIs should be placed. Structures that
are defined in C++ and have mojo based NativeEnum definitions will
require legacy Chrome IPC validators, see cc/ipc.
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module cc.mojom;
[Native]
enum TouchAction;
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
mojom = "//cc/mojom/touch_action.mojom"
public_headers = [ "//cc/input/touch_action.h" ]
traits_headers = [ "//cc/ipc/cc_param_traits_macros.h" ]
type_mappings = [ "cc.mojom.TouchAction=::cc::TouchAction" ]
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
typemaps = [ "//cc/mojom/touch_action.typemap" ]
...@@ -249,6 +249,7 @@ source_set("common") { ...@@ -249,6 +249,7 @@ source_set("common") {
public_deps = [ public_deps = [
":mojo_bindings", ":mojo_bindings",
"//cc", "//cc",
"//cc/ipc",
"//gpu/command_buffer/common", "//gpu/command_buffer/common",
"//ipc", "//ipc",
"//services/network:network_service", "//services/network:network_service",
...@@ -502,6 +503,7 @@ mojom("mojo_bindings") { ...@@ -502,6 +503,7 @@ mojom("mojo_bindings") {
import_dirs = [ "//mojo/services" ] import_dirs = [ "//mojo/services" ]
public_deps = [ public_deps = [
"//cc/mojom",
"//components/tracing/common:interfaces", "//components/tracing/common:interfaces",
"//content/public/common:interfaces", "//content/public/common:interfaces",
"//content/public/common:resource_type_bindings", "//content/public/common:resource_type_bindings",
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#define CONTENT_COMMON_CONTENT_PARAM_TRAITS_H_ #define CONTENT_COMMON_CONTENT_PARAM_TRAITS_H_
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "cc/ipc/cc_param_traits_macros.h"
#include "content/common/content_param_traits_macros.h" #include "content/common/content_param_traits_macros.h"
#include "content/common/cursors/webcursor.h" #include "content/common/cursors/webcursor.h"
#include "ipc/ipc_mojo_param_traits.h" #include "ipc/ipc_mojo_param_traits.h"
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
module content.mojom; module content.mojom;
import "cc/mojom/touch_action.mojom";
import "content/common/input/synchronous_compositor.mojom"; import "content/common/input/synchronous_compositor.mojom";
import "content/common/native_types.mojom"; import "content/common/native_types.mojom";
import "mojo/public/mojom/base/string16.mojom"; import "mojo/public/mojom/base/string16.mojom";
...@@ -161,7 +162,7 @@ struct Event { ...@@ -161,7 +162,7 @@ struct Event {
}; };
struct TouchActionOptional { struct TouchActionOptional {
TouchAction touch_action; cc.mojom.TouchAction touch_action;
}; };
// Interface exposed by the browser to the renderer. The messages // Interface exposed by the browser to the renderer. The messages
...@@ -176,7 +177,7 @@ interface WidgetInputHandlerHost { ...@@ -176,7 +177,7 @@ interface WidgetInputHandlerHost {
// When the renderer's main thread computes the touch action, send this to the // When the renderer's main thread computes the touch action, send this to the
// browser. // browser.
SetTouchActionFromMain(TouchAction touch_action); SetTouchActionFromMain(cc.mojom.TouchAction touch_action);
// The whitelisted touch action and the associated unique touch event id // The whitelisted touch action and the associated unique touch event id
// for a new touch point sent by the compositor. The unique touch event id is // for a new touch point sent by the compositor. The unique touch event id is
...@@ -184,7 +185,7 @@ interface WidgetInputHandlerHost { ...@@ -184,7 +185,7 @@ interface WidgetInputHandlerHost {
// with the correct touch event. The input event ack state is needed when // with the correct touch event. The input event ack state is needed when
// the touchstart message was not sent to the renderer and the touch // the touchstart message was not sent to the renderer and the touch
// actions need to be reset and the touch ack timeout needs to be started. // actions need to be reset and the touch ack timeout needs to be started.
SetWhiteListedTouchAction(TouchAction touch_action, SetWhiteListedTouchAction(cc.mojom.TouchAction touch_action,
uint32 unique_touch_event_id, uint32 unique_touch_event_id,
InputEventAckState state); InputEventAckState state);
......
...@@ -94,9 +94,6 @@ struct SyntheticTap; ...@@ -94,9 +94,6 @@ struct SyntheticTap;
[Native] [Native]
struct SyntheticPointerAction; struct SyntheticPointerAction;
[Native]
enum TouchAction;
[Native] [Native]
enum PreferredColorScheme; enum PreferredColorScheme;
......
...@@ -87,7 +87,6 @@ type_mappings = [ ...@@ -87,7 +87,6 @@ type_mappings = [
"content.mojom.SyntheticPinch=::content::SyntheticPinchGestureParams", "content.mojom.SyntheticPinch=::content::SyntheticPinchGestureParams",
"content.mojom.SyntheticTap=::content::SyntheticTapGestureParams", "content.mojom.SyntheticTap=::content::SyntheticTapGestureParams",
"content.mojom.SyntheticPointerAction=::content::SyntheticPointerActionListParams", "content.mojom.SyntheticPointerAction=::content::SyntheticPointerActionListParams",
"content.mojom.TouchAction=::cc::TouchAction",
"content.mojom.TouchActionOptional=::cc::TouchAction", "content.mojom.TouchActionOptional=::cc::TouchAction",
"content.mojom.TouchState=::blink::WebTouchPoint::State", "content.mojom.TouchState=::blink::WebTouchPoint::State",
"content.mojom.WebCursor=::content::WebCursor", "content.mojom.WebCursor=::content::WebCursor",
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#define CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_MACROS_H_ #define CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_MACROS_H_
#include "build/build_config.h" #include "build/build_config.h"
#include "cc/input/touch_action.h"
#include "content/public/common/browser_controls_state.h" #include "content/public/common/browser_controls_state.h"
#include "content/public/common/drop_data.h" #include "content/public/common/drop_data.h"
#include "content/public/common/referrer.h" #include "content/public/common/referrer.h"
...@@ -60,7 +59,6 @@ IPC_ENUM_TRAITS_MAX_VALUE(blink::WebHistoryScrollRestorationType, ...@@ -60,7 +59,6 @@ IPC_ENUM_TRAITS_MAX_VALUE(blink::WebHistoryScrollRestorationType,
IPC_ENUM_TRAITS_MAX_VALUE(blink::SecurityStyle, blink::SecurityStyle::kLast) IPC_ENUM_TRAITS_MAX_VALUE(blink::SecurityStyle, blink::SecurityStyle::kLast)
IPC_ENUM_TRAITS_MAX_VALUE(blink::mojom::PermissionStatus, IPC_ENUM_TRAITS_MAX_VALUE(blink::mojom::PermissionStatus,
blink::mojom::PermissionStatus::LAST) blink::mojom::PermissionStatus::LAST)
IPC_ENUM_TRAITS_MAX_VALUE(cc::TouchAction, cc::kTouchActionMax)
IPC_ENUM_TRAITS_MAX_VALUE(content::EditingBehavior, IPC_ENUM_TRAITS_MAX_VALUE(content::EditingBehavior,
content::EDITING_BEHAVIOR_LAST) content::EDITING_BEHAVIOR_LAST)
IPC_ENUM_TRAITS_MAX_VALUE(WindowOpenDisposition, IPC_ENUM_TRAITS_MAX_VALUE(WindowOpenDisposition,
......
...@@ -7,6 +7,7 @@ variant = "blink" ...@@ -7,6 +7,7 @@ variant = "blink"
for_blink = true for_blink = true
_typemap_imports = [ _typemap_imports = [
"//cc/typemaps.gni",
"//device/gamepad/public/cpp/typemaps.gni", "//device/gamepad/public/cpp/typemaps.gni",
"//mojo/public/cpp/bindings/tests/blink_typemaps.gni", "//mojo/public/cpp/bindings/tests/blink_typemaps.gni",
"//third_party/blink/renderer/platform/mojo/blink_typemaps.gni", "//third_party/blink/renderer/platform/mojo/blink_typemaps.gni",
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# found in the LICENSE file. # found in the LICENSE file.
_typemap_imports = [ _typemap_imports = [
"//cc/typemaps.gni",
"//chrome/chrome_cleaner/mojom/typemaps/typemaps.gni", "//chrome/chrome_cleaner/mojom/typemaps/typemaps.gni",
"//chrome/common/importer/typemaps.gni", "//chrome/common/importer/typemaps.gni",
"//chrome/common/media_router/mojom/typemaps.gni", "//chrome/common/media_router/mojom/typemaps.gni",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment