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

Unified Diff: blimp/engine/session/blimp_engine_session.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/engine/feature/engine_settings_feature.cc ('k') | blimp/net/blimp_connection_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/engine/session/blimp_engine_session.cc
diff --git a/blimp/engine/session/blimp_engine_session.cc b/blimp/engine/session/blimp_engine_session.cc
index 037f3e809d30393841b0a99c16204d2f07593f35..71bebfed6acf85f59642e05f498425d6363a5f48 100644
--- a/blimp/engine/session/blimp_engine_session.cc
+++ b/blimp/engine/session/blimp_engine_session.cc
@@ -293,25 +293,25 @@ void BlimpEngineSession::RegisterFeatures() {
// Register features' message senders and receivers.
tab_control_message_sender_ =
- thread_pipe_manager_->RegisterFeature(BlimpMessage::TAB_CONTROL, this);
+ thread_pipe_manager_->RegisterFeature(BlimpMessage::kTabControl, this);
navigation_message_sender_ =
- thread_pipe_manager_->RegisterFeature(BlimpMessage::NAVIGATION, this);
+ thread_pipe_manager_->RegisterFeature(BlimpMessage::kNavigation, this);
render_widget_feature_.set_render_widget_message_sender(
- thread_pipe_manager_->RegisterFeature(BlimpMessage::RENDER_WIDGET,
+ thread_pipe_manager_->RegisterFeature(BlimpMessage::kRenderWidget,
&render_widget_feature_));
render_widget_feature_.set_input_message_sender(
- thread_pipe_manager_->RegisterFeature(BlimpMessage::INPUT,
+ thread_pipe_manager_->RegisterFeature(BlimpMessage::kInput,
&render_widget_feature_));
render_widget_feature_.set_compositor_message_sender(
- thread_pipe_manager_->RegisterFeature(BlimpMessage::COMPOSITOR,
+ thread_pipe_manager_->RegisterFeature(BlimpMessage::kCompositor,
&render_widget_feature_));
render_widget_feature_.set_ime_message_sender(
- thread_pipe_manager_->RegisterFeature(BlimpMessage::IME,
+ thread_pipe_manager_->RegisterFeature(BlimpMessage::kIme,
&render_widget_feature_));
// The Settings feature does not need an outgoing message processor, since we
// don't send any messages to the client right now.
- thread_pipe_manager_->RegisterFeature(BlimpMessage::SETTINGS,
+ thread_pipe_manager_->RegisterFeature(BlimpMessage::kSettings,
&settings_feature_);
}
@@ -454,19 +454,19 @@ void BlimpEngineSession::ProcessMessage(
TRACE_EVENT1("blimp", "BlimpEngineSession::ProcessMessage", "TabId",
message->target_tab_id());
DCHECK(!callback.is_null());
- DCHECK(message->type() == BlimpMessage::TAB_CONTROL ||
- message->type() == BlimpMessage::NAVIGATION);
+ DCHECK(BlimpMessage::kTabControl == message->feature_case() ||
+ BlimpMessage::kNavigation == message->feature_case());
net::Error result = net::OK;
- if (message->type() == BlimpMessage::TAB_CONTROL) {
- switch (message->tab_control().type()) {
- case TabControlMessage::CREATE_TAB:
+ if (message->has_tab_control()) {
+ switch (message->tab_control().tab_control_case()) {
+ case TabControlMessage::kCreateTab:
if (!CreateWebContents(message->target_tab_id()))
result = net::ERR_FAILED;
break;
- case TabControlMessage::CLOSE_TAB:
+ case TabControlMessage::kCloseTab:
CloseWebContents(message->target_tab_id());
- case TabControlMessage::SIZE:
+ case TabControlMessage::kSize:
HandleResize(message->tab_control().size().device_pixel_ratio(),
gfx::Size(message->tab_control().size().width(),
message->tab_control().size().height()));
@@ -475,7 +475,7 @@ void BlimpEngineSession::ProcessMessage(
NOTIMPLEMENTED();
result = net::ERR_NOT_IMPLEMENTED;
}
- } else if (message->type() == BlimpMessage::NAVIGATION && web_contents_) {
+ } else if (message->has_navigation() && web_contents_) {
switch (message->navigation().type()) {
case NavigationMessage::LOAD_URL:
LoadUrl(message->target_tab_id(),
« no previous file with comments | « blimp/engine/feature/engine_settings_feature.cc ('k') | blimp/net/blimp_connection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698