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

Side by Side Diff: chrome/common/extensions/permissions/socket_permission_data.cc

Issue 12207167: Cleanup: Remove deprecated base::Value methods from chrome/common. Use base::Value too. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/common/extensions/permissions/socket_permission_data.h" 5 #include "chrome/common/extensions/permissions/socket_permission_data.h"
6 6
7 #include <cstdlib> 7 #include <cstdlib>
8 #include <sstream> 8 #include <sstream>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } 147 }
148 } 148 }
149 149
150 if (pattern_.port != request.port && pattern_.port != kWildcardPortNumber) 150 if (pattern_.port != request.port && pattern_.port != kWildcardPortNumber)
151 return false; 151 return false;
152 152
153 return true; 153 return true;
154 } 154 }
155 155
156 scoped_ptr<base::Value> SocketPermissionData::ToValue() const { 156 scoped_ptr<base::Value> SocketPermissionData::ToValue() const {
157 return scoped_ptr<base::Value>(base::Value::CreateStringValue(GetAsString())); 157 return scoped_ptr<base::Value>(new base::StringValue(GetAsString()));
158 } 158 }
159 159
160 bool SocketPermissionData::FromValue(const base::Value* value) { 160 bool SocketPermissionData::FromValue(const base::Value* value) {
161 std::string spec; 161 std::string spec;
162 if (!value->GetAsString(&spec)) 162 if (!value->GetAsString(&spec))
163 return false; 163 return false;
164 164
165 return Parse(spec); 165 return Parse(spec);
166 } 166 }
167 167
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 268
269 void SocketPermissionData::Reset() { 269 void SocketPermissionData::Reset() {
270 pattern_.type = SocketPermissionRequest::NONE; 270 pattern_.type = SocketPermissionRequest::NONE;
271 pattern_.host.clear(); 271 pattern_.host.clear();
272 match_subdomains_ = false; 272 match_subdomains_ = false;
273 pattern_.port = kInvalidPort; 273 pattern_.port = kInvalidPort;
274 spec_.clear(); 274 spec_.clear();
275 } 275 }
276 276
277 } // namespace extensions 277 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/permissions/api_permission_set_unittest.cc ('k') | chrome/common/extensions/value_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698