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

Side by Side Diff: net/disk_cache/file_lock.cc

Issue 7064033: Virtual destructors should have virtual keyword. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 7 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 | « net/disk_cache/file_lock.h ('k') | net/disk_cache/in_flight_backend_io.h » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "net/disk_cache/file_lock.h" 5 #include "net/disk_cache/file_lock.h"
6 6
7 namespace disk_cache { 7 namespace disk_cache {
8 8
9 FileLock::FileLock(BlockFileHeader* header) { 9 FileLock::FileLock(BlockFileHeader* header) {
10 updating_ = &header->updating; 10 updating_ = &header->updating;
11 (*updating_)++; 11 (*updating_)++;
12 acquired_ = true; 12 acquired_ = true;
13 } 13 }
14 14
15 FileLock::~FileLock() {
16 Unlock();
17 }
18
15 void FileLock::Lock() { 19 void FileLock::Lock() {
16 if (acquired_) 20 if (acquired_)
17 return; 21 return;
18 (*updating_)++; 22 (*updating_)++;
19 } 23 }
20 24
21 void FileLock::Unlock() { 25 void FileLock::Unlock() {
22 if (!acquired_) 26 if (!acquired_)
23 return; 27 return;
24 (*updating_)--; 28 (*updating_)--;
25 } 29 }
26 30
27 } // namespace disk_cache 31 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/file_lock.h ('k') | net/disk_cache/in_flight_backend_io.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698