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

Side by Side Diff: chrome/browser/chromeos/drive/fileapi/fileapi_worker.cc

Issue 2858073002: Use constexpr TaskTraits constructor in chrome. (Closed)
Patch Set: Created 3 years, 7 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/chromeos/drive/fileapi/fileapi_worker.h" 5 #include "chrome/browser/chromeos/drive/fileapi/fileapi_worker.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 file_flags &= ~(base::File::FLAG_CREATE | 178 file_flags &= ~(base::File::FLAG_CREATE |
179 base::File::FLAG_OPEN_ALWAYS); 179 base::File::FLAG_OPEN_ALWAYS);
180 file_flags |= base::File::FLAG_OPEN; 180 file_flags |= base::File::FLAG_OPEN;
181 } else if (file_flags & base::File::FLAG_CREATE_ALWAYS) { 181 } else if (file_flags & base::File::FLAG_CREATE_ALWAYS) {
182 file_flags &= ~base::File::FLAG_CREATE_ALWAYS; 182 file_flags &= ~base::File::FLAG_CREATE_ALWAYS;
183 file_flags |= base::File::FLAG_OPEN_TRUNCATED; 183 file_flags |= base::File::FLAG_OPEN_TRUNCATED;
184 } 184 }
185 185
186 // Cache file prepared for modification is available. Open it locally. 186 // Cache file prepared for modification is available. Open it locally.
187 base::PostTaskWithTraitsAndReplyWithResult( 187 base::PostTaskWithTraitsAndReplyWithResult(
188 FROM_HERE, base::TaskTraits().MayBlock(), 188 FROM_HERE, {base::MayBlock()},
189 base::Bind(&OpenFile, local_path, file_flags), 189 base::Bind(&OpenFile, local_path, file_flags),
190 base::Bind(&RunOpenFileCallback, callback, close_callback)); 190 base::Bind(&RunOpenFileCallback, callback, close_callback));
191 } 191 }
192 192
193 } // namespace 193 } // namespace
194 194
195 FileSystemInterface* GetFileSystemFromUrl(const storage::FileSystemURL& url) { 195 FileSystemInterface* GetFileSystemFromUrl(const storage::FileSystemURL& url) {
196 DCHECK_CURRENTLY_ON(BrowserThread::UI); 196 DCHECK_CURRENTLY_ON(BrowserThread::UI);
197 197
198 Profile* profile = util::ExtractProfileFromPath(url.path()); 198 Profile* profile = util::ExtractProfileFromPath(url.path());
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 const StatusCallback& callback, 359 const StatusCallback& callback,
360 FileSystemInterface* file_system) { 360 FileSystemInterface* file_system) {
361 DCHECK_CURRENTLY_ON(BrowserThread::UI); 361 DCHECK_CURRENTLY_ON(BrowserThread::UI);
362 file_system->TouchFile(file_path, last_access_time, last_modified_time, 362 file_system->TouchFile(file_path, last_access_time, last_modified_time,
363 base::Bind(&RunStatusCallbackByFileError, callback)); 363 base::Bind(&RunStatusCallbackByFileError, callback));
364 364
365 } 365 }
366 366
367 } // namespace fileapi_internal 367 } // namespace fileapi_internal
368 } // namespace drive 368 } // namespace drive
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/drive/download_handler.cc ('k') | chrome/browser/chromeos/drive/write_on_cache_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698