diff options
author | mlamouri <mlamouri@chromium.org> | 2015-06-03 10:30:28 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-03 17:30:51 +0000 |
commit | 5fc460f2bd3055f9142567a7b6e12d1b9e17de3c (patch) | |
tree | f4570a97553c84229d435147fa8c80da847532b2 /components/content_settings | |
parent | 6501fe16138827c2da534f7c556fd9a9f8bb05ce (diff) | |
download | chromium_src-5fc460f2bd3055f9142567a7b6e12d1b9e17de3c.zip chromium_src-5fc460f2bd3055f9142567a7b6e12d1b9e17de3c.tar.gz chromium_src-5fc460f2bd3055f9142567a7b6e12d1b9e17de3c.tar.bz2 |
Use RenderFrameHost for ::RequestPermission() and ::CancelPermission().
This is using RenderFrameHost instead of WebContents so it's possible
to know to associate a request and a frame. Each request will then be
defined by its process id, its frame id and its request id, making it
entirely unique.
BUG=491923
Review URL: https://codereview.chromium.org/1158813002
Cr-Commit-Position: refs/heads/master@{#332635}
Diffstat (limited to 'components/content_settings')
-rw-r--r-- | components/content_settings/core/common/permission_request_id.cc | 18 | ||||
-rw-r--r-- | components/content_settings/core/common/permission_request_id.h | 7 |
2 files changed, 10 insertions, 15 deletions
diff --git a/components/content_settings/core/common/permission_request_id.cc b/components/content_settings/core/common/permission_request_id.cc index 0d963a4..7d7eccb 100644 --- a/components/content_settings/core/common/permission_request_id.cc +++ b/components/content_settings/core/common/permission_request_id.cc @@ -7,11 +7,11 @@ #include "base/strings/stringprintf.h" PermissionRequestID::PermissionRequestID(int render_process_id, - int render_view_id, + int render_frame_id, int bridge_id, const GURL& origin) : render_process_id_(render_process_id), - render_view_id_(render_view_id), + render_frame_id_(render_frame_id), bridge_id_(bridge_id), origin_(origin) { } @@ -20,20 +20,16 @@ PermissionRequestID::~PermissionRequestID() { } bool PermissionRequestID::Equals(const PermissionRequestID& other) const { - return IsForSameTabAs(other) && (bridge_id_ == other.bridge_id_) && - (origin_ == other.origin()); -} - -bool PermissionRequestID::IsForSameTabAs( - const PermissionRequestID& other) const { - return (render_process_id_ == other.render_process_id_) && - (render_view_id_ == other.render_view_id_); + return render_process_id_ == other.render_process_id_ && + render_frame_id_ == other.render_frame_id_ && + bridge_id_ == other.bridge_id_ && + origin_ == other.origin_; } std::string PermissionRequestID::ToString() const { return base::StringPrintf("%d,%d,%d,%s", render_process_id_, - render_view_id_, + render_frame_id_, bridge_id_, origin_.spec().c_str()); } diff --git a/components/content_settings/core/common/permission_request_id.h b/components/content_settings/core/common/permission_request_id.h index a9252a1..6b798d4 100644 --- a/components/content_settings/core/common/permission_request_id.h +++ b/components/content_settings/core/common/permission_request_id.h @@ -13,23 +13,22 @@ class PermissionRequestID { public: PermissionRequestID(int render_process_id, - int render_view_id, + int render_frame_id, int bridge_id, const GURL& origin); ~PermissionRequestID(); int render_process_id() const { return render_process_id_; } - int render_view_id() const { return render_view_id_; } + int render_frame_id() const { return render_frame_id_; } int bridge_id() const { return bridge_id_; } GURL origin() const { return origin_; } bool Equals(const PermissionRequestID& other) const; - bool IsForSameTabAs(const PermissionRequestID& other) const; std::string ToString() const; private: int render_process_id_; - int render_view_id_; + int render_frame_id_; // Id unique to this instance. int bridge_id_; // Needed for permission checks that are based on origin. |