Commit 8620d3bf authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Avoid importing the symbol name "Result"

There are many types in Chromium named Result. When importing
that name into the global (or content) namespace with a
using statement, you run the risk of clashing with another
Result type. That happened in jumbo builds where more code
is compiled per translation unit.

This patch uses the fully qualified name instead of just
Result instead.

Bug: 746953
Change-Id: I5ccfb5e6b70712372a764c89b40a2a9340cc33fb
Reviewed-on: https://chromium-review.googlesource.com/822335
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: default avatarTakashi Toyoshima <toyoshim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523722}
parent 0cebd109
......@@ -18,7 +18,6 @@
using base::AutoLock;
using blink::WebString;
using midi::mojom::PortState;
using midi::mojom::Result;
// The maximum number of bytes which we're allowed to send to the browser
// before getting acknowledgement back from the browser that they've been
......@@ -32,7 +31,7 @@ MidiMessageFilter::MidiMessageFilter(
: sender_(nullptr),
io_task_runner_(io_task_runner),
main_task_runner_(base::ThreadTaskRunnerHandle::Get()),
session_result_(Result::NOT_INITIALIZED),
session_result_(midi::mojom::Result::NOT_INITIALIZED),
unacknowledged_bytes_sent_(0u) {}
MidiMessageFilter::~MidiMessageFilter() {}
......@@ -41,7 +40,7 @@ void MidiMessageFilter::AddClient(blink::WebMIDIAccessorClient* client) {
DCHECK(main_task_runner_->BelongsToCurrentThread());
TRACE_EVENT0("midi", "MidiMessageFilter::AddClient");
clients_waiting_session_queue_.push_back(client);
if (session_result_ != Result::NOT_INITIALIZED) {
if (session_result_ != midi::mojom::Result::NOT_INITIALIZED) {
HandleClientAdded(session_result_);
} else if (clients_waiting_session_queue_.size() == 1u) {
io_task_runner_->PostTask(
......@@ -64,7 +63,7 @@ void MidiMessageFilter::RemoveClient(blink::WebMIDIAccessorClient* client) {
if (it != clients_waiting_session_queue_.end())
clients_waiting_session_queue_.erase(it);
if (clients_.empty() && clients_waiting_session_queue_.empty()) {
session_result_ = Result::NOT_INITIALIZED;
session_result_ = midi::mojom::Result::NOT_INITIALIZED;
inputs_.clear();
outputs_.clear();
io_task_runner_->PostTask(
......@@ -151,7 +150,7 @@ void MidiMessageFilter::OnChannelClosing() {
sender_ = nullptr;
}
void MidiMessageFilter::OnSessionStarted(Result result) {
void MidiMessageFilter::OnSessionStarted(midi::mojom::Result result) {
TRACE_EVENT0("midi", "MidiMessageFilter::OnSessionStarted");
DCHECK(io_task_runner_->BelongsToCurrentThread());
// Handle on the main JS thread.
......@@ -206,7 +205,7 @@ void MidiMessageFilter::OnAcknowledgeSentData(size_t bytes_sent) {
this, bytes_sent));
}
void MidiMessageFilter::HandleClientAdded(Result result) {
void MidiMessageFilter::HandleClientAdded(midi::mojom::Result result) {
TRACE_EVENT0("midi", "MidiMessageFilter::HandleClientAdded");
DCHECK(main_task_runner_->BelongsToCurrentThread());
session_result_ = result;
......@@ -216,7 +215,7 @@ void MidiMessageFilter::HandleClientAdded(Result result) {
while (!clients_waiting_session_queue_.empty()) {
auto* client = clients_waiting_session_queue_.back();
clients_waiting_session_queue_.pop_back();
if (result == Result::OK) {
if (result == midi::mojom::Result::OK) {
// Add the client's input and output ports.
for (const auto& info : inputs_) {
client->DidAddInputPort(WebString::FromUTF8(info.id),
......
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