| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2008, 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 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 26 matching lines...) Expand all Loading... |
| 37 #include <v8.h> | 37 #include <v8.h> |
| 38 | 38 |
| 39 #ifndef NDEBUG | 39 #ifndef NDEBUG |
| 40 #include "V8Proxy.h" // for register and unregister global handles. | 40 #include "V8Proxy.h" // for register and unregister global handles. |
| 41 #endif | 41 #endif |
| 42 | 42 |
| 43 namespace WebCore { | 43 namespace WebCore { |
| 44 | 44 |
| 45 class ScriptValue { | 45 class ScriptValue { |
| 46 public: | 46 public: |
| 47 static ScriptValue quarantineValue(ScriptState* scriptState, const ScriptVal
ue& value) | |
| 48 { | |
| 49 return value; | |
| 50 } | |
| 51 | |
| 52 ScriptValue() {} | 47 ScriptValue() {} |
| 53 | 48 |
| 54 ScriptValue(v8::Handle<v8::Value> value) | 49 ScriptValue(v8::Handle<v8::Value> value) |
| 55 { | 50 { |
| 56 if (value.IsEmpty()) | 51 if (value.IsEmpty()) |
| 57 return; | 52 return; |
| 58 | 53 |
| 59 m_value = v8::Persistent<v8::Value>::New(value); | 54 m_value = v8::Persistent<v8::Value>::New(value); |
| 60 #ifndef NDEBUG | 55 #ifndef NDEBUG |
| 61 V8GCController::registerGlobalHandle(SCRIPTVALUE, this, m_value); | 56 V8GCController::registerGlobalHandle(SCRIPTVALUE, this, m_value); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 bool getString(String& result) const; | 143 bool getString(String& result) const; |
| 149 String toString(ScriptState*) const; | 144 String toString(ScriptState*) const; |
| 150 | 145 |
| 151 private: | 146 private: |
| 152 mutable v8::Persistent<v8::Value> m_value; | 147 mutable v8::Persistent<v8::Value> m_value; |
| 153 }; | 148 }; |
| 154 | 149 |
| 155 } // namespace WebCore | 150 } // namespace WebCore |
| 156 | 151 |
| 157 #endif // ScriptValue_h | 152 #endif // ScriptValue_h |
| OLD | NEW |