Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: content/child/blink_platform_impl.h

Issue 801613004: Implement WebPermissionClient for Document and Worker contexts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: with comments Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_BLINK_PLATFORM_IMPL_H_ 5 #ifndef CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_
6 #define CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_ 6 #define CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/threading/thread_local_storage.h" 9 #include "base/threading/thread_local_storage.h"
10 #include "base/timer/timer.h" 10 #include "base/timer/timer.h"
(...skipping 16 matching lines...) Expand all
27 #include "content/child/webthemeengine_impl_android.h" 27 #include "content/child/webthemeengine_impl_android.h"
28 #endif 28 #endif
29 29
30 namespace base { 30 namespace base {
31 class MessageLoop; 31 class MessageLoop;
32 } 32 }
33 33
34 namespace content { 34 namespace content {
35 class FlingCurveConfiguration; 35 class FlingCurveConfiguration;
36 class NotificationDispatcher; 36 class NotificationDispatcher;
37 class PermissionManager;
37 class PushDispatcher; 38 class PushDispatcher;
38 class ThreadSafeSender; 39 class ThreadSafeSender;
39 class WebBluetoothImpl; 40 class WebBluetoothImpl;
40 class WebCryptoImpl; 41 class WebCryptoImpl;
41 class WebGeofencingProviderImpl; 42 class WebGeofencingProviderImpl;
42 43
43 class CONTENT_EXPORT BlinkPlatformImpl 44 class CONTENT_EXPORT BlinkPlatformImpl
44 : NON_EXPORTED_BASE(public blink::Platform) { 45 : NON_EXPORTED_BASE(public blink::Platform) {
45 public: 46 public:
46 BlinkPlatformImpl(); 47 BlinkPlatformImpl();
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 const blink::WebFloatPoint& velocity, 151 const blink::WebFloatPoint& velocity,
151 const blink::WebSize& cumulative_scroll); 152 const blink::WebSize& cumulative_scroll);
152 virtual void didStartWorkerRunLoop(); 153 virtual void didStartWorkerRunLoop();
153 virtual void didStopWorkerRunLoop(); 154 virtual void didStopWorkerRunLoop();
154 virtual blink::WebCrypto* crypto(); 155 virtual blink::WebCrypto* crypto();
155 virtual blink::WebGeofencingProvider* geofencingProvider(); 156 virtual blink::WebGeofencingProvider* geofencingProvider();
156 virtual blink::WebBluetooth* bluetooth(); 157 virtual blink::WebBluetooth* bluetooth();
157 virtual blink::WebNotificationManager* notificationManager(); 158 virtual blink::WebNotificationManager* notificationManager();
158 virtual blink::WebPushProvider* pushProvider(); 159 virtual blink::WebPushProvider* pushProvider();
159 virtual blink::WebNavigatorConnectProvider* navigatorConnectProvider(); 160 virtual blink::WebNavigatorConnectProvider* navigatorConnectProvider();
161 virtual blink::WebPermissionClient* permissionClient();
160 162
161 void SuspendSharedTimer(); 163 void SuspendSharedTimer();
162 void ResumeSharedTimer(); 164 void ResumeSharedTimer();
163 virtual void OnStartSharedTimer(base::TimeDelta delay) {} 165 virtual void OnStartSharedTimer(base::TimeDelta delay) {}
164 166
165 WebBluetoothImpl* BluetoothImplForTesting() { return bluetooth_.get(); } 167 WebBluetoothImpl* BluetoothImplForTesting() { return bluetooth_.get(); }
166 168
167 virtual blink::WebString domCodeStringFromEnum(int dom_code); 169 virtual blink::WebString domCodeStringFromEnum(int dom_code);
168 virtual int domEnumFromCodeString(const blink::WebString& codeString); 170 virtual int domEnumFromCodeString(const blink::WebString& codeString);
169 171
170 private: 172 private:
171 void DoTimeout() { 173 void DoTimeout() {
172 if (shared_timer_func_ && !shared_timer_suspended_) 174 if (shared_timer_func_ && !shared_timer_suspended_)
173 shared_timer_func_(); 175 shared_timer_func_();
174 } 176 }
175 177
176 void InternalInit(); 178 void InternalInit();
177 void UpdateWebThreadTLS(blink::WebThread* thread); 179 void UpdateWebThreadTLS(blink::WebThread* thread);
178 180
181 bool IsMainThread() const;
182
179 scoped_refptr<base::SingleThreadTaskRunner> MainTaskRunnerForCurrentThread(); 183 scoped_refptr<base::SingleThreadTaskRunner> MainTaskRunnerForCurrentThread();
180 184
181 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; 185 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
182 WebThemeEngineImpl native_theme_engine_; 186 WebThemeEngineImpl native_theme_engine_;
183 WebFallbackThemeEngineImpl fallback_theme_engine_; 187 WebFallbackThemeEngineImpl fallback_theme_engine_;
184 base::OneShotTimer<BlinkPlatformImpl> shared_timer_; 188 base::OneShotTimer<BlinkPlatformImpl> shared_timer_;
185 void (*shared_timer_func_)(); 189 void (*shared_timer_func_)();
186 double shared_timer_fire_time_; 190 double shared_timer_fire_time_;
187 bool shared_timer_fire_time_was_set_while_suspended_; 191 bool shared_timer_fire_time_was_set_while_suspended_;
188 int shared_timer_suspended_; // counter 192 int shared_timer_suspended_; // counter
189 base::ThreadLocalStorage::Slot current_thread_slot_; 193 base::ThreadLocalStorage::Slot current_thread_slot_;
190 WebCryptoImpl web_crypto_; 194 WebCryptoImpl web_crypto_;
191 scoped_ptr<WebGeofencingProviderImpl> geofencing_provider_; 195 scoped_ptr<WebGeofencingProviderImpl> geofencing_provider_;
192 scoped_ptr<WebBluetoothImpl> bluetooth_; 196 scoped_ptr<WebBluetoothImpl> bluetooth_;
193 197
194 scoped_refptr<ThreadSafeSender> thread_safe_sender_; 198 scoped_refptr<ThreadSafeSender> thread_safe_sender_;
195 scoped_refptr<NotificationDispatcher> notification_dispatcher_; 199 scoped_refptr<NotificationDispatcher> notification_dispatcher_;
196 scoped_refptr<PushDispatcher> push_dispatcher_; 200 scoped_refptr<PushDispatcher> push_dispatcher_;
201 scoped_ptr<PermissionManager> permission_client_;
197 }; 202 };
198 203
199 } // namespace content 204 } // namespace content
200 205
201 #endif // CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_ 206 #endif // CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698