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