Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef BLIMP_CLIENT_CORE_RENDER_WIDGET_BLIMP_DOCUMENT_H_ | |
| 6 #define BLIMP_CLIENT_CORE_RENDER_WIDGET_BLIMP_DOCUMENT_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "base/memory/ptr_util.h" | |
| 12 #include "blimp/client/core/compositor/blimp_compositor.h" | |
| 13 | |
| 14 namespace blimp { | |
| 15 namespace client { | |
| 16 | |
| 17 class BlimpCompositorDependencies; | |
| 18 class BlimpDocumentManager; | |
| 19 | |
| 20 // BlimpDocument maps to an engine side render widget. | |
| 21 // 1. Is created on receiving an RenderWidgetMessage from the engine. | |
| 22 // 2. Owns the BlimpCompositor instance. | |
| 23 class BlimpDocument : public BlimpCompositorClient { | |
| 24 public: | |
| 25 BlimpDocument(int render_widget_id, | |
| 26 BlimpCompositorDependencies* compositor_dependencies, | |
| 27 BlimpDocumentManager* document_manager); | |
| 28 ~BlimpDocument() override; | |
| 29 | |
| 30 int render_widget_id() const { return render_widget_id_; } | |
| 31 | |
| 32 // Returns the compositor instance. | |
| 33 BlimpCompositor* GetCompositor(); | |
| 34 | |
| 35 protected: | |
| 36 void SetCompositorForTest(std::unique_ptr<BlimpCompositor> compositor); | |
| 37 | |
| 38 private: | |
| 39 // BlimpCompositorClient implementation. | |
| 40 void SendWebGestureEvent( | |
| 41 const blink::WebGestureEvent& gesture_event) override; | |
| 42 void SendCompositorMessage( | |
| 43 const cc::proto::CompositorMessage& message) override; | |
| 44 | |
| 45 // The unique identifier for this document instance. | |
| 46 const int render_widget_id_; | |
|
Khushal
2016/10/03 20:04:59
Should we rename this to document id in that case?
xingliu
2016/10/04 18:33:49
Rename most of it, except the functions parameters
Khushal
2016/10/04 18:49:54
Sounds good. The RenderWidgetFeature should die on
| |
| 47 | |
| 48 // The compositor instance. | |
| 49 std::unique_ptr<BlimpCompositor> compositor_; | |
| 50 | |
| 51 // The BlimpDocumentManager that manages a list of BlimpDocuments, and holds | |
| 52 // a network message processor. | |
| 53 BlimpDocumentManager* manager_; | |
|
Khushal
2016/10/03 20:04:59
You can just comment about why this is here, used
xingliu
2016/10/04 18:33:49
Done.
| |
| 54 | |
| 55 DISALLOW_COPY_AND_ASSIGN(BlimpDocument); | |
| 56 }; | |
| 57 | |
| 58 } // namespace client | |
| 59 } // namespace blimp | |
| 60 | |
| 61 #endif // BLIMP_CLIENT_CORE_RENDER_WIDGET_BLIMP_DOCUMENT_H_ | |
| OLD | NEW |