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

Side by Side Diff: content/browser/file_descriptor_info_impl.h

Issue 909553003: Android: Get rid of extra dup()s on launching child processes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 (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 ~FileDescriptorInfoImpl() override; 19 ~FileDescriptorInfoImpl() override;
20 void Share(int id, base::PlatformFile fd) override; 20 void Share(int id, base::PlatformFile fd) override;
21 void Transfer(int id, base::ScopedFD fd) override; 21 void Transfer(int id, base::ScopedFD fd) override;
22 const base::FileHandleMappingVector& GetMapping() const override; 22 const base::FileHandleMappingVector& GetMapping() const override;
23 base::FileHandleMappingVector GetMappingWithIDAdjustment( 23 base::FileHandleMappingVector GetMappingWithIDAdjustment(
24 int delta) const override; 24 int delta) const override;
25 base::PlatformFile GetFDAt(size_t i) const override; 25 base::PlatformFile GetFDAt(size_t i) const override;
26 int GetIDAt(size_t i) const override; 26 int GetIDAt(size_t i) const override;
27 size_t GetMappingSize() const override; 27 size_t GetMappingSize() const override;
28 bool OwnsFD(base::PlatformFile file) const override;
29 base::ScopedFD ReleaseFD(base::PlatformFile file) override;
28 30
29 private: 31 private:
30 FileDescriptorInfoImpl(); 32 FileDescriptorInfoImpl();
31 33
32 void AddToMapping(int id, base::PlatformFile fd); 34 void AddToMapping(int id, base::PlatformFile fd);
33 bool HasID(int id) const; 35 bool HasID(int id) const;
34 base::FileHandleMappingVector mapping_; 36 base::FileHandleMappingVector mapping_;
35 ScopedVector<base::ScopedFD> owned_descriptors_; 37 ScopedVector<base::ScopedFD> owned_descriptors_;
36 }; 38 };
37 } 39 }
38 40
39 #endif // CONTENT_PUBLIC_BROWSER_FILE_DESCRIPTOR_INFO_IMPL_H_ 41 #endif // CONTENT_PUBLIC_BROWSER_FILE_DESCRIPTOR_INFO_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698