Skip to content

Commit 90bdf10

Browse files
authored
[engine] Sync Flutter 3.32.0 source code (#93)
1 parent 3e1f8b6 commit 90bdf10

File tree

5 files changed

+269
-7
lines changed

5 files changed

+269
-7
lines changed

DEPS

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
deps = {
66
'src/third_party/rapidjson': 'https://fuchsia.googlesource.com/third_party/rapidjson@ef3564c5c8824989393b87df25355baf35ff544b',
7-
'src/third_party/libcxx': 'https://llvm.googlesource.com/llvm-project/libcxx@44079a4cc04cdeffb9cfe8067bfb3c276fb2bab0',
8-
'src/third_party/libcxxabi': 'https://llvm.googlesource.com/llvm-project/libcxxabi@2ce528fb5e0f92e57c97ec3ff53b75359d33af12',
7+
'src/third_party/libcxx': 'https://llvm.googlesource.com/llvm-project/libcxx@bd557f6f764d1e40b62528a13b124ce740624f8f',
8+
'src/third_party/libcxxabi': 'https://llvm.googlesource.com/llvm-project/libcxxabi@a4dda1589d37a7e4b4f7a81ebad01b1083f2e726',
99
'src/third_party/googletest': 'https://github.com/google/googletest@7f036c5563af7d0329f20e8bb42effb04629f0c0',
10-
'src/third_party/dart': 'https://dart.googlesource.com/sdk.git@f6ed8d7df6bfdf6fb08b38dd93c2ee1eba476b5a',
10+
'src/third_party/dart': 'https://dart.googlesource.com/sdk.git@b04011c77cd93e6ab9144af37976733b558d716c',
1111
'src/third_party/clang': {
1212
'packages': [
1313
{
@@ -21,7 +21,7 @@ deps = {
2121
'packages': [
2222
{
2323
'package': 'gn/gn/${{platform}}',
24-
'version': 'git_revision:b79031308cc878488202beb99883ec1f2efd9a6d',
24+
'version': 'git_revision:7a8aa3a08a13521336853a28c46537ec04338a2d',
2525
},
2626
],
2727
'dep_type': 'cipd',

flutter/shell/platform/common/BUILD.gn

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,23 @@ source_set("common_cpp_input") {
5454
deps = [ "//flutter/fml:fml" ]
5555
}
5656

57+
source_set("common_cpp_enums") {
58+
public = [
59+
"app_lifecycle_state.h",
60+
"platform_provided_menu.h",
61+
]
62+
63+
public_configs = [ "//flutter:config" ]
64+
}
65+
66+
source_set("common_cpp_switches") {
67+
public = [ "engine_switches.h" ]
68+
69+
sources = [ "engine_switches.cc" ]
70+
71+
public_configs = [ "//flutter:config" ]
72+
}
73+
5774
source_set("common_cpp_accessibility") {
5875
public = [
5976
"accessibility_bridge.h",
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
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_COMMON_APP_LIFECYCLE_STATE_H_
6+
#define FLUTTER_SHELL_PLATFORM_COMMON_APP_LIFECYCLE_STATE_H_
7+
8+
namespace flutter {
9+
10+
/**
11+
* These constants describe the possible lifecycle states of the application.
12+
* They must be kept up to date with changes in the framework's
13+
* AppLifecycleState enum. They are passed to the embedder's |SetLifecycleState|
14+
* function.
15+
*
16+
* States not supported on a platform will be synthesized by the framework when
17+
* transitioning between states which are supported, so that all implementations
18+
* share the same state machine.
19+
*
20+
* Here is the state machine:
21+
*
22+
* +-----------+ +-----------+
23+
* | detached |------------------------------>| resumed |
24+
* +-----------+ +-----------+
25+
* ^ ^
26+
* | |
27+
* | v
28+
* +-----------+ +--------------+ +-----------+
29+
* | paused |<------>| hidden |<----->| inactive |
30+
* +-----------+ +--------------+ +-----------+
31+
*/
32+
enum class AppLifecycleState {
33+
/**
34+
* Corresponds to the Framework's AppLifecycleState.detached: The initial
35+
* state of the state machine. On Android, iOS, and web, also the final state
36+
* of the state machine when all views are detached. Other platforms do not
37+
* re-enter this state after initially leaving it.
38+
*/
39+
kDetached,
40+
41+
/**
42+
* Corresponds to the Framework's AppLifecycleState.resumed: The nominal
43+
* "running" state of the application. The application is visible, has input
44+
* focus, and is running.
45+
*/
46+
kResumed,
47+
48+
/**
49+
* Corresponds to the Framework's AppLifecycleState.inactive: At least one
50+
* view of the application is visible, but none have input focus. The
51+
* application is otherwise running normally.
52+
*/
53+
kInactive,
54+
55+
/**
56+
* Corresponds to the Framework's AppLifecycleState.hidden: All views of an
57+
* application are hidden, either because the application is being stopped (on
58+
* iOS and Android), or because it is being minimized or on a desktop that is
59+
* no longer visible (on desktop), or on a tab that is no longer visible (on
60+
* web).
61+
*/
62+
kHidden,
63+
64+
/**
65+
* Corresponds to the Framework's AppLifecycleState.paused: The application is
66+
* not running, and can be detached or started again at any time. This state
67+
* is typically only entered into on iOS and Android.
68+
*/
69+
kPaused,
70+
};
71+
72+
constexpr const char* AppLifecycleStateToString(AppLifecycleState state) {
73+
switch (state) {
74+
case AppLifecycleState::kDetached:
75+
return "AppLifecycleState.detached";
76+
case AppLifecycleState::kResumed:
77+
return "AppLifecycleState.resumed";
78+
case AppLifecycleState::kInactive:
79+
return "AppLifecycleState.inactive";
80+
case AppLifecycleState::kHidden:
81+
return "AppLifecycleState.hidden";
82+
case AppLifecycleState::kPaused:
83+
return "AppLifecycleState.paused";
84+
}
85+
}
86+
87+
} // namespace flutter
88+
89+
#endif // FLUTTER_SHELL_PLATFORM_COMMON_APP_LIFECYCLE_STATE_H_

flutter/shell/platform/common/client_wrapper/standard_codec.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ const StandardMessageCodec& StandardMessageCodec::GetInstance(
301301
if (it == sInstances->end()) {
302302
// Uses new due to private constructor (to prevent API clients from
303303
// accidentally passing temporary codec instances to channels).
304+
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
304305
auto emplace_result = sInstances->emplace(
305306
serializer, std::unique_ptr<StandardMessageCodec>(
306307
new StandardMessageCodec(serializer)));
@@ -348,6 +349,7 @@ const StandardMethodCodec& StandardMethodCodec::GetInstance(
348349
if (it == sInstances->end()) {
349350
// Uses new due to private constructor (to prevent API clients from
350351
// accidentally passing temporary codec instances to channels).
352+
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
351353
auto emplace_result = sInstances->emplace(
352354
serializer, std::unique_ptr<StandardMethodCodec>(
353355
new StandardMethodCodec(serializer)));

0 commit comments

Comments
 (0)