| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 IncrementLoadEventDelayCount_h | 5 #ifndef IncrementLoadEventDelayCount_h |
| 6 #define IncrementLoadEventDelayCount_h | 6 #define IncrementLoadEventDelayCount_h |
| 7 | 7 |
| 8 #include "platform/heap/Handle.h" |
| 8 #include "wtf/Noncopyable.h" | 9 #include "wtf/Noncopyable.h" |
| 9 #include "wtf/RefPtr.h" | 10 #include "wtf/RefPtr.h" |
| 10 | 11 |
| 11 namespace WebCore { | 12 namespace WebCore { |
| 12 | 13 |
| 13 class Document; | 14 class Document; |
| 14 | 15 |
| 15 // A helper class that will increment a document's loadEventDelayCount on | 16 // A helper class that will increment a document's loadEventDelayCount on |
| 16 // contruction and decrement it on destruction (semantics similar to RefPtr). | 17 // contruction and decrement it on destruction (semantics similar to RefPtr). |
| 17 class IncrementLoadEventDelayCount { | 18 class IncrementLoadEventDelayCount { |
| 18 WTF_MAKE_NONCOPYABLE(IncrementLoadEventDelayCount); | 19 WTF_MAKE_NONCOPYABLE(IncrementLoadEventDelayCount); |
| 19 | 20 |
| 20 public: | 21 public: |
| 21 IncrementLoadEventDelayCount(Document&); | 22 IncrementLoadEventDelayCount(Document&); |
| 22 ~IncrementLoadEventDelayCount(); | 23 ~IncrementLoadEventDelayCount(); |
| 23 | 24 |
| 24 // Increments the new document's count and decrements the old count. | 25 // Increments the new document's count and decrements the old count. |
| 25 void documentChanged(Document& newDocument); | 26 void documentChanged(Document& newDocument); |
| 26 | 27 |
| 27 private: | 28 private: |
| 28 RefPtr<Document> m_document; | 29 RefPtrWillBePersistent<Document> m_document; |
| 29 }; | 30 }; |
| 30 } | 31 } |
| 31 | 32 |
| 32 #endif | 33 #endif |
| OLD | NEW |