Skip to content

Commit

Permalink
Report when blacklist.cc fails to setup the blacklisting thunk.
Browse files Browse the repository at this point in the history
BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278393 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
csharp@chromium.org committed Jun 19, 2014
1 parent 63d1d61 commit 70e44ab
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
18 changes: 14 additions & 4 deletions chrome/browser/chrome_elf_init_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ enum BlacklistSetupEventType {
// The blacklist setup code failed to execute.
BLACKLIST_SETUP_FAILED,

// Deprecated. The blacklist thunk setup code failed to execute.
// The blacklist thunk setup code failed. This is probably an indication
// that something else patched that code first.
BLACKLIST_THUNK_SETUP_FAILED,

// Deprecated. The blacklist interception code failed to execute.
Expand Down Expand Up @@ -143,9 +144,18 @@ void BrowserBlacklistBeaconSetup() {
blacklist_registry_key.ReadValueDW(blacklist::kBeaconState, &blacklist_state);

if (blacklist_state == blacklist::BLACKLIST_ENABLED) {
// The blacklist was enabled successfully so we record the event (along with
// the number of failed previous attempts).
RecordBlacklistSetupEvent(BLACKLIST_SETUP_RAN_SUCCESSFULLY);
// The blacklist setup didn't crash, so we report if it was enabled or not.
if (blacklist::IsBlacklistInitialized()) {
RecordBlacklistSetupEvent(BLACKLIST_SETUP_RAN_SUCCESSFULLY);
} else {
// The only way for the blacklist to be enabled, but not fully
// initialized is if the thunk setup failed. See blacklist.cc
// for more details.
RecordBlacklistSetupEvent(BLACKLIST_THUNK_SETUP_FAILED);
}

// Regardless of if the blacklist was fully enabled or not, report how many
// times we had to try to set it up.
DWORD attempt_count = 0;
blacklist_registry_key.ReadValueDW(blacklist::kBeaconAttemptCount,
&attempt_count);
Expand Down
6 changes: 3 additions & 3 deletions chrome_elf/blacklist/blacklist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ bool ResetBeacon() {
return false;
}

// Reaching this point with the setup running state means the setup
// succeeded and so we reset to enabled. Any other state indicates that setup
// was skipped; in that case we leave the state alone for later recording.
// Reaching this point with the setup running state means the setup did not
// crash, so we reset to enabled. Any other state indicates that setup was
// skipped; in that case we leave the state alone for later recording.
if (blacklist_state == BLACKLIST_SETUP_RUNNING)
result = SetDWValue(&key, kBeaconState, BLACKLIST_ENABLED);

Expand Down

0 comments on commit 70e44ab

Please sign in to comment.