summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/worker_content_settings_client_proxy.h
blob: 1e843a233b59fa63c16555109551a81c9ba0ee65 (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
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_RENDERER_WORKER_CONTENT_SETTINGS_CLIENT_PROXY_H_
#define CHROME_RENDERER_WORKER_CONTENT_SETTINGS_CLIENT_PROXY_H_

#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "third_party/WebKit/public/web/WebWorkerContentSettingsClientProxy.h"
#include "url/gurl.h"

namespace IPC {
class SyncMessageFilter;
}

namespace content {
class RenderFrame;
}

namespace blink {
class WebFrame;
}

// This proxy is created on the main renderer thread then passed onto
// the blink's worker thread.
class WorkerContentSettingsClientProxy
    : public blink::WebWorkerContentSettingsClientProxy {
 public:
  WorkerContentSettingsClientProxy(content::RenderFrame* render_frame,
                              blink::WebFrame* frame);
  ~WorkerContentSettingsClientProxy() override;

  // WebWorkerContentSettingsClientProxy overrides.
  bool requestFileSystemAccessSync() override;
  bool allowIndexedDB(const blink::WebString& name) override;

 private:
  // Loading document context for this worker.
  const int routing_id_;
  bool is_unique_origin_;
  GURL document_origin_url_;
  GURL top_frame_origin_url_;
  scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_;

  DISALLOW_COPY_AND_ASSIGN(WorkerContentSettingsClientProxy);
};

#endif  // CHROME_RENDERER_WORKER_CONTENT_SETTINGS_CLIENT_PROXY_H_