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

Unified Diff: webkit/browser/blob/blob_data_handle.h

Issue 261683005: Revert of Allow BlobDataHandles to be copied, and have their UUIDs read, on any thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: webkit/browser/blob/blob_data_handle.h
diff --git a/webkit/browser/blob/blob_data_handle.h b/webkit/browser/blob/blob_data_handle.h
index 917a0b38e8e9a588bf347bbfc3c1fe19217f2907..5f870f2731a21b9f456c99fc505e9c61a0a03bcd 100644
--- a/webkit/browser/blob/blob_data_handle.h
+++ b/webkit/browser/blob/blob_data_handle.h
@@ -28,42 +28,23 @@
class WEBKIT_STORAGE_BROWSER_EXPORT BlobDataHandle
: public base::SupportsUserData::Data {
public:
- BlobDataHandle(const BlobDataHandle& other); // May be copied on any thread.
virtual ~BlobDataHandle(); // Maybe be deleted on any thread.
BlobData* data() const; // May only be accessed on the IO thread.
- std::string uuid() const; // May be accessed on any thread.
-
private:
- class BlobDataHandleShared
- : public base::RefCountedThreadSafe<BlobDataHandleShared> {
- public:
- BlobDataHandleShared(BlobData* blob_data,
- BlobStorageContext* context,
- base::SequencedTaskRunner* task_runner);
-
- BlobData* data() const;
- const std::string& uuid() const;
-
- private:
- friend class base::DeleteHelper<BlobDataHandleShared>;
- friend class base::RefCountedThreadSafe<BlobDataHandleShared>;
- friend class BlobDataHandle;
-
- virtual ~BlobDataHandleShared();
-
- scoped_refptr<BlobData> blob_data_;
- base::WeakPtr<BlobStorageContext> context_;
-
- DISALLOW_COPY_AND_ASSIGN(BlobDataHandleShared);
- };
-
friend class BlobStorageContext;
BlobDataHandle(BlobData* blob_data, BlobStorageContext* context,
base::SequencedTaskRunner* task_runner);
+ static void DeleteHelper(
+ base::WeakPtr<BlobStorageContext> context,
+ BlobData* blob_data);
+
+ BlobData* blob_data_; // Intentionally a raw ptr to a non-thread-safe ref.
+ base::WeakPtr<BlobStorageContext> context_;
scoped_refptr<base::SequencedTaskRunner> io_task_runner_;
- scoped_refptr<BlobDataHandleShared> shared_;
+
+ DISALLOW_COPY_AND_ASSIGN(BlobDataHandle);
};
} // namespace webkit_blob
« no previous file with comments | « content/browser/loader/upload_data_stream_builder_unittest.cc ('k') | webkit/browser/blob/blob_data_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698