1 // Copyright 2013 The Flutter Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef FLUTTER_SHELL_PLATFORM_ANDROID_PLATFORM_MESSAGE_RESPONSE_ANDROID_H_ 6 #define FLUTTER_SHELL_PLATFORM_ANDROID_PLATFORM_MESSAGE_RESPONSE_ANDROID_H_ 7 8 #include "flutter/fml/macros.h" 9 #include "flutter/fml/platform/android/jni_weak_ref.h" 10 #include "flutter/fml/task_runner.h" 11 #include "flutter/lib/ui/window/platform_message_response.h" 12 13 namespace flutter { 14 15 class PlatformMessageResponseAndroid : public flutter::PlatformMessageResponse { 16 public: 17 // |flutter::PlatformMessageResponse| 18 void Complete(std::unique_ptr<fml::Mapping> data) override; 19 20 // |flutter::PlatformMessageResponse| 21 void CompleteEmpty() override; 22 23 private: 24 PlatformMessageResponseAndroid( 25 int response_id, 26 fml::jni::JavaObjectWeakGlobalRef weak_java_object, 27 fml::RefPtr<fml::TaskRunner> platform_task_runner); 28 29 ~PlatformMessageResponseAndroid() override; 30 31 int response_id_; 32 fml::jni::JavaObjectWeakGlobalRef weak_java_object_; 33 fml::RefPtr<fml::TaskRunner> platform_task_runner_; 34 35 FML_FRIEND_MAKE_REF_COUNTED(PlatformMessageResponseAndroid); 36 FML_DISALLOW_COPY_AND_ASSIGN(PlatformMessageResponseAndroid); 37 }; 38 39 } // namespace flutter 40 41 #endif // FLUTTER_SHELL_PLATFORM_ANDROID_PLATFORM_MESSAGE_RESPONSE_ANDROID_H_ 42