| 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 21 matching lines...) Expand all Loading... |
| 32 #define MockImageResourceClient_h | 32 #define MockImageResourceClient_h |
| 33 | 33 |
| 34 #include "core/fetch/ImageResourceClient.h" | 34 #include "core/fetch/ImageResourceClient.h" |
| 35 #include "core/fetch/Resource.h" | 35 #include "core/fetch/Resource.h" |
| 36 #include "platform/heap/Handle.h" | 36 #include "platform/heap/Handle.h" |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 class MockImageResourceClient final : public ImageResourceClient { | 40 class MockImageResourceClient final : public ImageResourceClient { |
| 41 public: | 41 public: |
| 42 explicit MockImageResourceClient(const PassRefPtrWillBeRawPtr<Resource>); | 42 explicit MockImageResourceClient(const RawPtr<Resource>); |
| 43 ~MockImageResourceClient() override; | 43 ~MockImageResourceClient() override; |
| 44 | 44 |
| 45 void imageChanged(ImageResource*, const IntRect*) override | 45 void imageChanged(ImageResource*, const IntRect*) override |
| 46 { | 46 { |
| 47 m_imageChangedCount++; | 47 m_imageChangedCount++; |
| 48 } | 48 } |
| 49 | 49 |
| 50 void notifyFinished(Resource*) override; | 50 void notifyFinished(Resource*) override; |
| 51 String debugName() const override { return "MockImageResourceClient"; } | 51 String debugName() const override { return "MockImageResourceClient"; } |
| 52 | 52 |
| 53 int imageChangedCount() const { return m_imageChangedCount; } | 53 int imageChangedCount() const { return m_imageChangedCount; } |
| 54 bool notifyFinishedCalled() const { return m_notifyFinishedCalled; } | 54 bool notifyFinishedCalled() const { return m_notifyFinishedCalled; } |
| 55 | 55 |
| 56 void removeAsClient(); | 56 void removeAsClient(); |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 // TODO(Oilpan): properly trace when ImageResourceClient is on the heap. | 59 // TODO(Oilpan): properly trace when ImageResourceClient is on the heap. |
| 60 RawPtrWillBeUntracedMember<Resource> m_resource; | 60 UntracedMember<Resource> m_resource; |
| 61 int m_imageChangedCount; | 61 int m_imageChangedCount; |
| 62 bool m_notifyFinishedCalled; | 62 bool m_notifyFinishedCalled; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 } // namespace blink | 65 } // namespace blink |
| 66 | 66 |
| 67 #endif // MockImageResourceClient_h | 67 #endif // MockImageResourceClient_h |
| OLD | NEW |