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

Unified Diff: blimp/client/session/render_widget_feature.h

Issue 1636163002: Restructure contents of blimp/client. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/client/session/navigation_feature_unittest.cc ('k') | blimp/client/session/render_widget_feature.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/client/session/render_widget_feature.h
diff --git a/blimp/client/session/render_widget_feature.h b/blimp/client/session/render_widget_feature.h
deleted file mode 100644
index 2982acc0cd2e4730bca6b41cd35dde8ce9d404ae..0000000000000000000000000000000000000000
--- a/blimp/client/session/render_widget_feature.h
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef BLIMP_CLIENT_SESSION_RENDER_WIDGET_FEATURE_H_
-#define BLIMP_CLIENT_SESSION_RENDER_WIDGET_FEATURE_H_
-
-#include <stdint.h>
-
-#include "base/containers/small_map.h"
-#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
-#include "blimp/client/blimp_client_export.h"
-#include "blimp/net/blimp_message_processor.h"
-#include "blimp/net/input_message_generator.h"
-
-namespace blink {
-class WebInputEvent;
-}
-
-namespace cc {
-namespace proto {
-class CompositorMessage;
-}
-}
-
-namespace blimp {
-namespace client {
-
-// Handles all incoming and outgoing protobuf message types tied to a specific
-// RenderWidget. This includes BlimpMessage::INPUT, BlimpMessage::COMPOSITOR,
-// and BlimpMessage::RENDER_WIDGET messages. Delegates can be added to be
-// notified of incoming messages. This class automatically attaches a specific
-// id so that the engine can drop stale RenderWidget related messages after it
-// sends a RenderWidgetMessage::INITIALIZE message.
-class BLIMP_CLIENT_EXPORT RenderWidgetFeature : public BlimpMessageProcessor {
- public:
- // A delegate to be notified of specific RenderWidget related incoming events.
- class RenderWidgetFeatureDelegate {
- public:
- // Called when the engine's RenderWidget has changed for a particular
- // WebContents. When this is received all state related to the existing
- // client RenderWidget should be reset.
- virtual void OnRenderWidgetInitialized() = 0;
-
- // Called when the engine sent a CompositorMessage. These messages should
- // be sent to the client's RemoteChannel of the compositor.
- virtual void OnCompositorMessageReceived(
- scoped_ptr<cc::proto::CompositorMessage> message) = 0;
- };
-
- RenderWidgetFeature();
- ~RenderWidgetFeature() override;
-
- // Set the BlimpMessageProcessor that will be used to send BlimpMessage::INPUT
- // messages to the engine.
- void set_outgoing_input_message_processor(
- scoped_ptr<BlimpMessageProcessor> processor);
-
- // Set the BlimpMessageProcessor that will be used to send
- // BlimpMessage::COMPOSITOR messages to the engine.
- void set_outgoing_compositor_message_processor(
- scoped_ptr<BlimpMessageProcessor> processor);
-
- // Sends a WebInputEvent for |tab_id| to the engine.
- void SendInputEvent(const int tab_id, const blink::WebInputEvent& event);
-
- // Sends a CompositorMessage for |tab_id| to the engine.
- void SendCompositorMessage(const int tab_id,
- const cc::proto::CompositorMessage& message);
-
- // Sets a RenderWidgetMessageDelegate to be notified of all incoming
- // RenderWidget related messages for |tab_id| from the engine. There can only
- // be one RenderWidgetMessageDelegate per tab.
- void SetDelegate(const int tab_id, RenderWidgetFeatureDelegate* delegate);
- void RemoveDelegate(const int tab_id);
-
- private:
- // BlimpMessageProcessor implementation.
- void ProcessMessage(scoped_ptr<BlimpMessage> message,
- const net::CompletionCallback& callback) override;
-
- // Returns nullptr if no delegate is found.
- RenderWidgetFeatureDelegate* FindDelegate(const int tab_id);
-
- // Returns 0 if no id is found.
- uint32_t GetRenderWidgetId(const int tab_id);
-
- typedef base::SmallMap<std::map<int, RenderWidgetFeatureDelegate*>>
- DelegateMap;
- typedef base::SmallMap<std::map<int, uint32_t>> RenderWidgetIdMap;
-
- DelegateMap delegates_;
- RenderWidgetIdMap render_widget_ids_;
-
- InputMessageGenerator input_message_generator_;
-
- // Used to send BlimpMessage::INPUT type messages to the engine.
- scoped_ptr<BlimpMessageProcessor> outgoing_input_message_processor_;
-
- // Used to send BlimpMessage::COMPOSITOR messages to the engine.
- scoped_ptr<BlimpMessageProcessor> outgoing_compositor_message_processor_;
-
- DISALLOW_COPY_AND_ASSIGN(RenderWidgetFeature);
-};
-
-} // namespace client
-} // namespace blimp
-
-#endif // BLIMP_CLIENT_SESSION_RENDER_WIDGET_FEATURE_H_
« no previous file with comments | « blimp/client/session/navigation_feature_unittest.cc ('k') | blimp/client/session/render_widget_feature.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698