| 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 26 matching lines...) Expand all Loading... |
| 37 class FetchRequest; | 37 class FetchRequest; |
| 38 class ResourceFetcher; | 38 class ResourceFetcher; |
| 39 class FontPlatformData; | 39 class FontPlatformData; |
| 40 class FontCustomPlatformData; | 40 class FontCustomPlatformData; |
| 41 class FontResourceClient; | 41 class FontResourceClient; |
| 42 | 42 |
| 43 class FontResource final : public Resource { | 43 class FontResource final : public Resource { |
| 44 public: | 44 public: |
| 45 using ClientType = FontResourceClient; | 45 using ClientType = FontResourceClient; |
| 46 | 46 |
| 47 static PassRefPtrWillBeRawPtr<FontResource> fetch(FetchRequest&, ResourceFet
cher*); | 47 static RawPtr<FontResource> fetch(FetchRequest&, ResourceFetcher*); |
| 48 ~FontResource() override; | 48 ~FontResource() override; |
| 49 | 49 |
| 50 void load(ResourceFetcher*, const ResourceLoaderOptions&) override; | 50 void load(ResourceFetcher*, const ResourceLoaderOptions&) override; |
| 51 | 51 |
| 52 void didAddClient(ResourceClient*) override; | 52 void didAddClient(ResourceClient*) override; |
| 53 | 53 |
| 54 void allClientsRemoved() override; | 54 void allClientsRemoved() override; |
| 55 void beginLoadIfNeeded(ResourceFetcher* dl); | 55 void beginLoadIfNeeded(ResourceFetcher* dl); |
| 56 bool stillNeedsLoad() const override { return m_state < LoadInitiated; } | 56 bool stillNeedsLoad() const override { return m_state < LoadInitiated; } |
| 57 | 57 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 68 | 68 |
| 69 protected: | 69 protected: |
| 70 bool isSafeToUnlock() const override; | 70 bool isSafeToUnlock() const override; |
| 71 | 71 |
| 72 private: | 72 private: |
| 73 class FontResourceFactory : public ResourceFactory { | 73 class FontResourceFactory : public ResourceFactory { |
| 74 public: | 74 public: |
| 75 FontResourceFactory() | 75 FontResourceFactory() |
| 76 : ResourceFactory(Resource::Font) { } | 76 : ResourceFactory(Resource::Font) { } |
| 77 | 77 |
| 78 PassRefPtrWillBeRawPtr<Resource> create(const ResourceRequest& request,
const String& charset) const override | 78 RawPtr<Resource> create(const ResourceRequest& request, const String& ch
arset) const override |
| 79 { | 79 { |
| 80 return adoptRefWillBeNoop(new FontResource(request)); | 80 return (new FontResource(request)); |
| 81 } | 81 } |
| 82 }; | 82 }; |
| 83 FontResource(const ResourceRequest&); | 83 FontResource(const ResourceRequest&); |
| 84 | 84 |
| 85 void checkNotify() override; | 85 void checkNotify() override; |
| 86 void fontLoadShortLimitCallback(Timer<FontResource>*); | 86 void fontLoadShortLimitCallback(Timer<FontResource>*); |
| 87 void fontLoadLongLimitCallback(Timer<FontResource>*); | 87 void fontLoadLongLimitCallback(Timer<FontResource>*); |
| 88 | 88 |
| 89 enum State { Unloaded, LoadScheduled, LoadInitiated, ShortLimitExceeded, Lon
gLimitExceeded }; | 89 enum State { Unloaded, LoadScheduled, LoadInitiated, ShortLimitExceeded, Lon
gLimitExceeded }; |
| 90 | 90 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 107 ResourceClientType resourceClientType() const final { return expectedType();
} | 107 ResourceClientType resourceClientType() const final { return expectedType();
} |
| 108 virtual void fontLoaded(FontResource*) {} | 108 virtual void fontLoaded(FontResource*) {} |
| 109 virtual void didStartFontLoad(FontResource*) {} | 109 virtual void didStartFontLoad(FontResource*) {} |
| 110 virtual void fontLoadShortLimitExceeded(FontResource*) {} | 110 virtual void fontLoadShortLimitExceeded(FontResource*) {} |
| 111 virtual void fontLoadLongLimitExceeded(FontResource*) {} | 111 virtual void fontLoadLongLimitExceeded(FontResource*) {} |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 } // namespace blink | 114 } // namespace blink |
| 115 | 115 |
| 116 #endif | 116 #endif |
| OLD | NEW |