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

Side by Side Diff: Source/bindings/v8/V8DOMConfiguration.cpp

Issue 75163003: Remove deprecated v8::External::New calls (blink side) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 v8::FunctionCallback setterCallback = accessors[i].setter; 46 v8::FunctionCallback setterCallback = accessors[i].setter;
47 if (currentWorldType == MainWorld) { 47 if (currentWorldType == MainWorld) {
48 if (accessors[i].getterForMainWorld) 48 if (accessors[i].getterForMainWorld)
49 getterCallback = accessors[i].getterForMainWorld; 49 getterCallback = accessors[i].getterForMainWorld;
50 if (accessors[i].setterForMainWorld) 50 if (accessors[i].setterForMainWorld)
51 setterCallback = accessors[i].setterForMainWorld; 51 setterCallback = accessors[i].setterForMainWorld;
52 } 52 }
53 53
54 v8::Local<v8::FunctionTemplate> getter; 54 v8::Local<v8::FunctionTemplate> getter;
55 if (getterCallback) { 55 if (getterCallback) {
56 getter = v8::FunctionTemplate::New(getterCallback, v8::External::New (const_cast<WrapperTypeInfo*>(accessors[i].data)), signature, 0); 56 getter = v8::FunctionTemplate::New(getterCallback, v8::External::New (isolate, const_cast<WrapperTypeInfo*>(accessors[i].data)), signature, 0);
57 getter->RemovePrototype(); 57 getter->RemovePrototype();
58 } 58 }
59 v8::Local<v8::FunctionTemplate> setter; 59 v8::Local<v8::FunctionTemplate> setter;
60 if (setterCallback) { 60 if (setterCallback) {
61 setter = v8::FunctionTemplate::New(setterCallback, v8::External::New (const_cast<WrapperTypeInfo*>(accessors[i].data)), signature, 1); 61 setter = v8::FunctionTemplate::New(setterCallback, v8::External::New (isolate, const_cast<WrapperTypeInfo*>(accessors[i].data)), signature, 1);
62 setter->RemovePrototype(); 62 setter->RemovePrototype();
63 } 63 }
64 prototype->SetAccessorProperty(v8::String::NewSymbol(accessors[i].name), getter, setter, accessors[i].attribute, accessors[i].settings); 64 prototype->SetAccessorProperty(v8::String::NewSymbol(accessors[i].name), getter, setter, accessors[i].attribute, accessors[i].settings);
65 } 65 }
66 } 66 }
67 67
68 void V8DOMConfiguration::installConstants(v8::Handle<v8::FunctionTemplate> funct ionDescriptor, v8::Handle<v8::ObjectTemplate> prototype, const ConstantConfigura tion* constants, size_t constantCount, v8::Isolate* isolate) 68 void V8DOMConfiguration::installConstants(v8::Handle<v8::FunctionTemplate> funct ionDescriptor, v8::Handle<v8::ObjectTemplate> prototype, const ConstantConfigura tion* constants, size_t constantCount, v8::Isolate* isolate)
69 { 69 {
70 for (size_t i = 0; i < constantCount; ++i) { 70 for (size_t i = 0; i < constantCount; ++i) {
71 const ConstantConfiguration* constant = &constants[i]; 71 const ConstantConfiguration* constant = &constants[i];
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 if (attributeCount) 108 if (attributeCount)
109 installAttributes(instanceTemplate, functionDescriptor->PrototypeTemplat e(), attributes, attributeCount, isolate, currentWorldType); 109 installAttributes(instanceTemplate, functionDescriptor->PrototypeTemplat e(), attributes, attributeCount, isolate, currentWorldType);
110 if (accessorCount) 110 if (accessorCount)
111 installAccessors(functionDescriptor->PrototypeTemplate(), defaultSignatu re, accessors, accessorCount, isolate, currentWorldType); 111 installAccessors(functionDescriptor->PrototypeTemplate(), defaultSignatu re, accessors, accessorCount, isolate, currentWorldType);
112 if (callbackCount) 112 if (callbackCount)
113 installCallbacks(functionDescriptor->PrototypeTemplate(), defaultSignatu re, static_cast<v8::PropertyAttribute>(v8::DontDelete), callbacks, callbackCount , isolate, currentWorldType); 113 installCallbacks(functionDescriptor->PrototypeTemplate(), defaultSignatu re, static_cast<v8::PropertyAttribute>(v8::DontDelete), callbacks, callbackCount , isolate, currentWorldType);
114 return defaultSignature; 114 return defaultSignature;
115 } 115 }
116 116
117 } // namespace WebCore 117 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698