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

Side by Side Diff: components/html_viewer/content_handler_impl.cc

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 years, 10 months 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 unified diff | Download patch
« no previous file with comments | « components/html_viewer/content_handler_impl.h ('k') | components/html_viewer/global_state.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <utility> 7 #include <utility>
8 8
9 #include "components/html_viewer/html_document_application_delegate.h" 9 #include "components/html_viewer/html_document_application_delegate.h"
10 10
11 namespace html_viewer { 11 namespace html_viewer {
12 12
13 ContentHandlerImpl::ContentHandlerImpl( 13 ContentHandlerImpl::ContentHandlerImpl(
14 GlobalState* global_state, 14 GlobalState* global_state,
15 mojo::ApplicationImpl* app, 15 mojo::Shell* shell,
16 mojo::InterfaceRequest<mojo::shell::mojom::ContentHandler> request) 16 mojo::InterfaceRequest<mojo::shell::mojom::ContentHandler> request)
17 : global_state_(global_state), 17 : global_state_(global_state),
18 app_(app), 18 shell_(shell),
19 binding_(this, std::move(request)), 19 binding_(this, std::move(request)),
20 app_refcount_(app_->app_lifetime_helper()->CreateAppRefCount()) {} 20 app_refcount_(shell_->CreateAppRefCount()) {}
21 21
22 ContentHandlerImpl::~ContentHandlerImpl() { 22 ContentHandlerImpl::~ContentHandlerImpl() {
23 } 23 }
24 24
25 void ContentHandlerImpl::StartApplication( 25 void ContentHandlerImpl::StartApplication(
26 mojo::ApplicationRequest request, 26 mojo::ApplicationRequest request,
27 mojo::URLResponsePtr response, 27 mojo::URLResponsePtr response,
28 const mojo::Callback<void()>& destruct_callback) { 28 const mojo::Callback<void()>& destruct_callback) {
29 // HTMLDocumentApplicationDelegate deletes itself. 29 // HTMLDocumentApplicationDelegate deletes itself.
30 new HTMLDocumentApplicationDelegate( 30 new HTMLDocumentApplicationDelegate(
31 std::move(request), std::move(response), global_state_, 31 std::move(request), std::move(response), global_state_,
32 app_->app_lifetime_helper()->CreateAppRefCount(), destruct_callback); 32 shell_->CreateAppRefCount(), destruct_callback);
33 } 33 }
34 34
35 } // namespace html_viewer 35 } // namespace html_viewer
OLDNEW
« no previous file with comments | « components/html_viewer/content_handler_impl.h ('k') | components/html_viewer/global_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698