Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: gin/arguments.h

Issue 89723002: Convert the rest of the functions in core.cc to use CreateFunctionTemplate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase+comments Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gin/arguments.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/arguments.h
diff --git a/gin/arguments.h b/gin/arguments.h
index 8a372eadfdb3113b2da925c996cbaa35f8d53989..38193f9e724c1b1eca5302e9ab9f4307389caa09 100644
--- a/gin/arguments.h
+++ b/gin/arguments.h
@@ -12,41 +12,42 @@ namespace gin {
class Arguments {
public:
+ Arguments();
explicit Arguments(const v8::FunctionCallbackInfo<v8::Value>& info);
~Arguments();
template<typename T>
// TODO(aa): Rename GetHolder().
bool Holder(T* out) {
- return ConvertFromV8(info_.Holder(), out);
+ return ConvertFromV8(isolate_, info_->Holder(), out);
}
template<typename T>
bool GetData(T* out) {
- return ConvertFromV8(info_.Data(), out);
+ return ConvertFromV8(isolate_, info_->Data(), out);
}
template<typename T>
bool GetNext(T* out) {
- if (next_ >= info_.Length()) {
+ if (next_ >= info_->Length()) {
insufficient_arguments_ = true;
return false;
}
- v8::Handle<v8::Value> val = info_[next_++];
- return ConvertFromV8(val, out);
+ v8::Handle<v8::Value> val = (*info_)[next_++];
+ return ConvertFromV8(isolate_, val, out);
}
template<typename T>
bool GetRemaining(std::vector<T>* out) {
- if (next_ >= info_.Length()) {
+ if (next_ >= info_->Length()) {
insufficient_arguments_ = true;
return false;
}
- int remaining = info_.Length() - next_;
+ int remaining = info_->Length() - next_;
out->resize(remaining);
for (int i = 0; i < remaining; ++i) {
- v8::Handle<v8::Value> val = info_[next_++];
- if (!ConvertFromV8(val, &out->at(i)))
+ v8::Handle<v8::Value> val = (*info_)[next_++];
+ if (!ConvertFromV8(isolate_, val, &out->at(i)))
return false;
}
return true;
@@ -54,7 +55,7 @@ class Arguments {
template<typename T>
void Return(T val) {
- info_.GetReturnValue().Set(ConvertToV8(isolate_, val));
+ info_->GetReturnValue().Set(ConvertToV8(isolate_, val));
}
v8::Handle<v8::Value> PeekNext();
@@ -66,13 +67,14 @@ class Arguments {
private:
v8::Isolate* isolate_;
- const v8::FunctionCallbackInfo<v8::Value>& info_;
+ const v8::FunctionCallbackInfo<v8::Value>* info_;
int next_;
bool insufficient_arguments_;
-
- DISALLOW_COPY_AND_ASSIGN(Arguments);
};
+template<>
+bool Arguments::GetNext<Arguments>(Arguments* out);
+
} // namespace gin
#endif // GIN_ARGUMENTS_H_
« no previous file with comments | « no previous file | gin/arguments.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698