OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_SCOPED_HANDLE_H_ | 5 #ifndef BASE_SCOPED_HANDLE_H_ |
6 #define BASE_SCOPED_HANDLE_H_ | 6 #define BASE_SCOPED_HANDLE_H_ |
7 | 7 |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 | 11 |
12 #if defined(OS_WIN) | 12 #if defined(OS_WIN) |
13 #include "base/scoped_handle_win.h" | 13 #include "base/scoped_handle_win.h" |
| 14 #elif defined(OS_LINUX) |
| 15 #include "base/scoped_handle_gtk.h" |
14 #endif | 16 #endif |
15 | 17 |
16 class ScopedStdioHandle { | 18 class ScopedStdioHandle { |
17 public: | 19 public: |
18 ScopedStdioHandle() | 20 ScopedStdioHandle() |
19 : handle_(NULL) { } | 21 : handle_(NULL) { } |
20 | 22 |
21 explicit ScopedStdioHandle(FILE* handle) | 23 explicit ScopedStdioHandle(FILE* handle) |
22 : handle_(handle) { } | 24 : handle_(handle) { } |
23 | 25 |
(...skipping 21 matching lines...) Expand all Loading... |
45 handle_ = newhandle; | 47 handle_ = newhandle; |
46 } | 48 } |
47 | 49 |
48 private: | 50 private: |
49 FILE* handle_; | 51 FILE* handle_; |
50 | 52 |
51 DISALLOW_EVIL_CONSTRUCTORS(ScopedStdioHandle); | 53 DISALLOW_EVIL_CONSTRUCTORS(ScopedStdioHandle); |
52 }; | 54 }; |
53 | 55 |
54 #endif // BASE_SCOPED_HANDLE_H_ | 56 #endif // BASE_SCOPED_HANDLE_H_ |
OLD | NEW |