forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dart_snapshot_buffer.h
40 lines (28 loc) · 1.13 KB
/
dart_snapshot_buffer.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
// Copyright 2017 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_RUNTIME_DART_SNAPSHOT_BUFFER_H_
#define FLUTTER_RUNTIME_DART_SNAPSHOT_BUFFER_H_
#include <initializer_list>
#include <memory>
#include "flutter/fml/file.h"
#include "flutter/fml/macros.h"
#include "flutter/fml/mapping.h"
#include "flutter/fml/native_library.h"
namespace blink {
class DartSnapshotBuffer {
public:
static std::unique_ptr<DartSnapshotBuffer> CreateWithSymbolInLibrary(
fml::RefPtr<fml::NativeLibrary> library,
const char* symbol_name);
static std::unique_ptr<DartSnapshotBuffer> CreateWithContentsOfFile(
const fml::UniqueFD& fd,
std::initializer_list<fml::FileMapping::Protection> protection);
static std::unique_ptr<DartSnapshotBuffer> CreateWithUnmanagedAllocation(
const uint8_t* allocation);
virtual ~DartSnapshotBuffer();
virtual const uint8_t* GetSnapshotPointer() const = 0;
virtual size_t GetSnapshotSize() const = 0;
};
} // namespace blink
#endif // FLUTTER_RUNTIME_DART_SNAPSHOT_BUFFER_H_