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

Side by Side Diff: Source/bindings/tests/results/V8TestTypedefs.cpp

Issue 116983005: Use v8AtomicString instead of v8::String::NewFromUtf8 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 v8::Local<v8::Signature> defaultSignature; 493 v8::Local<v8::Signature> defaultSignature;
494 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl ate, "TestTypedefs", v8::Local<v8::FunctionTemplate>(), V8TestTypedefs::internal FieldCount, 494 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl ate, "TestTypedefs", v8::Local<v8::FunctionTemplate>(), V8TestTypedefs::internal FieldCount,
495 V8TestTypedefsAttributes, WTF_ARRAY_LENGTH(V8TestTypedefsAttributes), 495 V8TestTypedefsAttributes, WTF_ARRAY_LENGTH(V8TestTypedefsAttributes),
496 0, 0, 496 0, 0,
497 V8TestTypedefsMethods, WTF_ARRAY_LENGTH(V8TestTypedefsMethods), 497 V8TestTypedefsMethods, WTF_ARRAY_LENGTH(V8TestTypedefsMethods),
498 isolate, currentWorldType); 498 isolate, currentWorldType);
499 functionTemplate->SetCallHandler(V8TestTypedefs::constructorCallback); 499 functionTemplate->SetCallHandler(V8TestTypedefs::constructorCallback);
500 functionTemplate->SetLength(2); 500 functionTemplate->SetLength(2);
501 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla te->InstanceTemplate(); 501 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla te->InstanceTemplate();
502 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl ate->PrototypeTemplate(); 502 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl ate->PrototypeTemplate();
503 functionTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(isolate, "Te stSubObj", v8::String::kInternalizedString), TestTypedefsV8Internal::TestTypedef sConstructorGetter, 0, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(& V8TestSubObj::wrapperTypeInfo)), static_cast<v8::PropertyAttribute>(v8::DontEnum ), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAU LT)); 503 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "TestSubObj" ), TestTypedefsV8Internal::TestTypedefsConstructorGetter, 0, v8::External::New(i solate, const_cast<WrapperTypeInfo*>(&V8TestSubObj::wrapperTypeInfo)), static_ca st<v8::PropertyAttribute>(v8::DontEnum), v8::Handle<v8::AccessorSignature>(), st atic_cast<v8::AccessControl>(v8::DEFAULT));
504 504
505 // Custom toString template 505 // Custom toString template
506 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); 506 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
507 return functionTemplate; 507 return functionTemplate;
508 } 508 }
509 509
510 v8::Handle<v8::FunctionTemplate> V8TestTypedefs::domTemplate(v8::Isolate* isolat e, WrapperWorldType currentWorldType) 510 v8::Handle<v8::FunctionTemplate> V8TestTypedefs::domTemplate(v8::Isolate* isolat e, WrapperWorldType currentWorldType)
511 { 511 {
512 V8PerIsolateData* data = V8PerIsolateData::from(isolate); 512 V8PerIsolateData* data = V8PerIsolateData::from(isolate);
513 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo rldType).find(&wrapperTypeInfo); 513 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo rldType).find(&wrapperTypeInfo);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 fromInternalPointer(object)->deref(); 559 fromInternalPointer(object)->deref();
560 } 560 }
561 561
562 template<> 562 template<>
563 v8::Handle<v8::Value> toV8NoInline(TestTypedefs* impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate) 563 v8::Handle<v8::Value> toV8NoInline(TestTypedefs* impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate)
564 { 564 {
565 return toV8(impl, creationContext, isolate); 565 return toV8(impl, creationContext, isolate);
566 } 566 }
567 567
568 } // namespace WebCore 568 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698