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

Side by Side Diff: third_party/WebKit/Source/modules/crypto/CryptoKey.cpp

Issue 1414553002: Fix out-of-memory crashes related to ArrayBuffer allocation Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase+more tweaks Created 5 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 { 120 {
121 ASSERT(algorithm.paramsType() == WebCryptoAlgorithmParamsTypeNone); 121 ASSERT(algorithm.paramsType() == WebCryptoAlgorithmParamsTypeNone);
122 122
123 V8ObjectBuilder algorithmValue(m_builder.scriptState()); 123 V8ObjectBuilder algorithmValue(m_builder.scriptState());
124 algorithmValue.addString("name", WebCryptoAlgorithm::lookupAlgorithmInfo (algorithm.id())->name); 124 algorithmValue.addString("name", WebCryptoAlgorithm::lookupAlgorithmInfo (algorithm.id())->name);
125 m_builder.add(propertyName, algorithmValue); 125 m_builder.add(propertyName, algorithmValue);
126 } 126 }
127 127
128 virtual void setUint8Array(const char* propertyName, const WebVector<unsigne d char>& vector) 128 virtual void setUint8Array(const char* propertyName, const WebVector<unsigne d char>& vector)
129 { 129 {
130 m_builder.add(propertyName, DOMUint8Array::create(vector.data(), vector. size())); 130 m_builder.add(propertyName, DOMUint8Array::deprecatedCreateOrCrash(vecto r.data(), vector.size()));
131 } 131 }
132 132
133 private: 133 private:
134 V8ObjectBuilder& m_builder; 134 V8ObjectBuilder& m_builder;
135 }; 135 };
136 136
137 } // namespace 137 } // namespace
138 138
139 CryptoKey::~CryptoKey() 139 CryptoKey::~CryptoKey()
140 { 140 {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 if (!usage) { 225 if (!usage) {
226 result->completeWithError(WebCryptoErrorTypeType, "Invalid keyUsages argument"); 226 result->completeWithError(WebCryptoErrorTypeType, "Invalid keyUsages argument");
227 return false; 227 return false;
228 } 228 }
229 mask |= usage; 229 mask |= usage;
230 } 230 }
231 return true; 231 return true;
232 } 232 }
233 233
234 } // namespace blink 234 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698