| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 void V8PerIsolateData::ensureInitialized(v8::Isolate* isolate) | 76 void V8PerIsolateData::ensureInitialized(v8::Isolate* isolate) |
| 77 { | 77 { |
| 78 ASSERT(isolate); | 78 ASSERT(isolate); |
| 79 if (!isolate->GetData()) | 79 if (!isolate->GetData()) |
| 80 create(isolate); | 80 create(isolate); |
| 81 } | 81 } |
| 82 | 82 |
| 83 v8::Persistent<v8::Value> V8PerIsolateData::ensureLiveRoot() | 83 v8::Persistent<v8::Value> V8PerIsolateData::ensureLiveRoot() |
| 84 { | 84 { |
| 85 if (m_liveRoot.isEmpty()) | 85 if (m_liveRoot.isEmpty()) { |
| 86 m_liveRoot.set(v8::Null()); | 86 m_liveRoot.set(v8::Null()); |
| 87 v8::UniqueId id(reinterpret_cast<intptr_t>(*(m_liveRoot.get()))); |
| 88 v8::V8::SetObjectGroupId(m_isolate, m_liveRoot.get(), id); |
| 89 } |
| 87 return m_liveRoot.get(); | 90 return m_liveRoot.get(); |
| 88 } | 91 } |
| 89 | 92 |
| 90 void V8PerIsolateData::dispose(v8::Isolate* isolate) | 93 void V8PerIsolateData::dispose(v8::Isolate* isolate) |
| 91 { | 94 { |
| 92 void* data = isolate->GetData(); | 95 void* data = isolate->GetData(); |
| 93 delete static_cast<V8PerIsolateData*>(data); | 96 delete static_cast<V8PerIsolateData*>(data); |
| 94 isolate->SetData(0); | 97 isolate->SetData(0); |
| 95 } | 98 } |
| 96 | 99 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 // changes to a DOM constructor's toString's toString will cause the | 197 // changes to a DOM constructor's toString's toString will cause the |
| 195 // toString of the DOM constructor itself to change. This is extremely | 198 // toString of the DOM constructor itself to change. This is extremely |
| 196 // obscure and unlikely to be a problem. | 199 // obscure and unlikely to be a problem. |
| 197 v8::Handle<v8::Value> value = args.Callee()->Get(v8::String::NewSymbol("toSt
ring")); | 200 v8::Handle<v8::Value> value = args.Callee()->Get(v8::String::NewSymbol("toSt
ring")); |
| 198 if (!value->IsFunction()) | 201 if (!value->IsFunction()) |
| 199 return v8::String::Empty(args.GetIsolate()); | 202 return v8::String::Empty(args.GetIsolate()); |
| 200 return v8::Handle<v8::Function>::Cast(value)->Call(args.This(), 0, 0); | 203 return v8::Handle<v8::Function>::Cast(value)->Call(args.This(), 0, 0); |
| 201 } | 204 } |
| 202 | 205 |
| 203 } // namespace WebCore | 206 } // namespace WebCore |
| OLD | NEW |