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

Unified Diff: sky/viewer/content_handler_impl.cc

Issue 783973002: Remove shutdown code from sky. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review 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 | sky/viewer/document_view.h » ('j') | 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..69768da1637354977e14c7d55092463989a5aa28 100644
--- a/sky/viewer/content_handler_impl.cc
+++ b/sky/viewer/content_handler_impl.cc
@@ -17,8 +17,7 @@ class SkyApplication : public mojo::Application {
mojo::URLResponsePtr response)
: url_(response->url),
shell_(shell.Pass()),
- initial_response_(response.Pass()),
- view_count_(0) {
+ initial_response_(response.Pass()) {
shell_.set_client(this);
mojo::ServiceProviderPtr service_provider;
shell_->ConnectToApplication("mojo:network_service",
@@ -30,7 +29,6 @@ class SkyApplication : public mojo::Application {
void AcceptConnection(const mojo::String& requestor_url,
mojo::ServiceProviderPtr provider) override {
- ++view_count_;
if (initial_response_) {
OnResponseReceived(mojo::URLLoaderPtr(), provider.Pass(),
initial_response_.Pass());
@@ -54,26 +52,16 @@ class SkyApplication : public mojo::Application {
}
private:
- void OnViewDestroyed() {
- --view_count_;
- if (view_count_ == 0) {
- delete this;
- }
- }
-
void OnResponseReceived(mojo::URLLoaderPtr loader,
mojo::ServiceProviderPtr provider,
mojo::URLResponsePtr response) {
- new DocumentView(
- base::Bind(&SkyApplication::OnViewDestroyed, base::Unretained(this)),
- provider.Pass(), response.Pass(), shell_.get());
+ new DocumentView(provider.Pass(), response.Pass(), shell_.get());
}
mojo::String url_;
mojo::ShellPtr shell_;
mojo::NetworkServicePtr network_service_;
mojo::URLResponsePtr initial_response_;
- uint32_t view_count_;
};
ContentHandlerImpl::ContentHandlerImpl() {
« no previous file with comments | « no previous file | sky/viewer/document_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698