flutter_flutter/lib/ui/versions.cc
Chinmay Garde eec74e5c92
Rename the blink namespace to flutter. (#8517)
Some components in the Flutter engine were derived from the forked blink codebase. While the forked components have either been removed or rewritten, the use of the blink namespace has mostly (and inconsistently) remained. This renames the blink namesapce to flutter for consistency. There are no functional changes in this patch.
2019-04-09 12:44:42 -07:00

32 lines
1007 B
C++

// 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/ui/versions.h"
#include "flutter/common/version/version.h"
#include "third_party/tonic/converter/dart_converter.h"
#include "third_party/tonic/dart_library_natives.h"
#include <string>
#include <vector>
using tonic::DartConverter;
namespace flutter {
// returns a vector with 3 versions.
// Dart, Skia and Flutter engine versions in this order.
void GetVersions(Dart_NativeArguments args) {
const std::vector<std::string> versions_list = {
GetDartVersion(), GetSkiaVersion(), GetFlutterEngineVersion()};
Dart_Handle dart_val =
DartConverter<std::vector<std::string>>::ToDart(versions_list);
Dart_SetReturnValue(args, dart_val);
}
void Versions::RegisterNatives(tonic::DartLibraryNatives* natives) {
natives->Register({{"Versions_getVersions", GetVersions, 0, true}});
}
} // namespace flutter