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

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

Issue 257333002: Drive extension functions from ExtensionFunction::Run. The (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comment 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/chromeos/file_system_provider/provided_file_system_inte rface.h" 7 #include "chrome/browser/chromeos/file_system_provider/provided_file_system_inte rface.h"
8 #include "chrome/browser/chromeos/file_system_provider/request_manager.h" 8 #include "chrome/browser/chromeos/file_system_provider/request_manager.h"
9 #include "chrome/browser/chromeos/file_system_provider/request_value.h" 9 #include "chrome/browser/chromeos/file_system_provider/request_value.h"
10 #include "chrome/browser/chromeos/file_system_provider/service.h" 10 #include "chrome/browser/chromeos/file_system_provider/service.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 SetErrorResponse(kSecurityErrorName, kResponseFailedErrorMessage); 87 SetErrorResponse(kSecurityErrorName, kResponseFailedErrorMessage);
88 } 88 }
89 89
90 void FileSystemProviderInternalFunction::FulfillRequest( 90 void FileSystemProviderInternalFunction::FulfillRequest(
91 scoped_ptr<RequestValue> value, 91 scoped_ptr<RequestValue> value,
92 bool has_next) { 92 bool has_next) {
93 if (!request_manager_->FulfillRequest(request_id_, value.Pass(), has_next)) 93 if (!request_manager_->FulfillRequest(request_id_, value.Pass(), has_next))
94 SetErrorResponse(kSecurityErrorName, kResponseFailedErrorMessage); 94 SetErrorResponse(kSecurityErrorName, kResponseFailedErrorMessage);
95 } 95 }
96 96
97 bool FileSystemProviderInternalFunction::RunImpl() { 97 bool FileSystemProviderInternalFunction::RunSync() {
98 DCHECK(args_); 98 DCHECK(args_);
99 if (!Parse()) 99 if (!Parse())
100 return true; 100 return true;
101 101
102 SendResponse(RunSync()); 102 SendResponse(RunWhenValid());
103 return true; 103 return true;
104 } 104 }
105 105
106 bool FileSystemProviderInternalFunction::Parse() { 106 bool FileSystemProviderInternalFunction::Parse() {
107 int file_system_id = 0; 107 int file_system_id = 0;
108 108
109 if (!args_->GetInteger(0, &file_system_id) || 109 if (!args_->GetInteger(0, &file_system_id) ||
110 !args_->GetInteger(1, &request_id_)) { 110 !args_->GetInteger(1, &request_id_)) {
111 bad_message_ = true; 111 bad_message_ = true;
112 SendResponse(false); 112 SendResponse(false);
(...skipping 20 matching lines...) Expand all
133 133
134 void FileSystemProviderInternalFunction::SetErrorResponse( 134 void FileSystemProviderInternalFunction::SetErrorResponse(
135 const std::string& name, 135 const std::string& name,
136 const std::string& message) { 136 const std::string& message) {
137 base::ListValue* result = new base::ListValue(); 137 base::ListValue* result = new base::ListValue();
138 result->Append(CreateError(name, message)); 138 result->Append(CreateError(name, message));
139 SetResult(result); 139 SetResult(result);
140 } 140 }
141 141
142 } // namespace extensions 142 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698