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

Side by Side Diff: chrome/browser/devtools/devtools_protocol.cc

Issue 786903002: devtools_protocol.cc: fix ptr to bool conversion warning (Closed) Base URL: precise:/work/chromium/src@clang_roll_223109
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #include "chrome/browser/devtools/devtools_protocol.h" 5 #include "chrome/browser/devtools/devtools_protocol.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 return true; 111 return true;
112 } 112 }
113 113
114 // static 114 // static
115 bool DevToolsProtocol::ParseResponse(const std::string& json, 115 bool DevToolsProtocol::ParseResponse(const std::string& json,
116 int* command_id, 116 int* command_id,
117 int* error_code) { 117 int* error_code) {
118 scoped_ptr<base::Value> value(base::JSONReader::Read(json)); 118 scoped_ptr<base::Value> value(base::JSONReader::Read(json));
119 if (!value || !value->IsType(base::Value::TYPE_DICTIONARY)) 119 if (!value || !value->IsType(base::Value::TYPE_DICTIONARY))
120 return nullptr; 120 return false;
121 121
122 scoped_ptr<base::DictionaryValue> dict( 122 scoped_ptr<base::DictionaryValue> dict(
123 static_cast<base::DictionaryValue*>(value.release())); 123 static_cast<base::DictionaryValue*>(value.release()));
124 124
125 if (!dict->GetInteger(kIdParam, command_id)) 125 if (!dict->GetInteger(kIdParam, command_id))
126 return nullptr; 126 return false;
127 127
128 *error_code = 0; 128 *error_code = 0;
129 base::DictionaryValue* error_dict = nullptr; 129 base::DictionaryValue* error_dict = nullptr;
130 if (dict->GetDictionary(kErrorParam, &error_dict)) 130 if (dict->GetDictionary(kErrorParam, &error_dict))
131 error_dict->GetInteger(kErrorCodeParam, error_code); 131 error_dict->GetInteger(kErrorCodeParam, error_code);
132 return true; 132 return true;
133 } 133 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698