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

Side by Side Diff: base/unguessable_token.cc

Issue 2353663003: Add base::UnguessableToken << operator (Closed)
Patch Set: Addressed comment. Created 4 years, 3 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
« no previous file with comments | « base/unguessable_token.h ('k') | base/unguessable_token_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "base/unguessable_token.h" 5 #include "base/unguessable_token.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/rand_util.h" 8 #include "base/rand_util.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 10
(...skipping 16 matching lines...) Expand all
27 } 27 }
28 28
29 // static 29 // static
30 UnguessableToken UnguessableToken::Deserialize(uint64_t high, uint64_t low) { 30 UnguessableToken UnguessableToken::Deserialize(uint64_t high, uint64_t low) {
31 // Receiving a zeroed out UnguessableToken from another process means that it 31 // Receiving a zeroed out UnguessableToken from another process means that it
32 // was never initialized via Create(). Treat this case as a security issue. 32 // was never initialized via Create(). Treat this case as a security issue.
33 DCHECK(!(high == 0 && low == 0)); 33 DCHECK(!(high == 0 && low == 0));
34 return UnguessableToken(high, low); 34 return UnguessableToken(high, low);
35 } 35 }
36 36
37 std::ostream& operator<<(std::ostream& out, const UnguessableToken& token) {
38 return out << token.ToString();
39 }
40
37 } // namespace base 41 } // namespace base
OLDNEW
« no previous file with comments | « base/unguessable_token.h ('k') | base/unguessable_token_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698