| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 void V8PerIsolateData::ensureInitialized(v8::Isolate* isolate) | 67 void V8PerIsolateData::ensureInitialized(v8::Isolate* isolate) |
| 68 { | 68 { |
| 69 ASSERT(isolate); | 69 ASSERT(isolate); |
| 70 if (!isolate->GetData()) | 70 if (!isolate->GetData()) |
| 71 create(isolate); | 71 create(isolate); |
| 72 } | 72 } |
| 73 | 73 |
| 74 v8::Persistent<v8::Value>& V8PerIsolateData::ensureLiveRoot() | 74 v8::Persistent<v8::Value>& V8PerIsolateData::ensureLiveRoot() |
| 75 { | 75 { |
| 76 if (m_liveRoot.isEmpty()) | 76 if (m_liveRoot.isEmpty()) |
| 77 m_liveRoot.set(m_isolate, v8::Null()); | 77 m_liveRoot.set(m_isolate, v8::Null(m_isolate)); |
| 78 return m_liveRoot.getUnsafe(); | 78 return m_liveRoot.getUnsafe(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void V8PerIsolateData::dispose(v8::Isolate* isolate) | 81 void V8PerIsolateData::dispose(v8::Isolate* isolate) |
| 82 { | 82 { |
| 83 void* data = isolate->GetData(); | 83 void* data = isolate->GetData(); |
| 84 delete static_cast<V8PerIsolateData*>(data); | 84 delete static_cast<V8PerIsolateData*>(data); |
| 85 isolate->SetData(0); | 85 isolate->SetData(0); |
| 86 } | 86 } |
| 87 | 87 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 // obscure and unlikely to be a problem. | 161 // obscure and unlikely to be a problem. |
| 162 v8::Handle<v8::Value> value = args.Callee()->Get(v8::String::NewSymbol("toSt
ring")); | 162 v8::Handle<v8::Value> value = args.Callee()->Get(v8::String::NewSymbol("toSt
ring")); |
| 163 if (!value->IsFunction()) { | 163 if (!value->IsFunction()) { |
| 164 v8SetReturnValue(args, v8::String::Empty(args.GetIsolate())); | 164 v8SetReturnValue(args, v8::String::Empty(args.GetIsolate())); |
| 165 return; | 165 return; |
| 166 } | 166 } |
| 167 v8SetReturnValue(args, V8ScriptRunner::callInternalFunction(v8::Handle<v8::F
unction>::Cast(value), args.This(), 0, 0, v8::Isolate::GetCurrent())); | 167 v8SetReturnValue(args, V8ScriptRunner::callInternalFunction(v8::Handle<v8::F
unction>::Cast(value), args.This(), 0, 0, v8::Isolate::GetCurrent())); |
| 168 } | 168 } |
| 169 | 169 |
| 170 } // namespace WebCore | 170 } // namespace WebCore |
| OLD | NEW |