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: components/webcrypto/status.h

Issue 1077273002: html_viewer: Move webcrypto to a place where html_viewer can use it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Copy the msvs_disabled_warnings to the new target. Created 5 years, 8 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_CHILD_WEBCRYPTO_STATUS_H_ 5 #ifndef CONTENT_CHILD_WEBCRYPTO_STATUS_H_
6 #define CONTENT_CHILD_WEBCRYPTO_STATUS_H_ 6 #define CONTENT_CHILD_WEBCRYPTO_STATUS_H_
7 7
8 #include <string> 8 #include <string>
9 #include "content/common/content_export.h"
10 #include "third_party/WebKit/public/platform/WebCrypto.h" 9 #include "third_party/WebKit/public/platform/WebCrypto.h"
11 10
12 namespace content { 11 namespace components {
13 12
14 namespace webcrypto { 13 namespace webcrypto {
15 14
16 // Status indicates whether an operation completed successfully, or with an 15 // Status indicates whether an operation completed successfully, or with an
17 // error. The error is used for verification in unit-tests, as well as for 16 // error. The error is used for verification in unit-tests, as well as for
18 // display to the user. 17 // display to the user.
19 // 18 //
20 // As such, it is important that errors DO NOT reveal any sensitive material 19 // As such, it is important that errors DO NOT reveal any sensitive material
21 // (like key bytes). 20 // (like key bytes).
22 class CONTENT_EXPORT Status { 21 class Status {
23 public: 22 public:
24 Status() : type_(TYPE_ERROR) {} 23 Status() : type_(TYPE_ERROR) {}
25 24
26 // Returns true if the Status represents an error (any one of them). 25 // Returns true if the Status represents an error (any one of them).
27 bool IsError() const; 26 bool IsError() const;
28 27
29 // Returns true if the Status represent success. 28 // Returns true if the Status represent success.
30 bool IsSuccess() const; 29 bool IsSuccess() const;
31 30
32 // Returns a UTF-8 error message (non-localized) describing the error. 31 // Returns a UTF-8 error message (non-localized) describing the error.
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 // Constructs a success or error without any details. 277 // Constructs a success or error without any details.
279 explicit Status(Type type); 278 explicit Status(Type type);
280 279
281 Type type_; 280 Type type_;
282 blink::WebCryptoErrorType error_type_; 281 blink::WebCryptoErrorType error_type_;
283 std::string error_details_; 282 std::string error_details_;
284 }; 283 };
285 284
286 } // namespace webcrypto 285 } // namespace webcrypto
287 286
288 } // namespace content 287 } // namespace components
289 288
290 #endif // CONTENT_CHILD_WEBCRYPTO_STATUS_H_ 289 #endif // CONTENT_CHILD_WEBCRYPTO_STATUS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698