| 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; } | 48     virtual bool notifyFinishedCalled() const { return m_notifyFinishedCalled; } | 
| 49 | 49 | 
| 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 imageNotifyFinished(ImageResource*) override; | 
| 63     void imageChanged(ImageResource*, const IntRect*) override; | 64     void imageChanged(ImageResource*, const IntRect*) override; | 
| 64 | 65 | 
| 65     String debugName() const override { return "MockImageResourceClient"; } | 66     String debugName() const override { return "MockImageResourceClient"; } | 
| 66 | 67 | 
|  | 68     bool notifyFinishedCalled() const override; | 
|  | 69 | 
| 67     void removeAsClient() override; | 70     void removeAsClient() override; | 
| 68 | 71 | 
| 69     int imageChangedCount() const { return m_imageChangedCount; } | 72     int imageChangedCount() const { return m_imageChangedCount; } | 
| 70 | 73 | 
| 71 private: | 74 private: | 
| 72     int m_imageChangedCount; | 75     int m_imageChangedCount; | 
|  | 76     int m_imageNotifyFinishedCount; | 
| 73 }; | 77 }; | 
| 74 | 78 | 
| 75 } // namespace blink | 79 } // namespace blink | 
| 76 | 80 | 
| 77 #endif // MockResourceClients_h | 81 #endif // MockResourceClients_h | 
| OLD | NEW | 
|---|