| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/html_viewer/content_handler_impl.h" | 5 #include "components/html_viewer/content_handler_impl.h" |
| 6 | 6 |
| 7 #include "components/html_viewer/html_document_application_delegate.h" | 7 #include "components/html_viewer/html_document_application_delegate.h" |
| 8 | 8 |
| 9 namespace html_viewer { | 9 namespace html_viewer { |
| 10 | 10 |
| 11 ContentHandlerImpl::ContentHandlerImpl( | 11 ContentHandlerImpl::ContentHandlerImpl( |
| 12 GlobalState* global_state, | 12 GlobalState* global_state, |
| 13 mojo::ApplicationImpl* app, | 13 mojo::ApplicationImpl* app, |
| 14 mojo::InterfaceRequest<mojo::ContentHandler> request) | 14 mojo::InterfaceRequest<mojo::ContentHandler> request) |
| 15 : global_state_(global_state), app_(app), binding_(this, request.Pass()) { | 15 : global_state_(global_state), |
| 16 app_(app), |
| 17 binding_(this, request.Pass()), |
| 18 app_refcount_(app_->app_lifetime_helper()->CreateAppRefCount()) { |
| 16 } | 19 } |
| 17 | 20 |
| 18 ContentHandlerImpl::~ContentHandlerImpl() { | 21 ContentHandlerImpl::~ContentHandlerImpl() { |
| 19 } | 22 } |
| 20 | 23 |
| 21 void ContentHandlerImpl::StartApplication( | 24 void ContentHandlerImpl::StartApplication( |
| 22 mojo::InterfaceRequest<mojo::Application> request, | 25 mojo::InterfaceRequest<mojo::Application> request, |
| 23 mojo::URLResponsePtr response) { | 26 mojo::URLResponsePtr response, |
| 27 const mojo::Callback<void()>& destruct_callback) { |
| 24 // HTMLDocumentApplicationDelegate deletes itself. | 28 // HTMLDocumentApplicationDelegate deletes itself. |
| 25 new HTMLDocumentApplicationDelegate( | 29 new HTMLDocumentApplicationDelegate( |
| 26 request.Pass(), response.Pass(), global_state_, | 30 request.Pass(), response.Pass(), global_state_, |
| 27 app_->app_lifetime_helper()->CreateAppRefCount()); | 31 app_->app_lifetime_helper()->CreateAppRefCount(), destruct_callback); |
| 28 } | 32 } |
| 29 | 33 |
| 30 } // namespace html_viewer | 34 } // namespace html_viewer |
| OLD | NEW |