| 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 * Copyright (C) 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 v8::ScriptOrigin origin = function->GetScriptOrigin(); | 158 v8::ScriptOrigin origin = function->GetScriptOrigin(); |
| 159 if (origin.ResourceName().IsEmpty()) { | 159 if (origin.ResourceName().IsEmpty()) { |
| 160 resourceName = "undefined"; | 160 resourceName = "undefined"; |
| 161 lineNumber = 1; | 161 lineNumber = 1; |
| 162 } else { | 162 } else { |
| 163 resourceName = toWebCoreString(origin.ResourceName()); | 163 resourceName = toWebCoreString(origin.ResourceName()); |
| 164 lineNumber = function->GetScriptLineNumber() + 1; | 164 lineNumber = function->GetScriptLineNumber() + 1; |
| 165 } | 165 } |
| 166 } | 166 } |
| 167 | 167 |
| 168 static String resourceString(const v8::Handle<v8::Function> function) | |
| 169 { | |
| 170 String resourceName; | |
| 171 int lineNumber; | |
| 172 resourceInfo(function, resourceName, lineNumber); | |
| 173 | |
| 174 StringBuilder builder; | |
| 175 builder.append(resourceName); | |
| 176 builder.append(':'); | |
| 177 builder.appendNumber(lineNumber); | |
| 178 return builder.toString(); | |
| 179 } | |
| 180 | |
| 181 v8::Local<v8::Value> ScriptController::callFunction(ExecutionContext* context, v
8::Handle<v8::Function> function, v8::Handle<v8::Object> receiver, int argc, v8:
:Handle<v8::Value> args[], v8::Isolate* isolate) | 168 v8::Local<v8::Value> ScriptController::callFunction(ExecutionContext* context, v
8::Handle<v8::Function> function, v8::Handle<v8::Object> receiver, int argc, v8:
:Handle<v8::Value> args[], v8::Isolate* isolate) |
| 182 { | 169 { |
| 183 InspectorInstrumentationCookie cookie; | 170 InspectorInstrumentationCookie cookie; |
| 184 if (InspectorInstrumentation::timelineAgentEnabled(context)) { | 171 if (InspectorInstrumentation::timelineAgentEnabled(context)) { |
| 185 String resourceName; | 172 String resourceName; |
| 186 int lineNumber; | 173 int lineNumber; |
| 187 resourceInfo(function, resourceName, lineNumber); | 174 resourceInfo(function, resourceName, lineNumber); |
| 188 cookie = InspectorInstrumentation::willCallFunction(context, resourceNam
e, lineNumber); | 175 cookie = InspectorInstrumentation::willCallFunction(context, resourceNam
e, lineNumber); |
| 189 } | 176 } |
| 190 | 177 |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 v8Results = evaluateHandleScope.Close(resultArray); | 687 v8Results = evaluateHandleScope.Close(resultArray); |
| 701 } | 688 } |
| 702 | 689 |
| 703 if (results && !v8Results.IsEmpty()) { | 690 if (results && !v8Results.IsEmpty()) { |
| 704 for (size_t i = 0; i < v8Results->Length(); ++i) | 691 for (size_t i = 0; i < v8Results->Length(); ++i) |
| 705 results->append(ScriptValue(v8Results->Get(i), m_isolate)); | 692 results->append(ScriptValue(v8Results->Get(i), m_isolate)); |
| 706 } | 693 } |
| 707 } | 694 } |
| 708 | 695 |
| 709 } // namespace WebCore | 696 } // namespace WebCore |
| OLD | NEW |