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

Side by Side Diff: content/child/blob_storage/blob_transport_controller.h

Issue 1988293002: [BlobAsync] Fixed race between IPC messages and IO task queue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | content/child/blob_storage/blob_transport_controller.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_CHILD_BLOB_STORAGE_BLOB_TRANSPORT_CONTROLLER_H_ 5 #ifndef CONTENT_CHILD_BLOB_STORAGE_BLOB_TRANSPORT_CONTROLLER_H_
6 #define CONTENT_CHILD_BLOB_STORAGE_BLOB_TRANSPORT_CONTROLLER_H_ 6 #define CONTENT_CHILD_BLOB_STORAGE_BLOB_TRANSPORT_CONTROLLER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // ChildProcess::ReleaseProcess to release our previous reference. 103 // ChildProcess::ReleaseProcess to release our previous reference.
104 void ClearForTesting(); 104 void ClearForTesting();
105 105
106 enum class ResponsesStatus { 106 enum class ResponsesStatus {
107 BLOB_NOT_FOUND, 107 BLOB_NOT_FOUND,
108 SHARED_MEMORY_MAP_FAILED, 108 SHARED_MEMORY_MAP_FAILED,
109 SUCCESS 109 SUCCESS
110 }; 110 };
111 friend struct base::DefaultLazyInstanceTraits<BlobTransportController>; 111 friend struct base::DefaultLazyInstanceTraits<BlobTransportController>;
112 112
113 void StoreBlobDataForRequests( 113 void StoreBlobDataAndStart(
114 const std::string& uuid, 114 const std::string& uuid,
115 std::unique_ptr<BlobConsolidation> consolidation, 115 std::unique_ptr<BlobConsolidation> consolidation,
116 scoped_refptr<ThreadSafeSender> sender,
116 scoped_refptr<base::SingleThreadTaskRunner> main_runner); 117 scoped_refptr<base::SingleThreadTaskRunner> main_runner);
117 118
118 ResponsesStatus GetResponses( 119 ResponsesStatus GetResponses(
119 const std::string& uuid, 120 const std::string& uuid,
120 const std::vector<storage::BlobItemBytesRequest>& requests, 121 const std::vector<storage::BlobItemBytesRequest>& requests,
121 std::vector<base::SharedMemoryHandle>* memory_handles, 122 std::vector<base::SharedMemoryHandle>* memory_handles,
122 const std::vector<IPC::PlatformFileForTransit>& file_handles, 123 const std::vector<IPC::PlatformFileForTransit>& file_handles,
123 std::vector<storage::BlobItemBytesResponse>* output); 124 std::vector<storage::BlobItemBytesResponse>* output);
124 125
125 // Deletes the consolidation, and if we removed the last consolidation from 126 // Deletes the consolidation, and if we removed the last consolidation from
126 // our map, we call ChildProcess::ReleaseProcess to release our previous 127 // our map, we call ChildProcess::ReleaseProcess to release our previous
127 // reference. 128 // reference.
128 void ReleaseBlobConsolidation(const std::string& uuid); 129 void ReleaseBlobConsolidation(const std::string& uuid);
129 130
130 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner_; 131 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner_;
131 std::map<std::string, std::unique_ptr<BlobConsolidation>> blob_storage_; 132 std::map<std::string, std::unique_ptr<BlobConsolidation>> blob_storage_;
132 133
133 DISALLOW_COPY_AND_ASSIGN(BlobTransportController); 134 DISALLOW_COPY_AND_ASSIGN(BlobTransportController);
134 }; 135 };
135 136
136 } // namespace content 137 } // namespace content
137 #endif // CONTENT_CHILD_BLOB_STORAGE_BLOB_TRANSPORT_CONTROLLER_H_ 138 #endif // CONTENT_CHILD_BLOB_STORAGE_BLOB_TRANSPORT_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | content/child/blob_storage/blob_transport_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698