OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/extensions/api/identity/identity_api.h" | 5 #include "chrome/browser/extensions/api/identity/identity_api.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // to live any time they are returned. | 114 // to live any time they are returned. |
115 time_to_live -= base::TimeDelta::FromMinutes(20); | 115 time_to_live -= base::TimeDelta::FromMinutes(20); |
116 | 116 |
117 base::TimeDelta zero_delta; | 117 base::TimeDelta zero_delta; |
118 if (time_to_live < zero_delta) | 118 if (time_to_live < zero_delta) |
119 time_to_live = zero_delta; | 119 time_to_live = zero_delta; |
120 | 120 |
121 expiration_time_ = base::Time::Now() + time_to_live; | 121 expiration_time_ = base::Time::Now() + time_to_live; |
122 } | 122 } |
123 | 123 |
| 124 IdentityTokenCacheValue::IdentityTokenCacheValue( |
| 125 const IdentityTokenCacheValue& other) = default; |
| 126 |
124 IdentityTokenCacheValue::~IdentityTokenCacheValue() {} | 127 IdentityTokenCacheValue::~IdentityTokenCacheValue() {} |
125 | 128 |
126 IdentityTokenCacheValue::CacheValueStatus IdentityTokenCacheValue::status() | 129 IdentityTokenCacheValue::CacheValueStatus IdentityTokenCacheValue::status() |
127 const { | 130 const { |
128 if (is_expired()) | 131 if (is_expired()) |
129 return IdentityTokenCacheValue::CACHE_STATUS_NOTFOUND; | 132 return IdentityTokenCacheValue::CACHE_STATUS_NOTFOUND; |
130 else | 133 else |
131 return status_; | 134 return status_; |
132 } | 135 } |
133 | 136 |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 if (redirect_url.GetWithEmptyPath() == final_url_prefix_) { | 1014 if (redirect_url.GetWithEmptyPath() == final_url_prefix_) { |
1012 SetResult(new base::StringValue(redirect_url.spec())); | 1015 SetResult(new base::StringValue(redirect_url.spec())); |
1013 SendResponse(true); | 1016 SendResponse(true); |
1014 if (auth_flow_) | 1017 if (auth_flow_) |
1015 auth_flow_.release()->DetachDelegateAndDelete(); | 1018 auth_flow_.release()->DetachDelegateAndDelete(); |
1016 Release(); // Balanced in RunAsync. | 1019 Release(); // Balanced in RunAsync. |
1017 } | 1020 } |
1018 } | 1021 } |
1019 | 1022 |
1020 } // namespace extensions | 1023 } // namespace extensions |
OLD | NEW |