~rpadovani/oxide/type-info

« back to all changes in this revision

Viewing changes to shared/browser/permissions/oxide_permission_request_id.cc

  • Committer: Riccardo Padovani
  • Date: 2015-10-19 07:56:29 UTC
  • mfrom: (1088.1.131 oxide)
  • Revision ID: riccardo@rpadovani.com-20151019075629-z0mlhwlb9xflkovw
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// vim:expandtab:shiftwidth=2:tabstop=2:
2
 
// Copyright (C) 2014-2015 Canonical Ltd.
3
 
 
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.
8
 
 
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.
13
 
 
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
17
 
 
18
 
#include "oxide_permission_request_id.h"
19
 
 
20
 
namespace oxide {
21
 
 
22
 
PermissionRequestID::PermissionRequestID(int render_process_id,
23
 
                                         int render_frame_id,
24
 
                                         int request_id,
25
 
                                         const GURL& origin)
26
 
    : render_process_id_(render_process_id),
27
 
      render_frame_id_(render_frame_id),
28
 
      request_id_(request_id),
29
 
      origin_(origin) {}
30
 
 
31
 
PermissionRequestID::PermissionRequestID()
32
 
    : render_process_id_(-1),
33
 
      render_frame_id_(-1),
34
 
      request_id_(-1) {}
35
 
 
36
 
PermissionRequestID::~PermissionRequestID() {}
37
 
 
38
 
bool PermissionRequestID::IsValid() const {
39
 
  return render_process_id_ > -1 && render_frame_id_ > -1 && request_id_ > -1;
40
 
}
41
 
 
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_;
47
 
}
48
 
 
49
 
} // namespace oxide