1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/permissions/permission_request_id.h"
7 #include "base/strings/stringprintf.h"
9 PermissionRequestID::PermissionRequestID(int render_process_id
,
13 : render_process_id_(render_process_id
),
14 render_frame_id_(render_frame_id
),
15 request_id_(request_id
),
19 PermissionRequestID::~PermissionRequestID() {
22 bool PermissionRequestID::operator==(const PermissionRequestID
& other
) const {
23 return render_process_id_
== other
.render_process_id_
&&
24 render_frame_id_
== other
.render_frame_id_
&&
25 request_id_
== other
.request_id_
&&
26 origin_
== other
.origin_
;
29 bool PermissionRequestID::operator!=(const PermissionRequestID
& other
) const {
30 return !operator==(other
);
33 std::string
PermissionRequestID::ToString() const {
34 return base::StringPrintf("%d,%d,%d,%s",
38 origin_
.spec().c_str());