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 | 10 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 return false; | 53 return false; |
54 } | 54 } |
55 return true; | 55 return true; |
56 } | 56 } |
57 | 57 |
58 template<typename T> | 58 template<typename T> |
59 void Return(T val) { | 59 void Return(T val) { |
60 info_->GetReturnValue().Set(ConvertToV8(isolate_, val)); | 60 info_->GetReturnValue().Set(ConvertToV8(isolate_, val)); |
61 } | 61 } |
62 | 62 |
63 v8::Handle<v8::Value> PeekNext(); | 63 v8::Handle<v8::Value> PeekNext() const; |
64 | 64 |
65 void ThrowError(); | 65 void ThrowError() const; |
66 void ThrowTypeError(const std::string& message); | 66 void ThrowTypeError(const std::string& message) const; |
67 | 67 |
68 v8::Isolate* isolate() const { return isolate_; } | 68 v8::Isolate* isolate() const { return isolate_; } |
69 | 69 |
70 private: | 70 private: |
71 v8::Isolate* isolate_; | 71 v8::Isolate* isolate_; |
72 const v8::FunctionCallbackInfo<v8::Value>* info_; | 72 const v8::FunctionCallbackInfo<v8::Value>* info_; |
73 int next_; | 73 int next_; |
74 bool insufficient_arguments_; | 74 bool insufficient_arguments_; |
75 }; | 75 }; |
76 | 76 |
77 } // namespace gin | 77 } // namespace gin |
78 | 78 |
79 #endif // GIN_ARGUMENTS_H_ | 79 #endif // GIN_ARGUMENTS_H_ |
OLD | NEW |