OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
4 * Copyright (C) 2013 Samsung Electronics. All rights reserved. | 4 * Copyright (C) 2013 Samsung Electronics. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions are | 7 * modification, are permitted provided that the following conditions are |
8 * met: | 8 * met: |
9 * | 9 * |
10 * * Redistributions of source code must retain the above copyright | 10 * * Redistributions of source code must retain the above copyright |
(...skipping 17 matching lines...) Expand all Loading... |
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
31 */ | 31 */ |
32 | 32 |
33 #include "core/frame/DOMWindowBase64.h" | 33 #include "core/frame/DOMWindowBase64.h" |
34 | 34 |
35 #include "bindings/core/v8/ExceptionState.h" | 35 #include "bindings/core/v8/ExceptionState.h" |
36 #include "core/dom/ExceptionCode.h" | 36 #include "core/dom/ExceptionCode.h" |
37 #include "core/html/parser/HTMLParserIdioms.h" | 37 #include "core/html/parser/HTMLParserIdioms.h" |
38 #include "wtf/text/Base64.h" | 38 #include "platform/wtf/text/Base64.h" |
39 | 39 |
40 namespace blink { | 40 namespace blink { |
41 | 41 |
42 String DOMWindowBase64::btoa(const String& string_to_encode, | 42 String DOMWindowBase64::btoa(const String& string_to_encode, |
43 ExceptionState& exception_state) { | 43 ExceptionState& exception_state) { |
44 if (string_to_encode.IsNull()) | 44 if (string_to_encode.IsNull()) |
45 return String(); | 45 return String(); |
46 | 46 |
47 if (!string_to_encode.ContainsOnlyLatin1()) { | 47 if (!string_to_encode.ContainsOnlyLatin1()) { |
48 exception_state.ThrowDOMException( | 48 exception_state.ThrowDOMException( |
(...skipping 24 matching lines...) Expand all Loading... |
73 exception_state.ThrowDOMException( | 73 exception_state.ThrowDOMException( |
74 kInvalidCharacterError, | 74 kInvalidCharacterError, |
75 "The string to be decoded is not correctly encoded."); | 75 "The string to be decoded is not correctly encoded."); |
76 return String(); | 76 return String(); |
77 } | 77 } |
78 | 78 |
79 return String(out.Data(), out.size()); | 79 return String(out.Data(), out.size()); |
80 } | 80 } |
81 | 81 |
82 } // namespace blink | 82 } // namespace blink |
OLD | NEW |