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

Unified Diff: chrome/browser/chromeos/attestation/platform_verification_impl.h

Issue 1053773007: Add Platform Verification Mojo Services. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/DEPS ('k') | chrome/browser/chromeos/attestation/platform_verification_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/attestation/platform_verification_impl.h
diff --git a/chrome/browser/chromeos/attestation/platform_verification_impl.h b/chrome/browser/chromeos/attestation/platform_verification_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..1f4549f3971d43b3f5ed7a68125b06920b392741
--- /dev/null
+++ b/chrome/browser/chromeos/attestation/platform_verification_impl.h
@@ -0,0 +1,59 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_IMPL_H_
+#define CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_IMPL_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/callback.h"
+#include "base/memory/ref_counted.h"
+#include "chrome/browser/chromeos/attestation/platform_verification_flow.h"
+#include "content/public/browser/render_frame_host.h"
+#include "media/mojo/interfaces/platform_verification.mojom.h"
+#include "third_party/mojo/src/mojo/public/cpp/bindings/interface_impl.h"
+
+namespace chromeos {
+namespace attestation {
+
+// Implements media::interfaces::PlatformVerification on ChromeOS using
+// PlatformVerificationFlow. Can only be used on the UI thread because
+// PlatformVerificationFlow lives on the UI thread.
+class PlatformVerificationImpl
+ : public mojo::InterfaceImpl<media::interfaces::PlatformVerification> {
+ public:
+ static void Create(
+ content::RenderFrameHost* render_frame_host,
+ mojo::InterfaceRequest<media::interfaces::PlatformVerification> request);
+
+ explicit PlatformVerificationImpl(
+ content::RenderFrameHost* render_frame_host);
+ ~PlatformVerificationImpl() override;
+
+ // mojo::InterfaceImpl<PlatformVerification> implementation.
+ void ChallengePlatform(const mojo::String& service_id,
+ const mojo::String& challenge,
+ const ChallengePlatformCallback& callback) override;
+
+ private:
+ using Result = PlatformVerificationFlow::Result;
+
+ void OnPlatformChallenged(const ChallengePlatformCallback& callback,
+ Result result,
+ const std::string& signed_data,
+ const std::string& signature,
+ const std::string& platform_key_certificate);
+
+ content::RenderFrameHost* const render_frame_host_;
+
+ scoped_refptr<PlatformVerificationFlow> platform_verification_flow_;
+
+ base::WeakPtrFactory<PlatformVerificationImpl> weak_factory_;
+};
+
+} // namespace attestation
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_ATTESTATION_PLATFORM_VERIFICATION_IMPL_H_
« no previous file with comments | « chrome/browser/chromeos/DEPS ('k') | chrome/browser/chromeos/attestation/platform_verification_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698