| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 USING_GARBAGE_COLLECTED_MIXIN(MockResourceClient); | 44 USING_GARBAGE_COLLECTED_MIXIN(MockResourceClient); |
| 45 | 45 |
| 46 public: | 46 public: |
| 47 explicit MockResourceClient(Resource*); | 47 explicit MockResourceClient(Resource*); |
| 48 ~MockResourceClient() override; | 48 ~MockResourceClient() override; |
| 49 | 49 |
| 50 void notifyFinished(Resource*) override; | 50 void notifyFinished(Resource*) override; |
| 51 String debugName() const override { return "MockResourceClient"; } | 51 String debugName() const override { return "MockResourceClient"; } |
| 52 virtual bool notifyFinishedCalled() const { return m_notifyFinishedCalled; } | 52 virtual bool notifyFinishedCalled() const { return m_notifyFinishedCalled; } |
| 53 | 53 |
| 54 size_t encodedSizeOnNotifyFinished() const { |
| 55 return m_encodedSizeOnNotifyFinished; |
| 56 } |
| 57 |
| 54 virtual void removeAsClient(); | 58 virtual void removeAsClient(); |
| 55 virtual void dispose(); | 59 virtual void dispose(); |
| 56 | 60 |
| 57 DECLARE_TRACE(); | 61 DECLARE_TRACE(); |
| 58 | 62 |
| 59 protected: | 63 protected: |
| 60 Member<Resource> m_resource; | 64 Member<Resource> m_resource; |
| 61 bool m_notifyFinishedCalled; | 65 bool m_notifyFinishedCalled; |
| 66 size_t m_encodedSizeOnNotifyFinished; |
| 62 }; | 67 }; |
| 63 | 68 |
| 64 class MockImageResourceClient final : public MockResourceClient, | 69 class MockImageResourceClient final : public MockResourceClient, |
| 65 public ImageResourceObserver { | 70 public ImageResourceObserver { |
| 66 public: | 71 public: |
| 67 explicit MockImageResourceClient(ImageResource*); | 72 explicit MockImageResourceClient(ImageResource*); |
| 68 ~MockImageResourceClient() override; | 73 ~MockImageResourceClient() override; |
| 69 | 74 |
| 70 void imageNotifyFinished(ImageResource*) override; | 75 void imageNotifyFinished(ImageResource*) override; |
| 71 void imageChanged(ImageResource*, const IntRect*) override; | 76 void imageChanged(ImageResource*, const IntRect*) override; |
| 72 | 77 |
| 73 String debugName() const override { return "MockImageResourceClient"; } | 78 String debugName() const override { return "MockImageResourceClient"; } |
| 74 | 79 |
| 75 bool notifyFinishedCalled() const override; | 80 bool notifyFinishedCalled() const override; |
| 76 | 81 |
| 77 void removeAsClient() override; | 82 void removeAsClient() override; |
| 78 void dispose() override; | 83 void dispose() override; |
| 79 | 84 |
| 80 int imageChangedCount() const { return m_imageChangedCount; } | 85 int imageChangedCount() const { return m_imageChangedCount; } |
| 81 | 86 |
| 87 size_t encodedSizeOnLastImageChanged() const { |
| 88 return m_encodedSizeOnLastImageChanged; |
| 89 } |
| 90 size_t encodedSizeOnImageNotifyFinished() const { |
| 91 return m_encodedSizeOnImageNotifyFinished; |
| 92 } |
| 93 |
| 82 private: | 94 private: |
| 83 int m_imageChangedCount; | 95 int m_imageChangedCount; |
| 96 size_t m_encodedSizeOnLastImageChanged; |
| 84 int m_imageNotifyFinishedCount; | 97 int m_imageNotifyFinishedCount; |
| 98 size_t m_encodedSizeOnImageNotifyFinished; |
| 85 }; | 99 }; |
| 86 | 100 |
| 87 } // namespace blink | 101 } // namespace blink |
| 88 | 102 |
| 89 #endif // MockResourceClients_h | 103 #endif // MockResourceClients_h |
| OLD | NEW |