flutter_flutter/lib/ui/window/platform_message.h
Chinmay Garde eec74e5c92
Rename the blink namespace to flutter. (#8517)
Some components in the Flutter engine were derived from the forked blink codebase. While the forked components have either been removed or rewritten, the use of the blink namespace has mostly (and inconsistently) remained. This renames the blink namesapce to flutter for consistency. There are no functional changes in this patch.
2019-04-09 12:44:42 -07:00

47 lines
1.4 KiB
C++

// 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 <string>
#include <vector>
#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<PlatformMessage> {
FML_FRIEND_REF_COUNTED_THREAD_SAFE(PlatformMessage);
FML_FRIEND_MAKE_REF_COUNTED(PlatformMessage);
public:
const std::string& channel() const { return channel_; }
const std::vector<uint8_t>& data() const { return data_; }
bool hasData() { return hasData_; }
const fml::RefPtr<PlatformMessageResponse>& response() const {
return response_;
}
private:
PlatformMessage(std::string name,
std::vector<uint8_t> data,
fml::RefPtr<PlatformMessageResponse> response);
PlatformMessage(std::string name,
fml::RefPtr<PlatformMessageResponse> response);
~PlatformMessage();
std::string channel_;
std::vector<uint8_t> data_;
bool hasData_;
fml::RefPtr<PlatformMessageResponse> response_;
};
} // namespace flutter
#endif // FLUTTER_LIB_UI_PLATFORM_PLATFORM_MESSAGE_H_