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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 void V8PerIsolateData::dispose(v8::Isolate* isolate) | 89 void V8PerIsolateData::dispose(v8::Isolate* isolate) |
90 { | 90 { |
91 void* data = isolate->GetData(gin::kEmbedderBlink); | 91 void* data = isolate->GetData(gin::kEmbedderBlink); |
92 delete static_cast<V8PerIsolateData*>(data); | 92 delete static_cast<V8PerIsolateData*>(data); |
93 isolate->SetData(gin::kEmbedderBlink, 0); | 93 isolate->SetData(gin::kEmbedderBlink, 0); |
94 } | 94 } |
95 | 95 |
96 V8PerIsolateData::DOMTemplateMap& V8PerIsolateData::currentDOMTemplateMap() | 96 V8PerIsolateData::DOMTemplateMap& V8PerIsolateData::currentDOMTemplateMap() |
97 { | 97 { |
98 if (DOMWrapperWorld::current(m_isolate).isMainWorld()) | 98 if (DOMWrapperWorld::current(m_isolate)->isMainWorld()) |
99 return m_domTemplateMapForMainWorld; | 99 return m_domTemplateMapForMainWorld; |
100 return m_domTemplateMapForNonMainWorld; | 100 return m_domTemplateMapForNonMainWorld; |
101 } | 101 } |
102 | 102 |
103 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) | 103 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 { | 104 { |
105 DOMTemplateMap& domTemplateMap = currentDOMTemplateMap(); | 105 DOMTemplateMap& domTemplateMap = currentDOMTemplateMap(); |
106 DOMTemplateMap::iterator result = domTemplateMap.find(domTemplateKey); | 106 DOMTemplateMap::iterator result = domTemplateMap.find(domTemplateKey); |
107 if (result != domTemplateMap.end()) | 107 if (result != domTemplateMap.end()) |
108 return result->value.Get(m_isolate); | 108 return result->value.Get(m_isolate); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |