OLD | NEW |
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 #include "components/nacl/renderer/plugin/temporary_file.h" | 5 #include "components/nacl/renderer/plugin/temporary_file.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "components/nacl/renderer/plugin/plugin.h" | 9 #include "components/nacl/renderer/plugin/plugin.h" |
10 #include "components/nacl/renderer/plugin/utility.h" | 10 #include "components/nacl/renderer/plugin/utility.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 bool TempFile::Reset() { | 56 bool TempFile::Reset() { |
57 // Use the read_wrapper_ to reset the file pos. The write_wrapper_ is also | 57 // Use the read_wrapper_ to reset the file pos. The write_wrapper_ is also |
58 // backed by the same file, so it should also reset. | 58 // backed by the same file, so it should also reset. |
59 CHECK(read_wrapper_); | 59 CHECK(read_wrapper_); |
60 nacl_off64_t newpos = read_wrapper_->Seek(0, SEEK_SET); | 60 nacl_off64_t newpos = read_wrapper_->Seek(0, SEEK_SET); |
61 return newpos == 0; | 61 return newpos == 0; |
62 } | 62 } |
63 | 63 |
64 PP_FileHandle TempFile::TakeFileHandle() { | 64 PP_FileHandle TempFile::TakeFileHandle() { |
| 65 DCHECK(file_handle_.IsValid()); |
65 return file_handle_.TakePlatformFile(); | 66 return file_handle_.TakePlatformFile(); |
66 } | 67 } |
67 | 68 |
| 69 PP_FileHandle TempFile::GetFileHandle() { |
| 70 DCHECK(file_handle_.IsValid()); |
| 71 return file_handle_.GetPlatformFile(); |
| 72 } |
| 73 |
68 } // namespace plugin | 74 } // namespace plugin |
OLD | NEW |