| 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 "chrome/browser/chromeos/attestation/platform_verification_flow.h" | 5 #include "chrome/browser/chromeos/attestation/platform_verification_flow.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 const std::string& challenge, | 193 const std::string& challenge, |
| 194 const ChallengeCallback& callback) { | 194 const ChallengeCallback& callback) { |
| 195 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 195 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 196 | 196 |
| 197 if (!delegate_->GetURL(web_contents).is_valid()) { | 197 if (!delegate_->GetURL(web_contents).is_valid()) { |
| 198 LOG(WARNING) << "PlatformVerificationFlow: Invalid URL."; | 198 LOG(WARNING) << "PlatformVerificationFlow: Invalid URL."; |
| 199 ReportError(callback, INTERNAL_ERROR); | 199 ReportError(callback, INTERNAL_ERROR); |
| 200 return; | 200 return; |
| 201 } | 201 } |
| 202 | 202 |
| 203 // Note: The following two checks are also checked in GetPermissionStatus. | 203 // Note: The following checks are performed when use of the protected media |
| 204 // Checking them here explicitly to report the correct error type. | 204 // identifier is indicated. The first two in GetPermissionStatus and the third |
| 205 // in DecidePermission. |
| 206 // In Chrome, the result of the first and third could have changed in the |
| 207 // interim, but the mode cannot change. |
| 208 // TODO(ddorwin): Share more code for the first two checks with |
| 209 // ProtectedMediaIdentifierPermissionContext:: |
| 210 // IsProtectedMediaIdentifierEnabled(). |
| 205 | 211 |
| 206 if (!IsAttestationAllowedByPolicy()) { | 212 if (!IsAttestationAllowedByPolicy()) { |
| 207 VLOG(1) << "Platform verification not allowed by device policy."; | 213 VLOG(1) << "Platform verification not allowed by device policy."; |
| 208 ReportError(callback, POLICY_REJECTED); | 214 ReportError(callback, POLICY_REJECTED); |
| 209 return; | 215 return; |
| 210 } | 216 } |
| 211 | 217 |
| 212 // TODO(xhwang): Change to DCHECK when prefixed EME support is removed. | |
| 213 // See http://crbug.com/249976 | |
| 214 if (!delegate_->IsInSupportedMode(web_contents)) { | 218 if (!delegate_->IsInSupportedMode(web_contents)) { |
| 215 VLOG(1) << "Platform verification denied because it's not supported in the " | 219 NOTREACHED() << "Platform verification not supported in the current mode."; |
| 216 << "current mode."; | |
| 217 ReportError(callback, PLATFORM_NOT_VERIFIED); | 220 ReportError(callback, PLATFORM_NOT_VERIFIED); |
| 218 return; | 221 return; |
| 219 } | 222 } |
| 220 | 223 |
| 221 if (!delegate_->IsPermittedByUser(web_contents)) { | 224 if (!delegate_->IsPermittedByUser(web_contents)) { |
| 222 VLOG(1) << "Platform verification not permitted by user."; | 225 VLOG(1) << "Platform verification not permitted by user."; |
| 223 ReportError(callback, USER_REJECTED); | 226 ReportError(callback, USER_REJECTED); |
| 224 return; | 227 return; |
| 225 } | 228 } |
| 226 | 229 |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 if (!operation_success) { | 428 if (!operation_success) { |
| 426 LOG(WARNING) << "PlatformVerificationFlow: Failed to renew platform " | 429 LOG(WARNING) << "PlatformVerificationFlow: Failed to renew platform " |
| 427 "certificate."; | 430 "certificate."; |
| 428 return; | 431 return; |
| 429 } | 432 } |
| 430 VLOG(1) << "Certificate successfully renewed."; | 433 VLOG(1) << "Certificate successfully renewed."; |
| 431 } | 434 } |
| 432 | 435 |
| 433 } // namespace attestation | 436 } // namespace attestation |
| 434 } // namespace chromeos | 437 } // namespace chromeos |
| OLD | NEW |