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

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

Issue 105823009: Revert 239280 "Move more file_util functions to base namespace." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 21 matching lines...) Expand all
32 RegisterParserFactory(factory); 32 RegisterParserFactory(factory);
33 } 33 }
34 34
35 MetadataParserManager::~MetadataParserManager() {} 35 MetadataParserManager::~MetadataParserManager() {}
36 36
37 MetadataParser* MetadataParserManager::GetParserForFile( 37 MetadataParser* MetadataParserManager::GetParserForFile(
38 const base::FilePath& path) { 38 const base::FilePath& path) {
39 char buffer[kAmountToRead]; 39 char buffer[kAmountToRead];
40 int amount_read = 0; 40 int amount_read = 0;
41 DLOG(ERROR) << path.value(); 41 DLOG(ERROR) << path.value();
42 amount_read = base::ReadFile(path, buffer, sizeof(buffer)); 42 amount_read = file_util::ReadFile(path, buffer, sizeof(buffer));
43 if (amount_read <= 0) { 43 if (amount_read <= 0) {
44 DLOG(ERROR) << "Unable to read file"; 44 DLOG(ERROR) << "Unable to read file";
45 return NULL; 45 return NULL;
46 } 46 }
47 for (size_t x = 0; x < factories_.size(); ++x) { 47 for (size_t x = 0; x < factories_.size(); ++x) {
48 if (factories_[x]->CanParse(path, buffer, amount_read)) { 48 if (factories_[x]->CanParse(path, buffer, amount_read)) {
49 return factories_[x]->CreateParser(path); 49 return factories_[x]->CreateParser(path);
50 } 50 }
51 } 51 }
52 return NULL; 52 return NULL;
53 } 53 }
OLDNEW
« no previous file with comments | « trunk/src/chrome/browser/net/net_log_temp_file.cc ('k') | trunk/src/chrome/browser/safe_browsing/prefix_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698