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

Side by Side Diff: public/platform/WebPrivatePtr.h

Issue 200723002: Use new is*Element() helper functions more in web/ code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use shadowHost() Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | no next file » | 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 226
227 template<typename U> 227 template<typename U>
228 WebPrivatePtr<T>& operator=(const U& ptr) 228 WebPrivatePtr<T>& operator=(const U& ptr)
229 { 229 {
230 storage().assign(ptr); 230 storage().assign(ptr);
231 return *this; 231 return *this;
232 } 232 }
233 233
234 T* get() const { return storage().get(); } 234 T* get() const { return storage().get(); }
235 235
236 T& operator*() const { ASSERT(get()); return *get(); }
tkent 2014/03/16 23:45:51 We don't write multiple statements in a single lin
Inactive 2014/03/16 23:53:51 Done.
237
236 T* operator->() const 238 T* operator->() const
237 { 239 {
238 ASSERT(m_storage); 240 ASSERT(m_storage);
239 return get(); 241 return get();
240 } 242 }
241 #endif 243 #endif
242 244
243 private: 245 private:
244 #if INSIDE_BLINK 246 #if INSIDE_BLINK
245 PtrStorage<T>& storage() { return PtrStorage<T>::fromSlot(&m_storage); } 247 PtrStorage<T>& storage() { return PtrStorage<T>::fromSlot(&m_storage); }
(...skipping 10 matching lines...) Expand all
256 // Disable the copy constructor; classes that contain a WebPrivatePtr 258 // Disable the copy constructor; classes that contain a WebPrivatePtr
257 // should implement their copy constructor using assign(). 259 // should implement their copy constructor using assign().
258 WebPrivatePtr(const WebPrivatePtr<T>&); 260 WebPrivatePtr(const WebPrivatePtr<T>&);
259 261
260 void* m_storage; 262 void* m_storage;
261 }; 263 };
262 264
263 } // namespace blink 265 } // namespace blink
264 266
265 #endif 267 #endif
OLDNEW
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698