| OLD | NEW |
| 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 STORAGE_BROWSER_BLOB_BLOB_ASYNC_BUILDER_HOST_H_ | 5 #ifndef STORAGE_BROWSER_BLOB_BLOB_ASYNC_BUILDER_HOST_H_ |
| 6 #define STORAGE_BROWSER_BLOB_BLOB_ASYNC_BUILDER_HOST_H_ | 6 #define STORAGE_BROWSER_BLOB_BLOB_ASYNC_BUILDER_HOST_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 size_t current_shared_memory_handle_index = 0; | 155 size_t current_shared_memory_handle_index = 0; |
| 156 | 156 |
| 157 // We save these to double check that the RegisterBlob and StartBuildingBlob | 157 // We save these to double check that the RegisterBlob and StartBuildingBlob |
| 158 // messages are in sync. | 158 // messages are in sync. |
| 159 std::set<std::string> referenced_blob_uuids; | 159 std::set<std::string> referenced_blob_uuids; |
| 160 // These are the blobs that are referenced in the newly constructed blob. | 160 // These are the blobs that are referenced in the newly constructed blob. |
| 161 // We use these to make sure they stay alive while we create the new blob, | 161 // We use these to make sure they stay alive while we create the new blob, |
| 162 // and to wait until any blobs that are not done building are fully | 162 // and to wait until any blobs that are not done building are fully |
| 163 // constructed. | 163 // constructed. |
| 164 std::vector<std::unique_ptr<BlobDataHandle>> referenced_blob_handles; | 164 std::vector<std::unique_ptr<BlobDataHandle>> referenced_blob_handles; |
| 165 | |
| 166 // These are the number of blobs we're waiting for before we can start | 165 // These are the number of blobs we're waiting for before we can start |
| 167 // building. | 166 // building. |
| 168 size_t num_referenced_blobs_building = 0; | 167 size_t num_referenced_blobs_building = 0; |
| 169 | 168 |
| 169 void LogState() { |
| 170 LOG(ERROR) << "Requests: " << request_builder.requests().size(); |
| 171 for (const auto& request : request_builder.requests()) { |
| 172 LOG(ERROR) << " " << static_cast<int>(request.message.transport_strategy
); |
| 173 } |
| 174 |
| 175 LOG(ERROR) << "request_received: " << request_received.size(); |
| 176 for (bool received : request_received) { |
| 177 LOG(ERROR) << " " << received; |
| 178 } |
| 179 LOG(ERROR) << "next_request: " << next_request; |
| 180 LOG(ERROR) << "num_fulfilled: " << num_fulfilled_requests; |
| 181 } |
| 182 |
| 170 BlobAsyncBuilderHost::RequestMemoryCallback request_memory_callback; | 183 BlobAsyncBuilderHost::RequestMemoryCallback request_memory_callback; |
| 171 }; | 184 }; |
| 172 | 185 |
| 173 typedef std::map<std::string, std::unique_ptr<BlobBuildingState>> | 186 typedef std::map<std::string, std::unique_ptr<BlobBuildingState>> |
| 174 AsyncBlobMap; | 187 AsyncBlobMap; |
| 175 | 188 |
| 176 // This is the 'main loop' of our memory requests to the renderer. | 189 // This is the 'main loop' of our memory requests to the renderer. |
| 177 BlobTransportResult ContinueBlobMemoryRequests(const std::string& uuid, | 190 BlobTransportResult ContinueBlobMemoryRequests(const std::string& uuid, |
| 178 BlobStorageContext* context); | 191 BlobStorageContext* context); |
| 179 | 192 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 197 size_t max_shared_memory_size_ = kBlobStorageMaxSharedMemoryBytes; | 210 size_t max_shared_memory_size_ = kBlobStorageMaxSharedMemoryBytes; |
| 198 uint64_t max_file_size_ = kBlobStorageMaxFileSizeBytes; | 211 uint64_t max_file_size_ = kBlobStorageMaxFileSizeBytes; |
| 199 | 212 |
| 200 base::WeakPtrFactory<BlobAsyncBuilderHost> ptr_factory_; | 213 base::WeakPtrFactory<BlobAsyncBuilderHost> ptr_factory_; |
| 201 | 214 |
| 202 DISALLOW_COPY_AND_ASSIGN(BlobAsyncBuilderHost); | 215 DISALLOW_COPY_AND_ASSIGN(BlobAsyncBuilderHost); |
| 203 }; | 216 }; |
| 204 | 217 |
| 205 } // namespace storage | 218 } // namespace storage |
| 206 #endif // STORAGE_BROWSER_BLOB_BLOB_ASYNC_BUILDER_HOST_H_ | 219 #endif // STORAGE_BROWSER_BLOB_BLOB_ASYNC_BUILDER_HOST_H_ |
| OLD | NEW |