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

Side by Side Diff: chrome/browser/net/metadata_url_request.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/metrics/metrics_log.cc ('k') | chrome/browser/page_info_model.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/net/metadata_url_request.h" 5 #include "chrome/browser/net/metadata_url_request.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/parsers/metadata_parser_manager.h" 10 #include "chrome/browser/parsers/metadata_parser_manager.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 int *bytes_read) { 68 int *bytes_read) {
69 FilePath path; 69 FilePath path;
70 70
71 if (!request()->url().is_valid()) { 71 if (!request()->url().is_valid()) {
72 return false; 72 return false;
73 } 73 }
74 if (!net::FileURLToFilePath(request()->url(), &path)) { 74 if (!net::FileURLToFilePath(request()->url(), &path)) {
75 return false; 75 return false;
76 } 76 }
77 if (!parsed) { 77 if (!parsed) {
78 MetadataParserManager* manager = MetadataParserManager::Get(); 78 MetadataParserManager* manager = MetadataParserManager::GetInstance();
79 scoped_ptr<MetadataParser> parser(manager->GetParserForFile(path)); 79 scoped_ptr<MetadataParser> parser(manager->GetParserForFile(path));
80 if (parser != NULL) { 80 if (parser != NULL) {
81 result_ = "{\n"; 81 result_ = "{\n";
82 parser->Parse(); 82 parser->Parse();
83 MetadataPropertyIterator *iter = parser->GetPropertyIterator(); 83 MetadataPropertyIterator *iter = parser->GetPropertyIterator();
84 while (!iter->IsEnd()) { 84 while (!iter->IsEnd()) {
85 std::string key; 85 std::string key;
86 std::string value; 86 std::string value;
87 if (iter->GetNext(&key, &value)) { 87 if (iter->GetNext(&key, &value)) {
88 result_ += "\""; 88 result_ += "\"";
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 } 123 }
124 124
125 } // namespace 125 } // namespace
126 126
127 void RegisterMetadataURLRequestHandler() { 127 void RegisterMetadataURLRequestHandler() {
128 #if defined(OS_CHROMEOS) 128 #if defined(OS_CHROMEOS)
129 net::URLRequest::RegisterProtocolFactory(chrome::kMetadataScheme, 129 net::URLRequest::RegisterProtocolFactory(chrome::kMetadataScheme,
130 &MetadataRequestHandler::Factory); 130 &MetadataRequestHandler::Factory);
131 #endif 131 #endif
132 } 132 }
OLDNEW
« no previous file with comments | « chrome/browser/metrics/metrics_log.cc ('k') | chrome/browser/page_info_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698