runtime_init.cc 1.0 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
// Copyright 2016 The Chromium 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/runtime/runtime_init.h"

#include "flutter/glue/trace_event.h"
#include "flutter/runtime/dart_init.h"
#include "flutter/runtime/platform_impl.h"
#include "flutter/sky/engine/public/web/Sky.h"
#include "lib/ftl/logging.h"

namespace blink {
namespace {

PlatformImpl* g_platform_impl = nullptr;

}  // namespace

R
Ryan Macnak 已提交
20 21 22 23
void InitRuntime(const uint8_t* vm_snapshot_data,
                 const uint8_t* vm_snapshot_instructions,
                 const uint8_t* default_isolate_snapshot_data,
                 const uint8_t* default_isolate_snapshot_instructions) {
24 25 26 27 28
  TRACE_EVENT0("flutter", "InitRuntime");

  FTL_CHECK(!g_platform_impl);
  g_platform_impl = new PlatformImpl();
  InitEngine(g_platform_impl);
R
Ryan Macnak 已提交
29 30 31
  InitDartVM(vm_snapshot_data, vm_snapshot_instructions,
             default_isolate_snapshot_data,
             default_isolate_snapshot_instructions);
32 33 34
}

}  // namespace blink