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

Unified Diff: blimp/client/core/render_widget/blimp_document.h

Issue 2382733007: Add BlimpDocument, pull out functions in BlimpCompositor. (Closed)
Patch Set: Remove Webkit DEPS modification. Created 4 years, 2 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/core/render_widget/BUILD.gn ('k') | blimp/client/core/render_widget/blimp_document.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/client/core/render_widget/blimp_document.h
diff --git a/blimp/client/core/render_widget/blimp_document.h b/blimp/client/core/render_widget/blimp_document.h
new file mode 100644
index 0000000000000000000000000000000000000000..d03b7d172f465306efc419cea45658890903ab8b
--- /dev/null
+++ b/blimp/client/core/render_widget/blimp_document.h
@@ -0,0 +1,60 @@
+// Copyright 2016 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_CORE_RENDER_WIDGET_BLIMP_DOCUMENT_H_
+#define BLIMP_CLIENT_CORE_RENDER_WIDGET_BLIMP_DOCUMENT_H_
+
+#include <memory>
+
+#include "base/macros.h"
+#include "base/memory/ptr_util.h"
+#include "blimp/client/core/compositor/blimp_compositor.h"
+
+namespace blimp {
+namespace client {
+
+class BlimpCompositorDependencies;
+class BlimpDocumentManager;
+
+// BlimpDocument maps to an engine side render widget.
+// 1. Is created on receiving an RenderWidgetMessage from the engine.
+// 2. Owns the BlimpCompositor instance.
+class BlimpDocument : public BlimpCompositorClient {
+ public:
+ BlimpDocument(int document_id,
+ BlimpCompositorDependencies* compositor_dependencies,
+ BlimpDocumentManager* document_manager);
+ ~BlimpDocument() override;
+
+ int document_id() const { return document_id_; }
+
+ // Returns the compositor instance.
+ BlimpCompositor* GetCompositor();
+
+ protected:
+ void SetCompositorForTest(std::unique_ptr<BlimpCompositor> compositor);
+
+ private:
+ // BlimpCompositorClient implementation.
+ void SendWebGestureEvent(
+ const blink::WebGestureEvent& gesture_event) override;
+ void SendCompositorMessage(
+ const cc::proto::CompositorMessage& message) override;
+
+ // The unique identifier for this document instance.
+ const int document_id_;
+
+ // The compositor instance.
+ std::unique_ptr<BlimpCompositor> compositor_;
+
+ // Used to send messages to the corresponding render widget on the engine.
+ BlimpDocumentManager* manager_;
+
+ DISALLOW_COPY_AND_ASSIGN(BlimpDocument);
+};
+
+} // namespace client
+} // namespace blimp
+
+#endif // BLIMP_CLIENT_CORE_RENDER_WIDGET_BLIMP_DOCUMENT_H_
« no previous file with comments | « blimp/client/core/render_widget/BUILD.gn ('k') | blimp/client/core/render_widget/blimp_document.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698