| 660 | } |
| 661 | |
| 662 | int Script::AddArguments(IElementManager* element_manager, const Json::Value& arguments) { |
| 663 | LOG(TRACE) << "Entering Script::AddArguments"; |
| 664 | |
| 665 | int status_code = WD_SUCCESS; |
| 666 | |
| 667 | // Calling vector::resize() is okay here, because the vector |
| 668 | // should be empty when Initialize() is called, and the |
| 669 | // reallocation of variants shouldn't give us too much of a |
| 670 | // negative impact. |
| 671 | this->argument_array_.resize(arguments.size()); |
| 672 | |
| 673 | for (UINT arg_index = 0; arg_index < arguments.size(); ++arg_index) { |
| 674 | Json::Value arg = arguments[arg_index]; |
| 675 | status_code = this->AddArgument(element_manager, arg); |
| 676 | if (status_code != WD_SUCCESS) { |
| 677 | break; |
| 678 | } |
| 679 | } |
| 680 | |
| 681 | return status_code; |
| 682 | } |
| 683 | |
| 684 | int Script::AddArgument(IElementManager* element_manager, const Json::Value& arg) { |
| 685 | LOG(TRACE) << "Entering Script::AddArgument"; |
no test coverage detected