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

Side by Side Diff: third_party/WebKit/Source/platform/inspector_protocol/ValueConversions.h

Issue 2098523002: Fix some issues found by coverity scans on Node.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « third_party/WebKit/Source/platform/inspector_protocol/String16STL.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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ValueConversions_h 5 #ifndef ValueConversions_h
6 #define ValueConversions_h 6 #define ValueConversions_h
7 7
8 #include "platform/inspector_protocol/ErrorSupport.h" 8 #include "platform/inspector_protocol/ErrorSupport.h"
9 #include "platform/inspector_protocol/Platform.h" 9 #include "platform/inspector_protocol/Platform.h"
10 #include "platform/inspector_protocol/String16.h" 10 #include "platform/inspector_protocol/String16.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 errors->addError("string value expected"); 105 errors->addError("string value expected");
106 return result; 106 return result;
107 } 107 }
108 }; 108 };
109 109
110 template<> 110 template<>
111 struct FromValue<Value> { 111 struct FromValue<Value> {
112 static std::unique_ptr<Value> parse(protocol::Value* value, ErrorSupport* er rors) 112 static std::unique_ptr<Value> parse(protocol::Value* value, ErrorSupport* er rors)
113 { 113 {
114 bool success = !!value; 114 bool success = !!value;
115 if (!success) 115 if (!success) {
116 errors->addError("value expected"); 116 errors->addError("value expected");
117 return nullptr;
118 }
117 return value->clone(); 119 return value->clone();
118 } 120 }
119 }; 121 };
120 122
121 template<> 123 template<>
122 struct FromValue<DictionaryValue> { 124 struct FromValue<DictionaryValue> {
123 static std::unique_ptr<DictionaryValue> parse(protocol::Value* value, ErrorS upport* errors) 125 static std::unique_ptr<DictionaryValue> parse(protocol::Value* value, ErrorS upport* errors)
124 { 126 {
125 bool success = value && value->type() == protocol::Value::TypeObject; 127 bool success = value && value->type() == protocol::Value::TypeObject;
126 if (!success) 128 if (!success)
(...skipping 20 matching lines...) Expand all
147 static std::unique_ptr<protocol::Array<T>> parse(protocol::Value* value, Err orSupport* errors) 149 static std::unique_ptr<protocol::Array<T>> parse(protocol::Value* value, Err orSupport* errors)
148 { 150 {
149 return protocol::Array<T>::parse(value, errors); 151 return protocol::Array<T>::parse(value, errors);
150 } 152 }
151 }; 153 };
152 154
153 } // namespace platform 155 } // namespace platform
154 } // namespace blink 156 } // namespace blink
155 157
156 #endif // !defined(ValueConversions_h) 158 #endif // !defined(ValueConversions_h)
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/inspector_protocol/String16STL.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698