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

Side by Side Diff: chrome/browser/parsers/metadata_parser_manager.cc

Issue 5685007: Rename all methods accessing Singleton<T> as GetInstance(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/parsers/metadata_parser_manager.h ('k') | chrome/browser/plugin_process_host.cc » ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/parsers/metadata_parser_manager.h" 5 #include "chrome/browser/parsers/metadata_parser_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/singleton.h" 9 #include "base/singleton.h"
10 #include "base/stl_util-inl.h" 10 #include "base/stl_util-inl.h"
11 #include "build/build_config.h" 11 #include "build/build_config.h"
12 #include "chrome/browser/parsers/metadata_parser_factory.h" 12 #include "chrome/browser/parsers/metadata_parser_factory.h"
13 #include "chrome/browser/parsers/metadata_parser_jpeg_factory.h" 13 #include "chrome/browser/parsers/metadata_parser_jpeg_factory.h"
14 14
15 static const int kAmountToRead = 256; 15 static const int kAmountToRead = 256;
16 16
17 // Gets the singleton 17 // Gets the singleton
18 MetadataParserManager* MetadataParserManager::Get() { 18 MetadataParserManager* MetadataParserManager::GetInstance() {
19 // Uses the LeakySingletonTrait because cleanup is optional. 19 // Uses the LeakySingletonTrait because cleanup is optional.
20 return 20 return Singleton<MetadataParserManager,
21 Singleton<MetadataParserManager, 21 LeakySingletonTraits<MetadataParserManager> >::get();
22 LeakySingletonTraits<MetadataParserManager> >::get(); 22 }
23 }
24 23
25 bool MetadataParserManager::RegisterParserFactory( 24 bool MetadataParserManager::RegisterParserFactory(
26 MetadataParserFactory* parser) { 25 MetadataParserFactory* parser) {
27 factories_.push_back(parser); 26 factories_.push_back(parser);
28 return true; 27 return true;
29 } 28 }
30 29
31 MetadataParserManager::MetadataParserManager() { 30 MetadataParserManager::MetadataParserManager() {
32 MetadataParserJpegFactory *factory = new MetadataParserJpegFactory(); 31 MetadataParserJpegFactory *factory = new MetadataParserJpegFactory();
33 RegisterParserFactory(factory); 32 RegisterParserFactory(factory);
(...skipping 11 matching lines...) Expand all
45 DLOG(ERROR) << "Unable to read file"; 44 DLOG(ERROR) << "Unable to read file";
46 return NULL; 45 return NULL;
47 } 46 }
48 for (size_t x = 0; x < factories_.size(); ++x) { 47 for (size_t x = 0; x < factories_.size(); ++x) {
49 if (factories_[x]->CanParse(path, buffer, amount_read)) { 48 if (factories_[x]->CanParse(path, buffer, amount_read)) {
50 return factories_[x]->CreateParser(path); 49 return factories_[x]->CreateParser(path);
51 } 50 }
52 } 51 }
53 return NULL; 52 return NULL;
54 } 53 }
OLDNEW
« no previous file with comments | « chrome/browser/parsers/metadata_parser_manager.h ('k') | chrome/browser/plugin_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698