Chromium Code Reviews| Index: storage/browser/blob/shareable_file_reference.h |
| diff --git a/storage/browser/blob/shareable_file_reference.h b/storage/browser/blob/shareable_file_reference.h |
| index e2739dcf8604654772991a11d14239c1c20cba23..ca899ca5e52ba72a1a48250a167229dc04367c4b 100644 |
| --- a/storage/browser/blob/shareable_file_reference.h |
| +++ b/storage/browser/blob/shareable_file_reference.h |
| @@ -5,8 +5,7 @@ |
| #ifndef STORAGE_BROWSER_BLOB_SHAREABLE_FILE_REFERENCE_H_ |
| #define STORAGE_BROWSER_BLOB_SHAREABLE_FILE_REFERENCE_H_ |
| -#include <vector> |
| - |
| +#include "storage/browser/blob/blob_data_item.h" |
| #include "storage/browser/blob/scoped_file.h" |
| #include "storage/browser/storage_browser_export.h" |
| @@ -16,8 +15,10 @@ namespace storage { |
| // same path if it already exists in its internal map. |
| // This class is non-thread-safe and all methods must be called on a single |
| // thread. |
| -class STORAGE_EXPORT ShareableFileReference |
| - : public base::RefCounted<ShareableFileReference> { |
| +// This class inherits directly from BlobDataItem::DataHandle as an optimization |
| +// to remove double-dereferences from refcounting the DataHandle objects. This |
| +// only works because there are no other fields in the DataHandle. |
|
michaeln
2015/06/12 23:43:06
I don't think the editorial comments about dbl-der
dmurph
2015/06/13 00:09:43
I asked him to add this in case it wasn't clear fo
gavinp
2015/06/15 14:01:19
Removed, just because I'm slightly with michaeln h
|
| +class STORAGE_EXPORT ShareableFileReference : public BlobDataItem::DataHandle { |
| public: |
| typedef ScopedFile::ScopeOutCallback FinalReleaseCallback; |
| @@ -60,10 +61,8 @@ class STORAGE_EXPORT ShareableFileReference |
| void AddFinalReleaseCallback(const FinalReleaseCallback& callback); |
| private: |
| - friend class base::RefCounted<ShareableFileReference>; |
| - |
| ShareableFileReference(ScopedFile scoped_file); |
| - ~ShareableFileReference(); |
| + ~ShareableFileReference() override; |
| ScopedFile scoped_file_; |