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

Unified Diff: mojo/public/cpp/bindings/struct_ptr.h

Issue 2715153004: Mojo: Support enums as map keys in WTF (Closed)
Patch Set: Address review comments Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/public/cpp/bindings/tests/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/struct_ptr.h
diff --git a/mojo/public/cpp/bindings/struct_ptr.h b/mojo/public/cpp/bindings/struct_ptr.h
index a01c42f9d05e689ba3e193242b254cdeebed9fe6..b135312e3944f52e458852ebd4372c1df903bca5 100644
--- a/mojo/public/cpp/bindings/struct_ptr.h
+++ b/mojo/public/cpp/bindings/struct_ptr.h
@@ -228,7 +228,7 @@ template <typename Struct>
class StructPtrWTFHelper {
public:
static bool IsHashTableDeletedValue(const StructPtr<Struct>& value) {
- return value.ptr_ == reinterpret_cast<Struct*>(1u);
+ return value.ptr_.get() == reinterpret_cast<Struct*>(1u);
}
static void ConstructDeletedValue(mojo::StructPtr<Struct>& slot) {
@@ -239,7 +239,7 @@ class StructPtrWTFHelper {
// Dirty trick: implant an invalid pointer in |ptr_|. Destructor isn't
// called for deleted buckets, so this is okay.
new (&slot) StructPtr<Struct>();
- slot.ptr_ = reinterpret_cast<Struct*>(1u);
+ slot.ptr_.reset(reinterpret_cast<Struct*>(1u));
}
};
« no previous file with comments | « no previous file | mojo/public/cpp/bindings/tests/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698