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

Side by Side Diff: mojo/services/launcher/launcher.cc

Issue 403573006: Mojo: Pass URLLoader to ResponseDetails as interface rather than handle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | mojo/services/public/interfaces/navigation/navigation.mojom » ('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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/compiler_specific.h" 6 #include "base/compiler_specific.h"
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/strings/string_tokenizer.h" 8 #include "base/strings/string_tokenizer.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "mojo/public/cpp/application/application_connection.h" 10 #include "mojo/public/cpp/application/application_connection.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 159
160 void LaunchInstance::OnReceivedResponse(URLResponsePtr response) { 160 void LaunchInstance::OnReceivedResponse(URLResponsePtr response) {
161 if (!response->error) { 161 if (!response->error) {
162 std::string content_type = GetContentType(response->headers); 162 std::string content_type = GetContentType(response->headers);
163 std::string handler_url = app_->GetHandlerForContentType(content_type); 163 std::string handler_url = app_->GetHandlerForContentType(content_type);
164 if (handler_url.empty()) { 164 if (handler_url.empty()) {
165 DLOG(WARNING) << "No handler for content type: " << content_type; 165 DLOG(WARNING) << "No handler for content type: " << content_type;
166 } else { 166 } else {
167 navigation::ResponseDetailsPtr nav_response( 167 navigation::ResponseDetailsPtr nav_response(
168 navigation::ResponseDetails::New()); 168 navigation::ResponseDetails::New());
169 nav_response->loader_handle = url_loader_.PassMessagePipe(); 169 nav_response->loader = url_loader_.Pass();
170 nav_response->response = response.Pass(); 170 nav_response->response = response.Pass();
171 String response_url = nav_response->response->url; 171 String response_url = nav_response->response->url;
172 callback_.Run(handler_url, response_url, nav_response.Pass()); 172 callback_.Run(handler_url, response_url, nav_response.Pass());
173 } 173 }
174 } 174 }
175 ScheduleDestroy(); 175 ScheduleDestroy();
176 } 176 }
177 177
178 } // namespace launcher 178 } // namespace launcher
179 179
180 // static 180 // static
181 ApplicationDelegate* ApplicationDelegate::Create() { 181 ApplicationDelegate* ApplicationDelegate::Create() {
182 return new launcher::LauncherApp; 182 return new launcher::LauncherApp;
183 } 183 }
184 184
185 } // namespace mojo 185 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/services/public/interfaces/navigation/navigation.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698