Commit 36b749b4 authored by Lukasz Anforowicz's avatar Lukasz Anforowicz Committed by Commit Bot

Adding GUARDED_BY annotations to //content/common.

Bug: 887645
Change-Id: I0f05856b0473bb6c197d53184322faa1042b2f23
Reviewed-on: https://chromium-review.googlesource.com/1237253Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593981}
parent 3924701b
......@@ -12,6 +12,7 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/strings/string16.h"
#include "base/thread_annotations.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "services/service_manager/public/cpp/bind_source_info.h"
......@@ -125,8 +126,8 @@ class FontCache {
FontCache() {
}
std::map<base::string16, CacheElement> cache_;
DispatcherToFontNames dispatcher_font_map_;
std::map<base::string16, CacheElement> cache_ GUARDED_BY(mutex_);
DispatcherToFontNames dispatcher_font_map_ GUARDED_BY(mutex_);
base::Lock mutex_;
DISALLOW_COPY_AND_ASSIGN(FontCache);
......
......@@ -15,6 +15,7 @@
#include "base/lazy_instance.h"
#include "base/macros.h"
#include "base/synchronization/lock.h"
#include "base/thread_annotations.h"
#include "build/build_config.h"
#include "content/common/content_export.h"
#include "content/public/common/webplugininfo.h"
......@@ -122,7 +123,8 @@ class CONTENT_EXPORT PluginList {
// Removes |plugin_path| from the list of extra plugin paths. Should only be
// called while holding |lock_|.
void RemoveExtraPluginPathLocked(const base::FilePath& plugin_path);
void RemoveExtraPluginPathLocked(const base::FilePath& plugin_path)
EXCLUSIVE_LOCKS_REQUIRED(lock_);
// Creates a WebPluginInfo structure given a plugin's path. On success
// returns true, with the information being put into "info".
......@@ -142,19 +144,19 @@ class CONTENT_EXPORT PluginList {
// States whether we will load the plugin list the next time we try to access
// it, whether we are currently in the process of loading it, or whether we
// consider it up to date.
LoadingState loading_state_;
LoadingState loading_state_ GUARDED_BY(lock_);
// Extra plugin paths that we want to search when loading.
std::vector<base::FilePath> extra_plugin_paths_;
std::vector<base::FilePath> extra_plugin_paths_ GUARDED_BY(lock_);
// Holds information about internal plugins.
std::vector<WebPluginInfo> internal_plugins_;
std::vector<WebPluginInfo> internal_plugins_ GUARDED_BY(lock_);
// A list holding all plugins.
std::vector<WebPluginInfo> plugins_list_;
std::vector<WebPluginInfo> plugins_list_ GUARDED_BY(lock_);
// Callback that is invoked whenever the PluginList will reload the plugins.
base::Closure will_load_plugins_callback_;
base::Closure will_load_plugins_callback_ GUARDED_BY(lock_);
// Need synchronization for the above members since this object can be
// accessed on multiple threads.
......
......@@ -14,6 +14,7 @@
#include "base/lazy_instance.h"
#include "base/macros.h"
#include "base/message_loop/message_loop_current.h"
#include "base/thread_annotations.h"
#include "base/threading/thread_checker.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
......@@ -339,14 +340,15 @@ class ServiceManagerConnectionImpl::IOThreadContext
std::unique_ptr<service_manager::ServiceContext> service_context_;
mojo::BindingSet<service_manager::mojom::ServiceFactory> factory_bindings_;
int next_filter_id_ = kInvalidConnectionFilterId;
// Not owned.
MessageLoopObserver* message_loop_observer_ = nullptr;
// Guards |connection_filters_|.
// Guards |connection_filters_| and |next_filter_id_|.
base::Lock lock_;
std::map<int, std::unique_ptr<ConnectionFilter>> connection_filters_;
std::map<int, std::unique_ptr<ConnectionFilter>> connection_filters_
GUARDED_BY(lock_);
int next_filter_id_ GUARDED_BY(lock_) = kInvalidConnectionFilterId;
std::map<std::string, std::unique_ptr<service_manager::EmbeddedServiceRunner>>
embedded_services_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment