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

Side by Side Diff: extensions/browser/error_map.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/browser/error_map.h" 5 #include "extensions/browser/error_map.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 12
13 namespace extensions { 13 namespace extensions {
14 14
15 namespace { 15 namespace {
16 16
17 // The maximum number of errors to be stored per extension. 17 // The maximum number of errors to be stored per extension.
18 const size_t kMaxErrorsPerExtension = 100; 18 const size_t kMaxErrorsPerExtension = 100;
19 19
20 base::LazyInstance<ErrorList> g_empty_error_list = LAZY_INSTANCE_INITIALIZER; 20 base::LazyInstance<ErrorList>::DestructorAtExit g_empty_error_list =
21 LAZY_INSTANCE_INITIALIZER;
21 22
22 // An incrementing counter for the next error id. Overflowing this is very 23 // An incrementing counter for the next error id. Overflowing this is very
23 // unlikely, since the number of errors per extension is capped at 100. 24 // unlikely, since the number of errors per extension is capped at 100.
24 int kNextErrorId = 1; 25 int kNextErrorId = 1;
25 26
26 } // namespace 27 } // namespace
27 28
28 //////////////////////////////////////////////////////////////////////////////// 29 ////////////////////////////////////////////////////////////////////////////////
29 // ErrorMap::Filter 30 // ErrorMap::Filter
30 ErrorMap::Filter::Filter(const std::string& restrict_to_extension_id, 31 ErrorMap::Filter::Filter(const std::string& restrict_to_extension_id,
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 affected_ids->insert(key_val.first); 201 affected_ids->insert(key_val.first);
201 } 202 }
202 } 203 }
203 } 204 }
204 205
205 void ErrorMap::RemoveAllErrors() { 206 void ErrorMap::RemoveAllErrors() {
206 map_.clear(); 207 map_.clear();
207 } 208 }
208 209
209 } // namespace extensions 210 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/browser_context_keyed_api_factory.h ('k') | extensions/browser/extension_api_frame_id_map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698