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

Unified Diff: experimental/SkV8Example/Path.cpp

Issue 116693004: Move v8 into third_party. (Closed) Base URL: https://skia.googlesource.com/skia.git@path
Patch Set: again 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 | « experimental/SkV8Example/JsContext.cpp ('k') | experimental/SkV8Example/README » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/SkV8Example/Path.cpp
diff --git a/experimental/SkV8Example/Path.cpp b/experimental/SkV8Example/Path.cpp
index bce96676904b74a919bb060804bd9263655c361e..2b53a0f8e16ba9cdc2eb8c60bb683a16580c7bfb 100644
--- a/experimental/SkV8Example/Path.cpp
+++ b/experimental/SkV8Example/Path.cpp
@@ -15,7 +15,8 @@ Global* Path::gGlobal = NULL;
void Path::ConstructPath(const v8::FunctionCallbackInfo<Value>& args) {
HandleScope handleScope(gGlobal->getIsolate());
Path* path = new Path();
- args.This()->SetInternalField(0, External::New(path));
+ args.This()->SetInternalField(
+ 0, External::New(gGlobal->getIsolate(), path));
}
#define ADD_METHOD(name, fn) \
@@ -23,7 +24,7 @@ void Path::ConstructPath(const v8::FunctionCallbackInfo<Value>& args) {
String::NewFromUtf8( \
global->getIsolate(), name, \
String::kInternalizedString), \
- FunctionTemplate::New(fn))
+ FunctionTemplate::New(global->getIsolate(), fn))
// Install the constructor in the global scope so Paths can be constructed
// in JS.
@@ -39,7 +40,7 @@ void Path::AddToGlobal(Global* global) {
Context::Scope contextScope(context);
Local<FunctionTemplate> constructor = FunctionTemplate::New(
- Path::ConstructPath);
+ gGlobal->getIsolate(), Path::ConstructPath);
constructor->InstanceTemplate()->SetInternalFieldCount(1);
ADD_METHOD("close", ClosePath);
@@ -50,7 +51,8 @@ void Path::AddToGlobal(Global* global) {
ADD_METHOD("arc", Arc);
ADD_METHOD("rect", Rect);
- context->Global()->Set(String::New("Path"), constructor->GetFunction());
+ context->Global()->Set(String::NewFromUtf8(
+ gGlobal->getIsolate(), "Path"), constructor->GetFunction());
}
Path* Path::Unwrap(const v8::FunctionCallbackInfo<Value>& args) {
« no previous file with comments | « experimental/SkV8Example/JsContext.cpp ('k') | experimental/SkV8Example/README » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698