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

Side by Side Diff: content/browser/blob_storage/chrome_blob_storage_context.h

Issue 2973233002: [Background Fetch] Cleanup/fix thread safety (Closed)
Patch Set: Created 3 years, 5 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CONTENT_BROWSER_FILEAPI_CHROME_BLOB_STORAGE_CONTEXT_H_ 5 #ifndef CONTENT_BROWSER_FILEAPI_CHROME_BLOB_STORAGE_CONTEXT_H_
6 #define CONTENT_BROWSER_FILEAPI_CHROME_BLOB_STORAGE_CONTEXT_H_ 6 #define CONTENT_BROWSER_FILEAPI_CHROME_BLOB_STORAGE_CONTEXT_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 // same instance. 43 // same instance.
44 // 44 //
45 // All methods, except the ctor, are expected to be called on 45 // All methods, except the ctor, are expected to be called on
46 // the IO thread (unless specifically called out in doc comments). 46 // the IO thread (unless specifically called out in doc comments).
47 class CONTENT_EXPORT ChromeBlobStorageContext 47 class CONTENT_EXPORT ChromeBlobStorageContext
48 : public base::RefCountedThreadSafe<ChromeBlobStorageContext, 48 : public base::RefCountedThreadSafe<ChromeBlobStorageContext,
49 ChromeBlobStorageContextDeleter> { 49 ChromeBlobStorageContextDeleter> {
50 public: 50 public:
51 ChromeBlobStorageContext(); 51 ChromeBlobStorageContext();
52 52
53 // Unlike the others, this method must be called on the UI thread.
Peter Beverloo 2017/07/10 13:13:21 // Must be called on the UI thread. (The first bi
johnme 2017/07/10 13:41:07 Done.
53 static ChromeBlobStorageContext* GetFor( 54 static ChromeBlobStorageContext* GetFor(
54 BrowserContext* browser_context); 55 BrowserContext* browser_context);
55 56
56 void InitializeOnIOThread(base::FilePath blob_storage_dir, 57 void InitializeOnIOThread(base::FilePath blob_storage_dir,
57 scoped_refptr<base::TaskRunner> file_task_runner); 58 scoped_refptr<base::TaskRunner> file_task_runner);
58 59
59 storage::BlobStorageContext* context() const { return context_.get(); } 60 storage::BlobStorageContext* context() const { return context_.get(); }
60 61
61 // Returns a NULL scoped_ptr on failure. 62 // Returns a NULL scoped_ptr on failure.
62 std::unique_ptr<BlobHandle> CreateMemoryBackedBlob(const char* data, 63 std::unique_ptr<BlobHandle> CreateMemoryBackedBlob(const char* data,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // Attempts to create a vector of BlobDataHandles that ensure any blob data 104 // Attempts to create a vector of BlobDataHandles that ensure any blob data
104 // associated with |body| isn't cleaned up until the handles are destroyed. 105 // associated with |body| isn't cleaned up until the handles are destroyed.
105 // Returns false on failure. This is used for POST and PUT requests. 106 // Returns false on failure. This is used for POST and PUT requests.
106 bool GetBodyBlobDataHandles(ResourceRequestBody* body, 107 bool GetBodyBlobDataHandles(ResourceRequestBody* body,
107 ResourceContext* resource_context, 108 ResourceContext* resource_context,
108 BlobHandles* blob_handles); 109 BlobHandles* blob_handles);
109 110
110 } // namespace content 111 } // namespace content
111 112
112 #endif // CONTENT_BROWSER_FILEAPI_CHROME_BLOB_STORAGE_CONTEXT_H_ 113 #endif // CONTENT_BROWSER_FILEAPI_CHROME_BLOB_STORAGE_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698