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

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

Issue 209853010: [ABANDONED] Enable V8 Promises (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: done? Created 6 years, 8 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
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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 if (result != domTemplateMap.end()) 119 if (result != domTemplateMap.end())
120 return result->value.Get(m_isolate); 120 return result->value.Get(m_isolate);
121 return v8::Local<v8::FunctionTemplate>(); 121 return v8::Local<v8::FunctionTemplate>();
122 } 122 }
123 123
124 void V8PerIsolateData::setDOMTemplate(void* domTemplateKey, v8::Handle<v8::Funct ionTemplate> templ) 124 void V8PerIsolateData::setDOMTemplate(void* domTemplateKey, v8::Handle<v8::Funct ionTemplate> templ)
125 { 125 {
126 currentDOMTemplateMap().add(domTemplateKey, v8::Eternal<v8::FunctionTemplate >(m_isolate, v8::Local<v8::FunctionTemplate>(templ))); 126 currentDOMTemplateMap().add(domTemplateKey, v8::Eternal<v8::FunctionTemplate >(m_isolate, v8::Local<v8::FunctionTemplate>(templ)));
127 } 127 }
128 128
129 v8::Local<v8::Context> V8PerIsolateData::ensureRegexContext() 129 v8::Local<v8::Context> V8PerIsolateData::ensureDomInJSContext()
130 { 130 {
131 if (!m_perContextDataForRegex) 131 if (!m_domInJSPerContextData)
132 m_perContextDataForRegex = V8PerContextData::create(v8::Context::New(m_i solate), DOMWrapperWorld::create()); 132 m_domInJSPerContextData = V8PerContextData::create(v8::Context::New(m_is olate), DOMWrapperWorld::create());
133 return m_perContextDataForRegex->context(); 133 return m_domInJSPerContextData->context();
134 } 134 }
135 135
136 bool V8PerIsolateData::hasInstance(const WrapperTypeInfo* info, v8::Handle<v8::V alue> value) 136 bool V8PerIsolateData::hasInstance(const WrapperTypeInfo* info, v8::Handle<v8::V alue> value)
137 { 137 {
138 return hasInstance(info, value, m_domTemplateMapForMainWorld) 138 return hasInstance(info, value, m_domTemplateMapForMainWorld)
139 || hasInstance(info, value, m_domTemplateMapForNonMainWorld); 139 || hasInstance(info, value, m_domTemplateMapForNonMainWorld);
140 } 140 }
141 141
142 bool V8PerIsolateData::hasInstance(const WrapperTypeInfo* info, v8::Handle<v8::V alue> value, DOMTemplateMap& domTemplateMap) 142 bool V8PerIsolateData::hasInstance(const WrapperTypeInfo* info, v8::Handle<v8::V alue> value, DOMTemplateMap& domTemplateMap)
143 { 143 {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 } 186 }
187 187
188 v8::Handle<v8::FunctionTemplate> V8PerIsolateData::toStringTemplate() 188 v8::Handle<v8::FunctionTemplate> V8PerIsolateData::toStringTemplate()
189 { 189 {
190 if (m_toStringTemplate.isEmpty()) 190 if (m_toStringTemplate.isEmpty())
191 m_toStringTemplate.set(m_isolate, v8::FunctionTemplate::New(m_isolate, c onstructorOfToString)); 191 m_toStringTemplate.set(m_isolate, v8::FunctionTemplate::New(m_isolate, c onstructorOfToString));
192 return m_toStringTemplate.newLocal(m_isolate); 192 return m_toStringTemplate.newLocal(m_isolate);
193 } 193 }
194 194
195 } // namespace WebCore 195 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698