Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1931)

Unified Diff: sky/viewer/content_handler_impl.cc

Issue 780413002: Make 'reload' in skydb work again (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/viewer/content_handler_impl.cc
diff --git a/sky/viewer/content_handler_impl.cc b/sky/viewer/content_handler_impl.cc
index 63ce25c23a0944d11e2b1b6d86d0dc527dfffdcf..5bfeb732e1bb002e7a53ffb7e89164398a759c30 100644
--- a/sky/viewer/content_handler_impl.cc
+++ b/sky/viewer/content_handler_impl.cc
@@ -56,9 +56,19 @@ class SkyApplication : public mojo::Application {
private:
void OnViewDestroyed() {
--view_count_;
- if (view_count_ == 0) {
- delete this;
- }
+
+ // TODO(eseidel): We can't destroy ourselves synchronously here
Aaron Boodman 2014/12/05 23:29:50 This seems like a reasonable fix for now. I don't
+ // as we may be in the middle of a reload and doing so will cause
+ // ConnectionManager::EmbedAtView / ViewManagerServiceImpl::Init
+ // To end up sending the "AcceptConnection" to a dead SkyApplication
+ // (which will be silently ignored). This manifests as every other
+ // "reload" command in skydb tearing down SkyApplication and silently
+ // failing. Another alternative would be to post a task to check if we
+ // should delete ourselves. We should likely keep ourselves alive
+ // so long as there is an active connection instead
+ // if (view_count_ == 0) {
+ // delete this;
+ // }
}
void OnResponseReceived(mojo::URLLoaderPtr loader,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698