| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "platform/heap/Handle.h" | 35 #include "platform/heap/Handle.h" |
| 36 #include <memory> | 36 #include <memory> |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 class FetchRequest; | 40 class FetchRequest; |
| 41 class ResourceFetcher; | 41 class ResourceFetcher; |
| 42 class FontPlatformData; | 42 class FontPlatformData; |
| 43 class FontCustomPlatformData; | 43 class FontCustomPlatformData; |
| 44 class FontResourceClient; | 44 class FontResourceClient; |
| 45 class FontVariationSettings; |
| 45 | 46 |
| 46 class CORE_EXPORT FontResource final : public Resource { | 47 class CORE_EXPORT FontResource final : public Resource { |
| 47 public: | 48 public: |
| 48 using ClientType = FontResourceClient; | 49 using ClientType = FontResourceClient; |
| 49 | 50 |
| 50 static FontResource* fetch(FetchRequest&, ResourceFetcher*); | 51 static FontResource* fetch(FetchRequest&, ResourceFetcher*); |
| 51 ~FontResource() override; | 52 ~FontResource() override; |
| 52 | 53 |
| 53 void didAddClient(ResourceClient*) override; | 54 void didAddClient(ResourceClient*) override; |
| 54 | 55 |
| 55 void setRevalidatingRequest(const ResourceRequest&) override; | 56 void setRevalidatingRequest(const ResourceRequest&) override; |
| 56 | 57 |
| 57 void allClientsAndObserversRemoved() override; | 58 void allClientsAndObserversRemoved() override; |
| 58 void startLoadLimitTimers(); | 59 void startLoadLimitTimers(); |
| 59 | 60 |
| 60 void setCORSFailed() override { m_corsFailed = true; } | 61 void setCORSFailed() override { m_corsFailed = true; } |
| 61 bool isCORSFailed() const { return m_corsFailed; } | 62 bool isCORSFailed() const { return m_corsFailed; } |
| 62 String otsParsingMessage() const { return m_otsParsingMessage; } | 63 String otsParsingMessage() const { return m_otsParsingMessage; } |
| 63 | 64 |
| 64 bool ensureCustomFontData(); | 65 bool ensureCustomFontData(); |
| 65 FontPlatformData platformDataFromCustomData( | 66 FontPlatformData platformDataFromCustomData( |
| 66 float size, | 67 float size, |
| 67 bool bold, | 68 bool bold, |
| 68 bool italic, | 69 bool italic, |
| 69 FontOrientation = FontOrientation::Horizontal); | 70 FontOrientation = FontOrientation::Horizontal, |
| 71 FontVariationSettings* = nullptr); |
| 70 | 72 |
| 71 // Returns true if the loading priority of the remote font resource can be | 73 // Returns true if the loading priority of the remote font resource can be |
| 72 // lowered. The loading priority of the font can be lowered only if the | 74 // lowered. The loading priority of the font can be lowered only if the |
| 73 // font is not needed for painting the text. | 75 // font is not needed for painting the text. |
| 74 bool isLowPriorityLoadingAllowedForRemoteFont() const; | 76 bool isLowPriorityLoadingAllowedForRemoteFont() const; |
| 75 | 77 |
| 76 void willReloadAfterDiskCacheMiss() override; | 78 void willReloadAfterDiskCacheMiss() override; |
| 77 | 79 |
| 78 void onMemoryDump(WebMemoryDumpLevelOfDetail, | 80 void onMemoryDump(WebMemoryDumpLevelOfDetail, |
| 79 WebProcessMemoryDump*) const override; | 81 WebProcessMemoryDump*) const override; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // Only the RemoteFontFaceSources clients can prevent lowering of loading | 140 // Only the RemoteFontFaceSources clients can prevent lowering of loading |
| 139 // priority of the remote fonts. Set the default to true to prevent | 141 // priority of the remote fonts. Set the default to true to prevent |
| 140 // other clients from incorrectly returning false. | 142 // other clients from incorrectly returning false. |
| 141 return true; | 143 return true; |
| 142 } | 144 } |
| 143 }; | 145 }; |
| 144 | 146 |
| 145 } // namespace blink | 147 } // namespace blink |
| 146 | 148 |
| 147 #endif | 149 #endif |
| OLD | NEW |