6045 callback error

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

6045 callback error

Postby ssaraf » Fri Dec 01, 2023 1:30 am

Hi,

I am getting error calling success callback using bindonce

CefCreateClosureTask(base::BindOnce(
&Callback::Success,
callback,
responseJson
));

error1.PNG
error1.PNG (16.65 KiB) Viewed 5284 times


Can we see the sample usage of how the success callback can be called after the current changes ?
ssaraf
Techie
 
Posts: 32
Joined: Mon Nov 09, 2020 2:18 am

Re: 6045 callback error

Postby ssaraf » Tue Dec 12, 2023 5:37 am

Is there any change for this?
ssaraf
Techie
 
Posts: 32
Joined: Mon Nov 09, 2020 2:18 am

Re: 6045 callback error

Postby magreenblatt » Tue Dec 12, 2023 9:02 am

Please provide a complete code example.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: 6045 callback error

Postby ssaraf » Mon Dec 18, 2023 5:29 am

void OnSuccess(const CefRefPtr<Callback>& callback, const std::string& responseJson) noexcept {
if (CefCurrentlyOn(TID_UI)) {
return callback->Success(responseJson);
}

CefCreateClosureTask(base::BindOnce(
&Callback::Success,
callback,
responseJson
));

CefPostTask(TID_UI, task);

}
ssaraf
Techie
 
Posts: 32
Joined: Mon Nov 09, 2020 2:18 am

Re: 6045 callback error

Postby magreenblatt » Mon Dec 18, 2023 10:46 am

What is the declaration of Callback::Success? Also, |task| is an undefined variable in your code.

See https://bitbucket.org/chromiumembedded/ ... ting-tasks
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: 6045 callback error

Postby ssaraf » Tue Jan 09, 2024 3:26 am

Task is defined before, failure callback works normally without any change/error from previous versions.
Last edited by ssaraf on Sat Jan 27, 2024 9:00 am, edited 1 time in total.
ssaraf
Techie
 
Posts: 32
Joined: Mon Nov 09, 2020 2:18 am

Re: 6045 callback error

Postby magreenblatt » Tue Jan 09, 2024 9:28 am

The success callback can be called from any thread. You don't need to post it to the UI thread.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: 6045 callback error

Postby ssaraf » Wed Jan 24, 2024 12:31 am

So the issue is:
In case of failure callback this works -

void OnFailure(const CefRefPtr<Callback>& callback, const std::string& errorJson) noexcept {
constexpr int errorCode = -1;
if (CefCurrentlyOn(TID_UI)) {
return callback->Failure(errorCode, errorJson);
}

CefRefPtr<CefTask> task = CefCreateClosureTask(base::BindOnce(
&Callback::Failure,
callback,
errorCode,
errorJson
));

if (!CefPostTask(TID_UI, task)) {
ATLAS_LOG(AtlasLog::ERR) << "Unable to post failure callback task";
}
}

But for success -

void OnSuccess(const CefRefPtr<Callback>& callback, const std::string& responseJson) noexcept {
if (CefCurrentlyOn(TID_UI)) {
return callback->Success(responseJson);
}

CefRefPtr<CefTask> task = CefCreateClosureTask(base::BindOnce(
&Callback::Success,
callback,
responseJson
));

if (!CefPostTask(TID_UI, task)) {
ATLAS_LOG(AtlasLog::ERR) << "Unable to post success callback task";
}
}

I see the below errors starting v6045
img.PNG
img.PNG (16.65 KiB) Viewed 877 times
Last edited by ssaraf on Sat Jan 27, 2024 9:01 am, edited 1 time in total.
ssaraf
Techie
 
Posts: 32
Joined: Mon Nov 09, 2020 2:18 am

Re: 6045 callback error

Postby SrujanaArshanapelli » Thu Jan 25, 2024 5:33 am

Hi, we see a similar issue. How can we use success callback with UI_Thread?
SrujanaArshanapelli
Newbie
 
Posts: 4
Joined: Thu Jan 19, 2023 1:12 am

Re: 6045 callback error

Postby ssaraf » Thu Jan 25, 2024 6:48 am

magreenblatt wrote:The success callback can be called from any thread. You don't need to post it to the UI thread.


Is there a way to do it through UI thread like it was done before ? Can you give an example for success callback with UI thread ?
Last edited by ssaraf on Sat Jan 27, 2024 9:02 am, edited 1 time in total.
ssaraf
Techie
 
Posts: 32
Joined: Mon Nov 09, 2020 2:18 am

Next

Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 208 guests