OLD | NEW |
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 "mojo/services/network/network_service_delegate.h" | 5 #include "mojo/services/network/network_service_delegate.h" |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 void NetworkServiceDelegate::Initialize(ApplicationImpl* app) { | 86 void NetworkServiceDelegate::Initialize(ApplicationImpl* app) { |
87 app_ = app; | 87 app_ = app; |
88 | 88 |
89 #if !defined(OS_ANDROID) | 89 #if !defined(OS_ANDROID) |
90 // TODO(erg): The following doesn't work when running the android | 90 // TODO(erg): The following doesn't work when running the android |
91 // apptests. It works in the mandoline shell (on desktop and on android), and | 91 // apptests. It works in the mandoline shell (on desktop and on android), and |
92 // in the apptests on desktop. However, on android, whenever we make the call | 92 // in the apptests on desktop. However, on android, whenever we make the call |
93 // to OpenFileSystem, the entire mojo system hangs to the point where writes | 93 // to OpenFileSystem, the entire mojo system hangs to the point where writes |
94 // to stderr that previously would have printed to our console aren't. The | 94 // to stderr that previously would have printed to our console aren't. The |
95 // apptests are also fairly resistant to being run under gdb on android. | 95 // apptests are also fairly resistant to being run under gdb on android. |
96 URLRequestPtr request(URLRequest::New()); | 96 app_->ConnectToService("mojo:filesystem", &files_); |
97 request->url = String::From("mojo:filesystem"); | |
98 app_->ConnectToService(request.Pass(), &files_); | |
99 | 97 |
100 filesystem::FileSystemClientPtr client; | 98 filesystem::FileSystemClientPtr client; |
101 binding_.Bind(GetProxy(&client)); | 99 binding_.Bind(GetProxy(&client)); |
102 | 100 |
103 filesystem::FileError error = filesystem::FILE_ERROR_FAILED; | 101 filesystem::FileError error = filesystem::FILE_ERROR_FAILED; |
104 filesystem::DirectoryPtr directory; | 102 filesystem::DirectoryPtr directory; |
105 files_->OpenFileSystem("origin", GetProxy(&directory), client.Pass(), | 103 files_->OpenFileSystem("origin", GetProxy(&directory), client.Pass(), |
106 Capture(&error)); | 104 Capture(&error)); |
107 files_.WaitForIncomingResponse(); | 105 files_.WaitForIncomingResponse(); |
108 | 106 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 FOR_EACH_OBSERVER(NetworkServiceDelegateObserver, observers_, | 196 FOR_EACH_OBSERVER(NetworkServiceDelegateObserver, observers_, |
199 OnIOWorkerThreadShutdown()); | 197 OnIOWorkerThreadShutdown()); |
200 | 198 |
201 // Destroy the io worker thread here so that we can commit any pending | 199 // Destroy the io worker thread here so that we can commit any pending |
202 // cookies here. | 200 // cookies here. |
203 io_worker_thread_.reset(); | 201 io_worker_thread_.reset(); |
204 } | 202 } |
205 } | 203 } |
206 | 204 |
207 } // namespace mojo | 205 } // namespace mojo |
OLD | NEW |