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

Unified Diff: mojo/services/network/network_service_delegate.cc

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/services/network/network_service_delegate.h ('k') | mojo/services/network/udp_socket_apptest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/network/network_service_delegate.cc
diff --git a/mojo/services/network/network_service_delegate.cc b/mojo/services/network/network_service_delegate.cc
index ea263e5b4504f65c8efe94b2e80ffe0d816be73d..d677f01837ae24495d3770acf76ebcff7cb86dcd 100644
--- a/mojo/services/network/network_service_delegate.cc
+++ b/mojo/services/network/network_service_delegate.cc
@@ -69,7 +69,7 @@ class SQLThread : public base::Thread {
namespace mojo {
NetworkServiceDelegate::NetworkServiceDelegate()
- : app_(nullptr),
+ : shell_(nullptr),
binding_(this) {
}
@@ -86,8 +86,9 @@ void NetworkServiceDelegate::RemoveObserver(
observers_.RemoveObserver(observer);
}
-void NetworkServiceDelegate::Initialize(ApplicationImpl* app) {
- app_ = app;
+void NetworkServiceDelegate::Initialize(Shell* shell, const std::string& url,
+ uint32_t id) {
+ shell_ = shell;
#if !defined(OS_ANDROID)
// TODO(erg): The following doesn't work when running the android
@@ -96,7 +97,7 @@ void NetworkServiceDelegate::Initialize(ApplicationImpl* app) {
// to OpenFileSystem, the entire mojo system hangs to the point where writes
// to stderr that previously would have printed to our console aren't. The
// apptests are also fairly resistant to being run under gdb on android.
- app_->ConnectToService("mojo:filesystem", &files_);
+ shell_->ConnectToService("mojo:filesystem", &files_);
filesystem::FileError error = filesystem::FileError::FAILED;
filesystem::DirectoryPtr directory;
@@ -127,7 +128,7 @@ void NetworkServiceDelegate::Initialize(ApplicationImpl* app) {
worker_thread = io_worker_thread_->task_runner();
#endif
context_.reset(new NetworkContext(base_path, worker_thread, this));
- tracing_.Initialize(app);
+ tracing_.Initialize(shell_, url);
}
bool NetworkServiceDelegate::AcceptConnection(
@@ -156,30 +157,27 @@ void NetworkServiceDelegate::Quit() {
void NetworkServiceDelegate::Create(ApplicationConnection* connection,
InterfaceRequest<NetworkService> request) {
- new NetworkServiceImpl(app_->app_lifetime_helper()->CreateAppRefCount(),
- std::move(request));
+ new NetworkServiceImpl(shell_->CreateAppRefCount(), std::move(request));
}
void NetworkServiceDelegate::Create(ApplicationConnection* connection,
InterfaceRequest<CookieStore> request) {
new CookieStoreImpl(
context_.get(), GURL(connection->GetRemoteApplicationURL()).GetOrigin(),
- app_->app_lifetime_helper()->CreateAppRefCount(), std::move(request));
+ shell_->CreateAppRefCount(), std::move(request));
}
void NetworkServiceDelegate::Create(
ApplicationConnection* connection,
InterfaceRequest<WebSocketFactory> request) {
- new WebSocketFactoryImpl(context_.get(),
- app_->app_lifetime_helper()->CreateAppRefCount(),
+ new WebSocketFactoryImpl(context_.get(), shell_->CreateAppRefCount(),
std::move(request));
}
void NetworkServiceDelegate::Create(
ApplicationConnection* connection,
InterfaceRequest<URLLoaderFactory> request) {
- new URLLoaderFactoryImpl(context_.get(),
- app_->app_lifetime_helper()->CreateAppRefCount(),
+ new URLLoaderFactoryImpl(context_.get(), shell_->CreateAppRefCount(),
std::move(request));
}
« no previous file with comments | « mojo/services/network/network_service_delegate.h ('k') | mojo/services/network/udp_socket_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698