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

Side by Side Diff: chrome/browser/extensions/api/file_system/file_system_api.cc

Issue 252653002: Rename (Chrome)SyncExtensionFunction::RunImpl to RunSync so that the RunImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix bookmarks Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/extensions/api/file_system/file_system_api.h" 5 #include "chrome/browser/extensions/api/file_system/file_system_api.h"
6 6
7 #include "apps/app_window.h" 7 #include "apps/app_window.h"
8 #include "apps/app_window_registry.h" 8 #include "apps/app_window_registry.h"
9 #include "apps/browser/file_handler_util.h" 9 #include "apps/browser/file_handler_util.h"
10 #include "apps/saved_files_service.h" 10 #include "apps/saved_files_service.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 for (size_t i = 0; i < arraysize(kGraylistedPaths); ++i) { 252 for (size_t i = 0; i < arraysize(kGraylistedPaths); ++i) {
253 base::FilePath graylisted_path; 253 base::FilePath graylisted_path;
254 if (PathService::Get(kGraylistedPaths[i], &graylisted_path)) 254 if (PathService::Get(kGraylistedPaths[i], &graylisted_path))
255 graylisted_directories.push_back(graylisted_path); 255 graylisted_directories.push_back(graylisted_path);
256 } 256 }
257 return graylisted_directories; 257 return graylisted_directories;
258 } 258 }
259 259
260 } // namespace file_system_api 260 } // namespace file_system_api
261 261
262 bool FileSystemGetDisplayPathFunction::RunImpl() { 262 bool FileSystemGetDisplayPathFunction::RunSync() {
263 std::string filesystem_name; 263 std::string filesystem_name;
264 std::string filesystem_path; 264 std::string filesystem_path;
265 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &filesystem_name)); 265 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &filesystem_name));
266 EXTENSION_FUNCTION_VALIDATE(args_->GetString(1, &filesystem_path)); 266 EXTENSION_FUNCTION_VALIDATE(args_->GetString(1, &filesystem_path));
267 267
268 base::FilePath file_path; 268 base::FilePath file_path;
269 if (!app_file_handler_util::ValidateFileEntryAndGetPath(filesystem_name, 269 if (!app_file_handler_util::ValidateFileEntryAndGetPath(filesystem_name,
270 filesystem_path, 270 filesystem_path,
271 render_view_host_, 271 render_view_host_,
272 &file_path, 272 &file_path,
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 CheckWritableFiles(paths); 395 CheckWritableFiles(paths);
396 } 396 }
397 397
398 void FileSystemGetWritableEntryFunction::SetIsDirectoryOnFileThread() { 398 void FileSystemGetWritableEntryFunction::SetIsDirectoryOnFileThread() {
399 DCHECK_CURRENTLY_ON(content::BrowserThread::FILE); 399 DCHECK_CURRENTLY_ON(content::BrowserThread::FILE);
400 if (base::DirectoryExists(path_)) { 400 if (base::DirectoryExists(path_)) {
401 is_directory_ = true; 401 is_directory_ = true;
402 } 402 }
403 } 403 }
404 404
405 bool FileSystemIsWritableEntryFunction::RunImpl() { 405 bool FileSystemIsWritableEntryFunction::RunSync() {
406 std::string filesystem_name; 406 std::string filesystem_name;
407 std::string filesystem_path; 407 std::string filesystem_path;
408 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &filesystem_name)); 408 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &filesystem_name));
409 EXTENSION_FUNCTION_VALIDATE(args_->GetString(1, &filesystem_path)); 409 EXTENSION_FUNCTION_VALIDATE(args_->GetString(1, &filesystem_path));
410 410
411 std::string filesystem_id; 411 std::string filesystem_id;
412 if (!fileapi::CrackIsolatedFileSystemName(filesystem_name, &filesystem_id)) { 412 if (!fileapi::CrackIsolatedFileSystemName(filesystem_name, &filesystem_id)) {
413 error_ = app_file_handler_util::kInvalidParameters; 413 error_ = app_file_handler_util::kInvalidParameters;
414 return false; 414 return false;
415 } 415 }
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 saved_files_service->RegisterFileEntry( 942 saved_files_service->RegisterFileEntry(
943 extension_->id(), entry_id, path_, is_directory_); 943 extension_->id(), entry_id, path_, is_directory_);
944 saved_files_service->EnqueueFileEntry(extension_->id(), entry_id); 944 saved_files_service->EnqueueFileEntry(extension_->id(), entry_id);
945 SendResponse(true); 945 SendResponse(true);
946 } 946 }
947 947
948 void FileSystemRetainEntryFunction::SetIsDirectoryOnFileThread() { 948 void FileSystemRetainEntryFunction::SetIsDirectoryOnFileThread() {
949 is_directory_ = base::DirectoryExists(path_); 949 is_directory_ = base::DirectoryExists(path_);
950 } 950 }
951 951
952 bool FileSystemIsRestorableFunction::RunImpl() { 952 bool FileSystemIsRestorableFunction::RunSync() {
953 std::string entry_id; 953 std::string entry_id;
954 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &entry_id)); 954 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &entry_id));
955 SetResult(new base::FundamentalValue(SavedFilesService::Get( 955 SetResult(new base::FundamentalValue(SavedFilesService::Get(
956 GetProfile())->IsRegistered(extension_->id(), entry_id))); 956 GetProfile())->IsRegistered(extension_->id(), entry_id)));
957 return true; 957 return true;
958 } 958 }
959 959
960 bool FileSystemRestoreEntryFunction::RunImpl() { 960 bool FileSystemRestoreEntryFunction::RunImpl() {
961 std::string entry_id; 961 std::string entry_id;
962 bool needs_new_entry; 962 bool needs_new_entry;
(...skipping 15 matching lines...) Expand all
978 if (needs_new_entry) { 978 if (needs_new_entry) {
979 is_directory_ = file_entry->is_directory; 979 is_directory_ = file_entry->is_directory;
980 CreateResponse(); 980 CreateResponse();
981 AddEntryToResponse(file_entry->path, file_entry->id); 981 AddEntryToResponse(file_entry->path, file_entry->id);
982 } 982 }
983 SendResponse(true); 983 SendResponse(true);
984 return true; 984 return true;
985 } 985 }
986 986
987 } // namespace extensions 987 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698