| 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 #ifndef GIN_ARGUMENTS_H_ | 5 #ifndef GIN_ARGUMENTS_H_ |
| 6 #define GIN_ARGUMENTS_H_ | 6 #define GIN_ARGUMENTS_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "gin/converter.h" | 9 #include "gin/converter.h" |
| 10 #include "gin/gin_export.h" |
| 10 | 11 |
| 11 namespace gin { | 12 namespace gin { |
| 12 | 13 |
| 13 // Arguments is a wrapper around v8::FunctionCallbackInfo that integrates | 14 // Arguments is a wrapper around v8::FunctionCallbackInfo that integrates |
| 14 // with Converter to make it easier to marshall arguments and return values | 15 // with Converter to make it easier to marshall arguments and return values |
| 15 // between V8 and C++. | 16 // between V8 and C++. |
| 16 class Arguments { | 17 class GIN_EXPORT Arguments { |
| 17 public: | 18 public: |
| 18 Arguments(); | 19 Arguments(); |
| 19 explicit Arguments(const v8::FunctionCallbackInfo<v8::Value>& info); | 20 explicit Arguments(const v8::FunctionCallbackInfo<v8::Value>& info); |
| 20 ~Arguments(); | 21 ~Arguments(); |
| 21 | 22 |
| 22 template<typename T> | 23 template<typename T> |
| 23 bool GetHolder(T* out) { | 24 bool GetHolder(T* out) { |
| 24 return ConvertFromV8(isolate_, info_->Holder(), out); | 25 return ConvertFromV8(isolate_, info_->Holder(), out); |
| 25 } | 26 } |
| 26 | 27 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 private: | 71 private: |
| 71 v8::Isolate* isolate_; | 72 v8::Isolate* isolate_; |
| 72 const v8::FunctionCallbackInfo<v8::Value>* info_; | 73 const v8::FunctionCallbackInfo<v8::Value>* info_; |
| 73 int next_; | 74 int next_; |
| 74 bool insufficient_arguments_; | 75 bool insufficient_arguments_; |
| 75 }; | 76 }; |
| 76 | 77 |
| 77 } // namespace gin | 78 } // namespace gin |
| 78 | 79 |
| 79 #endif // GIN_ARGUMENTS_H_ | 80 #endif // GIN_ARGUMENTS_H_ |
| OLD | NEW |