1
// vim:expandtab:shiftwidth=2:tabstop=2:
2
// Copyright (C) 2014-2015 Canonical Ltd.
4
// This library is free software; you can redistribute it and/or
5
// modify it under the terms of the GNU Lesser General Public
6
// License as published by the Free Software Foundation; either
7
// version 2.1 of the License, or (at your option) any later version.
9
// This library is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
// Lesser General Public License for more details.
14
// You should have received a copy of the GNU Lesser General Public
15
// License along with this library; if not, write to the Free Software
16
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
#include "oxide_permission_request_id.h"
22
PermissionRequestID::PermissionRequestID(int render_process_id,
26
: render_process_id_(render_process_id),
27
render_frame_id_(render_frame_id),
28
request_id_(request_id),
31
PermissionRequestID::PermissionRequestID()
32
: render_process_id_(-1),
36
PermissionRequestID::~PermissionRequestID() {}
38
bool PermissionRequestID::IsValid() const {
39
return render_process_id_ > -1 && render_frame_id_ > -1 && request_id_ > -1;
42
bool PermissionRequestID::operator==(const PermissionRequestID& other) const {
43
return render_process_id_ == other.render_process_id_ &&
44
render_frame_id_ == other.render_frame_id_ &&
45
request_id_ == other.request_id_ &&
46
origin_ == other.origin_;