// 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. #ifndef FLUTTER_LIB_UI_PLATFORM_PLATFORM_MESSAGE_H_ #define FLUTTER_LIB_UI_PLATFORM_PLATFORM_MESSAGE_H_ #include #include #include "flutter/fml/memory/ref_counted.h" #include "flutter/fml/memory/ref_ptr.h" #include "flutter/lib/ui/window/platform_message_response.h" namespace flutter { class PlatformMessage : public fml::RefCountedThreadSafe { FML_FRIEND_REF_COUNTED_THREAD_SAFE(PlatformMessage); FML_FRIEND_MAKE_REF_COUNTED(PlatformMessage); public: const std::string& channel() const { return channel_; } const std::vector& data() const { return data_; } bool hasData() { return hasData_; } const fml::RefPtr& response() const { return response_; } private: PlatformMessage(std::string channel, std::vector data, fml::RefPtr response); PlatformMessage(std::string channel, fml::RefPtr response); ~PlatformMessage(); std::string channel_; std::vector data_; bool hasData_; fml::RefPtr response_; }; } // namespace flutter #endif // FLUTTER_LIB_UI_PLATFORM_PLATFORM_MESSAGE_H_