From 1121fda40a4aececf67f0a3c852cb11e53fe50c8 Mon Sep 17 00:00:00 2001 From: gaaclarke <30870216+gaaclarke@users.noreply.github.com> Date: Thu, 13 Jun 2019 16:15:10 -0700 Subject: [PATCH] Added class docstrings for classes inside of shell/common. (#9303) Added class docstrings for classes inside of shell/common. --- shell/common/animator.h | 4 ++++ shell/common/engine.h | 3 +++ shell/common/isolate_configuration.h | 1 + shell/common/persistent_cache.h | 3 +++ shell/common/pipeline.h | 2 ++ shell/common/platform_view.h | 2 ++ shell/common/rasterizer.h | 1 + shell/common/run_configuration.h | 3 +++ shell/common/shell.h | 2 ++ shell/common/surface.h | 1 + shell/common/thread_host.h | 1 + shell/common/vsync_waiter.h | 2 ++ shell/common/vsync_waiter_fallback.h | 1 + 13 files changed, 26 insertions(+) diff --git a/shell/common/animator.h b/shell/common/animator.h index 32c02f789fe..9f84468c01b 100644 --- a/shell/common/animator.h +++ b/shell/common/animator.h @@ -22,6 +22,10 @@ namespace testing { class ShellTest; } +/// Executor of animations. +/// +/// In conjunction with the |VsyncWaiter| it allows callers (typically Dart +/// code) to schedule work that ends up generating a |LayerTree|. class Animator final { public: class Delegate { diff --git a/shell/common/engine.h b/shell/common/engine.h index 1a84f9f4216..293d78c1a71 100644 --- a/shell/common/engine.h +++ b/shell/common/engine.h @@ -29,6 +29,9 @@ namespace flutter { +/// Manager of the root Dart isolate and the relay of platform messages. +/// +/// Also setups up dart::ui bindings and handles restarts. class Engine final : public RuntimeDelegate { public: // Used by Engine::Run diff --git a/shell/common/isolate_configuration.h b/shell/common/isolate_configuration.h index a6db9edb69f..88833df7faf 100644 --- a/shell/common/isolate_configuration.h +++ b/shell/common/isolate_configuration.h @@ -19,6 +19,7 @@ namespace flutter { +/// Abstract Base Class that will configure a |DartIsolate|. class IsolateConfiguration { public: static std::unique_ptr InferFromSettings( diff --git a/shell/common/persistent_cache.h b/shell/common/persistent_cache.h index f26e819e81a..4c7d65d95b1 100644 --- a/shell/common/persistent_cache.h +++ b/shell/common/persistent_cache.h @@ -17,6 +17,9 @@ namespace flutter { +/// A cache of SkData that gets stored to disk. +/// +/// This is mainly used for Shaders but is also written to by Dart. class PersistentCache : public GrContextOptions::PersistentCache { public: // Mutable static switch that can be set before GetCacheForProcess. If true, diff --git a/shell/common/pipeline.h b/shell/common/pipeline.h index b9aa1d89c6c..435cf602345 100644 --- a/shell/common/pipeline.h +++ b/shell/common/pipeline.h @@ -24,6 +24,8 @@ enum class PipelineConsumeResult { size_t GetNextPipelineTraceID(); +/// A thread-safe queue of resources for a single consumer and a single +/// producer. template class Pipeline : public fml::RefCountedThreadSafe> { public: diff --git a/shell/common/platform_view.h b/shell/common/platform_view.h index c8e44836afe..7965975249a 100644 --- a/shell/common/platform_view.h +++ b/shell/common/platform_view.h @@ -25,6 +25,8 @@ namespace flutter { class Shell; +/// Abstract Base Class that represents the platform specific view we will be +/// rendering to. class PlatformView { public: class Delegate { diff --git a/shell/common/rasterizer.h b/shell/common/rasterizer.h index 8511e252006..ad6d2da7a82 100644 --- a/shell/common/rasterizer.h +++ b/shell/common/rasterizer.h @@ -20,6 +20,7 @@ namespace flutter { +/// Takes |LayerTree|s and draws its contents. class Rasterizer final : public SnapshotDelegate { public: class Delegate { diff --git a/shell/common/run_configuration.h b/shell/common/run_configuration.h index a8b3a8b6e72..d5dfd29e0b9 100644 --- a/shell/common/run_configuration.h +++ b/shell/common/run_configuration.h @@ -18,6 +18,9 @@ namespace flutter { +/// Configuration pertaining to how we will execute the Dart code. +/// +/// For example: what will be the first function we execute (entrypoint). class RunConfiguration { public: static RunConfiguration InferFromSettings( diff --git a/shell/common/shell.h b/shell/common/shell.h index a226761ff2e..a05ff47e897 100644 --- a/shell/common/shell.h +++ b/shell/common/shell.h @@ -34,6 +34,8 @@ namespace flutter { +/// Wraps up all the different components of Flutter engine and coordinates them +/// through a series of delegates. class Shell final : public PlatformView::Delegate, public Animator::Delegate, public Engine::Delegate, diff --git a/shell/common/surface.h b/shell/common/surface.h index 06bebed09c5..7bbc16e24c6 100644 --- a/shell/common/surface.h +++ b/shell/common/surface.h @@ -41,6 +41,7 @@ class SurfaceFrame { FML_DISALLOW_COPY_AND_ASSIGN(SurfaceFrame); }; +/// Abstract Base Class that represents where we will be rendering content. class Surface { public: Surface(); diff --git a/shell/common/thread_host.h b/shell/common/thread_host.h index 93f42a90861..b5e14e6fa6b 100644 --- a/shell/common/thread_host.h +++ b/shell/common/thread_host.h @@ -12,6 +12,7 @@ namespace flutter { +/// The collection of all the threads used by the engine. struct ThreadHost { enum Type { Platform = 1 << 0, diff --git a/shell/common/vsync_waiter.h b/shell/common/vsync_waiter.h index 3d2cd7aca8a..5e80dd4c09c 100644 --- a/shell/common/vsync_waiter.h +++ b/shell/common/vsync_waiter.h @@ -15,6 +15,8 @@ namespace flutter { +/// Abstract Base Class that represents a platform specific mechanism for +/// getting callbacks when a vsync event happens. class VsyncWaiter : public std::enable_shared_from_this { public: using Callback = std::function