flutter_flutter/sky/shell/android/update_service_android.h
Matt Perry 81b2b81b1d Replace C++ UpdateTask with an empty dart version, loaded as a snapshot.
This adds a new placeholder dart package updater in sky/packages. This is built
into a snapshot and compiled into the Sky engine binary using the same
mechanism as the Dart isolate.

I also added a SkyHeadless class, similar to SkyView, used for running Dart
code without a view.
2015-09-23 14:09:38 -04:00

45 lines
1.0 KiB
C++

// Copyright 2015 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.
#ifndef SKY_SHELL_ANDROID_UPDATE_SERVICE_ANDROID_H_
#define SKY_SHELL_ANDROID_UPDATE_SERVICE_ANDROID_H_
#include <jni.h>
#include "base/android/scoped_java_ref.h"
#include "base/memory/scoped_ptr.h"
namespace blink {
class SkyHeadless;
}
namespace sky {
namespace shell {
class UpdateTaskAndroid {
public:
UpdateTaskAndroid(JNIEnv* env, jobject update_service);
virtual ~UpdateTaskAndroid();
void Start();
void Finish();
// This C++ object is owned by the Java UpdateTask. This is called by
// UpdateTask when it is destroyed.
void Destroy(JNIEnv* env, jobject jcaller);
private:
void RunDartOnUIThread();
scoped_ptr<blink::SkyHeadless> headless_;
base::android::ScopedJavaGlobalRef<jobject> update_service_;
};
bool RegisterUpdateService(JNIEnv* env);
} // namespace shell
} // namespace sky
#endif // SKY_SHELL_ANDROID_UPDATE_SERVICE_ANDROID_H_