Flutter Engine
The Flutter Engine
platform_message.h
Go to the documentation of this file.
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_LIB_UI_WINDOW_PLATFORM_MESSAGE_H_
6#define FLUTTER_LIB_UI_WINDOW_PLATFORM_MESSAGE_H_
7
8#include <string>
9#include <vector>
10
11#include "flutter/fml/memory/ref_counted.h"
12#include "flutter/fml/memory/ref_ptr.h"
13#include "flutter/lib/ui/window/platform_message_response.h"
14
15namespace flutter {
16
18 public:
19 PlatformMessage(std::string channel,
22 PlatformMessage(std::string channel,
25
26 const std::string& channel() const { return channel_; }
27 const fml::MallocMapping& data() const { return data_; }
28 bool hasData() { return has_data_; }
29
31 return response_;
32 }
33
34 fml::MallocMapping releaseData() { return std::move(data_); }
35
36 private:
37 std::string channel_;
39 bool has_data_;
41};
42
43} // namespace flutter
44
45#endif // FLUTTER_LIB_UI_WINDOW_PLATFORM_MESSAGE_H_
const std::string & channel() const
fml::MallocMapping releaseData()
const fml::RefPtr< PlatformMessageResponse > & response() const
const fml::MallocMapping & data() const
PlatformMessage(std::string channel, fml::MallocMapping data, fml::RefPtr< PlatformMessageResponse > response)
A Mapping like NonOwnedMapping, but uses Free as its release proc.
Definition: mapping.h:144