| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PUBLIC_BROWSER_FILE_DESCRIPTOR_INFO_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_FILE_DESCRIPTOR_INFO_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_FILE_DESCRIPTOR_INFO_H_ | 6 #define CONTENT_PUBLIC_BROWSER_FILE_DESCRIPTOR_INFO_H_ |
| 7 | 7 |
| 8 #include "base/files/file.h" | 8 #include "base/files/file.h" |
| 9 #include "base/process/launch.h" | 9 #include "base/process/launch.h" |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 // A GetMapping() variant what adjusts the ID value by |delta|. | 35 // A GetMapping() variant what adjusts the ID value by |delta|. |
| 36 // Some environments need this trick. | 36 // Some environments need this trick. |
| 37 virtual base::FileHandleMappingVector GetMappingWithIDAdjustment( | 37 virtual base::FileHandleMappingVector GetMappingWithIDAdjustment( |
| 38 int delta) const = 0; | 38 int delta) const = 0; |
| 39 | 39 |
| 40 // API for iterating registered ID-FD pairs. | 40 // API for iterating registered ID-FD pairs. |
| 41 virtual base::PlatformFile GetFDAt(size_t i) const = 0; | 41 virtual base::PlatformFile GetFDAt(size_t i) const = 0; |
| 42 virtual int GetIDAt(size_t i) const = 0; | 42 virtual int GetIDAt(size_t i) const = 0; |
| 43 virtual size_t GetMappingSize() const = 0; | 43 virtual size_t GetMappingSize() const = 0; |
| 44 |
| 45 // True if |this| has an ownership of |file|. |
| 46 virtual bool OwnsFD(base::PlatformFile file) const = 0; |
| 47 // Assuming |OwnsFD(file)|, release the ownership. |
| 48 virtual base::ScopedFD ReleaseFD(base::PlatformFile file) = 0; |
| 44 }; | 49 }; |
| 45 | 50 |
| 46 } | 51 } |
| 47 | 52 |
| 48 #endif // CONTENT_PUBLIC_BROWSER_FILE_DESCRIPTOR_INFO_H_ | 53 #endif // CONTENT_PUBLIC_BROWSER_FILE_DESCRIPTOR_INFO_H_ |
| OLD | NEW |