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

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

Issue 1234813004: [BlobAsync] Asynchronous Blob Construction Final Patch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blob-protocol-change
Patch Set: added shared memory test, and fixed memory leak Created 4 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 #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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // * generate responses to blob memory requests, and 49 // * generate responses to blob memory requests, and
50 // * send IPC responses. 50 // * send IPC responses.
51 // Must be used on the IO thread. 51 // Must be used on the IO thread.
52 class CONTENT_EXPORT BlobTransportController { 52 class CONTENT_EXPORT BlobTransportController {
53 public: 53 public:
54 static BlobTransportController* GetInstance(); 54 static BlobTransportController* GetInstance();
55 55
56 // This kicks off a blob transfer to the browser thread, which involves 56 // This kicks off a blob transfer to the browser thread, which involves
57 // sending an IPC message and storing the blob consolidation object. 57 // sending an IPC message and storing the blob consolidation object.
58 void InitiateBlobTransfer(const std::string& uuid, 58 void InitiateBlobTransfer(const std::string& uuid,
59 const std::string& type,
60 scoped_ptr<BlobConsolidation> consolidation, 59 scoped_ptr<BlobConsolidation> consolidation,
61 IPC::Sender* sender); 60 IPC::Sender* sender);
62 61
63 // This responds to the request using the sender. 62 // This responds to the request using the sender.
64 void OnMemoryRequest( 63 void OnMemoryRequest(
65 const std::string& uuid, 64 const std::string& uuid,
66 const std::vector<storage::BlobItemBytesRequest>& requests, 65 const std::vector<storage::BlobItemBytesRequest>& requests,
67 std::vector<base::SharedMemoryHandle>* memory_handles, 66 std::vector<base::SharedMemoryHandle>* memory_handles,
68 const std::vector<IPC::PlatformFileForTransit>& file_handles, 67 const std::vector<IPC::PlatformFileForTransit>& file_handles,
69 IPC::Sender* sender); 68 IPC::Sender* sender);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 115
117 void ReleaseBlobConsolidation(const std::string& uuid); 116 void ReleaseBlobConsolidation(const std::string& uuid);
118 117
119 std::map<std::string, scoped_ptr<BlobConsolidation>> blob_storage_; 118 std::map<std::string, scoped_ptr<BlobConsolidation>> blob_storage_;
120 119
121 DISALLOW_COPY_AND_ASSIGN(BlobTransportController); 120 DISALLOW_COPY_AND_ASSIGN(BlobTransportController);
122 }; 121 };
123 122
124 } // namespace content 123 } // namespace content
125 #endif // CONTENT_CHILD_BLOB_STORAGE_BLOB_TRANSPORT_CONTROLLER_H_ 124 #endif // CONTENT_CHILD_BLOB_STORAGE_BLOB_TRANSPORT_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698