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

Side by Side Diff: trunk/src/content/test/weburl_loader_mock_factory.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/test/weburl_loader_mock_factory.h" 5 #include "content/test/weburl_loader_mock_factory.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "content/test/webkit_support.h" 10 #include "content/test/webkit_support.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 // static 175 // static
176 bool WebURLLoaderMockFactory::ReadFile(const base::FilePath& file_path, 176 bool WebURLLoaderMockFactory::ReadFile(const base::FilePath& file_path,
177 WebData* data) { 177 WebData* data) {
178 int64 file_size = 0; 178 int64 file_size = 0;
179 if (!base::GetFileSize(file_path, &file_size)) 179 if (!base::GetFileSize(file_path, &file_size))
180 return false; 180 return false;
181 181
182 int size = static_cast<int>(file_size); 182 int size = static_cast<int>(file_size);
183 scoped_ptr<char[]> buffer(new char[size]); 183 scoped_ptr<char[]> buffer(new char[size]);
184 data->reset(); 184 data->reset();
185 int read_count = base::ReadFile(file_path, buffer.get(), size); 185 int read_count = file_util::ReadFile(file_path, buffer.get(), size);
186 if (read_count == -1) 186 if (read_count == -1)
187 return false; 187 return false;
188 DCHECK(read_count == size); 188 DCHECK(read_count == size);
189 data->assign(buffer.get(), size); 189 data->assign(buffer.get(), size);
190 190
191 return true; 191 return true;
192 } 192 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698