OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Torch Mobile, Inc. | 3 * Copyright (C) 2009 Torch Mobile, Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 if (data[0] == 'w' && data[1] == 'O' && data[2] == 'F' && data[3] == '2') | 62 if (data[0] == 'w' && data[1] == 'O' && data[2] == 'F' && data[3] == '2') |
63 return PackageFormatWOFF2; | 63 return PackageFormatWOFF2; |
64 return PackageFormatSFNT; | 64 return PackageFormatSFNT; |
65 } | 65 } |
66 | 66 |
67 static void recordPackageFormatHistogram(FontPackageFormat format) | 67 static void recordPackageFormatHistogram(FontPackageFormat format) |
68 { | 68 { |
69 Platform::current()->histogramEnumeration("WebFont.PackageFormat", format, P
ackageFormatEnumMax); | 69 Platform::current()->histogramEnumeration("WebFont.PackageFormat", format, P
ackageFormatEnumMax); |
70 } | 70 } |
71 | 71 |
72 ResourcePtr<FontResource> FontResource::fetch(FetchRequest& request, ResourceFet
cher* fetcher) | 72 PassRefPtrWillBeRawPtr<FontResource> FontResource::fetch(FetchRequest& request,
ResourceFetcher* fetcher) |
73 { | 73 { |
74 ASSERT(request.resourceRequest().frameType() == WebURLRequest::FrameTypeNone
); | 74 ASSERT(request.resourceRequest().frameType() == WebURLRequest::FrameTypeNone
); |
75 request.mutableResourceRequest().setRequestContext(WebURLRequest::RequestCon
textFont); | 75 request.mutableResourceRequest().setRequestContext(WebURLRequest::RequestCon
textFont); |
76 return toFontResource(fetcher->requestResource(request, FontResourceFactory(
))); | 76 return toFontResource(fetcher->requestResource(request, FontResourceFactory(
))); |
77 } | 77 } |
78 | 78 |
79 FontResource::FontResource(const ResourceRequest& resourceRequest) | 79 FontResource::FontResource(const ResourceRequest& resourceRequest) |
80 : Resource(resourceRequest, Font) | 80 : Resource(resourceRequest, Font) |
81 , m_state(Unloaded) | 81 , m_state(Unloaded) |
82 , m_corsFailed(false) | 82 , m_corsFailed(false) |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 void FontResource::checkNotify() | 194 void FontResource::checkNotify() |
195 { | 195 { |
196 m_fontLoadShortLimitTimer.stop(); | 196 m_fontLoadShortLimitTimer.stop(); |
197 m_fontLoadLongLimitTimer.stop(); | 197 m_fontLoadLongLimitTimer.stop(); |
198 ResourceClientWalker<FontResourceClient> w(m_clients); | 198 ResourceClientWalker<FontResourceClient> w(m_clients); |
199 while (FontResourceClient* c = w.next()) | 199 while (FontResourceClient* c = w.next()) |
200 c->fontLoaded(this); | 200 c->fontLoaded(this); |
201 } | 201 } |
202 | 202 |
203 } // namespace blink | 203 } // namespace blink |
OLD | NEW |