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

Side by Side Diff: Source/wtf/WeakPtr.h

Issue 18371008: Add a WebDocument::watchCssSelectors(selectors) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@pinned
Patch Set: Initial Created 7 years, 5 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
« no previous file with comments | « Source/core/rendering/style/StyleRareNonInheritedData.cpp ('k') | public/platform/WebCString.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google, Inc. All Rights Reserved. 2 * Copyright (C) 2013 Google, Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 #endif 80 #endif
81 }; 81 };
82 82
83 template<typename T> 83 template<typename T>
84 class WeakPtr { 84 class WeakPtr {
85 WTF_MAKE_FAST_ALLOCATED; 85 WTF_MAKE_FAST_ALLOCATED;
86 public: 86 public:
87 WeakPtr() { } 87 WeakPtr() { }
88 WeakPtr(PassRefPtr<WeakReference<T> > ref) : m_ref(ref) { } 88 WeakPtr(PassRefPtr<WeakReference<T> > ref) : m_ref(ref) { }
89 89
90 T* get() const { return m_ref->get(); } 90 T* get() const { return m_ref ? m_ref->get() : 0; }
91 91
92 private: 92 private:
93 RefPtr<WeakReference<T> > m_ref; 93 RefPtr<WeakReference<T> > m_ref;
94 }; 94 };
95 95
96 template<typename T> 96 template<typename T>
97 class WeakPtrFactory { 97 class WeakPtrFactory {
98 WTF_MAKE_NONCOPYABLE(WeakPtrFactory<T>); 98 WTF_MAKE_NONCOPYABLE(WeakPtrFactory<T>);
99 WTF_MAKE_FAST_ALLOCATED; 99 WTF_MAKE_FAST_ALLOCATED;
100 public: 100 public:
(...skipping 22 matching lines...) Expand all
123 RefPtr<WeakReference<T> > m_ref; 123 RefPtr<WeakReference<T> > m_ref;
124 }; 124 };
125 125
126 } // namespace WTF 126 } // namespace WTF
127 127
128 using WTF::WeakPtr; 128 using WTF::WeakPtr;
129 using WTF::WeakPtrFactory; 129 using WTF::WeakPtrFactory;
130 using WTF::WeakReference; 130 using WTF::WeakReference;
131 131
132 #endif 132 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/style/StyleRareNonInheritedData.cpp ('k') | public/platform/WebCString.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698