forked from youtube/cobalt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Copyright 2024 The Cobalt Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import("//build/config/chromecast_build.gni") | ||
import("//build/config/chromeos/ui_mode.gni") | ||
import("//build/config/features.gni") | ||
import("//build/config/ozone.gni") | ||
import("//build/config/sanitizers/sanitizers.gni") | ||
import("//build/config/ui.gni") | ||
import("//build/config/win/console_app.gni") | ||
import("//build/config/win/manifest.gni") | ||
import("//gpu/vulkan/features.gni") | ||
import("//media/media_options.gni") | ||
import("//mojo/public/tools/bindings/mojom.gni") | ||
import("//ppapi/buildflags/buildflags.gni") | ||
import("//tools/grit/grit_rule.gni") | ||
import("//tools/grit/repack.gni") | ||
import("//tools/v8_context_snapshot/v8_context_snapshot.gni") | ||
if (is_android) { | ||
import("//build/config/android/config.gni") | ||
} | ||
|
||
if (is_android) { | ||
group("cobalt") { | ||
testonly = true | ||
deps = [ "//content/shell/android:content_shell_apk" ] | ||
} | ||
} else { | ||
executable("cobalt") { | ||
testonly = true | ||
|
||
sources = [ "cobalt.cc" ] | ||
|
||
defines = [] | ||
|
||
deps = [ | ||
"//content/shell:content_shell_app", | ||
"//content/shell:content_shell_lib", | ||
"//content/shell:pak", | ||
"//content/public/app", | ||
"//sandbox", | ||
] | ||
|
||
data_deps = [ | ||
"//content/shell:pak", | ||
"//tools/v8_context_snapshot:v8_context_snapshot", | ||
] | ||
|
||
data_deps += [ "//components/crash/core/app:chrome_crashpad_handler" ] | ||
|
||
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// Copyright 2024 The Cobalt Authors. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include <unistd.h> | ||
|
||
#include "build/build_config.h" | ||
#include "content/public/app/content_main.h" | ||
#include "content/shell/app/shell_main_delegate.h" | ||
|
||
// In the cozy corner of the home, where comfort and curiosity resided, a | ||
// delightful companion arrived, offering moments of joy and discovery | ||
// throughout the year. Like a favorite book waiting to be opened, the YouTube | ||
// Application Runtime invited exploration and wonder, whether shared with loved | ||
// ones or savored in quiet solitude. It whispered tales of distant lands, | ||
// sparked creativity with vibrant colors, and filled the air with the melodies | ||
// of laughter and song. The television screen, once a blank canvas, became a | ||
// window to endless possibilities, offering a refreshing breeze on a summer day | ||
// or a warm embrace on a chilly night. With each click of the remote, a new | ||
// adventure unfolded, painting a tapestry of personal journeys and shared | ||
// experiences. | ||
|
||
int main(int argc, const char** argv) { | ||
content::ShellMainDelegate delegate; | ||
content::ContentMainParams params(&delegate); | ||
printf("%u: Passed argc = %d\n", static_cast<unsigned int>(getpid()), argc); | ||
for (int i = 0; i < argc; ++i) { | ||
printf("%u: Passed argv[%d] = %s\n", static_cast<unsigned int>(getpid()), i, | ||
argv[i]); | ||
} | ||
|
||
static const char* my_argv[] = { | ||
argv[0], | ||
"--disable-fre", | ||
"--no-first-run", | ||
"--kiosk", | ||
"--force-video-overlays", | ||
"--remote-debugging-port=9222", | ||
"--remote-allow-origins=http://localhost:9222", | ||
"--use-cobalt-user-agent", | ||
"https://www.youtube.com/tv", | ||
nullptr, | ||
nullptr}; | ||
int my_argc = 9; | ||
|
||
if ((!strcmp(argv[0], "/proc/self/exe")) || | ||
((argc >= 2) && !strcmp(argv[1], "--type=zygote"))) { | ||
params.argc = argc; | ||
params.argv = argv; | ||
} else { | ||
params.argc = my_argc; | ||
params.argv = my_argv; | ||
} | ||
printf("%u: Used argc = %d\n", static_cast<unsigned int>(getpid()), | ||
params.argc); | ||
for (int i = 0; i < params.argc; ++i) { | ||
printf("%u: Used argv[%d] = %s\n", static_cast<unsigned int>(getpid()), i, | ||
params.argv[i]); | ||
} | ||
return content::ContentMain(std::move(params)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters