Remove obsolete base/lock.h and fix up callers to use the new header file and
the base namespace. Fix several files including lock.h unnecessarily. BUG=none TEST=none Original review=http://codereview.chromium.org/6142009/ Patch by leviw@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72106 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
base
at_exit.h
crypto
debug
i18n
linux_util.cclock.hmessage_loop.ccmessage_loop.hmessage_loop_proxy_impl.hmetrics
nss_util.ccobserver_list_threadsafe.hopenssl_util.ccpath_service.ccsynchronization
third_party
dmg_fp
threading
time_win.cctracked_objects.cctracked_objects.hceee
ie
broker
plugin
testing
chrome
browser
automation
bookmarks
browser_thread.ccbrowser_thread.hcancelable_request.hcert_store.cccert_store.hchild_process_launcher.ccchild_process_security_policy.ccchild_process_security_policy.hchromeos
content_settings
host_content_settings_map.cchost_content_settings_map.hpolicy_content_settings_provider.ccpolicy_content_settings_provider.hpref_content_settings_provider.ccpref_content_settings_provider.h
cross_site_request_manager.cccross_site_request_manager.hdevice_orientation
download
file_path_watcher
geolocation
gateway_data_provider_common.ccgateway_data_provider_common.hwifi_data_provider_common.ccwifi_data_provider_common.h
hang_monitor
history
host_zoom_map.cchost_zoom_map.hin_process_webkit
mach_broker_mac.ccmach_broker_mac.hmach_broker_mac_unittest.ccmulti_process_notification_mac.mmnet
policy
printing
print_dialog_cloud.ccprint_dialog_cloud_internal.hprint_dialog_gtk.ccprint_job_manager.ccprint_job_manager.h
renderer_host
accelerated_surface_container_manager_mac.ccaccelerated_surface_container_manager_mac.hdownload_resource_handler.ccrender_message_filter_gtk.ccrender_widget_helper.ccrender_widget_helper.h
safe_browsing
speech
sync
engine
glue
autofill_data_type_controller.ccautofill_data_type_controller.hautofill_model_associator.ccautofill_model_associator.hautofill_profile_model_associator.ccautofill_profile_model_associator.hpassword_model_associator.ccpassword_model_associator.hsync_backend_host.ccsync_backend_host.h
syncable
util
tab_contents
task_manager
transport_security_persister.hui
webdata
zygote_host_linux.cczygote_host_linux.hcommon
net
sqlite_utils.ccwebmessageportchannel_impl.ccwebmessageportchannel_impl.hworker_thread_ticker.ccworker_thread_ticker.hgpu
installer
plugin
renderer
service
cloud_print
test
automation
sync
webdriver
tools
crash_service
chrome_frame
cfproxy.hcfproxy_factory.cccfproxy_private.hcfproxy_support.ccchrome_frame_automation.ccchrome_frame_automation.hchrome_frame_delegate.hchrome_frame_histograms.ccchrome_frame_histograms.hchrome_tab.cccom_type_info_holder.cccom_type_info_holder.h
crash_reporting
function_stub.ccmetrics_service.ccmetrics_service.hprotocol_sink_wrap.ccsync_msg_reply_dispatcher.ccsync_msg_reply_dispatcher.htask_marshaller.cctask_marshaller.hurlmon_url_request.hutils.ccutils.hvtable_patch_manager.ccvtable_patch_manager.hgfx
ipc
ipc_channel_posix.ccipc_channel_proxy.ccipc_channel_proxy.hipc_sync_channel.ccipc_sync_channel.hipc_sync_message_filter.ccipc_sync_message_filter.h
media
audio
audio_input_controller.ccaudio_input_controller.haudio_output_controller.ccaudio_output_controller.h
linux
base
filters
net
base
capturing_net_log.cccapturing_net_log.hcert_database_mac.cccert_verifier.cccookie_monster.cccookie_monster.hdnsrr_resolver.cchost_resolver_impl.cchost_resolver_impl_unittest.cckeygen_handler_mac.cclisten_socket_unittest.ccnet_util.ccopenssl_memory_private_key_store.cctest_completion_callback_unittest.ccx509_certificate.ccx509_certificate.hx509_certificate_mac.cc
http
ocsp
proxy
socket
socket_stream
tools
flip_server
url_request
printing
backend
printed_document.ccprinted_document.hprinted_document_cairo.ccprinted_document_mac.ccprinted_document_win.ccremoting
base
host
capturer.cccapturer.hchromoting_host.ccchromoting_host.hin_memory_host_config.ccin_memory_host_config.hjson_host_config.ccjson_host_config.h
jingle_glue
protocol
skia/ext
third_party/cacheinvalidation/overrides/google/cacheinvalidation
tools/memory_watcher
ui/base/resource
resource_bundle.ccresource_bundle_dummy.ccresource_bundle_linux.ccresource_bundle_posix.ccresource_bundle_win.cc
webkit
@ -9,7 +9,7 @@
|
||||
#include <stack>
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
|
||||
namespace base {
|
||||
|
||||
@ -60,7 +60,7 @@ class AtExitManager {
|
||||
void* param_;
|
||||
};
|
||||
|
||||
Lock lock_;
|
||||
base::Lock lock_;
|
||||
std::stack<CallbackAndParam> stack_;
|
||||
AtExitManager* next_manager_; // Stack of managers to allow shadowing.
|
||||
|
||||
|
@ -5,8 +5,8 @@
|
||||
#include "base/crypto/capi_util.h"
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/singleton.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@ -18,7 +18,7 @@ class CAPIUtilSingleton {
|
||||
|
||||
// Returns a lock to guard calls to CryptAcquireContext with
|
||||
// CRYPT_DELETEKEYSET or CRYPT_NEWKEYSET.
|
||||
Lock& acquire_context_lock() {
|
||||
base::Lock& acquire_context_lock() {
|
||||
return acquire_context_lock_;
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ class CAPIUtilSingleton {
|
||||
|
||||
CAPIUtilSingleton() {}
|
||||
|
||||
Lock acquire_context_lock_;
|
||||
base::Lock acquire_context_lock_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CAPIUtilSingleton);
|
||||
};
|
||||
@ -43,7 +43,7 @@ BOOL CryptAcquireContextLocked(HCRYPTPROV* prov,
|
||||
DWORD prov_type,
|
||||
DWORD flags)
|
||||
{
|
||||
AutoLock lock(CAPIUtilSingleton::GetInstance()->acquire_context_lock());
|
||||
base::AutoLock lock(CAPIUtilSingleton::GetInstance()->acquire_context_lock());
|
||||
return CryptAcquireContext(prov, container, provider, prov_type, flags);
|
||||
}
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/singleton.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
|
||||
namespace base {
|
||||
namespace debug {
|
||||
@ -59,7 +59,7 @@ class SymbolContext {
|
||||
void OutputTraceToStream(const void* const* trace,
|
||||
int count,
|
||||
std::ostream* os) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
for (size_t i = 0; (i < count) && os->good(); ++i) {
|
||||
const int kMaxNameLength = 256;
|
||||
@ -129,7 +129,7 @@ class SymbolContext {
|
||||
}
|
||||
|
||||
DWORD init_error_;
|
||||
Lock lock_;
|
||||
base::Lock lock_;
|
||||
DISALLOW_COPY_AND_ASSIGN(SymbolContext);
|
||||
};
|
||||
|
||||
|
@ -31,9 +31,9 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "base/lock.h"
|
||||
#include "base/scoped_ptr.h"
|
||||
#include "base/singleton.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/time.h"
|
||||
#include "base/timer.h"
|
||||
|
||||
@ -135,7 +135,7 @@ class TraceLog {
|
||||
|
||||
bool enabled_;
|
||||
FILE* log_file_;
|
||||
Lock file_lock_;
|
||||
base::Lock file_lock_;
|
||||
TimeTicks trace_start_time_;
|
||||
scoped_ptr<base::ProcessMetrics> process_metrics_;
|
||||
RepeatingTimer<TraceLog> timer_;
|
||||
|
@ -90,7 +90,7 @@ class LocaleAwareComparator {
|
||||
int Compare(const string16& a, const string16& b) {
|
||||
// We are not sure if Collator::compare is thread-safe.
|
||||
// Use an AutoLock just in case.
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
|
||||
UErrorCode error_code = U_ZERO_ERROR;
|
||||
UCollationResult result = collator_->compare(
|
||||
@ -120,7 +120,7 @@ class LocaleAwareComparator {
|
||||
}
|
||||
|
||||
scoped_ptr<icu::Collator> collator_;
|
||||
Lock lock_;
|
||||
base::Lock lock_;
|
||||
friend struct DefaultSingletonTraits<LocaleAwareComparator>;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(LocaleAwareComparator);
|
||||
|
@ -17,12 +17,12 @@
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/file_util.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/process_util.h"
|
||||
#include "base/singleton.h"
|
||||
#include "base/scoped_ptr.h"
|
||||
#include "base/string_util.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@ -51,7 +51,7 @@ class LinuxDistroHelper {
|
||||
// we automatically move to STATE_CHECK_STARTED so nobody else will
|
||||
// do the check.
|
||||
LinuxDistroState State() {
|
||||
AutoLock scoped_lock(lock_);
|
||||
base::AutoLock scoped_lock(lock_);
|
||||
if (STATE_DID_NOT_CHECK == state_) {
|
||||
state_ = STATE_CHECK_STARTED;
|
||||
return STATE_DID_NOT_CHECK;
|
||||
@ -61,13 +61,13 @@ class LinuxDistroHelper {
|
||||
|
||||
// Indicate the check finished, move to STATE_CHECK_FINISHED.
|
||||
void CheckFinished() {
|
||||
AutoLock scoped_lock(lock_);
|
||||
base::AutoLock scoped_lock(lock_);
|
||||
DCHECK(state_ == STATE_CHECK_STARTED);
|
||||
state_ = STATE_CHECK_FINISHED;
|
||||
}
|
||||
|
||||
private:
|
||||
Lock lock_;
|
||||
base::Lock lock_;
|
||||
LinuxDistroState state_;
|
||||
};
|
||||
#endif // if defined(OS_LINUX)
|
||||
|
18
base/lock.h
18
base/lock.h
@ -1,18 +0,0 @@
|
||||
// Copyright (c) 2011 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 BASE_LOCK_H_
|
||||
#define BASE_LOCK_H_
|
||||
#pragma once
|
||||
|
||||
// This is a temporary forwarding file so not every user of lock needs to
|
||||
// be updated at once.
|
||||
// TODO(brettw) remove this and fix everybody up to using the new location.
|
||||
#include "base/synchronization/lock.h"
|
||||
|
||||
using base::AutoLock;
|
||||
using base::AutoUnlock;
|
||||
using base::Lock;
|
||||
|
||||
#endif // BASE_LOCK_H_
|
@ -394,7 +394,7 @@ void MessageLoop::ReloadWorkQueue() {
|
||||
|
||||
// Acquire all we can from the inter-thread queue with one lock acquisition.
|
||||
{
|
||||
AutoLock lock(incoming_queue_lock_);
|
||||
base::AutoLock lock(incoming_queue_lock_);
|
||||
if (incoming_queue_.empty())
|
||||
return;
|
||||
incoming_queue_.Swap(&work_queue_); // Constant time
|
||||
@ -495,7 +495,7 @@ void MessageLoop::PostTask_Helper(
|
||||
|
||||
scoped_refptr<base::MessagePump> pump;
|
||||
{
|
||||
AutoLock locked(incoming_queue_lock_);
|
||||
base::AutoLock locked(incoming_queue_lock_);
|
||||
|
||||
bool was_empty = incoming_queue_.empty();
|
||||
incoming_queue_.push(pending_task);
|
||||
|
@ -10,10 +10,10 @@
|
||||
#include <string>
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/message_pump.h"
|
||||
#include "base/observer_list.h"
|
||||
#include "base/ref_counted.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/task.h"
|
||||
|
||||
#if defined(OS_WIN)
|
||||
@ -466,7 +466,7 @@ class MessageLoop : public base::MessagePump::Delegate {
|
||||
// will be handled by the TimerManager.
|
||||
TaskQueue incoming_queue_;
|
||||
// Protect access to incoming_queue_.
|
||||
Lock incoming_queue_lock_;
|
||||
base::Lock incoming_queue_lock_;
|
||||
|
||||
RunState* state_;
|
||||
|
||||
|
@ -6,9 +6,9 @@
|
||||
#define BASE_MESSAGE_LOOP_PROXY_IMPL_H_
|
||||
#pragma once
|
||||
|
||||
#include "base/lock.h"
|
||||
#include "base/message_loop.h"
|
||||
#include "base/message_loop_proxy.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
|
||||
namespace base {
|
||||
|
||||
@ -50,7 +50,7 @@ class MessageLoopProxyImpl : public MessageLoopProxy,
|
||||
friend class MessageLoopProxy;
|
||||
|
||||
// The lock that protects access to target_message_loop_.
|
||||
mutable Lock message_loop_lock_;
|
||||
mutable base::Lock message_loop_lock_;
|
||||
MessageLoop* target_message_loop_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(MessageLoopProxyImpl);
|
||||
|
@ -67,8 +67,8 @@
|
||||
#include <string>
|
||||
|
||||
#include "base/gtest_prod_util.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/ref_counted.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/time.h"
|
||||
|
||||
namespace base {
|
||||
@ -271,7 +271,7 @@ class FieldTrialList {
|
||||
TimeTicks application_start_time_;
|
||||
|
||||
// Lock for access to registered_.
|
||||
Lock lock_;
|
||||
base::Lock lock_;
|
||||
RegistrationList registered_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(FieldTrialList);
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/hash_tables.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/threading/thread_local_storage.h"
|
||||
|
||||
namespace base {
|
||||
@ -175,7 +175,7 @@ class StatsTable {
|
||||
Private* impl_;
|
||||
|
||||
// The counters_lock_ protects the counters_ hash table.
|
||||
Lock counters_lock_;
|
||||
base::Lock counters_lock_;
|
||||
|
||||
// The counters_ hash map is an in-memory hash of the counters.
|
||||
// It is used for quick lookup of counters, but is cannot be used
|
||||
|
@ -31,8 +31,8 @@
|
||||
#if defined(USE_NSS)
|
||||
#include "base/crypto/crypto_module_blocking_password_delegate.h"
|
||||
#include "base/environment.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/scoped_ptr.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#endif // defined(USE_NSS)
|
||||
|
||||
namespace base {
|
||||
|
@ -93,7 +93,7 @@ class ObserverListThreadSafe
|
||||
if (!loop)
|
||||
return; // Some unittests may access this without a message loop.
|
||||
{
|
||||
AutoLock lock(list_lock_);
|
||||
base::AutoLock lock(list_lock_);
|
||||
if (observer_lists_.find(loop) == observer_lists_.end())
|
||||
observer_lists_[loop] = new ObserverList<ObserverType>(type_);
|
||||
list = observer_lists_[loop];
|
||||
@ -112,7 +112,7 @@ class ObserverListThreadSafe
|
||||
if (!loop)
|
||||
return; // On shutdown, it is possible that current() is already null.
|
||||
{
|
||||
AutoLock lock(list_lock_);
|
||||
base::AutoLock lock(list_lock_);
|
||||
list = observer_lists_[loop];
|
||||
if (!list) {
|
||||
NOTREACHED() << "RemoveObserver called on for unknown thread";
|
||||
@ -165,7 +165,7 @@ class ObserverListThreadSafe
|
||||
|
||||
template <class Method, class Params>
|
||||
void Notify(const UnboundMethod<ObserverType, Method, Params>& method) {
|
||||
AutoLock lock(list_lock_);
|
||||
base::AutoLock lock(list_lock_);
|
||||
typename ObserversListMap::iterator it;
|
||||
for (it = observer_lists_.begin(); it != observer_lists_.end(); ++it) {
|
||||
MessageLoop* loop = (*it).first;
|
||||
@ -187,7 +187,7 @@ class ObserverListThreadSafe
|
||||
|
||||
// Check that this list still needs notifications.
|
||||
{
|
||||
AutoLock lock(list_lock_);
|
||||
base::AutoLock lock(list_lock_);
|
||||
typename ObserversListMap::iterator it =
|
||||
observer_lists_.find(MessageLoop::current());
|
||||
|
||||
@ -209,7 +209,7 @@ class ObserverListThreadSafe
|
||||
// If there are no more observers on the list, we can now delete it.
|
||||
if (list->size() == 0) {
|
||||
{
|
||||
AutoLock lock(list_lock_);
|
||||
base::AutoLock lock(list_lock_);
|
||||
// Remove |list| if it's not already removed.
|
||||
// This can happen if multiple observers got removed in a notification.
|
||||
// See http://crbug.com/55725.
|
||||
@ -225,7 +225,7 @@ class ObserverListThreadSafe
|
||||
typedef std::map<MessageLoop*, ObserverList<ObserverType>*> ObserversListMap;
|
||||
|
||||
// These are marked mutable to facilitate having NotifyAll be const.
|
||||
Lock list_lock_; // Protects the observer_lists_.
|
||||
base::Lock list_lock_; // Protects the observer_lists_.
|
||||
ObserversListMap observer_lists_;
|
||||
const NotificationType type_;
|
||||
|
||||
|
@ -7,11 +7,11 @@
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/ssl.h>
|
||||
|
||||
#include "base/lock.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/scoped_vector.h"
|
||||
#include "base/singleton.h"
|
||||
#include "base/string_piece.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
|
||||
namespace base {
|
||||
|
||||
@ -46,7 +46,7 @@ class OpenSSLInitSingleton {
|
||||
int num_locks = CRYPTO_num_locks();
|
||||
locks_.reserve(num_locks);
|
||||
for (int i = 0; i < num_locks; ++i)
|
||||
locks_.push_back(new Lock());
|
||||
locks_.push_back(new base::Lock());
|
||||
CRYPTO_set_locking_callback(LockingCallback);
|
||||
CRYPTO_set_id_callback(CurrentThreadId);
|
||||
}
|
||||
@ -70,7 +70,7 @@ class OpenSSLInitSingleton {
|
||||
}
|
||||
|
||||
// These locks are used and managed by OpenSSL via LockingCallback().
|
||||
ScopedVector<Lock> locks_;
|
||||
ScopedVector<base::Lock> locks_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(OpenSSLInitSingleton);
|
||||
};
|
||||
|
@ -14,8 +14,8 @@
|
||||
#include "base/file_util.h"
|
||||
#include "base/hash_tables.h"
|
||||
#include "base/lazy_instance.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
|
||||
namespace base {
|
||||
bool PathProvider(int key, FilePath* result);
|
||||
@ -92,9 +92,9 @@ static Provider base_provider_posix = {
|
||||
|
||||
|
||||
struct PathData {
|
||||
Lock lock;
|
||||
PathMap cache; // Cache mappings from path key to path value.
|
||||
PathMap overrides; // Track path overrides.
|
||||
base::Lock lock;
|
||||
PathMap cache; // Cache mappings from path key to path value.
|
||||
PathMap overrides; // Track path overrides.
|
||||
Provider* providers; // Linked list of path service providers.
|
||||
|
||||
PathData() {
|
||||
@ -130,7 +130,7 @@ static PathData* GetPathData() {
|
||||
// static
|
||||
bool PathService::GetFromCache(int key, FilePath* result) {
|
||||
PathData* path_data = GetPathData();
|
||||
AutoLock scoped_lock(path_data->lock);
|
||||
base::AutoLock scoped_lock(path_data->lock);
|
||||
|
||||
// check for a cached version
|
||||
PathMap::const_iterator it = path_data->cache.find(key);
|
||||
@ -144,7 +144,7 @@ bool PathService::GetFromCache(int key, FilePath* result) {
|
||||
// static
|
||||
bool PathService::GetFromOverrides(int key, FilePath* result) {
|
||||
PathData* path_data = GetPathData();
|
||||
AutoLock scoped_lock(path_data->lock);
|
||||
base::AutoLock scoped_lock(path_data->lock);
|
||||
|
||||
// check for an overriden version.
|
||||
PathMap::const_iterator it = path_data->overrides.find(key);
|
||||
@ -158,7 +158,7 @@ bool PathService::GetFromOverrides(int key, FilePath* result) {
|
||||
// static
|
||||
void PathService::AddToCache(int key, const FilePath& path) {
|
||||
PathData* path_data = GetPathData();
|
||||
AutoLock scoped_lock(path_data->lock);
|
||||
base::AutoLock scoped_lock(path_data->lock);
|
||||
// Save the computed path in our cache.
|
||||
path_data->cache[key] = path;
|
||||
}
|
||||
@ -225,7 +225,7 @@ bool PathService::Override(int key, const FilePath& path) {
|
||||
if (!file_util::AbsolutePath(&file_path))
|
||||
return false;
|
||||
|
||||
AutoLock scoped_lock(path_data->lock);
|
||||
base::AutoLock scoped_lock(path_data->lock);
|
||||
|
||||
// Clear the cache now. Some of its entries could have depended
|
||||
// on the value we are overriding, and are now out of sync with reality.
|
||||
@ -243,7 +243,7 @@ void PathService::RegisterProvider(ProviderFunc func, int key_start,
|
||||
DCHECK(path_data);
|
||||
DCHECK(key_end > key_start);
|
||||
|
||||
AutoLock scoped_lock(path_data->lock);
|
||||
base::AutoLock scoped_lock(path_data->lock);
|
||||
|
||||
Provider* p;
|
||||
|
||||
|
@ -75,7 +75,7 @@
|
||||
#endif
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
|
||||
namespace base {
|
||||
|
||||
@ -156,10 +156,10 @@ class ConditionVariable {
|
||||
RunState run_state_;
|
||||
|
||||
// Private critical section for access to member data.
|
||||
Lock internal_lock_;
|
||||
base::Lock internal_lock_;
|
||||
|
||||
// Lock that is acquired before calling Wait().
|
||||
Lock& user_lock_;
|
||||
base::Lock& user_lock_;
|
||||
|
||||
// Events that threads are blocked on.
|
||||
Event waiting_list_;
|
||||
@ -176,7 +176,7 @@ class ConditionVariable {
|
||||
pthread_cond_t condition_;
|
||||
pthread_mutex_t* user_mutex_;
|
||||
#if !defined(NDEBUG)
|
||||
Lock* user_lock_; // Needed to adjust shadow lock state on wait.
|
||||
base::Lock* user_lock_; // Needed to adjust shadow lock state on wait.
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -8,11 +8,11 @@
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
#include "base/synchronization/condition_variable.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/scoped_ptr.h"
|
||||
#include "base/spin_wait.h"
|
||||
#include "base/synchronization/condition_variable.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/threading/platform_thread.h"
|
||||
#include "base/threading/thread_collision_warner.h"
|
||||
#include "base/time.h"
|
||||
@ -198,7 +198,7 @@ TEST_F(ConditionVariableTest, MultiThreadConsumerTest) {
|
||||
Time start_time; // Used to time task processing.
|
||||
|
||||
{
|
||||
AutoLock auto_lock(*queue.lock());
|
||||
base::AutoLock auto_lock(*queue.lock());
|
||||
while (!queue.EveryIdWasAllocated())
|
||||
queue.all_threads_have_ids()->Wait();
|
||||
}
|
||||
@ -209,7 +209,7 @@ TEST_F(ConditionVariableTest, MultiThreadConsumerTest) {
|
||||
|
||||
{
|
||||
// Since we have no tasks yet, all threads should be waiting by now.
|
||||
AutoLock auto_lock(*queue.lock());
|
||||
base::AutoLock auto_lock(*queue.lock());
|
||||
EXPECT_EQ(0, queue.GetNumThreadsTakingAssignments());
|
||||
EXPECT_EQ(0, queue.GetNumThreadsCompletingTasks());
|
||||
EXPECT_EQ(0, queue.task_count());
|
||||
@ -232,7 +232,7 @@ TEST_F(ConditionVariableTest, MultiThreadConsumerTest) {
|
||||
|
||||
{
|
||||
// Wait until all 10 work tasks have at least been assigned.
|
||||
AutoLock auto_lock(*queue.lock());
|
||||
base::AutoLock auto_lock(*queue.lock());
|
||||
while (queue.task_count())
|
||||
queue.no_more_tasks()->Wait();
|
||||
// The last of the tasks *might* still be running, but... all but one should
|
||||
@ -252,7 +252,7 @@ TEST_F(ConditionVariableTest, MultiThreadConsumerTest) {
|
||||
|
||||
{
|
||||
// Check that all work was done by one thread id.
|
||||
AutoLock auto_lock(*queue.lock());
|
||||
base::AutoLock auto_lock(*queue.lock());
|
||||
EXPECT_EQ(1, queue.GetNumThreadsTakingAssignments());
|
||||
EXPECT_EQ(1, queue.GetNumThreadsCompletingTasks());
|
||||
EXPECT_EQ(0, queue.task_count());
|
||||
@ -278,7 +278,7 @@ TEST_F(ConditionVariableTest, MultiThreadConsumerTest) {
|
||||
|
||||
{
|
||||
// Wait until all work tasks have at least been assigned.
|
||||
AutoLock auto_lock(*queue.lock());
|
||||
base::AutoLock auto_lock(*queue.lock());
|
||||
while (queue.task_count())
|
||||
queue.no_more_tasks()->Wait();
|
||||
|
||||
@ -301,7 +301,7 @@ TEST_F(ConditionVariableTest, MultiThreadConsumerTest) {
|
||||
queue.SpinUntilAllThreadsAreWaiting();
|
||||
|
||||
{
|
||||
AutoLock auto_lock(*queue.lock());
|
||||
base::AutoLock auto_lock(*queue.lock());
|
||||
EXPECT_EQ(3, queue.GetNumThreadsTakingAssignments());
|
||||
EXPECT_EQ(3, queue.GetNumThreadsCompletingTasks());
|
||||
EXPECT_EQ(0, queue.task_count());
|
||||
@ -322,7 +322,7 @@ TEST_F(ConditionVariableTest, MultiThreadConsumerTest) {
|
||||
queue.SpinUntilAllThreadsAreWaiting();
|
||||
|
||||
{
|
||||
AutoLock auto_lock(*queue.lock());
|
||||
base::AutoLock auto_lock(*queue.lock());
|
||||
EXPECT_EQ(3, queue.GetNumThreadsTakingAssignments());
|
||||
EXPECT_EQ(3, queue.GetNumThreadsCompletingTasks());
|
||||
EXPECT_EQ(0, queue.task_count());
|
||||
@ -343,7 +343,7 @@ TEST_F(ConditionVariableTest, MultiThreadConsumerTest) {
|
||||
queue.SpinUntilAllThreadsAreWaiting(); // Should take about 60 ms.
|
||||
|
||||
{
|
||||
AutoLock auto_lock(*queue.lock());
|
||||
base::AutoLock auto_lock(*queue.lock());
|
||||
EXPECT_EQ(10, queue.GetNumThreadsTakingAssignments());
|
||||
EXPECT_EQ(10, queue.GetNumThreadsCompletingTasks());
|
||||
EXPECT_EQ(0, queue.task_count());
|
||||
@ -362,7 +362,7 @@ TEST_F(ConditionVariableTest, MultiThreadConsumerTest) {
|
||||
queue.SpinUntilAllThreadsAreWaiting(); // Should take about 60 ms.
|
||||
|
||||
{
|
||||
AutoLock auto_lock(*queue.lock());
|
||||
base::AutoLock auto_lock(*queue.lock());
|
||||
EXPECT_EQ(10, queue.GetNumThreadsTakingAssignments());
|
||||
EXPECT_EQ(10, queue.GetNumThreadsCompletingTasks());
|
||||
EXPECT_EQ(0, queue.task_count());
|
||||
@ -381,11 +381,11 @@ TEST_F(ConditionVariableTest, LargeFastTaskTest) {
|
||||
WorkQueue queue(kThreadCount); // Start the threads.
|
||||
|
||||
Lock private_lock; // Used locally for master to wait.
|
||||
AutoLock private_held_lock(private_lock);
|
||||
base::AutoLock private_held_lock(private_lock);
|
||||
ConditionVariable private_cv(&private_lock);
|
||||
|
||||
{
|
||||
AutoLock auto_lock(*queue.lock());
|
||||
base::AutoLock auto_lock(*queue.lock());
|
||||
while (!queue.EveryIdWasAllocated())
|
||||
queue.all_threads_have_ids()->Wait();
|
||||
}
|
||||
@ -395,7 +395,7 @@ TEST_F(ConditionVariableTest, LargeFastTaskTest) {
|
||||
|
||||
{
|
||||
// Since we have no tasks, all threads should be waiting by now.
|
||||
AutoLock auto_lock(*queue.lock());
|
||||
base::AutoLock auto_lock(*queue.lock());
|
||||
EXPECT_EQ(0, queue.GetNumThreadsTakingAssignments());
|
||||
EXPECT_EQ(0, queue.GetNumThreadsCompletingTasks());
|
||||
EXPECT_EQ(0, queue.task_count());
|
||||
@ -412,7 +412,7 @@ TEST_F(ConditionVariableTest, LargeFastTaskTest) {
|
||||
queue.work_is_available()->Broadcast(); // Start up all threads.
|
||||
// Wait until we've handed out all tasks.
|
||||
{
|
||||
AutoLock auto_lock(*queue.lock());
|
||||
base::AutoLock auto_lock(*queue.lock());
|
||||
while (queue.task_count() != 0)
|
||||
queue.no_more_tasks()->Wait();
|
||||
}
|
||||
@ -423,7 +423,7 @@ TEST_F(ConditionVariableTest, LargeFastTaskTest) {
|
||||
{
|
||||
// With Broadcast(), every thread should have participated.
|
||||
// but with racing.. they may not all have done equal numbers of tasks.
|
||||
AutoLock auto_lock(*queue.lock());
|
||||
base::AutoLock auto_lock(*queue.lock());
|
||||
EXPECT_EQ(kThreadCount, queue.GetNumThreadsTakingAssignments());
|
||||
EXPECT_EQ(kThreadCount, queue.GetNumThreadsCompletingTasks());
|
||||
EXPECT_EQ(0, queue.task_count());
|
||||
@ -440,7 +440,7 @@ TEST_F(ConditionVariableTest, LargeFastTaskTest) {
|
||||
|
||||
// Wait until we've handed out all tasks
|
||||
{
|
||||
AutoLock auto_lock(*queue.lock());
|
||||
base::AutoLock auto_lock(*queue.lock());
|
||||
while (queue.task_count() != 0)
|
||||
queue.no_more_tasks()->Wait();
|
||||
}
|
||||
@ -451,7 +451,7 @@ TEST_F(ConditionVariableTest, LargeFastTaskTest) {
|
||||
{
|
||||
// With Signal(), every thread should have participated.
|
||||
// but with racing.. they may not all have done four tasks.
|
||||
AutoLock auto_lock(*queue.lock());
|
||||
base::AutoLock auto_lock(*queue.lock());
|
||||
EXPECT_EQ(kThreadCount, queue.GetNumThreadsTakingAssignments());
|
||||
EXPECT_EQ(kThreadCount, queue.GetNumThreadsCompletingTasks());
|
||||
EXPECT_EQ(0, queue.task_count());
|
||||
@ -500,7 +500,7 @@ WorkQueue::WorkQueue(int thread_count)
|
||||
|
||||
WorkQueue::~WorkQueue() {
|
||||
{
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
SetShutdown();
|
||||
}
|
||||
work_is_available_.Broadcast(); // Tell them all to terminate.
|
||||
@ -558,7 +558,7 @@ bool WorkQueue::shutdown() const {
|
||||
// lock already acquired.
|
||||
bool WorkQueue::ThreadSafeCheckShutdown(int thread_count) {
|
||||
bool all_shutdown;
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
{
|
||||
// Declare in scope so DFAKE is guranteed to be destroyed before AutoLock.
|
||||
DFAKE_SCOPED_RECURSIVE_LOCK(locked_methods_);
|
||||
@ -657,7 +657,7 @@ void WorkQueue::SetShutdown() {
|
||||
void WorkQueue::SpinUntilAllThreadsAreWaiting() {
|
||||
while (true) {
|
||||
{
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
if (waiting_thread_count_ == thread_count_)
|
||||
break;
|
||||
}
|
||||
@ -668,7 +668,7 @@ void WorkQueue::SpinUntilAllThreadsAreWaiting() {
|
||||
void WorkQueue::SpinUntilTaskCountLessThan(int task_count) {
|
||||
while (true) {
|
||||
{
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
if (task_count_ < task_count)
|
||||
break;
|
||||
}
|
||||
@ -698,7 +698,7 @@ void WorkQueue::SpinUntilTaskCountLessThan(int task_count) {
|
||||
void WorkQueue::ThreadMain() {
|
||||
int thread_id;
|
||||
{
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
thread_id = GetThreadId();
|
||||
if (EveryIdWasAllocated())
|
||||
all_threads_have_ids()->Signal(); // Tell creator we're ready.
|
||||
@ -709,7 +709,7 @@ void WorkQueue::ThreadMain() {
|
||||
TimeDelta work_time;
|
||||
bool could_use_help;
|
||||
{
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
while (0 == task_count() && !shutdown()) {
|
||||
++waiting_thread_count_;
|
||||
work_is_available()->Wait();
|
||||
@ -732,13 +732,13 @@ void WorkQueue::ThreadMain() {
|
||||
if (work_time > TimeDelta::FromMilliseconds(0)) {
|
||||
// We could just sleep(), but we'll instead further exercise the
|
||||
// condition variable class, and do a timed wait.
|
||||
AutoLock auto_lock(private_lock);
|
||||
base::AutoLock auto_lock(private_lock);
|
||||
ConditionVariable private_cv(&private_lock);
|
||||
private_cv.TimedWait(work_time); // Unsynchronized waiting.
|
||||
}
|
||||
|
||||
{
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
// Send notification that we completed our "work."
|
||||
WorkIsCompleted(thread_id);
|
||||
}
|
||||
|
@ -15,8 +15,8 @@
|
||||
#if defined(OS_POSIX)
|
||||
#include <list>
|
||||
#include <utility>
|
||||
#include "base/lock.h"
|
||||
#include "base/ref_counted.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#endif
|
||||
|
||||
namespace base {
|
||||
@ -149,7 +149,7 @@ class WaitableEvent {
|
||||
|
||||
bool Dequeue(Waiter* waiter, void* tag);
|
||||
|
||||
Lock lock_;
|
||||
base::Lock lock_;
|
||||
const bool manual_reset_;
|
||||
bool signaled_;
|
||||
std::list<Waiter*> waiters_;
|
||||
|
4
base/third_party/dmg_fp/dtoa_wrapper.cc
vendored
4
base/third_party/dmg_fp/dtoa_wrapper.cc
vendored
@ -4,12 +4,12 @@
|
||||
//
|
||||
// The purpose of this file is to supply the macro definintions necessary
|
||||
// to make third_party/dmg_fp/dtoa.cc threadsafe.
|
||||
#include "base/lock.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/logging.h"
|
||||
|
||||
// We need two locks because they're sometimes grabbed at the same time.
|
||||
// A single lock would lead to an attempted recursive grab.
|
||||
static Lock dtoa_locks[2];
|
||||
static base::Lock dtoa_locks[2];
|
||||
|
||||
/*
|
||||
* This define and the code below is to trigger thread-safe behavior
|
||||
|
@ -46,8 +46,8 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/threading/platform_thread.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/synchronization/waitable_event.h"
|
||||
|
||||
namespace base {
|
||||
@ -173,7 +173,7 @@ class DelegateSimpleThreadPool : public DelegateSimpleThread::Delegate {
|
||||
int num_threads_;
|
||||
std::vector<DelegateSimpleThread*> threads_;
|
||||
std::queue<Delegate*> delegates_;
|
||||
Lock lock_; // Locks delegates_
|
||||
base::Lock lock_; // Locks delegates_
|
||||
WaitableEvent dry_; // Not signaled when there is no work to do.
|
||||
};
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef NDEBUG
|
||||
#include "base/lock.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/threading/platform_thread.h"
|
||||
#endif // NDEBUG
|
||||
|
||||
@ -51,7 +51,7 @@ class ThreadChecker {
|
||||
private:
|
||||
void EnsureThreadIdAssigned() const;
|
||||
|
||||
mutable Lock lock_;
|
||||
mutable base::Lock lock_;
|
||||
// This is mutable so that CalledOnValidThread can set it.
|
||||
// It's guarded by |lock_|.
|
||||
mutable PlatformThreadId valid_thread_id_;
|
||||
|
@ -3,8 +3,8 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/scoped_ptr.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/threading/platform_thread.h"
|
||||
#include "base/threading/simple_thread.h"
|
||||
#include "base/threading/thread_collision_warner.h"
|
||||
@ -266,30 +266,30 @@ TEST(ThreadCollisionTest, MTSynchedScopedBookCriticalSectionTest) {
|
||||
// a lock.
|
||||
class QueueUser : public base::DelegateSimpleThread::Delegate {
|
||||
public:
|
||||
QueueUser(NonThreadSafeQueue& queue, Lock& lock)
|
||||
QueueUser(NonThreadSafeQueue& queue, base::Lock& lock)
|
||||
: queue_(queue),
|
||||
lock_(lock) {}
|
||||
|
||||
virtual void Run() {
|
||||
{
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
queue_.push(0);
|
||||
}
|
||||
{
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
queue_.pop();
|
||||
}
|
||||
}
|
||||
private:
|
||||
NonThreadSafeQueue& queue_;
|
||||
Lock& lock_;
|
||||
base::Lock& lock_;
|
||||
};
|
||||
|
||||
AssertReporter* local_reporter = new AssertReporter();
|
||||
|
||||
NonThreadSafeQueue queue(local_reporter);
|
||||
|
||||
Lock lock;
|
||||
base::Lock lock;
|
||||
|
||||
QueueUser queue_user_a(queue, lock);
|
||||
QueueUser queue_user_b(queue, lock);
|
||||
@ -340,34 +340,34 @@ TEST(ThreadCollisionTest, MTSynchedScopedRecursiveBookCriticalSectionTest) {
|
||||
// a lock.
|
||||
class QueueUser : public base::DelegateSimpleThread::Delegate {
|
||||
public:
|
||||
QueueUser(NonThreadSafeQueue& queue, Lock& lock)
|
||||
QueueUser(NonThreadSafeQueue& queue, base::Lock& lock)
|
||||
: queue_(queue),
|
||||
lock_(lock) {}
|
||||
|
||||
virtual void Run() {
|
||||
{
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
queue_.push(0);
|
||||
}
|
||||
{
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
queue_.bar();
|
||||
}
|
||||
{
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
queue_.pop();
|
||||
}
|
||||
}
|
||||
private:
|
||||
NonThreadSafeQueue& queue_;
|
||||
Lock& lock_;
|
||||
base::Lock& lock_;
|
||||
};
|
||||
|
||||
AssertReporter* local_reporter = new AssertReporter();
|
||||
|
||||
NonThreadSafeQueue queue(local_reporter);
|
||||
|
||||
Lock lock;
|
||||
base::Lock lock;
|
||||
|
||||
QueueUser queue_user_a(queue, lock);
|
||||
QueueUser queue_user_b(queue, lock);
|
||||
|
@ -6,8 +6,8 @@
|
||||
|
||||
#include <set>
|
||||
|
||||
#include "base/lock.h"
|
||||
#include "base/synchronization/condition_variable.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/task.h"
|
||||
#include "base/threading/platform_thread.h"
|
||||
#include "base/synchronization/waitable_event.h"
|
||||
@ -61,12 +61,12 @@ class IncrementingTask : public Task {
|
||||
|
||||
virtual void Run() {
|
||||
AddSelfToUniqueThreadSet();
|
||||
AutoLock locked(*counter_lock_);
|
||||
base::AutoLock locked(*counter_lock_);
|
||||
(*counter_)++;
|
||||
}
|
||||
|
||||
void AddSelfToUniqueThreadSet() {
|
||||
AutoLock locked(*unique_threads_lock_);
|
||||
base::AutoLock locked(*unique_threads_lock_);
|
||||
unique_threads_->insert(PlatformThread::CurrentId());
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ class BlockingIncrementingTask : public Task {
|
||||
|
||||
virtual void Run() {
|
||||
{
|
||||
AutoLock num_waiting_to_start_locked(*num_waiting_to_start_lock_);
|
||||
base::AutoLock num_waiting_to_start_locked(*num_waiting_to_start_lock_);
|
||||
(*num_waiting_to_start_)++;
|
||||
}
|
||||
num_waiting_to_start_cv_->Signal();
|
||||
@ -138,14 +138,14 @@ class PosixDynamicThreadPoolTest : public testing::Test {
|
||||
}
|
||||
|
||||
void WaitForTasksToStart(int num_tasks) {
|
||||
AutoLock num_waiting_to_start_locked(num_waiting_to_start_lock_);
|
||||
base::AutoLock num_waiting_to_start_locked(num_waiting_to_start_lock_);
|
||||
while (num_waiting_to_start_ < num_tasks) {
|
||||
num_waiting_to_start_cv_.Wait();
|
||||
}
|
||||
}
|
||||
|
||||
void WaitForIdleThreads(int num_idle_threads) {
|
||||
AutoLock pool_locked(*peer_.lock());
|
||||
base::AutoLock pool_locked(*peer_.lock());
|
||||
while (peer_.num_idle_threads() < num_idle_threads) {
|
||||
peer_.num_idle_threads_cv()->Wait();
|
||||
}
|
||||
@ -249,7 +249,7 @@ TEST_F(PosixDynamicThreadPoolTest, Complex) {
|
||||
|
||||
// Wake up all idle threads so they can exit.
|
||||
{
|
||||
AutoLock locked(*peer_.lock());
|
||||
base::AutoLock locked(*peer_.lock());
|
||||
while (peer_.num_idle_threads() > 0) {
|
||||
peer_.tasks_available_cv()->Signal();
|
||||
peer_.num_idle_threads_cv()->Wait();
|
||||
|
@ -41,10 +41,10 @@
|
||||
#include <mmsystem.h>
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/cpu.h"
|
||||
#include "base/singleton.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
|
||||
using base::Time;
|
||||
using base::TimeDelta;
|
||||
@ -262,7 +262,7 @@ DWORD last_seen_now = 0;
|
||||
// easy to use a Singleton without even knowing it, and that may lead to many
|
||||
// gotchas). Its impact on startup time should be negligible due to low-level
|
||||
// nature of time code.
|
||||
Lock rollover_lock;
|
||||
base::Lock rollover_lock;
|
||||
|
||||
// We use timeGetTime() to implement TimeTicks::Now(). This can be problematic
|
||||
// because it returns the number of milliseconds since Windows has started,
|
||||
@ -270,7 +270,7 @@ Lock rollover_lock;
|
||||
// rollover ourselves, which works if TimeTicks::Now() is called at least every
|
||||
// 49 days.
|
||||
TimeDelta RolloverProtectedNow() {
|
||||
AutoLock locked(rollover_lock);
|
||||
base::AutoLock locked(rollover_lock);
|
||||
// We should hold the lock while calling tick_function to make sure that
|
||||
// we keep last_seen_now stay correctly in sync.
|
||||
DWORD now = tick_function();
|
||||
@ -409,4 +409,4 @@ int64 TimeTicks::GetQPCDriftMicroseconds() {
|
||||
// static
|
||||
bool TimeTicks::IsHighResClockWorking() {
|
||||
return HighResNowSingleton::GetInstance()->IsUsingHighResClock();
|
||||
}
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ Births::Births(const Location& location)
|
||||
// static
|
||||
ThreadData* ThreadData::first_ = NULL;
|
||||
// static
|
||||
Lock ThreadData::list_lock_;
|
||||
base::Lock ThreadData::list_lock_;
|
||||
|
||||
// static
|
||||
ThreadData::Status ThreadData::status_ = ThreadData::UNINITIALIZED;
|
||||
@ -111,7 +111,7 @@ ThreadData* ThreadData::current() {
|
||||
bool too_late_to_create = false;
|
||||
{
|
||||
registry = new ThreadData;
|
||||
AutoLock lock(list_lock_);
|
||||
base::AutoLock lock(list_lock_);
|
||||
// Use lock to insure we have most recent status.
|
||||
if (!IsActive()) {
|
||||
too_late_to_create = true;
|
||||
@ -285,7 +285,7 @@ Births* ThreadData::TallyABirth(const Location& location) {
|
||||
Births* tracker = new Births(location);
|
||||
// Lock since the map may get relocated now, and other threads sometimes
|
||||
// snapshot it (but they lock before copying it).
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
birth_map_[location] = tracker;
|
||||
return tracker;
|
||||
}
|
||||
@ -305,13 +305,13 @@ void ThreadData::TallyADeath(const Births& lifetimes,
|
||||
return;
|
||||
}
|
||||
|
||||
AutoLock lock(lock_); // Lock since the map may get relocated now.
|
||||
base::AutoLock lock(lock_); // Lock since the map may get relocated now.
|
||||
death_map_[&lifetimes].RecordDeath(duration);
|
||||
}
|
||||
|
||||
// static
|
||||
ThreadData* ThreadData::first() {
|
||||
AutoLock lock(list_lock_);
|
||||
base::AutoLock lock(list_lock_);
|
||||
return first_;
|
||||
}
|
||||
|
||||
@ -323,7 +323,7 @@ const std::string ThreadData::ThreadName() const {
|
||||
|
||||
// This may be called from another thread.
|
||||
void ThreadData::SnapshotBirthMap(BirthMap *output) const {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
for (BirthMap::const_iterator it = birth_map_.begin();
|
||||
it != birth_map_.end(); ++it)
|
||||
(*output)[it->first] = it->second;
|
||||
@ -331,7 +331,7 @@ void ThreadData::SnapshotBirthMap(BirthMap *output) const {
|
||||
|
||||
// This may be called from another thread.
|
||||
void ThreadData::SnapshotDeathMap(DeathMap *output) const {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
for (DeathMap::const_iterator it = death_map_.begin();
|
||||
it != death_map_.end(); ++it)
|
||||
(*output)[it->first] = it->second;
|
||||
@ -348,7 +348,7 @@ void ThreadData::ResetAllThreadData() {
|
||||
}
|
||||
|
||||
void ThreadData::Reset() {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
for (DeathMap::iterator it = death_map_.begin();
|
||||
it != death_map_.end(); ++it)
|
||||
it->second.Clear();
|
||||
@ -372,7 +372,7 @@ class ThreadData::ThreadSafeDownCounter {
|
||||
|
||||
private:
|
||||
size_t remaining_count_;
|
||||
Lock lock_; // protect access to remaining_count_.
|
||||
base::Lock lock_; // protect access to remaining_count_.
|
||||
};
|
||||
|
||||
ThreadData::ThreadSafeDownCounter::ThreadSafeDownCounter(size_t count)
|
||||
@ -382,7 +382,7 @@ ThreadData::ThreadSafeDownCounter::ThreadSafeDownCounter(size_t count)
|
||||
|
||||
bool ThreadData::ThreadSafeDownCounter::LastCaller() {
|
||||
{
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
if (--remaining_count_)
|
||||
return false;
|
||||
} // Release lock, so we can delete everything in this instance.
|
||||
@ -461,12 +461,12 @@ bool ThreadData::StartTracking(bool status) {
|
||||
#endif
|
||||
|
||||
if (!status) {
|
||||
AutoLock lock(list_lock_);
|
||||
base::AutoLock lock(list_lock_);
|
||||
DCHECK(status_ == ACTIVE || status_ == SHUTDOWN);
|
||||
status_ = SHUTDOWN;
|
||||
return true;
|
||||
}
|
||||
AutoLock lock(list_lock_);
|
||||
base::AutoLock lock(list_lock_);
|
||||
DCHECK(status_ == UNINITIALIZED);
|
||||
CHECK(tls_index_.Initialize(NULL));
|
||||
status_ = ACTIVE;
|
||||
@ -504,7 +504,7 @@ void ThreadData::ShutdownSingleThreadedCleanup() {
|
||||
return;
|
||||
ThreadData* thread_data_list;
|
||||
{
|
||||
AutoLock lock(list_lock_);
|
||||
base::AutoLock lock(list_lock_);
|
||||
thread_data_list = first_;
|
||||
first_ = NULL;
|
||||
}
|
||||
@ -614,7 +614,7 @@ void DataCollector::Append(const ThreadData& thread_data) {
|
||||
thread_data.SnapshotDeathMap(&death_map);
|
||||
|
||||
// Use our lock to protect our accumulation activity.
|
||||
AutoLock lock(accumulation_lock_);
|
||||
base::AutoLock lock(accumulation_lock_);
|
||||
|
||||
DCHECK(count_of_contributing_threads_);
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "base/lock.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/tracked.h"
|
||||
#include "base/threading/thread_local_storage.h"
|
||||
|
||||
@ -322,7 +322,7 @@ class DataCollector {
|
||||
// seen a death count.
|
||||
BirthCount global_birth_count_;
|
||||
|
||||
Lock accumulation_lock_; // Protects access during accumulation phase.
|
||||
base::Lock accumulation_lock_; // Protects access during accumulation phase.
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(DataCollector);
|
||||
};
|
||||
@ -577,7 +577,7 @@ class ThreadData {
|
||||
// Link to the most recently created instance (starts a null terminated list).
|
||||
static ThreadData* first_;
|
||||
// Protection for access to first_.
|
||||
static Lock list_lock_;
|
||||
static base::Lock list_lock_;
|
||||
|
||||
// We set status_ to SHUTDOWN when we shut down the tracking service. This
|
||||
// setting is redundantly established by all participating threads so that we
|
||||
@ -613,7 +613,7 @@ class ThreadData {
|
||||
// thread, or reading from another thread. For reading from this thread we
|
||||
// don't need a lock, as there is no potential for a conflict since the
|
||||
// writing is only done from this thread.
|
||||
mutable Lock lock_;
|
||||
mutable base::Lock lock_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ThreadData);
|
||||
};
|
||||
|
@ -8,8 +8,8 @@
|
||||
|
||||
#include <atlbase.h>
|
||||
|
||||
#include "base/lock.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/tuple.h"
|
||||
#include "base/win/scoped_comptr.h"
|
||||
#include "ceee/common/com_utils.h"
|
||||
|
@ -157,7 +157,7 @@ void BrokerRpcServer_SendUmaHistogramTimes(handle_t binding_handle,
|
||||
int sample) {
|
||||
// We can't unfortunately use the HISTOGRAM_*_TIMES here because they use
|
||||
// static variables to save time.
|
||||
AutoLock lock(g_metrics_lock);
|
||||
base::AutoLock lock(g_metrics_lock);
|
||||
scoped_refptr<base::Histogram> counter =
|
||||
base::Histogram::FactoryTimeGet(name,
|
||||
base::TimeDelta::FromMilliseconds(1),
|
||||
@ -175,7 +175,7 @@ void BrokerRpcServer_SendUmaHistogramData(handle_t binding_handle,
|
||||
int bucket_count) {
|
||||
// We can't unfortunately use the HISTOGRAM_*_COUNT here because they use
|
||||
// static variables to save time.
|
||||
AutoLock lock(g_metrics_lock);
|
||||
base::AutoLock lock(g_metrics_lock);
|
||||
scoped_refptr<base::Histogram> counter =
|
||||
base::Histogram::FactoryGet(name, min, max, bucket_count,
|
||||
base::Histogram::kUmaTargetedHistogramFlag);
|
||||
|
@ -79,7 +79,7 @@ bool ExecutorsManager::IsKnownWindow(HWND window) {
|
||||
}
|
||||
|
||||
bool ExecutorsManager::IsKnownWindowImpl(HWND window) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
return handle_map_.find(window) != handle_map_.end() ||
|
||||
frame_window_families_.find(window) != frame_window_families_.end();
|
||||
}
|
||||
@ -92,7 +92,7 @@ HWND ExecutorsManager::FindTabChildImpl(HWND window) {
|
||||
if (!common_api::CommonApiResult::IsIeFrameClass(window))
|
||||
return NULL;
|
||||
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
FrameTabsMap::iterator it = frame_window_families_.find(window);
|
||||
if (it == frame_window_families_.end())
|
||||
return NULL;
|
||||
@ -107,7 +107,7 @@ HRESULT ExecutorsManager::RegisterTabExecutor(ThreadId thread_id,
|
||||
// This way we can add a ref to the module for the existence of the map.
|
||||
bool map_was_empty = false;
|
||||
{
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
map_was_empty = executors_.empty();
|
||||
if (!map_was_empty && executors_.find(thread_id) != executors_.end()) {
|
||||
return S_OK;
|
||||
@ -136,7 +136,7 @@ HRESULT ExecutorsManager::RegisterWindowExecutor(ThreadId thread_id,
|
||||
// our map in a thread safe way...
|
||||
CHandle executor_registration_gate;
|
||||
{
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
if (executors_.find(thread_id) != executors_.end()) {
|
||||
DCHECK(false) << "Unexpected registered thread_id: " << thread_id;
|
||||
return E_UNEXPECTED;
|
||||
@ -173,7 +173,7 @@ HRESULT ExecutorsManager::RegisterWindowExecutor(ThreadId thread_id,
|
||||
// This way we can add a ref to the module for the existence of the map.
|
||||
bool map_was_empty = false;
|
||||
{
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
map_was_empty = executors_.empty();
|
||||
// We should not get here if we already have an executor for that thread.
|
||||
DCHECK(executors_.find(thread_id) == executors_.end());
|
||||
@ -206,7 +206,7 @@ HRESULT ExecutorsManager::GetExecutor(ThreadId thread_id, HWND window,
|
||||
// But we must create the executor creator outside of the lock.
|
||||
bool create_executor = false;
|
||||
{
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
ExecutorsMap::iterator exec_iter = executors_.find(thread_id);
|
||||
if (exec_iter != executors_.end()) {
|
||||
// Found it... We're done... That was quick!!! :-)
|
||||
@ -266,7 +266,7 @@ HRESULT ExecutorsManager::GetExecutor(ThreadId thread_id, HWND window,
|
||||
reinterpret_cast<CeeeWindowHandle>(window));
|
||||
if (FAILED(hr)) {
|
||||
// This could happen if the thread we want to hook to died prematurely.
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
pending_registrations_.erase(thread_id);
|
||||
return hr;
|
||||
}
|
||||
@ -285,7 +285,7 @@ HRESULT ExecutorsManager::GetExecutor(ThreadId thread_id, HWND window,
|
||||
}
|
||||
|
||||
// Do our own cleanup and return a reference thread safely...
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
pending_registrations_.erase(thread_id);
|
||||
ExecutorsMap::iterator iter = executors_.find(thread_id);
|
||||
if (iter == executors_.end()) {
|
||||
@ -302,7 +302,7 @@ HRESULT ExecutorsManager::RemoveExecutor(ThreadId thread_id) {
|
||||
CComPtr<IUnknown> dead_executor;
|
||||
bool map_is_empty = false;
|
||||
{
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
ExecutorsMap::iterator iter = executors_.find(thread_id);
|
||||
if (iter == executors_.end()) {
|
||||
return S_FALSE;
|
||||
@ -348,7 +348,7 @@ void ExecutorsManager::SetTabIdForHandle(int tab_id, HWND handle) {
|
||||
DCHECK(common_api::CommonApiResult::IsIeFrameClass(frame_window));
|
||||
bool send_on_create = false;
|
||||
{
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
if (tab_id_map_.end() != tab_id_map_.find(tab_id) ||
|
||||
handle_map_.end() != handle_map_.find(handle)) {
|
||||
// Avoid double-setting of tab id -> handle mappings, which could
|
||||
@ -382,7 +382,7 @@ void ExecutorsManager::SetTabIdForHandle(int tab_id, HWND handle) {
|
||||
|
||||
void ExecutorsManager::SetTabToolBandIdForHandle(int tool_band_id,
|
||||
HWND handle) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
if (tool_band_id_map_.end() != tool_band_id_map_.find(tool_band_id) ||
|
||||
tool_band_handle_map_.end() != tool_band_handle_map_.find(handle)) {
|
||||
// Avoid double-setting of tool band id -> handle mappings, which could
|
||||
@ -412,7 +412,7 @@ void ExecutorsManager::DeleteTabHandle(HWND handle) {
|
||||
frame_window = NULL;
|
||||
|
||||
bool send_on_removed = false;
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
{
|
||||
HandleMap::iterator handle_it = handle_map_.find(handle);
|
||||
// Don't DCHECK, we may be called more than once, but it's fine,
|
||||
@ -492,7 +492,7 @@ void ExecutorsManager::CleanupMapsForThread(DWORD thread_id) {
|
||||
// of that for us, and 2) we can't call DeleteHandle from within a lock.
|
||||
std::vector<HWND> tab_handles_to_remove;
|
||||
{
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
HandleMap::iterator handle_it = handle_map_.begin();
|
||||
for (; handle_it != handle_map_.end(); ++ handle_it) {
|
||||
if (::GetWindowThreadProcessId(handle_it->first, NULL) == thread_id)
|
||||
@ -507,7 +507,7 @@ void ExecutorsManager::CleanupMapsForThread(DWORD thread_id) {
|
||||
}
|
||||
|
||||
bool ExecutorsManager::IsTabIdValid(int tab_id) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
TabIdMap::const_iterator it = tab_id_map_.find(tab_id);
|
||||
#ifdef DEBUG
|
||||
return it != tab_id_map_.end() && it->second != INVALID_HANDLE_VALUE;
|
||||
@ -517,7 +517,7 @@ bool ExecutorsManager::IsTabIdValid(int tab_id) {
|
||||
}
|
||||
|
||||
HWND ExecutorsManager::GetTabHandleFromId(int tab_id) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
TabIdMap::const_iterator it = tab_id_map_.find(tab_id);
|
||||
DCHECK(it != tab_id_map_.end());
|
||||
|
||||
@ -530,7 +530,7 @@ HWND ExecutorsManager::GetTabHandleFromId(int tab_id) {
|
||||
}
|
||||
|
||||
bool ExecutorsManager::IsTabHandleValid(HWND tab_handle) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
HandleMap::const_iterator it = handle_map_.find(tab_handle);
|
||||
#ifdef DEBUG
|
||||
return it != handle_map_.end() && it->second != kInvalidChromeSessionId;
|
||||
@ -540,7 +540,7 @@ bool ExecutorsManager::IsTabHandleValid(HWND tab_handle) {
|
||||
}
|
||||
|
||||
int ExecutorsManager::GetTabIdFromHandle(HWND tab_handle) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
HandleMap::const_iterator it = handle_map_.find(tab_handle);
|
||||
if (it == handle_map_.end())
|
||||
return kInvalidChromeSessionId;
|
||||
@ -549,7 +549,7 @@ int ExecutorsManager::GetTabIdFromHandle(HWND tab_handle) {
|
||||
}
|
||||
|
||||
HWND ExecutorsManager::GetTabHandleFromToolBandId(int tool_band_id) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
TabIdMap::const_iterator it = tool_band_id_map_.find(tool_band_id);
|
||||
|
||||
if (it == tool_band_id_map_.end())
|
||||
@ -567,7 +567,7 @@ HRESULT ExecutorsManager::GetExecutorCreator(
|
||||
|
||||
size_t ExecutorsManager::GetThreadHandles(
|
||||
CHandle thread_handles[], ThreadId thread_ids[], size_t num_threads) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
ExecutorsMap::iterator iter = executors_.begin();
|
||||
size_t index = 0;
|
||||
for (; index < num_threads && iter != executors_.end(); ++index, ++iter) {
|
||||
|
@ -14,8 +14,8 @@
|
||||
#include <map>
|
||||
#include <list>
|
||||
|
||||
#include "base/lock.h"
|
||||
#include "base/singleton.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/task.h"
|
||||
#include "ceee/common/window_utils.h"
|
||||
#include "ceee/ie/broker/window_events_funnel.h"
|
||||
@ -252,7 +252,7 @@ class ExecutorsManager {
|
||||
|
||||
// To protect the access to the maps (ExecutorsManager::executors_ &
|
||||
// ExecutorsManager::pending_registrations_ & tab_id_map_/handle_map_).
|
||||
Lock lock_;
|
||||
base::Lock lock_;
|
||||
|
||||
// Test seam.
|
||||
WindowEventsFunnel windows_events_funnel_;
|
||||
|
@ -235,7 +235,7 @@ void CookieAccountant::ConnectBroker() {
|
||||
|
||||
void CookieAccountant::Initialize() {
|
||||
{
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
if (initializing_)
|
||||
return;
|
||||
initializing_ = true;
|
||||
@ -257,7 +257,7 @@ void CookieAccountant::Initialize() {
|
||||
DCHECK(internet_set_cookie_ex_a_patch_.is_patched() ||
|
||||
internet_set_cookie_ex_w_patch_.is_patched());
|
||||
{
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
initializing_ = false;
|
||||
}
|
||||
}
|
||||
|
@ -13,8 +13,8 @@
|
||||
#include <string>
|
||||
|
||||
#include "app/win/iat_patch_function.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/singleton.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/time.h"
|
||||
#include "ceee/ie/plugin/bho/cookie_events_funnel.h"
|
||||
#include "net/base/cookie_monster.h"
|
||||
@ -86,7 +86,7 @@ class CookieAccountant {
|
||||
bool initializing_;
|
||||
|
||||
// A lock that protects access to the function patches.
|
||||
Lock lock_;
|
||||
base::Lock lock_;
|
||||
|
||||
// Cached singleton instance. Useful for unit testing.
|
||||
static CookieAccountant* singleton_instance_;
|
||||
|
@ -196,7 +196,7 @@ bool WindowMessageSource::AddEntryToMap(DWORD thread_id,
|
||||
WindowMessageSource* source) {
|
||||
DCHECK(source != NULL);
|
||||
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
MessageSourceMap::const_iterator iter = message_source_map_.find(thread_id);
|
||||
if (iter != message_source_map_.end())
|
||||
return false;
|
||||
@ -208,13 +208,13 @@ bool WindowMessageSource::AddEntryToMap(DWORD thread_id,
|
||||
|
||||
// static
|
||||
WindowMessageSource* WindowMessageSource::GetEntryFromMap(DWORD thread_id) {
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
MessageSourceMap::const_iterator iter = message_source_map_.find(thread_id);
|
||||
return iter == message_source_map_.end() ? NULL : iter->second;
|
||||
}
|
||||
|
||||
// static
|
||||
void WindowMessageSource::RemoveEntryFromMap(DWORD thread_id) {
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
message_source_map_.erase(thread_id);
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
|
||||
// A WindowMessageSource instance monitors keyboard and mouse messages on the
|
||||
// same thread as the one that creates the instance, and fires events to those
|
||||
@ -95,7 +95,7 @@ class WindowMessageSource {
|
||||
static MessageSourceMap message_source_map_;
|
||||
|
||||
// Used to protect access to the message_source_map_.
|
||||
static Lock lock_;
|
||||
static base::Lock lock_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(WindowMessageSource);
|
||||
};
|
||||
|
@ -705,7 +705,7 @@ void ScriptHost::DebugApplication::RegisterDebugApplication() {
|
||||
}
|
||||
|
||||
void ScriptHost::DebugApplication::Initialize() {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
++initialization_count_;
|
||||
|
||||
@ -715,7 +715,7 @@ void ScriptHost::DebugApplication::Initialize() {
|
||||
|
||||
void ScriptHost::DebugApplication::Initialize(
|
||||
IUnknown* debug_application_provider) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
++initialization_count_;
|
||||
|
||||
@ -742,7 +742,7 @@ void ScriptHost::DebugApplication::Initialize(
|
||||
|
||||
void ScriptHost::DebugApplication::Initialize(
|
||||
IProcessDebugManager* manager, IDebugApplication* app) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
// This function is exposed for testing only.
|
||||
DCHECK_EQ(0U, initialization_count_);
|
||||
|
||||
@ -758,7 +758,7 @@ void ScriptHost::DebugApplication::Initialize(
|
||||
|
||||
|
||||
void ScriptHost::DebugApplication::Terminate() {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
DCHECK_GT(initialization_count_, (size_t)0);
|
||||
--initialization_count_;
|
||||
|
||||
@ -778,7 +778,7 @@ void ScriptHost::DebugApplication::Terminate() {
|
||||
|
||||
HRESULT ScriptHost::DebugApplication::GetDebugApplication(
|
||||
IDebugApplication** app) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
if (debug_application_ == NULL)
|
||||
return E_NOTIMPL;
|
||||
@ -788,7 +788,7 @@ HRESULT ScriptHost::DebugApplication::GetDebugApplication(
|
||||
|
||||
HRESULT ScriptHost::DebugApplication::GetRootApplicationNode(
|
||||
IDebugApplicationNode** debug_app_node) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
if (debug_application_ == NULL) {
|
||||
*debug_app_node = NULL;
|
||||
@ -801,7 +801,7 @@ HRESULT ScriptHost::DebugApplication::GetRootApplicationNode(
|
||||
HRESULT ScriptHost::DebugApplication::CreateDebugDocumentHelper(
|
||||
const wchar_t* long_name, const wchar_t* code, TEXT_DOC_ATTR attributes,
|
||||
IDebugDocumentHelper** helper) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
if (debug_application_ == NULL)
|
||||
return S_OK;
|
||||
|
@ -19,8 +19,8 @@
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include "base/lock.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "third_party/activscp/activdbg.h"
|
||||
#include "ceee/common/initializing_coclass.h"
|
||||
|
||||
@ -293,7 +293,7 @@ class ScriptHost::DebugApplication {
|
||||
void RegisterDebugApplication(); // Under lock_.
|
||||
|
||||
// Protects all members below.
|
||||
::Lock lock_; // Our containing class has a Lock method.
|
||||
base::Lock lock_;
|
||||
|
||||
// Number of initialization calls.
|
||||
size_t initialization_count_;
|
||||
|
@ -17,13 +17,13 @@ namespace testing {
|
||||
Lock InstanceCountMixinBase::lock_;
|
||||
|
||||
InstanceCountMixinBase::InstanceCountMixinBase() {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
instances.insert(this);
|
||||
}
|
||||
|
||||
InstanceCountMixinBase::~InstanceCountMixinBase() {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
EXPECT_EQ(1, instances.erase(this));
|
||||
}
|
||||
@ -34,7 +34,7 @@ void InstanceCountMixinBase::GetDescription(std::string* description) const {
|
||||
}
|
||||
|
||||
void InstanceCountMixinBase::LogLeakedInstances() {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
InstanceSet::const_iterator it(instances.begin());
|
||||
InstanceSet::const_iterator end(instances.end());
|
||||
@ -49,7 +49,7 @@ void InstanceCountMixinBase::LogLeakedInstances() {
|
||||
typedef InstanceCountMixinBase::InstanceSet InstanceSet;
|
||||
|
||||
size_t InstanceCountMixinBase::all_instance_count() {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
return instances.size();
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <string>
|
||||
#include <set>
|
||||
|
||||
#include "base/lock.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
|
||||
namespace testing {
|
||||
|
||||
@ -47,7 +47,7 @@ class InstanceCountMixinBase {
|
||||
static InstanceSet::const_iterator end();
|
||||
|
||||
protected:
|
||||
static Lock lock_;
|
||||
static base::Lock lock_;
|
||||
};
|
||||
|
||||
// Inherit test classes from this class to get a per-class instance count.
|
||||
@ -60,11 +60,11 @@ template <class T>
|
||||
class InstanceCountMixin : public InstanceCountMixinBase {
|
||||
public:
|
||||
InstanceCountMixin() {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
++instance_count_;
|
||||
}
|
||||
~InstanceCountMixin() {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
--instance_count_;
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
#include "base/atomicops.h"
|
||||
#include "base/lazy_instance.h"
|
||||
#include "base/lock.h"
|
||||
#include "ipc/ipc_channel_proxy.h"
|
||||
#include "net/base/completion_callback.h"
|
||||
#include "net/base/cookie_store.h"
|
||||
|
@ -296,7 +296,7 @@ void BookmarkModel::SetURL(const BookmarkNode* node, const GURL& url) {
|
||||
CancelPendingFavIconLoadRequests(AsMutable(node));
|
||||
|
||||
{
|
||||
AutoLock url_lock(url_lock_);
|
||||
base::AutoLock url_lock(url_lock_);
|
||||
NodesOrderedByURLSet::iterator i = nodes_ordered_by_url_set_.find(
|
||||
AsMutable(node));
|
||||
DCHECK(i != nodes_ordered_by_url_set_.end());
|
||||
@ -323,7 +323,7 @@ bool BookmarkModel::IsLoaded() {
|
||||
|
||||
void BookmarkModel::GetNodesByURL(const GURL& url,
|
||||
std::vector<const BookmarkNode*>* nodes) {
|
||||
AutoLock url_lock(url_lock_);
|
||||
base::AutoLock url_lock(url_lock_);
|
||||
BookmarkNode tmp_node(url);
|
||||
NodesOrderedByURLSet::iterator i = nodes_ordered_by_url_set_.find(&tmp_node);
|
||||
while (i != nodes_ordered_by_url_set_.end() && (*i)->GetURL() == url) {
|
||||
@ -344,7 +344,7 @@ const BookmarkNode* BookmarkModel::GetMostRecentlyAddedNodeForURL(
|
||||
}
|
||||
|
||||
void BookmarkModel::GetBookmarks(std::vector<GURL>* urls) {
|
||||
AutoLock url_lock(url_lock_);
|
||||
base::AutoLock url_lock(url_lock_);
|
||||
const GURL* last_url = NULL;
|
||||
for (NodesOrderedByURLSet::iterator i = nodes_ordered_by_url_set_.begin();
|
||||
i != nodes_ordered_by_url_set_.end(); ++i) {
|
||||
@ -357,12 +357,12 @@ void BookmarkModel::GetBookmarks(std::vector<GURL>* urls) {
|
||||
}
|
||||
|
||||
bool BookmarkModel::HasBookmarks() {
|
||||
AutoLock url_lock(url_lock_);
|
||||
base::AutoLock url_lock(url_lock_);
|
||||
return !nodes_ordered_by_url_set_.empty();
|
||||
}
|
||||
|
||||
bool BookmarkModel::IsBookmarked(const GURL& url) {
|
||||
AutoLock url_lock(url_lock_);
|
||||
base::AutoLock url_lock(url_lock_);
|
||||
return IsBookmarkedNoLock(url);
|
||||
}
|
||||
|
||||
@ -419,7 +419,7 @@ const BookmarkNode* BookmarkModel::AddURLWithCreationTime(
|
||||
|
||||
{
|
||||
// Only hold the lock for the duration of the insert.
|
||||
AutoLock url_lock(url_lock_);
|
||||
base::AutoLock url_lock(url_lock_);
|
||||
nodes_ordered_by_url_set_.insert(new_node);
|
||||
}
|
||||
|
||||
@ -574,7 +574,7 @@ void BookmarkModel::DoneLoading(
|
||||
root_.Add(1, other_node_);
|
||||
|
||||
{
|
||||
AutoLock url_lock(url_lock_);
|
||||
base::AutoLock url_lock(url_lock_);
|
||||
// Update nodes_ordered_by_url_set_ from the nodes.
|
||||
PopulateNodesByURL(&root_);
|
||||
}
|
||||
@ -602,7 +602,7 @@ void BookmarkModel::RemoveAndDeleteNode(BookmarkNode* delete_me) {
|
||||
parent->Remove(index);
|
||||
history::URLsStarredDetails details(false);
|
||||
{
|
||||
AutoLock url_lock(url_lock_);
|
||||
base::AutoLock url_lock(url_lock_);
|
||||
RemoveNode(node.get(), &details.changed_urls);
|
||||
|
||||
// RemoveNode adds an entry to changed_urls for each node of type URL. As we
|
||||
|
@ -11,9 +11,9 @@
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
#include "base/lock.h"
|
||||
#include "base/observer_list.h"
|
||||
#include "base/string16.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/synchronization/waitable_event.h"
|
||||
#include "chrome/browser/bookmarks/bookmark_model_observer.h"
|
||||
#include "chrome/browser/bookmarks/bookmark_service.h"
|
||||
@ -455,7 +455,7 @@ class BookmarkModel : public NotificationObserver, public BookmarkService {
|
||||
// such, be sure and wrap all usage of it around url_lock_.
|
||||
typedef std::multiset<BookmarkNode*, NodeURLComparator> NodesOrderedByURLSet;
|
||||
NodesOrderedByURLSet nodes_ordered_by_url_set_;
|
||||
Lock url_lock_;
|
||||
base::Lock url_lock_;
|
||||
|
||||
// Used for loading favicons and the empty history request.
|
||||
CancelableRequestConsumerTSimple<BookmarkNode*> load_consumer_;
|
||||
|
@ -63,7 +63,7 @@ class BrowserThreadMessageLoopProxy : public base::MessageLoopProxy {
|
||||
};
|
||||
|
||||
|
||||
Lock BrowserThread::lock_;
|
||||
base::Lock BrowserThread::lock_;
|
||||
|
||||
BrowserThread* BrowserThread::browser_threads_[ID_COUNT];
|
||||
|
||||
@ -81,7 +81,7 @@ BrowserThread::BrowserThread(ID identifier, MessageLoop* message_loop)
|
||||
}
|
||||
|
||||
void BrowserThread::Initialize() {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
DCHECK(identifier_ >= 0 && identifier_ < ID_COUNT);
|
||||
DCHECK(browser_threads_[identifier_] == NULL);
|
||||
browser_threads_[identifier_] = this;
|
||||
@ -93,7 +93,7 @@ BrowserThread::~BrowserThread() {
|
||||
// correct BrowserThread succeeds.
|
||||
Stop();
|
||||
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
browser_threads_[identifier_] = NULL;
|
||||
#ifndef NDEBUG
|
||||
// Double check that the threads are ordered correctly in the enumeration.
|
||||
@ -106,7 +106,7 @@ BrowserThread::~BrowserThread() {
|
||||
|
||||
// static
|
||||
bool BrowserThread::IsWellKnownThread(ID identifier) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
return (identifier >= 0 && identifier < ID_COUNT &&
|
||||
browser_threads_[identifier]);
|
||||
}
|
||||
@ -118,7 +118,7 @@ bool BrowserThread::CurrentlyOn(ID identifier) {
|
||||
// function.
|
||||
// http://crbug.com/63678
|
||||
base::ThreadRestrictions::ScopedAllowSingleton allow_singleton;
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
DCHECK(identifier >= 0 && identifier < ID_COUNT);
|
||||
return browser_threads_[identifier] &&
|
||||
browser_threads_[identifier]->message_loop() == MessageLoop::current();
|
||||
@ -126,7 +126,7 @@ bool BrowserThread::CurrentlyOn(ID identifier) {
|
||||
|
||||
// static
|
||||
bool BrowserThread::IsMessageLoopValid(ID identifier) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
DCHECK(identifier >= 0 && identifier < ID_COUNT);
|
||||
return browser_threads_[identifier] &&
|
||||
browser_threads_[identifier]->message_loop();
|
||||
|
@ -6,7 +6,7 @@
|
||||
#define CHROME_BROWSER_BROWSER_THREAD_H_
|
||||
#pragma once
|
||||
|
||||
#include "base/lock.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/task.h"
|
||||
#include "base/threading/thread.h"
|
||||
|
||||
@ -197,7 +197,7 @@ class BrowserThread : public base::Thread {
|
||||
|
||||
// This lock protects |browser_threads_|. Do not read or modify that array
|
||||
// without holding this lock. Do not block while holding this lock.
|
||||
static Lock lock_;
|
||||
static base::Lock lock_;
|
||||
|
||||
// An array of the BrowserThread objects. This array is protected by |lock_|.
|
||||
// The threads are not owned by this array. Typically, the threads are owned
|
||||
|
@ -92,12 +92,12 @@
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/callback.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/message_loop.h"
|
||||
#include "base/ref_counted.h"
|
||||
#include "base/scoped_ptr.h"
|
||||
#include "base/synchronization/cancellation_flag.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/task.h"
|
||||
#include "build/build_config.h"
|
||||
|
||||
|
@ -46,7 +46,7 @@ CertStore::~CertStore() {
|
||||
|
||||
int CertStore::StoreCert(net::X509Certificate* cert, int process_id) {
|
||||
DCHECK(cert);
|
||||
AutoLock autoLock(cert_lock_);
|
||||
base::AutoLock autoLock(cert_lock_);
|
||||
|
||||
int cert_id;
|
||||
|
||||
@ -86,7 +86,7 @@ int CertStore::StoreCert(net::X509Certificate* cert, int process_id) {
|
||||
|
||||
bool CertStore::RetrieveCert(int cert_id,
|
||||
scoped_refptr<net::X509Certificate>* cert) {
|
||||
AutoLock autoLock(cert_lock_);
|
||||
base::AutoLock autoLock(cert_lock_);
|
||||
|
||||
CertMap::iterator iter = id_to_cert_.find(cert_id);
|
||||
if (iter == id_to_cert_.end())
|
||||
@ -109,7 +109,7 @@ void CertStore::RemoveCertInternal(int cert_id) {
|
||||
}
|
||||
|
||||
void CertStore::RemoveCertsForRenderProcesHost(int process_id) {
|
||||
AutoLock autoLock(cert_lock_);
|
||||
base::AutoLock autoLock(cert_lock_);
|
||||
|
||||
// We iterate through all the cert ids for that process.
|
||||
IDMap::iterator ids_iter;
|
||||
|
@ -8,8 +8,8 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "base/lock.h"
|
||||
#include "base/singleton.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "chrome/common/notification_observer.h"
|
||||
#include "chrome/common/notification_registrar.h"
|
||||
#include "net/base/x509_certificate.h"
|
||||
@ -76,7 +76,7 @@ class CertStore : public NotificationObserver {
|
||||
|
||||
// This lock protects: process_to_ids_, id_to_processes_, id_to_cert_ and
|
||||
// cert_to_id_.
|
||||
Lock cert_lock_;
|
||||
base::Lock cert_lock_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CertStore);
|
||||
};
|
||||
|
@ -7,9 +7,9 @@
|
||||
#include <utility> // For std::pair.
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/scoped_ptr.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/threading/thread.h"
|
||||
#include "chrome/browser/browser_thread.h"
|
||||
#include "chrome/common/chrome_descriptors.h"
|
||||
@ -174,7 +174,7 @@ class ChildProcessLauncher::Context
|
||||
// AddPlaceholderForPid(), enabling proper cleanup.
|
||||
{ // begin scope for AutoLock
|
||||
MachBroker* broker = MachBroker::GetInstance();
|
||||
AutoLock lock(broker->GetLock());
|
||||
base::AutoLock lock(broker->GetLock());
|
||||
|
||||
// This call to |PrepareForFork()| will start the MachBroker listener
|
||||
// thread, if it is not already running. Therefore the browser process
|
||||
|
@ -151,7 +151,7 @@ ChildProcessSecurityPolicy* ChildProcessSecurityPolicy::GetInstance() {
|
||||
}
|
||||
|
||||
void ChildProcessSecurityPolicy::Add(int child_id) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
if (security_state_.count(child_id) != 0) {
|
||||
NOTREACHED() << "Add child process at most once.";
|
||||
return;
|
||||
@ -161,7 +161,7 @@ void ChildProcessSecurityPolicy::Add(int child_id) {
|
||||
}
|
||||
|
||||
void ChildProcessSecurityPolicy::Remove(int child_id) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
if (!security_state_.count(child_id))
|
||||
return; // May be called multiple times.
|
||||
|
||||
@ -171,7 +171,7 @@ void ChildProcessSecurityPolicy::Remove(int child_id) {
|
||||
|
||||
void ChildProcessSecurityPolicy::RegisterWebSafeScheme(
|
||||
const std::string& scheme) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
DCHECK(web_safe_schemes_.count(scheme) == 0) << "Add schemes at most once.";
|
||||
DCHECK(pseudo_schemes_.count(scheme) == 0) << "Web-safe implies not psuedo.";
|
||||
|
||||
@ -179,14 +179,14 @@ void ChildProcessSecurityPolicy::RegisterWebSafeScheme(
|
||||
}
|
||||
|
||||
bool ChildProcessSecurityPolicy::IsWebSafeScheme(const std::string& scheme) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
return (web_safe_schemes_.find(scheme) != web_safe_schemes_.end());
|
||||
}
|
||||
|
||||
void ChildProcessSecurityPolicy::RegisterPseudoScheme(
|
||||
const std::string& scheme) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
DCHECK(pseudo_schemes_.count(scheme) == 0) << "Add schemes at most once.";
|
||||
DCHECK(web_safe_schemes_.count(scheme) == 0) <<
|
||||
"Psuedo implies not web-safe.";
|
||||
@ -195,7 +195,7 @@ void ChildProcessSecurityPolicy::RegisterPseudoScheme(
|
||||
}
|
||||
|
||||
bool ChildProcessSecurityPolicy::IsPseudoScheme(const std::string& scheme) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
return (pseudo_schemes_.find(scheme) != pseudo_schemes_.end());
|
||||
}
|
||||
@ -224,7 +224,7 @@ void ChildProcessSecurityPolicy::GrantRequestURL(
|
||||
}
|
||||
|
||||
{
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
SecurityStateMap::iterator state = security_state_.find(child_id);
|
||||
if (state == security_state_.end())
|
||||
return;
|
||||
@ -242,7 +242,7 @@ void ChildProcessSecurityPolicy::GrantReadFile(int child_id,
|
||||
|
||||
void ChildProcessSecurityPolicy::GrantPermissionsForFile(
|
||||
int child_id, const FilePath& file, int permissions) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
SecurityStateMap::iterator state = security_state_.find(child_id);
|
||||
if (state == security_state_.end())
|
||||
@ -253,7 +253,7 @@ void ChildProcessSecurityPolicy::GrantPermissionsForFile(
|
||||
|
||||
void ChildProcessSecurityPolicy::RevokeAllPermissionsForFile(
|
||||
int child_id, const FilePath& file) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
SecurityStateMap::iterator state = security_state_.find(child_id);
|
||||
if (state == security_state_.end())
|
||||
@ -264,7 +264,7 @@ void ChildProcessSecurityPolicy::RevokeAllPermissionsForFile(
|
||||
|
||||
void ChildProcessSecurityPolicy::GrantScheme(int child_id,
|
||||
const std::string& scheme) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
SecurityStateMap::iterator state = security_state_.find(child_id);
|
||||
if (state == security_state_.end())
|
||||
@ -274,7 +274,7 @@ void ChildProcessSecurityPolicy::GrantScheme(int child_id,
|
||||
}
|
||||
|
||||
void ChildProcessSecurityPolicy::GrantDOMUIBindings(int child_id) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
SecurityStateMap::iterator state = security_state_.find(child_id);
|
||||
if (state == security_state_.end())
|
||||
@ -290,7 +290,7 @@ void ChildProcessSecurityPolicy::GrantDOMUIBindings(int child_id) {
|
||||
}
|
||||
|
||||
void ChildProcessSecurityPolicy::GrantExtensionBindings(int child_id) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
SecurityStateMap::iterator state = security_state_.find(child_id);
|
||||
if (state == security_state_.end())
|
||||
@ -300,7 +300,7 @@ void ChildProcessSecurityPolicy::GrantExtensionBindings(int child_id) {
|
||||
}
|
||||
|
||||
void ChildProcessSecurityPolicy::GrantReadRawCookies(int child_id) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
SecurityStateMap::iterator state = security_state_.find(child_id);
|
||||
if (state == security_state_.end())
|
||||
@ -310,7 +310,7 @@ void ChildProcessSecurityPolicy::GrantReadRawCookies(int child_id) {
|
||||
}
|
||||
|
||||
void ChildProcessSecurityPolicy::RevokeReadRawCookies(int child_id) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
SecurityStateMap::iterator state = security_state_.find(child_id);
|
||||
if (state == security_state_.end())
|
||||
@ -354,7 +354,7 @@ bool ChildProcessSecurityPolicy::CanRequestURL(
|
||||
return true; // This URL request is destined for ShellExecute.
|
||||
|
||||
{
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
SecurityStateMap::iterator state = security_state_.find(child_id);
|
||||
if (state == security_state_.end())
|
||||
@ -373,7 +373,7 @@ bool ChildProcessSecurityPolicy::CanReadFile(int child_id,
|
||||
|
||||
bool ChildProcessSecurityPolicy::HasPermissionsForFile(
|
||||
int child_id, const FilePath& file, int permissions) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
SecurityStateMap::iterator state = security_state_.find(child_id);
|
||||
if (state == security_state_.end())
|
||||
@ -383,7 +383,7 @@ bool ChildProcessSecurityPolicy::HasPermissionsForFile(
|
||||
}
|
||||
|
||||
bool ChildProcessSecurityPolicy::HasDOMUIBindings(int child_id) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
SecurityStateMap::iterator state = security_state_.find(child_id);
|
||||
if (state == security_state_.end())
|
||||
@ -393,7 +393,7 @@ bool ChildProcessSecurityPolicy::HasDOMUIBindings(int child_id) {
|
||||
}
|
||||
|
||||
bool ChildProcessSecurityPolicy::HasExtensionBindings(int child_id) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
SecurityStateMap::iterator state = security_state_.find(child_id);
|
||||
if (state == security_state_.end())
|
||||
@ -403,7 +403,7 @@ bool ChildProcessSecurityPolicy::HasExtensionBindings(int child_id) {
|
||||
}
|
||||
|
||||
bool ChildProcessSecurityPolicy::CanReadRawCookies(int child_id) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
SecurityStateMap::iterator state = security_state_.find(child_id);
|
||||
if (state == security_state_.end())
|
||||
|
@ -13,8 +13,8 @@
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/gtest_prod_util.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/singleton.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
|
||||
class FilePath;
|
||||
class GURL;
|
||||
@ -141,7 +141,7 @@ class ChildProcessSecurityPolicy {
|
||||
|
||||
// You must acquire this lock before reading or writing any members of this
|
||||
// class. You must not block while holding this lock.
|
||||
Lock lock_;
|
||||
base::Lock lock_;
|
||||
|
||||
// These schemes are white-listed for all child processes. This set is
|
||||
// protected by |lock_|.
|
||||
|
@ -79,7 +79,7 @@ bool AudioMixerAlsa::InitSync() {
|
||||
}
|
||||
|
||||
double AudioMixerAlsa::GetVolumeDb() const {
|
||||
AutoLock lock(mixer_state_lock_);
|
||||
base::AutoLock lock(mixer_state_lock_);
|
||||
if (mixer_state_ != READY)
|
||||
return kSilenceDb;
|
||||
|
||||
@ -87,7 +87,7 @@ double AudioMixerAlsa::GetVolumeDb() const {
|
||||
}
|
||||
|
||||
bool AudioMixerAlsa::GetVolumeLimits(double* vol_min, double* vol_max) {
|
||||
AutoLock lock(mixer_state_lock_);
|
||||
base::AutoLock lock(mixer_state_lock_);
|
||||
if (mixer_state_ != READY)
|
||||
return false;
|
||||
if (vol_min)
|
||||
@ -98,7 +98,7 @@ bool AudioMixerAlsa::GetVolumeLimits(double* vol_min, double* vol_max) {
|
||||
}
|
||||
|
||||
void AudioMixerAlsa::SetVolumeDb(double vol_db) {
|
||||
AutoLock lock(mixer_state_lock_);
|
||||
base::AutoLock lock(mixer_state_lock_);
|
||||
if (mixer_state_ != READY)
|
||||
return;
|
||||
if (vol_db < kSilenceDb)
|
||||
@ -108,7 +108,7 @@ void AudioMixerAlsa::SetVolumeDb(double vol_db) {
|
||||
}
|
||||
|
||||
bool AudioMixerAlsa::IsMute() const {
|
||||
AutoLock lock(mixer_state_lock_);
|
||||
base::AutoLock lock(mixer_state_lock_);
|
||||
if (mixer_state_ != READY)
|
||||
return false;
|
||||
return GetElementMuted_Locked(elem_master_);
|
||||
@ -121,7 +121,7 @@ static bool PrefVolumeValid(double volume) {
|
||||
}
|
||||
|
||||
void AudioMixerAlsa::SetMute(bool mute) {
|
||||
AutoLock lock(mixer_state_lock_);
|
||||
base::AutoLock lock(mixer_state_lock_);
|
||||
if (mixer_state_ != READY)
|
||||
return;
|
||||
|
||||
@ -150,7 +150,7 @@ void AudioMixerAlsa::SetMute(bool mute) {
|
||||
}
|
||||
|
||||
AudioMixer::State AudioMixerAlsa::GetState() const {
|
||||
AutoLock lock(mixer_state_lock_);
|
||||
base::AutoLock lock(mixer_state_lock_);
|
||||
// If we think it's ready, verify it is actually so.
|
||||
if ((mixer_state_ == READY) && (alsa_mixer_ == NULL))
|
||||
mixer_state_ = IN_ERROR;
|
||||
@ -184,7 +184,7 @@ void AudioMixerAlsa::DoInit(InitDoneCallback* callback) {
|
||||
}
|
||||
|
||||
bool AudioMixerAlsa::InitThread() {
|
||||
AutoLock lock(mixer_state_lock_);
|
||||
base::AutoLock lock(mixer_state_lock_);
|
||||
|
||||
if (mixer_state_ != UNINITIALIZED)
|
||||
return false;
|
||||
@ -209,7 +209,7 @@ void AudioMixerAlsa::InitPrefs() {
|
||||
}
|
||||
|
||||
bool AudioMixerAlsa::InitializeAlsaMixer() {
|
||||
AutoLock lock(mixer_state_lock_);
|
||||
base::AutoLock lock(mixer_state_lock_);
|
||||
if (mixer_state_ != INITIALIZING)
|
||||
return false;
|
||||
|
||||
@ -273,7 +273,7 @@ bool AudioMixerAlsa::InitializeAlsaMixer() {
|
||||
}
|
||||
|
||||
void AudioMixerAlsa::FreeAlsaMixer() {
|
||||
AutoLock lock(mixer_state_lock_);
|
||||
base::AutoLock lock(mixer_state_lock_);
|
||||
mixer_state_ = SHUTTING_DOWN;
|
||||
if (alsa_mixer_) {
|
||||
snd_mixer_close(alsa_mixer_);
|
||||
@ -282,7 +282,7 @@ void AudioMixerAlsa::FreeAlsaMixer() {
|
||||
}
|
||||
|
||||
void AudioMixerAlsa::DoSetVolumeMute(double pref_volume, int pref_mute) {
|
||||
AutoLock lock(mixer_state_lock_);
|
||||
base::AutoLock lock(mixer_state_lock_);
|
||||
if (mixer_state_ != READY)
|
||||
return;
|
||||
|
||||
|
@ -8,8 +8,8 @@
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/callback.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/scoped_ptr.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/threading/thread.h"
|
||||
#include "chrome/browser/chromeos/audio_mixer.h"
|
||||
#include "chrome/browser/prefs/pref_member.h"
|
||||
@ -88,7 +88,7 @@ class AudioMixerAlsa : public AudioMixer {
|
||||
// no effect.
|
||||
double save_volume_;
|
||||
|
||||
mutable Lock mixer_state_lock_;
|
||||
mutable base::Lock mixer_state_lock_;
|
||||
mutable State mixer_state_;
|
||||
|
||||
// Cached contexts for use in ALSA calls.
|
||||
|
@ -144,7 +144,7 @@ void AudioMixerPulse::SetMute(bool mute) {
|
||||
}
|
||||
|
||||
AudioMixer::State AudioMixerPulse::GetState() const {
|
||||
AutoLock lock(mixer_state_lock_);
|
||||
base::AutoLock lock(mixer_state_lock_);
|
||||
// If we think it's ready, verify it is actually so.
|
||||
if ((mixer_state_ == READY) &&
|
||||
(pa_context_get_state(pa_context_) != PA_CONTEXT_READY))
|
||||
@ -162,7 +162,7 @@ void AudioMixerPulse::DoInit(InitDoneCallback* callback) {
|
||||
}
|
||||
|
||||
bool AudioMixerPulse::InitThread() {
|
||||
AutoLock lock(mixer_state_lock_);
|
||||
base::AutoLock lock(mixer_state_lock_);
|
||||
|
||||
if (mixer_state_ != UNINITIALIZED)
|
||||
return false;
|
||||
@ -202,7 +202,7 @@ bool AudioMixerPulse::PulseAudioInit() {
|
||||
pa_context_state_t state = PA_CONTEXT_FAILED;
|
||||
|
||||
{
|
||||
AutoLock lock(mixer_state_lock_);
|
||||
base::AutoLock lock(mixer_state_lock_);
|
||||
if (mixer_state_ != INITIALIZING)
|
||||
return false;
|
||||
|
||||
@ -286,7 +286,7 @@ bool AudioMixerPulse::PulseAudioInit() {
|
||||
break;
|
||||
|
||||
{
|
||||
AutoLock lock(mixer_state_lock_);
|
||||
base::AutoLock lock(mixer_state_lock_);
|
||||
if (mixer_state_ == SHUTTING_DOWN)
|
||||
return false;
|
||||
mixer_state_ = READY;
|
||||
@ -302,7 +302,7 @@ bool AudioMixerPulse::PulseAudioInit() {
|
||||
|
||||
void AudioMixerPulse::PulseAudioFree() {
|
||||
{
|
||||
AutoLock lock(mixer_state_lock_);
|
||||
base::AutoLock lock(mixer_state_lock_);
|
||||
if (!pa_mainloop_)
|
||||
mixer_state_ = UNINITIALIZED;
|
||||
if ((mixer_state_ == UNINITIALIZED) || (mixer_state_ == SHUTTING_DOWN))
|
||||
@ -327,7 +327,7 @@ void AudioMixerPulse::PulseAudioFree() {
|
||||
pa_mainloop_ = NULL;
|
||||
|
||||
{
|
||||
AutoLock lock(mixer_state_lock_);
|
||||
base::AutoLock lock(mixer_state_lock_);
|
||||
mixer_state_ = UNINITIALIZED;
|
||||
}
|
||||
}
|
||||
@ -441,7 +441,7 @@ inline void AudioMixerPulse::MainloopSignal() const {
|
||||
}
|
||||
|
||||
inline bool AudioMixerPulse::MainloopSafeLock() const {
|
||||
AutoLock lock(mixer_state_lock_);
|
||||
base::AutoLock lock(mixer_state_lock_);
|
||||
if ((mixer_state_ == SHUTTING_DOWN) || (!pa_mainloop_))
|
||||
return false;
|
||||
|
||||
@ -451,7 +451,7 @@ inline bool AudioMixerPulse::MainloopSafeLock() const {
|
||||
}
|
||||
|
||||
inline bool AudioMixerPulse::MainloopLockIfReady() const {
|
||||
AutoLock lock(mixer_state_lock_);
|
||||
base::AutoLock lock(mixer_state_lock_);
|
||||
if (mixer_state_ != READY)
|
||||
return false;
|
||||
if (!pa_mainloop_)
|
||||
|
@ -8,8 +8,8 @@
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/callback.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/scoped_ptr.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/threading/thread.h"
|
||||
#include "chrome/browser/chromeos/audio_mixer.h"
|
||||
|
||||
@ -100,7 +100,7 @@ class AudioMixerPulse : public AudioMixer {
|
||||
// For informational purposes only, just used to assert lock is held.
|
||||
mutable int mainloop_lock_count_;
|
||||
|
||||
mutable Lock mixer_state_lock_;
|
||||
mutable base::Lock mixer_state_lock_;
|
||||
mutable State mixer_state_;
|
||||
|
||||
// Cached contexts for use in PulseAudio calls.
|
||||
|
@ -8,11 +8,11 @@
|
||||
|
||||
#include "app/l10n_util.h"
|
||||
#include "base/i18n/rtl.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/scoped_ptr.h"
|
||||
#include "base/stl_util-inl.h"
|
||||
#include "base/string_util.h"
|
||||
#include "base/stringprintf.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/time.h"
|
||||
#include "base/utf_string_conversions.h"
|
||||
#include "base/values.h"
|
||||
@ -120,7 +120,7 @@ static const char* kTimeZones[] = {
|
||||
"Pacific/Tongatapu",
|
||||
};
|
||||
|
||||
static Lock timezone_bundle_lock;
|
||||
static base::Lock timezone_bundle_lock;
|
||||
|
||||
struct UResClose {
|
||||
inline void operator() (UResourceBundle* b) const {
|
||||
@ -138,7 +138,7 @@ string16 GetExemplarCity(const icu::TimeZone& zone) {
|
||||
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
{
|
||||
AutoLock lock(timezone_bundle_lock);
|
||||
base::AutoLock lock(timezone_bundle_lock);
|
||||
if (zone_bundle == NULL)
|
||||
zone_bundle = ures_open(zone_bundle_name, uloc_getDefault(), &status);
|
||||
|
||||
|
@ -324,7 +324,7 @@ void Camera::DoStopCapturing() {
|
||||
}
|
||||
|
||||
void Camera::GetFrame(SkBitmap* frame) {
|
||||
AutoLock lock(image_lock_);
|
||||
base::AutoLock lock(image_lock_);
|
||||
frame->swap(frame_image_);
|
||||
}
|
||||
|
||||
@ -527,7 +527,7 @@ void Camera::ProcessImage(void* data) {
|
||||
}
|
||||
image.setIsOpaque(true);
|
||||
{
|
||||
AutoLock lock(image_lock_);
|
||||
base::AutoLock lock(image_lock_);
|
||||
frame_image_.swap(image);
|
||||
}
|
||||
BrowserThread::PostTask(
|
||||
@ -573,13 +573,13 @@ void Camera::OnCaptureFailure() {
|
||||
}
|
||||
|
||||
bool Camera::IsOnCameraThread() const {
|
||||
AutoLock lock(thread_lock_);
|
||||
base::AutoLock lock(thread_lock_);
|
||||
return thread_ && MessageLoop::current() == thread_->message_loop();
|
||||
}
|
||||
|
||||
void Camera::PostCameraTask(const tracked_objects::Location& from_here,
|
||||
Task* task) {
|
||||
AutoLock lock(thread_lock_);
|
||||
base::AutoLock lock(thread_lock_);
|
||||
if (!thread_)
|
||||
return;
|
||||
DCHECK(thread_->IsRunning());
|
||||
|
@ -9,8 +9,8 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "base/lock.h"
|
||||
#include "base/ref_counted.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/threading/thread.h"
|
||||
#include "third_party/skia/include/core/SkBitmap.h"
|
||||
|
||||
@ -181,10 +181,10 @@ class Camera : public base::RefCountedThreadSafe<Camera> {
|
||||
SkBitmap frame_image_;
|
||||
|
||||
// Lock that guards references to |frame_image_|.
|
||||
mutable Lock image_lock_;
|
||||
mutable base::Lock image_lock_;
|
||||
|
||||
// Lock that guards references to |camera_thread_|.
|
||||
mutable Lock thread_lock_;
|
||||
mutable base::Lock thread_lock_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(Camera);
|
||||
};
|
||||
|
@ -9,12 +9,12 @@
|
||||
#include "base/command_line.h"
|
||||
#include "base/file_path.h"
|
||||
#include "base/file_util.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/scoped_ptr.h"
|
||||
#include "base/singleton.h"
|
||||
#include "base/string_util.h"
|
||||
#include "base/stringprintf.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/time.h"
|
||||
#include "base/utf_string_conversions.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
@ -172,7 +172,7 @@ class LoginUtilsWrapper {
|
||||
}
|
||||
|
||||
LoginUtils* get() {
|
||||
AutoLock create(create_lock_);
|
||||
base::AutoLock create(create_lock_);
|
||||
if (!ptr_.get())
|
||||
reset(new LoginUtilsImpl);
|
||||
return ptr_.get();
|
||||
@ -187,7 +187,7 @@ class LoginUtilsWrapper {
|
||||
|
||||
LoginUtilsWrapper() {}
|
||||
|
||||
Lock create_lock_;
|
||||
base::Lock create_lock_;
|
||||
scoped_ptr<LoginUtils> ptr_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(LoginUtilsWrapper);
|
||||
|
@ -225,7 +225,7 @@ ContentSetting HostContentSettingsMap::GetNonDefaultContentSetting(
|
||||
return GetDefaultContentSetting(content_type);
|
||||
}
|
||||
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
|
||||
const std::string host(net::GetHostOrSpecFromURL(url));
|
||||
ContentSettingsTypeResourceIdentifierPair
|
||||
@ -307,7 +307,7 @@ ContentSettings HostContentSettingsMap::GetNonDefaultContentSettings(
|
||||
if (ShouldAllowAllContent(url))
|
||||
return ContentSettings(CONTENT_SETTING_ALLOW);
|
||||
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
|
||||
const std::string host(net::GetHostOrSpecFromURL(url));
|
||||
ContentSettings output;
|
||||
@ -371,7 +371,7 @@ void HostContentSettingsMap::GetSettingsForOneType(
|
||||
ContentSettingsTypeResourceIdentifierPair
|
||||
requested_setting(content_type, resource_identifier);
|
||||
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
for (HostContentSettings::const_iterator i(map_to_return->begin());
|
||||
i != map_to_return->end(); ++i) {
|
||||
ContentSetting setting;
|
||||
@ -446,7 +446,7 @@ void HostContentSettingsMap::SetContentSetting(
|
||||
}
|
||||
|
||||
{
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
if (!map_to_modify->count(pattern_str))
|
||||
(*map_to_modify)[pattern_str].content_settings = ContentSettings();
|
||||
HostContentSettings::iterator
|
||||
@ -556,7 +556,7 @@ void HostContentSettingsMap::ClearSettingsForOneType(
|
||||
}
|
||||
|
||||
{
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
for (HostContentSettings::iterator i(map_to_modify->begin());
|
||||
i != map_to_modify->end(); ) {
|
||||
if (RequiresResourceIdentifier(content_type) ||
|
||||
@ -626,7 +626,7 @@ void HostContentSettingsMap::SetBlockThirdPartyCookies(bool block) {
|
||||
}
|
||||
|
||||
{
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
block_third_party_cookies_ = block;
|
||||
}
|
||||
|
||||
@ -647,7 +647,7 @@ void HostContentSettingsMap::SetBlockNonsandboxedPlugins(bool block) {
|
||||
}
|
||||
|
||||
{
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
block_nonsandboxed_plugins_ = block;
|
||||
}
|
||||
|
||||
@ -668,7 +668,7 @@ void HostContentSettingsMap::ResetToDefaults() {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
|
||||
{
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
for (provider_iterator provider = content_settings_providers_.begin();
|
||||
provider != content_settings_providers_.end(); ++provider) {
|
||||
(*provider)->ResetToDefaults();
|
||||
@ -711,14 +711,14 @@ void HostContentSettingsMap::Observe(NotificationType type,
|
||||
if (*name == prefs::kContentSettingsPatterns) {
|
||||
ReadExceptions(true);
|
||||
} else if (*name == prefs::kBlockThirdPartyCookies) {
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
block_third_party_cookies_ = profile_->GetPrefs()->GetBoolean(
|
||||
prefs::kBlockThirdPartyCookies);
|
||||
is_block_third_party_cookies_managed_ =
|
||||
profile_->GetPrefs()->IsManagedPreference(
|
||||
prefs::kBlockThirdPartyCookies);
|
||||
} else if (*name == prefs::kBlockNonsandboxedPlugins) {
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
block_nonsandboxed_plugins_ = profile_->GetPrefs()->GetBoolean(
|
||||
prefs::kBlockNonsandboxedPlugins);
|
||||
} else {
|
||||
@ -822,7 +822,7 @@ bool HostContentSettingsMap::IsDefaultContentSettingManaged(
|
||||
}
|
||||
|
||||
void HostContentSettingsMap::ReadExceptions(bool overwrite) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
PrefService* prefs = profile_->GetPrefs();
|
||||
DictionaryValue* all_settings_dictionary =
|
||||
|
@ -16,8 +16,8 @@
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/linked_ptr.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/ref_counted.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "chrome/browser/browser_thread.h"
|
||||
#include "chrome/browser/content_settings/content_settings_pattern.h"
|
||||
#include "chrome/browser/prefs/pref_change_registrar.h"
|
||||
@ -233,7 +233,7 @@ class HostContentSettingsMap
|
||||
content_settings_providers_;
|
||||
|
||||
// Used around accesses to the following objects to guarantee thread safety.
|
||||
mutable Lock lock_;
|
||||
mutable base::Lock lock_;
|
||||
|
||||
// Copies of the pref data, so that we can read it on threads other than the
|
||||
// UI thread.
|
||||
|
@ -71,7 +71,7 @@ PolicyContentSettingsProvider::~PolicyContentSettingsProvider() {
|
||||
|
||||
bool PolicyContentSettingsProvider::CanProvideDefaultSetting(
|
||||
ContentSettingsType content_type) const {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
if (managed_default_content_settings_.settings[content_type] !=
|
||||
CONTENT_SETTING_DEFAULT) {
|
||||
return true;
|
||||
@ -82,7 +82,7 @@ bool PolicyContentSettingsProvider::CanProvideDefaultSetting(
|
||||
|
||||
ContentSetting PolicyContentSettingsProvider::ProvideDefaultSetting(
|
||||
ContentSettingsType content_type) const {
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
return managed_default_content_settings_.settings[content_type];
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ void PolicyContentSettingsProvider::UpdateDefaultSetting(
|
||||
|
||||
bool PolicyContentSettingsProvider::DefaultSettingIsManaged(
|
||||
ContentSettingsType content_type) const {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
if (managed_default_content_settings_.settings[content_type] !=
|
||||
CONTENT_SETTING_DEFAULT) {
|
||||
return true;
|
||||
@ -183,7 +183,7 @@ void PolicyContentSettingsProvider::UpdateManagedDefaultSetting(
|
||||
PrefService* prefs = profile_->GetPrefs();
|
||||
DCHECK(!prefs->HasPrefPath(kPrefToManageType[type]) ||
|
||||
prefs->IsManagedPreference(kPrefToManageType[type]));
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
managed_default_content_settings_.settings[type] = IntToContentSetting(
|
||||
prefs->GetInteger(kPrefToManageType[type]));
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
// A content settings provider that takes its settings out of policies.
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "chrome/browser/content_settings/content_settings_provider.h"
|
||||
#include "chrome/browser/prefs/pref_change_registrar.h"
|
||||
#include "chrome/common/notification_observer.h"
|
||||
@ -67,7 +67,7 @@ class PolicyContentSettingsProvider : public ContentSettingsProviderInterface,
|
||||
|
||||
// Used around accesses to the managed_default_content_settings_ object to
|
||||
// guarantee thread safety.
|
||||
mutable Lock lock_;
|
||||
mutable base::Lock lock_;
|
||||
|
||||
PrefChangeRegistrar pref_change_registrar_;
|
||||
NotificationRegistrar notification_registrar_;
|
||||
|
@ -85,7 +85,7 @@ bool PrefContentSettingsProvider::CanProvideDefaultSetting(
|
||||
|
||||
ContentSetting PrefContentSettingsProvider::ProvideDefaultSetting(
|
||||
ContentSettingsType content_type) const {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
return default_content_settings_.settings[content_type];
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ void PrefContentSettingsProvider::UpdateDefaultSetting(
|
||||
std::string dictionary_path(kTypeNames[content_type]);
|
||||
updating_preferences_ = true;
|
||||
{
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
ScopedPrefUpdate update(prefs, prefs::kDefaultContentSettings);
|
||||
if ((setting == CONTENT_SETTING_DEFAULT) ||
|
||||
(setting == kDefaultSettings[content_type])) {
|
||||
@ -138,7 +138,7 @@ bool PrefContentSettingsProvider::DefaultSettingIsManaged(
|
||||
|
||||
void PrefContentSettingsProvider::ResetToDefaults() {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
default_content_settings_ = ContentSettings();
|
||||
ForceDefaultsToBeExplicit();
|
||||
|
||||
@ -195,7 +195,7 @@ void PrefContentSettingsProvider::ReadDefaultSettings(bool overwrite) {
|
||||
const DictionaryValue* default_settings_dictionary =
|
||||
prefs->GetDictionary(prefs::kDefaultContentSettings);
|
||||
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
if (overwrite)
|
||||
default_content_settings_ = ContentSettings();
|
||||
|
@ -9,7 +9,7 @@
|
||||
// A content settings provider that takes its settings out of the pref service.
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "chrome/browser/content_settings/content_settings_provider.h"
|
||||
#include "chrome/browser/prefs/pref_change_registrar.h"
|
||||
#include "chrome/common/notification_observer.h"
|
||||
@ -73,7 +73,7 @@ class PrefContentSettingsProvider : public ContentSettingsProviderInterface,
|
||||
|
||||
// Used around accesses to the default_content_settings_ object to guarantee
|
||||
// thread safety.
|
||||
mutable Lock lock_;
|
||||
mutable base::Lock lock_;
|
||||
|
||||
PrefChangeRegistrar pref_change_registrar_;
|
||||
NotificationRegistrar notification_registrar_;
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
bool CrossSiteRequestManager::HasPendingCrossSiteRequest(int renderer_id,
|
||||
int render_view_id) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
std::pair<int, int> key(renderer_id, render_view_id);
|
||||
return pending_cross_site_views_.find(key) !=
|
||||
@ -18,7 +18,7 @@ bool CrossSiteRequestManager::HasPendingCrossSiteRequest(int renderer_id,
|
||||
void CrossSiteRequestManager::SetHasPendingCrossSiteRequest(int renderer_id,
|
||||
int render_view_id,
|
||||
bool has_pending) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
std::pair<int, int> key(renderer_id, render_view_id);
|
||||
if (has_pending) {
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <utility>
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
|
||||
template <typename T> struct DefaultSingletonTraits;
|
||||
|
||||
@ -47,7 +47,7 @@ class CrossSiteRequestManager {
|
||||
|
||||
// You must acquire this lock before reading or writing any members of this
|
||||
// class. You must not block while holding this lock.
|
||||
Lock lock_;
|
||||
base::Lock lock_;
|
||||
|
||||
// Set of (render_process_host_id, render_view_id) pairs of all
|
||||
// RenderViewHosts that have pending cross-site requests. Used to pass
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#include <queue>
|
||||
|
||||
#include "base/lock.h"
|
||||
#include "base/message_loop.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/task.h"
|
||||
#include "chrome/browser/device_orientation/data_fetcher.h"
|
||||
#include "chrome/browser/device_orientation/orientation.h"
|
||||
@ -78,7 +78,7 @@ class MockOrientationFactory : public base::RefCounted<MockOrientationFactory> {
|
||||
}
|
||||
|
||||
void SetOrientation(const Orientation& orientation) {
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
orientation_ = orientation;
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ class MockOrientationFactory : public base::RefCounted<MockOrientationFactory> {
|
||||
|
||||
// From DataFetcher. Called by the Provider.
|
||||
virtual bool GetOrientation(Orientation* orientation) {
|
||||
AutoLock auto_lock(orientation_factory_->lock_);
|
||||
base::AutoLock auto_lock(orientation_factory_->lock_);
|
||||
*orientation = orientation_factory_->orientation_;
|
||||
return true;
|
||||
}
|
||||
@ -102,7 +102,7 @@ class MockOrientationFactory : public base::RefCounted<MockOrientationFactory> {
|
||||
|
||||
static MockOrientationFactory* instance_;
|
||||
Orientation orientation_;
|
||||
Lock lock_;
|
||||
base::Lock lock_;
|
||||
};
|
||||
|
||||
MockOrientationFactory* MockOrientationFactory::instance_;
|
||||
|
@ -196,7 +196,7 @@ void DownloadFileManager::UpdateDownload(int id, DownloadBuffer* buffer) {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
|
||||
std::vector<DownloadBuffer::Contents> contents;
|
||||
{
|
||||
AutoLock auto_lock(buffer->lock);
|
||||
base::AutoLock auto_lock(buffer->lock);
|
||||
contents.swap(buffer->contents);
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include "base/file_path.h"
|
||||
#include "base/linked_ptr.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "net/base/file_stream.h"
|
||||
|
||||
namespace net {
|
||||
@ -27,7 +27,7 @@ struct DownloadBuffer {
|
||||
DownloadBuffer();
|
||||
~DownloadBuffer();
|
||||
|
||||
Lock lock;
|
||||
base::Lock lock;
|
||||
typedef std::pair<net::IOBuffer*, int> Contents;
|
||||
std::vector<Contents> contents;
|
||||
};
|
||||
|
@ -21,10 +21,10 @@
|
||||
#include "base/file_util.h"
|
||||
#include "base/hash_tables.h"
|
||||
#include "base/lazy_instance.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/message_loop.h"
|
||||
#include "base/scoped_ptr.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/task.h"
|
||||
#include "base/threading/thread.h"
|
||||
|
||||
@ -62,7 +62,7 @@ class InotifyReader {
|
||||
base::hash_map<Watch, WatcherSet> watchers_;
|
||||
|
||||
// Lock to protect watchers_.
|
||||
Lock lock_;
|
||||
base::Lock lock_;
|
||||
|
||||
// Separate thread on which we run blocking read for inotify events.
|
||||
base::Thread thread_;
|
||||
@ -237,7 +237,7 @@ InotifyReader::Watch InotifyReader::AddWatch(
|
||||
if (!valid_)
|
||||
return kInvalidWatch;
|
||||
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
|
||||
Watch watch = inotify_add_watch(inotify_fd_, path.value().c_str(),
|
||||
IN_CREATE | IN_DELETE |
|
||||
@ -257,7 +257,7 @@ bool InotifyReader::RemoveWatch(Watch watch,
|
||||
if (!valid_)
|
||||
return false;
|
||||
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
|
||||
watchers_[watch].erase(watcher);
|
||||
|
||||
@ -274,7 +274,7 @@ void InotifyReader::OnInotifyEvent(const inotify_event* event) {
|
||||
return;
|
||||
|
||||
FilePath::StringType child(event->len ? event->name : FILE_PATH_LITERAL(""));
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
|
||||
for (WatcherSet::iterator watcher = watchers_[event->wd].begin();
|
||||
watcher != watchers_[event->wd].end();
|
||||
|
@ -32,7 +32,7 @@ void GatewayDataProviderCommon::StopDataProvider() {
|
||||
bool GatewayDataProviderCommon::GetData(GatewayData *data) {
|
||||
DCHECK(CalledOnClientThread());
|
||||
DCHECK(data);
|
||||
AutoLock lock(data_mutex_);
|
||||
base::AutoLock lock(data_mutex_);
|
||||
*data = gateway_data_;
|
||||
// If we've successfully completed a scan, indicate that we have all of the
|
||||
// data we can get.
|
||||
@ -67,7 +67,7 @@ void GatewayDataProviderCommon::DoRouterScanTask() {
|
||||
ScheduleNextScan(polling_policy_->NoRouterInterval());
|
||||
} else {
|
||||
{
|
||||
AutoLock lock(data_mutex_);
|
||||
base::AutoLock lock(data_mutex_);
|
||||
update_available = gateway_data_.DiffersSignificantly(new_data);
|
||||
gateway_data_ = new_data;
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ class GatewayDataProviderCommon
|
||||
// Will schedule a scan; i.e. enqueue DoRouterScanTask deferred task.
|
||||
void ScheduleNextScan(int interval);
|
||||
|
||||
Lock data_mutex_;
|
||||
base::Lock data_mutex_;
|
||||
// Whether we've successfully completed a scan for gateway data (or the
|
||||
// polling thread has terminated early).
|
||||
bool is_first_scan_complete_;
|
||||
|
@ -42,7 +42,7 @@ void WifiDataProviderCommon::StopDataProvider() {
|
||||
bool WifiDataProviderCommon::GetData(WifiData *data) {
|
||||
DCHECK(CalledOnClientThread());
|
||||
DCHECK(data);
|
||||
AutoLock lock(data_mutex_);
|
||||
base::AutoLock lock(data_mutex_);
|
||||
*data = wifi_data_;
|
||||
// If we've successfully completed a scan, indicate that we have all of the
|
||||
// data we can get.
|
||||
@ -81,7 +81,7 @@ void WifiDataProviderCommon::DoWifiScanTask() {
|
||||
ScheduleNextScan(polling_policy_->NoWifiInterval());
|
||||
} else {
|
||||
{
|
||||
AutoLock lock(data_mutex_);
|
||||
base::AutoLock lock(data_mutex_);
|
||||
update_available = wifi_data_.DiffersSignificantly(new_data);
|
||||
wifi_data_ = new_data;
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ class WifiDataProviderCommon
|
||||
void ScheduleNextScan(int interval);
|
||||
|
||||
WifiData wifi_data_;
|
||||
Lock data_mutex_;
|
||||
base::Lock data_mutex_;
|
||||
|
||||
// Whether we've successfully completed a scan for WiFi data (or the polling
|
||||
// thread has terminated early).
|
||||
|
@ -48,7 +48,7 @@ bool HungWindowDetector::Initialize(HWND top_level_window,
|
||||
|
||||
void HungWindowDetector::OnTick() {
|
||||
do {
|
||||
AutoLock lock(hang_detection_lock_);
|
||||
base::AutoLock lock(hang_detection_lock_);
|
||||
// If we already are checking for hung windows on another thread,
|
||||
// don't do this again.
|
||||
if (enumerating_) {
|
||||
|
@ -6,7 +6,7 @@
|
||||
#define CHROME_BROWSER_HANG_MONITOR_HUNG_WINDOW_DETECTOR_H__
|
||||
#pragma once
|
||||
|
||||
#include "base/lock.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "chrome/common/worker_thread_ticker.h"
|
||||
|
||||
// This class provides the following functionality:
|
||||
@ -81,7 +81,7 @@ class HungWindowDetector : public WorkerThreadTicker::Callback {
|
||||
|
||||
// How long do we wait before we consider a window hung (in ms)
|
||||
int message_response_timeout_;
|
||||
Lock hang_detection_lock_;
|
||||
base::Lock hang_detection_lock_;
|
||||
// Indicates if this object is currently enumerating hung windows
|
||||
bool enumerating_;
|
||||
|
||||
|
@ -217,7 +217,7 @@ void TopSites::GetMostVisitedURLs(CancelableRequestConsumer* consumer,
|
||||
AddRequest(request, consumer);
|
||||
MostVisitedURLList filtered_urls;
|
||||
{
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
if (!loaded_) {
|
||||
// A request came in before we finished loading. Put the request in
|
||||
// pending_callbacks_ and we'll notify it when we finish loading.
|
||||
@ -233,7 +233,7 @@ void TopSites::GetMostVisitedURLs(CancelableRequestConsumer* consumer,
|
||||
bool TopSites::GetPageThumbnail(const GURL& url,
|
||||
scoped_refptr<RefCountedBytes>* bytes) {
|
||||
// WARNING: this may be invoked on any thread.
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
return thread_safe_cache_->GetPageThumbnail(url, bytes);
|
||||
}
|
||||
|
||||
@ -800,7 +800,7 @@ void TopSites::MoveStateToLoaded() {
|
||||
MostVisitedURLList filtered_urls;
|
||||
PendingCallbackSet pending_callbacks;
|
||||
{
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
if (loaded_)
|
||||
return; // Don't do anything if we're already loaded.
|
||||
@ -822,14 +822,14 @@ void TopSites::MoveStateToLoaded() {
|
||||
}
|
||||
|
||||
void TopSites::ResetThreadSafeCache() {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
MostVisitedURLList cached;
|
||||
ApplyBlacklistAndPinnedURLs(cache_->top_sites(), &cached);
|
||||
thread_safe_cache_->SetTopSites(cached);
|
||||
}
|
||||
|
||||
void TopSites::ResetThreadSafeImageCache() {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
thread_safe_cache_->SetThumbnails(cache_->images());
|
||||
thread_safe_cache_->RemoveUnreferencedThumbnails();
|
||||
}
|
||||
|
@ -13,9 +13,9 @@
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/gtest_prod_util.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/ref_counted.h"
|
||||
#include "base/ref_counted_memory.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/time.h"
|
||||
#include "base/timer.h"
|
||||
#include "chrome/browser/cancelable_request.h"
|
||||
@ -297,7 +297,7 @@ class TopSites
|
||||
Profile* profile_;
|
||||
|
||||
// Lock used to access |thread_safe_cache_|.
|
||||
mutable Lock lock_;
|
||||
mutable base::Lock lock_;
|
||||
|
||||
CancelableRequestConsumer cancelable_consumer_;
|
||||
|
||||
|
@ -51,7 +51,7 @@ void HostZoomMap::Load() {
|
||||
if (!profile_)
|
||||
return;
|
||||
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
host_zoom_levels_.clear();
|
||||
const DictionaryValue* host_zoom_dictionary =
|
||||
profile_->GetPrefs()->GetDictionary(prefs::kPerHostZoomLevels);
|
||||
@ -95,7 +95,7 @@ void HostZoomMap::RegisterUserPrefs(PrefService* prefs) {
|
||||
|
||||
double HostZoomMap::GetZoomLevel(const GURL& url) const {
|
||||
std::string host(net::GetHostOrSpecFromURL(url));
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
HostZoomLevels::const_iterator i(host_zoom_levels_.find(host));
|
||||
return (i == host_zoom_levels_.end()) ? default_zoom_level_ : i->second;
|
||||
}
|
||||
@ -108,7 +108,7 @@ void HostZoomMap::SetZoomLevel(const GURL& url, double level) {
|
||||
std::string host(net::GetHostOrSpecFromURL(url));
|
||||
|
||||
{
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
if (level == default_zoom_level_)
|
||||
host_zoom_levels_.erase(host);
|
||||
else
|
||||
@ -141,7 +141,7 @@ void HostZoomMap::SetZoomLevel(const GURL& url, double level) {
|
||||
|
||||
double HostZoomMap::GetTemporaryZoomLevel(int render_process_id,
|
||||
int render_view_id) const {
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
for (size_t i = 0; i < temporary_zoom_levels_.size(); ++i) {
|
||||
if (temporary_zoom_levels_[i].render_process_id == render_process_id &&
|
||||
temporary_zoom_levels_[i].render_view_id == render_view_id) {
|
||||
@ -159,7 +159,7 @@ void HostZoomMap::SetTemporaryZoomLevel(int render_process_id,
|
||||
return;
|
||||
|
||||
{
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
size_t i;
|
||||
for (i = 0; i < temporary_zoom_levels_.size(); ++i) {
|
||||
if (temporary_zoom_levels_[i].render_process_id == render_process_id &&
|
||||
@ -193,7 +193,7 @@ void HostZoomMap::ResetToDefaults() {
|
||||
return;
|
||||
|
||||
{
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
host_zoom_levels_.clear();
|
||||
}
|
||||
|
||||
@ -224,7 +224,7 @@ void HostZoomMap::Observe(
|
||||
Shutdown();
|
||||
break;
|
||||
case NotificationType::RENDER_VIEW_HOST_WILL_CLOSE_RENDER_VIEW: {
|
||||
AutoLock auto_lock(lock_);
|
||||
base::AutoLock auto_lock(lock_);
|
||||
int render_view_id = Source<RenderViewHost>(source)->routing_id();
|
||||
int render_process_id = Source<RenderViewHost>(source)->process()->id();
|
||||
|
||||
|
@ -14,8 +14,8 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/ref_counted.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "chrome/browser/browser_thread.h"
|
||||
#include "chrome/browser/prefs/pref_change_registrar.h"
|
||||
#include "chrome/common/notification_observer.h"
|
||||
@ -112,7 +112,7 @@ class HostZoomMap :
|
||||
|
||||
// Used around accesses to |host_zoom_levels_|, |default_zoom_level_| and
|
||||
// |temporary_zoom_levels_| to guarantee thread safety.
|
||||
mutable Lock lock_;
|
||||
mutable base::Lock lock_;
|
||||
|
||||
// Whether we are currently updating preferences, this is used to ignore
|
||||
// notifications from the preference service that we triggered ourself.
|
||||
|
@ -7,7 +7,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "base/basictypes.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/scoped_ptr.h"
|
||||
#include "base/threading/thread.h"
|
||||
#include "chrome/browser/browser_thread.h"
|
||||
|
@ -91,7 +91,7 @@ class MachListenerThreadDelegate : public base::PlatformThread::Delegate {
|
||||
// leaking MachBroker map entries in this case, lock around both these
|
||||
// calls. If the child dies, the death notification will be processed
|
||||
// after the call to FinalizePid(), ensuring proper cleanup.
|
||||
AutoLock lock(broker_->GetLock());
|
||||
base::AutoLock lock(broker_->GetLock());
|
||||
|
||||
int pid;
|
||||
err = pid_for_task(child_task, &pid);
|
||||
@ -170,7 +170,7 @@ void MachBroker::FinalizePid(base::ProcessHandle pid,
|
||||
|
||||
// Removes all mappings belonging to |pid| from the broker.
|
||||
void MachBroker::InvalidatePid(base::ProcessHandle pid) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
MachBroker::MachMap::iterator it = mach_map_.find(pid);
|
||||
if (it == mach_map_.end())
|
||||
return;
|
||||
@ -183,13 +183,13 @@ void MachBroker::InvalidatePid(base::ProcessHandle pid) {
|
||||
mach_map_.erase(it);
|
||||
}
|
||||
|
||||
Lock& MachBroker::GetLock() {
|
||||
base::Lock& MachBroker::GetLock() {
|
||||
return lock_;
|
||||
}
|
||||
|
||||
// Returns the mach task belonging to |pid|.
|
||||
mach_port_t MachBroker::TaskForPid(base::ProcessHandle pid) const {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
MachBroker::MachMap::const_iterator it = mach_map_.find(pid);
|
||||
if (it == mach_map_.end())
|
||||
return MACH_PORT_NULL;
|
||||
|
@ -11,10 +11,10 @@
|
||||
|
||||
#include <mach/mach.h>
|
||||
|
||||
#include "base/lock.h"
|
||||
#include "base/process.h"
|
||||
#include "base/process_util.h"
|
||||
#include "base/singleton.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "chrome/common/notification_observer.h"
|
||||
#include "chrome/common/notification_registrar.h"
|
||||
|
||||
@ -70,7 +70,7 @@ class MachBroker : public base::ProcessMetrics::PortProvider,
|
||||
|
||||
// The lock that protects this MachBroker object. Clients MUST acquire and
|
||||
// release this lock around calls to PlaceholderForPid() and FinalizePid().
|
||||
Lock& GetLock();
|
||||
base::Lock& GetLock();
|
||||
|
||||
// Returns the Mach port name to use when sending or receiving messages.
|
||||
// Does the Right Thing in the browser and in child processes.
|
||||
@ -99,7 +99,7 @@ class MachBroker : public base::ProcessMetrics::PortProvider,
|
||||
MachMap mach_map_;
|
||||
|
||||
// Mutex that guards |mach_map_|.
|
||||
mutable Lock lock_;
|
||||
mutable base::Lock lock_;
|
||||
|
||||
friend class MachBrokerTest;
|
||||
friend class RegisterNotificationTask;
|
||||
|
@ -4,21 +4,21 @@
|
||||
|
||||
#include "chrome/browser/mach_broker_mac.h"
|
||||
|
||||
#include "base/lock.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
class MachBrokerTest : public testing::Test {
|
||||
public:
|
||||
// Helper function to acquire/release locks and call |PlaceholderForPid()|.
|
||||
void AddPlaceholderForPid(base::ProcessHandle pid) {
|
||||
AutoLock lock(broker_.GetLock());
|
||||
base::AutoLock lock(broker_.GetLock());
|
||||
broker_.AddPlaceholderForPid(pid);
|
||||
}
|
||||
|
||||
// Helper function to acquire/release locks and call |FinalizePid()|.
|
||||
void FinalizePid(base::ProcessHandle pid,
|
||||
const MachBroker::MachInfo& mach_info) {
|
||||
AutoLock lock(broker_.GetLock());
|
||||
base::AutoLock lock(broker_.GetLock());
|
||||
broker_.FinalizePid(pid, mach_info);
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ class MachBrokerTest : public testing::Test {
|
||||
|
||||
TEST_F(MachBrokerTest, Locks) {
|
||||
// Acquire and release the locks. Nothing bad should happen.
|
||||
AutoLock lock(broker_.GetLock());
|
||||
base::AutoLock lock(broker_.GetLock());
|
||||
}
|
||||
|
||||
TEST_F(MachBrokerTest, AddPlaceholderAndFinalize) {
|
||||
|
@ -163,7 +163,7 @@ class LeopardSwitchboardThread
|
||||
|
||||
// all accesses to entries_ must be controlled by entries_lock_.
|
||||
std::vector<SwitchboardEntry> entries_;
|
||||
Lock entries_lock_;
|
||||
base::Lock entries_lock_;
|
||||
base::MessagePumpLibevent::FileDescriptorWatcher watcher_;
|
||||
};
|
||||
|
||||
@ -192,7 +192,7 @@ class ListenerImpl : public base::MessagePumpLibevent::Watcher {
|
||||
bool started_;
|
||||
int fd_;
|
||||
int token_;
|
||||
Lock switchboard_lock_;
|
||||
base::Lock switchboard_lock_;
|
||||
static LeopardSwitchboardThread* g_switchboard_thread_;
|
||||
base::MessagePumpLibevent::FileDescriptorWatcher watcher_;
|
||||
scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
|
||||
|
@ -36,7 +36,7 @@ void ChromeNetLog::ThreadSafeObserver::AssertNetLogLockAcquired() const {
|
||||
void ChromeNetLog::ThreadSafeObserver::SetLogLevel(
|
||||
net::NetLog::LogLevel log_level) {
|
||||
DCHECK(net_log_);
|
||||
AutoLock lock(net_log_->lock_);
|
||||
base::AutoLock lock(net_log_->lock_);
|
||||
log_level_ = log_level;
|
||||
net_log_->UpdateLogLevel_();
|
||||
}
|
||||
@ -85,7 +85,7 @@ void ChromeNetLog::AddEntry(EventType type,
|
||||
const Source& source,
|
||||
EventPhase phase,
|
||||
EventParameters* params) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
// Notify all of the log observers.
|
||||
FOR_EACH_OBSERVER(ThreadSafeObserver, observers_,
|
||||
@ -102,12 +102,12 @@ net::NetLog::LogLevel ChromeNetLog::GetLogLevel() const {
|
||||
}
|
||||
|
||||
void ChromeNetLog::AddObserver(ThreadSafeObserver* observer) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
AddObserverWhileLockHeld(observer);
|
||||
}
|
||||
|
||||
void ChromeNetLog::RemoveObserver(ThreadSafeObserver* observer) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
DCHECK_EQ(observer->net_log_, this);
|
||||
observer->net_log_ = NULL;
|
||||
observers_.RemoveObserver(observer);
|
||||
@ -116,18 +116,18 @@ void ChromeNetLog::RemoveObserver(ThreadSafeObserver* observer) {
|
||||
|
||||
void ChromeNetLog::AddObserverAndGetAllPassivelyCapturedEvents(
|
||||
ThreadSafeObserver* observer, EntryList* passive_entries) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
AddObserverWhileLockHeld(observer);
|
||||
passive_collector_->GetAllCapturedEvents(passive_entries);
|
||||
}
|
||||
|
||||
void ChromeNetLog::GetAllPassivelyCapturedEvents(EntryList* passive_entries) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
passive_collector_->GetAllCapturedEvents(passive_entries);
|
||||
}
|
||||
|
||||
void ChromeNetLog::ClearAllPassivelyCapturedEvents() {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
passive_collector_->Clear();
|
||||
}
|
||||
|
||||
|
@ -9,9 +9,9 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/atomicops.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/observer_list.h"
|
||||
#include "base/scoped_ptr.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/time.h"
|
||||
#include "net/base/net_log.h"
|
||||
|
||||
@ -142,7 +142,7 @@ class ChromeNetLog : public net::NetLog {
|
||||
|
||||
// |lock_| protects access to |observers_| and, indirectly, to
|
||||
// |passive_collector_|. Should not be acquired by observers.
|
||||
Lock lock_;
|
||||
base::Lock lock_;
|
||||
|
||||
// Last assigned source ID. Incremented to get the next one.
|
||||
base::subtle::Atomic32 last_id_;
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include <algorithm>
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/string_util.h"
|
||||
#include "base/format_macros.h"
|
||||
#include "net/url_request/url_request_netlog_params.h"
|
||||
|
@ -107,7 +107,7 @@ class SQLitePersistentCookieStore::Backend
|
||||
// True if the persistent store should be deleted upon destruction.
|
||||
bool clear_local_state_on_exit_;
|
||||
// Guard |pending_|, |num_pending_| and |clear_local_state_on_exit_|.
|
||||
Lock lock_;
|
||||
base::Lock lock_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(Backend);
|
||||
};
|
||||
@ -306,7 +306,7 @@ void SQLitePersistentCookieStore::Backend::BatchOperation(
|
||||
|
||||
PendingOperationsList::size_type num_pending;
|
||||
{
|
||||
AutoLock locked(lock_);
|
||||
base::AutoLock locked(lock_);
|
||||
pending_.push_back(po.release());
|
||||
num_pending = ++num_pending_;
|
||||
}
|
||||
@ -329,7 +329,7 @@ void SQLitePersistentCookieStore::Backend::Commit() {
|
||||
|
||||
PendingOperationsList ops;
|
||||
{
|
||||
AutoLock locked(lock_);
|
||||
base::AutoLock locked(lock_);
|
||||
pending_.swap(ops);
|
||||
num_pending_ = 0;
|
||||
}
|
||||
@ -449,7 +449,7 @@ void SQLitePersistentCookieStore::Backend::InternalBackgroundClose() {
|
||||
|
||||
void SQLitePersistentCookieStore::Backend::SetClearLocalStateOnExit(
|
||||
bool clear_local_state) {
|
||||
AutoLock locked(lock_);
|
||||
base::AutoLock locked(lock_);
|
||||
clear_local_state_on_exit_ = clear_local_state;
|
||||
}
|
||||
SQLitePersistentCookieStore::SQLitePersistentCookieStore(const FilePath& path)
|
||||
|
@ -104,7 +104,7 @@ void DeviceManagementPolicyCache::LoadPolicyFromFile() {
|
||||
// Decode and swap in the new policy information.
|
||||
scoped_ptr<DictionaryValue> value(DecodePolicy(cached_policy.policy()));
|
||||
{
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
if (!fresh_policy_)
|
||||
policy_.reset(value.release());
|
||||
last_policy_refresh_time_ = timestamp;
|
||||
@ -118,7 +118,7 @@ bool DeviceManagementPolicyCache::SetPolicy(
|
||||
const bool new_policy_differs = !(value->Equals(policy_.get()));
|
||||
base::Time now(base::Time::NowFromSystemTime());
|
||||
{
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
policy_.reset(value);
|
||||
fresh_policy_ = true;
|
||||
last_policy_refresh_time_ = now;
|
||||
@ -134,7 +134,7 @@ bool DeviceManagementPolicyCache::SetPolicy(
|
||||
}
|
||||
|
||||
DictionaryValue* DeviceManagementPolicyCache::GetPolicy() {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
return policy_->DeepCopy();
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ void DeviceManagementPolicyCache::SetDeviceUnmanaged() {
|
||||
is_device_unmanaged_ = true;
|
||||
base::Time now(base::Time::NowFromSystemTime());
|
||||
{
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
policy_.reset(new DictionaryValue);
|
||||
last_policy_refresh_time_ = now;
|
||||
}
|
||||
|
@ -7,9 +7,9 @@
|
||||
|
||||
#include "base/file_path.h"
|
||||
#include "base/gtest_prod_util.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/ref_counted.h"
|
||||
#include "base/scoped_ptr.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/time.h"
|
||||
#include "chrome/browser/policy/proto/device_management_backend.pb.h"
|
||||
|
||||
@ -74,7 +74,7 @@ class DeviceManagementPolicyCache {
|
||||
const FilePath backing_file_path_;
|
||||
|
||||
// Protects |policy_|.
|
||||
Lock lock_;
|
||||
base::Lock lock_;
|
||||
|
||||
// Policy key-value information.
|
||||
scoped_ptr<DictionaryValue> policy_;
|
||||
|
@ -148,7 +148,7 @@ void CloudPrintDataSenderHelper::CallJavascriptFunction(
|
||||
// potentially expensive enough that stopping whatever is in progress
|
||||
// is worth it.
|
||||
void CloudPrintDataSender::CancelPrintDataFile() {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
// We don't own helper, it was passed in to us, so no need to
|
||||
// delete, just let it go.
|
||||
helper_ = NULL;
|
||||
@ -202,7 +202,7 @@ void CloudPrintDataSender::ReadPrintDataFile(const FilePath& path_to_pdf) {
|
||||
// needed. - 4/1/2010
|
||||
void CloudPrintDataSender::SendPrintDataFile() {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
if (helper_ && print_data_.get()) {
|
||||
StringValue title(print_job_title_);
|
||||
|
||||
|
@ -10,8 +10,8 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/file_path.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/scoped_ptr.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "chrome/browser/dom_ui/dom_ui.h"
|
||||
#include "chrome/browser/dom_ui/html_dialog_ui.h"
|
||||
#include "chrome/common/notification_observer.h"
|
||||
@ -70,7 +70,7 @@ class CloudPrintDataSender
|
||||
friend class base::RefCountedThreadSafe<CloudPrintDataSender>;
|
||||
virtual ~CloudPrintDataSender();
|
||||
|
||||
Lock lock_;
|
||||
base::Lock lock_;
|
||||
CloudPrintDataSenderHelper* volatile helper_;
|
||||
scoped_ptr<StringValue> print_data_;
|
||||
string16 print_job_title_;
|
||||
|
@ -11,8 +11,8 @@
|
||||
#include "base/file_util.h"
|
||||
#include "base/file_util_proxy.h"
|
||||
#include "base/lazy_instance.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/threading/thread_restrictions.h"
|
||||
#include "base/utf_string_conversions.h"
|
||||
#include "chrome/browser/browser_list.h"
|
||||
@ -26,8 +26,8 @@ namespace {
|
||||
PrintDialogGtk* g_print_dialog = NULL;
|
||||
|
||||
// Used to make accesses to the above thread safe.
|
||||
Lock& DialogLock() {
|
||||
static base::LazyInstance<Lock> dialog_lock(base::LINKER_INITIALIZED);
|
||||
base::Lock& DialogLock() {
|
||||
static base::LazyInstance<base::Lock> dialog_lock(base::LINKER_INITIALIZED);
|
||||
return dialog_lock.Get();
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ void PrintDialogGtk::CreatePrintDialogForPdf(const FilePath& path) {
|
||||
|
||||
// static
|
||||
bool PrintDialogGtk::DialogShowing() {
|
||||
AutoLock lock(DialogLock());
|
||||
base::AutoLock lock(DialogLock());
|
||||
return !!g_print_dialog;
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@ void PrintDialogGtk::CreateDialogImpl(const FilePath& path) {
|
||||
// locking up the system with
|
||||
//
|
||||
// while(true){print();}
|
||||
AutoLock lock(DialogLock());
|
||||
base::AutoLock lock(DialogLock());
|
||||
if (g_print_dialog) {
|
||||
// Clean up the temporary file.
|
||||
base::FileUtilProxy::Delete(
|
||||
@ -112,7 +112,7 @@ PrintDialogGtk::PrintDialogGtk(const FilePath& path_to_pdf)
|
||||
}
|
||||
|
||||
PrintDialogGtk::~PrintDialogGtk() {
|
||||
AutoLock lock(DialogLock());
|
||||
base::AutoLock lock(DialogLock());
|
||||
DCHECK_EQ(this, g_print_dialog);
|
||||
g_print_dialog = NULL;
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ PrintJobManager::PrintJobManager() {
|
||||
}
|
||||
|
||||
PrintJobManager::~PrintJobManager() {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
queued_queries_.clear();
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ void PrintJobManager::StopJobs(bool wait_for_finish) {
|
||||
}
|
||||
|
||||
void PrintJobManager::QueuePrinterQuery(PrinterQuery* job) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
DCHECK(job);
|
||||
queued_queries_.push_back(make_scoped_refptr(job));
|
||||
DCHECK(job->is_valid());
|
||||
@ -67,7 +67,7 @@ void PrintJobManager::QueuePrinterQuery(PrinterQuery* job) {
|
||||
|
||||
void PrintJobManager::PopPrinterQuery(int document_cookie,
|
||||
scoped_refptr<PrinterQuery>* job) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
for (PrinterQueries::iterator itr = queued_queries_.begin();
|
||||
itr != queued_queries_.end();
|
||||
++itr) {
|
||||
@ -162,12 +162,12 @@ void PrintJobManager::OnPrintJobEvent(
|
||||
}
|
||||
|
||||
bool PrintJobManager::printing_enabled() {
|
||||
AutoLock lock(enabled_lock_);
|
||||
base::AutoLock lock(enabled_lock_);
|
||||
return printing_enabled_;
|
||||
}
|
||||
|
||||
void PrintJobManager::set_printing_enabled(bool printing_enabled) {
|
||||
AutoLock lock(enabled_lock_);
|
||||
base::AutoLock lock(enabled_lock_);
|
||||
printing_enabled_ = printing_enabled;
|
||||
}
|
||||
|
||||
|
@ -8,8 +8,8 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "base/lock.h"
|
||||
#include "base/ref_counted.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "chrome/common/notification_observer.h"
|
||||
#include "chrome/common/notification_registrar.h"
|
||||
|
||||
@ -62,10 +62,10 @@ class PrintJobManager : public NotificationObserver {
|
||||
NotificationRegistrar registrar_;
|
||||
|
||||
// Used to serialize access to queued_workers_.
|
||||
Lock lock_;
|
||||
base::Lock lock_;
|
||||
|
||||
// Used to serialize access to printing_enabled_
|
||||
Lock enabled_lock_;
|
||||
base::Lock enabled_lock_;
|
||||
|
||||
PrinterQueries queued_queries_;
|
||||
|
||||
|
@ -18,7 +18,7 @@ AcceleratedSurfaceContainerManagerMac::AcceleratedSurfaceContainerManagerMac()
|
||||
gfx::PluginWindowHandle
|
||||
AcceleratedSurfaceContainerManagerMac::AllocateFakePluginWindowHandle(
|
||||
bool opaque, bool root) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
AcceleratedSurfaceContainerMac* container =
|
||||
new AcceleratedSurfaceContainerMac(this, opaque);
|
||||
@ -34,7 +34,7 @@ AcceleratedSurfaceContainerManagerMac::AllocateFakePluginWindowHandle(
|
||||
|
||||
void AcceleratedSurfaceContainerManagerMac::DestroyFakePluginWindowHandle(
|
||||
gfx::PluginWindowHandle id) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
AcceleratedSurfaceContainerMac* container = MapIDToContainer(id);
|
||||
if (container) {
|
||||
@ -65,7 +65,7 @@ void AcceleratedSurfaceContainerManagerMac::SetSizeAndIOSurface(
|
||||
int32 width,
|
||||
int32 height,
|
||||
uint64 io_surface_identifier) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
AcceleratedSurfaceContainerMac* container = MapIDToContainer(id);
|
||||
if (container) {
|
||||
@ -78,7 +78,7 @@ void AcceleratedSurfaceContainerManagerMac::SetSizeAndTransportDIB(
|
||||
int32 width,
|
||||
int32 height,
|
||||
TransportDIB::Handle transport_dib) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
AcceleratedSurfaceContainerMac* container = MapIDToContainer(id);
|
||||
if (container)
|
||||
@ -87,7 +87,7 @@ void AcceleratedSurfaceContainerManagerMac::SetSizeAndTransportDIB(
|
||||
|
||||
void AcceleratedSurfaceContainerManagerMac::SetPluginContainerGeometry(
|
||||
const webkit::npapi::WebPluginGeometry& move) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
AcceleratedSurfaceContainerMac* container = MapIDToContainer(move.window);
|
||||
if (container)
|
||||
@ -96,7 +96,7 @@ void AcceleratedSurfaceContainerManagerMac::SetPluginContainerGeometry(
|
||||
|
||||
void AcceleratedSurfaceContainerManagerMac::Draw(CGLContextObj context,
|
||||
gfx::PluginWindowHandle id) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
glColorMask(true, true, true, true);
|
||||
// Should match the clear color of RenderWidgetHostViewMac.
|
||||
@ -123,7 +123,7 @@ void AcceleratedSurfaceContainerManagerMac::Draw(CGLContextObj context,
|
||||
}
|
||||
|
||||
void AcceleratedSurfaceContainerManagerMac::ForceTextureReload() {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
for (PluginWindowToContainerMap::const_iterator i =
|
||||
plugin_window_to_container_map_.begin();
|
||||
@ -135,7 +135,7 @@ void AcceleratedSurfaceContainerManagerMac::ForceTextureReload() {
|
||||
|
||||
void AcceleratedSurfaceContainerManagerMac::SetSurfaceWasPaintedTo(
|
||||
gfx::PluginWindowHandle id, uint64 surface_id) {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
AcceleratedSurfaceContainerMac* container = MapIDToContainer(id);
|
||||
if (container)
|
||||
@ -143,14 +143,14 @@ void AcceleratedSurfaceContainerManagerMac::SetSurfaceWasPaintedTo(
|
||||
}
|
||||
|
||||
void AcceleratedSurfaceContainerManagerMac::SetRootSurfaceInvalid() {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
if (root_container_)
|
||||
root_container_->set_surface_invalid();
|
||||
}
|
||||
|
||||
bool AcceleratedSurfaceContainerManagerMac::SurfaceShouldBeVisible(
|
||||
gfx::PluginWindowHandle id) const {
|
||||
AutoLock lock(lock_);
|
||||
base::AutoLock lock(lock_);
|
||||
|
||||
if (IsRootContainer(id) && !gpu_rendering_active_)
|
||||
return false;
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#include "app/surface/transport_dib.h"
|
||||
#include "base/basictypes.h"
|
||||
#include "base/lock.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "gfx/native_widget_types.h"
|
||||
|
||||
namespace webkit {
|
||||
@ -116,7 +116,7 @@ class AcceleratedSurfaceContainerManagerMac {
|
||||
// Both |plugin_window_to_container_map_| and the
|
||||
// AcceleratedSurfaceContainerMac in it are not threadsafe, but accessed from
|
||||
// multiple threads. All these accesses are guarded by this lock.
|
||||
mutable Lock lock_;
|
||||
mutable base::Lock lock_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerManagerMac);
|
||||
};
|
||||
|
@ -186,7 +186,7 @@ bool DownloadResourceHandler::OnReadCompleted(int request_id, int* bytes_read) {
|
||||
if (!*bytes_read)
|
||||
return true;
|
||||
DCHECK(read_buffer_);
|
||||
AutoLock auto_lock(buffer_->lock);
|
||||
base::AutoLock auto_lock(buffer_->lock);
|
||||
bool need_update = buffer_->contents.empty();
|
||||
|
||||
// We are passing ownership of this buffer to the download file manager.
|
||||
@ -265,7 +265,7 @@ void DownloadResourceHandler::CheckWriteProgress() {
|
||||
|
||||
size_t contents_size;
|
||||
{
|
||||
AutoLock lock(buffer_->lock);
|
||||
base::AutoLock lock(buffer_->lock);
|
||||
contents_size = buffer_->contents.size();
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ void RenderMessageFilter::DoOnGetWindowRect(gfx::NativeViewId view,
|
||||
gfx::Rect rect;
|
||||
XID window;
|
||||
|
||||
AutoLock lock(GtkNativeViewManager::GetInstance()->unrealize_lock());
|
||||
base::AutoLock lock(GtkNativeViewManager::GetInstance()->unrealize_lock());
|
||||
if (GtkNativeViewManager::GetInstance()->GetXIDForId(&window, view)) {
|
||||
if (window) {
|
||||
int x, y;
|
||||
@ -100,7 +100,7 @@ void RenderMessageFilter::DoOnGetRootWindowRect(gfx::NativeViewId view,
|
||||
gfx::Rect rect;
|
||||
XID window;
|
||||
|
||||
AutoLock lock(GtkNativeViewManager::GetInstance()->unrealize_lock());
|
||||
base::AutoLock lock(GtkNativeViewManager::GetInstance()->unrealize_lock());
|
||||
if (GtkNativeViewManager::GetInstance()->GetXIDForId(&window, view)) {
|
||||
if (window) {
|
||||
const XID toplevel = GetTopLevelWindow(window);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user