Chromium Code Reviews| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 | 113 |
| 114 v8::Persistent<v8::Value>& V8PerIsolateData::ensureLiveRoot() | 114 v8::Persistent<v8::Value>& V8PerIsolateData::ensureLiveRoot() |
| 115 { | 115 { |
| 116 if (m_liveRoot.isEmpty()) | 116 if (m_liveRoot.isEmpty()) |
| 117 m_liveRoot.set(m_isolate, v8::Null(m_isolate)); | 117 m_liveRoot.set(m_isolate, v8::Null(m_isolate)); |
| 118 return m_liveRoot.getUnsafe(); | 118 return m_liveRoot.getUnsafe(); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void V8PerIsolateData::dispose(v8::Isolate* isolate) | 121 void V8PerIsolateData::willBeDestroyed(v8::Isolate* isolate) |
| 122 { | |
| 123 V8PerIsolateData* data = from(isolate); | |
| 124 | |
| 125 // Clear any data that may have handles into the heap, | |
| 126 // prior to thread detach. | |
|
haraken
2014/09/11 01:18:53
thread detach => calling ThreadState::detach
jsbell
2014/09/11 22:14:51
Done.
| |
| 127 data->m_idbPendingTransactionMonitor.clear(); | |
| 128 } | |
| 129 | |
| 130 void V8PerIsolateData::destroy(v8::Isolate* isolate) | |
| 122 { | 131 { |
| 123 #if ENABLE(ASSERT) | 132 #if ENABLE(ASSERT) |
| 124 if (blink::Platform::current()->currentThread()) | 133 if (blink::Platform::current()->currentThread()) |
| 125 isolate->RemoveCallCompletedCallback(&assertV8RecursionScope); | 134 isolate->RemoveCallCompletedCallback(&assertV8RecursionScope); |
| 126 #endif | 135 #endif |
| 127 void* data = isolate->GetData(gin::kEmbedderBlink); | 136 void* data = isolate->GetData(gin::kEmbedderBlink); |
|
haraken
2014/09/11 01:18:53
We can use from(isolate) here as well.
jsbell
2014/09/11 22:14:51
Done.
| |
| 128 delete static_cast<V8PerIsolateData*>(data); | 137 delete static_cast<V8PerIsolateData*>(data); |
| 129 isolate->SetData(gin::kEmbedderBlink, 0); | 138 isolate->SetData(gin::kEmbedderBlink, 0); |
| 130 } | 139 } |
| 131 | 140 |
| 132 V8PerIsolateData::DOMTemplateMap& V8PerIsolateData::currentDOMTemplateMap() | 141 V8PerIsolateData::DOMTemplateMap& V8PerIsolateData::currentDOMTemplateMap() |
| 133 { | 142 { |
| 134 if (DOMWrapperWorld::current(m_isolate).isMainWorld()) | 143 if (DOMWrapperWorld::current(m_isolate).isMainWorld()) |
| 135 return m_domTemplateMapForMainWorld; | 144 return m_domTemplateMapForMainWorld; |
| 136 return m_domTemplateMapForNonMainWorld; | 145 return m_domTemplateMapForNonMainWorld; |
| 137 } | 146 } |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 224 } | 233 } |
| 225 | 234 |
| 226 v8::Handle<v8::FunctionTemplate> V8PerIsolateData::toStringTemplate() | 235 v8::Handle<v8::FunctionTemplate> V8PerIsolateData::toStringTemplate() |
| 227 { | 236 { |
| 228 if (m_toStringTemplate.isEmpty()) | 237 if (m_toStringTemplate.isEmpty()) |
| 229 m_toStringTemplate.set(m_isolate, v8::FunctionTemplate::New(m_isolate, c onstructorOfToString)); | 238 m_toStringTemplate.set(m_isolate, v8::FunctionTemplate::New(m_isolate, c onstructorOfToString)); |
| 230 return m_toStringTemplate.newLocal(m_isolate); | 239 return m_toStringTemplate.newLocal(m_isolate); |
| 231 } | 240 } |
| 232 | 241 |
| 233 } // namespace blink | 242 } // namespace blink |
| OLD | NEW |