Commit c431cc9f authored by Xiangjun Zhang's avatar Xiangjun Zhang Committed by Commit Bot

Mirroring service: Change build target to component.

Bug: 734672
Change-Id: I97941d577b6993170b4f5a506e51a9451623dccd
Reviewed-on: https://chromium-review.googlesource.com/1162772
Commit-Queue: Xiangjun Zhang <xjz@chromium.org>
Reviewed-by: default avatarYuri Wiitala <miu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581336}
parent 8df8b5d2
......@@ -1742,7 +1742,7 @@ jumbo_split_static_library("browser") {
"//components/mirroring/browser:browser",
"//components/mirroring/mojom:host",
"//components/mirroring/mojom:service",
"//components/mirroring/service:service",
"//components/mirroring/service:mirroring_service",
"//components/navigation_interception",
"//components/navigation_metrics",
"//components/net_log",
......
......@@ -4,7 +4,7 @@
import("//testing/test.gni")
source_set("service") {
component("mirroring_service") {
sources = [
"captured_audio_input.cc",
"captured_audio_input.h",
......@@ -60,6 +60,8 @@ source_set("service") {
"//services/network/public/mojom",
"//ui/gfx",
]
defines = [ "IS_MIRRORING_SERVICE_IMPL" ]
}
source_set("unittests") {
......@@ -83,7 +85,7 @@ source_set("unittests") {
]
deps = [
":service",
":mirroring_service",
"//base",
"//base/test:test_support",
"//components/mirroring/mojom:service",
......
......@@ -6,6 +6,7 @@
#define COMPONENTS_MIRRORING_SERVICE_CAPTURED_AUDIO_INPUT_H_
#include "base/callback.h"
#include "base/component_export.h"
#include "base/macros.h"
#include "base/sequence_checker.h"
#include "components/mirroring/mojom/resource_provider.mojom.h"
......@@ -17,9 +18,10 @@ namespace mirroring {
// CapturedAudioInput handles the creation, initialization and control of an
// audio input stream created by Audio Service.
class CapturedAudioInput final : public media::AudioInputIPC,
public mojom::AudioStreamCreatorClient,
public media::mojom::AudioInputStreamClient {
class COMPONENT_EXPORT(MIRRORING_SERVICE) CapturedAudioInput final
: public media::AudioInputIPC,
public mojom::AudioStreamCreatorClient,
public media::mojom::AudioInputStreamClient {
public:
using StreamCreatorCallback =
base::RepeatingCallback<void(mojom::AudioStreamCreatorClientPtr client,
......
......@@ -5,11 +5,13 @@
#ifndef COMPONENTS_MIRRORING_SERVICE_FEATURES_H_
#define COMPONENTS_MIRRORING_SERVICE_FEATURES_H_
#include "base/component_export.h"
#include "base/feature_list.h"
namespace mirroring {
namespace features {
COMPONENT_EXPORT(MIRRORING_SERVICE)
extern const base::Feature kMirroringService;
} // namespace features
......
......@@ -5,6 +5,7 @@
#ifndef COMPONENTS_MIRRORING_SERVICE_MEDIA_REMOTER_H_
#define COMPONENTS_MIRRORING_SERVICE_MEDIA_REMOTER_H_
#include "base/component_export.h"
#include "base/macros.h"
#include "media/cast/cast_config.h"
#include "media/mojo/interfaces/remoting.mojom.h"
......@@ -37,7 +38,8 @@ class RemotingSender;
// browser and the Cast Receiver. The audio/video data streams are delivered
// from the media renderer to the Mirroring Service through mojo datapipes, and
// are then sent out to Cast Receiver through Cast Streaming.
class MediaRemoter final : public media::mojom::Remoter {
class COMPONENT_EXPORT(MIRRORING_SERVICE) MediaRemoter final
: public media::mojom::Remoter {
public:
class Client {
public:
......
......@@ -6,6 +6,7 @@
#define COMPONENTS_MIRRORING_SERVICE_MESSAGE_DISPATCHER_H_
#include "base/callback.h"
#include "base/component_export.h"
#include "base/containers/flat_map.h"
#include "base/macros.h"
#include "components/mirroring/mojom/cast_message_channel.mojom.h"
......@@ -17,7 +18,8 @@ namespace mirroring {
// Dispatches inbound/outbound messages. The outbound messages are sent out
// through |outbound_channel|, and the inbound messages are handled by this
// class.
class MessageDispatcher final : public mojom::CastMessageChannel {
class COMPONENT_EXPORT(MIRRORING_SERVICE) MessageDispatcher final
: public mojom::CastMessageChannel {
public:
using ErrorCallback = base::RepeatingCallback<void(const std::string&)>;
MessageDispatcher(mojom::CastMessageChannelPtr outbound_channel,
......
......@@ -5,6 +5,7 @@
#ifndef COMPONENTS_MIRRORING_SERVICE_MIRROR_SETTINGS_H_
#define COMPONENTS_MIRRORING_SERVICE_MIRROR_SETTINGS_H_
#include "base/component_export.h"
#include "base/time/time.h"
#include "base/values.h"
#include "media/capture/video_capture_types.h"
......@@ -22,7 +23,7 @@ namespace mirroring {
// TODO(xjz): Add the function to generate the audio capture contraints.
// TODO(xjz): Add setters to the settings that might be overriden by integration
// tests.
class MirrorSettings {
class COMPONENT_EXPORT(MIRRORING_SERVICE) MirrorSettings {
public:
MirrorSettings();
~MirrorSettings();
......
......@@ -9,6 +9,7 @@
#include <string>
#include <vector>
#include "base/component_export.h"
#include "base/values.h"
namespace mirroring {
......@@ -22,7 +23,7 @@ enum ResponseType {
RPC, // Rpc binary messages. The payload is base64 encoded.
};
struct Answer {
struct COMPONENT_EXPORT(MIRRORING_SERVICE) Answer {
Answer();
~Answer();
Answer(const Answer& answer);
......@@ -43,7 +44,7 @@ struct Answer {
std::string cast_mode;
};
struct ReceiverStatus {
struct COMPONENT_EXPORT(MIRRORING_SERVICE) ReceiverStatus {
ReceiverStatus();
~ReceiverStatus();
ReceiverStatus(const ReceiverStatus& status);
......@@ -56,7 +57,7 @@ struct ReceiverStatus {
std::vector<int32_t> wifi_speed;
};
struct ReceiverKeySystem {
struct COMPONENT_EXPORT(MIRRORING_SERVICE) ReceiverKeySystem {
ReceiverKeySystem();
~ReceiverKeySystem();
ReceiverKeySystem(const ReceiverKeySystem& receiver_key_system);
......@@ -82,7 +83,7 @@ struct ReceiverKeySystem {
std::string distinctive_identifier_support;
};
struct ReceiverCapability {
struct COMPONENT_EXPORT(MIRRORING_SERVICE) ReceiverCapability {
ReceiverCapability();
~ReceiverCapability();
ReceiverCapability(const ReceiverCapability& capabilities);
......@@ -93,7 +94,7 @@ struct ReceiverCapability {
std::vector<ReceiverKeySystem> key_systems;
};
struct ReceiverError {
struct COMPONENT_EXPORT(MIRRORING_SERVICE) ReceiverError {
ReceiverError();
~ReceiverError();
bool Parse(const base::Value& raw_value);
......@@ -103,7 +104,7 @@ struct ReceiverError {
std::string details; // In JSON format.
};
struct ReceiverResponse {
struct COMPONENT_EXPORT(MIRRORING_SERVICE) ReceiverResponse {
ReceiverResponse();
~ReceiverResponse();
ReceiverResponse(ReceiverResponse&& receiver_response);
......
......@@ -8,6 +8,7 @@
#include <memory>
#include "base/callback.h"
#include "base/component_export.h"
#include "base/containers/queue.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
......@@ -29,8 +30,9 @@ namespace mirroring {
// RTP sender for a single Cast Remoting RTP stream. The client calls Send() to
// instruct the sender to read from a Mojo data pipe and transmit the data using
// a CastTransport.
class RemotingSender final : public media::mojom::RemotingDataStreamSender,
public media::cast::FrameSender {
class COMPONENT_EXPORT(MIRRORING_SERVICE) RemotingSender final
: public media::mojom::RemotingDataStreamSender,
public media::cast::FrameSender {
public:
// |transport| is expected to outlive this class.
RemotingSender(scoped_refptr<media::cast::CastEnvironment> cast_environment,
......
......@@ -10,6 +10,7 @@
#include <vector>
#include "base/callback.h"
#include "base/component_export.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
......@@ -32,7 +33,7 @@ class AudioSender;
namespace mirroring {
class RtpStreamClient {
class COMPONENT_EXPORT(MIRRORING_SERVICE) RtpStreamClient {
public:
virtual ~RtpStreamClient() {}
......@@ -61,7 +62,8 @@ class RtpStreamClient {
// regular intervals for a short period of time. This provides the video
// encoder, downstream, several copies of the last frame so that it may clear up
// lossy encoding artifacts.
class VideoRtpStream : public base::SupportsWeakPtr<VideoRtpStream> {
class COMPONENT_EXPORT(MIRRORING_SERVICE) VideoRtpStream
: public base::SupportsWeakPtr<VideoRtpStream> {
public:
VideoRtpStream(std::unique_ptr<media::cast::VideoSender> video_sender,
base::WeakPtr<RtpStreamClient> client);
......@@ -94,7 +96,8 @@ class VideoRtpStream : public base::SupportsWeakPtr<VideoRtpStream> {
};
// Receives audio data and submits the data to media::cast::AudioSender.
class AudioRtpStream : public base::SupportsWeakPtr<AudioRtpStream> {
class COMPONENT_EXPORT(MIRRORING_SERVICE) AudioRtpStream
: public base::SupportsWeakPtr<AudioRtpStream> {
public:
AudioRtpStream(std::unique_ptr<media::cast::AudioSender> audio_sender,
base::WeakPtr<RtpStreamClient> client);
......
......@@ -5,6 +5,7 @@
#ifndef COMPONENTS_MIRRORING_SERVICE_SESSION_H_
#define COMPONENTS_MIRRORING_SERVICE_SESSION_H_
#include "base/component_export.h"
#include "base/memory/weak_ptr.h"
#include "base/optional.h"
#include "base/single_thread_task_runner.h"
......@@ -44,7 +45,9 @@ class SessionMonitor;
// occurs. |observer| will get notified when status changes. |outbound_channel|
// is responsible for sending messages to the mirroring receiver through Cast
// Channel. |inbound_channel| receives message sent from the mirroring receiver.
class Session final : public RtpStreamClient, public MediaRemoter::Client {
class COMPONENT_EXPORT(MIRRORING_SERVICE) Session final
: public RtpStreamClient,
public MediaRemoter::Client {
public:
Session(mojom::SessionParametersPtr session_params,
const gfx::Size& max_resolution,
......
......@@ -8,6 +8,7 @@
#include <memory>
#include <string>
#include "base/component_export.h"
#include "base/containers/circular_deque.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
......@@ -47,7 +48,7 @@ class WifiStatusMonitor;
//
// To avoid unbounded memory use, older data is discarded automatically if too
// much is accumulating.
class SessionMonitor {
class COMPONENT_EXPORT(MIRRORING_SERVICE) SessionMonitor {
public:
using EventsAndStats =
std::pair<std::string /* events */, std::string /* stats */>;
......
......@@ -6,6 +6,7 @@
#define COMPONENTS_MIRRORING_SERVICE_UDP_SOCKET_CLIENT_H_
#include "base/callback.h"
#include "base/component_export.h"
#include "media/cast/net/cast_transport_config.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "net/base/ip_endpoint.h"
......@@ -20,8 +21,9 @@ namespace mirroring {
// |remote_endpoint_| when StartReceiving() is called. Sending/Receiving ends
// when StopReceiving() is called or this class is destructed. |error_callback|
// will be called if the UDPSocket is failed to be created or connected.
class UdpSocketClient final : public media::cast::PacketTransport,
public network::mojom::UDPSocketReceiver {
class COMPONENT_EXPORT(MIRRORING_SERVICE) UdpSocketClient final
: public media::cast::PacketTransport,
public network::mojom::UDPSocketReceiver {
public:
UdpSocketClient(const net::IPEndPoint& remote_endpoint,
network::mojom::NetworkContext* context,
......
......@@ -7,6 +7,7 @@
#include <string>
#include "base/component_export.h"
#include "base/values.h"
namespace mirroring {
......@@ -15,25 +16,32 @@ namespace mirroring {
// false if |key| exists and the type of the data mismatches. Return true
// otherwise.
COMPONENT_EXPORT(MIRRORING_SERVICE)
bool GetInt(const base::Value& value, const std::string& key, int32_t* result);
COMPONENT_EXPORT(MIRRORING_SERVICE)
bool GetDouble(const base::Value& value,
const std::string& key,
double* result);
COMPONENT_EXPORT(MIRRORING_SERVICE)
bool GetString(const base::Value& value,
const std::string& key,
std::string* result);
COMPONENT_EXPORT(MIRRORING_SERVICE)
bool GetBool(const base::Value& value, const std::string& key, bool* result);
COMPONENT_EXPORT(MIRRORING_SERVICE)
bool GetIntArray(const base::Value& value,
const std::string& key,
std::vector<int32_t>* result);
COMPONENT_EXPORT(MIRRORING_SERVICE)
bool GetStringArray(const base::Value& value,
const std::string& key,
std::vector<std::string>* result);
} // namespace mirroring
#endif // COMPONENTS_MIRRORING_SERVICE_VALUE_UTIL_H_
......@@ -6,6 +6,7 @@
#define COMPONENTS_MIRRORING_SERVICE_VIDEO_CAPTURE_CLIENT_H_
#include "base/callback.h"
#include "base/component_export.h"
#include "base/containers/flat_map.h"
#include "base/memory/weak_ptr.h"
#include "base/sequence_checker.h"
......@@ -25,7 +26,8 @@ namespace mirroring {
// media::mojom::VideoCaptureHost interface and requests to launch a video
// capture device. After the device is started, the captured video frames are
// received through the media::mojom::VideoCaptureObserver interface.
class VideoCaptureClient : public media::mojom::VideoCaptureObserver {
class COMPONENT_EXPORT(MIRRORING_SERVICE) VideoCaptureClient
: public media::mojom::VideoCaptureObserver {
public:
VideoCaptureClient(const media::VideoCaptureParams& params,
media::mojom::VideoCaptureHostPtr host);
......
......@@ -7,6 +7,7 @@
#include <vector>
#include "base/component_export.h"
#include "base/containers/circular_deque.h"
#include "base/macros.h"
#include "base/time/time.h"
......@@ -27,7 +28,7 @@ struct WifiStatus {
// updates, processes responses, and maintains a recent history of data points.
// This data can be included in feedback logs to help identify and diagnose
// issues related to lousy network performance.
class WifiStatusMonitor {
class COMPONENT_EXPORT(MIRRORING_SERVICE) WifiStatusMonitor {
public:
// |message_dispatcher| must keep alive during the lifetime of this class.
explicit WifiStatusMonitor(MessageDispatcher* message_dispatcher);
......
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