| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 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 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 } | 933 } |
| 934 ASSERT_NOT_REACHED(); | 934 ASSERT_NOT_REACHED(); |
| 935 return nullptr; | 935 return nullptr; |
| 936 } | 936 } |
| 937 | 937 |
| 938 void DevToolsFunctionInfo::ensureInitialized() const | 938 void DevToolsFunctionInfo::ensureInitialized() const |
| 939 { | 939 { |
| 940 if (m_function.IsEmpty()) | 940 if (m_function.IsEmpty()) |
| 941 return; | 941 return; |
| 942 | 942 |
| 943 v8::HandleScope scope(m_function->GetIsolate()); |
| 943 v8::Local<v8::Function> originalFunction = getBoundFunction(m_function); | 944 v8::Local<v8::Function> originalFunction = getBoundFunction(m_function); |
| 944 m_scriptId = originalFunction->ScriptId(); | 945 m_scriptId = originalFunction->ScriptId(); |
| 945 v8::ScriptOrigin origin = originalFunction->GetScriptOrigin(); | 946 v8::ScriptOrigin origin = originalFunction->GetScriptOrigin(); |
| 946 if (!origin.ResourceName().IsEmpty()) { | 947 if (!origin.ResourceName().IsEmpty()) { |
| 947 V8StringResource<> stringResource(origin.ResourceName()); | 948 V8StringResource<> stringResource(origin.ResourceName()); |
| 948 stringResource.prepare(); | 949 stringResource.prepare(); |
| 949 m_resourceName = stringResource; | 950 m_resourceName = stringResource; |
| 950 m_lineNumber = originalFunction->GetScriptLineNumber() + 1; | 951 m_lineNumber = originalFunction->GetScriptLineNumber() + 1; |
| 951 } | 952 } |
| 952 if (m_resourceName.isEmpty()) { | 953 if (m_resourceName.isEmpty()) { |
| 953 m_resourceName = "undefined"; | 954 m_resourceName = ""; |
| 954 m_lineNumber = 1; | 955 m_lineNumber = 1; |
| 955 } | 956 } |
| 956 | 957 |
| 957 m_function.Clear(); | 958 m_function.Clear(); |
| 958 } | 959 } |
| 959 | 960 |
| 960 int DevToolsFunctionInfo::scriptId() const | 961 int DevToolsFunctionInfo::scriptId() const |
| 961 { | 962 { |
| 962 ensureInitialized(); | 963 ensureInitialized(); |
| 963 return m_scriptId; | 964 return m_scriptId; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 987 v8::Local<v8::Value> data = info.Data(); | 988 v8::Local<v8::Value> data = info.Data(); |
| 988 ASSERT(data->IsExternal()); | 989 ASSERT(data->IsExternal()); |
| 989 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre
ationContext()); | 990 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre
ationContext()); |
| 990 if (!perContextData) | 991 if (!perContextData) |
| 991 return; | 992 return; |
| 992 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u
nwrap(data))); | 993 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u
nwrap(data))); |
| 993 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 994 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 994 } | 995 } |
| 995 | 996 |
| 996 } // namespace blink | 997 } // namespace blink |
| OLD | NEW |