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

Unified Diff: android_webview/native/permission/permission_request_handler.h

Issue 274443002: Implement PreauthorizePermission (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 6 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
Index: android_webview/native/permission/permission_request_handler.h
diff --git a/android_webview/native/permission/permission_request_handler.h b/android_webview/native/permission/permission_request_handler.h
index d4d91b64bfc6738f2aa4c095b343831fbcd03946..3acb497654edca30f9396b8cd1e79663f6b4a367 100644
--- a/android_webview/native/permission/permission_request_handler.h
+++ b/android_webview/native/permission/permission_request_handler.h
@@ -5,6 +5,7 @@
#ifndef ANDROID_WEBVIEW_NATIVE_PERMISSION_PERMISSION_REQUEST_HANDLER_H
#define ANDROID_WEBVIEW_NATIVE_PERMISSION_PERMISSION_REQUEST_HANDLER_H
+#include <map>
#include <vector>
#include "base/memory/scoped_ptr.h"
@@ -32,6 +33,9 @@ class PermissionRequestHandler {
// Cancel the ongoing request initiated by |origin| for accessing |resources|.
void CancelRequest(const GURL& origin, int64 resources);
+ // Allow |origin| to access the |resources|.
+ void PreauthorizePermission(const GURL& origin, int64 resources);
+
private:
friend class TestPermissionRequestHandler;
@@ -47,11 +51,16 @@ class PermissionRequestHandler {
// Remove the invalid requests from requests_.
void PruneRequests();
+ // Return true if |origin| were preauthorized to access |resources|.
+ bool Preauthorized(const GURL& origin, int64 resources);
+
PermissionRequestHandlerClient* client_;
// A list of ongoing requests.
std::vector<base::WeakPtr<AwPermissionRequest> > requests_;
+ std::map<std::string, int64> preauthorized_permission_;
+
DISALLOW_COPY_AND_ASSIGN(PermissionRequestHandler);
};
« no previous file with comments | « android_webview/native/aw_contents.cc ('k') | android_webview/native/permission/permission_request_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698