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

Unified Diff: sky/shell/dart/dart_library_provider_network.h

Issue 1203143004: Make it possible to run Sky apps offline (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: gn check Created 5 years, 6 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 | « sky/shell/dart/dart_library_provider_files.cc ('k') | sky/shell/dart/dart_library_provider_network.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/shell/dart/dart_library_provider_network.h
diff --git a/sky/shell/dart/dart_library_provider_network.h b/sky/shell/dart/dart_library_provider_network.h
new file mode 100644
index 0000000000000000000000000000000000000000..b1f0add58592afe74db68c18341d78e148be5c11
--- /dev/null
+++ b/sky/shell/dart/dart_library_provider_network.h
@@ -0,0 +1,41 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SKY_SHELL_DART_DART_LIBRARY_PROVIDER_NETWORK_H_
+#define SKY_SHELL_DART_DART_LIBRARY_PROVIDER_NETWORK_H_
+
+#include "mojo/services/network/public/interfaces/network_service.mojom.h"
+#include "sky/engine/tonic/dart_library_provider.h"
+#include "sky/engine/wtf/HashSet.h"
+#include "sky/engine/wtf/OwnPtr.h"
+
+namespace sky {
+namespace shell {
+
+class DartLibraryProviderNetwork : public blink::DartLibraryProvider {
+ public:
+ explicit DartLibraryProviderNetwork(mojo::NetworkService* network_service);
+ ~DartLibraryProviderNetwork() override;
+
+ mojo::NetworkService* network_service() const { return network_service_; }
+
+ protected:
+ // |DartLibraryProvider| implementation:
+ void GetLibraryAsStream(const String& name,
+ blink::DataPipeConsumerCallback callback) override;
+ Dart_Handle CanonicalizeURL(Dart_Handle library, Dart_Handle url) override;
+
+ private:
+ class Job;
+
+ mojo::NetworkService* network_service_;
+ HashSet<OwnPtr<Job>> jobs_;
+
+ DISALLOW_COPY_AND_ASSIGN(DartLibraryProviderNetwork);
+};
+
+} // namespace shell
+} // namespace sky
+
+#endif // SKY_SHELL_DART_DART_LIBRARY_PROVIDER_NETWORK_H_
« no previous file with comments | « sky/shell/dart/dart_library_provider_files.cc ('k') | sky/shell/dart/dart_library_provider_network.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698