| // Copyright 2013 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 COMPONENTS_CONTENT_CAPTURE_COMMON_CONTENT_CAPTURE_MOJOM_H_ |
| #define COMPONENTS_CONTENT_CAPTURE_COMMON_CONTENT_CAPTURE_MOJOM_H_ |
| |
| #include <stdint.h> |
| |
| #include <limits> |
| #include <type_traits> |
| #include <utility> |
| |
| #include "base/callback.h" |
| #include "base/macros.h" |
| #include "base/optional.h" |
| |
| #include "mojo/public/cpp/bindings/mojo_buildflags.h" |
| #if BUILDFLAG(MOJO_TRACE_ENABLED) |
| #include "base/trace_event/trace_event.h" |
| #endif |
| #include "mojo/public/cpp/bindings/clone_traits.h" |
| #include "mojo/public/cpp/bindings/equals_traits.h" |
| #include "mojo/public/cpp/bindings/lib/serialization.h" |
| #include "mojo/public/cpp/bindings/struct_ptr.h" |
| #include "mojo/public/cpp/bindings/struct_traits.h" |
| #include "mojo/public/cpp/bindings/union_traits.h" |
| #include "components/content_capture/common/content_capture.mojom-shared.h" |
| #include "components/content_capture/common/content_capture.mojom-forward.h" |
| #include "components/content_capture/common/content_capture_data.mojom-forward.h" |
| #include <string> |
| #include <vector> |
| |
| #include "mojo/public/cpp/bindings/associated_interface_ptr.h" |
| #include "mojo/public/cpp/bindings/associated_interface_ptr_info.h" |
| #include "mojo/public/cpp/bindings/associated_interface_request.h" |
| #include "mojo/public/cpp/bindings/interface_ptr.h" |
| #include "mojo/public/cpp/bindings/interface_request.h" |
| #include "mojo/public/cpp/bindings/lib/control_message_handler.h" |
| #include "mojo/public/cpp/bindings/raw_ptr_impl_ref_traits.h" |
| #include "mojo/public/cpp/bindings/thread_safe_interface_ptr.h" |
| |
| |
| #include "mojo/public/cpp/bindings/lib/native_enum_serialization.h" |
| #include "mojo/public/cpp/bindings/lib/native_struct_serialization.h" |
| |
| #ifdef KYTHE_IS_RUNNING |
| #pragma kythe_inline_metadata "Metadata comment" |
| #endif |
| |
| |
| namespace content_capture { |
| namespace mojom { |
| |
| class ContentCaptureReceiverProxy; |
| |
| template <typename ImplRefTraits> |
| class ContentCaptureReceiverStub; |
| |
| class ContentCaptureReceiverRequestValidator; |
| |
| |
| // @generated_from: content_capture.mojom.ContentCaptureReceiver |
| class ContentCaptureReceiver |
| : public ContentCaptureReceiverInterfaceBase { |
| public: |
| static const char Name_[]; |
| static constexpr uint32_t Version_ = 0; |
| static constexpr bool PassesAssociatedKinds_ = false; |
| static constexpr bool HasSyncMethods_ = false; |
| |
| using Base_ = ContentCaptureReceiverInterfaceBase; |
| using Proxy_ = ContentCaptureReceiverProxy; |
| |
| template <typename ImplRefTraits> |
| using Stub_ = ContentCaptureReceiverStub<ImplRefTraits>; |
| |
| using RequestValidator_ = ContentCaptureReceiverRequestValidator; |
| using ResponseValidator_ = mojo::PassThroughFilter; |
| enum MethodMinVersions : uint32_t { |
| kDidCaptureContentMinVersion = 0, |
| kDidUpdateContentMinVersion = 0, |
| kDidRemoveContentMinVersion = 0, |
| }; |
| virtual ~ContentCaptureReceiver() {} |
| |
| |
| // @generated_from: content_capture.mojom.ContentCaptureReceiver.DidCaptureContent |
| virtual void DidCaptureContent(const content_capture::ContentCaptureData& data, bool first_data) = 0; |
| |
| |
| // @generated_from: content_capture.mojom.ContentCaptureReceiver.DidUpdateContent |
| virtual void DidUpdateContent(const content_capture::ContentCaptureData& data) = 0; |
| |
| |
| // @generated_from: content_capture.mojom.ContentCaptureReceiver.DidRemoveContent |
| virtual void DidRemoveContent(const std::vector<int64_t>& ids) = 0; |
| }; |
| |
| class ContentCaptureSenderProxy; |
| |
| template <typename ImplRefTraits> |
| class ContentCaptureSenderStub; |
| |
| class ContentCaptureSenderRequestValidator; |
| |
| |
| // @generated_from: content_capture.mojom.ContentCaptureSender |
| class ContentCaptureSender |
| : public ContentCaptureSenderInterfaceBase { |
| public: |
| static const char Name_[]; |
| static constexpr uint32_t Version_ = 0; |
| static constexpr bool PassesAssociatedKinds_ = false; |
| static constexpr bool HasSyncMethods_ = false; |
| |
| using Base_ = ContentCaptureSenderInterfaceBase; |
| using Proxy_ = ContentCaptureSenderProxy; |
| |
| template <typename ImplRefTraits> |
| using Stub_ = ContentCaptureSenderStub<ImplRefTraits>; |
| |
| using RequestValidator_ = ContentCaptureSenderRequestValidator; |
| using ResponseValidator_ = mojo::PassThroughFilter; |
| enum MethodMinVersions : uint32_t { |
| kStartCaptureMinVersion = 0, |
| kStopCaptureMinVersion = 0, |
| }; |
| virtual ~ContentCaptureSender() {} |
| |
| |
| // @generated_from: content_capture.mojom.ContentCaptureSender.StartCapture |
| virtual void StartCapture() = 0; |
| |
| |
| // @generated_from: content_capture.mojom.ContentCaptureSender.StopCapture |
| virtual void StopCapture() = 0; |
| }; |
| |
| class ContentCaptureReceiverProxy |
| : public ContentCaptureReceiver { |
| public: |
| using InterfaceType = ContentCaptureReceiver; |
| |
| explicit ContentCaptureReceiverProxy(mojo::MessageReceiverWithResponder* receiver); |
| void DidCaptureContent(const content_capture::ContentCaptureData& data, bool first_data) final; |
| void DidUpdateContent(const content_capture::ContentCaptureData& data) final; |
| void DidRemoveContent(const std::vector<int64_t>& ids) final; |
| |
| private: |
| mojo::MessageReceiverWithResponder* receiver_; |
| }; |
| |
| class ContentCaptureSenderProxy |
| : public ContentCaptureSender { |
| public: |
| using InterfaceType = ContentCaptureSender; |
| |
| explicit ContentCaptureSenderProxy(mojo::MessageReceiverWithResponder* receiver); |
| void StartCapture() final; |
| void StopCapture() final; |
| |
| private: |
| mojo::MessageReceiverWithResponder* receiver_; |
| }; |
| class ContentCaptureReceiverStubDispatch { |
| public: |
| static bool Accept(ContentCaptureReceiver* impl, mojo::Message* message); |
| static bool AcceptWithResponder( |
| ContentCaptureReceiver* impl, |
| mojo::Message* message, |
| std::unique_ptr<mojo::MessageReceiverWithStatus> responder); |
| }; |
| |
| template <typename ImplRefTraits = |
| mojo::RawPtrImplRefTraits<ContentCaptureReceiver>> |
| class ContentCaptureReceiverStub |
| : public mojo::MessageReceiverWithResponderStatus { |
| public: |
| using ImplPointerType = typename ImplRefTraits::PointerType; |
| |
| ContentCaptureReceiverStub() {} |
| ~ContentCaptureReceiverStub() override {} |
| |
| void set_sink(ImplPointerType sink) { sink_ = std::move(sink); } |
| ImplPointerType& sink() { return sink_; } |
| |
| bool Accept(mojo::Message* message) override { |
| if (ImplRefTraits::IsNull(sink_)) |
| return false; |
| return ContentCaptureReceiverStubDispatch::Accept( |
| ImplRefTraits::GetRawPointer(&sink_), message); |
| } |
| |
| bool AcceptWithResponder( |
| mojo::Message* message, |
| std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override { |
| if (ImplRefTraits::IsNull(sink_)) |
| return false; |
| return ContentCaptureReceiverStubDispatch::AcceptWithResponder( |
| ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder)); |
| } |
| |
| private: |
| ImplPointerType sink_; |
| }; |
| class ContentCaptureSenderStubDispatch { |
| public: |
| static bool Accept(ContentCaptureSender* impl, mojo::Message* message); |
| static bool AcceptWithResponder( |
| ContentCaptureSender* impl, |
| mojo::Message* message, |
| std::unique_ptr<mojo::MessageReceiverWithStatus> responder); |
| }; |
| |
| template <typename ImplRefTraits = |
| mojo::RawPtrImplRefTraits<ContentCaptureSender>> |
| class ContentCaptureSenderStub |
| : public mojo::MessageReceiverWithResponderStatus { |
| public: |
| using ImplPointerType = typename ImplRefTraits::PointerType; |
| |
| ContentCaptureSenderStub() {} |
| ~ContentCaptureSenderStub() override {} |
| |
| void set_sink(ImplPointerType sink) { sink_ = std::move(sink); } |
| ImplPointerType& sink() { return sink_; } |
| |
| bool Accept(mojo::Message* message) override { |
| if (ImplRefTraits::IsNull(sink_)) |
| return false; |
| return ContentCaptureSenderStubDispatch::Accept( |
| ImplRefTraits::GetRawPointer(&sink_), message); |
| } |
| |
| bool AcceptWithResponder( |
| mojo::Message* message, |
| std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override { |
| if (ImplRefTraits::IsNull(sink_)) |
| return false; |
| return ContentCaptureSenderStubDispatch::AcceptWithResponder( |
| ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder)); |
| } |
| |
| private: |
| ImplPointerType sink_; |
| }; |
| class ContentCaptureReceiverRequestValidator : public mojo::MessageReceiver { |
| public: |
| bool Accept(mojo::Message* message) override; |
| }; |
| class ContentCaptureSenderRequestValidator : public mojo::MessageReceiver { |
| public: |
| bool Accept(mojo::Message* message) override; |
| }; |
| |
| |
| |
| |
| |
| } // namespace mojom |
| } // namespace content_capture |
| |
| namespace mojo { |
| |
| } // namespace mojo |
| |
| #endif // COMPONENTS_CONTENT_CAPTURE_COMMON_CONTENT_CAPTURE_MOJOM_H_
|
| /* Metadata comment
|
| eyJtZXRhIjogW3siZW5kIjogMjE5OCwgImJlZ2luIjogMjE3NiwgImVkZ2UiOiAiJS9reXRoZS9l
|
| ZGdlL2dlbmVyYXRlcyIsICJ0eXBlIjogImFuY2hvcl9kZWZpbmVzIiwgInZuYW1lIjogeyJjb3Jw
|
| dXMiOiAiY2hyb21pdW0uZ29vZ2xlc291cmNlLmNvbS9jaHJvbWl1bS9zcmMiLCAibGFuZ3VhZ2Ui
|
| OiAibW9qb20iLCAic2lnbmF0dXJlIjogImNvbnRlbnRfY2FwdHVyZS5tb2pvbS5Db250ZW50Q2Fw
|
| dHVyZVJlY2VpdmVyIn19LCB7ImVuZCI6IDMwNjcsICJiZWdpbiI6IDMwNTAsICJlZGdlIjogIiUv
|
| a3l0aGUvZWRnZS9nZW5lcmF0ZXMiLCAidHlwZSI6ICJhbmNob3JfZGVmaW5lcyIsICJ2bmFtZSI6
|
| IHsiY29ycHVzIjogImNocm9taXVtLmdvb2dsZXNvdXJjZS5jb20vY2hyb21pdW0vc3JjIiwgImxh
|
| bmd1YWdlIjogIm1vam9tIiwgInNpZ25hdHVyZSI6ICJjb250ZW50X2NhcHR1cmUubW9qb20uQ29u
|
| dGVudENhcHR1cmVSZWNlaXZlci5EaWRDYXB0dXJlQ29udGVudCJ9fSwgeyJlbm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