diff options
Diffstat (limited to 'mojo/public/cpp/base')
-rw-r--r-- | mojo/public/cpp/base/BUILD.gn | 85 | ||||
-rw-r--r-- | mojo/public/cpp/base/logfont_win.typemap | 18 | ||||
-rw-r--r-- | mojo/public/cpp/base/logfont_win_mojom_traits.cc | 39 | ||||
-rw-r--r-- | mojo/public/cpp/base/logfont_win_mojom_traits.h | 30 |
4 files changed, 0 insertions, 172 deletions
diff --git a/mojo/public/cpp/base/BUILD.gn b/mojo/public/cpp/base/BUILD.gn deleted file mode 100644 index c57ac0bf1d..0000000000 --- a/mojo/public/cpp/base/BUILD.gn +++ /dev/null @@ -1,85 +0,0 @@ -# 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. - -import("//mojo/public/tools/bindings/mojom.gni") - -component("base") { - output_name = "mojo_base_lib" - - sources = [ - "big_buffer.cc", - "big_buffer.h", - ] - - defines = [ "IS_MOJO_BASE_IMPL" ] - - public_deps = [ - "//base", - "//mojo/public/cpp/bindings", - "//mojo/public/cpp/system", - ] -} - -# Normally typemap traits sources should be build directly into mojom targets -# via the typemap file. This target is for typemapped mojo_base types whose -# traits are shared between chromium and blink variants. -component("shared_typemap_traits") { - output_name = "mojo_base_shared_typemap_traits" - - sources = [ - "big_buffer_mojom_traits.cc", - "big_buffer_mojom_traits.h", - "file_info_mojom_traits.cc", - "file_info_mojom_traits.h", - "file_path_mojom_traits.cc", - "file_path_mojom_traits.h", - "shared_memory_mojom_traits.cc", - "shared_memory_mojom_traits.h", - "time_mojom_traits.cc", - "time_mojom_traits.h", - "values_mojom_traits.cc", - "values_mojom_traits.h", - ] - - defines = [ "IS_MOJO_BASE_SHARED_TRAITS_IMPL" ] - - public_deps = [ - ":base", - "//base:i18n", - "//mojo/public/mojom/base:base_shared", - ] -} - -source_set("tests") { - testonly = true - - sources = [ - "big_buffer_unittest.cc", - "big_string_unittest.cc", - "file_path_unittest.cc", - "file_unittest.cc", - "memory_allocator_dump_cross_process_uid_unittest.cc", - "process_id_unittest.cc", - "read_only_buffer_unittest.cc", - "ref_counted_memory_unittest.cc", - "shared_memory_unittest.cc", - "string16_unittest.cc", - "text_direction_unittest.cc", - "thread_priority_unittest.cc", - "time_unittest.cc", - "unguessable_token_unittest.cc", - "values_unittest.cc", - ] - - public_deps = [ - ":base", - ":shared_typemap_traits", - "//base", - "//base/test:test_support", - "//mojo/public/cpp/test_support:test_utils", - "//mojo/public/mojom/base", - "//mojo/public/mojom/base:read_only_buffer", - "//testing/gtest", - ] -} diff --git a/mojo/public/cpp/base/logfont_win.typemap b/mojo/public/cpp/base/logfont_win.typemap deleted file mode 100644 index daaf6fcca6..0000000000 --- a/mojo/public/cpp/base/logfont_win.typemap +++ /dev/null @@ -1,18 +0,0 @@ -# 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" ] diff --git a/mojo/public/cpp/base/logfont_win_mojom_traits.cc b/mojo/public/cpp/base/logfont_win_mojom_traits.cc deleted file mode 100644 index 3c73701ce9..0000000000 --- a/mojo/public/cpp/base/logfont_win_mojom_traits.cc +++ /dev/null @@ -1,39 +0,0 @@ -// 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. - -#include "mojo/public/cpp/base/logfont_win_mojom_traits.h" - -#include <tchar.h> - -#include "base/logging.h" -#include "base/numerics/safe_conversions.h" - -namespace mojo { - -// static -base::span<const uint8_t> -StructTraits<mojo_base::mojom::LOGFONTDataView, ::LOGFONT>::bytes( - const ::LOGFONT& input) { - return base::make_span(reinterpret_cast<const uint8_t*>(&input), - sizeof(::LOGFONT)); -} - -// static -bool StructTraits<mojo_base::mojom::LOGFONTDataView, ::LOGFONT>::Read( - mojo_base::mojom::LOGFONTDataView data, - ::LOGFONT* out) { - ArrayDataView<uint8_t> bytes_view; - data.GetBytesDataView(&bytes_view); - if (bytes_view.size() != sizeof(::LOGFONT)) - return false; - - const ::LOGFONT* font = reinterpret_cast<const ::LOGFONT*>(bytes_view.data()); - if (_tcsnlen(font->lfFaceName, LF_FACESIZE) >= LF_FACESIZE) - return false; - - memcpy(out, font, sizeof(::LOGFONT)); - return true; -} - -} // namespace mojo diff --git a/mojo/public/cpp/base/logfont_win_mojom_traits.h b/mojo/public/cpp/base/logfont_win_mojom_traits.h deleted file mode 100644 index 09a9fbbeee..0000000000 --- a/mojo/public/cpp/base/logfont_win_mojom_traits.h +++ /dev/null @@ -1,30 +0,0 @@ -// 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. - -#ifndef MOJO_PUBLIC_CPP_BASE_LOGFONT_WIN_MOJOM_TRAITS_H_ -#define MOJO_PUBLIC_CPP_BASE_LOGFONT_WIN_MOJOM_TRAITS_H_ - -#include <windows.h> - -#include <cstdint> - -#include "base/component_export.h" -#include "base/containers/span.h" -#include "base/macros.h" -#include "base/win/windows_types.h" -#include "mojo/public/cpp/bindings/struct_traits.h" -#include "mojo/public/mojom/base/logfont_win.mojom-shared.h" - -namespace mojo { - -template <> -struct COMPONENT_EXPORT(MOJO_BASE_MOJOM) - StructTraits<mojo_base::mojom::LOGFONTDataView, ::LOGFONT> { - static base::span<const uint8_t> bytes(const ::LOGFONT& input); - static bool Read(mojo_base::mojom::LOGFONTDataView data, ::LOGFONT* out); -}; - -} // namespace mojo - -#endif // MOJO_PUBLIC_CPP_BASE_LOGFONT_WIN_MOJOM_TRAITS_H_ |