OLD | NEW |
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // WebCryptoKey is: | 79 // WebCryptoKey is: |
80 // * Copiable (cheaply) | 80 // * Copiable (cheaply) |
81 // * Threadsafe if the embedder's WebCryptoKeyHandle is also threadsafe. | 81 // * Threadsafe if the embedder's WebCryptoKeyHandle is also threadsafe. |
82 // | 82 // |
83 // The embedder is responsible for creating all WebCryptoKeys, and therefore can | 83 // The embedder is responsible for creating all WebCryptoKeys, and therefore can |
84 // safely assume any details regarding the type of the wrapped | 84 // safely assume any details regarding the type of the wrapped |
85 // WebCryptoKeyHandle*. | 85 // WebCryptoKeyHandle*. |
86 // | 86 // |
87 // If WebCryptoKey "isNull()" then it is invalid to call any of the other | 87 // If WebCryptoKey "isNull()" then it is invalid to call any of the other |
88 // methods on it (other than destruction, assignment, or isNull()). | 88 // methods on it (other than destruction, assignment, or isNull()). |
89 // | |
90 // FIXME: Define the interface to use for structured clone. | |
91 // Cloning across a process boundary will need serialization, | |
92 // however cloning for in-process workers could just share the same | |
93 // (threadsafe) handle. | |
94 class WebCryptoKey { | 89 class WebCryptoKey { |
95 public: | 90 public: |
96 ~WebCryptoKey() { reset(); } | 91 ~WebCryptoKey() { reset(); } |
97 | 92 |
98 WebCryptoKey(const WebCryptoKey& other) { assign(other); } | 93 WebCryptoKey(const WebCryptoKey& other) { assign(other); } |
99 WebCryptoKey& operator=(const WebCryptoKey& other) | 94 WebCryptoKey& operator=(const WebCryptoKey& other) |
100 { | 95 { |
101 assign(other); | 96 assign(other); |
102 return *this; | 97 return *this; |
103 } | 98 } |
(...skipping 29 matching lines...) Expand all Loading... |
133 // Base class for the embedder to define its own opaque key handle. The lifetime | 128 // Base class for the embedder to define its own opaque key handle. The lifetime |
134 // of this object is controlled by WebCryptoKey using reference counting. | 129 // of this object is controlled by WebCryptoKey using reference counting. |
135 class WebCryptoKeyHandle { | 130 class WebCryptoKeyHandle { |
136 public: | 131 public: |
137 virtual ~WebCryptoKeyHandle() { } | 132 virtual ~WebCryptoKeyHandle() { } |
138 }; | 133 }; |
139 | 134 |
140 } // namespace blink | 135 } // namespace blink |
141 | 136 |
142 #endif | 137 #endif |
OLD | NEW |