Skip to content

Commit

Permalink
Revert 216822 "Remove chrome.pak references, build resources int..."
Browse files Browse the repository at this point in the history
Broke a variety of Linux, CrOS, and Android bots:

ninja: error: 'gen/repack/chrome.pak', needed by 'chrome.pak', missing and no
known rule to make it

> Remove chrome.pak references, build resources into resources.pak
> 
> This puts resources that used to be in chrome.pak and/or compiled in to
> chrome.dll into resources.pak. resources.pak is already loaded at startup
> on all platforms so having some resources in a separate pak file isn't
> beneficial.
> 
> R=tony
> TBR=sky
> 
> BUG=52609
> 
> Review URL: https://chromiumcodereview.appspot.com/22339020

TBR=jamesr@chromium.org

Review URL: https://codereview.chromium.org/22557005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216823 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
thestig@chromium.org committed Aug 10, 2013
1 parent 3fb8b90 commit f6d7f8b
Show file tree
Hide file tree
Showing 24 changed files with 84 additions and 18 deletions.
1 change: 1 addition & 0 deletions ash/ash.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@
'shell/cocoa/app-Info.plist',
'shell/cocoa/nibs/MainMenu.xib',
'shell/cocoa/nibs/RootWindow.xib',
'<(SHARED_INTERMEDIATE_DIR)/repack/chrome.pak',
'<!@pymod_do_main(repack_locales -o -p <(OS) -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(SHARED_INTERMEDIATE_DIR) <(locales))',
],
'mac_bundle_resources!': [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class ChromiumTestShellApplication extends Application {
private static final String TAG = "ChromiumTestShellApplication";
private static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "chromiumtestshell";
private static final String[] CHROME_MANDATORY_PAKS = {
"chrome.pak",
"en-US.pak",
"resources.pak",
"chrome_100_percent.pak",
Expand Down
1 change: 1 addition & 0 deletions chrome/app/chrome_main_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
ResourceBundle::InitSharedInstanceWithPakFile(locale_pak_fd, false);

int extra_pak_keys[] = {
kAndroidChromePakDescriptor,
kAndroidChrome100PercentPakDescriptor,
kAndroidUIResourcesPakDescriptor,
};
Expand Down
10 changes: 8 additions & 2 deletions chrome/browser/chrome_content_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2465,10 +2465,16 @@ void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
DCHECK(!data_path.empty());

int flags = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ;
base::FilePath chrome_pak = data_path.AppendASCII("chrome.pak");
base::PlatformFile f =
base::CreatePlatformFile(chrome_pak, flags, NULL, NULL);
DCHECK(f != base::kInvalidPlatformFileValue);
mappings->push_back(FileDescriptorInfo(kAndroidChromePakDescriptor,
FileDescriptor(f, true)));

base::FilePath chrome_resources_pak =
data_path.AppendASCII("chrome_100_percent.pak");
base::PlatformFile f =
base::CreatePlatformFile(chrome_resources_pak, flags, NULL, NULL);
f = base::CreatePlatformFile(chrome_resources_pak, flags, NULL, NULL);
DCHECK(f != base::kInvalidPlatformFileValue);
mappings->push_back(FileDescriptorInfo(kAndroidChrome100PercentPakDescriptor,
FileDescriptor(f, true)));
Expand Down
1 change: 1 addition & 0 deletions chrome/browser_tests.isolate
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
],
'isolate_dependency_tracked': [
'../testing/xvfb.py',
'<(PRODUCT_DIR)/chrome.pak',
'<(PRODUCT_DIR)/chrome<(EXECUTABLE_SUFFIX)',
'<(PRODUCT_DIR)/libclearkeycdm.so',
'<(PRODUCT_DIR)/libclearkeycdmadapter.so',
Expand Down
1 change: 1 addition & 0 deletions chrome/chrome.isolate
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
['OS=="linux"', {
'variables': {
'isolate_dependency_tracked': [
'<(PRODUCT_DIR)/chrome.pak',
'<(PRODUCT_DIR)/libclearkeycdm.so',
'<(PRODUCT_DIR)/libclearkeycdmadapter.so',
'<(PRODUCT_DIR)/libffmpegsumo.so',
Expand Down
1 change: 1 addition & 0 deletions chrome/chrome_android_paks.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
'variables': {
'chrome_android_pak_output_folder': '<@(PRODUCT_DIR)/../assets/<(package_name)',
'chrome_android_pak_input_resources': [
'<(PRODUCT_DIR)/chrome.pak',
'<(PRODUCT_DIR)/resources.pak',
'<(PRODUCT_DIR)/chrome_100_percent.pak',
'<(PRODUCT_DIR)/locales/am.pak',
Expand Down
1 change: 1 addition & 0 deletions chrome/chrome_dll_bundle.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
'app/theme/menu_overflow_down.pdf',
'app/theme/menu_overflow_up.pdf',
'browser/mac/install.sh',
'<(SHARED_INTERMEDIATE_DIR)/repack/chrome.pak',
'<(SHARED_INTERMEDIATE_DIR)/repack/chrome_100_percent.pak',
'<(SHARED_INTERMEDIATE_DIR)/repack/resources.pak',
'<!@pymod_do_main(repack_locales -o -p <(OS) -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(SHARED_INTERMEDIATE_DIR) <(locales))',
Expand Down
1 change: 1 addition & 0 deletions chrome/chrome_installer.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@
# TODO(mmoss) Any convenient way to get all the relevant build
# files? (e.g. all locales, resources, etc.)
'<(PRODUCT_DIR)/chrome',
'<(PRODUCT_DIR)/chrome.pak',
'<(PRODUCT_DIR)/chrome_sandbox',
'<(PRODUCT_DIR)/libffmpegsumo.so',
'<(PRODUCT_DIR)/libppGoogleNaClPluginChrome.so',
Expand Down
1 change: 1 addition & 0 deletions chrome/chrome_ios_bundle_resources.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
'<(DEPTH)/chrome/chrome_resources.gyp:packed_extra_resources',
],
'mac_bundle_resources': [
'<(SHARED_INTERMEDIATE_DIR)/repack/chrome.pak',
'<(SHARED_INTERMEDIATE_DIR)/repack/chrome_100_percent.pak',
'<(SHARED_INTERMEDIATE_DIR)/repack/chrome_200_percent.pak',
'<(SHARED_INTERMEDIATE_DIR)/repack/resources.pak',
Expand Down
36 changes: 36 additions & 0 deletions chrome/chrome_repack_chrome.gypi
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'action_name': 'repack_chrome',
'variables': {
'pak_inputs': [
'<(grit_out_dir)/browser_resources.pak',
'<(grit_out_dir)/common_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/chrome/chrome_unscaled_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
],
'conditions': [
['OS != "ios"', {
'pak_inputs': [
'<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/tracing_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/webkit/blink_resources.pak',
],
}],
['enable_extensions==1', {
'pak_inputs': [
'<(grit_out_dir)/extensions_api_resources.pak',
],
}],
],
},
'inputs': [
'<(repack_path)',
'<@(pak_inputs)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/repack/chrome.pak',
],
'action': ['python', '<(repack_path)', '<@(_outputs)', '<@(pak_inputs)'],
}
18 changes: 3 additions & 15 deletions chrome/chrome_repack_resources.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,14 @@
'action_name': 'repack_resources',
'variables': {
'pak_inputs': [
'<(SHARED_INTERMEDIATE_DIR)/chrome/chrome_unscaled_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/webui_resources.pak',
'<(grit_out_dir)/browser_resources.pak',
'<(grit_out_dir)/common_resources.pak',
'<(grit_out_dir)/memory_internals_resources.pak',
'<(grit_out_dir)/net_internals_resources.pak',
'<(grit_out_dir)/signin_internals_resources.pak',
'<(grit_out_dir)/sync_internals_resources.pak',
'<(grit_out_dir)/translate_internals_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/webui_resources.pak',
],
'conditions': [
['OS != "ios"', {
'pak_inputs': [
'<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/tracing_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/webkit/blink_resources.pak',
'<(grit_out_dir)/devtools_discovery_page_resources.pak',
],
}],
['OS != "ios" and OS != "android"', {
# New paks should be added here by default.
'pak_inputs': [
Expand All @@ -35,9 +23,9 @@
'<(grit_out_dir)/sync_file_system_internals_resources.pak',
],
}],
['enable_extensions==1', {
['OS != "ios"', {
'pak_inputs': [
'<(grit_out_dir)/extensions_api_resources.pak',
'<(grit_out_dir)/devtools_discovery_page_resources.pak',
],
}],
],
Expand Down
3 changes: 3 additions & 0 deletions chrome/chrome_resources.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@
'<(DEPTH)/ui/ui.gyp:ui_resources',
],
'actions': [
{
'includes': ['chrome_repack_chrome.gypi']
},
{
'includes': ['chrome_repack_locales.gypi']
},
Expand Down
3 changes: 2 additions & 1 deletion chrome/common/descriptors_android.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

enum {
#if defined(OS_ANDROID)
kAndroidLocalePakDescriptor = kContentIPCDescriptorMax + 1,
kAndroidChromePakDescriptor = kContentIPCDescriptorMax + 1,
kAndroidLocalePakDescriptor,
kAndroidChrome100PercentPakDescriptor,
kAndroidUIResourcesPakDescriptor,
kAndroidMinidumpDescriptor,
Expand Down
1 change: 1 addition & 0 deletions chrome/interactive_ui_tests.isolate
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
],
'isolate_dependency_tracked': [
'../testing/xvfb.py',
'<(PRODUCT_DIR)/chrome.pak',
'<(PRODUCT_DIR)/libffmpegsumo.so',
'<(PRODUCT_DIR)/pyproto/google/__init__.py',
'<(PRODUCT_DIR)/xdisplaycheck<(EXECUTABLE_SUFFIX)',
Expand Down
1 change: 1 addition & 0 deletions chrome/sync_integration_tests.isolate
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'isolate_dependency_tracked': [
'../testing/test_env.py',
'../testing/xvfb.py',
'<(PRODUCT_DIR)/chrome.pak',
'<(PRODUCT_DIR)/chrome_100_percent.pak',
'<(PRODUCT_DIR)/libffmpegsumo.so',
'<(PRODUCT_DIR)/libppGoogleNaClPluginChrome.so',
Expand Down
4 changes: 4 additions & 0 deletions chrome/tools/build/chromeos/FILES.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ FILES = [
'filename': 'chrome-wrapper',
'buildtype': ['dev', 'official'],
},
{
'filename': 'chrome.pak',
'buildtype': ['dev', 'official'],
},
{
'filename': 'chrome_100_percent.pak',
'buildtype': ['dev', 'official'],
Expand Down
4 changes: 4 additions & 0 deletions chrome/tools/build/linux/FILES.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ FILES = [
'filename': 'chrome-wrapper',
'buildtype': ['dev', 'official'],
},
{
'filename': 'chrome.pak',
'buildtype': ['dev', 'official'],
},
{
'filename': 'chrome_100_percent.pak',
'buildtype': ['dev', 'official'],
Expand Down
3 changes: 3 additions & 0 deletions chrome/unit_tests.isolate
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
'conditions': [
['OS=="android" or OS=="linux"', {
'variables': {
'isolate_dependency_tracked': [
'<(PRODUCT_DIR)/chrome.pak',
],
'isolate_dependency_untracked': [
'<(PRODUCT_DIR)/test_data/',
],
Expand Down
2 changes: 2 additions & 0 deletions ui/base/resource/resource_bundle_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ namespace ui {
void ResourceBundle::LoadCommonResources() {
base::FilePath path;
PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &path);
AddDataPackFromPath(path.AppendASCII("chrome.pak"),
SCALE_FACTOR_NONE);
AddDataPackFromPath(path.AppendASCII("chrome_100_percent.pak"),
SCALE_FACTOR_100P);
}
Expand Down
3 changes: 3 additions & 0 deletions ui/base/resource/resource_bundle_auralinux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ void ResourceBundle::LoadCommonResources() {
// Always load the 1x data pack first as the 2x data pack contains both 1x and
// 2x images. The 1x data pack only has 1x images, thus passes in an accurate
// scale factor to gfx::ImageSkia::AddRepresentation.

AddDataPackFromPath(GetResourcesPakFilePath("chrome.pak"),
SCALE_FACTOR_NONE);
AddDataPackFromPath(GetResourcesPakFilePath(
"chrome_100_percent.pak"), SCALE_FACTOR_100P);

Expand Down
2 changes: 2 additions & 0 deletions ui/base/resource/resource_bundle_gtk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ base::FilePath GetResourcesPakFilePath(const std::string& pak_name) {
} // namespace

void ResourceBundle::LoadCommonResources() {
AddDataPackFromPath(GetResourcesPakFilePath("chrome.pak"),
SCALE_FACTOR_NONE);
AddDataPackFromPath(GetResourcesPakFilePath(
"chrome_100_percent.pak"),
SCALE_FACTOR_100P);
Expand Down
2 changes: 2 additions & 0 deletions ui/base/resource/resource_bundle_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
} // namespace

void ResourceBundle::LoadCommonResources() {
AddDataPackFromPath(GetResourcesPakFilePath(@"chrome", nil),
SCALE_FACTOR_NONE);
AddDataPackFromPath(GetResourcesPakFilePath(@"chrome_100_percent",
nil), SCALE_FACTOR_100P);
AddDataPackFromPath(GetResourcesPakFilePath(@"webkit_resources_100_percent",
Expand Down
1 change: 1 addition & 0 deletions ui/ui_unittests.isolate
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
'variables': {
'isolate_dependency_tracked': [
'base/test/data/data_pack_unittest/truncated-header.pak',
'<(PRODUCT_DIR)/chrome.pak',
'<(PRODUCT_DIR)/locales/en-US.pak',
],
},
Expand Down

0 comments on commit f6d7f8b

Please sign in to comment.