OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SKY_SHELL_DART_DART_LIBRARY_PROVIDER_NETWORK_H_ |
| 6 #define SKY_SHELL_DART_DART_LIBRARY_PROVIDER_NETWORK_H_ |
| 7 |
| 8 #include "mojo/services/network/public/interfaces/network_service.mojom.h" |
| 9 #include "sky/engine/tonic/dart_library_provider.h" |
| 10 #include "sky/engine/wtf/HashSet.h" |
| 11 #include "sky/engine/wtf/OwnPtr.h" |
| 12 |
| 13 namespace sky { |
| 14 namespace shell { |
| 15 |
| 16 class DartLibraryProviderNetwork : public blink::DartLibraryProvider { |
| 17 public: |
| 18 explicit DartLibraryProviderNetwork(mojo::NetworkService* network_service); |
| 19 ~DartLibraryProviderNetwork() override; |
| 20 |
| 21 mojo::NetworkService* network_service() const { return network_service_; } |
| 22 |
| 23 protected: |
| 24 // |DartLibraryProvider| implementation: |
| 25 void GetLibraryAsStream(const String& name, |
| 26 blink::DataPipeConsumerCallback callback) override; |
| 27 Dart_Handle CanonicalizeURL(Dart_Handle library, Dart_Handle url) override; |
| 28 |
| 29 private: |
| 30 class Job; |
| 31 |
| 32 mojo::NetworkService* network_service_; |
| 33 HashSet<OwnPtr<Job>> jobs_; |
| 34 |
| 35 DISALLOW_COPY_AND_ASSIGN(DartLibraryProviderNetwork); |
| 36 }; |
| 37 |
| 38 } // namespace shell |
| 39 } // namespace sky |
| 40 |
| 41 #endif // SKY_SHELL_DART_DART_LIBRARY_PROVIDER_NETWORK_H_ |
OLD | NEW |