Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

deps = {
'src/third_party/rapidjson': 'https://fuchsia.googlesource.com/third_party/rapidjson@ef3564c5c8824989393b87df25355baf35ff544b',
'src/third_party/libcxx': 'https://llvm.googlesource.com/llvm-project/libcxx@44079a4cc04cdeffb9cfe8067bfb3c276fb2bab0',
'src/third_party/libcxxabi': 'https://llvm.googlesource.com/llvm-project/libcxxabi@2ce528fb5e0f92e57c97ec3ff53b75359d33af12',
'src/third_party/libcxx': 'https://llvm.googlesource.com/llvm-project/libcxx@bd557f6f764d1e40b62528a13b124ce740624f8f',
'src/third_party/libcxxabi': 'https://llvm.googlesource.com/llvm-project/libcxxabi@a4dda1589d37a7e4b4f7a81ebad01b1083f2e726',
'src/third_party/googletest': 'https://github.com/google/googletest@7f036c5563af7d0329f20e8bb42effb04629f0c0',
'src/third_party/dart': 'https://dart.googlesource.com/sdk.git@f6ed8d7df6bfdf6fb08b38dd93c2ee1eba476b5a',
'src/third_party/dart': 'https://dart.googlesource.com/sdk.git@b04011c77cd93e6ab9144af37976733b558d716c',
'src/third_party/clang': {
'packages': [
{
Expand All @@ -21,7 +21,7 @@ deps = {
'packages': [
{
'package': 'gn/gn/${{platform}}',
'version': 'git_revision:b79031308cc878488202beb99883ec1f2efd9a6d',
'version': 'git_revision:7a8aa3a08a13521336853a28c46537ec04338a2d',
},
],
'dep_type': 'cipd',
Expand Down
17 changes: 17 additions & 0 deletions flutter/shell/platform/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,23 @@ source_set("common_cpp_input") {
deps = [ "//flutter/fml:fml" ]
}

source_set("common_cpp_enums") {
public = [
"app_lifecycle_state.h",
"platform_provided_menu.h",
]

public_configs = [ "//flutter:config" ]
}

source_set("common_cpp_switches") {
public = [ "engine_switches.h" ]

sources = [ "engine_switches.cc" ]

public_configs = [ "//flutter:config" ]
}

source_set("common_cpp_accessibility") {
public = [
"accessibility_bridge.h",
Expand Down
89 changes: 89 additions & 0 deletions flutter/shell/platform/common/app_lifecycle_state.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
// 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_SHELL_PLATFORM_COMMON_APP_LIFECYCLE_STATE_H_
#define FLUTTER_SHELL_PLATFORM_COMMON_APP_LIFECYCLE_STATE_H_

namespace flutter {

/**
* These constants describe the possible lifecycle states of the application.
* They must be kept up to date with changes in the framework's
* AppLifecycleState enum. They are passed to the embedder's |SetLifecycleState|
* function.
*
* States not supported on a platform will be synthesized by the framework when
* transitioning between states which are supported, so that all implementations
* share the same state machine.
*
* Here is the state machine:
*
* +-----------+ +-----------+
* | detached |------------------------------>| resumed |
* +-----------+ +-----------+
* ^ ^
* | |
* | v
* +-----------+ +--------------+ +-----------+
* | paused |<------>| hidden |<----->| inactive |
* +-----------+ +--------------+ +-----------+
*/
enum class AppLifecycleState {
/**
* Corresponds to the Framework's AppLifecycleState.detached: The initial
* state of the state machine. On Android, iOS, and web, also the final state
* of the state machine when all views are detached. Other platforms do not
* re-enter this state after initially leaving it.
*/
kDetached,

/**
* Corresponds to the Framework's AppLifecycleState.resumed: The nominal
* "running" state of the application. The application is visible, has input
* focus, and is running.
*/
kResumed,

/**
* Corresponds to the Framework's AppLifecycleState.inactive: At least one
* view of the application is visible, but none have input focus. The
* application is otherwise running normally.
*/
kInactive,

/**
* Corresponds to the Framework's AppLifecycleState.hidden: All views of an
* application are hidden, either because the application is being stopped (on
* iOS and Android), or because it is being minimized or on a desktop that is
* no longer visible (on desktop), or on a tab that is no longer visible (on
* web).
*/
kHidden,

/**
* Corresponds to the Framework's AppLifecycleState.paused: The application is
* not running, and can be detached or started again at any time. This state
* is typically only entered into on iOS and Android.
*/
kPaused,
};

constexpr const char* AppLifecycleStateToString(AppLifecycleState state) {
switch (state) {
case AppLifecycleState::kDetached:
return "AppLifecycleState.detached";
case AppLifecycleState::kResumed:
return "AppLifecycleState.resumed";
case AppLifecycleState::kInactive:
return "AppLifecycleState.inactive";
case AppLifecycleState::kHidden:
return "AppLifecycleState.hidden";
case AppLifecycleState::kPaused:
return "AppLifecycleState.paused";
}
}

} // namespace flutter

#endif // FLUTTER_SHELL_PLATFORM_COMMON_APP_LIFECYCLE_STATE_H_
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ const StandardMessageCodec& StandardMessageCodec::GetInstance(
if (it == sInstances->end()) {
// Uses new due to private constructor (to prevent API clients from
// accidentally passing temporary codec instances to channels).
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
auto emplace_result = sInstances->emplace(
serializer, std::unique_ptr<StandardMessageCodec>(
new StandardMessageCodec(serializer)));
Expand Down Expand Up @@ -348,6 +349,7 @@ const StandardMethodCodec& StandardMethodCodec::GetInstance(
if (it == sInstances->end()) {
// Uses new due to private constructor (to prevent API clients from
// accidentally passing temporary codec instances to channels).
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
auto emplace_result = sInstances->emplace(
serializer, std::unique_ptr<StandardMethodCodec>(
new StandardMethodCodec(serializer)));
Expand Down
Loading