diff options
author | csharp@chromium.org <csharp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-27 17:15:05 +0000 |
---|---|---|
committer | csharp@chromium.org <csharp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-27 17:15:05 +0000 |
commit | e5890e1e8f97eb873972680e85e6c76ea3bc6923 (patch) | |
tree | a9cad560057361f14d3506a4d0ce9dc3522b87c7 /chrome_elf | |
parent | 66c12e88d5df69057be30fcd93359ec73bc6362a (diff) | |
download | chromium_src-e5890e1e8f97eb873972680e85e6c76ea3bc6923.zip chromium_src-e5890e1e8f97eb873972680e85e6c76ea3bc6923.tar.gz chromium_src-e5890e1e8f97eb873972680e85e6c76ea3bc6923.tar.bz2 |
Link chrome_elf.dll instead of statically linking the blacklist code
This ensure that the dll code is referenced, instead of the target
making its own copy.
TBR=sky@chromium.org
BUG=329023
Review URL: https://codereview.chromium.org/181373003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253847 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_elf')
-rw-r--r-- | chrome_elf/blacklist.gypi | 1 | ||||
-rw-r--r-- | chrome_elf/blacklist/blacklist.cc | 5 | ||||
-rw-r--r-- | chrome_elf/blacklist/blacklist.h | 24 | ||||
-rw-r--r-- | chrome_elf/blacklist/test/blacklist_test.cc | 1 | ||||
-rw-r--r-- | chrome_elf/chrome_elf.gyp | 23 | ||||
-rw-r--r-- | chrome_elf/chrome_elf_constants.cc | 7 | ||||
-rw-r--r-- | chrome_elf/chrome_elf_constants.h | 28 |
7 files changed, 60 insertions, 29 deletions
diff --git a/chrome_elf/blacklist.gypi b/chrome_elf/blacklist.gypi index 24fcec6..86c97c9 100644 --- a/chrome_elf/blacklist.gypi +++ b/chrome_elf/blacklist.gypi @@ -23,6 +23,7 @@ '../base/base.gyp:base_static', '../chrome/chrome.gyp:chrome_version_header', '../chrome_elf/chrome_elf.gyp:chrome_elf_breakpad', + '../chrome_elf/chrome_elf.gyp:chrome_elf_constants', '../sandbox/sandbox.gyp:sandbox', ], }, diff --git a/chrome_elf/blacklist/blacklist.cc b/chrome_elf/blacklist/blacklist.cc index 958d710..73383d5 100644 --- a/chrome_elf/blacklist/blacklist.cc +++ b/chrome_elf/blacklist/blacklist.cc @@ -8,6 +8,7 @@ #include "base/basictypes.h" #include "chrome_elf/blacklist/blacklist_interceptions.h" +#include "chrome_elf/chrome_elf_constants.h" #include "sandbox/win/src/interception_internal.h" #include "sandbox/win/src/internal_types.h" #include "sandbox/win/src/sandbox_utils.h" @@ -28,10 +29,6 @@ const wchar_t* g_troublesome_dlls[kTroublesomeDllsMaxCount] = { NULL, }; -const wchar_t kRegistryBeaconPath[] = L"SOFTWARE\\Google\\Chrome\\BLBeacon"; -const wchar_t kBeaconVersion[] = L"version"; -const wchar_t kBeaconState[] = L"state"; - } // namespace blacklist // Allocate storage for thunks in a page of this module to save on doing diff --git a/chrome_elf/blacklist/blacklist.h b/chrome_elf/blacklist/blacklist.h index 2e21f20..779525f 100644 --- a/chrome_elf/blacklist/blacklist.h +++ b/chrome_elf/blacklist/blacklist.h @@ -17,30 +17,6 @@ const int kTroublesomeDllsMaxCount = 64; // The DLL blacklist. extern const wchar_t* g_troublesome_dlls[kTroublesomeDllsMaxCount]; -// The registry path of the blacklist beacon. -extern const wchar_t kRegistryBeaconPath[]; - -// The properties for the blacklist beacon. -extern const wchar_t kBeaconVersion[]; -extern const wchar_t kBeaconState[]; - -// The states for the blacklist setup code. -enum BlacklistState { - BLACKLIST_DISABLED = 0, - BLACKLIST_ENABLED, - // The blacklist setup code is running. If this is still set at startup, - // it means the last setup crashed. - BLACKLIST_SETUP_RUNNING, - // The blacklist thunk setup code is running. If this is still set at startup, - // it means the last setup crashed during thunk setup. - BLACKLIST_THUNK_SETUP, - // The blacklist code is currently intercepting MapViewOfSection. If this is - // still set at startup, it means we crashed during interception. - BLACKLIST_INTERCEPTING, - // Always keep this at the end. - BLACKLIST_STATE_MAX, -}; - #if defined(_WIN64) extern NtMapViewOfSectionFunction g_nt_map_view_of_section_func; #endif diff --git a/chrome_elf/blacklist/test/blacklist_test.cc b/chrome_elf/blacklist/test/blacklist_test.cc index 39db737..096502d 100644 --- a/chrome_elf/blacklist/test/blacklist_test.cc +++ b/chrome_elf/blacklist/test/blacklist_test.cc @@ -15,6 +15,7 @@ #include "base/win/registry.h" #include "chrome_elf/blacklist/blacklist.h" #include "chrome_elf/blacklist/test/blacklist_test_main_dll.h" +#include "chrome_elf/chrome_elf_constants.h" #include "testing/gtest/include/gtest/gtest.h" #include "version.h" // NOLINT diff --git a/chrome_elf/chrome_elf.gyp b/chrome_elf/chrome_elf.gyp index fa6ed36..5820fc2 100644 --- a/chrome_elf/chrome_elf.gyp +++ b/chrome_elf/chrome_elf.gyp @@ -126,7 +126,7 @@ ], }, { - 'target_name': 'chrome_elf_common', + 'target_name': 'chrome_elf_constants', 'type': 'static_library', 'include_dirs': [ '..', @@ -134,6 +134,27 @@ 'sources': [ 'chrome_elf_constants.cc', 'chrome_elf_constants.h', + ], + 'conditions': [ + ['component=="shared_library"', { + # In component builds, all targets depend on chrome_redirects by + # default. Remove it here so we are able to test it. + 'dependencies!': [ + '../chrome_elf/chrome_elf.gyp:chrome_redirects', + ], + }], + ], + }, + { + 'target_name': 'chrome_elf_common', + 'type': 'static_library', + 'dependencies': [ + 'chrome_elf_constants', + ], + 'include_dirs': [ + '..', + ], + 'sources': [ 'chrome_elf_types.h', 'chrome_elf_util.cc', 'chrome_elf_util.h', diff --git a/chrome_elf/chrome_elf_constants.cc b/chrome_elf/chrome_elf_constants.cc index cd60763..8879da7 100644 --- a/chrome_elf/chrome_elf_constants.cc +++ b/chrome_elf/chrome_elf_constants.cc @@ -14,3 +14,10 @@ const wchar_t kLocalStateFilename[] = L"Local State"; const wchar_t kPreferencesFilename[] = L"Preferences"; const wchar_t kUserDataDirName[] = L"User Data"; +namespace blacklist { + +const wchar_t kRegistryBeaconPath[] = L"SOFTWARE\\Google\\Chrome\\BLBeacon"; +const wchar_t kBeaconVersion[] = L"version"; +const wchar_t kBeaconState[] = L"state"; + +} // namespace blacklist diff --git a/chrome_elf/chrome_elf_constants.h b/chrome_elf/chrome_elf_constants.h index fcfbc25..2941815 100644 --- a/chrome_elf/chrome_elf_constants.h +++ b/chrome_elf/chrome_elf_constants.h @@ -14,4 +14,32 @@ extern const wchar_t kLocalStateFilename[]; extern const wchar_t kPreferencesFilename[]; extern const wchar_t kUserDataDirName[]; +namespace blacklist { + +// The registry path of the blacklist beacon. +extern const wchar_t kRegistryBeaconPath[]; + +// The properties for the blacklist beacon. +extern const wchar_t kBeaconVersion[]; +extern const wchar_t kBeaconState[]; + +// The states for the blacklist setup code. +enum BlacklistState { + BLACKLIST_DISABLED = 0, + BLACKLIST_ENABLED, + // The blacklist setup code is running. If this is still set at startup, + // it means the last setup crashed. + BLACKLIST_SETUP_RUNNING, + // The blacklist thunk setup code is running. If this is still set at startup, + // it means the last setup crashed during thunk setup. + BLACKLIST_THUNK_SETUP, + // The blacklist code is currently intercepting MapViewOfSection. If this is + // still set at startup, it means we crashed during interception. + BLACKLIST_INTERCEPTING, + // Always keep this at the end. + BLACKLIST_STATE_MAX, +}; + +} // namespace blacklist + #endif // CHROME_ELF_CHROME_ELF_CONSTANTS_H_ |