Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3143)

Unified Diff: blimp/net/thread_pipe_manager.cc

Issue 1933053003: Used oneof in blimp_message.proto (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « blimp/net/thread_pipe_manager.h ('k') | blimp/net/thread_pipe_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/net/thread_pipe_manager.cc
diff --git a/blimp/net/thread_pipe_manager.cc b/blimp/net/thread_pipe_manager.cc
index 1363e093b9794796f2fac477080d1b66f4a890c6..ca358c390542fe491b0bac20da33a5a6db03647e 100644
--- a/blimp/net/thread_pipe_manager.cc
+++ b/blimp/net/thread_pipe_manager.cc
@@ -24,7 +24,7 @@ class IoThreadPipeManager {
// Connects message pipes between the specified feature and the network layer,
// using |incoming_proxy| as the incoming message processor, and connecting
// |outgoing_pipe| to the actual message sender.
- void RegisterFeature(BlimpMessage::Type type,
+ void RegisterFeature(BlimpMessage::FeatureCase feature_case,
std::unique_ptr<BlimpMessageThreadPipe> outgoing_pipe,
std::unique_ptr<BlimpMessageProcessor> incoming_proxy);
@@ -54,14 +54,14 @@ IoThreadPipeManager::IoThreadPipeManager(
IoThreadPipeManager::~IoThreadPipeManager() {}
void IoThreadPipeManager::RegisterFeature(
- BlimpMessage::Type type,
+ BlimpMessage::FeatureCase feature_case,
std::unique_ptr<BlimpMessageThreadPipe> outgoing_pipe,
std::unique_ptr<BlimpMessageProcessor> incoming_proxy) {
// Registers |incoming_proxy| as the message processor for incoming
- // messages with |type|. Sets the returned outgoing message processor as the
- // target of the |outgoing_pipe|.
+ // messages with |feature_case|. Sets the returned outgoing message processor
+ // as the target of the |outgoing_pipe|.
std::unique_ptr<BlimpMessageProcessor> outgoing_message_processor =
- connection_handler_->RegisterFeature(type, incoming_proxy.get());
+ connection_handler_->RegisterFeature(feature_case, incoming_proxy.get());
outgoing_pipe->set_target_processor(outgoing_message_processor.get());
// This object manages the lifetimes of the pipe, proxy and target processor.
@@ -83,7 +83,7 @@ ThreadPipeManager::~ThreadPipeManager() {
}
std::unique_ptr<BlimpMessageProcessor> ThreadPipeManager::RegisterFeature(
- BlimpMessage::Type type,
+ BlimpMessage::FeatureCase feature_case,
BlimpMessageProcessor* incoming_processor) {
// Creates an outgoing pipe and a proxy for forwarding messages
// from features on the UI thread to network components on the IO thread.
@@ -102,10 +102,11 @@ std::unique_ptr<BlimpMessageProcessor> ThreadPipeManager::RegisterFeature(
// Finishes registration on IO thread.
io_task_runner_->PostTask(
- FROM_HERE, base::Bind(&IoThreadPipeManager::RegisterFeature,
- base::Unretained(io_pipe_manager_.get()), type,
- base::Passed(std::move(outgoing_pipe)),
- base::Passed(std::move(incoming_proxy))));
+ FROM_HERE,
+ base::Bind(&IoThreadPipeManager::RegisterFeature,
+ base::Unretained(io_pipe_manager_.get()), feature_case,
+ base::Passed(std::move(outgoing_pipe)),
+ base::Passed(std::move(incoming_proxy))));
incoming_pipes_.push_back(std::move(incoming_pipe));
return outgoing_proxy;
« no previous file with comments | « blimp/net/thread_pipe_manager.h ('k') | blimp/net/thread_pipe_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698