| 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 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |