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

Side by Side Diff: chrome/browser/media_galleries/fileapi/device_media_async_file_util.cc

Issue 100573002: Move directory creation functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
OLDNEW
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 #include "chrome/browser/media_galleries/fileapi/device_media_async_file_util.h" 5 #include "chrome/browser/media_galleries/fileapi/device_media_async_file_util.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/task_runner_util.h" 10 #include "base/task_runner_util.h"
(...skipping 27 matching lines...) Expand all
38 // file is created successfully, |snapshot_file_path| will be a non-empty file 38 // file is created successfully, |snapshot_file_path| will be a non-empty file
39 // path. In case of failure, the |snapshot_file_path| will be an empty file 39 // path. In case of failure, the |snapshot_file_path| will be an empty file
40 // path. 40 // path.
41 void CreateSnapshotFileOnBlockingPool( 41 void CreateSnapshotFileOnBlockingPool(
42 const base::FilePath& device_file_path, 42 const base::FilePath& device_file_path,
43 const base::FilePath& profile_path, 43 const base::FilePath& profile_path,
44 base::FilePath* snapshot_file_path) { 44 base::FilePath* snapshot_file_path) {
45 DCHECK(snapshot_file_path); 45 DCHECK(snapshot_file_path);
46 base::FilePath isolated_media_file_system_dir_path = 46 base::FilePath isolated_media_file_system_dir_path =
47 profile_path.AppendASCII(kDeviceMediaAsyncFileUtilTempDir); 47 profile_path.AppendASCII(kDeviceMediaAsyncFileUtilTempDir);
48 if (!file_util::CreateDirectory(isolated_media_file_system_dir_path) || 48 if (!base::CreateDirectory(isolated_media_file_system_dir_path) ||
49 !base::CreateTemporaryFileInDir(isolated_media_file_system_dir_path, 49 !base::CreateTemporaryFileInDir(isolated_media_file_system_dir_path,
50 snapshot_file_path)) { 50 snapshot_file_path)) {
51 LOG(WARNING) << "Could not create media snapshot file " 51 LOG(WARNING) << "Could not create media snapshot file "
52 << isolated_media_file_system_dir_path.value(); 52 << isolated_media_file_system_dir_path.value();
53 *snapshot_file_path = base::FilePath(); 53 *snapshot_file_path = base::FilePath();
54 } 54 }
55 } 55 }
56 56
57 } // namespace 57 } // namespace
58 58
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 url.path(), // device file path 333 url.path(), // device file path
334 *snapshot_file_path, 334 *snapshot_file_path,
335 base::Bind(&DeviceMediaAsyncFileUtil::OnDidCreateSnapshotFile, 335 base::Bind(&DeviceMediaAsyncFileUtil::OnDidCreateSnapshotFile,
336 weak_ptr_factory_.GetWeakPtr(), 336 weak_ptr_factory_.GetWeakPtr(),
337 callback, 337 callback,
338 make_scoped_refptr(context->task_runner())), 338 make_scoped_refptr(context->task_runner())),
339 base::Bind(&DeviceMediaAsyncFileUtil::OnCreateSnapshotFileError, 339 base::Bind(&DeviceMediaAsyncFileUtil::OnCreateSnapshotFileError,
340 weak_ptr_factory_.GetWeakPtr(), 340 weak_ptr_factory_.GetWeakPtr(),
341 callback)); 341 callback));
342 } 342 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698