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

Side by Side Diff: Source/core/platform/chromium/support/WebCrypto.cpp

Issue 23003021: WebCrypto: assert that WebArrayBuffers are not null. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 | « no previous file | 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) 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 25 matching lines...) Expand all
36 namespace WebKit { 36 namespace WebKit {
37 37
38 void WebCryptoResult::completeWithError() 38 void WebCryptoResult::completeWithError()
39 { 39 {
40 m_impl->completeWithError(); 40 m_impl->completeWithError();
41 reset(); 41 reset();
42 } 42 }
43 43
44 void WebCryptoResult::completeWithBuffer(const WebArrayBuffer& buffer) 44 void WebCryptoResult::completeWithBuffer(const WebArrayBuffer& buffer)
45 { 45 {
46 RELEASE_ASSERT(!buffer.isNull());
46 m_impl->completeWithBuffer(buffer); 47 m_impl->completeWithBuffer(buffer);
47 reset(); 48 reset();
48 } 49 }
49 50
50 void WebCryptoResult::completeWithBuffer(const void* bytes, size_t bytesSize) 51 void WebCryptoResult::completeWithBuffer(const void* bytes, size_t bytesSize)
51 { 52 {
52 WebArrayBuffer buffer = WebKit::WebArrayBuffer::create(bytesSize, 1); 53 WebArrayBuffer buffer = WebKit::WebArrayBuffer::create(bytesSize, 1);
54 RELEASE_ASSERT(!buffer.isNull());
53 memcpy(buffer.data(), bytes, bytesSize); 55 memcpy(buffer.data(), bytes, bytesSize);
54 completeWithBuffer(buffer); 56 completeWithBuffer(buffer);
55 } 57 }
56 58
57 void WebCryptoResult::completeWithBoolean(bool b) 59 void WebCryptoResult::completeWithBoolean(bool b)
58 { 60 {
59 m_impl->completeWithBoolean(b); 61 m_impl->completeWithBoolean(b);
60 reset(); 62 reset();
61 } 63 }
62 64
(...skipping 12 matching lines...) Expand all
75 { 77 {
76 m_impl = o.m_impl; 78 m_impl = o.m_impl;
77 } 79 }
78 80
79 void WebCryptoResult::assign(WebCryptoResultPrivate* impl) 81 void WebCryptoResult::assign(WebCryptoResultPrivate* impl)
80 { 82 {
81 m_impl = impl; 83 m_impl = impl;
82 } 84 }
83 85
84 } // namespace WebKit 86 } // namespace WebKit
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698