Import Cobalt 22.lts.2.305573
diff --git a/src/cobalt/build/build.id b/src/cobalt/build/build.id
index 52c4c5d..a003887 100644
--- a/src/cobalt/build/build.id
+++ b/src/cobalt/build/build.id
@@ -1 +1 @@
-305559
\ No newline at end of file
+305573
\ No newline at end of file
diff --git a/src/cobalt/updater/utils.h b/src/cobalt/updater/utils.h
index 3ca7793..5efa2db 100644
--- a/src/cobalt/updater/utils.h
+++ b/src/cobalt/updater/utils.h
@@ -1,4 +1,4 @@
-// Copyright 2019 The Chromium Authors. All rights reserved.
+// Copyright 2021 The Cobalt Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
diff --git a/src/starboard/build/doc/gn_migrate_stub_to_platform.md b/src/starboard/build/doc/gn_migrate_stub_to_platform.md
index f07e338..2f16d36 100644
--- a/src/starboard/build/doc/gn_migrate_stub_to_platform.md
+++ b/src/starboard/build/doc/gn_migrate_stub_to_platform.md
@@ -13,10 +13,10 @@
Here are the steps to do your migration:
1. [Copy stub files over to your platform and build them](#copy-stub-files-over-to-your-platform-and-build-them).
-2. [Replace stub toolchain with your platform's toolchain](#replace-stub-toolchain-with-your-platforms-toolchain).
-3. [Replace stub configuration with your platform's configuration](#replace-stub-configuration-with-your-platforms-configuration).
+2. [Replace stub toolchain with your platform's toolchain](#replace-stub-toolchain).
+3. [Replace stub configuration with your platform's configuration](#replace-stub-configuration).
4. [Replace stubbed starboard_platform target sources with your platform's
- sources](#replace-stubbed-starboardplatform-sources-with-your-platforms-sources).
+ sources](#replace-stubbed-starboard).
After each step, you should be able to build the starboard_platform target.
For example, you would build raspi2 starboard_platform target with the following
@@ -43,21 +43,21 @@
* starboard/stub/toolchain/BUILD.gn >
starboard/YOUR_PLATFORM/toolchain/BUILD.gn
2. Add your platform path to starboard/build/platforms.gni as referenced
- [here](../migrating_gyp_to_gn.md#adding-your-platform-to-starboard)
+ [here](./migrating_gyp_to_gn.md#adding-your-platform-to-starboard)
3. Resolve any errors which come up for missing/incorrect file paths. Then, you
should be able to build your platform target with the stubbed out files
suggested in the above section.
-### Replace Stub Toolchain with Your Platform's Toolchain
+### Replace Stub Toolchain with Your Platform's Toolchain {#replace-stub-toolchain}
-Follow instructions [here](../migrating_gyp_to_gn.md#migrating-a-toolchain) for
+Follow instructions [here](./migrating_gyp_to_gn.md#migrating-a-toolchain) for
migrating the toolchain. Resolve errors and build the starboard_platform target
with the stubbed files.
-### Replace Stub Configuration with Your Platform's Configuration
+### Replace Stub Configuration with Your Platform's Configuration {#replace-stub-configuration}
This involves migrating the compiler flags and build variables as referenced
-[here](../migrating_gyp_to_gn.md#migrating-a-platform).
+[here](./migrating_gyp_to_gn.md#migrating-a-platform).
> **Highly recommended** \
> It’s good to turn off the `treat_warnings_as_errors flag` until you can compile
@@ -74,10 +74,10 @@
Resolve errors and build the starboard_platform target with the stubbed files.
-### Replace Stubbed starboard_platform Sources with Your Platform's Sources
+### Replace Stubbed starboard_platform Sources with Your Platform's Sources {#replace-stubbed-starboard}
This involves adding files for the starboard_platform target as suggested
-[here](../migrating_gyp_to_gn.md#migrating-a-platform).
+[here](./migrating_gyp_to_gn.md#migrating-a-platform).
While building any target, follow the recommendation above of building the
target with `treat_warnings_as_errors=false`.
@@ -114,9 +114,9 @@
* Are the compiler flags for this file the same as in GYP ?
> To compare flags for GYP vs GN refer
- > [section](../migrating_gyp_to_gn.md#validating-a-target). To check if
+ > [section](./migrating_gyp_to_gn.md#validating-a-target). To check if
> the variables/flags you are compiling have changed since GYP, refer
- > [page](../migration_changes.md).
+ > [page](./migration_changes.md).
* Have you passed in the default arguments for your platform correctly?
diff --git a/src/starboard/build/doc/migrating_gyp_to_gn.md b/src/starboard/build/doc/migrating_gyp_to_gn.md
index c6d06b6..5834300 100644
--- a/src/starboard/build/doc/migrating_gyp_to_gn.md
+++ b/src/starboard/build/doc/migrating_gyp_to_gn.md
@@ -79,7 +79,8 @@
```
You also may need to remove default configs. The default configs are listed in
-[BUILDCONFIG.gn](../config/BUILDCONFIG.gn). You remove a config like so:
+[BUILDCONFIG.gn](https://cobalt.googlesource.com/cobalt/+/refs/heads/master/src/starboard/build/config/BUILDCONFIG.gn).
+You remove a config like so:
```
static_library("foo") {
@@ -144,8 +145,9 @@
Instead of implicitly searching directories for certain files like GYP did, we
explicitly enumerate our ports and their locations.
-[platforms.gni](../platforms.gni) contains all of this information, and you'll
-need to add your platform to that list following the same format.
+[platforms.gni](https://cobalt.googlesource.com/cobalt/+/refs/heads/master/src/starboard/build/platforms.gni)
+contains all of this information, and you'll need to add your platform to that
+list following the same format.
### Migrating a Family of Platforms
@@ -171,10 +173,10 @@
You may define a toolchain from scratch following the [reference][gn_toolchain],
or you can use the
-[gcc/clang templates](../../../build/toolchain/gcc_toolchain.gni) provided.
-Almost all of the reference platforms use these templates, so look to those as
-examples for how to use it correctly. Here's the linux-x64x11
-[toolchain/BUILD.gn file](../../linux/x64x11/toolchain/BUILD.gn).
+[gcc/clang templates](https://cobalt.googlesource.com/cobalt/+/refs/heads/master/src/build/toolchain/gcc_toolchain.gni)
+provided. Almost all of the reference platforms use these templates, so look to
+those as examples for how to use it correctly. Here's the linux-x64x11
+[toolchain/BUILD.gn file](https://cobalt.googlesource.com/cobalt/+/refs/heads/master/src/starboard/linux/x64x11/toolchain/BUILD.gn).
## Checking Your Migration
@@ -199,29 +201,36 @@
```
If this was equivalent to a GYP target, you can compare the ninja compilation
-databases by using [format_ninja.py](../../../tools/format_ninja.py) and a
-comparison tool, i.e. [meld](https://meldmerge.org/). This will allow you to see
-any changes in commands, i.e. with flags or otherwise.
+databases by using
+[format_ninja.py](https://cobalt.googlesource.com/cobalt/+/refs/heads/master/src/tools/format_ninja.py)
+and a comparison tool, i.e. [meld](https://meldmerge.org/). This will allow you
+to see any changes in commands, i.e. with flags or otherwise.
The following differences for ninja flags between GYP and GN don't cause any
issues:
-1. The name of the intermediate .o, .d files is different in both cases: Here is
- an example while compiling the same source file
- ```
- starboard/common/new.cc
- ```
- GYP generates:
- ```
- obj/starboard/common/common.new.cc.o
- ```
- GN generates:
- ```
- obj/starboard/common/common/new.o
- ```
-2. The `-x` flag for specifying language is not present in GN migration.
- For example GYP specifies `-x c` flag while building c language files for
- certain targets. This flag is not specified while building any GN targets.
+1. The name of the intermediate .o, .d files is different in both cases: Here
+ is an example while compiling the same source file
+
+ ```
+ starboard/common/new.cc
+ ```
+
+ GYP generates:
+
+ ```
+ obj/starboard/common/common.new.cc.o
+ ```
+
+ GN generates:
+
+ ```
+ obj/starboard/common/common/new.o
+ ```
+
+1. The `-x` flag for specifying language is not present in GN migration. For
+ example GYP specifies `-x c` flag while building c language files for
+ certain targets. This flag is not specified while building any GN targets.
### Validating a Platform
@@ -236,7 +245,7 @@
### Step by Step Stub to Your Platform Migration Guide
-This [document](../gn_migrate_stub_to_platform.md) outlines a step by step
+This [document](./gn_migrate_stub_to_platform.md) outlines a step by step
process for converting the stub platform's GN files to GN files that will be
able to be built for your platform.
diff --git a/src/starboard/shared/starboard/application.cc b/src/starboard/shared/starboard/application.cc
index c54fa31..2d34e10 100644
--- a/src/starboard/shared/starboard/application.cc
+++ b/src/starboard/shared/starboard/application.cc
@@ -239,7 +239,7 @@
SB_DCHECK(state_ == kStateUnstarted);
DispatchAndDelete(CreateInitialEvent(kSbEventTypeStart, timestamp));
}
-#else // SB_API_VERSION >= 13
+#else // SB_API_VERSION >= 13
void Application::DispatchStart() {
SB_DCHECK(IsCurrentThread());
SB_DCHECK(state_ == kStateUnstarted || state_ == kStatePreloading);
@@ -253,7 +253,7 @@
SB_DCHECK(state_ == kStateUnstarted);
DispatchAndDelete(CreateInitialEvent(kSbEventTypePreload, timestamp));
}
-#else // SB_API_VERSION >= 13
+#else // SB_API_VERSION >= 13
void Application::DispatchPreload() {
SB_DCHECK(IsCurrentThread());
SB_DCHECK(state_ == kStateUnstarted);
@@ -334,7 +334,6 @@
case kStateStopped:
return true;
case kStateFrozen:
- OnResume();
Inject(new Event(kSbEventTypeUnfreeze, timestamp, NULL, NULL));
Inject(scoped_event.release());
return true;
@@ -370,6 +369,7 @@
case kStateStopped:
return true;
case kStateFrozen:
+ OnResume();
break;
case kStateConcealed:
case kStateBlurred:
@@ -585,7 +585,7 @@
#if SB_API_VERSION >= 13
Application::Event* Application::CreateInitialEvent(SbEventType type,
SbTimeMonotonic timestamp) {
-#else // SB_API_VERSION >= 13
+#else // SB_API_VERSION >= 13
Application::Event* Application::CreateInitialEvent(SbEventType type) {
#endif // SB_API_VERSION >= 13
SB_DCHECK(type == kSbEventTypePreload || type == kSbEventTypeStart);
@@ -615,8 +615,8 @@
} else if (IsStartImmediate()) {
DispatchStart(SbTimeGetMonotonicNow());
}
-#else // SB_API_VERSION >= 13
- if (IsPreloadImmediate()) {
+#else // SB_API_VERSION >= 13
+ if (IsPreloadImmediate()) {
DispatchPreload();
} else if (IsStartImmediate()) {
DispatchStart();