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

Side by Side Diff: mojo/application/content_handler_factory.cc

Issue 1979683002: ApplicationConnection devolution, part 2.4. (Closed) Base URL: https://github.com/domokit/mojo.git@work795_app_conn_devo_2.3-x-work794_app_conn_devo_2.2
Patch Set: so much doh Created 4 years, 7 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 | « mojo/application/content_handler_factory.h ('k') | services/dart/content_handler_main.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/application/content_handler_factory.h" 5 #include "mojo/application/content_handler_factory.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 std::map<ApplicationThread*, base::PlatformThreadHandle> active_threads_; 106 std::map<ApplicationThread*, base::PlatformThreadHandle> active_threads_;
107 StrongBinding<ContentHandler> binding_; 107 StrongBinding<ContentHandler> binding_;
108 base::WeakPtrFactory<ContentHandlerImpl> weak_factory_; 108 base::WeakPtrFactory<ContentHandlerImpl> weak_factory_;
109 109
110 DISALLOW_COPY_AND_ASSIGN(ContentHandlerImpl); 110 DISALLOW_COPY_AND_ASSIGN(ContentHandlerImpl);
111 }; 111 };
112 112
113 } // namespace 113 } // namespace
114 114
115 ContentHandlerFactory::ContentHandlerFactory(Delegate* delegate) 115 ContentHandlerFactory::ContentHandlerFactory(Delegate* delegate)
116 : delegate_(delegate) { 116 : delegate_(delegate) {}
117
118 ContentHandlerFactory::~ContentHandlerFactory() {}
119
120 void ContentHandlerFactory::Create(
121 const ConnectionContext& connection_context,
122 InterfaceRequest<ContentHandler> content_handler_request) {
123 new ContentHandlerImpl(delegate_, content_handler_request.Pass());
117 } 124 }
118 125
119 ContentHandlerFactory::~ContentHandlerFactory() { 126 ServiceProviderImpl::InterfaceRequestHandler<ContentHandler>
127 ContentHandlerFactory::GetInterfaceRequestHandler() {
128 return [this](const ConnectionContext& connection_context,
129 InterfaceRequest<ContentHandler> content_handler_request) {
130 Create(connection_context, content_handler_request.Pass());
131 };
120 } 132 }
121 133
122 void ContentHandlerFactory::ManagedDelegate::RunApplication( 134 void ContentHandlerFactory::ManagedDelegate::RunApplication(
123 InterfaceRequest<Application> application_request, 135 InterfaceRequest<Application> application_request,
124 URLResponsePtr response) { 136 URLResponsePtr response) {
125 base::MessageLoop loop(common::MessagePumpMojo::Create()); 137 base::MessageLoop loop(common::MessagePumpMojo::Create());
126 auto application = 138 auto application =
127 this->CreateApplication(application_request.Pass(), response.Pass()); 139 this->CreateApplication(application_request.Pass(), response.Pass());
128 if (application) 140 if (application)
129 loop.Run(); 141 loop.Run();
130 } 142 }
131 143
132 void ContentHandlerFactory::Create(const ConnectionContext& connection_context,
133 InterfaceRequest<ContentHandler> request) {
134 new ContentHandlerImpl(delegate_, request.Pass());
135 }
136
137 } // namespace mojo 144 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/application/content_handler_factory.h ('k') | services/dart/content_handler_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698