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

Unified Diff: third_party/WebKit/Source/wtf/UniquePtrTransitionGuide.md

Issue 2547053003: s/ passed(...) / WTF::passed(...) / to avoid future ambiguity w/ base::Passed. (Closed)
Patch Set: Rebasing... Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/wtf/TerminatedArray.h ('k') | third_party/WebKit/Source/wtf/VectorTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/UniquePtrTransitionGuide.md
diff --git a/third_party/WebKit/Source/wtf/UniquePtrTransitionGuide.md b/third_party/WebKit/Source/wtf/UniquePtrTransitionGuide.md
index fcfbb7fcfd58439034555d5428c8503b099dcd2f..1d4da3dc51b9b6998a6b4a074afe46797a833c4c 100644
--- a/third_party/WebKit/Source/wtf/UniquePtrTransitionGuide.md
+++ b/third_party/WebKit/Source/wtf/UniquePtrTransitionGuide.md
@@ -30,29 +30,29 @@ void f()
void f()
{
std::unique_ptr<T> owned(new T(argument));
- // Or: auto owned = wrapUnique(new T(argument)); †1
+ // Or: auto owned = WTF::wrapUnique(new T(argument)); †1
owned->useThis();
T& reference = *owned;
T* pointer = owned.get();
owned.reset(); // Or: owned = nullptr
- owned.reset(new T); // Or: owned = wrapUnique(new T)
+ owned.reset(new T); // Or: owned = WTF::wrapUnique(new T)
T* leakedPointer = owned.release();
}
```
|||---|||
-†1 `wrapUnique()` is particularly useful when you pass a `unique_ptr` to somebody else:
+†1 `WTF::wrapUnique()` is particularly useful when you pass a `unique_ptr` to somebody else:
```c++
std::unique_ptr<T> g()
{
- h(wrapUnique(new T(argument))); // Pass to a function.
- return wrapUnique(new T(argument)); // Return from a function.
+ h(WTF::wrapUnique(new T(argument))); // Pass to a function.
+ return WTF::wrapUnique(new T(argument)); // Return from a function.
}
```
-You need to `#include "wtf/PtrUtil.h"` for `wrapUnique()`.
+You need to `#include "wtf/PtrUtil.h"` for `WTF::wrapUnique()`.
## Passing and Receiving
« no previous file with comments | « third_party/WebKit/Source/wtf/TerminatedArray.h ('k') | third_party/WebKit/Source/wtf/VectorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698