| 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 #include "modules/notifications/NotificationResourcesLoader.h" | 5 #include "modules/notifications/NotificationResourcesLoader.h" |
| 6 | 6 |
| 7 #include <cmath> |
| 7 #include "platform/Histogram.h" | 8 #include "platform/Histogram.h" |
| 8 #include "platform/weborigin/KURL.h" | 9 #include "platform/weborigin/KURL.h" |
| 9 #include "public/platform/modules/notifications/WebNotificationData.h" | 10 #include "public/platform/modules/notifications/WebNotificationData.h" |
| 10 #include "public/platform/modules/notifications/WebNotificationResources.h" | 11 #include "public/platform/modules/notifications/WebNotificationResources.h" |
| 11 #include "wtf/CurrentTime.h" | 12 #include "wtf/CurrentTime.h" |
| 12 #include "wtf/Threading.h" | 13 #include "wtf/Threading.h" |
| 13 #include <cmath> | |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 NotificationResourcesLoader::NotificationResourcesLoader( | 17 NotificationResourcesLoader::NotificationResourcesLoader( |
| 18 std::unique_ptr<CompletionCallback> completionCallback) | 18 std::unique_ptr<CompletionCallback> completionCallback) |
| 19 : m_started(false), | 19 : m_started(false), |
| 20 m_completionCallback(std::move(completionCallback)), | 20 m_completionCallback(std::move(completionCallback)), |
| 21 m_pendingRequestCount(0) { | 21 m_pendingRequestCount(0) { |
| 22 DCHECK(m_completionCallback); | 22 DCHECK(m_completionCallback); |
| 23 } | 23 } |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 DCHECK_GT(m_pendingRequestCount, 0); | 122 DCHECK_GT(m_pendingRequestCount, 0); |
| 123 m_pendingRequestCount--; | 123 m_pendingRequestCount--; |
| 124 if (!m_pendingRequestCount) { | 124 if (!m_pendingRequestCount) { |
| 125 stop(); | 125 stop(); |
| 126 (*m_completionCallback)(this); | 126 (*m_completionCallback)(this); |
| 127 // The |this| pointer may have been deleted now. | 127 // The |this| pointer may have been deleted now. |
| 128 } | 128 } |
| 129 } | 129 } |
| 130 | 130 |
| 131 } // namespace blink | 131 } // namespace blink |
| OLD | NEW |