summaryrefslogtreecommitdiffstats
path: root/src/core/browser_message_filter_qt.h
blob: 0f5721c824f23f33c13fdc3e7315444dc670f2ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#ifndef BROWSER_MESSAGE_FILTER_QT_H
#define BROWSER_MESSAGE_FILTER_QT_H

#include "base/functional/callback.h"
#include "content/public/browser/browser_message_filter.h"

class GURL;
class Profile;

namespace QtWebEngineCore {

class ProfileIODataQt;

class BrowserMessageFilterQt : public content::BrowserMessageFilter
{
public:
    BrowserMessageFilterQt(int render_process_id, Profile *profile);

private:
    bool OnMessageReceived(const IPC::Message& message) override;


    void OnAllowStorageAccess(int render_frame_id,
                              const GURL &origin_url,
                              const GURL &top_origin_url,
                              int storage_type,
                              bool *allowed);

    void OnRequestStorageAccessSync(int render_frame_id,
                                    const GURL &origin_url,
                                    const GURL &top_origin_url,
                                    int storage_type,
                                    IPC::Message *message);
    void OnRequestStorageAccessAsync(int render_frame_id,
                                     int request_id,
                                     const GURL &origin_url,
                                     const GURL &top_origin_url,
                                     int storage_type);
    void OnRequestStorageAccessSyncResponse(IPC::Message *reply_msg,
                                            bool allowed);
    void OnRequestStorageAccessAsyncResponse(int render_frame_id,
                                             int request_id,
                                             bool allowed);
    void OnRequestStorageAccess(int render_frame_id,
                                const GURL &origin_url,
                                const GURL &top_origin_url,
                                int storage_type,
                                base::OnceCallback<void(bool)> callback);

    ProfileIODataQt *m_profileData;
};

} // namespace QtWebEngineCore

#endif // BROWSER_MESSAGE_FILTER_QT_H