OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/content_settings/permission_request_id.h" | 5 #include "chrome/browser/content_settings/permission_request_id.h" |
6 | 6 |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 | 8 |
9 | 9 |
10 PermissionRequestID::PermissionRequestID(int render_process_id, | 10 PermissionRequestID::PermissionRequestID(int render_process_id, |
11 int render_view_id, | 11 int render_view_id, |
12 int bridge_id) | 12 int bridge_id, |
| 13 int group_id) |
13 : render_process_id_(render_process_id), | 14 : render_process_id_(render_process_id), |
14 render_view_id_(render_view_id), | 15 render_view_id_(render_view_id), |
15 bridge_id_(bridge_id) { | 16 bridge_id_(bridge_id), |
| 17 group_id_(group_id) { |
16 } | 18 } |
17 | 19 |
18 PermissionRequestID::~PermissionRequestID() { | 20 PermissionRequestID::~PermissionRequestID() { |
19 } | 21 } |
20 | 22 |
21 bool PermissionRequestID::Equals(const PermissionRequestID& other) const { | 23 bool PermissionRequestID::Equals(const PermissionRequestID& other) const { |
22 return IsForSameTabAs(other) && (bridge_id_ == other.bridge_id_); | 24 return IsForSameTabAs(other) && (bridge_id_ == other.bridge_id_); |
23 } | 25 } |
24 | 26 |
25 bool PermissionRequestID::IsForSameTabAs( | 27 bool PermissionRequestID::IsForSameTabAs( |
26 const PermissionRequestID& other) const { | 28 const PermissionRequestID& other) const { |
27 return (render_process_id_ == other.render_process_id_) && | 29 return (render_process_id_ == other.render_process_id_) && |
28 (render_view_id_ == other.render_view_id_); | 30 (render_view_id_ == other.render_view_id_); |
29 } | 31 } |
30 | 32 |
31 std::string PermissionRequestID::ToString() const { | 33 std::string PermissionRequestID::ToString() const { |
32 return base::StringPrintf("%d,%d,%d", render_process_id_, render_view_id_, | 34 return base::StringPrintf("%d,%d,%d,%d", |
33 bridge_id_); | 35 render_process_id_, |
| 36 render_view_id_, |
| 37 bridge_id_, |
| 38 group_id_); |
34 } | 39 } |
OLD | NEW |