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

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: lizeb@ test comments 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..b78d12ecb934da68f7225faafb8987d3bd9662c9
--- /dev/null
+++ b/chrome/browser/android/digital_asset_links/digital_asset_links_handler.h
@@ -0,0 +1,52 @@
+// 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>)>
nyquist 2017/04/19 06:35:57 Nit: On a failure what will the parameter to this
Yusuf 2017/04/26 00:51:36 Documented the failure case. On success depends on
nyquist 2017/04/27 04:38:25 Awesome with the referral to the REST API. Very he
+ RelationshipCheckResultCallback;
+
+class DigitalAssetLinksHandler : public net::URLFetcherDelegate {
nyquist 2017/04/19 06:35:57 Nit: What is this class used for? What is the life
Yusuf 2017/04/26 00:51:36 Done.
+ public:
+ DigitalAssetLinksHandler(
nyquist 2017/04/19 06:35:57 Nit: Single argument constructors should be marked
Yusuf 2017/04/26 00:51:36 Done.
+ const scoped_refptr<net::URLRequestContextGetter>& request_context);
+ ~DigitalAssetLinksHandler() override;
+
+ bool CheckDigitalAssetLinkRelationship(
nyquist 2017/04/19 06:35:57 Nit: Could you explain what this method does? What
Yusuf 2017/04/26 00:51:36 Done.
+ 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;
+
+ scoped_refptr<net::URLRequestContextGetter> request_context_;
+
+ std::unique_ptr<net::URLFetcher> url_fetcher_;
+
+ // The callback for receiving a URLFetcher result.
+ RelationshipCheckResultCallback callback_;
nyquist 2017/04/19 06:35:57 So, this is a little bit confusing. It's passed in
Yusuf 2017/04/26 00:51:36 Done.
+
+ 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