0

[jumbo] Resolve symbol clashes in content/shell

Rename two TestServiceImpl to not clash in jumbo build experiments,
and change a kIllegalString constant to be shared.

Bug: 886902
Change-Id: I513e0641834476bb198cf24d71ef088634458313
Reviewed-on: https://chromium-review.googlesource.com/1233709
Reviewed-by: Peter Beverloo <peter@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#593125}
This commit is contained in:
Daniel Bratell
2018-09-21 08:50:40 +00:00
committed by Commit Bot
parent 90815d42b4
commit 74789b0b5e
5 changed files with 18 additions and 15 deletions

@ -44,15 +44,15 @@ namespace content {
namespace {
// A test service which can be driven by browser tests for various reasons.
class TestServiceImpl : public mojom::TestService {
class TestRendererServiceImpl : public mojom::TestService {
public:
explicit TestServiceImpl(mojom::TestServiceRequest request)
explicit TestRendererServiceImpl(mojom::TestServiceRequest request)
: binding_(this, std::move(request)) {
binding_.set_connection_error_handler(base::BindOnce(
&TestServiceImpl::OnConnectionError, base::Unretained(this)));
&TestRendererServiceImpl::OnConnectionError, base::Unretained(this)));
}
~TestServiceImpl() override {}
~TestRendererServiceImpl() override {}
private:
void OnConnectionError() { delete this; }
@ -93,12 +93,12 @@ class TestServiceImpl : public mojom::TestService {
mojo::Binding<mojom::TestService> binding_;
DISALLOW_COPY_AND_ASSIGN(TestServiceImpl);
DISALLOW_COPY_AND_ASSIGN(TestRendererServiceImpl);
};
void CreateTestService(mojom::TestServiceRequest request) {
void CreateRendererTestService(mojom::TestServiceRequest request) {
// Owns itself.
new TestServiceImpl(std::move(request));
new TestRendererServiceImpl(std::move(request));
}
} // namespace
@ -113,7 +113,8 @@ void ShellContentRendererClient::RenderThreadStarted() {
auto registry = std::make_unique<service_manager::BinderRegistry>();
registry->AddInterface<mojom::TestService>(
base::Bind(&CreateTestService), base::ThreadTaskRunnerHandle::Get());
base::Bind(&CreateRendererTestService),
base::ThreadTaskRunnerHandle::Get());
registry->AddInterface<mojom::PowerMonitorTest>(
base::Bind(&PowerMonitorTestImpl::MakeStrongBinding,
base::Passed(std::make_unique<PowerMonitorTestImpl>())),

@ -24,7 +24,6 @@ const char file_test_prefix[] = "(file test):";
const char data_url_pattern[] = "data:";
const std::string::size_type data_url_pattern_size =
sizeof(data_url_pattern) - 1;
const char* kIllegalString = "illegal value";
const char* kPolicyIgnore = "Ignore";
const char* kPolicyDownload = "download";
const char* kPolicyCurrentTab = "current tab";
@ -35,6 +34,8 @@ const char* kPolicyNewPopup = "new popup";
} // namespace
const char* kIllegalString = "illegal value";
std::string NormalizeLayoutTestURL(const std::string& url) {
std::string result = url;
size_t pos;

@ -17,6 +17,8 @@ class GURL;
namespace test_runner {
extern const char* kIllegalString;
inline bool IsASCIIAlpha(char ch) {
return base::IsAsciiLower(ch | 0x20);
}

@ -144,7 +144,6 @@ const char* kBackForwardString = "back/forward";
const char* kReloadString = "reload";
const char* kFormResubmittedString = "form resubmitted";
const char* kOtherString = "other";
const char* kIllegalString = "illegal value";
// Get a debugging string from a WebNavigationType.
const char* WebNavigationTypeToString(blink::WebNavigationType type) {

@ -35,10 +35,10 @@ namespace content {
namespace {
class TestServiceImpl : public mojom::TestService {
class TestUtilityServiceImpl : public mojom::TestService {
public:
static void Create(mojom::TestServiceRequest request) {
mojo::MakeStrongBinding(base::WrapUnique(new TestServiceImpl),
mojo::MakeStrongBinding(base::WrapUnique(new TestUtilityServiceImpl),
std::move(request));
}
@ -80,9 +80,9 @@ class TestServiceImpl : public mojom::TestService {
}
private:
explicit TestServiceImpl() {}
explicit TestUtilityServiceImpl() {}
DISALLOW_COPY_AND_ASSIGN(TestServiceImpl);
DISALLOW_COPY_AND_ASSIGN(TestUtilityServiceImpl);
};
std::unique_ptr<service_manager::Service> CreateTestService() {
@ -105,7 +105,7 @@ ShellContentUtilityClient::~ShellContentUtilityClient() {
void ShellContentUtilityClient::UtilityThreadStarted() {
auto registry = std::make_unique<service_manager::BinderRegistry>();
registry->AddInterface(base::BindRepeating(&TestServiceImpl::Create),
registry->AddInterface(base::BindRepeating(&TestUtilityServiceImpl::Create),
base::ThreadTaskRunnerHandle::Get());
registry->AddInterface<mojom::PowerMonitorTest>(
base::BindRepeating(