OLD | NEW |
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 void V8PerIsolateData::dispose(v8::Isolate* isolate) | 90 void V8PerIsolateData::dispose(v8::Isolate* isolate) |
91 { | 91 { |
92 void* data = isolate->GetData(gin::kEmbedderBlink); | 92 void* data = isolate->GetData(gin::kEmbedderBlink); |
93 delete static_cast<V8PerIsolateData*>(data); | 93 delete static_cast<V8PerIsolateData*>(data); |
94 isolate->SetData(gin::kEmbedderBlink, 0); | 94 isolate->SetData(gin::kEmbedderBlink, 0); |
95 } | 95 } |
96 | 96 |
97 V8PerIsolateData::DOMTemplateMap& V8PerIsolateData::currentDOMTemplateMap() | 97 V8PerIsolateData::DOMTemplateMap& V8PerIsolateData::currentDOMTemplateMap() |
98 { | 98 { |
99 if (DOMWrapperWorld::current(m_isolate)->isMainWorld()) | 99 if (DOMWrapperWorld::current(m_isolate).isMainWorld()) |
100 return m_domTemplateMapForMainWorld; | 100 return m_domTemplateMapForMainWorld; |
101 return m_domTemplateMapForNonMainWorld; | 101 return m_domTemplateMapForNonMainWorld; |
102 } | 102 } |
103 | 103 |
104 v8::Handle<v8::FunctionTemplate> V8PerIsolateData::domTemplate(void* domTemplate
Key, v8::FunctionCallback callback, v8::Handle<v8::Value> data, v8::Handle<v8::S
ignature> signature, int length) | 104 v8::Handle<v8::FunctionTemplate> V8PerIsolateData::domTemplate(void* domTemplate
Key, v8::FunctionCallback callback, v8::Handle<v8::Value> data, v8::Handle<v8::S
ignature> signature, int length) |
105 { | 105 { |
106 DOMTemplateMap& domTemplateMap = currentDOMTemplateMap(); | 106 DOMTemplateMap& domTemplateMap = currentDOMTemplateMap(); |
107 DOMTemplateMap::iterator result = domTemplateMap.find(domTemplateKey); | 107 DOMTemplateMap::iterator result = domTemplateMap.find(domTemplateKey); |
108 if (result != domTemplateMap.end()) | 108 if (result != domTemplateMap.end()) |
109 return result->value.Get(m_isolate); | 109 return result->value.Get(m_isolate); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } | 190 } |
191 | 191 |
192 v8::Handle<v8::FunctionTemplate> V8PerIsolateData::toStringTemplate() | 192 v8::Handle<v8::FunctionTemplate> V8PerIsolateData::toStringTemplate() |
193 { | 193 { |
194 if (m_toStringTemplate.isEmpty()) | 194 if (m_toStringTemplate.isEmpty()) |
195 m_toStringTemplate.set(m_isolate, v8::FunctionTemplate::New(m_isolate, c
onstructorOfToString)); | 195 m_toStringTemplate.set(m_isolate, v8::FunctionTemplate::New(m_isolate, c
onstructorOfToString)); |
196 return m_toStringTemplate.newLocal(m_isolate); | 196 return m_toStringTemplate.newLocal(m_isolate); |
197 } | 197 } |
198 | 198 |
199 } // namespace WebCore | 199 } // namespace WebCore |
OLD | NEW |