1 // Copyright 2014 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.
5 #ifndef SANDBOX_LINUX_TESTS_SCOPED_TEMPORARY_FILE_H_
6 #define SANDBOX_LINUX_TESTS_SCOPED_TEMPORARY_FILE_H_
8 #include "base/macros.h"
11 // Creates and open a temporary file on creation and closes
12 // and removes it on destruction.
13 // Unlike base/ helpers, this does not require JNI on Android.
14 class ScopedTemporaryFile
{
16 ScopedTemporaryFile();
17 ~ScopedTemporaryFile();
19 int fd() const { return fd_
; }
20 const char* full_file_name() const { return full_file_name_
; }
24 char full_file_name_
[128];
25 DISALLOW_COPY_AND_ASSIGN(ScopedTemporaryFile
);
28 } // namespace sandbox
30 #endif // SANDBOX_LINUX_TESTS_SCOPED_TEMPORARY_FILE_H_