forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathisolate_configuration.h
56 lines (40 loc) · 1.64 KB
/
isolate_configuration.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright 2013 The Flutter 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 FLUTTER_SHELL_COMMON_ISOLATE_CONFIGURATION_H_
#define FLUTTER_SHELL_COMMON_ISOLATE_CONFIGURATION_H_
#include <future>
#include <memory>
#include <string>
#include "flutter/assets/asset_manager.h"
#include "flutter/assets/asset_resolver.h"
#include "flutter/common/settings.h"
#include "flutter/fml/macros.h"
#include "flutter/fml/mapping.h"
#include "flutter/fml/memory/weak_ptr.h"
#include "flutter/runtime/dart_isolate.h"
namespace flutter {
class IsolateConfiguration {
public:
static std::unique_ptr<IsolateConfiguration> InferFromSettings(
const Settings& settings,
std::shared_ptr<AssetManager> asset_manager,
fml::RefPtr<fml::TaskRunner> io_worker);
static std::unique_ptr<IsolateConfiguration> CreateForAppSnapshot();
static std::unique_ptr<IsolateConfiguration> CreateForKernel(
std::unique_ptr<const fml::Mapping> kernel);
static std::unique_ptr<IsolateConfiguration> CreateForKernelList(
std::vector<std::future<std::unique_ptr<const fml::Mapping>>>
kernel_pieces);
static std::unique_ptr<IsolateConfiguration> CreateForKernelList(
std::vector<std::unique_ptr<const fml::Mapping>> kernel_pieces);
IsolateConfiguration();
virtual ~IsolateConfiguration();
bool PrepareIsolate(DartIsolate& isolate);
protected:
virtual bool DoPrepareIsolate(DartIsolate& isolate) = 0;
private:
FML_DISALLOW_COPY_AND_ASSIGN(IsolateConfiguration);
};
} // namespace flutter
#endif // FLUTTER_SHELL_COMMON_ISOLATE_CONFIGURATION_H_