Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve: IsLoaded is unreliable #913

Merged
merged 2 commits into from
Apr 10, 2015

Conversation

amaitland
Copy link
Member

http://magpcss.org/ceforum/apidocs3/projects/%28default%29/CefLoadHandler.html#OnLoadStart%28CefRefPtr%3CCefBrowser%3E,CefRefPtr%3CCefFrame%3E%29

For notification of overall browser load status use OnLoadingStateChange instead.

Initially just migrating WPF control. When it's configured, update the other two flavours.

…magpcss.org/ceforum/apidocs3/projects/%28default%29/CefLoadHandler.html#OnLoadStart%28CefRefPtr%3CCefBrowser%3E,CefRefPtr%3CCefFrame%3E%29

`For notification of overall browser load status use OnLoadingStateChange instead.`

So migrating `WPF` property to `OnLoadingStateChange`
@amaitland
Copy link
Member Author

When complete this will fix #909

@rassilon
Copy link
Contributor

I can push this through WinForms separately if you like.
Looks like it might be the right thing, but I haven't done much WPF programming.

Bill

@rassilon
Copy link
Contributor

Oh, If we do this push this through, we should add a depreciated attribute to SetIsLoading or something similar.

Bill

@amaitland
Copy link
Member Author

Oh, If we do this push this through, we should add a depreciated attribute to SetIsLoading or something similar.

Hmm, yeah maybe making the IsLoadingChanged event as deprecated is the way to go for now. For WPF it makes sense to have a bind able property. For the others I think removing the event is better long term, people can still subscribe to FrameLoadStart and FrameLoadEnd which is would give the same output if absolutely nessicary. Otherwise NavStateChanged seems to be the way to go.

Looking at OnLoadStart and OnLoadEnd, I wonder if we still need the AutoLock lock_scope(_syncRoot);? I'm not actually sure what their purposes is. For all three flavors, they simply fire events, so I wouldn't have though locking was necessary.

So I think the short term question is, do we remove IsLoadingChanged from WinForms and OffScreen or mark them as deprecated?

@amaitland
Copy link
Member Author

If we remove IsLoadingChanged then NavStateChanged could be renamed to LoadingStateChanged to bring it inline with the CEF Api. Thoughts?

@amaitland amaitland added this to the 41.0.0 milestone Apr 2, 2015
@rassilon
Copy link
Contributor

rassilon commented Apr 7, 2015

I think the lock_scope(_syncRoot) bit might be trying to prevent the users event callbacks being called simultaneously on two different threads.

Well, at a minimum depreciated I think, although if you're ok with the renaming to LoadingStateChanged for 41.x that's fine by me, it certainly is a cleaner naming.

If we were going to rename in 41.x I think it would be ok to depreciate in 39.0.1 (or whatever) if we wanted.

Bill

@amaitland amaitland modified the milestones: 39.0.1, 41.0.0 Apr 7, 2015
@amaitland
Copy link
Member Author

I think the lock_scope(_syncRoot) bit might be trying to prevent the users event callbacks being called simultaneously on two different threads.

As they basically just fire events, I wonder if that's necessary? My initial though would be that locking maybe slowing things down, by how much I'm not sure.

If we were going to rename in 41.x I think it would be ok to depreciate in 39.0.1 (or whatever) if we wanted.

Sounds like a plan 👍

@rassilon
Copy link
Contributor

rassilon commented Apr 7, 2015

I don't know if the lock is necessary or not, its certainly nicer to the consumer of CefSharp if you can have the two events fire on different threads from CEF and not have to care about it at the level of CefSharp's users.

@amaitland
Copy link
Member Author

I think if we remove the call to SetIsLoading which would be part of this PR then it should be safe enough. If we change in 2272 early enough then hopefully any issues will arise before the release of 41.0.0

@amaitland
Copy link
Member Author

#931 has changes for 2272 branch.

Just a matter of making the IsLoadingChanged as deprecated.

amaitland added a commit that referenced this pull request Apr 10, 2015
@amaitland amaitland merged commit 3d98415 into cefsharp:master Apr 10, 2015
@amaitland amaitland deleted the bug/wpf-isloading branch April 10, 2015 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants