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

Unified Diff: android_webview/browser/shared_renderer_state.h

Issue 1858853002: Rename SharedRendererState to RenderThreadManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix rebase 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/shared_renderer_state.h
diff --git a/android_webview/browser/shared_renderer_state.h b/android_webview/browser/shared_renderer_state.h
deleted file mode 100644
index b7eccc42e429e16171364260151765a4cc8e4d7e..0000000000000000000000000000000000000000
--- a/android_webview/browser/shared_renderer_state.h
+++ /dev/null
@@ -1,125 +0,0 @@
-// Copyright 2014 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 ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_
-#define ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_
-
-#include <map>
-
-#include "android_webview/browser/gl_view_renderer_manager.h"
-#include "android_webview/browser/parent_compositor_draw_constraints.h"
-#include "base/cancelable_callback.h"
-#include "base/macros.h"
-#include "base/memory/weak_ptr.h"
-#include "base/single_thread_task_runner.h"
-#include "base/synchronization/lock.h"
-#include "cc/output/compositor_frame_ack.h"
-#include "ui/gfx/geometry/rect.h"
-#include "ui/gfx/geometry/vector2d.h"
-
-struct AwDrawGLInfo;
-namespace android_webview {
-
-namespace internal {
-class RequestDrawGLTracker;
-}
-
-class SharedRendererStateClient;
-class ChildFrame;
-class HardwareRenderer;
-class InsideHardwareReleaseReset;
-
-// This class is used to pass data between UI thread and RenderThread.
-class SharedRendererState {
- public:
- struct ReturnedResources {
- ReturnedResources();
- ~ReturnedResources();
-
- uint32_t output_surface_id;
- cc::ReturnedResourceArray resources;
- };
- using ReturnedResourcesMap = std::map<uint32_t, ReturnedResources>;
-
- SharedRendererState(
- SharedRendererStateClient* client,
- const scoped_refptr<base::SingleThreadTaskRunner>& ui_loop);
- ~SharedRendererState();
-
- // This function can be called from any thread.
- void ClientRequestDrawGL(bool for_idle);
-
- // UI thread methods.
- void SetScrollOffsetOnUI(gfx::Vector2d scroll_offset);
- void SetFrameOnUI(std::unique_ptr<ChildFrame> frame);
- void InitializeHardwareDrawIfNeededOnUI();
- ParentCompositorDrawConstraints GetParentDrawConstraintsOnUI() const;
- void SwapReturnedResourcesOnUI(ReturnedResourcesMap* returned_resource_map);
- bool ReturnedResourcesEmptyOnUI() const;
- std::unique_ptr<ChildFrame> PassUncommittedFrameOnUI();
- bool HasFrameOnUI() const;
- void DeleteHardwareRendererOnUI();
-
- // RT thread methods.
- gfx::Vector2d GetScrollOffsetOnRT();
- std::unique_ptr<ChildFrame> PassFrameOnRT();
- void DrawGL(AwDrawGLInfo* draw_info);
- void PostExternalDrawConstraintsToChildCompositorOnRT(
- const ParentCompositorDrawConstraints& parent_draw_constraints);
- void InsertReturnedResourcesOnRT(const cc::ReturnedResourceArray& resources,
- uint32_t compositor_id,
- uint32_t output_surface_id);
-
- private:
- friend class internal::RequestDrawGLTracker;
- class InsideHardwareReleaseReset {
- public:
- explicit InsideHardwareReleaseReset(
- SharedRendererState* shared_renderer_state);
- ~InsideHardwareReleaseReset();
-
- private:
- SharedRendererState* shared_renderer_state_;
- };
-
- // RT thread method.
- void DidDrawGLProcess();
-
- // UI thread methods.
- void ResetRequestDrawGLCallback();
- void ClientRequestDrawGLOnUI();
- void UpdateParentDrawConstraintsOnUI();
- bool IsInsideHardwareRelease() const;
- void SetInsideHardwareRelease(bool inside);
-
- // Accessed by UI thread.
- scoped_refptr<base::SingleThreadTaskRunner> ui_loop_;
- SharedRendererStateClient* const client_;
- base::WeakPtr<SharedRendererState> ui_thread_weak_ptr_;
- base::CancelableClosure request_draw_gl_cancelable_closure_;
-
- // Accessed by RT thread.
- std::unique_ptr<HardwareRenderer> hardware_renderer_;
-
- // This is accessed by both UI and RT now. TODO(hush): move to RT only.
- GLViewRendererManager::Key renderer_manager_key_;
-
- // Accessed by both UI and RT thread.
- mutable base::Lock lock_;
- bool hardware_renderer_has_frame_;
- gfx::Vector2d scroll_offset_;
- std::unique_ptr<ChildFrame> child_frame_;
- bool inside_hardware_release_;
- ParentCompositorDrawConstraints parent_draw_constraints_;
- ReturnedResourcesMap returned_resources_map_;
- base::Closure request_draw_gl_closure_;
-
- base::WeakPtrFactory<SharedRendererState> weak_factory_on_ui_thread_;
-
- DISALLOW_COPY_AND_ASSIGN(SharedRendererState);
-};
-
-} // namespace android_webview
-
-#endif // ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_
« no previous file with comments | « android_webview/browser/render_thread_manager_client.h ('k') | android_webview/browser/shared_renderer_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698