Commit 3e0bed88 authored by Ken Rockot's avatar Ken Rockot Committed by Commit Bot

Convert remaining mojo_base typemaps to GN rules

Bug: 1059389
Change-Id: Ifbef91dec1142962f1dcdd34dd2c6e0b2000cd13
Tbr: jbroman@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2092065
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: default avatarTom Sepez <tsepez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748776}
parent 4fa1454b
...@@ -29,14 +29,45 @@ component("typemap_traits") { ...@@ -29,14 +29,45 @@ component("typemap_traits") {
sources = [ sources = [
"big_string_mojom_traits.cc", "big_string_mojom_traits.cc",
"big_string_mojom_traits.h", "big_string_mojom_traits.h",
"memory_allocator_dump_cross_process_uid_mojom_traits.cc",
"memory_allocator_dump_cross_process_uid_mojom_traits.h",
"memory_pressure_level_mojom_traits.cc",
"memory_pressure_level_mojom_traits.h",
"message_pump_type_mojom_traits.cc",
"message_pump_type_mojom_traits.h",
"process_id_mojom_traits.cc",
"process_id_mojom_traits.h",
"ref_counted_memory_mojom_traits.cc",
"ref_counted_memory_mojom_traits.h",
"string16_mojom_traits.cc",
"string16_mojom_traits.h",
"text_direction_mojom_traits.cc",
"text_direction_mojom_traits.h",
"thread_priority_mojom_traits.cc",
"thread_priority_mojom_traits.h",
] ]
if (is_android) {
sources += [
"application_state_mojom_traits.cc",
"application_state_mojom_traits.h",
]
}
if (is_win) {
sources += [
"logfont_win_mojom_traits.cc",
"logfont_win_mojom_traits.h",
]
}
defines = [ "IS_MOJO_BASE_TRAITS_IMPL" ] defines = [ "IS_MOJO_BASE_TRAITS_IMPL" ]
public_deps = [ public_deps = [
":shared_typemap_traits", ":shared_typemap_traits",
"//base", "//base",
"//mojo/public/cpp/base", "//mojo/public/cpp/base",
"//mojo/public/mojom/base:base_shared",
] ]
} }
......
per-file *.typemap=set noparent
per-file *.typemap=file://ipc/SECURITY_OWNERS
per-file *_mojom_traits*.*=set noparent per-file *_mojom_traits*.*=set noparent
per-file *_mojom_traits*.*=file://ipc/SECURITY_OWNERS per-file *_mojom_traits*.*=file://ipc/SECURITY_OWNERS
# Copyright 2018 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 = "//mojo/public/mojom/base/application_state.mojom"
os_whitelist = [ "android" ]
public_headers = [ "//base/android/application_status_listener.h" ]
traits_headers = [ "//mojo/public/cpp/base/application_state_mojom_traits.h" ]
sources = [
"//mojo/public/cpp/base/application_state_mojom_traits.cc",
"//mojo/public/cpp/base/application_state_mojom_traits.h",
]
public_deps = [
"//base",
]
type_mappings =
[ "mojo_base.mojom.ApplicationState=::base::android::ApplicationState" ]
...@@ -8,12 +8,12 @@ ...@@ -8,12 +8,12 @@
#include "base/android/application_status_listener.h" #include "base/android/application_status_listener.h"
#include "base/component_export.h" #include "base/component_export.h"
#include "mojo/public/cpp/bindings/struct_traits.h" #include "mojo/public/cpp/bindings/struct_traits.h"
#include "mojo/public/mojom/base/application_state.mojom.h" #include "mojo/public/mojom/base/application_state.mojom-shared.h"
namespace mojo { namespace mojo {
template <> template <>
struct COMPONENT_EXPORT(MOJO_BASE_MOJOM) struct COMPONENT_EXPORT(MOJO_BASE_TRAITS)
EnumTraits<mojo_base::mojom::ApplicationState, EnumTraits<mojo_base::mojom::ApplicationState,
base::android::ApplicationState> { base::android::ApplicationState> {
static mojo_base::mojom::ApplicationState ToMojom( static mojo_base::mojom::ApplicationState ToMojom(
......
# Copyright 2016 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 = "//mojo/public/mojom/base/file.mojom"
public_headers = [ "//base/files/file.h" ]
traits_headers = [ "//mojo/public/cpp/base/file_mojom_traits.h" ]
public_deps = [
"//base",
"//mojo/public/cpp/base:shared_typemap_traits",
]
type_mappings =
[ "mojo_base.mojom.File=::base::File[move_only,nullable_is_same_type]" ]
# Copyright 2018 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 = "//mojo/public/mojom/base/file_error.mojom"
public_headers = [ "//base/files/file.h" ]
traits_headers = [ "//mojo/public/cpp/base/file_error_mojom_traits.h" ]
public_deps = [
"//base",
"//mojo/public/cpp/bindings",
]
type_mappings = [ "mojo_base.mojom.FileError=::base::File::Error" ]
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#define MOJO_PUBLIC_CPP_BASE_FILE_ERROR_MOJOM_TRAITS_H_ #define MOJO_PUBLIC_CPP_BASE_FILE_ERROR_MOJOM_TRAITS_H_
#include "base/files/file.h" #include "base/files/file.h"
#include "mojo/public/mojom/base/file_error.mojom.h" #include "mojo/public/mojom/base/file_error.mojom-shared.h"
namespace mojo { namespace mojo {
......
# Copyright 2017 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 = "//mojo/public/mojom/base/file_info.mojom"
public_headers = [ "//base/files/file.h" ]
traits_headers = [ "//mojo/public/cpp/base/file_info_mojom_traits.h" ]
public_deps = [
"//base",
"//mojo/public/cpp/base:shared_typemap_traits",
]
type_mappings = [ "mojo_base.mojom.FileInfo=::base::File::Info" ]
# Copyright 2016 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 = "//mojo/public/mojom/base/file_path.mojom"
public_headers = [ "//base/files/file_path.h" ]
traits_headers = [ "//mojo/public/cpp/base/file_path_mojom_traits.h" ]
public_deps = [
"//mojo/public/cpp/base:shared_typemap_traits",
]
type_mappings = [ "mojo_base.mojom.FilePath=::base::FilePath" ]
# Copyright 2017 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 = "//mojo/public/mojom/base/logfont_win.mojom"
public_headers = [
"//base/win/windows_full.h",
"//base/win/windows_types.h",
]
traits_headers = [ "//mojo/public/cpp/base/logfont_win_mojom_traits.h" ]
public_deps = [
"//base",
]
sources = [
"//mojo/public/cpp/base/logfont_win_mojom_traits.cc",
"//mojo/public/cpp/base/logfont_win_mojom_traits.h",
]
type_mappings = [ "mojo_base.mojom.LOGFONT=::LOGFONT" ]
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
namespace mojo { namespace mojo {
template <> template <>
struct COMPONENT_EXPORT(MOJO_BASE_MOJOM) struct COMPONENT_EXPORT(MOJO_BASE_TRAITS)
StructTraits<mojo_base::mojom::LOGFONTDataView, ::LOGFONT> { StructTraits<mojo_base::mojom::LOGFONTDataView, ::LOGFONT> {
static base::span<const uint8_t> bytes(const ::LOGFONT& input); static base::span<const uint8_t> bytes(const ::LOGFONT& input);
static bool Read(mojo_base::mojom::LOGFONTDataView data, ::LOGFONT* out); static bool Read(mojo_base::mojom::LOGFONTDataView data, ::LOGFONT* out);
......
# Copyright 2017 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 = "//mojo/public/mojom/base/memory_allocator_dump_cross_process_uid.mojom"
public_headers = [ "//base/trace_event/memory_allocator_dump_guid.h" ]
traits_headers = [ "//mojo/public/cpp/base/memory_allocator_dump_cross_process_uid_mojom_traits.h" ]
sources = [
"//mojo/public/cpp/base/memory_allocator_dump_cross_process_uid_mojom_traits.cc",
"//mojo/public/cpp/base/memory_allocator_dump_cross_process_uid_mojom_traits.h",
]
type_mappings = [ "mojo_base.mojom.MemoryAllocatorDumpCrossProcessUid=::base::trace_event::MemoryAllocatorDumpGuid" ]
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
namespace mojo { namespace mojo {
template <> template <>
struct COMPONENT_EXPORT(MOJO_BASE_MOJOM) struct COMPONENT_EXPORT(MOJO_BASE_TRAITS)
StructTraits<mojo_base::mojom::MemoryAllocatorDumpCrossProcessUidDataView, StructTraits<mojo_base::mojom::MemoryAllocatorDumpCrossProcessUidDataView,
base::trace_event::MemoryAllocatorDumpGuid> { base::trace_event::MemoryAllocatorDumpGuid> {
static uint64_t value(const base::trace_event::MemoryAllocatorDumpGuid& id) { static uint64_t value(const base::trace_event::MemoryAllocatorDumpGuid& id) {
......
# Copyright 2018 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 = "//mojo/public/mojom/base/memory_pressure_level.mojom"
public_headers = [ "//base/memory/memory_pressure_listener.h" ]
traits_headers =
[ "//mojo/public/cpp/base/memory_pressure_level_mojom_traits.h" ]
sources = [
"//mojo/public/cpp/base/memory_pressure_level_mojom_traits.cc",
"//mojo/public/cpp/base/memory_pressure_level_mojom_traits.h",
]
public_deps = [
"//base",
]
type_mappings = [ "mojo_base.mojom.MemoryPressureLevel=::base::MemoryPressureListener::MemoryPressureLevel" ]
...@@ -8,12 +8,12 @@ ...@@ -8,12 +8,12 @@
#include "base/component_export.h" #include "base/component_export.h"
#include "base/memory/memory_pressure_listener.h" #include "base/memory/memory_pressure_listener.h"
#include "mojo/public/cpp/bindings/struct_traits.h" #include "mojo/public/cpp/bindings/struct_traits.h"
#include "mojo/public/mojom/base/memory_pressure_level.mojom.h" #include "mojo/public/mojom/base/memory_pressure_level.mojom-shared.h"
namespace mojo { namespace mojo {
template <> template <>
struct COMPONENT_EXPORT(MOJO_BASE_MOJOM) struct COMPONENT_EXPORT(MOJO_BASE_TRAITS)
EnumTraits<mojo_base::mojom::MemoryPressureLevel, EnumTraits<mojo_base::mojom::MemoryPressureLevel,
base::MemoryPressureListener::MemoryPressureLevel> { base::MemoryPressureListener::MemoryPressureLevel> {
static mojo_base::mojom::MemoryPressureLevel ToMojom( static mojo_base::mojom::MemoryPressureLevel ToMojom(
......
# 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 = "//mojo/public/mojom/base/message_pump_type.mojom"
public_headers = [ "//base/message_loop/message_pump_type.h" ]
traits_headers = [ "//mojo/public/cpp/base/message_pump_type_mojom_traits.h" ]
sources = [
"//mojo/public/cpp/base/message_pump_type_mojom_traits.cc",
"//mojo/public/cpp/base/message_pump_type_mojom_traits.h",
]
public_deps = [
"//base",
]
type_mappings = [ "mojo_base.mojom.MessagePumpType=::base::MessagePumpType" ]
...@@ -8,12 +8,12 @@ ...@@ -8,12 +8,12 @@
#include "base/component_export.h" #include "base/component_export.h"
#include "base/message_loop/message_pump_type.h" #include "base/message_loop/message_pump_type.h"
#include "mojo/public/cpp/bindings/struct_traits.h" #include "mojo/public/cpp/bindings/struct_traits.h"
#include "mojo/public/mojom/base/message_pump_type.mojom.h" #include "mojo/public/mojom/base/message_pump_type.mojom-shared.h"
namespace mojo { namespace mojo {
template <> template <>
struct COMPONENT_EXPORT(MOJO_BASE_MOJOM) struct COMPONENT_EXPORT(MOJO_BASE_TRAITS)
EnumTraits<mojo_base::mojom::MessagePumpType, base::MessagePumpType> { EnumTraits<mojo_base::mojom::MessagePumpType, base::MessagePumpType> {
static mojo_base::mojom::MessagePumpType ToMojom(base::MessagePumpType input); static mojo_base::mojom::MessagePumpType ToMojom(base::MessagePumpType input);
static bool FromMojom(mojo_base::mojom::MessagePumpType input, static bool FromMojom(mojo_base::mojom::MessagePumpType input,
......
# Copyright 2017 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 = "//mojo/public/mojom/base/process_id.mojom"
public_headers = [ "//base/process/process_handle.h" ]
traits_headers = [ "//mojo/public/cpp/base/process_id_mojom_traits.h" ]
sources = [
"//mojo/public/cpp/base/process_id_mojom_traits.cc",
"//mojo/public/cpp/base/process_id_mojom_traits.h",
]
type_mappings =
[ "mojo_base.mojom.ProcessId=::base::ProcessId[copyable_pass_by_value]" ]
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
namespace mojo { namespace mojo {
template <> template <>
struct COMPONENT_EXPORT(MOJO_BASE_MOJOM) struct COMPONENT_EXPORT(MOJO_BASE_TRAITS)
StructTraits<mojo_base::mojom::ProcessIdDataView, base::ProcessId> { StructTraits<mojo_base::mojom::ProcessIdDataView, base::ProcessId> {
static uint32_t pid(const base::ProcessId& process_id) { static uint32_t pid(const base::ProcessId& process_id) {
return static_cast<uint32_t>(process_id); return static_cast<uint32_t>(process_id);
...@@ -24,4 +24,4 @@ struct COMPONENT_EXPORT(MOJO_BASE_MOJOM) ...@@ -24,4 +24,4 @@ struct COMPONENT_EXPORT(MOJO_BASE_MOJOM)
} // namespace mojo } // namespace mojo
#endif // MOJO_PUBLIC_CPP_BASE_PROCESS_ID_MOJOM_TRAITS_H_ #endif // MOJO_PUBLIC_CPP_BASE_PROCESS_ID_MOJOM_TRAITS_H_
\ No newline at end of file
# Copyright 2017 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 = "//mojo/public/mojom/base/read_only_buffer.mojom"
public_headers = [ "//base/containers/span.h" ]
traits_headers = [ "//mojo/public/cpp/base/read_only_buffer_mojom_traits.h" ]
public_deps = [
"//base",
"//mojo/public/cpp/base:shared_typemap_traits",
]
type_mappings = [ "mojo_base.mojom.ReadOnlyBuffer=::base::span<const ::uint8_t>[copyable_pass_by_value,force_serialize]" ]
# Copyright 2018 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 = "//mojo/public/mojom/base/ref_counted_memory.mojom"
public_headers = [ "//base/memory/ref_counted_memory.h" ]
traits_headers = [ "//mojo/public/cpp/base/ref_counted_memory_mojom_traits.h" ]
sources = [
"//mojo/public/cpp/base/ref_counted_memory_mojom_traits.cc",
"//mojo/public/cpp/base/ref_counted_memory_mojom_traits.h",
]
public_deps = [
"//base",
"//mojo/public/cpp/base",
"//mojo/public/cpp/base:shared_typemap_traits",
]
type_mappings = [ "mojo_base.mojom.RefCountedMemory=::scoped_refptr<::base::RefCountedMemory>[copyable_pass_by_value,nullable_is_same_type]" ]
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
namespace mojo { namespace mojo {
template <> template <>
struct COMPONENT_EXPORT(MOJO_BASE_MOJOM) struct COMPONENT_EXPORT(MOJO_BASE_TRAITS)
StructTraits<mojo_base::mojom::RefCountedMemoryDataView, StructTraits<mojo_base::mojom::RefCountedMemoryDataView,
scoped_refptr<base::RefCountedMemory>> { scoped_refptr<base::RefCountedMemory>> {
static mojo_base::BigBuffer data( static mojo_base::BigBuffer data(
......
# Copyright 2018 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 = "//mojo/public/mojom/base/shared_memory.mojom"
public_headers = [
"//base/memory/platform_shared_memory_region.h",
"//base/memory/read_only_shared_memory_region.h",
"//base/memory/unsafe_shared_memory_region.h",
"//base/memory/writable_shared_memory_region.h",
]
traits_headers = [ "//mojo/public/cpp/base/shared_memory_mojom_traits.h" ]
public_deps = [
"//base",
"//mojo/public/cpp/base:shared_typemap_traits",
]
type_mappings = [
"mojo_base.mojom.PlatformSharedMemoryHandle=::base::subtle::PlatformSharedMemoryRegion::ScopedPlatformHandle[move_only]",
"mojo_base.mojom.PlatformSharedMemoryRegion=::base::subtle::PlatformSharedMemoryRegion[move_only]",
"mojo_base.mojom.PlatformSharedMemoryRegion.Mode=::base::subtle::PlatformSharedMemoryRegion::Mode",
"mojo_base.mojom.ReadOnlySharedMemoryRegion=::base::ReadOnlySharedMemoryRegion[move_only,nullable_is_same_type]",
"mojo_base.mojom.UnsafeSharedMemoryRegion=::base::UnsafeSharedMemoryRegion[move_only,nullable_is_same_type]",
"mojo_base.mojom.WritableSharedMemoryRegion=::base::WritableSharedMemoryRegion[move_only,nullable_is_same_type]",
]
# Copyright 2016 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 = "//mojo/public/mojom/base/string16.mojom"
public_headers = [ "//base/strings/string16.h" ]
traits_headers = [ "//mojo/public/cpp/base/string16_mojom_traits.h" ]
sources = [
"//mojo/public/cpp/base/string16_mojom_traits.cc",
"//mojo/public/cpp/base/string16_mojom_traits.h",
]
public_deps = [
"//mojo/public/cpp/base:shared_typemap_traits",
]
type_mappings = [
"mojo_base.mojom.BigString16=::base::string16",
"mojo_base.mojom.String16=::base::string16",
]
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
namespace mojo { namespace mojo {
template <> template <>
struct COMPONENT_EXPORT(MOJO_BASE_MOJOM) struct COMPONENT_EXPORT(MOJO_BASE_TRAITS)
StructTraits<mojo_base::mojom::String16DataView, base::StringPiece16> { StructTraits<mojo_base::mojom::String16DataView, base::StringPiece16> {
static base::span<const uint16_t> data(base::StringPiece16 str) { static base::span<const uint16_t> data(base::StringPiece16 str) {
return base::make_span(reinterpret_cast<const uint16_t*>(str.data()), return base::make_span(reinterpret_cast<const uint16_t*>(str.data()),
...@@ -26,7 +26,7 @@ struct COMPONENT_EXPORT(MOJO_BASE_MOJOM) ...@@ -26,7 +26,7 @@ struct COMPONENT_EXPORT(MOJO_BASE_MOJOM)
}; };
template <> template <>
struct COMPONENT_EXPORT(MOJO_BASE_MOJOM) struct COMPONENT_EXPORT(MOJO_BASE_TRAITS)
StructTraits<mojo_base::mojom::String16DataView, base::string16> { StructTraits<mojo_base::mojom::String16DataView, base::string16> {
static base::span<const uint16_t> data(const base::string16& str) { static base::span<const uint16_t> data(const base::string16& str) {
return StructTraits<mojo_base::mojom::String16DataView, return StructTraits<mojo_base::mojom::String16DataView,
...@@ -38,7 +38,7 @@ struct COMPONENT_EXPORT(MOJO_BASE_MOJOM) ...@@ -38,7 +38,7 @@ struct COMPONENT_EXPORT(MOJO_BASE_MOJOM)
}; };
template <> template <>
struct COMPONENT_EXPORT(MOJO_BASE_MOJOM) struct COMPONENT_EXPORT(MOJO_BASE_TRAITS)
StructTraits<mojo_base::mojom::BigString16DataView, base::string16> { StructTraits<mojo_base::mojom::BigString16DataView, base::string16> {
static mojo_base::BigBuffer data(const base::string16& str); static mojo_base::BigBuffer data(const base::string16& str);
......
# Copyright 2017 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 = "//mojo/public/mojom/base/text_direction.mojom"
public_headers = [ "//base/i18n/rtl.h" ]
traits_headers = [ "//mojo/public/cpp/base/text_direction_mojom_traits.h" ]
sources = [
"//mojo/public/cpp/base/text_direction_mojom_traits.cc",
"//mojo/public/cpp/base/text_direction_mojom_traits.h",
]
public_deps = [
"//base:i18n",
]
type_mappings = [ "mojo_base.mojom.TextDirection=::base::i18n::TextDirection" ]
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
namespace mojo { namespace mojo {
template <> template <>
struct COMPONENT_EXPORT(MOJO_BASE_MOJOM) struct COMPONENT_EXPORT(MOJO_BASE_TRAITS)
EnumTraits<mojo_base::mojom::TextDirection, base::i18n::TextDirection> { EnumTraits<mojo_base::mojom::TextDirection, base::i18n::TextDirection> {
static mojo_base::mojom::TextDirection ToMojom( static mojo_base::mojom::TextDirection ToMojom(
base::i18n::TextDirection text_direction); base::i18n::TextDirection text_direction);
......
# Copyright 2017 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 = "//mojo/public/mojom/base/thread_priority.mojom"
public_headers = [ "//base/threading/platform_thread.h" ]
traits_headers = [ "//mojo/public/cpp/base/thread_priority_mojom_traits.h" ]
sources = [
"//mojo/public/cpp/base/thread_priority_mojom_traits.cc",
"//mojo/public/cpp/base/thread_priority_mojom_traits.h",
]
type_mappings = [ "mojo_base.mojom.ThreadPriority=::base::ThreadPriority" ]
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
namespace mojo { namespace mojo {
template <> template <>
struct COMPONENT_EXPORT(MOJO_BASE_MOJOM) struct COMPONENT_EXPORT(MOJO_BASE_TRAITS)
EnumTraits<mojo_base::mojom::ThreadPriority, base::ThreadPriority> { EnumTraits<mojo_base::mojom::ThreadPriority, base::ThreadPriority> {
static mojo_base::mojom::ThreadPriority ToMojom( static mojo_base::mojom::ThreadPriority ToMojom(
base::ThreadPriority thread_priority); base::ThreadPriority thread_priority);
...@@ -21,4 +21,4 @@ struct COMPONENT_EXPORT(MOJO_BASE_MOJOM) ...@@ -21,4 +21,4 @@ struct COMPONENT_EXPORT(MOJO_BASE_MOJOM)
} // namespace mojo } // namespace mojo
#endif // MOJO_PUBLIC_CPP_BASE_THREAD_PRIORITY_MOJOM_TRAITS_H_ #endif // MOJO_PUBLIC_CPP_BASE_THREAD_PRIORITY_MOJOM_TRAITS_H_
\ No newline at end of file
# Copyright 2018 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 = "//mojo/public/mojom/base/token.mojom"
public_headers = [ "//base/token.h" ]
traits_headers = [ "//mojo/public/cpp/base/token_mojom_traits.h" ]
public_deps = [
"//base",
"//mojo/public/cpp/base:shared_typemap_traits",
]
type_mappings = [ "mojo_base.mojom.Token=::base::Token" ]
# Copyright 2018 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 = [
"//mojo/public/cpp/base/application_state.typemap",
"//mojo/public/cpp/base/file_error.typemap",
"//mojo/public/cpp/base/file_info.typemap",
"//mojo/public/cpp/base/file_path.typemap",
"//mojo/public/cpp/base/file.typemap",
"//mojo/public/cpp/base/read_only_buffer.typemap",
"//mojo/public/cpp/base/memory_allocator_dump_cross_process_uid.typemap",
"//mojo/public/cpp/base/memory_pressure_level.typemap",
"//mojo/public/cpp/base/message_pump_type.typemap",
"//mojo/public/cpp/base/process_id.typemap",
"//mojo/public/cpp/base/ref_counted_memory.typemap",
"//mojo/public/cpp/base/shared_memory.typemap",
"//mojo/public/cpp/base/string16.typemap",
"//mojo/public/cpp/base/logfont_win.typemap",
"//mojo/public/cpp/base/text_direction.typemap",
"//mojo/public/cpp/base/thread_priority.typemap",
"//mojo/public/cpp/base/token.typemap",
]
...@@ -46,13 +46,37 @@ mojom_component("base") { ...@@ -46,13 +46,37 @@ mojom_component("base") {
common_typemaps = [ common_typemaps = [
":big_buffer_typemap", ":big_buffer_typemap",
":file_error_typemap",
":file_info_typemap",
":file_path_typemap",
":file_typemap",
":generic_pending_receiver_typemap", ":generic_pending_receiver_typemap",
":read_only_buffer_typemap",
":shared_memory_typemap",
":time_typemap", ":time_typemap",
":unguessable_token_typemap", ":unguessable_token_typemap",
":value_typemap", ":value_typemap",
] ]
cpp_typemaps = common_typemaps + [ ":big_string_typemap" ] cpp_typemaps = common_typemaps + [
":big_string_typemap",
":memory_allocator_dump_cross_process_ui_typemap",
":memory_pressure_level_typemap",
":message_pump_type_typemap",
":process_id_typemap",
":ref_counted_memory_typemap",
":string16_typemap",
":text_direction_typemap",
":thread_priority_typemap",
":token_typemap",
]
if (is_android) {
cpp_typemaps += [ ":application_state_typemap" ]
}
if (is_win) {
cpp_typemaps += [ ":logfont_typemap" ]
}
blink_cpp_typemaps = blink_cpp_typemaps =
common_typemaps + common_typemaps +
...@@ -91,6 +115,80 @@ mojom_cpp_typemap("big_string_typemap") { ...@@ -91,6 +115,80 @@ mojom_cpp_typemap("big_string_typemap") {
] ]
} }
mojom_cpp_typemap("file_error_typemap") {
types = [
{
mojom = "mojo_base.mojom.FileError"
cpp = "::base::File::Error"
},
]
public_headers = [
"//base/files/file.h",
"//mojo/public/cpp/base/file_error_mojom_traits.h",
]
traits_sources = [ "//mojo/public/cpp/base/file_error_mojom_traits.h" ]
traits_public_deps = [
":base_shared",
"//base",
]
}
mojom_cpp_typemap("file_info_typemap") {
types = [
{
mojom = "mojo_base.mojom.FileInfo"
cpp = "::base::File::Info"
},
]
public_headers = [
"//base/files/file.h",
"//mojo/public/cpp/base/file_info_mojom_traits.h",
]
public_deps = [
"//base",
"//mojo/public/cpp/base",
"//mojo/public/cpp/base:shared_typemap_traits",
]
}
mojom_cpp_typemap("file_path_typemap") {
types = [
{
mojom = "mojo_base.mojom.FilePath"
cpp = "::base::FilePath"
},
]
public_headers = [
"//base/files/file_path.h",
"//mojo/public/cpp/base/file_path_mojom_traits.h",
]
public_deps = [
"//base",
"//mojo/public/cpp/base",
"//mojo/public/cpp/base:shared_typemap_traits",
]
}
mojom_cpp_typemap("file_typemap") {
types = [
{
mojom = "mojo_base.mojom.File"
cpp = "::base::File"
move_only = true
nullable_is_same_type = true
},
]
public_headers = [
"//base/files/file.h",
"//mojo/public/cpp/base/file_mojom_traits.h",
]
public_deps = [
"//base",
"//mojo/public/cpp/base",
"//mojo/public/cpp/base:shared_typemap_traits",
]
}
mojom_cpp_typemap("generic_pending_receiver_typemap") { mojom_cpp_typemap("generic_pending_receiver_typemap") {
types = [ types = [
{ {
...@@ -110,6 +208,213 @@ mojom_cpp_typemap("generic_pending_receiver_typemap") { ...@@ -110,6 +208,213 @@ mojom_cpp_typemap("generic_pending_receiver_typemap") {
] ]
} }
mojom_cpp_typemap("memory_allocator_dump_cross_process_ui_typemap") {
types = [
{
mojom = "mojom_base.mojom.MemoryAllocatorDumpCrossProcessUid"
cpp = "::base::trace_event::MemoryAllocatorDumpGuid"
},
]
public_headers = [
"//base/trace_event/memory_allocator_dump_guid.h",
"//mojo/public/cpp/base/memory_allocator_dump_cross_process_uid_mojom_traits.h",
]
public_deps = [
"//base",
"//mojo/public/cpp/base:typemap_traits",
]
}
mojom_cpp_typemap("memory_pressure_level_typemap") {
types = [
{
mojom = "mojo_base.mojom.MemoryPressureLevel"
cpp = "::base::MemoryPressureListener::MemoryPressureLevel"
},
]
public_headers = [
"//base/memory/memory_pressure_listener.h",
"//mojo/public/cpp/base/memory_pressure_level_mojom_traits.h",
]
public_deps = [
"//base",
"//mojo/public/cpp/base:typemap_traits",
]
}
mojom_cpp_typemap("message_pump_type_typemap") {
types = [
{
mojom = "mojo_base.mojom.MessagePumpType"
cpp = "::base::MessagePumpType"
},
]
public_headers = [
"//base/message_loop/message_pump_type.h",
"//mojo/public/cpp/base/message_pump_type_mojom_traits.h",
]
public_deps = [
"//base",
"//mojo/public/cpp/base:typemap_traits",
]
}
mojom_cpp_typemap("ref_counted_memory_typemap") {
types = [
{
mojom = "mojo_base.mojom.RefCountedMemory"
cpp = "::scoped_refptr<::base::RefCountedMemory>"
copyable_pass_by_value = true
nullable_is_same_type = true
},
]
public_headers = [
"//base/memory/ref_counted_memory.h",
"//mojo/public/cpp/base/ref_counted_memory_mojom_traits.h",
]
public_deps = [
"//base",
"//mojo/public/cpp/base:typemap_traits",
]
}
mojom_cpp_typemap("process_id_typemap") {
types = [
{
mojom = "mojo_base.mojom.ProcessId"
cpp = "::base::ProcessId"
copyable_pass_by_value = true
},
]
public_headers = [
"//base/process/process_handle.h",
"//mojo/public/cpp/base/process_id_mojom_traits.h",
]
public_deps = [
"//base",
"//mojo/public/cpp/base:typemap_traits",
]
}
mojom_cpp_typemap("read_only_buffer_typemap") {
types = [
{
mojom = "mojo_base.mojom.ReadOnlyBuffer"
cpp = "::base::span<const ::uint8_t>"
copyable_pass_by_value = true
force_serialize = true
},
]
public_headers = [
"//base/containers/span.h",
"//mojo/public/cpp/base/read_only_buffer_mojom_traits.h",
]
public_deps = [
"//base",
"//mojo/public/cpp/base:shared_typemap_traits",
]
}
mojom_cpp_typemap("shared_memory_typemap") {
types = [
{
mojom = "mojo_base.mojom.PlatformSharedMemoryHandle"
cpp = "::base::subtle::PlatformSharedMemoryRegion::ScopedPlatformHandle"
move_only = true
},
{
mojom = "mojo_base.mojom.PlatformSharedMemoryRegion"
cpp = "::base::subtle::PlatformSharedMemoryRegion"
move_only = true
},
{
mojom = "mojo_base.mojom.ReadOnlySharedMemoryRegion"
cpp = "::base::ReadOnlySharedMemoryRegion"
move_only = true
nullable_is_same_type = true
},
{
mojom = "mojo_base.mojom.UnsafeSharedMemoryRegion"
cpp = "::base::UnsafeSharedMemoryRegion"
move_only = true
nullable_is_same_type = true
},
{
mojom = "mojo_base.mojom.WritableSharedMemoryRegion"
cpp = "::base::WritableSharedMemoryRegion"
move_only = true
nullable_is_same_type = true
},
]
public_headers = [
"//base/containers/span.h",
"//base/memory/platform_shared_memory_region.h",
"//base/memory/read_only_shared_memory_region.h",
"//base/memory/unsafe_shared_memory_region.h",
"//base/memory/writable_shared_memory_region.h",
"//mojo/public/cpp/base/shared_memory_mojom_traits.h",
]
public_deps = [
"//base",
"//mojo/public/cpp/base:shared_typemap_traits",
]
}
mojom_cpp_typemap("string16_typemap") {
types = [
{
mojom = "mojo_base.mojom.String16"
cpp = "::base::string16"
},
{
mojom = "mojo_base.mojom.BigString16"
cpp = "::base::string16"
},
]
public_headers = [
"//base/strings/string16.h",
"//mojo/public/cpp/base/string16_mojom_traits.h",
]
public_deps = [
"//base",
"//mojo/public/cpp/base:typemap_traits",
]
}
mojom_cpp_typemap("text_direction_typemap") {
types = [
{
mojom = "mojo_base.mojom.TextDirection"
cpp = "::base::i18n::TextDirection"
},
]
public_headers = [
"//base/i18n/rtl.h",
"//mojo/public/cpp/base/text_direction_mojom_traits.h",
]
public_deps = [
"//base:i18n",
"//mojo/public/cpp/base:typemap_traits",
]
}
mojom_cpp_typemap("thread_priority_typemap") {
types = [
{
mojom = "mojo_base.mojom.ThreadPriority"
cpp = "::base::ThreadPriority"
},
]
public_headers = [
"//base/threading/platform_thread.h",
"//mojo/public/cpp/base/thread_priority_mojom_traits.h",
]
public_deps = [
"//base",
"//mojo/public/cpp/base:typemap_traits",
]
}
mojom_cpp_typemap("time_typemap") { mojom_cpp_typemap("time_typemap") {
types = [ types = [
{ {
...@@ -139,6 +444,23 @@ mojom_cpp_typemap("time_typemap") { ...@@ -139,6 +444,23 @@ mojom_cpp_typemap("time_typemap") {
] ]
} }
mojom_cpp_typemap("token_typemap") {
types = [
{
mojom = "mojo_base.mojom.Token"
cpp = "::base::Token"
},
]
public_headers = [
"//base/token.h",
"//mojo/public/cpp/base/token_mojom_traits.h",
]
public_deps = [
"//base",
"//mojo/public/cpp/base:shared_typemap_traits",
]
}
mojom_cpp_typemap("unguessable_token_typemap") { mojom_cpp_typemap("unguessable_token_typemap") {
types = [ types = [
{ {
...@@ -178,3 +500,42 @@ mojom_cpp_typemap("value_typemap") { ...@@ -178,3 +500,42 @@ mojom_cpp_typemap("value_typemap") {
"//mojo/public/cpp/base:shared_typemap_traits", "//mojo/public/cpp/base:shared_typemap_traits",
] ]
} }
if (is_android) {
mojom_cpp_typemap("application_state_typemap") {
types = [
{
mojom = "mojo_base.mojom.ApplicationState"
cpp = "::base::android::ApplicationState"
},
]
public_headers = [
"//base/android/application_status_listener.h",
"//mojo/public/cpp/base/application_state_mojom_traits.h",
]
public_deps = [
"//base",
"//mojo/public/cpp/base:typemap_traits",
]
}
}
if (is_win) {
mojom_cpp_typemap("logfont_typemap") {
types = [
{
mojom = "mojo_base.mojom.LOGFONT"
cpp = "::LOGFONT"
},
]
public_headers = [
"//base/win/windows_full.h",
"//base/win/windows_types.h",
"//mojo/public/cpp/base/logfont_win_mojom_traits.h",
]
public_deps = [
"//base",
"//mojo/public/cpp/base:typemap_traits",
]
}
}
...@@ -34,7 +34,6 @@ _typemap_imports = [ ...@@ -34,7 +34,6 @@ _typemap_imports = [
"//media/fuchsia/mojom/typemaps.gni", "//media/fuchsia/mojom/typemaps.gni",
"//media/learning/mojo/public/cpp/typemaps.gni", "//media/learning/mojo/public/cpp/typemaps.gni",
"//media/mojo/mojom/typemaps.gni", "//media/mojo/mojom/typemaps.gni",
"//mojo/public/cpp/base/typemaps.gni",
"//mojo/public/cpp/bindings/tests/chromium_typemaps.gni", "//mojo/public/cpp/bindings/tests/chromium_typemaps.gni",
"//sandbox/mac/mojom/typemaps.gni", "//sandbox/mac/mojom/typemaps.gni",
"//services/audio/public/cpp/typemaps.gni", "//services/audio/public/cpp/typemaps.gni",
......
...@@ -5,12 +5,6 @@ ...@@ -5,12 +5,6 @@
typemaps = [ typemaps = [
"//gpu/ipc/common/mailbox_holder_for_blink.typemap", "//gpu/ipc/common/mailbox_holder_for_blink.typemap",
"//gpu/ipc/common/sync_token.typemap", "//gpu/ipc/common/sync_token.typemap",
"//mojo/public/cpp/base/file.typemap",
"//mojo/public/cpp/base/file_info.typemap",
"//mojo/public/cpp/base/file_path.typemap",
"//mojo/public/cpp/base/file_error.typemap",
"//mojo/public/cpp/base/shared_memory.typemap",
"//mojo/public/cpp/base/read_only_buffer.typemap",
"//services/network/public/cpp/cross_origin_embedder_policy.typemap", "//services/network/public/cpp/cross_origin_embedder_policy.typemap",
"//services/network/public/cpp/url_request.typemap", "//services/network/public/cpp/url_request.typemap",
"//services/viz/public/cpp/compositing/begin_frame_args_for_blink.typemap", "//services/viz/public/cpp/compositing/begin_frame_args_for_blink.typemap",
......
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