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

Side by Side Diff: courgette/memory_allocator.cc

Issue 99923002: Move temp file functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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
« no previous file with comments | « content/public/test/test_launcher.cc ('k') | extensions/common/file_util_unittest.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) 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 "courgette/memory_allocator.h" 5 #include "courgette/memory_allocator.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 14 matching lines...) Expand all
25 void TempFile::Close() { 25 void TempFile::Close() {
26 if (valid()) { 26 if (valid()) {
27 base::ClosePlatformFile(file_); 27 base::ClosePlatformFile(file_);
28 file_ = base::kInvalidPlatformFileValue; 28 file_ = base::kInvalidPlatformFileValue;
29 } 29 }
30 } 30 }
31 31
32 bool TempFile::Create() { 32 bool TempFile::Create() {
33 DCHECK(file_ == base::kInvalidPlatformFileValue); 33 DCHECK(file_ == base::kInvalidPlatformFileValue);
34 base::FilePath path; 34 base::FilePath path;
35 if (!file_util::CreateTemporaryFile(&path)) 35 if (!base::CreateTemporaryFile(&path))
36 return false; 36 return false;
37 37
38 bool created = false; 38 bool created = false;
39 base::PlatformFileError error_code = base::PLATFORM_FILE_OK; 39 base::PlatformFileError error_code = base::PLATFORM_FILE_OK;
40 int flags = base::PLATFORM_FILE_OPEN_ALWAYS | base::PLATFORM_FILE_READ | 40 int flags = base::PLATFORM_FILE_OPEN_ALWAYS | base::PLATFORM_FILE_READ |
41 base::PLATFORM_FILE_WRITE | 41 base::PLATFORM_FILE_WRITE |
42 base::PLATFORM_FILE_DELETE_ON_CLOSE | 42 base::PLATFORM_FILE_DELETE_ON_CLOSE |
43 base::PLATFORM_FILE_TEMPORARY; 43 base::PLATFORM_FILE_TEMPORARY;
44 file_ = base::CreatePlatformFile(path, flags, &created, &error_code); 44 file_ = base::CreatePlatformFile(path, flags, &created, &error_code);
45 if (file_ == base::kInvalidPlatformFileValue) 45 if (file_ == base::kInvalidPlatformFileValue)
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 if (mem) { 153 if (mem) {
154 ret = reinterpret_cast<TempMapping**>(mem)[-1]; 154 ret = reinterpret_cast<TempMapping**>(mem)[-1];
155 } 155 }
156 DCHECK(ret); 156 DCHECK(ret);
157 return ret; 157 return ret;
158 } 158 }
159 159
160 } // namespace courgette 160 } // namespace courgette
161 161
162 #endif // OS_WIN 162 #endif // OS_WIN
OLDNEW
« no previous file with comments | « content/public/test/test_launcher.cc ('k') | extensions/common/file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698