OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 return nullptr; | 93 return nullptr; |
94 DCHECK(value->IsFunction()); | 94 DCHECK(value->IsFunction()); |
95 v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast(value); | 95 v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast(value); |
96 v8::Local<v8::Object> windowGlobal = context->Global(); | 96 v8::Local<v8::Object> windowGlobal = context->Global(); |
97 v8::Local<v8::Value> info[] = { | 97 v8::Local<v8::Value> info[] = { |
98 scriptHostWrapper, windowGlobal, | 98 scriptHostWrapper, windowGlobal, |
99 v8::Number::New(isolate, inspectedContext->contextId())}; | 99 v8::Number::New(isolate, inspectedContext->contextId())}; |
100 v8::MicrotasksScope microtasksScope(isolate, | 100 v8::MicrotasksScope microtasksScope(isolate, |
101 v8::MicrotasksScope::kDoNotRunMicrotasks); | 101 v8::MicrotasksScope::kDoNotRunMicrotasks); |
102 v8::Local<v8::Value> injectedScriptValue; | 102 v8::Local<v8::Value> injectedScriptValue; |
103 if (!function | 103 if (!function->Call(context, windowGlobal, arraysize(info), info) |
104 ->Call(context, windowGlobal, V8_INSPECTOR_ARRAY_LENGTH(info), info) | |
105 .ToLocal(&injectedScriptValue)) | 104 .ToLocal(&injectedScriptValue)) |
106 return nullptr; | 105 return nullptr; |
107 if (!injectedScriptValue->IsObject()) return nullptr; | 106 if (!injectedScriptValue->IsObject()) return nullptr; |
108 return wrapUnique(new InjectedScript(inspectedContext, | 107 return wrapUnique(new InjectedScript(inspectedContext, |
109 injectedScriptValue.As<v8::Object>(), | 108 injectedScriptValue.As<v8::Object>(), |
110 std::move(injectedScriptNative))); | 109 std::move(injectedScriptNative))); |
111 } | 110 } |
112 | 111 |
113 InjectedScript::InjectedScript( | 112 InjectedScript::InjectedScript( |
114 InspectedContext* context, v8::Local<v8::Object> object, | 113 InspectedContext* context, v8::Local<v8::Object> object, |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 void InjectedScript::CallFrameScope::findInjectedScript( | 561 void InjectedScript::CallFrameScope::findInjectedScript( |
563 V8InspectorSessionImpl* session) { | 562 V8InspectorSessionImpl* session) { |
564 std::unique_ptr<RemoteCallFrameId> remoteId = | 563 std::unique_ptr<RemoteCallFrameId> remoteId = |
565 RemoteCallFrameId::parse(m_errorString, m_remoteCallFrameId); | 564 RemoteCallFrameId::parse(m_errorString, m_remoteCallFrameId); |
566 if (!remoteId) return; | 565 if (!remoteId) return; |
567 m_frameOrdinal = static_cast<size_t>(remoteId->frameOrdinal()); | 566 m_frameOrdinal = static_cast<size_t>(remoteId->frameOrdinal()); |
568 m_injectedScript = session->findInjectedScript(m_errorString, remoteId.get()); | 567 m_injectedScript = session->findInjectedScript(m_errorString, remoteId.get()); |
569 } | 568 } |
570 | 569 |
571 } // namespace v8_inspector | 570 } // namespace v8_inspector |
OLD | NEW |