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

Side by Side Diff: content/browser/cache_storage/cache_storage_cache_handle.h

Issue 2056983004: [CacheStorage] Give ownership of all CacheStorageCaches to CacheStorage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_HANDLE_H_
6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_HANDLE_H_
7
8 #include "base/memory/weak_ptr.h"
9 #include "content/browser/cache_storage/cache_storage.h"
10 #include "content/browser/cache_storage/cache_storage_cache.h"
11
12 namespace content {
13
14 // Holds a reference to a CacheStorageCache. The CacheStorage will keep the
15 // CacheStorageCache alive until the last handle is destroyed or the
16 // CacheStorage is deleted.
17 class CONTENT_EXPORT CacheStorageCacheHandle {
18 public:
19 ~CacheStorageCacheHandle();
20
21 // Returns the underlying CacheStorageCache*. Will return nullptr if the
22 // CacheStorage has been deleted.
23 CacheStorageCache* value() { return cache_storage_cache_.get(); }
24
25 std::unique_ptr<CacheStorageCacheHandle> Clone();
26
27 private:
28 friend class CacheStorage;
29
30 CacheStorageCacheHandle(base::WeakPtr<CacheStorageCache> cache_storage_cache,
31 base::WeakPtr<CacheStorage> cache_storage);
32
33 base::WeakPtr<CacheStorageCache> cache_storage_cache_;
34 base::WeakPtr<CacheStorage> cache_storage_;
35
36 DISALLOW_COPY_AND_ASSIGN(CacheStorageCacheHandle);
37 };
38
39 } // namespace content
40
41 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_HANDLE_H_
OLDNEW
« no previous file with comments | « content/browser/cache_storage/cache_storage_cache.cc ('k') | content/browser/cache_storage/cache_storage_cache_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698