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

Unified Diff: content/common/page_state_serialization.cc

Issue 649533003: C++11 declares a type safe null pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Presubmit errors Created 6 years, 2 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 | « content/common/media/media_stream_options.h ('k') | content/common/page_state_serialization_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/page_state_serialization.cc
diff --git a/content/common/page_state_serialization.cc b/content/common/page_state_serialization.cc
index d99830a2ce27d8d4f2308a1a2b274bc56acced41..4fbb0dae1e3a44c8136e268a4f69cf4446c777ae 100644
--- a/content/common/page_state_serialization.cc
+++ b/content/common/page_state_serialization.cc
@@ -215,7 +215,7 @@ void ReadData(SerializeObject* obj, const void** data, int* length) {
*data = tmp;
} else {
obj->parse_error = true;
- *data = NULL;
+ *data = nullptr;
*length = 0;
}
}
@@ -249,7 +249,7 @@ void WriteReal(double data, SerializeObject* obj) {
}
double ReadReal(SerializeObject* obj) {
- const void* tmp = NULL;
+ const void* tmp = nullptr;
int length = 0;
double value = 0.0;
ReadData(obj, &tmp, &length);
@@ -316,21 +316,21 @@ void WriteString(const base::NullableString16& str, SerializeObject* obj) {
}
// This reads a serialized NullableString16 from obj. If a string can't be
-// read, NULL is returned.
+// read, nullptr is returned.
const base::char16* ReadStringNoCopy(SerializeObject* obj, int* num_chars) {
int length_in_bytes;
if (!obj->pickle.ReadInt(&obj->iter, &length_in_bytes)) {
obj->parse_error = true;
- return NULL;
+ return nullptr;
}
if (length_in_bytes < 0)
- return NULL;
+ return nullptr;
const char* data;
if (!obj->pickle.ReadBytes(&obj->iter, &data, length_in_bytes)) {
obj->parse_error = true;
- return NULL;
+ return nullptr;
}
if (num_chars)
« no previous file with comments | « content/common/media/media_stream_options.h ('k') | content/common/page_state_serialization_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698