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

Side by Side Diff: utils/cross/temporary_file.cc

Issue 203077: This updated the GYP deps file to the last known good revision of Chrome,... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: Created 11 years, 3 months 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 | « core/win/d3d9/utils_d3d9.h ('k') | utils/cross/temporary_file_test.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 /* 1 /*
2 * Copyright 2009, Google Inc. 2 * Copyright 2009, Google Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 TemporaryFile::TemporaryFile() { 50 TemporaryFile::TemporaryFile() {
51 // file_path_ is initialized to be empty. 51 // file_path_ is initialized to be empty.
52 } 52 }
53 53
54 TemporaryFile::TemporaryFile(const FilePath& file_to_manage) 54 TemporaryFile::TemporaryFile(const FilePath& file_to_manage)
55 : file_path_(file_to_manage) { 55 : file_path_(file_to_manage) {
56 } 56 }
57 57
58 bool TemporaryFile::Create(TemporaryFile* temporary_file) { 58 bool TemporaryFile::Create(TemporaryFile* temporary_file) {
59 FilePath temporary_path; 59 FilePath temporary_path;
60 if (file_util::CreateTemporaryFileName(&temporary_path)) { 60 if (file_util::CreateTemporaryFile(&temporary_path)) {
61 temporary_file->Reset(temporary_path); 61 temporary_file->Reset(temporary_path);
62 } else { 62 } else {
63 return false; 63 return false;
64 } 64 }
65 return true; 65 return true;
66 } 66 }
67 67
68 TemporaryFile::~TemporaryFile() { 68 TemporaryFile::~TemporaryFile() {
69 DeletePath(file_path_); 69 DeletePath(file_path_);
70 } 70 }
71 71
72 FilePath TemporaryFile::Release() { 72 FilePath TemporaryFile::Release() {
73 FilePath old_path = file_path_; 73 FilePath old_path = file_path_;
74 file_path_ = FilePath(); 74 file_path_ = FilePath();
75 return old_path; 75 return old_path;
76 } 76 }
77 77
78 void TemporaryFile::Reset(const FilePath& file_path) { 78 void TemporaryFile::Reset(const FilePath& file_path) {
79 DeletePath(file_path_); 79 DeletePath(file_path_);
80 file_path_ = file_path; 80 file_path_ = file_path;
81 } 81 }
82 82
83 } // end namespace o3d 83 } // end namespace o3d
OLDNEW
« no previous file with comments | « core/win/d3d9/utils_d3d9.h ('k') | utils/cross/temporary_file_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698