Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(813)

Side by Side Diff: third_party/WebKit/Source/core/fetch/MockResourceClients.h

Issue 1728313003: Split ImageResourceClient into ResourceClient and ImageResourceObserver [2/2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698