diff options
author | Torne (Richard Coles) <torne@google.com> | 2013-11-28 11:55:43 +0000 |
---|---|---|
committer | Torne (Richard Coles) <torne@google.com> | 2013-11-28 11:55:43 +0000 |
commit | f2477e01787aa58f445919b809d89e252beef54f (patch) | |
tree | 2db962b4af39f0db3a5f83b314373d0530c484b8 /chrome_elf | |
parent | 7daea1dd5ff7e419322de831b642d81af3247912 (diff) | |
download | chromium_org-f2477e01787aa58f445919b809d89e252beef54f.tar.gz |
Merge from Chromium at DEPS revision 237746
This commit was generated by merge_to_master.py.
Change-Id: I8997af4cddfeb09a7c26f7e8e672c712cab461ea
Diffstat (limited to 'chrome_elf')
-rw-r--r-- | chrome_elf/DEPS | 2 | ||||
-rw-r--r-- | chrome_elf/OWNERS | 3 | ||||
-rw-r--r-- | chrome_elf/README | 15 | ||||
-rw-r--r-- | chrome_elf/chrome_elf.def | 8 | ||||
-rw-r--r-- | chrome_elf/chrome_elf.gyp | 33 | ||||
-rw-r--r-- | chrome_elf/chrome_elf_main.cc | 16 | ||||
-rw-r--r-- | chrome_elf/chrome_elf_main.h | 10 | ||||
-rw-r--r-- | chrome_elf/chrome_exe_manifest.template | 10 | ||||
-rw-r--r-- | chrome_elf/chrome_exe_manifest_action.gypi | 34 | ||||
-rw-r--r-- | chrome_elf/version_assembly_manifest.template | 8 | ||||
-rw-r--r-- | chrome_elf/version_assembly_manifest_action.gypi | 37 |
11 files changed, 176 insertions, 0 deletions
diff --git a/chrome_elf/DEPS b/chrome_elf/DEPS new file mode 100644 index 0000000000..48e88750d4 --- /dev/null +++ b/chrome_elf/DEPS @@ -0,0 +1,2 @@ +include_rules = [ +] diff --git a/chrome_elf/OWNERS b/chrome_elf/OWNERS new file mode 100644 index 0000000000..d2e52d6c15 --- /dev/null +++ b/chrome_elf/OWNERS @@ -0,0 +1,3 @@ + caitkp@chromium.org + gab@chromium.org + robertshield@chromium.org
\ No newline at end of file diff --git a/chrome_elf/README b/chrome_elf/README new file mode 100644 index 0000000000..b657437375 --- /dev/null +++ b/chrome_elf/README @@ -0,0 +1,15 @@ +Chrome Early Loading Framework (aka ChromeELF) + +chrome_elf.dll is shipped in Chrome's version directory to ease updates, +and is loaded early in chrome.exe's lifetime. This is done by turning the +version directory into a private assembly which refers to chrome_elf.dll +(http://msdn.microsoft.com/library/aa374224.aspx). + +In an ideal world, this would be done by embedding an application config in +chrome.exe that would refer to the proper version directory via a +probing\privatePath attribute (http://msdn.microsoft.com/library/aa374182.aspx). +This would allow us to refer to dlls in the version directory without having to +make the version directory itself into an assembly. It would also avoid naming +conflicts (as the WinSxS dir and GAC both take precedence over private +assemblies when searching for dlls). Unfortunately, the probing\privatePath +attribute is only supported for Windows 7 and later. diff --git a/chrome_elf/chrome_elf.def b/chrome_elf/chrome_elf.def new file mode 100644 index 0000000000..d3ca82f80d --- /dev/null +++ b/chrome_elf/chrome_elf.def @@ -0,0 +1,8 @@ +; Copyright 2013 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. + +LIBRARY "chrome_elf.dll" + +EXPORTS + InitChromeElf diff --git a/chrome_elf/chrome_elf.gyp b/chrome_elf/chrome_elf.gyp new file mode 100644 index 0000000000..a8f15bd841 --- /dev/null +++ b/chrome_elf/chrome_elf.gyp @@ -0,0 +1,33 @@ +# Copyright 2013 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. +{ + 'variables': { + 'chromium_code': 1, + }, + 'includes': [ + '../build/win_precompile.gypi', + '../chrome/version.gypi', + ], + 'targets': [ + { + 'target_name': 'chrome_elf', + 'type': 'shared_library', + 'include_dirs': [ + '..', + ], + 'sources': [ + 'chrome_elf.def', + 'chrome_elf_main.cc', + 'chrome_elf_main.h', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'BaseAddress': '0x01c20000', + # Set /SUBSYSTEM:WINDOWS for chrome_elf.dll (for consistency). + 'SubSystem': '2', + }, + }, + }, + ], +} diff --git a/chrome_elf/chrome_elf_main.cc b/chrome_elf/chrome_elf_main.cc new file mode 100644 index 0000000000..c6715ba376 --- /dev/null +++ b/chrome_elf/chrome_elf_main.cc @@ -0,0 +1,16 @@ +// Copyright 2013 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. + +#include <windows.h> + +#include "chrome_elf/chrome_elf_main.h" + +void InitChromeElf() { + // This method is a no-op which may be called to force a load-time dependency + // on chrome_elf.dll. +} + +BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) { + return TRUE; +} diff --git a/chrome_elf/chrome_elf_main.h b/chrome_elf/chrome_elf_main.h new file mode 100644 index 0000000000..7d02ddd991 --- /dev/null +++ b/chrome_elf/chrome_elf_main.h @@ -0,0 +1,10 @@ +// Copyright 2013 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. + +#ifndef CHROME_ELF_CHROME_ELF_MAIN_H_ +#define CHROME_ELF_CHROME_ELF_MAIN_H_ + +extern "C" void InitChromeElf(); + +#endif // CHROME_ELF_CHROME_ELF_MAIN_H_ diff --git a/chrome_elf/chrome_exe_manifest.template b/chrome_elf/chrome_exe_manifest.template new file mode 100644 index 0000000000..7c66328e20 --- /dev/null +++ b/chrome_elf/chrome_exe_manifest.template @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> + <dependency> + <dependentAssembly> + <assemblyIdentity type='win32' + name='@MAJOR@.@MINOR@.@BUILD@.@PATCH@' + version='@MAJOR@.@MINOR@.@BUILD@.@PATCH@' language='*'/> + </dependentAssembly> + </dependency> +</assembly>
\ No newline at end of file diff --git a/chrome_elf/chrome_exe_manifest_action.gypi b/chrome_elf/chrome_exe_manifest_action.gypi new file mode 100644 index 0000000000..89453dbc95 --- /dev/null +++ b/chrome_elf/chrome_exe_manifest_action.gypi @@ -0,0 +1,34 @@ +# Copyright 2013 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. + +# This file contains an action which can be used to construct a manifest file +# declaring a dependency on chrome_elf.dll. This manifest can then be merged +# into the manifest of the executable and embedded into it when it is built. + +# To use this the following variables need to be defined: +# version_path: string: path to file containing version data (e.g. +# chrome/VERSION). +# version_py_path: string: path to file containing version script (e.g. +# chrome/tools/build/version.py). + +{ + 'variables': { + 'template_input_path': + '<(DEPTH)/chrome_elf/chrome_exe_manifest.template', + }, + 'inputs': [ + '<(template_input_path)', + '<(version_path)', + ], + 'outputs': [ + '<(SHARED_INTERMEDIATE_DIR)/chrome_elf/version_assembly.manifest', + ], + 'action': [ + 'python', '<(version_py_path)', + '-f', '<(version_path)', + '<(template_input_path)', + '<@(_outputs)', + ], + 'message': 'Generating <@(_outputs)', +}
\ No newline at end of file diff --git a/chrome_elf/version_assembly_manifest.template b/chrome_elf/version_assembly_manifest.template new file mode 100644 index 0000000000..153194c3d3 --- /dev/null +++ b/chrome_elf/version_assembly_manifest.template @@ -0,0 +1,8 @@ +<assembly + xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'> + <assemblyIdentity + name='@MAJOR@.@MINOR@.@BUILD@.@PATCH@' + version='@MAJOR@.@MINOR@.@BUILD@.@PATCH@' + type='win32'/> + <file name='chrome_elf.dll'/> +</assembly>
\ No newline at end of file diff --git a/chrome_elf/version_assembly_manifest_action.gypi b/chrome_elf/version_assembly_manifest_action.gypi new file mode 100644 index 0000000000..9c44315332 --- /dev/null +++ b/chrome_elf/version_assembly_manifest_action.gypi @@ -0,0 +1,37 @@ +# Copyright 2013 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. + +# This file contains an action which can be used to construct a manifest file +# with the same name as the version directory so that chrome.exe identifies the +# version directory as an assembly. This will be copied over to the version +# directory by the installer script. + +# To use this the following variables need to be defined: +# version_path: string: path to file containing version data (e.g. +# chrome/VERSION). +# version_py_path: string: path to file containing version script (e.g. +# chrome/tools/build/version.py). +# version_full: string: version string in W.X.Y.Z form. + + +{ + 'variables': { + 'template_input_path': + '<(DEPTH)/chrome_elf/version_assembly_manifest.template', + }, + 'inputs': [ + '<(template_input_path)', + '<(version_path)', + ], + 'outputs': [ + '<(PRODUCT_DIR)/<(version_full).manifest', + ], + 'action': [ + 'python', '<(version_py_path)', + '-f', '<(version_path)', + '<(template_input_path)', + '<@(_outputs)', + ], + 'message': 'Generating <@(_outputs)', +}
\ No newline at end of file |