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

Side by Side Diff: src/ports/SkOSFile_posix.cpp

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 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
« no previous file with comments | « src/ports/SkImageGenerator_skia.cpp ('k') | src/ports/SkOSFile_win.cpp » ('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 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkOSFile.h" 8 #include "SkOSFile.h"
9 #include "SkString.h" 9 #include "SkString.h"
10 #include "SkTFitsIn.h" 10 #include "SkTFitsIn.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 //////////////////////////////////////////////////////////////////////////// 98 ////////////////////////////////////////////////////////////////////////////
99 99
100 struct SkOSFileIterData { 100 struct SkOSFileIterData {
101 SkOSFileIterData() : fDIR(0) { } 101 SkOSFileIterData() : fDIR(0) { }
102 DIR* fDIR; 102 DIR* fDIR;
103 SkString fPath, fSuffix; 103 SkString fPath, fSuffix;
104 }; 104 };
105 static_assert(sizeof(SkOSFileIterData) <= SkOSFile::Iter::kStorageSize, "not_eno ugh_space"); 105 static_assert(sizeof(SkOSFileIterData) <= SkOSFile::Iter::kStorageSize, "not_eno ugh_space");
106 106
107 SkOSFile::Iter::Iter() { 107 SkOSFile::Iter::Iter() { new (fSelf.get()) SkOSFileIterData; }
108 SkNEW_PLACEMENT(fSelf.get(), SkOSFileIterData);
109 }
110 108
111 SkOSFile::Iter::Iter(const char path[], const char suffix[]) { 109 SkOSFile::Iter::Iter(const char path[], const char suffix[]) {
112 SkNEW_PLACEMENT(fSelf.get(), SkOSFileIterData); 110 new (fSelf.get()) SkOSFileIterData;
113 this->reset(path, suffix); 111 this->reset(path, suffix);
114 } 112 }
115 113
116 SkOSFile::Iter::~Iter() { 114 SkOSFile::Iter::~Iter() {
117 SkOSFileIterData& self = *static_cast<SkOSFileIterData*>(fSelf.get()); 115 SkOSFileIterData& self = *static_cast<SkOSFileIterData*>(fSelf.get());
118 if (self.fDIR) { 116 if (self.fDIR) {
119 ::closedir(self.fDIR); 117 ::closedir(self.fDIR);
120 } 118 }
121 self.~SkOSFileIterData(); 119 self.~SkOSFileIterData();
122 } 120 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 } 172 }
175 if (entry) { // we broke out with a file 173 if (entry) { // we broke out with a file
176 if (name) { 174 if (name) {
177 name->set(entry->d_name); 175 name->set(entry->d_name);
178 } 176 }
179 return true; 177 return true;
180 } 178 }
181 } 179 }
182 return false; 180 return false;
183 } 181 }
OLDNEW
« no previous file with comments | « src/ports/SkImageGenerator_skia.cpp ('k') | src/ports/SkOSFile_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698