Flutter Engine
The 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
12#include "flutter/common/task_runners.h"
13#include "flutter/fml/macros.h"
14#include "flutter/shell/common/thread_host.h"
15#include "flutter/shell/platform/embedder/embedder.h"
16#include "flutter/shell/platform/embedder/embedder_task_runner.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(int64_t runner, uint64_t task) const;
40
41 private:
42 ThreadHost host_;
43 flutter::TaskRunners runners_;
44 std::map<int64_t, fml::RefPtr<EmbedderTaskRunner>> runners_map_;
45
46 static std::unique_ptr<EmbedderThreadHost> CreateEmbedderManagedThreadHost(
47 const FlutterCustomTaskRunners* custom_task_runners,
48 const flutter::ThreadConfigSetter& config_setter =
50
51 static std::unique_ptr<EmbedderThreadHost> CreateEngineManagedThreadHost(
52 const flutter::ThreadConfigSetter& config_setter =
54
56};
57
58} // namespace flutter
59
60#endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_THREAD_HOST_H_
bool PostTask(int64_t runner, uint64_t task) const
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 switches.h:74
fml::Thread::ThreadConfigSetter ThreadConfigSetter
Definition thread_host.h:18
The collection of all the threads used by the engine.
Definition thread_host.h:21