You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CefSharp.Core.Runtime/Internals/JavascriptCallbackProxy.cpp
+17-16Lines changed: 17 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -27,30 +27,31 @@ namespace CefSharp
27
27
auto browser = GetBrowser();
28
28
if (browser == nullptr)
29
29
{
30
-
throwgcnew InvalidOperationException("Browser instance is null. Check CanExecute before calling this method.");
30
+
return Task::FromException<JavascriptResponse^>(gcnew InvalidOperationException("Browser instance is null. Check CanExecute before calling this method."));
31
31
}
32
32
33
33
auto browserWrapper = static_cast<CefBrowserWrapper^>(browser);
34
-
auto javascriptNameConverter = GetJavascriptNameConverter();
35
-
36
-
auto doneCallback = _pendingTasks->CreateJavascriptCallbackPendingTask(_callback->Id, timeout);
37
-
38
-
auto callbackMessage = CefProcessMessage::Create(kJavascriptCallbackRequest);
39
-
auto argList = callbackMessage->GetArgumentList();
40
-
SetInt64(argList, 0, doneCallback.Key);
41
-
SetInt64(argList, 1, _callback->Id);
42
-
auto paramList = CefListValue::Create();
43
-
for (int i = 0; i < parameters->Length; i++)
44
-
{
45
-
auto param = parameters[i];
46
-
SerializeV8Object(paramList, i, param, javascriptNameConverter);
47
-
}
48
-
argList->SetList(2, paramList);
49
34
50
35
auto frame = browserWrapper->Browser->GetFrameByIdentifier(StringUtils::ToNative(_callback->FrameId));
51
36
52
37
if (frame.get() && frame->IsValid())
53
38
{
39
+
auto javascriptNameConverter = GetJavascriptNameConverter();
40
+
41
+
auto doneCallback = _pendingTasks->CreateJavascriptCallbackPendingTask(_callback->FrameId, _callback->Id, timeout);
42
+
43
+
auto callbackMessage = CefProcessMessage::Create(kJavascriptCallbackRequest);
44
+
auto argList = callbackMessage->GetArgumentList();
45
+
SetInt64(argList, 0, doneCallback.Key);
46
+
SetInt64(argList, 1, _callback->Id);
47
+
auto paramList = CefListValue::Create();
48
+
for (int i = 0; i < parameters->Length; i++)
49
+
{
50
+
auto param = parameters[i];
51
+
SerializeV8Object(paramList, i, param, javascriptNameConverter);
0 commit comments