| 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 #include "blimp/engine/browser/font_data_fetcher_impl.h" | |
| 6 | |
| 7 #include <memory> | |
| 8 | |
| 9 #include "base/memory/ptr_util.h" | |
| 10 #include "base/task_runner_util.h" | |
| 11 | |
| 12 namespace blimp { | |
| 13 namespace engine { | |
| 14 | |
| 15 namespace { | |
| 16 // This is a temporary implementation which return a empty SkStream. | |
| 17 std::unique_ptr<SkStream> | |
| 18 FetchFontStreamOnFileThread(const std::string& font_hash) { | |
| 19 return base::MakeUnique<SkMemoryStream>(); | |
| 20 } | |
| 21 | |
| 22 } // namespace | |
| 23 | |
| 24 FontDataFetcherImpl::FontDataFetcherImpl( | |
| 25 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner) | |
| 26 : file_task_runner_(file_task_runner) { | |
| 27 DCHECK(file_task_runner_); | |
| 28 } | |
| 29 | |
| 30 FontDataFetcherImpl::~FontDataFetcherImpl() { | |
| 31 DCHECK(thread_checker_.CalledOnValidThread()); | |
| 32 } | |
| 33 | |
| 34 void FontDataFetcherImpl::FetchFontStream( | |
| 35 const std::string& font_hash, const FontResponseCallback& callback) const { | |
| 36 DCHECK(thread_checker_.CalledOnValidThread()); | |
| 37 | |
| 38 base::PostTaskAndReplyWithResult( | |
| 39 file_task_runner_.get(), FROM_HERE, | |
| 40 base::Bind(&FetchFontStreamOnFileThread, font_hash), callback); | |
| 41 } | |
| 42 | |
| 43 } // namespace engine | |
| 44 } // namespace blimp | |
| OLD | NEW |