| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_CHILD_PERMISSIONS_PERMISSION_MANAGER_THREAD_PROXY_H_ | 5 #ifndef CONTENT_CHILD_PERMISSIONS_PERMISSION_DISPATCHER_THREAD_PROXY_H_ |
| 6 #define CONTENT_CHILD_PERMISSIONS_PERMISSION_MANAGER_THREAD_PROXY_H_ | 6 #define CONTENT_CHILD_PERMISSIONS_PERMISSION_DISPATCHER_THREAD_PROXY_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/id_map.h" | 9 #include "base/id_map.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "content/child/worker_task_runner.h" | 12 #include "content/child/worker_task_runner.h" |
| 13 #include "third_party/WebKit/public/platform/modules/permissions/WebPermissionCl
ient.h" | 13 #include "third_party/WebKit/public/platform/modules/permissions/WebPermissionCl
ient.h" |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class SingleThreadTaskRunner; | 16 class SingleThreadTaskRunner; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 | 20 |
| 21 class PermissionManager; | 21 class PermissionDispatcher; |
| 22 | 22 |
| 23 class PermissionManagerThreadProxy : | 23 class PermissionDispatcherThreadProxy : |
| 24 public blink::WebPermissionClient, | 24 public blink::WebPermissionClient, |
| 25 public WorkerTaskRunner::Observer { | 25 public WorkerTaskRunner::Observer { |
| 26 public: | 26 public: |
| 27 static PermissionManagerThreadProxy* GetThreadInstance( | 27 static PermissionDispatcherThreadProxy* GetThreadInstance( |
| 28 base::SingleThreadTaskRunner* main_thread_task_runner, | 28 base::SingleThreadTaskRunner* main_thread_task_runner, |
| 29 PermissionManager* permissions_manager); | 29 PermissionDispatcher* permissions_dispatcher); |
| 30 | 30 |
| 31 // blink::WebPermissionClient implementation. | 31 // blink::WebPermissionClient implementation. |
| 32 virtual void queryPermission(blink::WebPermissionType type, | 32 virtual void queryPermission(blink::WebPermissionType type, |
| 33 const blink::WebURL& origin, | 33 const blink::WebURL& origin, |
| 34 blink::WebPermissionQueryCallback* callback); | 34 blink::WebPermissionQueryCallback* callback); |
| 35 | 35 |
| 36 // WorkerTaskRunner::Observer implementation. | 36 // WorkerTaskRunner::Observer implementation. |
| 37 void OnWorkerRunLoopStopped() override; | 37 void OnWorkerRunLoopStopped() override; |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 PermissionManagerThreadProxy( | 40 PermissionDispatcherThreadProxy( |
| 41 base::SingleThreadTaskRunner* main_thread_task_runner, | 41 base::SingleThreadTaskRunner* main_thread_task_runner, |
| 42 PermissionManager* permissions_manager); | 42 PermissionDispatcher* permissions_dispatcher); |
| 43 | 43 |
| 44 virtual ~PermissionManagerThreadProxy(); | 44 virtual ~PermissionDispatcherThreadProxy(); |
| 45 | 45 |
| 46 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 46 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
| 47 PermissionManager* permissions_manager_; | 47 PermissionDispatcher* permission_dispatcher_; |
| 48 | 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(PermissionManagerThreadProxy); | 49 DISALLOW_COPY_AND_ASSIGN(PermissionDispatcherThreadProxy); |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 } // namespace content | 52 } // namespace content |
| 53 | 53 |
| 54 #endif // CONTENT_CHILD_PERMISSIONS_PERMISSIONS_MANAGER_THREAD_PROXY_H_ | 54 #endif // CONTENT_CHILD_PERMISSIONS_PERMISSION_DISPATCHER_THREAD_PROXY_H_ |
| OLD | NEW |