OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 from api_data_source import APIDataSource | 5 from api_data_source import APIDataSource |
6 from api_list_data_source import APIListDataSource | 6 from api_list_data_source import APIListDataSource |
7 from compiled_file_system import CompiledFileSystem | 7 from compiled_file_system import CompiledFileSystem |
8 from content_providers import ContentProviders | 8 from content_providers import ContentProviders |
9 from document_renderer import DocumentRenderer | 9 from document_renderer import DocumentRenderer |
10 from empty_dir_file_system import EmptyDirFileSystem | 10 from empty_dir_file_system import EmptyDirFileSystem |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 self.host_file_system_iterator = HostFileSystemIterator( | 67 self.host_file_system_iterator = HostFileSystemIterator( |
68 host_file_system_provider, | 68 host_file_system_provider, |
69 branch_utility) | 69 branch_utility) |
70 | 70 |
71 self.platform_bundle = PlatformBundle( | 71 self.platform_bundle = PlatformBundle( |
72 branch_utility, | 72 branch_utility, |
73 self.compiled_fs_factory, | 73 self.compiled_fs_factory, |
74 host_fs_at_trunk, | 74 host_fs_at_trunk, |
75 self.host_file_system_iterator, | 75 self.host_file_system_iterator, |
76 self.object_store_creator) | 76 self.object_store_creator, |
77 | 77 self.base_path) |
78 # Note: samples are super slow in the dev server because it doesn't support | |
79 # async fetch, so disable them. | |
80 if IsDevServer(): | |
81 extension_samples_fs = EmptyDirFileSystem() | |
82 app_samples_fs = EmptyDirFileSystem() | |
83 else: | |
84 extension_samples_fs = host_fs_at_trunk | |
85 # TODO(kalman): Re-enable the apps samples, see http://crbug.com/344097. | |
86 app_samples_fs = EmptyDirFileSystem() | |
87 #app_samples_fs = github_file_system_provider.Create( | |
88 # 'GoogleChrome', 'chrome-app-samples') | |
89 self.samples_data_source_factory = SamplesDataSource.Factory( | |
90 extension_samples_fs, | |
91 app_samples_fs, | |
92 CompiledFileSystem.Factory(object_store_creator), | |
93 self.platform_bundle, | |
94 base_path) | |
95 | 78 |
96 self.content_providers = ContentProviders( | 79 self.content_providers = ContentProviders( |
97 object_store_creator, | 80 object_store_creator, |
98 self.compiled_fs_factory, | 81 self.compiled_fs_factory, |
99 host_fs_at_trunk, | 82 host_fs_at_trunk, |
100 self.github_file_system_provider, | 83 self.github_file_system_provider, |
101 self.gcs_file_system_provider) | 84 self.gcs_file_system_provider) |
102 | 85 |
103 # TODO(kalman): Move all the remaining DataSources into DataSourceRegistry, | 86 # TODO(kalman): Move all the remaining DataSources into DataSourceRegistry, |
104 # then factor out the DataSource creation into a factory method, so that | 87 # then factor out the DataSource creation into a factory method, so that |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 store_type=TestObjectStore) | 124 store_type=TestObjectStore) |
142 host_file_system_provider = HostFileSystemProvider.ForLocal( | 125 host_file_system_provider = HostFileSystemProvider.ForLocal( |
143 object_store_creator) | 126 object_store_creator) |
144 return ServerInstance( | 127 return ServerInstance( |
145 object_store_creator, | 128 object_store_creator, |
146 CompiledFileSystem.Factory(object_store_creator), | 129 CompiledFileSystem.Factory(object_store_creator), |
147 TestBranchUtility.CreateWithCannedData(), | 130 TestBranchUtility.CreateWithCannedData(), |
148 host_file_system_provider, | 131 host_file_system_provider, |
149 GithubFileSystemProvider.ForEmpty(), | 132 GithubFileSystemProvider.ForEmpty(), |
150 CloudStorageFileSystemProvider(object_store_creator)) | 133 CloudStorageFileSystemProvider(object_store_creator)) |
OLD | NEW |