| 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/application_impl.h" | 12 #include "mojo/shell/public/cpp/application_impl.h" |
| 13 #include "mojo/shell/public/cpp/connect.h" | 13 #include "mojo/shell/public/cpp/connect.h" |
| 14 #include "mojo/shell/public/interfaces/shell.mojom.h" | 14 #include "mojo/shell/public/interfaces/shell.mojom.h" |
| 15 | 15 |
| 16 namespace font_service { | 16 namespace font_service { |
| 17 namespace { | 17 namespace { |
| 18 void OnGotRemoteIDs(uint32_t instance_id, uint32_t content_handler_id) {} | 18 void OnGotRemoteIDs(uint32_t instance_id, uint32_t content_handler_id) {} |
| 19 } // namespace | 19 } // namespace |
| 20 | 20 |
| 21 FontLoader::FontLoader(mojo::Shell* shell) { | 21 FontLoader::FontLoader(mojo::shell::mojom::Shell* shell) { |
| 22 mojo::ServiceProviderPtr font_service_provider; | 22 mojo::ServiceProviderPtr font_service_provider; |
| 23 mojo::URLRequestPtr request(mojo::URLRequest::New()); | 23 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
| 24 request->url = mojo::String::From("mojo:font_service"); | 24 request->url = mojo::String::From("mojo:font_service"); |
| 25 FontServicePtr font_service; | 25 FontServicePtr font_service; |
| 26 shell->ConnectToApplication(std::move(request), | 26 shell->ConnectToApplication(std::move(request), |
| 27 GetProxy(&font_service_provider), nullptr, | 27 GetProxy(&font_service_provider), nullptr, |
| 28 mojo::CreatePermissiveCapabilityFilter(), | 28 mojo::CreatePermissiveCapabilityFilter(), |
| 29 base::Bind(&OnGotRemoteIDs)); | 29 base::Bind(&OnGotRemoteIDs)); |
| 30 mojo::ConnectToService(font_service_provider.get(), &font_service); | 30 mojo::ConnectToService(font_service_provider.get(), &font_service); |
| 31 | 31 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 } | 87 } |
| 88 | 88 |
| 89 void FontLoader::OnMappedFontFileDestroyed(internal::MappedFontFile* f) { | 89 void FontLoader::OnMappedFontFileDestroyed(internal::MappedFontFile* f) { |
| 90 TRACE_EVENT1("font_loader", "FontLoader::OnMappedFontFileDestroyed", | 90 TRACE_EVENT1("font_loader", "FontLoader::OnMappedFontFileDestroyed", |
| 91 "identity", f->font_id()); | 91 "identity", f->font_id()); |
| 92 base::AutoLock lock(lock_); | 92 base::AutoLock lock(lock_); |
| 93 mapped_font_files_.erase(f->font_id()); | 93 mapped_font_files_.erase(f->font_id()); |
| 94 } | 94 } |
| 95 | 95 |
| 96 } // namespace font_service | 96 } // namespace font_service |
| OLD | NEW |