Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / chrome / browser / permissions / permission_request_id.h
blob25da709342b8853e953dd8ba5a63e51566186c3f
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 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_ID_H_
6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_ID_H_
8 #include <string>
10 #include "url/gurl.h"
12 // Uniquely identifies a particular permission request.
13 // None of the different attributes (render_process_id, render_frame_id or
14 // request_id) is enough to compare two requests. In order to check if
15 // a request is the same as another one, consumers of this class should use
16 // the operator== or operator!=.
17 class PermissionRequestID {
18 public:
19 PermissionRequestID(int render_process_id,
20 int render_frame_id,
21 int request_id);
22 ~PermissionRequestID();
24 PermissionRequestID(const PermissionRequestID&) = default;
25 PermissionRequestID& operator=(const PermissionRequestID&) = default;
27 int render_process_id() const { return render_process_id_; }
28 int render_frame_id() const { return render_frame_id_; }
29 int request_id() const { return request_id_; }
31 bool operator==(const PermissionRequestID& other) const;
32 bool operator!=(const PermissionRequestID& other) const;
34 std::string ToString() const;
36 private:
37 int render_process_id_;
38 int render_frame_id_;
39 int request_id_;
42 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_ID_H_