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

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

Issue 29553002: Move privateTemplateUniqueKey / sharedTemplateUniqueKey to .bss section (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase 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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 v8::Handle<v8::Context> context() const { return m_context; } 73 v8::Handle<v8::Context> context() const { return m_context; }
74 74
75 private: 75 private:
76 bool m_didEnterContext; 76 bool m_didEnterContext;
77 v8::Handle<v8::Context> m_context; 77 v8::Handle<v8::Context> m_context;
78 }; 78 };
79 79
80 static v8::Local<v8::Object> wrapInShadowTemplate(v8::Local<v8::Object> wrapper, Node* impl, v8::Isolate* isolate) 80 static v8::Local<v8::Object> wrapInShadowTemplate(v8::Local<v8::Object> wrapper, Node* impl, v8::Isolate* isolate)
81 { 81 {
82 // This is only for getting a unique pointer which we can pass to privateTem plate. 82 // This is only for getting a unique pointer which we can pass to privateTem plate.
83 static const char* shadowTemplateUniqueKey = "wrapInShadowTemplate"; 83 static int shadowTemplateUniqueKey;
84 WrapperWorldType currentWorldType = worldType(isolate); 84 WrapperWorldType currentWorldType = worldType(isolate);
85 V8PerIsolateData* data = V8PerIsolateData::from(isolate); 85 V8PerIsolateData* data = V8PerIsolateData::from(isolate);
86 v8::Handle<v8::FunctionTemplate> shadowTemplate = data->privateTemplateIfExi sts(currentWorldType, &shadowTemplateUniqueKey); 86 v8::Handle<v8::FunctionTemplate> shadowTemplate = data->privateTemplateIfExi sts(currentWorldType, &shadowTemplateUniqueKey);
87 if (shadowTemplate.IsEmpty()) { 87 if (shadowTemplate.IsEmpty()) {
88 shadowTemplate = v8::FunctionTemplate::New(); 88 shadowTemplate = v8::FunctionTemplate::New();
89 if (shadowTemplate.IsEmpty()) 89 if (shadowTemplate.IsEmpty())
90 return v8::Local<v8::Object>(); 90 return v8::Local<v8::Object>();
91 shadowTemplate->SetClassName(v8::String::NewSymbol("HTMLDocument")); 91 shadowTemplate->SetClassName(v8::String::NewSymbol("HTMLDocument"));
92 shadowTemplate->Inherit(V8HTMLDocument::GetTemplate(isolate, currentWorl dType)); 92 shadowTemplate->Inherit(V8HTMLDocument::GetTemplate(isolate, currentWorl dType));
93 shadowTemplate->InstanceTemplate()->SetInternalFieldCount(V8HTMLDocument ::internalFieldCount); 93 shadowTemplate->InstanceTemplate()->SetInternalFieldCount(V8HTMLDocument ::internalFieldCount);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 164
165 v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(value); 165 v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(value);
166 ASSERT(wrapper->InternalFieldCount() >= v8DefaultWrapperInternalFieldCount); 166 ASSERT(wrapper->InternalFieldCount() >= v8DefaultWrapperInternalFieldCount);
167 ASSERT(wrapper->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) ; 167 ASSERT(wrapper->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) ;
168 168
169 const WrapperTypeInfo* typeInfo = static_cast<const WrapperTypeInfo*>(wrappe r->GetAlignedPointerFromInternalField(v8DOMWrapperTypeIndex)); 169 const WrapperTypeInfo* typeInfo = static_cast<const WrapperTypeInfo*>(wrappe r->GetAlignedPointerFromInternalField(v8DOMWrapperTypeIndex));
170 return typeInfo == type; 170 return typeInfo == type;
171 } 171 }
172 172
173 } // namespace WebCore 173 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestNamedConstructor.cpp ('k') | Source/bindings/v8/custom/V8PromiseCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698