Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1323)

Unified Diff: chrome/browser/content_settings/host_content_settings_map.h

Issue 12223052: Remove unused lock, add debug-only verification of intended usage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Forgot that DCHECK-enabled != NDEBUG not defined. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/content_settings/host_content_settings_map.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/content_settings/host_content_settings_map.h
diff --git a/chrome/browser/content_settings/host_content_settings_map.h b/chrome/browser/content_settings/host_content_settings_map.h
index 635a3dba37bb86474c647f72f88ac6ce527ed3e1..46f62ffe0145ea9fd66f9e1da83e21b99c5f797a 100644
--- a/chrome/browser/content_settings/host_content_settings_map.h
+++ b/chrome/browser/content_settings/host_content_settings_map.h
@@ -15,7 +15,6 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/prefs/public/pref_change_registrar.h"
-#include "base/synchronization/lock.h"
#include "base/tuple.h"
#include "chrome/browser/content_settings/content_settings_observer.h"
#include "chrome/common/content_settings.h"
@@ -230,18 +229,27 @@ class HostContentSettingsMap
ContentSettingsForOneType* settings,
bool incognito) const;
+ // Call UsedContentSettingsProviders() whenever you access
+ // content_settings_providers_ (apart from initialization and
+ // teardown), so that we can DCHECK in RegisterExtensionService that
+ // it is not being called too late.
+ void UsedContentSettingsProviders() const;
+
+#ifndef NDEBUG
+ mutable bool used_content_settings_providers_;
+#endif
+
// Weak; owned by the Profile.
PrefService* prefs_;
// Whether this settings map is for an OTR session.
bool is_off_the_record_;
- // Content setting providers.
+ // Content setting providers. This is only modified at construction
+ // time and by RegisterExtensionService, both of which should happen
+ // before any other uses of it.
ProviderMap content_settings_providers_;
- // Used around accesses to the following objects to guarantee thread safety.
- mutable base::Lock lock_;
-
DISALLOW_COPY_AND_ASSIGN(HostContentSettingsMap);
};
« no previous file with comments | « no previous file | chrome/browser/content_settings/host_content_settings_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698