Flutter Engine
 
Loading...
Searching...
No Matches
embedder_thread_host.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_THREAD_HOST_H_
6#define FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_THREAD_HOST_H_
7
8#include <map>
9#include <memory>
10#include <set>
11
13#include "flutter/fml/macros.h"
17
18namespace flutter {
19
21 public:
22 static std::unique_ptr<EmbedderThreadHost>
24 const FlutterCustomTaskRunners* custom_task_runners,
25 const flutter::ThreadConfigSetter& config_setter =
27
30 const flutter::TaskRunners& runners,
31 const std::set<fml::RefPtr<EmbedderTaskRunner>>& embedder_task_runners);
32
34
35 bool IsValid() const;
36
38
39 bool PostTask(intptr_t runner, uint64_t task) const;
40
41 static bool RunnerIsValid(intptr_t runner);
42
44
45 private:
46 ThreadHost host_;
47 flutter::TaskRunners runners_;
48 std::map<intptr_t, fml::RefPtr<EmbedderTaskRunner>> runners_map_;
49
50 static std::set<intptr_t> active_runners_;
51 static std::mutex active_runners_mutex_;
52
53 static std::unique_ptr<EmbedderThreadHost> CreateEmbedderManagedThreadHost(
54 const FlutterCustomTaskRunners* custom_task_runners,
55 const flutter::ThreadConfigSetter& config_setter =
57
58 static std::unique_ptr<EmbedderThreadHost> CreateEngineManagedThreadHost(
59 const flutter::ThreadConfigSetter& config_setter =
61
63};
64
65} // namespace flutter
66
67#endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_THREAD_HOST_H_
bool PostTask(intptr_t runner, uint64_t task) const
static bool RunnerIsValid(intptr_t runner)
const flutter::TaskRunners & GetTaskRunners() const
static std::unique_ptr< EmbedderThreadHost > CreateEmbedderOrEngineManagedThreadHost(const FlutterCustomTaskRunners *custom_task_runners, const flutter::ThreadConfigSetter &config_setter=fml::Thread::SetCurrentThreadName)
static void SetCurrentThreadName(const ThreadConfig &config)
Definition thread.cc:135
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service host
Definition switch_defs.h:69
fml::Thread::ThreadConfigSetter ThreadConfigSetter
Definition thread_host.h:18
The collection of all the threads used by the engine.
Definition thread_host.h:21