| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 WEBKIT_COMMON_BLOB_SCOPED_FILE_H_ | 5 #ifndef WEBKIT_COMMON_BLOB_SCOPED_FILE_H_ |
| 6 #define WEBKIT_COMMON_BLOB_SCOPED_FILE_H_ | 6 #define WEBKIT_COMMON_BLOB_SCOPED_FILE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 DELETE_ON_SCOPE_OUT, | 42 DELETE_ON_SCOPE_OUT, |
| 43 DONT_DELETE_ON_SCOPE_OUT, | 43 DONT_DELETE_ON_SCOPE_OUT, |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 ScopedFile(); | 46 ScopedFile(); |
| 47 | 47 |
| 48 // |file_task_runner| is used to schedule a file deletion if |policy| | 48 // |file_task_runner| is used to schedule a file deletion if |policy| |
| 49 // is DELETE_ON_SCOPE_OUT. | 49 // is DELETE_ON_SCOPE_OUT. |
| 50 ScopedFile(const base::FilePath& path, | 50 ScopedFile(const base::FilePath& path, |
| 51 ScopeOutPolicy policy, | 51 ScopeOutPolicy policy, |
| 52 base::TaskRunner* file_task_runner); | 52 const scoped_refptr<base::TaskRunner>& file_task_runner); |
| 53 | 53 |
| 54 // Move constructor and operator. The data of r-value will be transfered | 54 // Move constructor and operator. The data of r-value will be transfered |
| 55 // in a destructive way. (See base/move.h) | 55 // in a destructive way. (See base/move.h) |
| 56 ScopedFile(RValue other); | 56 ScopedFile(RValue other); |
| 57 ScopedFile& operator=(RValue rhs) { | 57 ScopedFile& operator=(RValue rhs) { |
| 58 MoveFrom(*rhs.object); | 58 MoveFrom(*rhs.object); |
| 59 return *this; | 59 return *this; |
| 60 } | 60 } |
| 61 | 61 |
| 62 ~ScopedFile(); | 62 ~ScopedFile(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 85 | 85 |
| 86 base::FilePath path_; | 86 base::FilePath path_; |
| 87 ScopeOutPolicy scope_out_policy_; | 87 ScopeOutPolicy scope_out_policy_; |
| 88 scoped_refptr<base::TaskRunner> file_task_runner_; | 88 scoped_refptr<base::TaskRunner> file_task_runner_; |
| 89 ScopeOutCallbackList scope_out_callbacks_; | 89 ScopeOutCallbackList scope_out_callbacks_; |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 } // namespace storage | 92 } // namespace storage |
| 93 | 93 |
| 94 #endif // WEBKIT_COMMON_BLOB_SCOPED_FILE_H_ | 94 #endif // WEBKIT_COMMON_BLOB_SCOPED_FILE_H_ |
| OLD | NEW |