Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / sandbox / linux / tests / scoped_temporary_file.h
blob07341300557572c058d444dba9120ab45b976de6
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"
10 namespace sandbox {
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 {
15 public:
16 ScopedTemporaryFile();
17 ~ScopedTemporaryFile();
19 int fd() const { return fd_; }
20 const char* full_file_name() const { return full_file_name_; }
22 private:
23 int fd_;
24 char full_file_name_[128];
25 DISALLOW_COPY_AND_ASSIGN(ScopedTemporaryFile);
28 } // namespace sandbox
30 #endif // SANDBOX_LINUX_TESTS_SCOPED_TEMPORARY_FILE_H_