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

Unified Diff: src/extensions/gc-extension.h

Issue 142893003: Merge bleeding_edge 18658:18677 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 11 months 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 | « src/extensions/free-buffer-extension.cc ('k') | src/extensions/gc-extension.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/extensions/gc-extension.h
diff --git a/src/extensions/gc-extension.h b/src/extensions/gc-extension.h
index 8c25e7d84d5e286b763d22873ca1d7962d1a9cce..105c5ad5b72b4f01ed3712c2eec2613fc218449f 100644
--- a/src/extensions/gc-extension.h
+++ b/src/extensions/gc-extension.h
@@ -35,12 +35,22 @@ namespace internal {
class GCExtension : public v8::Extension {
public:
- explicit GCExtension(const char* source) : v8::Extension("v8/gc", source) {}
+ explicit GCExtension(const char* fun_name)
+ : v8::Extension("v8/gc",
+ BuildSource(buffer_, sizeof(buffer_), fun_name)) {}
virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
v8::Isolate* isolate,
v8::Handle<v8::String> name);
static void GC(const v8::FunctionCallbackInfo<v8::Value>& args);
- static void Register();
+
+ private:
+ static const char* BuildSource(char* buf, size_t size, const char* fun_name) {
+ OS::SNPrintF(Vector<char>(buf, static_cast<int>(size)),
+ "native function %s();", fun_name);
+ return buf;
+ }
+
+ char buffer_[50];
};
} } // namespace v8::internal
« no previous file with comments | « src/extensions/free-buffer-extension.cc ('k') | src/extensions/gc-extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698