OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009, 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009, 2011 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 return m_value->newLocal(isolate()); | 55 return m_value->newLocal(isolate()); |
56 } | 56 } |
57 | 57 |
58 v8::Local<v8::Value> ScriptValue::v8ValueUnsafe() const | 58 v8::Local<v8::Value> ScriptValue::v8ValueUnsafe() const |
59 { | 59 { |
60 if (isEmpty()) | 60 if (isEmpty()) |
61 return v8::Local<v8::Value>(); | 61 return v8::Local<v8::Value>(); |
62 return m_value->newLocal(isolate()); | 62 return m_value->newLocal(isolate()); |
63 } | 63 } |
64 | 64 |
65 v8::Local<v8::Value> ScriptValue::v8ValueFor(ScriptState* targetScriptState) | 65 v8::Local<v8::Value> ScriptValue::v8ValueFor(ScriptState* targetScriptState) con
st |
66 { | 66 { |
67 if (isEmpty()) | 67 if (isEmpty()) |
68 return v8::Local<v8::Value>(); | 68 return v8::Local<v8::Value>(); |
69 v8::Isolate* isolate = targetScriptState->isolate(); | 69 v8::Isolate* isolate = targetScriptState->isolate(); |
70 if (&m_scriptState->world() == &targetScriptState->world()) | 70 if (&m_scriptState->world() == &targetScriptState->world()) |
71 return m_value->newLocal(isolate); | 71 return m_value->newLocal(isolate); |
72 | 72 |
73 ASSERT(isolate->InContext()); | 73 ASSERT(isolate->InContext()); |
74 v8::Local<v8::Value> value = m_value->newLocal(isolate); | 74 v8::Local<v8::Value> value = m_value->newLocal(isolate); |
75 RefPtr<SerializedScriptValue> serialized = SerializedScriptValueFactory::ins
tance().createAndSwallowExceptions(isolate, value); | 75 RefPtr<SerializedScriptValue> serialized = SerializedScriptValueFactory::ins
tance().createAndSwallowExceptions(isolate, value); |
(...skipping 12 matching lines...) Expand all Loading... |
88 result = toCoreString(v8::Local<v8::String>::Cast(string)); | 88 result = toCoreString(v8::Local<v8::String>::Cast(string)); |
89 return true; | 89 return true; |
90 } | 90 } |
91 | 91 |
92 ScriptValue ScriptValue::createNull(ScriptState* scriptState) | 92 ScriptValue ScriptValue::createNull(ScriptState* scriptState) |
93 { | 93 { |
94 return ScriptValue(scriptState, v8::Null(scriptState->isolate())); | 94 return ScriptValue(scriptState, v8::Null(scriptState->isolate())); |
95 } | 95 } |
96 | 96 |
97 } // namespace blink | 97 } // namespace blink |
OLD | NEW |