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

Unified Diff: android_webview/browser/browser_view_renderer.h

Issue 1911433002: Refactor BrowserViewRenderer-RenderThreadManager relationship. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address most comments Created 4 years, 8 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
Index: android_webview/browser/browser_view_renderer.h
diff --git a/android_webview/browser/browser_view_renderer.h b/android_webview/browser/browser_view_renderer.h
index fe6cad755461a1250e31005953a80d5e0e11adab..69049978bb14aa2f12ae54e806967baac3df4a6e 100644
--- a/android_webview/browser/browser_view_renderer.h
+++ b/android_webview/browser/browser_view_renderer.h
@@ -9,8 +9,8 @@
#include <map>
+#include "android_webview/browser/compositor_frame_producer.h"
#include "android_webview/browser/parent_compositor_draw_constraints.h"
-#include "android_webview/browser/render_thread_manager.h"
#include "base/callback.h"
#include "base/cancelable_callback.h"
#include "base/macros.h"
@@ -33,10 +33,12 @@ namespace android_webview {
class BrowserViewRendererClient;
class ChildFrame;
+class CompositorFrameConsumer;
// Interface for all the WebView-specific content rendering operations.
// Provides software and hardware rendering and the Capture Picture API.
-class BrowserViewRenderer : public content::SynchronousCompositorClient {
+class BrowserViewRenderer : public content::SynchronousCompositorClient,
+ public CompositorFrameProducer {
public:
static void CalculateTileMemoryPolicy();
static BrowserViewRenderer* FromWebContents(
@@ -52,8 +54,9 @@ class BrowserViewRenderer : public content::SynchronousCompositorClient {
void RegisterWithWebContents(content::WebContents* web_contents);
// The BrowserViewRenderer client is responsible for ensuring that the
- // RenderThreadManager has been set correctly via this method.
- void SetRenderThreadManager(RenderThreadManager* render_thread_manager);
+ // CompositorFrameConsumer has been set correctly via this method.
+ void SetCompositorFrameConsumer(
+ CompositorFrameConsumer* compositor_frame_consumer);
// Called before either OnDrawHardware or OnDrawSoftware to set the view
// state of this frame. |scroll| is the view's current scroll offset.
@@ -121,8 +124,9 @@ class BrowserViewRenderer : public content::SynchronousCompositorClient {
const gfx::Vector2dF& latest_overscroll_delta,
const gfx::Vector2dF& current_fling_velocity) override;
- void OnParentDrawConstraintsUpdated();
- void DetachFunctorFromView();
+ // CompositorFrameProducer overrides
+ void OnParentDrawConstraintsUpdated() override;
+ void OnCompositorFrameConsumerWillDestroy() override;
private:
void SetTotalRootLayerScrollOffset(const gfx::Vector2dF& new_value_dip);
@@ -134,7 +138,8 @@ class BrowserViewRenderer : public content::SynchronousCompositorClient {
const gfx::SizeF& scrollable_size_dip);
void ReturnUnusedResource(std::unique_ptr<ChildFrame> frame);
- void ReturnResourceFromParent();
+ void ReturnResourceFromParent(
+ CompositorFrameConsumer* compositor_frame_consumer);
void ReleaseHardware();
gfx::Vector2d max_scroll_offset() const;
@@ -148,7 +153,7 @@ class BrowserViewRenderer : public content::SynchronousCompositorClient {
BrowserViewRendererClient* const client_;
const scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
- RenderThreadManager* render_thread_manager_;
+ CompositorFrameConsumer* compositor_frame_consumer_;
bool disable_page_visibility_;
// The current compositor that's owned by the current RVH.
« no previous file with comments | « no previous file | android_webview/browser/browser_view_renderer.cc » ('j') | android_webview/browser/browser_view_renderer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698