Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit c29588f

Browse files
committed
Add additional files related to IPCs processing
1 parent a329efc commit c29588f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+326
-0
lines changed
0 Bytes
Binary file not shown.
Binary file not shown.

build/android/gyp/util/__init__.pyc

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

build/android/gyp/util/md5_check.pyc

-850 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

build/android/pylib/__init__.pyc

0 Bytes
Binary file not shown.
-85 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

build/gn_helpers.pyc

-860 Bytes
Binary file not shown.

build/toolchain/wrapper_utils.pyc

0 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

ipc/message.typemap

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2018 The Chromium Authors. All rights reserved.
2+
# Use of this source code is governed by a BSD-style license that can be
3+
# found in the LICENSE file.
4+
5+
mojom = "//ipc/ipc.mojom"
6+
public_headers = [ "//ipc/message_view.h" ]
7+
traits_headers = [ "//ipc/message_mojom_traits.h" ]
8+
sources = [
9+
"//ipc/message_mojom_traits.cc",
10+
"//ipc/message_mojom_traits.h",
11+
"//ipc/message_view.cc",
12+
"//ipc/message_view.h",
13+
]
14+
public_deps = [
15+
"//ipc:message_support",
16+
"//mojo/public/cpp/base:shared_typemap_traits",
17+
]
18+
type_mappings = [ "IPC.mojom.Message=IPC::MessageView[move_only]" ]

ipc/message_mojom_traits.cc

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Copyright 2018 The Chromium Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
#include "ipc/message_mojom_traits.h"
6+
7+
#include "mojo/public/cpp/base/big_buffer_mojom_traits.h"
8+
9+
namespace mojo {
10+
11+
// static
12+
mojo_base::BigBufferView
13+
StructTraits<IPC::mojom::MessageDataView, IPC::MessageView>::buffer(
14+
IPC::MessageView& view) {
15+
return view.TakeBufferView();
16+
}
17+
18+
// static
19+
base::Optional<std::vector<mojo::native::SerializedHandlePtr>>
20+
StructTraits<IPC::mojom::MessageDataView, IPC::MessageView>::handles(
21+
IPC::MessageView& view) {
22+
return view.TakeHandles();
23+
}
24+
25+
// static
26+
bool StructTraits<IPC::mojom::MessageDataView, IPC::MessageView>::Read(
27+
IPC::mojom::MessageDataView data,
28+
IPC::MessageView* out) {
29+
mojo_base::BigBufferView buffer_view;
30+
if (!data.ReadBuffer(&buffer_view))
31+
return false;
32+
base::Optional<std::vector<mojo::native::SerializedHandlePtr>> handles;
33+
if (!data.ReadHandles(&handles))
34+
return false;
35+
36+
*out = IPC::MessageView(std::move(buffer_view), std::move(handles));
37+
return true;
38+
}
39+
40+
} // namespace mojo

ipc/message_mojom_traits.h

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright 2018 The Chromium Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
#ifndef IPC_MESSAGE_MOJOM_TRAITS_H_
6+
#define IPC_MESSAGE_MOJOM_TRAITS_H_
7+
8+
#include <vector>
9+
10+
#include "base/optional.h"
11+
#include "ipc/ipc.mojom-shared.h"
12+
#include "ipc/message_view.h"
13+
#include "mojo/public/cpp/base/big_buffer.h"
14+
#include "mojo/public/cpp/bindings/struct_traits.h"
15+
#include "mojo/public/interfaces/bindings/native_struct.mojom.h"
16+
17+
namespace mojo {
18+
19+
template <>
20+
class StructTraits<IPC::mojom::MessageDataView, IPC::MessageView> {
21+
public:
22+
static mojo_base::BigBufferView buffer(IPC::MessageView& view);
23+
static base::Optional<std::vector<mojo::native::SerializedHandlePtr>> handles(
24+
IPC::MessageView& view);
25+
26+
static bool Read(IPC::mojom::MessageDataView data, IPC::MessageView* out);
27+
};
28+
29+
} // namespace mojo
30+
31+
#endif // IPC_MESSAGE_MOJOM_TRAITS_H_

ipc/message_view.cc

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright 2018 The Chromium Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
#include "ipc/message_view.h"
6+
7+
namespace IPC {
8+
9+
MessageView::MessageView() = default;
10+
11+
MessageView::MessageView(
12+
const Message& message,
13+
base::Optional<std::vector<mojo::native::SerializedHandlePtr>> handles)
14+
: buffer_view_(base::make_span<const uint8_t>(
15+
static_cast<const uint8_t*>(message.data()),
16+
message.size())),
17+
handles_(std::move(handles)) {}
18+
19+
MessageView::MessageView(
20+
mojo_base::BigBufferView buffer_view,
21+
base::Optional<std::vector<mojo::native::SerializedHandlePtr>> handles)
22+
: buffer_view_(std::move(buffer_view)), handles_(std::move(handles)) {}
23+
24+
MessageView::MessageView(MessageView&&) = default;
25+
26+
MessageView::~MessageView() = default;
27+
28+
MessageView& MessageView::operator=(MessageView&&) = default;
29+
30+
} // namespace IPC

