OLD | NEW |
| (Empty) |
1 // Copyright 2016 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 BLIMP_ENGINE_BROWSER_FONT_DATA_FETCHER_IMPL_H_ | |
6 #define BLIMP_ENGINE_BROWSER_FONT_DATA_FETCHER_IMPL_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/single_thread_task_runner.h" | |
11 #include "base/threading/thread_checker.h" | |
12 #include "blimp/engine/browser/font_data_fetcher.h" | |
13 | |
14 namespace blimp { | |
15 namespace engine { | |
16 | |
17 // Implementation of fetching font data from files. File access is done on the | |
18 // file thread. | |
19 class FontDataFetcherImpl : public FontDataFetcher { | |
20 public: | |
21 // |file_task_runner|: The task runner that will process all file access. | |
22 explicit FontDataFetcherImpl( | |
23 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner); | |
24 | |
25 ~FontDataFetcherImpl() override; | |
26 | |
27 // FontDataFetcher implementation. | |
28 void FetchFontStream(const std::string& font_hash, | |
29 const FontResponseCallback& callback) const override; | |
30 | |
31 private: | |
32 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; | |
33 | |
34 base::ThreadChecker thread_checker_; | |
35 | |
36 DISALLOW_COPY_AND_ASSIGN(FontDataFetcherImpl); | |
37 }; | |
38 | |
39 } // namespace engine | |
40 } // namespace blimp | |
41 | |
42 #endif // BLIMP_ENGINE_BROWSER_FONT_DATA_FETCHER_IMPL_H_ | |
OLD | NEW |