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

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

Issue 1254383016: ApplicationConnection lifetime management changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 4 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
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/html_document_application_delegate.h" 5 #include "components/html_viewer/html_document_application_delegate.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "components/html_viewer/global_state.h" 9 #include "components/html_viewer/global_state.h"
10 #include "components/html_viewer/html_document_oopif.h" 10 #include "components/html_viewer/html_document_oopif.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // when we quit (the messageloop is shared among multiple 108 // when we quit (the messageloop is shared among multiple
109 // HTMLDocumentApplicationDelegates). 109 // HTMLDocumentApplicationDelegates).
110 void HTMLDocumentApplicationDelegate::OnTerminate() { 110 void HTMLDocumentApplicationDelegate::OnTerminate() {
111 delete this; 111 delete this;
112 } 112 }
113 113
114 // ApplicationDelegate; 114 // ApplicationDelegate;
115 void HTMLDocumentApplicationDelegate::Initialize(mojo::ApplicationImpl* app) { 115 void HTMLDocumentApplicationDelegate::Initialize(mojo::ApplicationImpl* app) {
116 mojo::URLRequestPtr request(mojo::URLRequest::New()); 116 mojo::URLRequestPtr request(mojo::URLRequest::New());
117 request->url = mojo::String::From("mojo:network_service"); 117 request->url = mojo::String::From("mojo:network_service");
118 mojo::ApplicationConnection* connection = 118 scoped_ptr<mojo::ApplicationConnection> connection =
119 app_.ConnectToApplication(request.Pass()); 119 app_.ConnectToApplication(request.Pass());
120 connection->ConnectToService(&network_service_); 120 connection->ConnectToService(&network_service_);
121 connection->ConnectToService(&url_loader_factory_); 121 connection->ConnectToService(&url_loader_factory_);
122 } 122 }
123 123
124 bool HTMLDocumentApplicationDelegate::ConfigureIncomingConnection( 124 bool HTMLDocumentApplicationDelegate::ConfigureIncomingConnection(
125 mojo::ApplicationConnection* connection) { 125 mojo::ApplicationConnection* connection) {
126 if (initial_response_) { 126 if (initial_response_) {
127 OnResponseReceived(mojo::URLLoaderPtr(), connection, nullptr, 127 OnResponseReceived(mojo::URLLoaderPtr(), connection, nullptr,
128 initial_response_.Pass()); 128 initial_response_.Pass());
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 documents_.insert(document); 186 documents_.insert(document);
187 } 187 }
188 188
189 if (connector_queue) { 189 if (connector_queue) {
190 connector_queue->PushRequestsTo(connection); 190 connector_queue->PushRequestsTo(connection);
191 connection->SetServiceConnector(nullptr); 191 connection->SetServiceConnector(nullptr);
192 } 192 }
193 } 193 }
194 194
195 } // namespace html_viewer 195 } // namespace html_viewer
OLDNEW
« no previous file with comments | « components/html_viewer/blink_platform_impl.cc ('k') | components/view_manager/public/cpp/lib/view_manager_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698