Skip to content

Commit

Permalink
Revert 218956 "Remove chrome.pak references, build resources int..."
Browse files Browse the repository at this point in the history
It seemes to have broken the mac buildbot.
I'll post more info here soon, crbug.com does not seem to be working at the moment.

> Remove chrome.pak references, build resources into resources.pak (try 2)
> 
> 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.
> 
> This previously landed as https://codereview.chromium.org/22339020 and
> was reverted due to various scripts/etc still referencing chrome.pak. This
> patch still builds chrome.pak, but with only the (tiny) net_resources in
> it. After this lands I'll go remove references to chrome.pak and then remove
> it completely once all references are gone.
> 
> BUG=52609
> TBR=phajdan.jr@chromium.org for chrome/installer/linux
> 
> Review URL: https://chromiumcodereview.appspot.com/23205023

TBR=jamesr@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@218975 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
vabr@chromium.org committed Aug 22, 2013
1 parent 9132fe8 commit c8df0d5
Show file tree
Hide file tree
Showing 24 changed files with 64 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 @@ -915,6 +915,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 @@ -20,6 +20,7 @@
public class ChromiumTestShellApplication extends Application {
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 @@ -667,6 +667,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 @@ -2443,10 +2443,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
2 changes: 2 additions & 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 Expand Up @@ -53,6 +54,7 @@
'<(PRODUCT_DIR)/locales/zh-TW.pak',
],
'chrome_android_pak_output_resources': [
'<(chrome_android_pak_output_folder)/chrome.pak',
'<(chrome_android_pak_output_folder)/resources.pak',
'<(chrome_android_pak_output_folder)/chrome_100_percent.pak',
'<(chrome_android_pak_output_folder)/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 @@ -553,6 +553,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
17 changes: 17 additions & 0 deletions chrome/chrome_repack_chrome.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,25 @@
'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)',
Expand Down
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: 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/installer/linux/common/installer.include
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ stage_install_common() {
rm "${DEBUGFILE}" "${STRIPPEDFILE}"

# resources
install -m 644 "${BUILDDIR}/${PROGNAME}.pak" "${STAGEDIR}/${INSTALLDIR}/"
install -m 644 "${BUILDDIR}/resources.pak" "${STAGEDIR}/${INSTALLDIR}/"
# TODO(mmoss): This has broken a couple times on adding new .pak files. Maybe
# we should flag all installer files in FILES.cfg and get them from there, so
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 c8df0d5

Please sign in to comment.