| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "extensions/browser/api/file_handlers/directory_util.h" | 5 #include "extensions/browser/api/file_handlers/directory_util.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/task_scheduler/post_task.h" | 9 #include "base/task_scheduler/post_task.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #if defined(OS_CHROMEOS) | 36 #if defined(OS_CHROMEOS) |
| 37 NonNativeFileSystemDelegate* delegate = | 37 NonNativeFileSystemDelegate* delegate = |
| 38 ExtensionsAPIClient::Get()->GetNonNativeFileSystemDelegate(); | 38 ExtensionsAPIClient::Get()->GetNonNativeFileSystemDelegate(); |
| 39 if (delegate && delegate->IsUnderNonNativeLocalPath(context, path)) { | 39 if (delegate && delegate->IsUnderNonNativeLocalPath(context, path)) { |
| 40 delegate->IsNonNativeLocalPathDirectory(context, path, callback); | 40 delegate->IsNonNativeLocalPathDirectory(context, path, callback); |
| 41 return; | 41 return; |
| 42 } | 42 } |
| 43 #endif | 43 #endif |
| 44 | 44 |
| 45 base::PostTaskWithTraitsAndReplyWithResult( | 45 base::PostTaskWithTraitsAndReplyWithResult( |
| 46 FROM_HERE, base::TaskTraits().MayBlock(), | 46 FROM_HERE, {base::MayBlock()}, |
| 47 base::Bind(&GetIsDirectoryFromFileInfo, path), callback); | 47 base::Bind(&GetIsDirectoryFromFileInfo, path), callback); |
| 48 } | 48 } |
| 49 | 49 |
| 50 } // namespace | 50 } // namespace |
| 51 | 51 |
| 52 IsDirectoryCollector::IsDirectoryCollector(content::BrowserContext* context) | 52 IsDirectoryCollector::IsDirectoryCollector(content::BrowserContext* context) |
| 53 : context_(context), left_(0), weak_ptr_factory_(this) {} | 53 : context_(context), left_(0), weak_ptr_factory_(this) {} |
| 54 | 54 |
| 55 IsDirectoryCollector::~IsDirectoryCollector() {} | 55 IsDirectoryCollector::~IsDirectoryCollector() {} |
| 56 | 56 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 FROM_HERE, base::Bind(callback_, base::Passed(&result_))); | 89 FROM_HERE, base::Bind(callback_, base::Passed(&result_))); |
| 90 // Release the callback to avoid a circullar reference in case an instance | 90 // Release the callback to avoid a circullar reference in case an instance |
| 91 // of this class is a member of a ref counted class, which instance is bound | 91 // of this class is a member of a ref counted class, which instance is bound |
| 92 // to this callback. | 92 // to this callback. |
| 93 callback_ = CompletionCallback(); | 93 callback_ = CompletionCallback(); |
| 94 } | 94 } |
| 95 } | 95 } |
| 96 | 96 |
| 97 } // namespace app_file_handler_util | 97 } // namespace app_file_handler_util |
| 98 } // namespace extensions | 98 } // namespace extensions |
| OLD | NEW |