| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/renderer/api_signature.h" | 5 #include "extensions/renderer/bindings/api_signature.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "content/public/child/v8_value_converter.h" | 13 #include "content/public/child/v8_value_converter.h" |
| 14 #include "extensions/renderer/api_invocation_errors.h" | 14 #include "extensions/renderer/bindings/api_invocation_errors.h" |
| 15 #include "extensions/renderer/argument_spec.h" | 15 #include "extensions/renderer/bindings/argument_spec.h" |
| 16 #include "gin/arguments.h" | 16 #include "gin/arguments.h" |
| 17 | 17 |
| 18 namespace extensions { | 18 namespace extensions { |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 bool HasCallback(const std::vector<std::unique_ptr<ArgumentSpec>>& signature) { | 22 bool HasCallback(const std::vector<std::unique_ptr<ArgumentSpec>>& signature) { |
| 23 // TODO(devlin): This is how extension APIs have always determined if a | 23 // TODO(devlin): This is how extension APIs have always determined if a |
| 24 // function has a callback, but it seems a little silly. In the long run (once | 24 // function has a callback, but it seems a little silly. In the long run (once |
| 25 // signatures are generated), it probably makes sense to indicate this | 25 // signatures are generated), it probably makes sense to indicate this |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 pieces.push_back( | 354 pieces.push_back( |
| 355 base::StringPrintf("%s%s %s", spec->optional() ? kOptionalPrefix : "", | 355 base::StringPrintf("%s%s %s", spec->optional() ? kOptionalPrefix : "", |
| 356 spec->GetTypeName().c_str(), spec->name().c_str())); | 356 spec->GetTypeName().c_str(), spec->name().c_str())); |
| 357 } | 357 } |
| 358 expected_signature_ = base::JoinString(pieces, ", "); | 358 expected_signature_ = base::JoinString(pieces, ", "); |
| 359 | 359 |
| 360 return expected_signature_; | 360 return expected_signature_; |
| 361 } | 361 } |
| 362 | 362 |
| 363 } // namespace extensions | 363 } // namespace extensions |
| OLD | NEW |