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

Side by Side Diff: content/child/webcrypto/jwk.cc

Issue 377723002: Fixes for re-enabling more MSVC level 4 warnings: content/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « content/child/npapi/plugin_instance.cc ('k') | content/child/webcrypto/shared_crypto.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "jwk.h" 5 #include "jwk.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <map> 9 #include <map>
10 10
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 return !algorithm->isNull(); 258 return !algorithm->isNull();
259 } 259 }
260 260
261 bool IsInvalidKeyByteLength(size_t byte_length) const { 261 bool IsInvalidKeyByteLength(size_t byte_length) const {
262 if (required_key_length_bytes_ == NO_KEY_SIZE_REQUIREMENT) 262 if (required_key_length_bytes_ == NO_KEY_SIZE_REQUIREMENT)
263 return false; 263 return false;
264 return required_key_length_bytes_ != byte_length; 264 return required_key_length_bytes_ != byte_length;
265 } 265 }
266 266
267 private: 267 private:
268 enum { NO_KEY_SIZE_REQUIREMENT = UINT_MAX }; 268 static const unsigned int NO_KEY_SIZE_REQUIREMENT = UINT_MAX;
269 269
270 AlgorithmCreationFunc creation_func_; 270 AlgorithmCreationFunc creation_func_;
271 271
272 // The expected key size for the algorithm or NO_KEY_SIZE_REQUIREMENT. 272 // The expected key size for the algorithm or NO_KEY_SIZE_REQUIREMENT.
273 unsigned int required_key_length_bytes_; 273 unsigned int required_key_length_bytes_;
274 }; 274 };
275 275
276 typedef std::map<std::string, JwkAlgorithmInfo> JwkAlgorithmInfoMap; 276 typedef std::map<std::string, JwkAlgorithmInfo> JwkAlgorithmInfoMap;
277 277
278 class JwkAlgorithmRegistry { 278 class JwkAlgorithmRegistry {
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 1009
1010 std::string json; 1010 std::string json;
1011 base::JSONWriter::Write(&jwk_dict, &json); 1011 base::JSONWriter::Write(&jwk_dict, &json);
1012 buffer->assign(json.data(), json.data() + json.size()); 1012 buffer->assign(json.data(), json.data() + json.size());
1013 return Status::Success(); 1013 return Status::Success();
1014 } 1014 }
1015 1015
1016 } // namespace webcrypto 1016 } // namespace webcrypto
1017 1017
1018 } // namespace content 1018 } // namespace content
OLDNEW
« no previous file with comments | « content/child/npapi/plugin_instance.cc ('k') | content/child/webcrypto/shared_crypto.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698