OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/browser/media/webrtc_identity_store_backend.h" | 5 #include "content/browser/media/webrtc_identity_store_backend.h" |
6 | 6 |
| 7 #include <tuple> |
| 8 |
7 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
8 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
9 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_vector.h" |
10 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
11 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
12 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
13 #include "sql/statement.h" | 15 #include "sql/statement.h" |
14 #include "sql/transaction.h" | 16 #include "sql/transaction.h" |
15 #include "storage/browser/quota/special_storage_policy.h" | 17 #include "storage/browser/quota/special_storage_policy.h" |
16 #include "url/gurl.h" | 18 #include "url/gurl.h" |
(...skipping 29 matching lines...) Expand all Loading... |
46 "certificate BLOB NOT NULL," | 48 "certificate BLOB NOT NULL," |
47 "private_key BLOB NOT NULL," | 49 "private_key BLOB NOT NULL," |
48 "creation_time INTEGER)"); | 50 "creation_time INTEGER)"); |
49 } | 51 } |
50 | 52 |
51 struct WebRTCIdentityStoreBackend::IdentityKey { | 53 struct WebRTCIdentityStoreBackend::IdentityKey { |
52 IdentityKey(const GURL& origin, const std::string& identity_name) | 54 IdentityKey(const GURL& origin, const std::string& identity_name) |
53 : origin(origin), identity_name(identity_name) {} | 55 : origin(origin), identity_name(identity_name) {} |
54 | 56 |
55 bool operator<(const IdentityKey& other) const { | 57 bool operator<(const IdentityKey& other) const { |
56 return origin < other.origin || | 58 return std::tie(origin, identity_name) < |
57 (origin == other.origin && identity_name < other.identity_name); | 59 std::tie(other.origin, other.identity_name); |
58 } | 60 } |
59 | 61 |
60 GURL origin; | 62 GURL origin; |
61 std::string identity_name; | 63 std::string identity_name; |
62 }; | 64 }; |
63 | 65 |
64 struct WebRTCIdentityStoreBackend::Identity { | 66 struct WebRTCIdentityStoreBackend::Identity { |
65 Identity(const std::string& common_name, | 67 Identity(const std::string& common_name, |
66 const std::string& certificate, | 68 const std::string& certificate, |
67 const std::string& private_key) | 69 const std::string& private_key) |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 NOTREACHED(); | 596 NOTREACHED(); |
595 break; | 597 break; |
596 } | 598 } |
597 } | 599 } |
598 | 600 |
599 if (!transaction.Commit()) | 601 if (!transaction.Commit()) |
600 DVLOG(2) << "Failed to commit the transaction."; | 602 DVLOG(2) << "Failed to commit the transaction."; |
601 } | 603 } |
602 | 604 |
603 } // namespace content | 605 } // namespace content |
OLD | NEW |