CreateBrowserSync problem

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.

CreateBrowserSync problem

Postby emerick » Mon Apr 07, 2014 12:10 pm

I'm working on upgrading my WTL application from CEF1 to CEF3. Things are going great so far, but I've noticed that before my call to CreateBrowserSync returns, my application's OnIdle handler is firing. I realize that WTL is outside the scope of CEF, but would this be expected behavior? I'm concerned because I don't recall this happening when using CEF1.

I'm assuming that I will need to keep some kind of Boolean flag around to indicate when CreateBrowserSync has finished running, so that my OnIdle handler doesn't get confused (because it's currently trying to perform some browser-related actions)? If anyone has any tips on this, I'd love to hear them.

Emerick
emerick
Expert
 
Posts: 154
Joined: Sun Feb 21, 2010 7:57 pm
Location: Belmont, MA

Re: CreateBrowserSync problem

Postby magreenblatt » Mon Apr 07, 2014 3:46 pm

Are you using multi-threaded message loop mode in CEF? You might want to wait for the OnAfterCreated callback before trying to manipulate the browser.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: CreateBrowserSync problem

Postby emerick » Tue Apr 08, 2014 9:46 am

magreenblatt wrote:Are you using multi-threaded message loop mode in CEF?


No, I have multi_threaded_message_loop set to false. Is this behavior expected in that case?

magreenblatt wrote:You might want to wait for the OnAfterCreated callback before trying to manipulate the browser.


Right, that makes sense. I'm not sure how I got away without doing this when using CEF1, but this clearly seems like the correct approach.
emerick
Expert
 
Posts: 154
Joined: Sun Feb 21, 2010 7:57 pm
Location: Belmont, MA

Re: CreateBrowserSync problem

Postby magreenblatt » Tue Apr 08, 2014 9:56 am

emerick wrote:
magreenblatt wrote:Are you using multi-threaded message loop mode in CEF?

No, I have multi_threaded_message_loop set to false. Is this behavior expected in that case?

What thread is OnIdle running on? It seems strange that it would execute during the execution of CreateBrowserSync if they're running on the same thread.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: CreateBrowserSync problem

Postby emerick » Tue Apr 08, 2014 10:20 am

It's running on the main UI thread (CrBrowserMain?) I agree that it seems like it shouldn't be happening. I'm going to double-check the flow for browser creation in my app; I'm starting to suspect that I'm just doing something wrong here...
emerick
Expert
 
Posts: 154
Joined: Sun Feb 21, 2010 7:57 pm
Location: Belmont, MA

Re: CreateBrowserSync problem

Postby emerick » Wed Apr 09, 2014 8:15 pm

This turned out to be a programming error in my application. Sorry for the false alarm and thanks for the help!
emerick
Expert
 
Posts: 154
Joined: Sun Feb 21, 2010 7:57 pm
Location: Belmont, MA


Return to Support Forum

Who is online

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