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

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

Issue 1231493002: mandoline filesystem: Save cookie data to the mojo:filesystem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with ToT Created 5 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 side-by-side diff with in-line comments
Download patch
Index: mojo/services/network/network_service_delegate.h
diff --git a/mojo/services/network/network_service_delegate.h b/mojo/services/network/network_service_delegate.h
index 2c1718ff7ee99e1ae5fc02401ee3b25633dc377a..1d87e3ce342be4b2b00836152e3739ab00f1332b 100644
--- a/mojo/services/network/network_service_delegate.h
+++ b/mojo/services/network/network_service_delegate.h
@@ -5,6 +5,9 @@
#ifndef MOJO_SERVICES_NETWORK_NETWORK_SERVICE_DELEGATE_H_
#define MOJO_SERVICES_NETWORK_NETWORK_SERVICE_DELEGATE_H_
+#include "base/observer_list.h"
+#include "base/threading/thread.h"
+#include "components/filesystem/public/interfaces/file_system.mojom.h"
#include "mojo/application/public/cpp/application_delegate.h"
#include "mojo/application/public/cpp/application_impl.h"
#include "mojo/application/public/cpp/interface_factory.h"
@@ -13,19 +16,35 @@
#include "mojo/services/network/public/interfaces/url_loader_factory.mojom.h"
#include "third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr.h"
+namespace sql {
+class ScopedMojoFilesystemVFS;
+}
+
+namespace mojo {
+class NetworkServiceDelegateObserver;
+
class NetworkServiceDelegate
: public mojo::ApplicationDelegate,
public mojo::InterfaceFactory<mojo::NetworkService>,
- public mojo::InterfaceFactory<mojo::URLLoaderFactory> {
+ public mojo::InterfaceFactory<mojo::URLLoaderFactory>,
+ public filesystem::FileSystemClient {
public:
NetworkServiceDelegate();
~NetworkServiceDelegate() override;
+ void AddObserver(NetworkServiceDelegateObserver* observer);
+ void RemoveObserver(NetworkServiceDelegateObserver* observer);
+
private:
+ // Notifies all of our observers of a Shuts down our IO thread. Safe to call
+ // multiple times.
+ void EnsureIOThreadShutdown();
+
// mojo::ApplicationDelegate implementation.
void Initialize(mojo::ApplicationImpl* app) override;
bool ConfigureIncomingConnection(
mojo::ApplicationConnection* connection) override;
+ bool OnShellConnectionError() override;
void Quit() override;
// mojo::InterfaceFactory<mojo::NetworkService> implementation.
@@ -36,9 +55,27 @@ class NetworkServiceDelegate
void Create(mojo::ApplicationConnection* connection,
mojo::InterfaceRequest<mojo::URLLoaderFactory> request) override;
+ // Overridden from FileSystemClient:
+ void OnFileSystemShutdown() override;
+
private:
mojo::ApplicationImpl* app_;
+
+ // Observers that want notifications that our worker thread is going away.
+ base::ObserverList<NetworkServiceDelegateObserver> observers_;
+
+ mojo::Binding<filesystem::FileSystemClient> binding_;
+
+ // A worker thread that blocks for file IO.
+ scoped_ptr<base::Thread> io_worker_thread_;
+
+ // Our connection to the filesystem service, which stores our cookies and
+ // other data.
+ filesystem::FileSystemPtr files_;
+
scoped_ptr<mojo::NetworkContext> context_;
};
+} // namespace mojo
+
#endif // MOJO_SERVICES_NETWORK_NETWORK_SERVICE_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698