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

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

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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 , m_hasBackingFile(true) 139 , m_hasBackingFile(true)
140 , m_userVisibility(userVisibility) 140 , m_userVisibility(userVisibility)
141 , m_path(path) 141 , m_path(path)
142 , m_name(name) 142 , m_name(name)
143 , m_snapshotSize(-1) 143 , m_snapshotSize(-1)
144 , m_snapshotModificationTimeMS(invalidFileTime()) 144 , m_snapshotModificationTimeMS(invalidFileTime())
145 { 145 {
146 } 146 }
147 147
148 File::File(const String& path, const String& name, const String& relativePath, U serVisibility userVisibility, bool hasSnapshotData, uint64_t size, double lastMo dified, PassRefPtr<BlobDataHandle> blobDataHandle) 148 File::File(const String& path, const String& name, const String& relativePath, U serVisibility userVisibility, bool hasSnapshotData, uint64_t size, double lastMo dified, PassRefPtr<BlobDataHandle> blobDataHandle)
149 : Blob(blobDataHandle) 149 : Blob(std::move(blobDataHandle))
150 , m_hasBackingFile(!path.isEmpty() || !relativePath.isEmpty()) 150 , m_hasBackingFile(!path.isEmpty() || !relativePath.isEmpty())
151 , m_userVisibility(userVisibility) 151 , m_userVisibility(userVisibility)
152 , m_path(path) 152 , m_path(path)
153 , m_name(name) 153 , m_name(name)
154 , m_snapshotSize(hasSnapshotData ? static_cast<long long>(size) : -1) 154 , m_snapshotSize(hasSnapshotData ? static_cast<long long>(size) : -1)
155 , m_snapshotModificationTimeMS(hasSnapshotData ? lastModified : invalidFileT ime()) 155 , m_snapshotModificationTimeMS(hasSnapshotData ? lastModified : invalidFileT ime())
156 , m_relativePath(relativePath) 156 , m_relativePath(relativePath)
157 { 157 {
158 } 158 }
159 159
160 File::File(const String& name, double modificationTimeMS, PassRefPtr<BlobDataHan dle> blobDataHandle) 160 File::File(const String& name, double modificationTimeMS, PassRefPtr<BlobDataHan dle> blobDataHandle)
161 : Blob(blobDataHandle) 161 : Blob(std::move(blobDataHandle))
162 , m_hasBackingFile(false) 162 , m_hasBackingFile(false)
163 , m_userVisibility(File::IsNotUserVisible) 163 , m_userVisibility(File::IsNotUserVisible)
164 , m_name(name) 164 , m_name(name)
165 , m_snapshotSize(Blob::size()) 165 , m_snapshotSize(Blob::size())
166 , m_snapshotModificationTimeMS(modificationTimeMS) 166 , m_snapshotModificationTimeMS(modificationTimeMS)
167 { 167 {
168 } 168 }
169 169
170 File::File(const String& name, const FileMetadata& metadata, UserVisibility user Visibility) 170 File::File(const String& name, const FileMetadata& metadata, UserVisibility user Visibility)
171 : Blob(BlobDataHandle::create(createBlobDataForFileWithMetadata(name, metada ta), metadata.length)) 171 : Blob(BlobDataHandle::create(createBlobDataForFileWithMetadata(name, metada ta), metadata.length))
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 if (m_fileSystemURL.isEmpty() != other.m_fileSystemURL.isEmpty()) 358 if (m_fileSystemURL.isEmpty() != other.m_fileSystemURL.isEmpty())
359 return false; 359 return false;
360 360
361 if (!m_fileSystemURL.isEmpty()) 361 if (!m_fileSystemURL.isEmpty())
362 return m_fileSystemURL == other.m_fileSystemURL; 362 return m_fileSystemURL == other.m_fileSystemURL;
363 363
364 return uuid() == other.uuid(); 364 return uuid() == other.uuid();
365 } 365 }
366 366
367 } // namespace blink 367 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fileapi/File.h ('k') | third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698