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 #include "content/child/blob_storage/blob_transport_controller.h" | 5 #include "content/child/blob_storage/blob_transport_controller.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 BlobTransportController::GetDescriptions( | 174 BlobTransportController::GetDescriptions( |
175 consolidation.get(), quotas.max_ipc_memory_size, &descriptions); | 175 consolidation.get(), quotas.max_ipc_memory_size, &descriptions); |
176 // I post the task first to make sure that we store our consolidation before | 176 // I post the task first to make sure that we store our consolidation before |
177 // we get a request back from the browser. | 177 // we get a request back from the browser. |
178 io_runner->PostTask( | 178 io_runner->PostTask( |
179 FROM_HERE, | 179 FROM_HERE, |
180 base::Bind(&BlobTransportController::StoreBlobDataForRequests, | 180 base::Bind(&BlobTransportController::StoreBlobDataForRequests, |
181 base::Unretained(BlobTransportController::GetInstance()), uuid, | 181 base::Unretained(BlobTransportController::GetInstance()), uuid, |
182 base::Passed(std::move(consolidation)), | 182 base::Passed(std::move(consolidation)), |
183 base::Passed(std::move(main_runner)))); | 183 base::Passed(std::move(main_runner)))); |
| 184 |
| 185 // Measure how much jank the following synchronous IPC introduces. |
| 186 SCOPED_UMA_HISTOGRAM_TIMER("Storage.Blob.RegisterBlobTime"); |
| 187 |
184 sender->Send( | 188 sender->Send( |
185 new BlobStorageMsg_RegisterBlob(uuid, content_type, "", descriptions)); | 189 new BlobStorageMsg_RegisterBlob(uuid, content_type, "", descriptions)); |
186 } | 190 } |
187 | 191 |
188 void BlobTransportController::OnMemoryRequest( | 192 void BlobTransportController::OnMemoryRequest( |
189 const std::string& uuid, | 193 const std::string& uuid, |
190 const std::vector<storage::BlobItemBytesRequest>& requests, | 194 const std::vector<storage::BlobItemBytesRequest>& requests, |
191 std::vector<base::SharedMemoryHandle>* memory_handles, | 195 std::vector<base::SharedMemoryHandle>* memory_handles, |
192 const std::vector<IPC::PlatformFileForTransit>& file_handles, | 196 const std::vector<IPC::PlatformFileForTransit>& file_handles, |
193 base::TaskRunner* file_runner, | 197 base::TaskRunner* file_runner, |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 | 410 |
407 void BlobTransportController::ReleaseBlobConsolidation( | 411 void BlobTransportController::ReleaseBlobConsolidation( |
408 const std::string& uuid) { | 412 const std::string& uuid) { |
409 if (blob_storage_.erase(uuid)) { | 413 if (blob_storage_.erase(uuid)) { |
410 main_thread_runner_->PostTask(FROM_HERE, | 414 main_thread_runner_->PostTask(FROM_HERE, |
411 base::Bind(&DecChildProcessRefCount)); | 415 base::Bind(&DecChildProcessRefCount)); |
412 } | 416 } |
413 } | 417 } |
414 | 418 |
415 } // namespace content | 419 } // namespace content |
OLD | NEW |