Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_IMPL_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_IMPL_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/callback.h" | |
| 12 #include "base/memory/ref_counted.h" | |
| 13 #include "chrome/browser/chromeos/attestation/platform_verification_flow.h" | |
| 14 #include "content/public/browser/render_frame_host.h" | |
| 15 #include "media/mojo/interfaces/platform_verification.mojom.h" | |
| 16 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_impl.h" | |
| 17 | |
| 18 namespace chromeos { | |
| 19 namespace attestation { | |
| 20 | |
| 21 class PlatformVerificationImpl | |
|
Darren Krahn
2015/05/06 19:02:40
Class documentation please. Please mention threadi
xhwang
2015/05/07 00:27:37
Done.
| |
| 22 : public mojo::InterfaceImpl<media::interfaces::PlatformVerification> { | |
| 23 public: | |
| 24 static void Create( | |
| 25 content::RenderFrameHost* render_frame_host, | |
| 26 mojo::InterfaceRequest<media::interfaces::PlatformVerification> request); | |
| 27 | |
| 28 explicit PlatformVerificationImpl( | |
| 29 content::RenderFrameHost* render_frame_host); | |
| 30 ~PlatformVerificationImpl() override; | |
| 31 | |
| 32 // mojo::InterfaceImpl<PlatformVerification> implementation. | |
| 33 void ChallengePlatform(const mojo::String& service_id, | |
| 34 const mojo::String& challenge, | |
| 35 const ChallengePlatformCallback& callback) override; | |
| 36 | |
| 37 private: | |
| 38 using Result = PlatformVerificationFlow::Result; | |
| 39 | |
| 40 void OnPlatformChallenged(const ChallengePlatformCallback& callback, | |
| 41 Result result, | |
| 42 const std::string& signed_data, | |
| 43 const std::string& signature, | |
| 44 const std::string& platform_key_certificate); | |
| 45 | |
| 46 content::RenderFrameHost* const render_frame_host_; | |
| 47 | |
| 48 scoped_refptr<PlatformVerificationFlow> platform_verification_flow_; | |
| 49 | |
| 50 base::WeakPtrFactory<PlatformVerificationImpl> weak_factory_; | |
| 51 }; | |
| 52 | |
| 53 } // namespace attestation | |
| 54 } // namespace chromeos | |
| 55 | |
| 56 #endif // CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_IMPL_H_ | |
| OLD | NEW |