OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 V8PerContextData::~V8PerContextData() | 72 V8PerContextData::~V8PerContextData() |
73 { | 73 { |
74 v8::HandleScope handleScope(m_isolate); | 74 v8::HandleScope handleScope(m_isolate); |
75 NewScriptState::from(m_context.newLocal(m_isolate))->setPerContextData(0); | 75 NewScriptState::from(m_context.newLocal(m_isolate))->setPerContextData(0); |
76 | 76 |
77 disposeMapWithUnsafePersistentValues(&m_wrapperBoilerplates); | 77 disposeMapWithUnsafePersistentValues(&m_wrapperBoilerplates); |
78 disposeMapWithUnsafePersistentValues(&m_constructorMap); | 78 disposeMapWithUnsafePersistentValues(&m_constructorMap); |
79 } | 79 } |
80 | 80 |
| 81 PassOwnPtr<V8PerContextData> V8PerContextData::create(v8::Handle<v8::Context> co
ntext, PassRefPtr<DOMWrapperWorld> world) |
| 82 { |
| 83 return adoptPtr(new V8PerContextData(context, world)); |
| 84 } |
| 85 |
81 V8PerContextData* V8PerContextData::from(v8::Handle<v8::Context> context) | 86 V8PerContextData* V8PerContextData::from(v8::Handle<v8::Context> context) |
82 { | 87 { |
83 return NewScriptState::from(context)->perContextData(); | 88 return NewScriptState::from(context)->perContextData(); |
84 } | 89 } |
85 | 90 |
86 v8::Local<v8::Object> V8PerContextData::createWrapperFromCacheSlowCase(const Wra
pperTypeInfo* type) | 91 v8::Local<v8::Object> V8PerContextData::createWrapperFromCacheSlowCase(const Wra
pperTypeInfo* type) |
87 { | 92 { |
88 ASSERT(!m_errorPrototype.isEmpty()); | 93 ASSERT(!m_errorPrototype.isEmpty()); |
89 | 94 |
90 v8::Context::Scope scope(context()); | 95 v8::Context::Scope scope(context()); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 if (!data->IsString()) | 211 if (!data->IsString()) |
207 return -1; | 212 return -1; |
208 v8::String::Utf8Value utf8(data); | 213 v8::String::Utf8Value utf8(data); |
209 char* comma = strnstr(*utf8, ",", utf8.length()); | 214 char* comma = strnstr(*utf8, ",", utf8.length()); |
210 if (!comma) | 215 if (!comma) |
211 return -1; | 216 return -1; |
212 return atoi(comma + 1); | 217 return atoi(comma + 1); |
213 } | 218 } |
214 | 219 |
215 } // namespace WebCore | 220 } // namespace WebCore |
OLD | NEW |