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

Side by Side Diff: Source/wtf/text/Base64.cpp

Issue 26481005: Implementation of script hashes for CSP. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on tip of tree Created 7 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
« no previous file with comments | « Source/wtf/text/Base64.h ('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 /* 1 /*
2 Copyright (C) 2000-2001 Dawit Alemayehu <adawit@kde.org> 2 Copyright (C) 2000-2001 Dawit Alemayehu <adawit@kde.org>
3 Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> 3 Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org>
4 Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 4 Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
5 Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> 5 Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
6 6
7 This program is free software; you can redistribute it and/or modify 7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License (LGPL) 8 it under the terms of the GNU Lesser General Public License (LGPL)
9 version 2 as published by the Free Software Foundation. 9 version 2 as published by the Free Software Foundation.
10 10
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 out.shrink(outLength); 202 out.shrink(outLength);
203 203
204 return true; 204 return true;
205 } 205 }
206 206
207 bool base64Decode(const char* data, unsigned length, Vector<char>& out, Base64De codePolicy policy) 207 bool base64Decode(const char* data, unsigned length, Vector<char>& out, Base64De codePolicy policy)
208 { 208 {
209 return base64DecodeInternal<LChar>(reinterpret_cast<const LChar*>(data), len gth, out, policy); 209 return base64DecodeInternal<LChar>(reinterpret_cast<const LChar*>(data), len gth, out, policy);
210 } 210 }
211 211
212 bool base64Decode(const UChar* data, unsigned length, Vector<char>& out, Base64D ecodePolicy policy)
213 {
214 return base64DecodeInternal<UChar>(data, length, out, policy);
215 }
216
212 bool base64Decode(const String& in, Vector<char>& out, Base64DecodePolicy policy ) 217 bool base64Decode(const String& in, Vector<char>& out, Base64DecodePolicy policy )
213 { 218 {
214 if (in.isEmpty()) 219 if (in.isEmpty())
215 return base64DecodeInternal<LChar>(0, 0, out, policy); 220 return base64DecodeInternal<LChar>(0, 0, out, policy);
216 if (in.is8Bit()) 221 if (in.is8Bit())
217 return base64DecodeInternal<LChar>(in.characters8(), in.length(), out, p olicy); 222 return base64DecodeInternal<LChar>(in.characters8(), in.length(), out, p olicy);
218 return base64DecodeInternal<UChar>(in.characters16(), in.length(), out, poli cy); 223 return base64DecodeInternal<UChar>(in.characters16(), in.length(), out, poli cy);
219 } 224 }
220 225
221 } // namespace WTF 226 } // namespace WTF
OLDNEW
« no previous file with comments | « Source/wtf/text/Base64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698