Make touch-action apply to double-tap zoom
[chromium-blink-merge.git] / base / files / file.cc
blob478f9028443437c4a14480f11fe864132f02252b
1 // Copyright (c) 2011 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 #include "base/files/file.h"
7 // TODO(rvargas): remove this (needed for kInvalidPlatformFileValue).
8 #include "base/platform_file.h"
10 namespace base {
12 File::Info::Info()
13 : size(0),
14 is_directory(false),
15 is_symbolic_link(false) {
18 File::Info::~Info() {
21 File::File()
22 : file_(kInvalidPlatformFileValue),
23 error_details_(FILE_OK),
24 created_(false),
25 async_(false) {
28 #if !defined(OS_NACL)
29 File::File(const FilePath& name, uint32 flags)
30 : file_(kInvalidPlatformFileValue),
31 error_details_(FILE_OK),
32 created_(false),
33 async_(false) {
34 Initialize(name, flags);
36 #endif
38 File::File(PlatformFile platform_file)
39 : file_(platform_file),
40 error_details_(FILE_OK),
41 created_(false),
42 async_(false) {
45 File::File(RValue other)
46 : file_(other.object->TakePlatformFile()),
47 error_details_(other.object->error_details()),
48 created_(other.object->created()),
49 async_(other.object->async_) {
52 File::~File() {
53 Close();
56 File& File::operator=(RValue other) {
57 if (this != other.object) {
58 Close();
59 SetPlatformFile(other.object->TakePlatformFile());
60 error_details_ = other.object->error_details();
61 created_ = other.object->created();
62 async_ = other.object->async_;
64 return *this;
67 #if !defined(OS_NACL)
68 void File::Initialize(const FilePath& name, uint32 flags) {
69 if (name.ReferencesParent()) {
70 error_details_ = FILE_ERROR_ACCESS_DENIED;
71 return;
73 InitializeUnsafe(name, flags);
75 #endif
77 } // namespace base