Skip to content

Commit 7b59bbb

Browse files
committed
Remove TryAcquireSRWLock from Chromium sandbox even though it's unused
1 parent 6ad1c94 commit 7b59bbb

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

ipc/chromium/src/base/lock_impl_win.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ LockImpl::LockImpl() : native_handle_(SRWLOCK_INIT) {}
1313

1414
LockImpl::~LockImpl() = default;
1515

16-
bool LockImpl::Try() { return !!::TryAcquireSRWLockExclusive(&native_handle_); }
17-
1816
void LockImpl::Lock() { ::AcquireSRWLockExclusive(&native_handle_); }
1917

2018
void LockImpl::Unlock() { ::ReleaseSRWLockExclusive(&native_handle_); }

security/sandbox/chromium/base/synchronization/lock_impl_win.cc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ LockImpl::LockImpl() : native_handle_(SRWLOCK_INIT) {}
1515

1616
LockImpl::~LockImpl() = default;
1717

18-
bool LockImpl::Try() {
19-
return !!::TryAcquireSRWLockExclusive(
20-
reinterpret_cast<PSRWLOCK>(&native_handle_));
21-
}
22-
2318
void LockImpl::Lock() {
2419
// The ScopedLockAcquireActivity below is relatively expensive and so its
2520
// actions can become significant due to the very large number of locks
@@ -28,10 +23,6 @@ void LockImpl::Lock() {
2823
// (tracked) blocking call if that fails. Since "try" itself is a system
2924
// call, and thus also somewhat expensive, don't bother with it unless
3025
// tracking is actually enabled.
31-
if (base::debug::GlobalActivityTracker::IsEnabled())
32-
if (Try())
33-
return;
34-
3526
base::debug::ScopedLockAcquireActivity lock_activity(this);
3627
::AcquireSRWLockExclusive(reinterpret_cast<PSRWLOCK>(&native_handle_));
3728
}

0 commit comments

Comments
 (0)