Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: third_party/WebKit/Source/core/fileapi/File.h

Issue 2282413002: Replaced PassRefPtr copies with moves in Source/core. (Closed)
Patch Set: rebased Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // Constructor in File.idl 58 // Constructor in File.idl
59 static File* create(ExecutionContext*, const HeapVector<ArrayBufferOrArrayBu fferViewOrBlobOrUSVString>&, const String& fileName, const FilePropertyBag&, Exc eptionState&); 59 static File* create(ExecutionContext*, const HeapVector<ArrayBufferOrArrayBu fferViewOrBlobOrUSVString>&, const String& fileName, const FilePropertyBag&, Exc eptionState&);
60 60
61 static File* create(const String& path, ContentTypeLookupPolicy policy = Wel lKnownContentTypes) 61 static File* create(const String& path, ContentTypeLookupPolicy policy = Wel lKnownContentTypes)
62 { 62 {
63 return new File(path, policy, File::IsUserVisible); 63 return new File(path, policy, File::IsUserVisible);
64 } 64 }
65 65
66 static File* create(const String& name, double modificationTime, PassRefPtr< BlobDataHandle> blobDataHandle) 66 static File* create(const String& name, double modificationTime, PassRefPtr< BlobDataHandle> blobDataHandle)
67 { 67 {
68 return new File(name, modificationTime, blobDataHandle); 68 return new File(name, modificationTime, std::move(blobDataHandle));
69 } 69 }
70 70
71 // For deserialization. 71 // For deserialization.
72 static File* createFromSerialization(const String& path, const String& name, const String& relativePath, UserVisibility userVisibility, bool hasSnapshotData , uint64_t size, double lastModified, PassRefPtr<BlobDataHandle> blobDataHandle) 72 static File* createFromSerialization(const String& path, const String& name, const String& relativePath, UserVisibility userVisibility, bool hasSnapshotData , uint64_t size, double lastModified, PassRefPtr<BlobDataHandle> blobDataHandle)
73 { 73 {
74 return new File(path, name, relativePath, userVisibility, hasSnapshotDat a, size, lastModified, blobDataHandle); 74 return new File(path, name, relativePath, userVisibility, hasSnapshotDat a, size, lastModified, std::move(blobDataHandle));
75 } 75 }
76 static File* createFromIndexedSerialization(const String& path, const String & name, uint64_t size, double lastModified, PassRefPtr<BlobDataHandle> blobDataH andle) 76 static File* createFromIndexedSerialization(const String& path, const String & name, uint64_t size, double lastModified, PassRefPtr<BlobDataHandle> blobDataH andle)
77 { 77 {
78 return new File(path, name, String(), IsNotUserVisible, true, size, last Modified, blobDataHandle); 78 return new File(path, name, String(), IsNotUserVisible, true, size, last Modified, std::move(blobDataHandle));
79 } 79 }
80 80
81 static File* createWithRelativePath(const String& path, const String& relati vePath); 81 static File* createWithRelativePath(const String& path, const String& relati vePath);
82 82
83 // If filesystem files live in the remote filesystem, the port might pass th e valid metadata (whose length field is non-negative) and cache in the File obje ct. 83 // If filesystem files live in the remote filesystem, the port might pass th e valid metadata (whose length field is non-negative) and cache in the File obje ct.
84 // 84 //
85 // Otherwise calling size(), lastModifiedTime() and slice() will synchronous ly query the file metadata. 85 // Otherwise calling size(), lastModifiedTime() and slice() will synchronous ly query the file metadata.
86 static File* createForFileSystemFile(const String& name, const FileMetadata& metadata, UserVisibility userVisibility) 86 static File* createForFileSystemFile(const String& name, const FileMetadata& metadata, UserVisibility userVisibility)
87 { 87 {
88 return new File(name, metadata, userVisibility); 88 return new File(name, metadata, userVisibility);
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 const double m_snapshotModificationTimeMS; 181 const double m_snapshotModificationTimeMS;
182 182
183 String m_relativePath; 183 String m_relativePath;
184 }; 184 };
185 185
186 DEFINE_TYPE_CASTS(File, Blob, blob, blob->isFile(), blob.isFile()); 186 DEFINE_TYPE_CASTS(File, Blob, blob, blob->isFile(), blob.isFile());
187 187
188 } // namespace blink 188 } // namespace blink
189 189
190 #endif // File_h 190 #endif // File_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fileapi/Blob.h ('k') | third_party/WebKit/Source/core/fileapi/File.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698