| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 String ScriptValue::toString(ScriptState*) const | 77 String ScriptValue::toString(ScriptState*) const |
| 78 { | 78 { |
| 79 v8::TryCatch block; | 79 v8::TryCatch block; |
| 80 v8::Handle<v8::String> string = v8ValueRaw()->ToString(); | 80 v8::Handle<v8::String> string = v8ValueRaw()->ToString(); |
| 81 if (block.HasCaught()) | 81 if (block.HasCaught()) |
| 82 return String(); | 82 return String(); |
| 83 return v8StringToWebCoreString<String>(string, DoNotExternalize); | 83 return v8StringToWebCoreString<String>(string, DoNotExternalize); |
| 84 } | 84 } |
| 85 | 85 |
| 86 #if ENABLE(INSPECTOR) | |
| 87 static PassRefPtr<InspectorValue> v8ToInspectorValue(v8::Handle<v8::Value> value
, int maxDepth) | 86 static PassRefPtr<InspectorValue> v8ToInspectorValue(v8::Handle<v8::Value> value
, int maxDepth) |
| 88 { | 87 { |
| 89 if (value.IsEmpty()) { | 88 if (value.IsEmpty()) { |
| 90 ASSERT_NOT_REACHED(); | 89 ASSERT_NOT_REACHED(); |
| 91 return 0; | 90 return 0; |
| 92 } | 91 } |
| 93 | 92 |
| 94 if (!maxDepth) | 93 if (!maxDepth) |
| 95 return 0; | 94 return 0; |
| 96 maxDepth--; | 95 maxDepth--; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 return 0; | 136 return 0; |
| 138 } | 137 } |
| 139 | 138 |
| 140 PassRefPtr<InspectorValue> ScriptValue::toInspectorValue(ScriptState* scriptStat
e) const | 139 PassRefPtr<InspectorValue> ScriptValue::toInspectorValue(ScriptState* scriptStat
e) const |
| 141 { | 140 { |
| 142 v8::HandleScope handleScope; | 141 v8::HandleScope handleScope; |
| 143 // v8::Object::GetPropertyNames() expects current context to be not null. | 142 // v8::Object::GetPropertyNames() expects current context to be not null. |
| 144 v8::Context::Scope contextScope(scriptState->context()); | 143 v8::Context::Scope contextScope(scriptState->context()); |
| 145 return v8ToInspectorValue(v8ValueRaw(), InspectorValue::maxDepth); | 144 return v8ToInspectorValue(v8ValueRaw(), InspectorValue::maxDepth); |
| 146 } | 145 } |
| 147 #endif | |
| 148 | 146 |
| 149 } // namespace WebCore | 147 } // namespace WebCore |
| OLD | NEW |