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

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

Issue 2394793002: Resource: helper class to prohibit {add,remove}Client() calls in scope (Closed)
Patch Set: rebase Created 4 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/Resource.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 26 matching lines...) Expand all
37 #include "platform/heap/Handle.h" 37 #include "platform/heap/Handle.h"
38 38
39 namespace blink { 39 namespace blink {
40 40
41 class MockResourceClient : public GarbageCollectedFinalized<MockResourceClient>, 41 class MockResourceClient : public GarbageCollectedFinalized<MockResourceClient>,
42 public ResourceClient { 42 public ResourceClient {
43 USING_PRE_FINALIZER(MockResourceClient, dispose); 43 USING_PRE_FINALIZER(MockResourceClient, dispose);
44 USING_GARBAGE_COLLECTED_MIXIN(MockResourceClient); 44 USING_GARBAGE_COLLECTED_MIXIN(MockResourceClient);
45 45
46 public: 46 public:
47 MockResourceClient() {}
47 explicit MockResourceClient(Resource*); 48 explicit MockResourceClient(Resource*);
48 ~MockResourceClient() override; 49 ~MockResourceClient() override;
49 50
50 void notifyFinished(Resource*) override; 51 void notifyFinished(Resource*) override;
51 String debugName() const override { return "MockResourceClient"; } 52 String debugName() const override { return "MockResourceClient"; }
52 virtual bool notifyFinishedCalled() const { return m_notifyFinishedCalled; } 53 virtual bool notifyFinishedCalled() const { return m_notifyFinishedCalled; }
53 54
54 virtual void removeAsClient(); 55 virtual void removeAsClient();
55 virtual void dispose(); 56 virtual void dispose();
56 57
(...skipping 23 matching lines...) Expand all
80 int imageChangedCount() const { return m_imageChangedCount; } 81 int imageChangedCount() const { return m_imageChangedCount; }
81 82
82 private: 83 private:
83 int m_imageChangedCount; 84 int m_imageChangedCount;
84 int m_imageNotifyFinishedCount; 85 int m_imageNotifyFinishedCount;
85 }; 86 };
86 87
87 } // namespace blink 88 } // namespace blink
88 89
89 #endif // MockResourceClients_h 90 #endif // MockResourceClients_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/Resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698