| 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 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 class MockResourceClient : public ResourceClient { | 41 class MockResourceClient : public ResourceClient { |
| 42 public: | 42 public: |
| 43 explicit MockResourceClient(const PassRefPtrWillBeRawPtr<Resource>); | 43 explicit MockResourceClient(const PassRefPtrWillBeRawPtr<Resource>); |
| 44 ~MockResourceClient() override; | 44 ~MockResourceClient() override; |
| 45 | 45 |
| 46 void notifyFinished(Resource*) override; | 46 void notifyFinished(Resource*) override; |
| 47 String debugName() const override { return "MockResourceClient"; } | 47 String debugName() const override { return "MockResourceClient"; } |
| 48 bool notifyFinishedCalled() const { return m_notifyFinishedCalled; } | |
| 49 | 48 |
| 49 virtual bool notifyFinishedCalled() const { return m_notifyFinishedCalled; } |
| 50 virtual void removeAsClient(); | 50 virtual void removeAsClient(); |
| 51 | 51 |
| 52 protected: | 52 protected: |
| 53 // TODO(Oilpan): properly trace when ResourceClient is on the heap. | 53 // TODO(Oilpan): properly trace when ResourceClient is on the heap. |
| 54 RawPtrWillBeUntracedMember<Resource> m_resource; | 54 RawPtrWillBeUntracedMember<Resource> m_resource; |
| 55 bool m_notifyFinishedCalled; | 55 bool m_notifyFinishedCalled; |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 class MockImageResourceClient final : public MockResourceClient, public ImageRes
ourceObserver { | 58 class MockImageResourceClient final : public MockResourceClient, public ImageRes
ourceObserver { |
| 59 public: | 59 public: |
| 60 explicit MockImageResourceClient(const PassRefPtrWillBeRawPtr<ImageResource>
); | 60 explicit MockImageResourceClient(const PassRefPtrWillBeRawPtr<ImageResource>
); |
| 61 ~MockImageResourceClient() override; | 61 ~MockImageResourceClient() override; |
| 62 | 62 |
| 63 void imageChanged(ImageResource*, const IntRect*) override; | 63 void imageChanged(bool isNotifyingFinish, ImageResource*, const IntRect*) ov
erride; |
| 64 | 64 |
| 65 String debugName() const override { return "MockImageResourceClient"; } | 65 String debugName() const override { return "MockImageResourceClient"; } |
| 66 | 66 |
| 67 bool notifyFinishedCalled() const override; |
| 68 |
| 67 void removeAsClient() override; | 69 void removeAsClient() override; |
| 68 | 70 |
| 69 int imageChangedCount() const { return m_imageChangedCount; } | 71 int imageChangedCount() const { return m_imageChangedCount; } |
| 70 | 72 |
| 71 private: | 73 private: |
| 72 int m_imageChangedCount; | 74 int m_imageChangedCount; |
| 75 int m_imageChangedNotifyingFinishCount; |
| 73 }; | 76 }; |
| 74 | 77 |
| 75 } // namespace blink | 78 } // namespace blink |
| 76 | 79 |
| 77 #endif // MockResourceClients_h | 80 #endif // MockResourceClients_h |
| OLD | NEW |