Flutter Engine
connection_collection.mm
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 #import "flutter/shell/platform/darwin/ios/framework/Source/connection_collection.h"
6 
7 namespace flutter {
9  Connection nextConnection = ++counter_;
10  connections_[name] = nextConnection;
11  return nextConnection;
12 }
13 
15  if (connection > 0) {
16  std::string channel;
17  for (auto& keyValue : connections_) {
18  if (keyValue.second == connection) {
19  channel = keyValue.first;
20  break;
21  }
22  }
23  if (channel.length() > 0) {
24  connections_.erase(channel);
25  return channel;
26  }
27  }
28  return "";
29 }
30 
32  return connection > 0;
33 }
34 
36  if (errCode < 0) {
37  return -1 * errCode;
38  }
39  return errCode;
40 }
41 
42 } // namespace flutter
std::string CleanupConnection(Connection connection)
static bool IsValidConnection(Connection connection)
const char * name
Definition: fuchsia.cc:50
static Connection MakeErrorConnection(int errCode)
Connection AquireConnection(const std::string &name)