| OLD | NEW |
| 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 "extensions/browser/extension_function.h" | 5 #include "extensions/browser/extension_function.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
| 10 #include "content/public/browser/notification_source.h" | 10 #include "content/public/browser/notification_source.h" |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 } | 299 } |
| 300 | 300 |
| 301 ExtensionFunction::ResponseValue ExtensionFunction::OneArgument( | 301 ExtensionFunction::ResponseValue ExtensionFunction::OneArgument( |
| 302 base::Value* arg) { | 302 base::Value* arg) { |
| 303 scoped_ptr<base::ListValue> args(new base::ListValue()); | 303 scoped_ptr<base::ListValue> args(new base::ListValue()); |
| 304 args->Append(arg); | 304 args->Append(arg); |
| 305 return ResponseValue( | 305 return ResponseValue( |
| 306 new ArgumentListResponseValue(name(), "OneArgument", this, args.Pass())); | 306 new ArgumentListResponseValue(name(), "OneArgument", this, args.Pass())); |
| 307 } | 307 } |
| 308 | 308 |
| 309 ExtensionFunction::ResponseValue ExtensionFunction::OneArgument( | |
| 310 scoped_ptr<base::Value> arg) { | |
| 311 return OneArgument(arg.release()); | |
| 312 } | |
| 313 | |
| 314 ExtensionFunction::ResponseValue ExtensionFunction::TwoArguments( | 309 ExtensionFunction::ResponseValue ExtensionFunction::TwoArguments( |
| 315 base::Value* arg1, | 310 base::Value* arg1, |
| 316 base::Value* arg2) { | 311 base::Value* arg2) { |
| 317 scoped_ptr<base::ListValue> args(new base::ListValue()); | 312 scoped_ptr<base::ListValue> args(new base::ListValue()); |
| 318 args->Append(arg1); | 313 args->Append(arg1); |
| 319 args->Append(arg2); | 314 args->Append(arg2); |
| 320 return ResponseValue( | 315 return ResponseValue( |
| 321 new ArgumentListResponseValue(name(), "TwoArguments", this, args.Pass())); | 316 new ArgumentListResponseValue(name(), "TwoArguments", this, args.Pass())); |
| 322 } | 317 } |
| 323 | 318 |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 | 570 |
| 576 ExtensionFunction::ResponseAction SyncIOThreadExtensionFunction::Run() { | 571 ExtensionFunction::ResponseAction SyncIOThreadExtensionFunction::Run() { |
| 577 return RespondNow(RunSync() ? ArgumentList(results_.Pass()) : Error(error_)); | 572 return RespondNow(RunSync() ? ArgumentList(results_.Pass()) : Error(error_)); |
| 578 } | 573 } |
| 579 | 574 |
| 580 // static | 575 // static |
| 581 bool SyncIOThreadExtensionFunction::ValidationFailure( | 576 bool SyncIOThreadExtensionFunction::ValidationFailure( |
| 582 SyncIOThreadExtensionFunction* function) { | 577 SyncIOThreadExtensionFunction* function) { |
| 583 return false; | 578 return false; |
| 584 } | 579 } |
| OLD | NEW |