OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_PUBLIC_BROWSER_FILE_DESCRIPTOR_INFO_IMPL_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_FILE_DESCRIPTOR_INFO_IMPL_H_ |
| 7 |
| 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/scoped_vector.h" |
| 10 #include "content/common/content_export.h" |
| 11 #include "content/public/browser/file_descriptor_info.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 class FileDescriptorInfoImpl : public FileDescriptorInfo { |
| 16 public: |
| 17 CONTENT_EXPORT static scoped_ptr<FileDescriptorInfo> Create(); |
| 18 |
| 19 virtual ~FileDescriptorInfoImpl(); |
| 20 virtual void Share(int id, base::PlatformFile fd) OVERRIDE; |
| 21 virtual void Transfer(int id, base::ScopedFD fd) OVERRIDE; |
| 22 virtual void TransferWithoutMapping(base::ScopedFD fd) OVERRIDE; |
| 23 virtual const base::FileHandleMappingVector& GetMapping() const OVERRIDE; |
| 24 virtual base::FileHandleMappingVector GetMappingWithIDAdjustment( |
| 25 int delta) const OVERRIDE; |
| 26 virtual base::PlatformFile GetFDAt(size_t i) const OVERRIDE; |
| 27 virtual int GetIDAt(size_t i) const OVERRIDE; |
| 28 virtual size_t GetMappingSize() const OVERRIDE; |
| 29 |
| 30 private: |
| 31 FileDescriptorInfoImpl(); |
| 32 |
| 33 void AddToMapping(int id, base::PlatformFile fd); |
| 34 |
| 35 base::FileHandleMappingVector mapping_; |
| 36 ScopedVector<base::ScopedFD> owned_descriptors_; |
| 37 }; |
| 38 } |
| 39 |
| 40 #endif // CONTENT_PUBLIC_BROWSER_FILE_DESCRIPTOR_INFO_IMPL_H_ |
OLD | NEW |