ipc/message_view.h

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// Copyright 2018 The Chromium Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
#ifndef IPC_MESSAGE_VIEW_H_
6+
#define IPC_MESSAGE_VIEW_H_
7+
8+
#include <vector>
9+
10+
#include "base/component_export.h"
11+
#include "base/containers/span.h"
12+
#include "base/macros.h"
13+
#include "ipc/ipc_message.h"
14+
#include "mojo/public/cpp/base/big_buffer.h"
15+
#include "mojo/public/interfaces/bindings/native_struct.mojom.h"
16+
17+
namespace IPC {
18+
19+
class COMPONENT_EXPORT(IPC_MOJOM) MessageView {
20+
public:
21+
MessageView();
22+
MessageView(
23+
const Message& message,
24+
base::Optional<std::vector<mojo::native::SerializedHandlePtr>> handles);
25+
MessageView(
26+
mojo_base::BigBufferView buffer_view,
27+
base::Optional<std::vector<mojo::native::SerializedHandlePtr>> handles);
28+
MessageView(MessageView&&);
29+
~MessageView();
30+
31+
MessageView& operator=(MessageView&&);
32+
33+
const char* data() const {
34+
return reinterpret_cast<const char*>(buffer_view_.data().data());
35+
}
36+
37+
uint32_t size() const {
38+
return static_cast<uint32_t>(buffer_view_.data().size());
39+
}
40+
41+
mojo_base::BigBufferView TakeBufferView() { return std::move(buffer_view_); }
42+
43+
base::Optional<std::vector<mojo::native::SerializedHandlePtr>> TakeHandles() {
44+
return std::move(handles_);
45+
}
46+
47+
private:
48+
mojo_base::BigBufferView buffer_view_;
49+
base::Optional<std::vector<mojo::native::SerializedHandlePtr>> handles_;
50+
51+
DISALLOW_COPY_AND_ASSIGN(MessageView);
52+
};
53+
54+
} // namespace IPC
55+
56+
#endif // IPC_MESSAGE_VIEW_H_

