| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SKY_SHELL_DART_DART_LIBRARY_PROVIDER_FILES_H_ | 5 #ifndef SKY_SHELL_DART_DART_LIBRARY_PROVIDER_FILES_H_ |
| 6 #define SKY_SHELL_DART_DART_LIBRARY_PROVIDER_FILES_H_ | 6 #define SKY_SHELL_DART_DART_LIBRARY_PROVIDER_FILES_H_ |
| 7 | 7 |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "sky/engine/tonic/dart_library_provider.h" | 9 #include "sky/engine/tonic/dart_library_provider.h" |
| 10 | 10 |
| 11 namespace sky { | 11 namespace sky { |
| 12 namespace shell { | 12 namespace shell { |
| 13 | 13 |
| 14 class DartLibraryProviderFiles : public blink::DartLibraryProvider { | 14 class DartLibraryProviderFiles : public blink::DartLibraryProvider { |
| 15 public: | 15 public: |
| 16 explicit DartLibraryProviderFiles(const base::FilePath& package_root); | 16 explicit DartLibraryProviderFiles(const base::FilePath& package_root); |
| 17 ~DartLibraryProviderFiles() override; | 17 ~DartLibraryProviderFiles() override; |
| 18 | 18 |
| 19 protected: | 19 protected: |
| 20 // |DartLibraryProvider| implementation: | 20 // |DartLibraryProvider| implementation: |
| 21 void GetLibraryAsStream(const String& name, | 21 void GetLibraryAsStream(const std::string& name, |
| 22 blink::DataPipeConsumerCallback callback) override; | 22 blink::DataPipeConsumerCallback callback) override; |
| 23 Dart_Handle CanonicalizeURL(Dart_Handle library, Dart_Handle url) override; | 23 Dart_Handle CanonicalizeURL(Dart_Handle library, Dart_Handle url) override; |
| 24 | 24 |
| 25 private: | 25 private: |
| 26 std::string CanonicalizePackageURL(std::string url); | 26 std::string CanonicalizePackageURL(std::string url); |
| 27 | 27 |
| 28 base::FilePath package_root_; | 28 base::FilePath package_root_; |
| 29 | 29 |
| 30 DISALLOW_COPY_AND_ASSIGN(DartLibraryProviderFiles); | 30 DISALLOW_COPY_AND_ASSIGN(DartLibraryProviderFiles); |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 } // namespace shell | 33 } // namespace shell |
| 34 } // namespace sky | 34 } // namespace sky |
| 35 | 35 |
| 36 #endif // SKY_SHELL_DART_DART_LIBRARY_PROVIDER_FILES_H_ | 36 #endif // SKY_SHELL_DART_DART_LIBRARY_PROVIDER_FILES_H_ |
| OLD | NEW |