forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdart_io.cc
25 lines (18 loc) · 815 Bytes
/
dart_io.cc
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
// 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.
#include "flutter/lib/io/dart_io.h"
#include "third_party/dart/runtime/include/bin/dart_io_api.h"
#include "third_party/dart/runtime/include/dart_api.h"
#include "third_party/tonic/converter/dart_converter.h"
using tonic::ToDart;
namespace blink {
void DartIO::InitForIsolate() {
DART_CHECK_VALID(Dart_SetNativeResolver(Dart_LookupLibrary(ToDart("dart:io")),
dart::bin::LookupIONative,
dart::bin::LookupIONativeSymbol));
}
bool DartIO::EntropySource(uint8_t* buffer, intptr_t length) {
return dart::bin::GetEntropy(buffer, length);
}
} // namespace blink