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

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

Issue 2422793002: HTML MessagePort as mojo::MessagePipeHandle (Closed)
Patch Set: Add missing ScopedAsyncTaskScheduler instance for the new unit tests; required by a recent change t… Created 3 years, 10 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 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
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
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
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/child/blob_storage/blob_transport_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698