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

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

Issue 25443008: Fix an uninitialized field in the fileSystem.retainEntry implementation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/file_system/file_system_apitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/saved_files_service.h" 7 #include "apps/saved_files_service.h"
8 #include "apps/shell_window.h" 8 #include "apps/shell_window.h"
9 #include "apps/shell_window_registry.h" 9 #include "apps/shell_window_registry.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 void FileSystemRetainEntryFunction::RetainFileEntry( 967 void FileSystemRetainEntryFunction::RetainFileEntry(
968 const std::string& entry_id) { 968 const std::string& entry_id) {
969 SavedFilesService* saved_files_service = SavedFilesService::Get(profile()); 969 SavedFilesService* saved_files_service = SavedFilesService::Get(profile());
970 saved_files_service->RegisterFileEntry( 970 saved_files_service->RegisterFileEntry(
971 extension_->id(), entry_id, path_, is_directory_); 971 extension_->id(), entry_id, path_, is_directory_);
972 saved_files_service->EnqueueFileEntry(extension_->id(), entry_id); 972 saved_files_service->EnqueueFileEntry(extension_->id(), entry_id);
973 SendResponse(true); 973 SendResponse(true);
974 } 974 }
975 975
976 void FileSystemRetainEntryFunction::SetIsDirectoryOnFileThread() { 976 void FileSystemRetainEntryFunction::SetIsDirectoryOnFileThread() {
977 if (base::DirectoryExists(path_)) { 977 is_directory_ = base::DirectoryExists(path_);
978 is_directory_ = true;
979 }
980 } 978 }
981 979
982 bool FileSystemIsRestorableFunction::RunImpl() { 980 bool FileSystemIsRestorableFunction::RunImpl() {
983 std::string entry_id; 981 std::string entry_id;
984 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &entry_id)); 982 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &entry_id));
985 SetResult(new base::FundamentalValue(SavedFilesService::Get( 983 SetResult(new base::FundamentalValue(SavedFilesService::Get(
986 profile())->IsRegistered(extension_->id(), entry_id))); 984 profile())->IsRegistered(extension_->id(), entry_id)));
987 return true; 985 return true;
988 } 986 }
989 987
(...skipping 18 matching lines...) Expand all
1008 if (needs_new_entry) { 1006 if (needs_new_entry) {
1009 is_directory_ = file_entry->is_directory; 1007 is_directory_ = file_entry->is_directory;
1010 CreateResponse(); 1008 CreateResponse();
1011 AddEntryToResponse(file_entry->path, file_entry->id); 1009 AddEntryToResponse(file_entry->path, file_entry->id);
1012 } 1010 }
1013 SendResponse(true); 1011 SendResponse(true);
1014 return true; 1012 return true;
1015 } 1013 }
1016 1014
1017 } // namespace extensions 1015 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/file_system/file_system_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698