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

Side by Side Diff: chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.cc

Issue 334263017: [fsp] Remember mounted file systems as soon as possible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated a comment. Created 6 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/file_system_provider/service.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/chromeos/extensions/file_system_provider/file_system_pr ovider_api.h" 5 #include "chrome/browser/chromeos/extensions/file_system_provider/file_system_pr ovider_api.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 using api::file_system_provider::Unmount::Params; 68 using api::file_system_provider::Unmount::Params;
69 scoped_ptr<Params> params(Params::Create(*args_)); 69 scoped_ptr<Params> params(Params::Create(*args_));
70 EXTENSION_FUNCTION_VALIDATE(params); 70 EXTENSION_FUNCTION_VALIDATE(params);
71 71
72 Service* service = Service::Get(GetProfile()); 72 Service* service = Service::Get(GetProfile());
73 DCHECK(service); 73 DCHECK(service);
74 if (!service) 74 if (!service)
75 return false; 75 return false;
76 76
77 if (!service->UnmountFileSystem(extension_id(), 77 if (!service->UnmountFileSystem(extension_id(),
78 params->options.file_system_id)) { 78 params->options.file_system_id,
79 Service::UNMOUNT_REASON_USER)) {
79 // TODO(mtomasz): Pass more detailed errors, rather than just a bool. 80 // TODO(mtomasz): Pass more detailed errors, rather than just a bool.
80 base::ListValue* result = new base::ListValue(); 81 base::ListValue* result = new base::ListValue();
81 result->Append(CreateError(kSecurityErrorName, kUnmountFailedErrorMessage)); 82 result->Append(CreateError(kSecurityErrorName, kUnmountFailedErrorMessage));
82 SetResult(result); 83 SetResult(result);
83 return true; 84 return true;
84 } 85 }
85 86
86 base::ListValue* result = new base::ListValue(); 87 base::ListValue* result = new base::ListValue();
87 SetResult(result); 88 SetResult(result);
88 return true; 89 return true;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 using api::file_system_provider_internal::OperationRequestedError::Params; 153 using api::file_system_provider_internal::OperationRequestedError::Params;
153 scoped_ptr<Params> params(Params::Create(*args_)); 154 scoped_ptr<Params> params(Params::Create(*args_));
154 EXTENSION_FUNCTION_VALIDATE(params); 155 EXTENSION_FUNCTION_VALIDATE(params);
155 156
156 const base::File::Error error = ProviderErrorToFileError(params->error); 157 const base::File::Error error = ProviderErrorToFileError(params->error);
157 RejectRequest(RequestValue::CreateForOperationError(params.Pass()), error); 158 RejectRequest(RequestValue::CreateForOperationError(params.Pass()), error);
158 return true; 159 return true;
159 } 160 }
160 161
161 } // namespace extensions 162 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/file_system_provider/service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698