Commit 0c36b098 authored by Ken Rockot's avatar Ken Rockot Committed by Commit Bot

Clean up Data Decoder implementation

Removes dead code inside Data Decoder that was there to support its use
through Service Manager clients which no longer exist.

Bug: 977637
Change-Id: I379787ff50cf2d12bc364f17ed1d6a42d2c1b836
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1892671
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712795}
parent 8077abdc
...@@ -40,7 +40,6 @@ source_set("lib") { ...@@ -40,7 +40,6 @@ source_set("lib") {
public_deps = [ public_deps = [
"//services/data_decoder/public/mojom", "//services/data_decoder/public/mojom",
"//services/service_manager/public/cpp",
] ]
if (!is_ios) { if (!is_ios) {
...@@ -87,6 +86,7 @@ source_set("tests") { ...@@ -87,6 +86,7 @@ source_set("tests") {
deps += [ deps += [
"//gin", "//gin",
"//gin:gin_test", "//gin:gin_test",
"//services/service_manager/public/cpp",
"//third_party/blink/public:blink", "//third_party/blink/public:blink",
] ]
data_deps = [ data_deps = [
......
...@@ -29,9 +29,7 @@ const int kDataTypeManufacturerData = 0xFF; ...@@ -29,9 +29,7 @@ const int kDataTypeManufacturerData = 0xFF;
const char kUuidPrefix[] = "0000"; const char kUuidPrefix[] = "0000";
const char kUuidSuffix[] = "-0000-1000-8000-00805F9B34FB"; const char kUuidSuffix[] = "-0000-1000-8000-00805F9B34FB";
BleScanParserImpl::BleScanParserImpl( BleScanParserImpl::BleScanParserImpl() = default;
std::unique_ptr<service_manager::ServiceContextRef> service_ref)
: service_ref_(std::move(service_ref)) {}
BleScanParserImpl::~BleScanParserImpl() = default; BleScanParserImpl::~BleScanParserImpl() = default;
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "base/macros.h" #include "base/macros.h"
#include "device/bluetooth/public/mojom/uuid.mojom.h" #include "device/bluetooth/public/mojom/uuid.mojom.h"
#include "services/data_decoder/public/mojom/ble_scan_parser.mojom.h" #include "services/data_decoder/public/mojom/ble_scan_parser.mojom.h"
#include "services/service_manager/public/cpp/service_context_ref.h"
namespace data_decoder { namespace data_decoder {
...@@ -31,8 +30,7 @@ enum class UuidFormat { ...@@ -31,8 +30,7 @@ enum class UuidFormat {
class BleScanParserImpl : public mojom::BleScanParser { class BleScanParserImpl : public mojom::BleScanParser {
public: public:
explicit BleScanParserImpl( BleScanParserImpl();
std::unique_ptr<service_manager::ServiceContextRef> service_ref);
~BleScanParserImpl() override; ~BleScanParserImpl() override;
// mojom::BleScanParser: // mojom::BleScanParser:
...@@ -51,8 +49,6 @@ class BleScanParserImpl : public mojom::BleScanParser { ...@@ -51,8 +49,6 @@ class BleScanParserImpl : public mojom::BleScanParser {
std::vector<device::BluetoothUUID>* service_uuids); std::vector<device::BluetoothUUID>* service_uuids);
private: private:
const std::unique_ptr<service_manager::ServiceContextRef> service_ref_;
DISALLOW_COPY_AND_ASSIGN(BleScanParserImpl); DISALLOW_COPY_AND_ASSIGN(BleScanParserImpl);
}; };
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/bindings/remote.h"
#include "services/data_decoder/public/mojom/bundled_exchanges_parser.mojom.h" #include "services/data_decoder/public/mojom/bundled_exchanges_parser.mojom.h"
#include "services/service_manager/public/cpp/service_context_ref.h"
namespace data_decoder { namespace data_decoder {
......
...@@ -45,9 +45,7 @@ class FileDataSource final : public mojom::BundleDataSource { ...@@ -45,9 +45,7 @@ class FileDataSource final : public mojom::BundleDataSource {
} // namespace } // namespace
BundledExchangesParserFactory::BundledExchangesParserFactory( BundledExchangesParserFactory::BundledExchangesParserFactory() = default;
std::unique_ptr<service_manager::ServiceContextRef> service_ref)
: service_ref_(std::move(service_ref)) {}
BundledExchangesParserFactory::~BundledExchangesParserFactory() = default; BundledExchangesParserFactory::~BundledExchangesParserFactory() = default;
......
...@@ -12,15 +12,13 @@ ...@@ -12,15 +12,13 @@
#include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/bindings/remote.h"
#include "services/data_decoder/public/mojom/bundled_exchanges_parser.mojom.h" #include "services/data_decoder/public/mojom/bundled_exchanges_parser.mojom.h"
#include "services/service_manager/public/cpp/service_context_ref.h"
namespace data_decoder { namespace data_decoder {
class BundledExchangesParserFactory class BundledExchangesParserFactory
: public mojom::BundledExchangesParserFactory { : public mojom::BundledExchangesParserFactory {
public: public:
explicit BundledExchangesParserFactory( BundledExchangesParserFactory();
std::unique_ptr<service_manager::ServiceContextRef> service_ref);
~BundledExchangesParserFactory() override; ~BundledExchangesParserFactory() override;
std::unique_ptr<mojom::BundleDataSource> CreateFileDataSourceForTesting( std::unique_ptr<mojom::BundleDataSource> CreateFileDataSourceForTesting(
...@@ -36,8 +34,6 @@ class BundledExchangesParserFactory ...@@ -36,8 +34,6 @@ class BundledExchangesParserFactory
mojo::PendingReceiver<mojom::BundledExchangesParser> receiver, mojo::PendingReceiver<mojom::BundledExchangesParser> receiver,
mojo::PendingRemote<mojom::BundleDataSource> data_source) override; mojo::PendingRemote<mojom::BundleDataSource> data_source) override;
const std::unique_ptr<service_manager::ServiceContextRef> service_ref_;
DISALLOW_COPY_AND_ASSIGN(BundledExchangesParserFactory); DISALLOW_COPY_AND_ASSIGN(BundledExchangesParserFactory);
}; };
......
...@@ -33,8 +33,7 @@ base::FilePath GetTestFilePath(const base::FilePath& path) { ...@@ -33,8 +33,7 @@ base::FilePath GetTestFilePath(const base::FilePath& path) {
class BundledExchangesParserFactoryTest : public testing::Test { class BundledExchangesParserFactoryTest : public testing::Test {
public: public:
BundledExchangesParserFactoryTest() BundledExchangesParserFactoryTest()
: factory_(std::make_unique<BundledExchangesParserFactory>( : factory_(std::make_unique<BundledExchangesParserFactory>()) {}
/*service_ref=*/nullptr)) {}
std::unique_ptr<mojom::BundleDataSource> CreateFileDataSource( std::unique_ptr<mojom::BundleDataSource> CreateFileDataSource(
mojo::PendingReceiver<mojom::BundleDataSource> receiver, mojo::PendingReceiver<mojom::BundleDataSource> receiver,
......
...@@ -58,8 +58,7 @@ class BundledExchangesParserFuzzer { ...@@ -58,8 +58,7 @@ class BundledExchangesParserFuzzer {
data_source_.AddReceiver( data_source_.AddReceiver(
data_source_remote.InitWithNewPipeAndPassReceiver()); data_source_remote.InitWithNewPipeAndPassReceiver());
data_decoder::BundledExchangesParserFactory factory_impl( data_decoder::BundledExchangesParserFactory factory_impl;
/*service_ref=*/nullptr);
data_decoder::mojom::BundledExchangesParserFactory& factory = factory_impl; data_decoder::mojom::BundledExchangesParserFactory& factory = factory_impl;
factory.GetParserForDataSource(parser_.BindNewPipeAndPassReceiver(), factory.GetParserForDataSource(parser_.BindNewPipeAndPassReceiver(),
std::move(data_source_remote)); std::move(data_source_remote));
......
...@@ -28,24 +28,10 @@ ...@@ -28,24 +28,10 @@
namespace data_decoder { namespace data_decoder {
namespace { DataDecoderService::DataDecoderService() = default;
constexpr auto kMaxServiceIdleTime = base::TimeDelta::FromSeconds(5);
} // namespace
DataDecoderService::DataDecoderService()
: keepalive_(&binding_, kMaxServiceIdleTime) {}
DataDecoderService::DataDecoderService(
mojo::PendingReceiver<service_manager::mojom::Service> receiver)
: DataDecoderService() {
binding_.Bind(std::move(receiver));
}
DataDecoderService::DataDecoderService( DataDecoderService::DataDecoderService(
mojo::PendingReceiver<mojom::DataDecoderService> receiver) mojo::PendingReceiver<mojom::DataDecoderService> receiver) {
: DataDecoderService() {
receiver_.Bind(std::move(receiver)); receiver_.Bind(std::move(receiver));
} }
...@@ -56,26 +42,6 @@ void DataDecoderService::BindReceiver( ...@@ -56,26 +42,6 @@ void DataDecoderService::BindReceiver(
receiver_.Bind(std::move(receiver)); receiver_.Bind(std::move(receiver));
} }
void DataDecoderService::OnBindInterface(
const service_manager::BindSourceInfo& source_info,
const std::string& interface_name,
mojo::ScopedMessagePipeHandle interface_pipe) {
mojo::GenericPendingReceiver receiver(interface_name,
std::move(interface_pipe));
if (auto r = receiver.As<mojom::ImageDecoder>())
BindImageDecoder(std::move(r));
else if (auto r = receiver.As<mojom::JsonParser>())
BindJsonParser(std::move(r));
else if (auto r = receiver.As<mojom::XmlParser>())
BindXmlParser(std::move(r));
else if (auto r = receiver.As<mojom::BundledExchangesParserFactory>())
BindBundledExchangesParserFactory(std::move(r));
#if defined(OS_CHROMEOS)
else if (auto r = receiver.As<mojom::BleScanParser>())
BindBleScanParser(std::move(r));
#endif
}
void DataDecoderService::BindImageDecoder( void DataDecoderService::BindImageDecoder(
mojo::PendingReceiver<mojom::ImageDecoder> receiver) { mojo::PendingReceiver<mojom::ImageDecoder> receiver) {
#if defined(OS_IOS) #if defined(OS_IOS)
...@@ -83,9 +49,8 @@ void DataDecoderService::BindImageDecoder( ...@@ -83,9 +49,8 @@ void DataDecoderService::BindImageDecoder(
#else #else
if (drop_image_decoders_) if (drop_image_decoders_)
return; return;
mojo::MakeSelfOwnedReceiver( mojo::MakeSelfOwnedReceiver(std::make_unique<ImageDecoderImpl>(),
std::make_unique<ImageDecoderImpl>(keepalive_.CreateRef()), std::move(receiver));
std::move(receiver));
#endif #endif
} }
...@@ -93,30 +58,27 @@ void DataDecoderService::BindJsonParser( ...@@ -93,30 +58,27 @@ void DataDecoderService::BindJsonParser(
mojo::PendingReceiver<mojom::JsonParser> receiver) { mojo::PendingReceiver<mojom::JsonParser> receiver) {
if (drop_json_parsers_) if (drop_json_parsers_)
return; return;
mojo::MakeSelfOwnedReceiver( mojo::MakeSelfOwnedReceiver(std::make_unique<JsonParserImpl>(),
std::make_unique<JsonParserImpl>(keepalive_.CreateRef()), std::move(receiver));
std::move(receiver));
} }
void DataDecoderService::BindXmlParser( void DataDecoderService::BindXmlParser(
mojo::PendingReceiver<mojom::XmlParser> receiver) { mojo::PendingReceiver<mojom::XmlParser> receiver) {
mojo::MakeSelfOwnedReceiver( mojo::MakeSelfOwnedReceiver(std::make_unique<XmlParser>(),
std::make_unique<XmlParser>(keepalive_.CreateRef()), std::move(receiver)); std::move(receiver));
} }
void DataDecoderService::BindBundledExchangesParserFactory( void DataDecoderService::BindBundledExchangesParserFactory(
mojo::PendingReceiver<mojom::BundledExchangesParserFactory> receiver) { mojo::PendingReceiver<mojom::BundledExchangesParserFactory> receiver) {
mojo::MakeSelfOwnedReceiver( mojo::MakeSelfOwnedReceiver(std::make_unique<BundledExchangesParserFactory>(),
std::make_unique<BundledExchangesParserFactory>(keepalive_.CreateRef()), std::move(receiver));
std::move(receiver));
} }
#ifdef OS_CHROMEOS #ifdef OS_CHROMEOS
void DataDecoderService::BindBleScanParser( void DataDecoderService::BindBleScanParser(
mojo::PendingReceiver<mojom::BleScanParser> receiver) { mojo::PendingReceiver<mojom::BleScanParser> receiver) {
mojo::MakeSelfOwnedReceiver( mojo::MakeSelfOwnedReceiver(std::make_unique<BleScanParserImpl>(),
std::make_unique<BleScanParserImpl>(keepalive_.CreateRef()), std::move(receiver));
std::move(receiver));
} }
#endif // OS_CHROMEOS #endif // OS_CHROMEOS
......
...@@ -15,10 +15,6 @@ ...@@ -15,10 +15,6 @@
#include "services/data_decoder/public/mojom/image_decoder.mojom.h" #include "services/data_decoder/public/mojom/image_decoder.mojom.h"
#include "services/data_decoder/public/mojom/json_parser.mojom.h" #include "services/data_decoder/public/mojom/json_parser.mojom.h"
#include "services/data_decoder/public/mojom/xml_parser.mojom.h" #include "services/data_decoder/public/mojom/xml_parser.mojom.h"
#include "services/service_manager/public/cpp/service.h"
#include "services/service_manager/public/cpp/service_binding.h"
#include "services/service_manager/public/cpp/service_keepalive.h"
#include "services/service_manager/public/mojom/service.mojom.h"
#ifdef OS_CHROMEOS #ifdef OS_CHROMEOS
#include "services/data_decoder/public/mojom/ble_scan_parser.mojom.h" #include "services/data_decoder/public/mojom/ble_scan_parser.mojom.h"
...@@ -26,12 +22,9 @@ ...@@ -26,12 +22,9 @@
namespace data_decoder { namespace data_decoder {
class DataDecoderService : public service_manager::Service, class DataDecoderService : public mojom::DataDecoderService {
public mojom::DataDecoderService {
public: public:
DataDecoderService(); DataDecoderService();
explicit DataDecoderService(
mojo::PendingReceiver<service_manager::mojom::Service> receiver);
explicit DataDecoderService( explicit DataDecoderService(
mojo::PendingReceiver<mojom::DataDecoderService> receiver); mojo::PendingReceiver<mojom::DataDecoderService> receiver);
~DataDecoderService() override; ~DataDecoderService() override;
...@@ -41,11 +34,6 @@ class DataDecoderService : public service_manager::Service, ...@@ -41,11 +34,6 @@ class DataDecoderService : public service_manager::Service,
// constructed. // constructed.
void BindReceiver(mojo::PendingReceiver<mojom::DataDecoderService> receiver); void BindReceiver(mojo::PendingReceiver<mojom::DataDecoderService> receiver);
// service_manager::Service implementation:
void OnBindInterface(const service_manager::BindSourceInfo& source_info,
const std::string& interface_name,
mojo::ScopedMessagePipeHandle interface_pipe) override;
// Configures the service to drop ImageDecoder receivers instead of binding // Configures the service to drop ImageDecoder receivers instead of binding
// them. Useful for tests simulating service failures. // them. Useful for tests simulating service failures.
void SimulateImageDecoderCrashForTesting(bool drop) { void SimulateImageDecoderCrashForTesting(bool drop) {
...@@ -73,8 +61,6 @@ class DataDecoderService : public service_manager::Service, ...@@ -73,8 +61,6 @@ class DataDecoderService : public service_manager::Service,
mojo::PendingReceiver<mojom::BleScanParser> receiver) override; mojo::PendingReceiver<mojom::BleScanParser> receiver) override;
#endif // OS_CHROMEOS #endif // OS_CHROMEOS
service_manager::ServiceBinding binding_{this};
service_manager::ServiceKeepalive keepalive_;
mojo::Receiver<mojom::DataDecoderService> receiver_{this}; mojo::Receiver<mojom::DataDecoderService> receiver_{this};
bool drop_image_decoders_ = false; bool drop_image_decoders_ = false;
......
...@@ -65,9 +65,7 @@ void ResizeImage(SkBitmap* decoded_image, ...@@ -65,9 +65,7 @@ void ResizeImage(SkBitmap* decoded_image,
} // namespace } // namespace
ImageDecoderImpl::ImageDecoderImpl( ImageDecoderImpl::ImageDecoderImpl() = default;
std::unique_ptr<service_manager::ServiceContextRef> service_ref)
: service_ref_(std::move(service_ref)) {}
ImageDecoderImpl::~ImageDecoderImpl() = default; ImageDecoderImpl::~ImageDecoderImpl() = default;
......
...@@ -9,15 +9,13 @@ ...@@ -9,15 +9,13 @@
#include "base/macros.h" #include "base/macros.h"
#include "services/data_decoder/public/mojom/image_decoder.mojom.h" #include "services/data_decoder/public/mojom/image_decoder.mojom.h"
#include "services/service_manager/public/cpp/service_context_ref.h"
#include "ui/gfx/geometry/size.h" #include "ui/gfx/geometry/size.h"
namespace data_decoder { namespace data_decoder {
class ImageDecoderImpl : public mojom::ImageDecoder { class ImageDecoderImpl : public mojom::ImageDecoder {
public: public:
explicit ImageDecoderImpl( ImageDecoderImpl();
std::unique_ptr<service_manager::ServiceContextRef> service_ref);
~ImageDecoderImpl() override; ~ImageDecoderImpl() override;
// Overridden from mojom::ImageDecoder: // Overridden from mojom::ImageDecoder:
...@@ -33,8 +31,6 @@ class ImageDecoderImpl : public mojom::ImageDecoder { ...@@ -33,8 +31,6 @@ class ImageDecoderImpl : public mojom::ImageDecoder {
DecodeAnimationCallback callback) override; DecodeAnimationCallback callback) override;
private: private:
const std::unique_ptr<service_manager::ServiceContextRef> service_ref_;
DISALLOW_COPY_AND_ASSIGN(ImageDecoderImpl); DISALLOW_COPY_AND_ASSIGN(ImageDecoderImpl);
}; };
......
...@@ -98,8 +98,8 @@ base::LazyInstance<BlinkInitializer>::Leaky g_blink_initializer = ...@@ -98,8 +98,8 @@ base::LazyInstance<BlinkInitializer>::Leaky g_blink_initializer =
class ImageDecoderImplTest : public testing::Test { class ImageDecoderImplTest : public testing::Test {
public: public:
ImageDecoderImplTest() : decoder_(nullptr) {} ImageDecoderImplTest() = default;
~ImageDecoderImplTest() override {} ~ImageDecoderImplTest() override = default;
void SetUp() override { g_blink_initializer.Get(); } void SetUp() override { g_blink_initializer.Get(); }
......
...@@ -12,9 +12,7 @@ ...@@ -12,9 +12,7 @@
namespace data_decoder { namespace data_decoder {
JsonParserImpl::JsonParserImpl( JsonParserImpl::JsonParserImpl() = default;
std::unique_ptr<service_manager::ServiceContextRef> service_ref)
: service_ref_(std::move(service_ref)) {}
JsonParserImpl::~JsonParserImpl() = default; JsonParserImpl::~JsonParserImpl() = default;
......
...@@ -9,19 +9,15 @@ ...@@ -9,19 +9,15 @@
#include "base/macros.h" #include "base/macros.h"
#include "services/data_decoder/public/mojom/json_parser.mojom.h" #include "services/data_decoder/public/mojom/json_parser.mojom.h"
#include "services/service_manager/public/cpp/service_context_ref.h"
namespace data_decoder { namespace data_decoder {
class JsonParserImpl : public mojom::JsonParser { class JsonParserImpl : public mojom::JsonParser {
public: public:
explicit JsonParserImpl( JsonParserImpl();
std::unique_ptr<service_manager::ServiceContextRef> service_ref);
~JsonParserImpl() override; ~JsonParserImpl() override;
private: private:
const std::unique_ptr<service_manager::ServiceContextRef> service_ref_;
// mojom::JsonParser implementation. // mojom::JsonParser implementation.
void Parse(const std::string& json, ParseCallback callback) override; void Parse(const std::string& json, ParseCallback callback) override;
......
...@@ -46,7 +46,6 @@ source_set("cpp") { ...@@ -46,7 +46,6 @@ source_set("cpp") {
":service_provider", ":service_provider",
"//base", "//base",
"//services/data_decoder/public/mojom", "//services/data_decoder/public/mojom",
"//services/service_manager/public/cpp",
] ]
if (is_android) { if (is_android) {
......
...@@ -18,7 +18,7 @@ namespace data_decoder { ...@@ -18,7 +18,7 @@ namespace data_decoder {
namespace { namespace {
std::unique_ptr<base::Value> ParseXml(const std::string& xml) { std::unique_ptr<base::Value> ParseXml(const std::string& xml) {
XmlParser parser_impl(/*service_ref=*/nullptr); XmlParser parser_impl;
mojom::XmlParser& parser = parser_impl; mojom::XmlParser& parser = parser_impl;
std::unique_ptr<base::Value> root_node; std::unique_ptr<base::Value> root_node;
......
...@@ -103,9 +103,7 @@ void PopulateAttributes(base::Value* node_value, XmlReader* xml_reader) { ...@@ -103,9 +103,7 @@ void PopulateAttributes(base::Value* node_value, XmlReader* xml_reader) {
} // namespace } // namespace
XmlParser::XmlParser( XmlParser::XmlParser() = default;
std::unique_ptr<service_manager::ServiceContextRef> service_ref)
: service_ref_(std::move(service_ref)) {}
XmlParser::~XmlParser() = default; XmlParser::~XmlParser() = default;
......
...@@ -10,19 +10,15 @@ ...@@ -10,19 +10,15 @@
#include "base/macros.h" #include "base/macros.h"
#include "services/data_decoder/public/mojom/xml_parser.mojom.h" #include "services/data_decoder/public/mojom/xml_parser.mojom.h"
#include "services/service_manager/public/cpp/service_context_ref.h"
namespace data_decoder { namespace data_decoder {
class XmlParser : public mojom::XmlParser { class XmlParser : public mojom::XmlParser {
public: public:
explicit XmlParser( XmlParser();
std::unique_ptr<service_manager::ServiceContextRef> service_ref);
~XmlParser() override; ~XmlParser() override;
private: private:
const std::unique_ptr<service_manager::ServiceContextRef> service_ref_;
// mojom::XmlParser implementation. // mojom::XmlParser implementation.
void Parse(const std::string& xml, ParseCallback callback) override; void Parse(const std::string& xml, ParseCallback callback) override;
......
...@@ -32,7 +32,7 @@ static ScopedXmlErrorFunc scoped_xml_error_func(nullptr, &ignore); ...@@ -32,7 +32,7 @@ static ScopedXmlErrorFunc scoped_xml_error_func(nullptr, &ignore);
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
const char* data_ptr = reinterpret_cast<const char*>(data); const char* data_ptr = reinterpret_cast<const char*>(data);
data_decoder::XmlParser xml_parser_impl(/*service_ref=*/nullptr); data_decoder::XmlParser xml_parser_impl;
data_decoder::mojom::XmlParser& xml_parser = xml_parser_impl; data_decoder::mojom::XmlParser& xml_parser = xml_parser_impl;
base::SingleThreadTaskExecutor main_thread_task_executor; base::SingleThreadTaskExecutor main_thread_task_executor;
......
...@@ -28,7 +28,7 @@ void TestParseXmlCallback(std::unique_ptr<base::Value>* value_out, ...@@ -28,7 +28,7 @@ void TestParseXmlCallback(std::unique_ptr<base::Value>* value_out,
// Parses the passed in |xml| and compares the result to |json|. // Parses the passed in |xml| and compares the result to |json|.
// If |json| is empty, the parsing is expected to fail. // If |json| is empty, the parsing is expected to fail.
void TestParseXml(const std::string& xml, const std::string& json) { void TestParseXml(const std::string& xml, const std::string& json) {
XmlParser parser_impl(/*service_ref=*/nullptr); XmlParser parser_impl;
// Use a reference to mojom::XmlParser as XmlParser implements the interface // Use a reference to mojom::XmlParser as XmlParser implements the interface
// privately. // privately.
mojom::XmlParser& parser = parser_impl; mojom::XmlParser& parser = parser_impl;
......
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