/third_party/flutter/engine/flutter/fml/ |
D | file_unittest.cc | 14 static bool WriteStringToFile(const fml::UniqueFD& fd, in WriteStringToFile() 16 if (!fml::TruncateFile(fd, contents.size())) { in WriteStringToFile() 20 fml::FileMapping mapping(fd, {fml::FileMapping::Protection::kWrite}); in WriteStringToFile() 33 static std::string ReadStringFromFile(const fml::UniqueFD& fd) { in ReadStringFromFile() 34 fml::FileMapping mapping(fd); in ReadStringFromFile() 45 auto dir_name = fml::CreateTemporaryDirectory(); in TEST() 48 fml::OpenDirectory(dir_name.c_str(), false, fml::FilePermission::kRead); in TEST() 51 ASSERT_TRUE(fml::UnlinkDirectory(dir_name.c_str())); in TEST() 55 fml::ScopedTemporaryDirectory dir; in TEST() 60 fml::ScopedTemporaryDirectory dir; in TEST() [all …]
|
D | gpu_thread_merger_unittests.cc | 18 fml::MessageLoop* loop1 = nullptr; in TEST() 19 fml::AutoResetWaitableEvent latch1; in TEST() 20 fml::AutoResetWaitableEvent term1; in TEST() 22 fml::MessageLoop::EnsureInitializedForCurrentThread(); in TEST() 23 loop1 = &fml::MessageLoop::GetCurrent(); in TEST() 28 fml::MessageLoop* loop2 = nullptr; in TEST() 29 fml::AutoResetWaitableEvent latch2; in TEST() 30 fml::AutoResetWaitableEvent term2; in TEST() 32 fml::MessageLoop::EnsureInitializedForCurrentThread(); in TEST() 33 loop2 = &fml::MessageLoop::GetCurrent(); in TEST() [all …]
|
D | message_loop_unittests.cc | 26 fml::MessageLoop::EnsureInitializedForCurrentThread(); in TEST() 27 ASSERT_TRUE(fml::MessageLoop::GetCurrent().GetTaskRunner()); in TEST() 33 fml::MessageLoop* loop1 = nullptr; in TEST() 34 fml::AutoResetWaitableEvent latch1; in TEST() 35 fml::AutoResetWaitableEvent term1; in TEST() 37 fml::MessageLoop::EnsureInitializedForCurrentThread(); in TEST() 38 loop1 = &fml::MessageLoop::GetCurrent(); in TEST() 43 fml::MessageLoop* loop2 = nullptr; in TEST() 44 fml::AutoResetWaitableEvent latch2; in TEST() 45 fml::AutoResetWaitableEvent term2; in TEST() [all …]
|
D | message_loop_task_queues_unittests.cc | 14 class TestWakeable : public fml::Wakeable { 16 using WakeUpCall = std::function<void(const fml::TimePoint)>; 20 void WakeUp(fml::TimePoint time_point) override { wake_up_call_(time_point); } in WakeUp() 27 auto task_queue = fml::MessageLoopTaskQueues::GetInstance(); in TEST() 33 const auto time = fml::TimePoint::Max(); in TEST() 35 auto task_queue = fml::MessageLoopTaskQueues::GetInstance(); in TEST() 38 new TestWakeable([&time](fml::TimePoint wake_time) { in TEST() 49 auto task_queue = fml::MessageLoopTaskQueues::GetInstance(); in TEST() 52 queue_id, [] {}, fml::TimePoint::Now()); in TEST() 54 queue_id, [] {}, fml::TimePoint::Max()); in TEST() [all …]
|
D | message_loop_task_queues_merge_unmerge_unittests.cc | 14 class TestWakeable : public fml::Wakeable { 16 using WakeUpCall = std::function<void(const fml::TimePoint)>; 20 void WakeUp(fml::TimePoint time_point) override { wake_up_call_(time_point); } in WakeUp() 28 auto task_queue = fml::MessageLoopTaskQueues::GetInstance(); in TEST() 34 queue_id_1, []() {}, fml::TimePoint::Now()); in TEST() 39 queue_id_1, []() {}, fml::TimePoint::Now()); in TEST() 47 auto task_queue = fml::MessageLoopTaskQueues::GetInstance(); in TEST() 53 queue_id_2, []() {}, fml::TimePoint::Now()); in TEST() 62 auto task_queue = fml::MessageLoopTaskQueues::GetInstance(); in TEST() 68 queue_id_1, []() {}, fml::TimePoint::Now()); in TEST() [all …]
|
D | file.h | 19 namespace fml { 31 fml::UniqueFD OpenFile(const char* path, 35 fml::UniqueFD OpenFile(const fml::UniqueFD& base_directory, 40 fml::UniqueFD OpenDirectory(const char* path, 44 fml::UniqueFD OpenDirectory(const fml::UniqueFD& base_directory, 49 fml::UniqueFD Duplicate(fml::UniqueFD::element_type descriptor); 51 bool IsDirectory(const fml::UniqueFD& directory); 56 bool TruncateFile(const fml::UniqueFD& file, size_t size); 58 bool FileExists(const fml::UniqueFD& base_directory, const char* path); 62 bool UnlinkDirectory(const fml::UniqueFD& base_directory, const char* path); [all …]
|
D | task_runner.h | 15 namespace fml { 19 class TaskRunner : public fml::RefCountedThreadSafe<TaskRunner> { 23 virtual void PostTask(fml::closure task); 25 virtual void PostTaskForTime(fml::closure task, fml::TimePoint target_time); 27 virtual void PostDelayedTask(fml::closure task, fml::TimeDelta delay); 33 static void RunNowOrPostTask(fml::RefPtr<fml::TaskRunner> runner, 34 fml::closure task); 37 TaskRunner(fml::RefPtr<MessageLoopImpl> loop); 40 fml::RefPtr<MessageLoopImpl> loop_;
|
D | task_runner.cc | 16 namespace fml { namespace 18 TaskRunner::TaskRunner(fml::RefPtr<MessageLoopImpl> loop) in TaskRunner() 23 void TaskRunner::PostTask(fml::closure task) { in PostTask() 24 loop_->PostTask(std::move(task), fml::TimePoint::Now()); in PostTask() 27 void TaskRunner::PostTaskForTime(fml::closure task, in PostTaskForTime() 28 fml::TimePoint target_time) { in PostTaskForTime() 32 void TaskRunner::PostDelayedTask(fml::closure task, fml::TimeDelta delay) { in PostDelayedTask() 33 loop_->PostTask(std::move(task), fml::TimePoint::Now() + delay); in PostDelayedTask() 42 if (!fml::MessageLoop::IsInitializedForCurrentThread()) { in RunsTasksOnCurrentThread() 64 void TaskRunner::RunNowOrPostTask(fml::RefPtr<fml::TaskRunner> runner, in RunNowOrPostTask() [all …]
|
/third_party/flutter/engine/flutter/common/ |
D | task_runners.h | 18 fml::RefPtr<fml::TaskRunner> platform, 19 fml::RefPtr<fml::TaskRunner> gpu, 20 fml::RefPtr<fml::TaskRunner> ui, 21 fml::RefPtr<fml::TaskRunner> io); 29 fml::RefPtr<fml::TaskRunner> GetPlatformTaskRunner() const; 31 fml::RefPtr<fml::TaskRunner> GetUITaskRunner() const; 33 fml::RefPtr<fml::TaskRunner> GetIOTaskRunner() const; 35 fml::RefPtr<fml::TaskRunner> GetGPUTaskRunner() const; 41 fml::RefPtr<fml::TaskRunner> platform_; 42 fml::RefPtr<fml::TaskRunner> gpu_; [all …]
|
D | task_runners.cc | 12 fml::RefPtr<fml::TaskRunner> platform, in TaskRunners() 13 fml::RefPtr<fml::TaskRunner> gpu, in TaskRunners() 14 fml::RefPtr<fml::TaskRunner> ui, in TaskRunners() 15 fml::RefPtr<fml::TaskRunner> io) in TaskRunners() 30 fml::RefPtr<fml::TaskRunner> TaskRunners::GetPlatformTaskRunner() const { in GetPlatformTaskRunner() 34 fml::RefPtr<fml::TaskRunner> TaskRunners::GetUITaskRunner() const { in GetUITaskRunner() 38 fml::RefPtr<fml::TaskRunner> TaskRunners::GetIOTaskRunner() const { in GetIOTaskRunner() 42 fml::RefPtr<fml::TaskRunner> TaskRunners::GetGPUTaskRunner() const { in GetGPUTaskRunner()
|
/third_party/flutter/engine/flutter/runtime/ |
D | dart_isolate.h | 44 fml::RefPtr<const DartSnapshot> isolate_snapshot, 45 fml::RefPtr<const DartSnapshot> shared_snapshot, 48 fml::WeakPtr<IOManager> io_manager, 49 fml::WeakPtr<ImageDecoder> image_decoder, 53 fml::closure isolate_create_callback, 54 fml::closure isolate_shutdown_callback); 57 fml::RefPtr<const DartSnapshot> isolate_snapshot, 58 fml::RefPtr<const DartSnapshot> shared_snapshot, 60 fml::WeakPtr<IOManager> io_manager, 61 fml::WeakPtr<ImageDecoder> image_decoder, [all …]
|
D | dart_snapshot.cc | 31 static std::unique_ptr<const fml::Mapping> GetFileMapping( in GetFileMapping() 35 return fml::FileMapping::CreateReadExecute(path); in GetFileMapping() 37 return fml::FileMapping::CreateReadOnly(path); in GetFileMapping() 52 static std::shared_ptr<const fml::Mapping> SearchMapping( in SearchMapping() 73 auto native_library = fml::NativeLibrary::Create(path.c_str()); in SearchMapping() 74 auto symbol_mapping = std::make_unique<const fml::SymbolMapping>( in SearchMapping() 83 auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess(); in SearchMapping() 84 auto symbol_mapping = std::make_unique<const fml::SymbolMapping>( in SearchMapping() 96 static std::shared_ptr<const fml::Mapping> ResolveVMData( in ResolveVMData() 99 return std::make_unique<fml::NonOwnedMapping>(kDartVmSnapshotData, 0); in ResolveVMData() [all …]
|
D | dart_vm.cc | 135 fml::TimeDelta mtime = fml::TimeDelta::FromSeconds(info.st_mtime + 1); in DartFileModifiedCallback() 136 fml::TimeDelta since = fml::TimeDelta::FromMilliseconds(since_ms); in DartFileModifiedCallback() 147 fml::UniqueFD fd = fml::OpenFile("pkg/data/observatory.tar", false, in GetVMServiceAssetsArchiveCallback() 148 fml::FilePermission::kRead); in GetVMServiceAssetsArchiveCallback() 149 fml::FileMapping mapping(fd, {fml::FileMapping::Protection::kRead}); in GetVMServiceAssetsArchiveCallback() 227 fml::RefPtr<DartSnapshot> vm_snapshot, in Create() 228 fml::RefPtr<DartSnapshot> isolate_snapshot, in Create() 229 fml::RefPtr<DartSnapshot> shared_snapshot, in Create() 256 concurrent_message_loop_(fml::ConcurrentMessageLoop::Create()), in DartVM() 259 fml::closure work) { runner->PostTask(work); }), in DartVM() [all …]
|
/third_party/flutter/engine/flutter/shell/common/ |
D | persistent_cache.cc | 31 auto encode_result = fml::Base32Encode(view); in SkKeyToFilePath() 55 std::shared_ptr<fml::UniqueFD> MakeCacheDirectory( in MakeCacheDirectory() 58 fml::UniqueFD cache_base_dir; in MakeCacheDirectory() 60 cache_base_dir = fml::OpenDirectory(global_cache_base_path.c_str(), false, in MakeCacheDirectory() 61 fml::FilePermission::kRead); in MakeCacheDirectory() 63 cache_base_dir = fml::paths::GetCachesDirectory(); in MakeCacheDirectory() 67 return std::make_shared<fml::UniqueFD>(CreateDirectory( in MakeCacheDirectory() 70 read_only ? fml::FilePermission::kRead in MakeCacheDirectory() 71 : fml::FilePermission::kReadWrite)); in MakeCacheDirectory() 73 return std::make_shared<fml::UniqueFD>(); in MakeCacheDirectory() [all …]
|
D | ace_shell.cc | 86 fml::AutoResetWaitableEvent io_latch; in CreateShellOnPlatformThread() 89 fml::TaskRunner::RunNowOrPostTask( in CreateShellOnPlatformThread() 104 fml::AutoResetWaitableEvent gpu_latch; in CreateShellOnPlatformThread() 106 fml::TaskRunner::RunNowOrPostTask( in CreateShellOnPlatformThread() 122 fml::AutoResetWaitableEvent ui_latch; in CreateShellOnPlatformThread() 126 fml::TaskRunner::RunNowOrPostTask( in CreateShellOnPlatformThread() 128 fml::MakeCopyable([&ui_latch, // in CreateShellOnPlatformThread() 156 fml::TaskRunner::RunNowOrPostTask( in CreateShellOnPlatformThread() 189 fml::LogSettings log_settings; in PerformInitializationTasks() 191 settings.verbose_logging ? fml::LOG_INFO : fml::LOG_ERROR; in PerformInitializationTasks() [all …]
|
D | shell_unittests.cc | 42 fml::AutoResetWaitableEvent latch; in ValidateShell() 43 fml::TaskRunner::RunNowOrPostTask( in ValidateShell() 98 fml::MessageLoop::EnsureInitializedForCurrentThread(); in TEST_F() 99 auto task_runner = fml::MessageLoop::GetCurrent().GetTaskRunner(); in TEST_F() 116 fml::MessageLoop::EnsureInitializedForCurrentThread(); in TEST_F() 118 fml::MessageLoop::GetCurrent().GetTaskRunner(), in TEST_F() 167 fml::AutoResetWaitableEvent main_latch; in TEST_F() 189 fml::CountDownLatch latch(2); in TEST_F() 211 const std::vector<fml::CommandLine::Option> options = { in TEST() 212 fml::CommandLine::Option("dart-flags", "--enable_mirrors")}; in TEST() [all …]
|
D | shell.cc | 39 fml::RefPtr<const DartSnapshot> isolate_snapshot, in CreateShellOnPlatformThread() 40 fml::RefPtr<const DartSnapshot> shared_snapshot, in CreateShellOnPlatformThread() 68 fml::AutoResetWaitableEvent io_latch; in CreateShellOnPlatformThread() 71 fml::TaskRunner::RunNowOrPostTask( in CreateShellOnPlatformThread() 86 fml::AutoResetWaitableEvent gpu_latch; in CreateShellOnPlatformThread() 88 fml::TaskRunner::RunNowOrPostTask( in CreateShellOnPlatformThread() 104 fml::AutoResetWaitableEvent ui_latch; in CreateShellOnPlatformThread() 106 fml::TaskRunner::RunNowOrPostTask( in CreateShellOnPlatformThread() 108 fml::MakeCopyable([&ui_latch, // in CreateShellOnPlatformThread() 165 fml::LogSettings log_settings; in PerformInitializationTasks() [all …]
|
D | vsync_waiter_fallback.cc | 14 static fml::TimePoint SnapToNextTick(fml::TimePoint value, in SnapToNextTick() 15 fml::TimePoint tick_phase, in SnapToNextTick() 16 fml::TimeDelta tick_interval) { in SnapToNextTick() 17 fml::TimeDelta offset = (tick_phase - value) % tick_interval; in SnapToNextTick() 18 if (offset != fml::TimeDelta::Zero()) in SnapToNextTick() 26 : VsyncWaiter(std::move(task_runners)), phase_(fml::TimePoint::Now()) {} in VsyncWaiterFallback() 34 constexpr fml::TimeDelta kSingleFrameInterval = in AwaitVSync() 35 fml::TimeDelta::FromSecondsF(1.0 / 30.0); in AwaitVSync() 37 constexpr fml::TimeDelta kSingleFrameInterval = in AwaitVSync() 38 fml::TimeDelta::FromSecondsF(1.0 / 60.0); in AwaitVSync() [all …]
|
/third_party/flutter/engine/flutter/shell/testing/ |
D | tester_main.cc | 32 fml::RefPtr<fml::TaskRunner> main_task_runner, in ScriptCompletionTaskObserver() 60 []() { fml::MessageLoop::GetCurrent().Terminate(); }); in DidProcessTask() 66 fml::RefPtr<fml::TaskRunner> main_task_runner_; 77 fml::MessageLoop::EnsureInitializedForCurrentThread(); in RunTester() 79 auto current_task_runner = fml::MessageLoop::GetCurrent().GetTaskRunner(); in RunTester() 122 fml::RefPtr<flutter::PlatformMessageResponse> response; in RunTester() 124 fml::MakeRefCounted<flutter::PlatformMessage>("flutter/localization", in RunTester() 127 std::initializer_list<fml::FileMapping::Protection> protection = { in RunTester() 128 fml::FileMapping::Protection::kRead}; in RunTester() 129 auto main_dart_file_mapping = std::make_unique<fml::FileMapping>( in RunTester() [all …]
|
/third_party/flutter/engine/flutter/fml/platform/posix/ |
D | file_posix.cc | 19 namespace fml { namespace 62 fml::UniqueFD OpenFile(const char* path, in OpenFile() 65 return OpenFile(fml::UniqueFD{AT_FDCWD}, path, create_if_necessary, in OpenFile() 69 fml::UniqueFD OpenFile(const fml::UniqueFD& base_directory, in OpenFile() 88 return fml::UniqueFD{ in OpenFile() 92 fml::UniqueFD OpenDirectory(const char* path, in OpenDirectory() 95 return OpenDirectory(fml::UniqueFD{AT_FDCWD}, path, create_if_necessary, in OpenDirectory() 99 fml::UniqueFD OpenDirectory(const fml::UniqueFD& base_directory, in OpenDirectory() 114 return fml::UniqueFD{FML_HANDLE_EINTR( in OpenDirectory() 118 fml::UniqueFD Duplicate(fml::UniqueFD::element_type descriptor) { in Duplicate() [all …]
|
/third_party/flutter/engine/flutter/lib/ui/compositing/ |
D | scene_builder.h | 39 static fml::RefPtr<SceneBuilder> create() { in create() 40 return fml::MakeRefCounted<SceneBuilder>(); in create() 45 fml::RefPtr<EngineLayer> pushTransform(tonic::Float64List& matrix4); 46 fml::RefPtr<EngineLayer> pushOffset(double dx, double dy); 47 fml::RefPtr<EngineLayer> pushClipRect(double left, 52 fml::RefPtr<EngineLayer> pushClipRRect(const RRect& rrect, int clipBehavior); 53 fml::RefPtr<EngineLayer> pushClipPath(const CanvasPath* path, 55 fml::RefPtr<EngineLayer> pushOpacity(int alpha, double dx = 0, double dy = 0); 56 fml::RefPtr<EngineLayer> pushColorFilter(const ColorFilter* color_filter); 57 fml::RefPtr<EngineLayer> pushBackdropFilter(ImageFilter* filter); [all …]
|
/third_party/flutter/engine/flutter/shell/platform/ohos/ |
D | platform_task_runner_adapter.cc | 11 fml::RefPtr<fml::TaskRunner> PlatformTaskRunnerAdapter::taskRunner_; 14 : fml::TaskRunner(nullptr) in PlatformTaskRunnerAdapter() 24 void PlatformTaskRunnerAdapter::PostTask(fml::closure task) in PostTask() 29 void PlatformTaskRunnerAdapter::PostTaskForTime(fml::closure task, fml::TimePoint target_time) in PostTaskForTime() 34 void PlatformTaskRunnerAdapter::PostDelayedTask(fml::closure task, fml::TimeDelta delay) in PostDelayedTask() 44 fml::TaskQueueId PlatformTaskRunnerAdapter::GetTaskQueueId() in GetTaskQueueId() 46 return fml::_kUnmerged; in GetTaskQueueId() 49 fml::RefPtr<fml::TaskRunner> PlatformTaskRunnerAdapter::CurrentTaskRunner(bool useCurrentEventRunne… in CurrentTaskRunner() 52 return fml::MakeRefCounted<PlatformTaskRunnerAdapter>(useCurrentEventRunner); in CurrentTaskRunner() 57 taskRunner_ = fml::MakeRefCounted<PlatformTaskRunnerAdapter>(useCurrentEventRunner); in CurrentTaskRunner()
|
/third_party/flutter/engine/flutter/shell/platform/android/ |
D | flutter_main.cc | 37 fml::jni::ScopedJavaGlobalRef<jclass>* g_flutter_jni_class = nullptr; 67 for (auto& arg : fml::jni::StringArrayToVector(env, jargs)) { in Init() 70 auto command_line = fml::CommandLineFromIterators(args.begin(), args.end()); in Init() 78 fml::jni::JavaStringToString(env, appStoragePath)); in Init() 80 fml::paths::InitializeAndroidCachesPath( in Init() 81 fml::jni::JavaStringToString(env, engineCachesPath)); in Init() 89 fml::jni::JavaStringToString(env, kernelPath); in Init() 91 if (fml::IsFile(application_kernel_path)) { in Init() 96 settings.task_observer_add = [](intptr_t key, fml::closure callback) { in Init() 97 fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); in Init() [all …]
|
/third_party/flutter/engine/flutter/testing/ |
D | thread_test.h | 45 fml::RefPtr<fml::TaskRunner> GetCurrentTaskRunner(); 61 fml::RefPtr<fml::TaskRunner> GetThreadTaskRunner(); 73 fml::RefPtr<fml::TaskRunner> CreateNewThread(std::string name = ""); 83 std::unique_ptr<fml::Thread> thread_; 84 fml::RefPtr<fml::TaskRunner> thread_task_runner_; 85 fml::RefPtr<fml::TaskRunner> current_task_runner_; 86 std::vector<std::unique_ptr<fml::Thread>> extra_threads_;
|
/third_party/flutter/engine/flutter/lib/ui/painting/ |
D | image_decoder_unittests.cc | 20 TestIOManager(fml::RefPtr<fml::TaskRunner> task_runner, in TestIOManager() 24 has_gpu_context ? std::make_unique<fml::WeakPtrFactory<GrContext>>( in TestIOManager() 27 unref_queue_(fml::MakeRefCounted<SkiaUnrefQueue>( in TestIOManager() 29 fml::TimeDelta::FromNanoseconds(0))), in TestIOManager() 39 fml::AutoResetWaitableEvent latch; in ~TestIOManager() 40 fml::TaskRunner::RunNowOrPostTask(runner_, in ~TestIOManager() 49 fml::WeakPtr<IOManager> GetWeakIOManager() const override { in GetWeakIOManager() 54 fml::WeakPtr<GrContext> GetResourceContext() const override { in GetResourceContext() 56 : fml::WeakPtr<GrContext>{}; in GetResourceContext() 60 fml::RefPtr<flutter::SkiaUnrefQueue> GetSkiaUnrefQueue() const override { in GetSkiaUnrefQueue() [all …]
|