diff options
author | lalitm <lalitm@google.com> | 2015-10-02 04:34:17 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-02 11:35:17 +0000 |
commit | 27583e9b340401a935ee45c5110506cc5a858c59 (patch) | |
tree | 4d8a910438c51982d241c9cf6d08b544a4b2659b /chromecast | |
parent | 3f147b554f12984bc314db586ea1d0b99426507d (diff) | |
download | chromium_src-27583e9b340401a935ee45c5110506cc5a858c59.zip chromium_src-27583e9b340401a935ee45c5110506cc5a858c59.tar.gz chromium_src-27583e9b340401a935ee45c5110506cc5a858c59.tar.bz2 |
permissions: handle request ids for permissions in permission manager
Until this point permission service was generating ids and passing these to
permission manager to use. However, since each web_contents has its own
service, these ids are not unique.
If data needs to be stored in manager a string representation of the request
needs to be used which is ugly to say the least.
Switch to permission manager generating request ids so they are unique to the
manager and return this when request occurs for use by service to cancel.
BUG=516626
Review URL: https://codereview.chromium.org/1342833002
Cr-Commit-Position: refs/heads/master@{#352002}
Diffstat (limited to 'chromecast')
-rw-r--r-- | chromecast/browser/cast_permission_manager.cc | 6 | ||||
-rw-r--r-- | chromecast/browser/cast_permission_manager.h | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/chromecast/browser/cast_permission_manager.cc b/chromecast/browser/cast_permission_manager.cc index 047a6ff..eaa6b94 100644 --- a/chromecast/browser/cast_permission_manager.cc +++ b/chromecast/browser/cast_permission_manager.cc @@ -18,15 +18,15 @@ CastPermissionManager::CastPermissionManager() CastPermissionManager::~CastPermissionManager() { } -void CastPermissionManager::RequestPermission( +int CastPermissionManager::RequestPermission( content::PermissionType permission, content::RenderFrameHost* render_frame_host, - int request_id, const GURL& origin, bool user_gesture, const base::Callback<void(content::PermissionStatus)>& callback) { LOG(INFO) << __FUNCTION__ << ": " << static_cast<int>(permission); callback.Run(content::PermissionStatus::PERMISSION_STATUS_GRANTED); + return kNoPendingOperation; } void CastPermissionManager::CancelPermissionRequest( @@ -61,7 +61,7 @@ int CastPermissionManager::SubscribePermissionStatusChange( const GURL& requesting_origin, const GURL& embedding_origin, const base::Callback<void(content::PermissionStatus)>& callback) { - return -1; + return kNoPendingOperation; } void CastPermissionManager::UnsubscribePermissionStatusChange( diff --git a/chromecast/browser/cast_permission_manager.h b/chromecast/browser/cast_permission_manager.h index 237eff9..5eab5a1 100644 --- a/chromecast/browser/cast_permission_manager.h +++ b/chromecast/browser/cast_permission_manager.h @@ -18,10 +18,9 @@ class CastPermissionManager : public content::PermissionManager { ~CastPermissionManager() override; // content::PermissionManager implementation: - void RequestPermission( + int RequestPermission( content::PermissionType permission, content::RenderFrameHost* render_frame_host, - int request_id, const GURL& requesting_origin, bool user_gesture, const base::Callback<void(content::PermissionStatus)>& callback) override; |