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

Side by Side Diff: Source/bindings/v8/custom/V8HTMLImageElementConstructor.cpp

Issue 29553002: Move privateTemplateUniqueKey / sharedTemplateUniqueKey to .bss section (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update sharedTemplateUniqueKey as well Created 7 years, 2 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) 2009, 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 RefPtr<HTMLImageElement> image = HTMLImageElement::createForJSConstructor(*d ocument, optionalWidth, optionalHeight); 83 RefPtr<HTMLImageElement> image = HTMLImageElement::createForJSConstructor(*d ocument, optionalWidth, optionalHeight);
84 v8::Handle<v8::Object> wrapper = args.Holder(); 84 v8::Handle<v8::Object> wrapper = args.Holder();
85 V8DOMWrapper::associateObjectWithWrapper<V8HTMLImageElement>(image.release() , &V8HTMLImageElementConstructor::info, wrapper, args.GetIsolate(), WrapperConfi guration::Dependent); 85 V8DOMWrapper::associateObjectWithWrapper<V8HTMLImageElement>(image.release() , &V8HTMLImageElementConstructor::info, wrapper, args.GetIsolate(), WrapperConfi guration::Dependent);
86 v8SetReturnValue(args, wrapper); 86 v8SetReturnValue(args, wrapper);
87 } 87 }
88 88
89 v8::Handle<v8::FunctionTemplate> V8HTMLImageElementConstructor::GetTemplate(v8:: Isolate* isolate, WrapperWorldType currentWorldType) 89 v8::Handle<v8::FunctionTemplate> V8HTMLImageElementConstructor::GetTemplate(v8:: Isolate* isolate, WrapperWorldType currentWorldType)
90 { 90 {
91 // This is only for getting a unique pointer which we can pass to privateTem plate. 91 // This is only for getting a unique pointer which we can pass to privateTem plate.
92 static const char* privateTemplateUniqueKey = "V8HTMLImageElementConstructor ::GetTemplatePrivateTemplate"; 92 static const int privateTemplateUniqueKey = 0;
93 V8PerIsolateData* data = V8PerIsolateData::from(isolate); 93 V8PerIsolateData* data = V8PerIsolateData::from(isolate);
94 v8::Handle<v8::FunctionTemplate> result = data->privateTemplateIfExists(curr entWorldType, &privateTemplateUniqueKey); 94 v8::Handle<v8::FunctionTemplate> result = data->privateTemplateIfExists(curr entWorldType, &privateTemplateUniqueKey);
95 if (!result.IsEmpty()) 95 if (!result.IsEmpty())
96 return result; 96 return result;
97 97
98 v8::HandleScope scope(isolate); 98 v8::HandleScope scope(isolate);
99 result = v8::FunctionTemplate::New(v8HTMLImageElementConstructorMethodCustom ); 99 result = v8::FunctionTemplate::New(v8HTMLImageElementConstructorMethodCustom );
100 100
101 v8::Local<v8::ObjectTemplate> instance = result->InstanceTemplate(); 101 v8::Local<v8::ObjectTemplate> instance = result->InstanceTemplate();
102 instance->SetInternalFieldCount(V8HTMLImageElement::internalFieldCount); 102 instance->SetInternalFieldCount(V8HTMLImageElement::internalFieldCount);
103 result->SetClassName(v8::String::NewSymbol("HTMLImageElement")); 103 result->SetClassName(v8::String::NewSymbol("HTMLImageElement"));
104 result->Inherit(V8HTMLImageElement::GetTemplate(isolate, currentWorldType)); 104 result->Inherit(V8HTMLImageElement::GetTemplate(isolate, currentWorldType));
105 105
106 data->setPrivateTemplate(currentWorldType, &privateTemplateUniqueKey, result ); 106 data->setPrivateTemplate(currentWorldType, &privateTemplateUniqueKey, result );
107 return scope.Close(result); 107 return scope.Close(result);
108 } 108 }
109 109
110 } // namespace WebCore 110 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698