ipc/typemaps.gni

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright 2018 The Chromium Authors. All rights reserved.
2+
# Use of this source code is governed by a BSD-style license that can be
3+
# found in the LICENSE file.
4+
5+
typemaps = [ "//ipc/message.typemap" ]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright 2018 The Chromium Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
#include "mojo/public/cpp/base/file_info_mojom_traits.h"
6+
7+
#include "base/logging.h"
8+
#include "mojo/public/cpp/base/time_mojom_traits.h"
9+
10+
namespace mojo {
11+
12+
// static
13+
bool StructTraits<mojo_base::mojom::FileInfoDataView, base::File::Info>::Read(
14+
mojo_base::mojom::FileInfoDataView data,
15+
base::File::Info* out) {
16+
if (!data.ReadLastModified(&out->last_modified))
17+
return false;
18+
if (!data.ReadLastAccessed(&out->last_accessed))
19+
return false;
20+
if (!data.ReadCreationTime(&out->creation_time))
21+
return false;
22+
out->size = data.size();
23+
out->is_directory = data.is_directory();
24+
out->is_symbolic_link = data.is_symbolic_link();
25+
return true;
26+
}
27+
28+
} // namespace mojo
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Copyright 2018 The Chromium Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
#ifndef MOJO_PUBLIC_CPP_BASE_FILE_INFO_MOJOM_TRAITS_H_
6+
#define MOJO_PUBLIC_CPP_BASE_FILE_INFO_MOJOM_TRAITS_H_
7+
8+
#include <cstdint>
9+
10+
#include "base/component_export.h"
11+
#include "base/files/file.h"
12+
#include "base/macros.h"
13+
#include "mojo/public/cpp/bindings/struct_traits.h"
14+
#include "mojo/public/mojom/base/file_info.mojom-shared.h"
15+
16+
namespace mojo {
17+
18+
template <>
19+
struct COMPONENT_EXPORT(MOJO_BASE_SHARED_TRAITS)
20+
StructTraits<mojo_base::mojom::FileInfoDataView, base::File::Info> {
21+
static int64_t size(const base::File::Info& info) { return info.size; }
22+
23+
static bool is_directory(const base::File::Info& info) {
24+
return info.is_directory;
25+
}
26+
27+
static bool is_symbolic_link(const base::File::Info& info) {
28+
return info.is_symbolic_link;
29+
}
30+
31+
static base::Time last_modified(const base::File::Info& info) {
32+
return info.last_modified;
33+
}
34+
35+
static base::Time last_accessed(const base::File::Info& info) {
36+
return info.last_accessed;
37+
}
38+
39+
static base::Time creation_time(const base::File::Info& info) {
40+
return info.creation_time;
41+
}
42+
43+
static bool Read(mojo_base::mojom::FileInfoDataView data,
44+
base::File::Info* out);
45+
};
46+
47+
} // namespace mojo
48+
49+
#endif // MOJO_PUBLIC_CPP_BASE_FILE_INFO_MOJOM_TRAITS_H_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Copyright 2018 The Chromium Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
#include "mojo/public/cpp/base/logfont_win_mojom_traits.h"
6+
7+
#include <tchar.h>
8+
9+
#include "base/logging.h"
10+
#include "base/numerics/safe_conversions.h"
11+
12+
namespace mojo {
13+
14+
// static
15+
base::span<const uint8_t>
16+
StructTraits<mojo_base::mojom::LOGFONTDataView, ::LOGFONT>::bytes(
17+
const ::LOGFONT& input) {
18+
return base::make_span(reinterpret_cast<const uint8_t*>(&input),
19+
sizeof(::LOGFONT));
20+
}
21+
22+
// static
23+
bool StructTraits<mojo_base::mojom::LOGFONTDataView, ::LOGFONT>::Read(
24+
mojo_base::mojom::LOGFONTDataView data,
25+
::LOGFONT* out) {
26+
ArrayDataView<uint8_t> bytes_view;
27+
data.GetBytesDataView(&bytes_view);
28+
if (bytes_view.size() != sizeof(::LOGFONT))
29+
return false;
30+
31+
const ::LOGFONT* font = reinterpret_cast<const ::LOGFONT*>(bytes_view.data());
32+
if (_tcsnlen(font->lfFaceName, LF_FACESIZE) >= LF_FACESIZE)
33+
return false;
34+
35+
memcpy(out, font, sizeof(::LOGFONT));
36+
return true;
37+
}
38+
39+
} // namespace mojo
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright 2018 The Chromium Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
#ifndef MOJO_PUBLIC_CPP_BASE_LOGFONT_WIN_MOJOM_TRAITS_H_
6+
#define MOJO_PUBLIC_CPP_BASE_LOGFONT_WIN_MOJOM_TRAITS_H_
7+
8+
#include <windows.h>
9+
10+
#include <cstdint>
11+
12+
#include "base/component_export.h"
13+
#include "base/containers/span.h"
14+
#include "base/macros.h"
15+
#include "base/win/windows_types.h"
16+
#include "mojo/public/cpp/bindings/struct_traits.h"
17+
#include "mojo/public/mojom/base/logfont_win.mojom-shared.h"
18+
19+
namespace mojo {
20+
21+
template <>
22+
struct COMPONENT_EXPORT(MOJO_BASE_MOJOM)
23+
StructTraits<mojo_base::mojom::LOGFONTDataView, ::LOGFONT> {
24+
static base::span<const uint8_t> bytes(const ::LOGFONT& input);
25+
static bool Read(mojo_base::mojom::LOGFONTDataView data, ::LOGFONT* out);
26+
};
27+
28+
} // namespace mojo
29+
30+
#endif // MOJO_PUBLIC_CPP_BASE_LOGFONT_WIN_MOJOM_TRAITS_H_
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

third_party/jinja2/__init__.pyc

0 Bytes
Binary file not shown.

third_party/jinja2/_compat.pyc

0 Bytes
Binary file not shown.

third_party/jinja2/bccache.pyc

0 Bytes
Binary file not shown.

third_party/jinja2/compiler.pyc

0 Bytes
Binary file not shown.

third_party/jinja2/defaults.pyc

0 Bytes
Binary file not shown.

third_party/jinja2/environment.pyc

0 Bytes
Binary file not shown.

third_party/jinja2/exceptions.pyc

0 Bytes
Binary file not shown.

third_party/jinja2/filters.pyc

0 Bytes
Binary file not shown.

third_party/jinja2/idtracking.pyc

0 Bytes
Binary file not shown.

third_party/jinja2/lexer.pyc

0 Bytes
Binary file not shown.

third_party/jinja2/loaders.pyc

0 Bytes
Binary file not shown.

third_party/jinja2/nodes.pyc

0 Bytes
Binary file not shown.

third_party/jinja2/optimizer.pyc

0 Bytes
Binary file not shown.

third_party/jinja2/parser.pyc

0 Bytes
Binary file not shown.

third_party/jinja2/runtime.pyc

0 Bytes
Binary file not shown.

third_party/jinja2/tests.pyc

0 Bytes
Binary file not shown.

third_party/jinja2/utils.pyc

0 Bytes
Binary file not shown.

third_party/jinja2/visitor.pyc

0 Bytes
Binary file not shown.

third_party/markupsafe/__init__.pyc

0 Bytes
Binary file not shown.

third_party/markupsafe/_compat.pyc

0 Bytes
Binary file not shown.

third_party/markupsafe/_native.pyc

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)