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

Unified Diff: tonic/dart_library_provider_network.h

Issue 1262493002: Enable HTTP loading in Mojo dart content handler (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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
« no previous file with comments | « tonic/BUILD.gn ('k') | tonic/dart_library_provider_network.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tonic/dart_library_provider_network.h
diff --git a/tonic/dart_library_provider_network.h b/tonic/dart_library_provider_network.h
new file mode 100644
index 0000000000000000000000000000000000000000..2939f92356a763fa62c4b4e418fcdf3ce7ea15a4
--- /dev/null
+++ b/tonic/dart_library_provider_network.h
@@ -0,0 +1,39 @@
+// 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 TONIC_DART_LIBRARY_PROVIDER_NETWORK_H_
+#define TONIC_DART_LIBRARY_PROVIDER_NETWORK_H_
+
+#include <unordered_set>
+
+#include "mojo/services/network/public/interfaces/network_service.mojom.h"
+#include "tonic/dart_library_provider.h"
+
+namespace tonic {
+
+class DartLibraryProviderNetwork : public DartLibraryProvider {
+ public:
+ explicit DartLibraryProviderNetwork(mojo::NetworkService* network_service);
+ ~DartLibraryProviderNetwork() override;
+
+ mojo::NetworkService* network_service() const { return network_service_; }
+
+ protected:
+ // |DartLibraryProvider| implementation:
+ void GetLibraryAsStream(const std::string& name,
+ DataPipeConsumerCallback callback) override;
+ Dart_Handle CanonicalizeURL(Dart_Handle library, Dart_Handle url) override;
+
+ private:
+ class Job;
+
+ mojo::NetworkService* network_service_;
+ std::unordered_set<std::unique_ptr<Job>> jobs_;
+
+ DISALLOW_COPY_AND_ASSIGN(DartLibraryProviderNetwork);
+};
+
+} // namespace tonic
+
+#endif // TONIC_DART_LIBRARY_PROVIDER_NETWORK_H_
« no previous file with comments | « tonic/BUILD.gn ('k') | tonic/dart_library_provider_network.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698