Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(406)

Side by Side Diff: components/font_service/public/cpp/font_service_thread.cc

Issue 2339413004: Allow Mojo structs as map keys (Closed)
Patch Set: Fix hash unit test on Windows Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | mojo/android/javatests/src/org/chromium/mojo/bindings/ValidationTest.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_service_thread.h" 5 #include "components/font_service/public/cpp/font_service_thread.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file.h" 10 #include "base/files/file.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 bool* out_valid, 117 bool* out_valid,
118 SkFontConfigInterface::FontIdentity* out_font_identity, 118 SkFontConfigInterface::FontIdentity* out_font_identity,
119 SkString* out_family_name, 119 SkString* out_family_name,
120 SkFontStyle* out_style, 120 SkFontStyle* out_style,
121 mojom::FontIdentityPtr font_identity, 121 mojom::FontIdentityPtr font_identity,
122 mojo::String family_name, 122 mojo::String family_name,
123 mojom::TypefaceStylePtr style) { 123 mojom::TypefaceStylePtr style) {
124 DCHECK_EQ(GetThreadId(), base::PlatformThread::CurrentId()); 124 DCHECK_EQ(GetThreadId(), base::PlatformThread::CurrentId());
125 pending_waitable_events_.erase(done_event); 125 pending_waitable_events_.erase(done_event);
126 126
127 *out_valid = font_identity; 127 *out_valid = !font_identity.is_null();
128 if (font_identity) { 128 if (font_identity) {
129 out_font_identity->fID = font_identity->id; 129 out_font_identity->fID = font_identity->id;
130 out_font_identity->fTTCIndex = font_identity->ttc_index; 130 out_font_identity->fTTCIndex = font_identity->ttc_index;
131 out_font_identity->fString = font_identity->str_representation.data(); 131 out_font_identity->fString = font_identity->str_representation.data();
132 // TODO(erg): fStyle isn't set. This is rather odd, however it matches the 132 // TODO(erg): fStyle isn't set. This is rather odd, however it matches the
133 // behaviour of the current Linux IPC version. 133 // behaviour of the current Linux IPC version.
134 134
135 *out_family_name = family_name.data(); 135 *out_family_name = family_name.data();
136 *out_style = SkFontStyle(style->weight, 136 *out_style = SkFontStyle(style->weight,
137 style->width, 137 style->width,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 base::Bind(&FontServiceThread::OnFontServiceConnectionError, 183 base::Bind(&FontServiceThread::OnFontServiceConnectionError,
184 weak_factory_.GetWeakPtr())); 184 weak_factory_.GetWeakPtr()));
185 } 185 }
186 186
187 void FontServiceThread::CleanUp() { 187 void FontServiceThread::CleanUp() {
188 font_service_.reset(); 188 font_service_.reset();
189 } 189 }
190 190
191 } // namespace internal 191 } // namespace internal
192 } // namespace font_service 192 } // namespace font_service
OLDNEW
« no previous file with comments | « no previous file | mojo/android/javatests/src/org/chromium/mojo/bindings/ValidationTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698