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

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

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/entry_impl.h ('k') | net/disk_cache/file_lock.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // See net/disk_cache/disk_cache.h for the public interface of the cache. 5 // See net/disk_cache/disk_cache.h for the public interface of the cache.
6 6
7 #ifndef NET_DISK_CACHE_FILE_LOCK_H__ 7 #ifndef NET_DISK_CACHE_FILE_LOCK_H__
8 #define NET_DISK_CACHE_FILE_LOCK_H__ 8 #define NET_DISK_CACHE_FILE_LOCK_H__
9 #pragma once 9 #pragma once
10 10
(...skipping 13 matching lines...) Expand all
24 // header->max_entries = num_entries; 24 // header->max_entries = num_entries;
25 // // At this point the destructor is going to release the lock. 25 // // At this point the destructor is going to release the lock.
26 // } 26 // }
27 // It is important to perform Lock() and Unlock() operations in the right order, 27 // It is important to perform Lock() and Unlock() operations in the right order,
28 // because otherwise the desired effect of the "lock" will not be achieved. If 28 // because otherwise the desired effect of the "lock" will not be achieved. If
29 // the operations are inlined / optimized, the "locked" operations can happen 29 // the operations are inlined / optimized, the "locked" operations can happen
30 // outside the lock. 30 // outside the lock.
31 class NET_TEST FileLock { 31 class NET_TEST FileLock {
32 public: 32 public:
33 explicit FileLock(BlockFileHeader* header); 33 explicit FileLock(BlockFileHeader* header);
34 virtual ~FileLock() { 34 virtual ~FileLock();
35 Unlock(); 35
36 }
37 // Virtual to make sure the compiler never inlines the calls. 36 // Virtual to make sure the compiler never inlines the calls.
38 virtual void Lock(); 37 virtual void Lock();
39 virtual void Unlock(); 38 virtual void Unlock();
40 private: 39 private:
41 bool acquired_; 40 bool acquired_;
42 volatile int32* updating_; 41 volatile int32* updating_;
43 }; 42 };
44 43
45 } // namespace disk_cache 44 } // namespace disk_cache
46 45
47 #endif // NET_DISK_CACHE_FILE_LOCK_H__ 46 #endif // NET_DISK_CACHE_FILE_LOCK_H__
OLDNEW
« no previous file with comments | « net/disk_cache/entry_impl.h ('k') | net/disk_cache/file_lock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698