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

Side by Side Diff: third_party/WebKit/Source/core/dom/IncrementLoadEventDelayCount.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 // 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 #include "core/dom/IncrementLoadEventDelayCount.h" 5 #include "core/dom/IncrementLoadEventDelayCount.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "wtf/PtrUtil.h"
9 #include <memory>
10 8
11 namespace blink { 9 namespace blink {
12 10
13 std::unique_ptr<IncrementLoadEventDelayCount> IncrementLoadEventDelayCount::crea te(Document& document) 11 PassOwnPtr<IncrementLoadEventDelayCount> IncrementLoadEventDelayCount::create(Do cument& document)
14 { 12 {
15 return wrapUnique(new IncrementLoadEventDelayCount(document)); 13 return adoptPtr(new IncrementLoadEventDelayCount(document));
16 } 14 }
17 15
18 IncrementLoadEventDelayCount::IncrementLoadEventDelayCount(Document& document) 16 IncrementLoadEventDelayCount::IncrementLoadEventDelayCount(Document& document)
19 : m_document(&document) 17 : m_document(&document)
20 { 18 {
21 document.incrementLoadEventDelayCount(); 19 document.incrementLoadEventDelayCount();
22 } 20 }
23 21
24 IncrementLoadEventDelayCount::~IncrementLoadEventDelayCount() 22 IncrementLoadEventDelayCount::~IncrementLoadEventDelayCount()
25 { 23 {
26 m_document->decrementLoadEventDelayCount(); 24 m_document->decrementLoadEventDelayCount();
27 } 25 }
28 26
29 void IncrementLoadEventDelayCount::documentChanged(Document& newDocument) 27 void IncrementLoadEventDelayCount::documentChanged(Document& newDocument)
30 { 28 {
31 newDocument.incrementLoadEventDelayCount(); 29 newDocument.incrementLoadEventDelayCount();
32 m_document->decrementLoadEventDelayCount(); 30 m_document->decrementLoadEventDelayCount();
33 m_document = &newDocument; 31 m_document = &newDocument;
34 } 32 }
35 } // namespace blink 33 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698