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

Unified Diff: chrome/browser/android/digital_asset_links/digital_asset_links_handler.h

Issue 2767333006: Add Digital Asset Links verification for postMessage API (Closed)
Patch Set: fix hex conversion logic Created 3 years, 8 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
Index: chrome/browser/android/digital_asset_links/digital_asset_links_handler.h
diff --git a/chrome/browser/android/digital_asset_links/digital_asset_links_handler.h b/chrome/browser/android/digital_asset_links/digital_asset_links_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..c9e22a32850f652656542f2bc9659c1599fe4c45
--- /dev/null
+++ b/chrome/browser/android/digital_asset_links/digital_asset_links_handler.h
@@ -0,0 +1,53 @@
+// Copyright (c) 2017 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_ANDROID_DIGITAL_ASSET_LINKS_DIGITAL_ASSET_LINKS_HANDLER_H_
+#define CHROME_BROWSER_ANDROID_DIGITAL_ASSET_LINKS_DIGITAL_ASSET_LINKS_HANDLER_H_
+
+#include "net/url_request/url_fetcher.h"
+#include "net/url_request/url_fetcher_delegate.h"
+#include "net/url_request/url_request_context_getter.h"
+
+namespace base {
+class DictionaryValue;
+}
+
+namespace digital_asset_links {
+
+extern const char kDigitalAssetLinksCheckResponseKeyLinked[];
+
+typedef base::Callback<void(std::unique_ptr<base::DictionaryValue>)>
+ RelationshipCheckResultCallback;
+
+class DigitalAssetLinksHandler : public net::URLFetcherDelegate {
+ public:
+ DigitalAssetLinksHandler(
+ const scoped_refptr<net::URLRequestContextGetter>& request_context);
+ ~DigitalAssetLinksHandler() override;
+
+ bool CheckDigitalAssetLinkRelationship(
+ RelationshipCheckResultCallback listener,
+ const std::string& web_domain,
+ const std::string& package_name,
+ const std::string& fingerprint,
+ const std::string& relationship);
+
+ private:
+ // net::URLFetcherDelegate:
+ void OnURLFetchComplete(const net::URLFetcher* source) override;
+
+ // URL request context.
Benoit L 2017/04/07 15:04:55 nit: Remove this comment? (seems redundant with th
Yusuf 2017/04/07 23:38:41 Done.
+ scoped_refptr<net::URLRequestContextGetter> request_context_;
+
+ std::unique_ptr<net::URLFetcher> url_fetcher_;
+
+ // The callback for receiving a URLFether result.
Benoit L 2017/04/07 15:04:54 nit: URLFetcher.
Yusuf 2017/04/07 23:38:41 Done.
+ RelationshipCheckResultCallback callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(DigitalAssetLinksHandler);
+};
+
+} // namespace digital_asset_links
+
+#endif // CHROME_BROWSER_ANDROID_DIGITAL_ASSET_LINKS_DIGITAL_ASSET_LINKS_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698