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

Side by Side Diff: webrtc/base/diskcache.cc

Issue 1405023016: Convert usage of ARRAY_SIZE to arraysize. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: static_cast<int> Created 5 years, 1 month 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 | « webrtc/base/crc32.cc ('k') | webrtc/base/fileutils.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 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #include <time.h> 11 #include <time.h>
12 12
13 #if defined(WEBRTC_WIN) 13 #if defined(WEBRTC_WIN)
14 #include "webrtc/base/win32.h" 14 #include "webrtc/base/win32.h"
15 #endif 15 #endif
16 16
17 #include <algorithm> 17 #include <algorithm>
18 #include "webrtc/base/arraysize.h"
18 #include "webrtc/base/common.h" 19 #include "webrtc/base/common.h"
19 #include "webrtc/base/diskcache.h" 20 #include "webrtc/base/diskcache.h"
20 #include "webrtc/base/fileutils.h" 21 #include "webrtc/base/fileutils.h"
21 #include "webrtc/base/pathutils.h" 22 #include "webrtc/base/pathutils.h"
22 #include "webrtc/base/stream.h" 23 #include "webrtc/base/stream.h"
23 #include "webrtc/base/stringencode.h" 24 #include "webrtc/base/stringencode.h"
24 #include "webrtc/base/stringutils.h" 25 #include "webrtc/base/stringutils.h"
25 26
26 #if !defined(NDEBUG) 27 #if !defined(NDEBUG)
27 #define TRANSPARENT_CACHE_NAMES 1 28 #define TRANSPARENT_CACHE_NAMES 1
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 encode(buffer, buffer_size, id.data(), id.length(), 257 encode(buffer, buffer_size, id.data(), id.length(),
257 unsafe_filename_characters(), '%'); 258 unsafe_filename_characters(), '%');
258 // TODO: ASSERT(strlen(buffer) < FileSystem::MaxBasenameLength()); 259 // TODO: ASSERT(strlen(buffer) < FileSystem::MaxBasenameLength());
259 #else // !TRANSPARENT_CACHE_NAMES 260 #else // !TRANSPARENT_CACHE_NAMES
260 // We might want to just use a hash of the filename at some point, both for 261 // We might want to just use a hash of the filename at some point, both for
261 // obfuscation, and to avoid both filename length and escaping issues. 262 // obfuscation, and to avoid both filename length and escaping issues.
262 ASSERT(false); 263 ASSERT(false);
263 #endif // !TRANSPARENT_CACHE_NAMES 264 #endif // !TRANSPARENT_CACHE_NAMES
264 265
265 char extension[32]; 266 char extension[32];
266 sprintfn(extension, ARRAY_SIZE(extension), ".%u", index); 267 sprintfn(extension, arraysize(extension), ".%u", index);
267 268
268 Pathname pathname; 269 Pathname pathname;
269 pathname.SetFolder(folder_); 270 pathname.SetFolder(folder_);
270 pathname.SetBasename(buffer); 271 pathname.SetBasename(buffer);
271 pathname.SetExtension(extension); 272 pathname.SetExtension(extension);
272 273
273 #ifdef TRANSPARENT_CACHE_NAMES 274 #ifdef TRANSPARENT_CACHE_NAMES
274 delete [] buffer; 275 delete [] buffer;
275 #endif // TRANSPARENT_CACHE_NAMES 276 #endif // TRANSPARENT_CACHE_NAMES
276 277
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 entry2->last_modified = time(0); 340 entry2->last_modified = time(0);
340 entry2->lock_state = LS_UNLOCKED; 341 entry2->lock_state = LS_UNLOCKED;
341 this2->CheckLimit(); 342 this2->CheckLimit();
342 } 343 }
343 } 344 }
344 } 345 }
345 346
346 /////////////////////////////////////////////////////////////////////////////// 347 ///////////////////////////////////////////////////////////////////////////////
347 348
348 } // namespace rtc 349 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/base/crc32.cc ('k') | webrtc/base/fileutils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698