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

Side by Side Diff: base/file_descriptor_shuffle.h

Issue 5648004: Add the "virtual" keyword on method overrides that are missing it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Missing file Created 10 years 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 | Annotate | Revision Log
« no previous file with comments | « app/slide_animation.h ('k') | base/message_loop_proxy_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 BASE_FILE_DESCRIPTOR_SHUFFLE_H_ 5 #ifndef BASE_FILE_DESCRIPTOR_SHUFFLE_H_
6 #define BASE_FILE_DESCRIPTOR_SHUFFLE_H_ 6 #define BASE_FILE_DESCRIPTOR_SHUFFLE_H_
7 #pragma once 7 #pragma once
8 8
9 // This code exists to perform the shuffling of file descriptors which is 9 // This code exists to perform the shuffling of file descriptors which is
10 // commonly needed when forking subprocesses. The naive approve is very simple, 10 // commonly needed when forking subprocesses. The naive approve is very simple,
(...skipping 28 matching lines...) Expand all
39 // Delete an element of the domain. 39 // Delete an element of the domain.
40 virtual void Close(int fd) = 0; 40 virtual void Close(int fd) = 0;
41 41
42 protected: 42 protected:
43 virtual ~InjectionDelegate() {} 43 virtual ~InjectionDelegate() {}
44 }; 44 };
45 45
46 // An implementation of the InjectionDelegate interface using the file 46 // An implementation of the InjectionDelegate interface using the file
47 // descriptor table of the current process as the domain. 47 // descriptor table of the current process as the domain.
48 class FileDescriptorTableInjection : public InjectionDelegate { 48 class FileDescriptorTableInjection : public InjectionDelegate {
49 bool Duplicate(int* result, int fd); 49 virtual bool Duplicate(int* result, int fd);
50 bool Move(int src, int dest); 50 virtual bool Move(int src, int dest);
51 void Close(int fd); 51 virtual void Close(int fd);
52 }; 52 };
53 53
54 // A single arc of the directed graph which describes an injective multimapping. 54 // A single arc of the directed graph which describes an injective multimapping.
55 struct InjectionArc { 55 struct InjectionArc {
56 InjectionArc(int in_source, int in_dest, bool in_close) 56 InjectionArc(int in_source, int in_dest, bool in_close)
57 : source(in_source), 57 : source(in_source),
58 dest(in_dest), 58 dest(in_dest),
59 close(in_close) { 59 close(in_close) {
60 } 60 }
61 61
(...skipping 13 matching lines...) Expand all
75 75
76 // This function will not call malloc but will mutate |map| 76 // This function will not call malloc but will mutate |map|
77 static inline bool ShuffleFileDescriptors(InjectiveMultimap* map) { 77 static inline bool ShuffleFileDescriptors(InjectiveMultimap* map) {
78 FileDescriptorTableInjection delegate; 78 FileDescriptorTableInjection delegate;
79 return PerformInjectiveMultimapDestructive(map, &delegate); 79 return PerformInjectiveMultimapDestructive(map, &delegate);
80 } 80 }
81 81
82 } // namespace base 82 } // namespace base
83 83
84 #endif // BASE_FILE_DESCRIPTOR_SHUFFLE_H_ 84 #endif // BASE_FILE_DESCRIPTOR_SHUFFLE_H_
OLDNEW
« no previous file with comments | « app/slide_animation.h ('k') | base/message_loop_proxy_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698