OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NotificationImageLoader_h | 5 #ifndef NotificationImageLoader_h |
6 #define NotificationImageLoader_h | 6 #define NotificationImageLoader_h |
7 | 7 |
8 #include "core/loader/ThreadableLoader.h" | 8 #include "core/loader/ThreadableLoader.h" |
9 #include "core/loader/ThreadableLoaderClient.h" | 9 #include "core/loader/ThreadableLoaderClient.h" |
10 #include "platform/SharedBuffer.h" | 10 #include "platform/SharedBuffer.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 // Cancels the pending load, if there is one. The |m_imageCallback| will not | 39 // Cancels the pending load, if there is one. The |m_imageCallback| will not |
40 // be run. | 40 // be run. |
41 void stop(); | 41 void stop(); |
42 | 42 |
43 // ThreadableLoaderClient interface. | 43 // ThreadableLoaderClient interface. |
44 void didReceiveData(const char* data, unsigned length) override; | 44 void didReceiveData(const char* data, unsigned length) override; |
45 void didFinishLoading(unsigned long resourceIdentifier, double finishTime) o
verride; | 45 void didFinishLoading(unsigned long resourceIdentifier, double finishTime) o
verride; |
46 void didFail(const ResourceError&) override; | 46 void didFail(const ResourceError&) override; |
47 void didFailRedirectCheck() override; | 47 void didFailRedirectCheck() override; |
48 | 48 |
49 DEFINE_INLINE_TRACE() | 49 DEFINE_INLINE_TRACE() {} |
50 { | |
51 visitor->trace(m_threadableLoader); | |
52 } | |
53 | 50 |
54 private: | 51 private: |
55 void runCallbackWithEmptyBitmap(); | 52 void runCallbackWithEmptyBitmap(); |
56 | 53 |
57 bool m_stopped; | 54 bool m_stopped; |
58 double m_startTime; | 55 double m_startTime; |
59 RefPtr<SharedBuffer> m_data; | 56 RefPtr<SharedBuffer> m_data; |
60 std::unique_ptr<ImageCallback> m_imageCallback; | 57 std::unique_ptr<ImageCallback> m_imageCallback; |
61 Member<ThreadableLoader> m_threadableLoader; | 58 std::unique_ptr<ThreadableLoader> m_threadableLoader; |
62 }; | 59 }; |
63 | 60 |
64 } // namespace blink | 61 } // namespace blink |
65 | 62 |
66 #endif // NotificationImageLoader_h | 63 #endif // NotificationImageLoader_h |
OLD | NEW |