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

Side by Side Diff: third_party/WebKit/public/platform/WebPassOwnPtr.h

Issue 1441073006: Move throttling of background timers into the renderer scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try again for MSVC Created 5 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 WebPassOwnPtr_h 5 #ifndef WebPassOwnPtr_h
6 #define WebPassOwnPtr_h 6 #define WebPassOwnPtr_h
7 7
8 #include "public/platform/WebCommon.h" 8 #include "public/platform/WebCommon.h"
9 #include <cstddef> 9 #include <cstddef>
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 #if INSIDE_BLINK 46 #if INSIDE_BLINK
47 PassOwnPtr<T> release() 47 PassOwnPtr<T> release()
48 { 48 {
49 T* ptr = m_ptr; 49 T* ptr = m_ptr;
50 m_ptr = nullptr; 50 m_ptr = nullptr;
51 return adoptPtr(ptr); 51 return adoptPtr(ptr);
52 } 52 }
53 #endif // INSIDE_BLINK 53 #endif // INSIDE_BLINK
54 54
55 T* get() const
jochen (gone - plz use gerrit) 2015/11/16 11:51:44 that breaks the ownership semantics of this class.
alex clarke (OOO till 29th) 2015/11/23 17:13:46 Done.
56 {
57 return m_ptr;
58 }
59
55 template <typename U> friend class WebPassOwnPtr; 60 template <typename U> friend class WebPassOwnPtr;
56 template <typename U> friend WebPassOwnPtr<U> adoptWebPtr(U*); 61 template <typename U> friend WebPassOwnPtr<U> adoptWebPtr(U*);
57 62
58 private: 63 private:
59 explicit WebPassOwnPtr(T* ptr) : m_ptr(ptr) {} 64 explicit WebPassOwnPtr(T* ptr) : m_ptr(ptr) {}
60 65
61 // See the constructor comment to see why |mutable| is needed. 66 // See the constructor comment to see why |mutable| is needed.
62 mutable T* m_ptr; 67 mutable T* m_ptr;
63 }; 68 };
64 69
65 template <typename T> 70 template <typename T>
66 WebPassOwnPtr<T> adoptWebPtr(T* p) { return WebPassOwnPtr<T>(p); } 71 WebPassOwnPtr<T> adoptWebPtr(T* p) { return WebPassOwnPtr<T>(p); }
67 72
68 } // namespace blink 73 } // namespace blink
69 74
70 #endif 75 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698