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

Side by Side Diff: mojo/shell/network_service_loader.cc

Issue 423963004: First cut at "content handling" support in Mojo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use URLResponse with ContentHandler interface instead of data pipe Created 6 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 | Annotate | Revision Log
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/shell/network_service_loader.h" 5 #include "mojo/shell/network_service_loader.h"
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "mojo/public/cpp/application/application_connection.h" 10 #include "mojo/public/cpp/application/application_connection.h"
(...skipping 14 matching lines...) Expand all
25 25
26 NetworkServiceLoader::NetworkServiceLoader() { 26 NetworkServiceLoader::NetworkServiceLoader() {
27 } 27 }
28 28
29 NetworkServiceLoader::~NetworkServiceLoader() { 29 NetworkServiceLoader::~NetworkServiceLoader() {
30 } 30 }
31 31
32 void NetworkServiceLoader::LoadService( 32 void NetworkServiceLoader::LoadService(
33 ServiceManager* manager, 33 ServiceManager* manager,
34 const GURL& url, 34 const GURL& url,
35 ScopedMessagePipeHandle shell_handle) { 35 scoped_refptr<LoadServiceCallbacks> callbacks) {
36 ScopedMessagePipeHandle shell_handle = callbacks->RegisterApplication();
37 if (!shell_handle.is_valid()) {
DaveMoore 2014/08/04 21:50:52 Nit: no braces
Aaron Boodman 2014/08/05 05:44:55 Done.
38 return;
39 }
40
36 uintptr_t key = reinterpret_cast<uintptr_t>(manager); 41 uintptr_t key = reinterpret_cast<uintptr_t>(manager);
37 if (apps_.find(key) == apps_.end()) { 42 if (apps_.find(key) == apps_.end()) {
38 scoped_ptr<ApplicationImpl> app( 43 scoped_ptr<ApplicationImpl> app(
39 new ApplicationImpl(this, shell_handle.Pass())); 44 new ApplicationImpl(this, shell_handle.Pass()));
40 apps_.add(key, app.Pass()); 45 apps_.add(key, app.Pass());
41 } 46 }
42 } 47 }
43 48
44 void NetworkServiceLoader::OnServiceError(ServiceManager* manager, 49 void NetworkServiceLoader::OnServiceError(ServiceManager* manager,
45 const GURL& url) { 50 const GURL& url) {
(...skipping 11 matching lines...) Expand all
57 return true; 62 return true;
58 } 63 }
59 64
60 void NetworkServiceLoader::Create(ApplicationConnection* connection, 65 void NetworkServiceLoader::Create(ApplicationConnection* connection,
61 InterfaceRequest<NetworkService> request) { 66 InterfaceRequest<NetworkService> request) {
62 BindToRequest(new NetworkServiceImpl(connection, context_.get()), &request); 67 BindToRequest(new NetworkServiceImpl(connection, context_.get()), &request);
63 } 68 }
64 69
65 } // namespace shell 70 } // namespace shell
66 } // namespace mojo 71 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698