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

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

Issue 2826923002: Replace ASSERT and ASSERT_NOT_REACHED in third_party/Webkit/public (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | third_party/WebKit/public/web/WebTextDirection.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) 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 298
299 template <typename U> 299 template <typename U>
300 WebPrivatePtr& operator=(const U& ptr) { 300 WebPrivatePtr& operator=(const U& ptr) {
301 Storage().Assign(ptr); 301 Storage().Assign(ptr);
302 return *this; 302 return *this;
303 } 303 }
304 304
305 T* Get() const { return Storage().Get(); } 305 T* Get() const { return Storage().Get(); }
306 306
307 T& operator*() const { 307 T& operator*() const {
308 ASSERT(storage_); 308 DCHECK(storage_);
309 return *Get(); 309 return *Get();
310 } 310 }
311 311
312 T* operator->() const { 312 T* operator->() const {
313 ASSERT(storage_); 313 DCHECK(storage_);
314 return Get(); 314 return Get();
315 } 315 }
316 #endif 316 #endif
317 317
318 private: 318 private:
319 #if INSIDE_BLINK 319 #if INSIDE_BLINK
320 using PtrStorageType = PtrStorage<T, crossThreadDestruction, strongOrWeak>; 320 using PtrStorageType = PtrStorage<T, crossThreadDestruction, strongOrWeak>;
321 321
322 PtrStorageType& Storage() { return PtrStorageType::FromSlot(&storage_); } 322 PtrStorageType& Storage() { return PtrStorageType::FromSlot(&storage_); }
323 const PtrStorageType& Storage() const { 323 const PtrStorageType& Storage() const {
(...skipping 11 matching lines...) Expand all
335 // Disable the copy constructor; classes that contain a WebPrivatePtr 335 // Disable the copy constructor; classes that contain a WebPrivatePtr
336 // should implement their copy constructor using assign(). 336 // should implement their copy constructor using assign().
337 WebPrivatePtr(const WebPrivatePtr&) = delete; 337 WebPrivatePtr(const WebPrivatePtr&) = delete;
338 338
339 void* storage_; 339 void* storage_;
340 }; 340 };
341 341
342 } // namespace blink 342 } // namespace blink
343 343
344 #endif // WebPrivatePtr_h 344 #endif // WebPrivatePtr_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/public/web/WebTextDirection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698