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

Side by Side Diff: chrome/browser/plugins/plugin_finder.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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
« no previous file with comments | « chrome/browser/plugins/plugin_finder.h ('k') | chrome/browser/plugins/plugin_prefs_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/plugins/plugin_finder.h" 5 #include "chrome/browser/plugins/plugin_finder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 } // namespace 154 } // namespace
155 155
156 // static 156 // static
157 void PluginFinder::RegisterPrefs(PrefRegistrySimple* registry) { 157 void PluginFinder::RegisterPrefs(PrefRegistrySimple* registry) {
158 registry->RegisterBooleanPref(prefs::kDisablePluginFinder, false); 158 registry->RegisterBooleanPref(prefs::kDisablePluginFinder, false);
159 } 159 }
160 160
161 // static 161 // static
162 PluginFinder* PluginFinder::GetInstance() { 162 PluginFinder* PluginFinder::GetInstance() {
163 // PluginFinder::GetInstance() is the only method that's allowed to call 163 // PluginFinder::GetInstance() is the only method that's allowed to call
164 // Singleton<PluginFinder>::get(). 164 // base::Singleton<PluginFinder>::get().
165 return Singleton<PluginFinder>::get(); 165 return base::Singleton<PluginFinder>::get();
166 } 166 }
167 167
168 PluginFinder::PluginFinder() : version_(-1) { 168 PluginFinder::PluginFinder() : version_(-1) {
169 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 169 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
170 } 170 }
171 171
172 void PluginFinder::Init() { 172 void PluginFinder::Init() {
173 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 173 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
174 // Load the built-in plugin list first. If we have a newer version stored 174 // Load the built-in plugin list first. If we have a newer version stored
175 // locally or download one, we will replace this one with it. 175 // locally or download one, we will replace this one with it.
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 metadata->AddMatchingMimeType(plugin.mime_types[i].mime_type); 376 metadata->AddMatchingMimeType(plugin.mime_types[i].mime_type);
377 377
378 DCHECK(metadata->MatchesPlugin(plugin)); 378 DCHECK(metadata->MatchesPlugin(plugin));
379 if (identifier_plugin_.find(identifier) != identifier_plugin_.end()) 379 if (identifier_plugin_.find(identifier) != identifier_plugin_.end())
380 identifier = GetLongIdentifier(plugin); 380 identifier = GetLongIdentifier(plugin);
381 381
382 DCHECK(identifier_plugin_.find(identifier) == identifier_plugin_.end()); 382 DCHECK(identifier_plugin_.find(identifier) == identifier_plugin_.end());
383 identifier_plugin_[identifier] = metadata; 383 identifier_plugin_[identifier] = metadata;
384 return metadata->Clone(); 384 return metadata->Clone();
385 } 385 }
OLDNEW
« no previous file with comments | « chrome/browser/plugins/plugin_finder.h ('k') | chrome/browser/plugins/plugin_prefs_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698