| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, packageFormatHistogram
, new EnumerationHistogram("WebFont.PackageFormat", PackageFormatEnumMax)); | 69 DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, packageFormatHistogram
, new EnumerationHistogram("WebFont.PackageFormat", PackageFormatEnumMax)); |
| 70 packageFormatHistogram.count(format); | 70 packageFormatHistogram.count(format); |
| 71 } | 71 } |
| 72 | 72 |
| 73 PassRefPtrWillBeRawPtr<FontResource> FontResource::fetch(FetchRequest& request,
ResourceFetcher* fetcher) | 73 RawPtr<FontResource> FontResource::fetch(FetchRequest& request, ResourceFetcher*
fetcher) |
| 74 { | 74 { |
| 75 ASSERT(request.resourceRequest().frameType() == WebURLRequest::FrameTypeNone
); | 75 ASSERT(request.resourceRequest().frameType() == WebURLRequest::FrameTypeNone
); |
| 76 request.mutableResourceRequest().setRequestContext(WebURLRequest::RequestCon
textFont); | 76 request.mutableResourceRequest().setRequestContext(WebURLRequest::RequestCon
textFont); |
| 77 return toFontResource(fetcher->requestResource(request, FontResourceFactory(
))); | 77 return toFontResource(fetcher->requestResource(request, FontResourceFactory(
))); |
| 78 } | 78 } |
| 79 | 79 |
| 80 FontResource::FontResource(const ResourceRequest& resourceRequest, const Resourc
eLoaderOptions& options) | 80 FontResource::FontResource(const ResourceRequest& resourceRequest, const Resourc
eLoaderOptions& options) |
| 81 : Resource(resourceRequest, Font, options) | 81 : Resource(resourceRequest, Font, options) |
| 82 , m_loadLimitState(UnderLimit) | 82 , m_loadLimitState(UnderLimit) |
| 83 , m_corsFailed(false) | 83 , m_corsFailed(false) |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 void FontResource::checkNotify() | 192 void FontResource::checkNotify() |
| 193 { | 193 { |
| 194 m_fontLoadShortLimitTimer.stop(); | 194 m_fontLoadShortLimitTimer.stop(); |
| 195 m_fontLoadLongLimitTimer.stop(); | 195 m_fontLoadLongLimitTimer.stop(); |
| 196 ResourceClientWalker<FontResourceClient> w(m_clients); | 196 ResourceClientWalker<FontResourceClient> w(m_clients); |
| 197 while (FontResourceClient* c = w.next()) | 197 while (FontResourceClient* c = w.next()) |
| 198 c->fontLoaded(this); | 198 c->fontLoaded(this); |
| 199 } | 199 } |
| 200 | 200 |
| 201 } // namespace blink | 201 } // namespace blink |
| OLD | NEW |