| 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 #include "components/font_service/public/cpp/font_loader.h" | 5 #include "components/font_service/public/cpp/font_loader.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| 11 #include "components/font_service/public/cpp/font_service_thread.h" | 11 #include "components/font_service/public/cpp/font_service_thread.h" |
| 12 #include "mojo/shell/public/cpp/connector.h" | 12 #include "services/shell/public/cpp/connector.h" |
| 13 | 13 |
| 14 namespace font_service { | 14 namespace font_service { |
| 15 | 15 |
| 16 FontLoader::FontLoader(mojo::Connector* connector) { | 16 FontLoader::FontLoader(mojo::Connector* connector) { |
| 17 FontServicePtr font_service; | 17 FontServicePtr font_service; |
| 18 connector->ConnectToInterface("mojo:font_service", &font_service); | 18 connector->ConnectToInterface("mojo:font_service", &font_service); |
| 19 thread_ = new internal::FontServiceThread(std::move(font_service)); | 19 thread_ = new internal::FontServiceThread(std::move(font_service)); |
| 20 } | 20 } |
| 21 | 21 |
| 22 FontLoader::~FontLoader() {} | 22 FontLoader::~FontLoader() {} |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 } | 67 } |
| 68 | 68 |
| 69 void FontLoader::OnMappedFontFileDestroyed(internal::MappedFontFile* f) { | 69 void FontLoader::OnMappedFontFileDestroyed(internal::MappedFontFile* f) { |
| 70 TRACE_EVENT1("font_loader", "FontLoader::OnMappedFontFileDestroyed", | 70 TRACE_EVENT1("font_loader", "FontLoader::OnMappedFontFileDestroyed", |
| 71 "identity", f->font_id()); | 71 "identity", f->font_id()); |
| 72 base::AutoLock lock(lock_); | 72 base::AutoLock lock(lock_); |
| 73 mapped_font_files_.erase(f->font_id()); | 73 mapped_font_files_.erase(f->font_id()); |
| 74 } | 74 } |
| 75 | 75 |
| 76 } // namespace font_service | 76 } // namespace font_service |
| OLD | NEW |