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/font_service_app.h" | 5 #include "components/font_service/font_service_app.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 const mojo::Identity& identity, | 62 const mojo::Identity& identity, |
63 uint32_t id) { | 63 uint32_t id) { |
64 tracing_.Initialize(connector, identity.name()); | 64 tracing_.Initialize(connector, identity.name()); |
65 } | 65 } |
66 | 66 |
67 bool FontServiceApp::AcceptConnection(mojo::Connection* connection) { | 67 bool FontServiceApp::AcceptConnection(mojo::Connection* connection) { |
68 connection->AddInterface(this); | 68 connection->AddInterface(this); |
69 return true; | 69 return true; |
70 } | 70 } |
71 | 71 |
| 72 void FontServiceApp::ShellConnectionLost() { |
| 73 _exit(1); |
| 74 } |
| 75 |
72 void FontServiceApp::Create(mojo::Connection* connection, | 76 void FontServiceApp::Create(mojo::Connection* connection, |
73 mojo::InterfaceRequest<FontService> request) { | 77 mojo::InterfaceRequest<FontService> request) { |
74 bindings_.AddBinding(this, std::move(request)); | 78 bindings_.AddBinding(this, std::move(request)); |
75 } | 79 } |
76 | 80 |
77 void FontServiceApp::MatchFamilyName(const mojo::String& family_name, | 81 void FontServiceApp::MatchFamilyName(const mojo::String& family_name, |
78 TypefaceStyle requested_style, | 82 TypefaceStyle requested_style, |
79 const MatchFamilyNameCallback& callback) { | 83 const MatchFamilyNameCallback& callback) { |
80 SkFontConfigInterface::FontIdentity result_identity; | 84 SkFontConfigInterface::FontIdentity result_identity; |
81 SkString result_family; | 85 SkString result_family; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 int count = paths_.size(); | 122 int count = paths_.size(); |
119 for (int i = 0; i < count; ++i) { | 123 for (int i = 0; i < count; ++i) { |
120 if (path == paths_[i]) | 124 if (path == paths_[i]) |
121 return i; | 125 return i; |
122 } | 126 } |
123 paths_.emplace_back(path); | 127 paths_.emplace_back(path); |
124 return count; | 128 return count; |
125 } | 129 } |
126 | 130 |
127 } // namespace font_service | 131 } // namespace font_service |
OLD | NEW |