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

Unified Diff: blimp/net/blimp_message_demultiplexer.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/blimp_message_demultiplexer.h ('k') | blimp/net/blimp_message_demultiplexer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/net/blimp_message_demultiplexer.cc
diff --git a/blimp/net/blimp_message_demultiplexer.cc b/blimp/net/blimp_message_demultiplexer.cc
index ab67c84fe3b1f39c496c304c4dcd8f7f10b92477..b6a86ce4e6b623d087b0e566074886c3976ba6c7 100644
--- a/blimp/net/blimp_message_demultiplexer.cc
+++ b/blimp/net/blimp_message_demultiplexer.cc
@@ -17,13 +17,15 @@ BlimpMessageDemultiplexer::BlimpMessageDemultiplexer() {}
BlimpMessageDemultiplexer::~BlimpMessageDemultiplexer() {}
-void BlimpMessageDemultiplexer::AddProcessor(BlimpMessage::Type type,
- BlimpMessageProcessor* receiver) {
+void BlimpMessageDemultiplexer::AddProcessor(
+ BlimpMessage::FeatureCase feature_case,
+ BlimpMessageProcessor* receiver) {
DCHECK(receiver);
- if (feature_receiver_map_.find(type) == feature_receiver_map_.end()) {
- feature_receiver_map_.insert(std::make_pair(type, receiver));
+ if (feature_receiver_map_.find(feature_case) == feature_receiver_map_.end()) {
+ feature_receiver_map_.insert(std::make_pair(feature_case, receiver));
} else {
- DLOG(FATAL) << "Handler already registered for type=" << type << ".";
+ DLOG(FATAL) << "Handler already registered for feature=" << feature_case
+ << ".";
}
}
@@ -31,7 +33,7 @@ void BlimpMessageDemultiplexer::ProcessMessage(
std::unique_ptr<BlimpMessage> message,
const net::CompletionCallback& callback) {
DVLOG(2) << "ProcessMessage : " << *message;
- auto receiver_iter = feature_receiver_map_.find(message->type());
+ auto receiver_iter = feature_receiver_map_.find(message->feature_case());
if (receiver_iter == feature_receiver_map_.end()) {
DLOG(ERROR) << "No registered receiver for " << *message << ".";
if (!callback.is_null()) {
« no previous file with comments | « blimp/net/blimp_message_demultiplexer.h ('k') | blimp/net/blimp_message_demultiplexer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698