Commit 6cea1c6c authored by Sergey Ulanov's avatar Sergey Ulanov Committed by Commit Bot

[Fuchsia] Fix assets loading for content_shell package.

content_shell previously was failing to find V8 natives file and resources
when packaged on Fuchsia. Update paths used to locate these assets to make
content_shell usable again.

Bug: 796779, 778467
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I257124223f953bbf048ca6ab649322e8f726bf5d
Reviewed-on: https://chromium-review.googlesource.com/865466
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532695}
parent 297366b4
......@@ -83,6 +83,10 @@
#include "components/crash/content/app/breakpad_linux.h"
#endif
#if defined(OS_FUCHSIA)
#include "base/base_paths_fuchsia.h"
#endif // OS_FUCHSIA
namespace {
#if !defined(OS_FUCHSIA)
......@@ -361,17 +365,19 @@ void ShellMainDelegate::InitializeResourceBundle() {
pak_region);
ui::ResourceBundle::GetSharedInstance().AddDataPackFromFileRegion(
base::File(pak_fd), pak_region, ui::SCALE_FACTOR_100P);
#else // defined(OS_ANDROID)
#if defined(OS_MACOSX)
base::FilePath pak_file = GetResourcesPakFilePath();
#elif defined(OS_MACOSX)
ui::ResourceBundle::InitSharedInstanceWithPakPath(GetResourcesPakFilePath());
#else
base::FilePath pak_file;
#if defined(OS_FUCHSIA)
bool r = PathService::Get(base::DIR_FUCHSIA_RESOURCES, &pak_file);
#else
bool r = PathService::Get(base::DIR_MODULE, &pak_file);
#endif
DCHECK(r);
pak_file = pak_file.Append(FILE_PATH_LITERAL("content_shell.pak"));
#endif // defined(OS_MACOSX)
ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file);
#endif // defined(OS_ANDROID)
#endif
}
ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() {
......
......@@ -34,6 +34,10 @@
#endif
#endif // V8_USE_EXTERNAL_STARTUP_DATA
#if defined(OS_FUCHSIA)
#include "base/base_paths_fuchsia.h"
#endif
namespace gin {
namespace {
......@@ -104,6 +108,8 @@ void GetV8FilePath(const char* file_name, base::FilePath* path_out) {
#if defined(OS_ANDROID)
// This is the path within the .apk.
data_path = base::FilePath(FILE_PATH_LITERAL("assets"));
#elif defined(OS_FUCHSIA)
PathService::Get(base::DIR_FUCHSIA_RESOURCES, &data_path);
#elif defined(OS_POSIX)
PathService::Get(base::DIR_EXE, &data_path);
#elif defined(OS_WIN)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment