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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 V8PerIsolateData* V8PerIsolateData::create(v8::Isolate* isolate) | 58 V8PerIsolateData* V8PerIsolateData::create(v8::Isolate* isolate) |
59 { | 59 { |
60 ASSERT(isolate); | 60 ASSERT(isolate); |
61 ASSERT(!isolate->GetData()); | 61 ASSERT(!isolate->GetData()); |
62 V8PerIsolateData* data = new V8PerIsolateData(isolate); | 62 V8PerIsolateData* data = new V8PerIsolateData(isolate); |
63 isolate->SetData(data); | 63 isolate->SetData(data); |
64 return data; | 64 return data; |
65 } | 65 } |
66 | 66 |
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()); |
78 return m_liveRoot.getUnsafe(); | 78 return m_liveRoot.getUnsafe(); |
79 } | 79 } |
80 | 80 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 // obscure and unlikely to be a problem. | 180 // obscure and unlikely to be a problem. |
181 v8::Handle<v8::Value> value = args.Callee()->Get(v8::String::NewSymbol("toSt
ring")); | 181 v8::Handle<v8::Value> value = args.Callee()->Get(v8::String::NewSymbol("toSt
ring")); |
182 if (!value->IsFunction()) { | 182 if (!value->IsFunction()) { |
183 v8SetReturnValue(args, v8::String::Empty(args.GetIsolate())); | 183 v8SetReturnValue(args, v8::String::Empty(args.GetIsolate())); |
184 return; | 184 return; |
185 } | 185 } |
186 v8SetReturnValue(args, V8ScriptRunner::callInternalFunction(v8::Handle<v8::F
unction>::Cast(value), args.This(), 0, 0, v8::Isolate::GetCurrent())); | 186 v8SetReturnValue(args, V8ScriptRunner::callInternalFunction(v8::Handle<v8::F
unction>::Cast(value), args.This(), 0, 0, v8::Isolate::GetCurrent())); |
187 } | 187 } |
188 | 188 |
189 } // namespace WebCore | 189 } // namespace WebCore |
OLD | NEW |