Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Unified Diff: samples/android_sample/jni/dart_host.cc

Issue 11467028: Migrate files to embedder. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review fixes Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samples/android_sample/jni/dart_host.h ('k') | samples/android_sample/jni/eventloop.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/android_sample/jni/dart_host.cc
diff --git a/samples/android_sample/jni/dart_host.cc b/samples/android_sample/jni/dart_host.cc
deleted file mode 100644
index 4d38243be7f613cd390902921a6d4453ed3f80c1..0000000000000000000000000000000000000000
--- a/samples/android_sample/jni/dart_host.cc
+++ /dev/null
@@ -1,129 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-#include "jni/dart_host.h"
-
-#include <math.h>
-#include <unistd.h>
-
-#include "jni/log.h"
-
-DartHost::DartHost(Context *context)
- : graphics_(context->graphics),
- input_handler_(context->input_handler),
- sound_service_(context->sound_service),
- timer_(context->timer),
- vm_glue_(context->vm_glue),
- active_(false) {
- LOGI("Creating DartHost");
-}
-
-DartHost::~DartHost() {
- LOGI("Freeing DartHost");
-}
-
-int32_t DartHost::OnActivate() {
- return Activate();
-}
-
-int32_t DartHost::Activate() {
- if (!active_) {
- LOGI("Activating DartHost");
- if (graphics_->Start() != 0) {
- return -1;
- }
- if (sound_service_->Start() != 0) {
- return -1;
- }
- if (input_handler_->Start() != 0) {
- return -1;
- }
- timer_->reset();
- LOGI("Starting main isolate");
- int result = vm_glue_->StartMainIsolate();
- if (result != 0) {
- LOGE("startMainIsolate returned %d", result);
- return -1;
- }
- active_ = true;
- vm_glue_->CallSetup();
- }
- return 0;
-}
-
-void DartHost::OnDeactivate() {
- Deactivate();
-}
-
-void DartHost::Deactivate() {
- if (active_) {
- active_ = false;
- vm_glue_->FinishMainIsolate();
- LOGI("Deactivating DartHost");
- sound_service_->Stop();
- graphics_->Stop();
- }
-}
-
-int32_t DartHost::OnStep() {
- timer_->update();
- vm_glue_->CallUpdate();
- if (graphics_->Update() != 0) {
- return -1;
- }
- return 0;
-}
-
-void DartHost::OnStart() {
- LOGI("Starting DartHost");
-}
-
-void DartHost::OnResume() {
- LOGI("Resuming DartHost");
-}
-
-void DartHost::OnPause() {
- LOGI("Pausing DartHost");
-}
-
-void DartHost::OnStop() {
- LOGI("Stopping DartHost");
-}
-
-void DartHost::OnDestroy() {
- LOGI("Destroying DartHost");
-}
-
-void DartHost::OnSaveState(void** data, size_t size) {
- LOGI("Saving DartHost state");
-}
-
-void DartHost::OnConfigurationChanged() {
- LOGI("DartHost config changed");
-}
-
-void DartHost::OnLowMemory() {
- LOGI("DartHost low on memory");
-}
-
-void DartHost::OnCreateWindow() {
- LOGI("DartHost creating window");
-}
-
-void DartHost::OnDestroyWindow() {
- LOGI("DartHost destroying window");
-}
-
-void DartHost::OnGainedFocus() {
- LOGI("DartHost gained focus");
-}
-
-void DartHost::OnLostFocus() {
- LOGI("DartHost lost focus");
-}
-
-void DartHost::Clear() {
- memset(window_buffer_.bits, 0,
- window_buffer_.stride * window_buffer_.height * sizeof(int32_t));
-}
« no previous file with comments | « samples/android_sample/jni/dart_host.h ('k') | samples/android_sample/jni/eventloop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698