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

Side by Side Diff: content/renderer/renderer_blink_platform_impl.cc

Issue 690703002: WebThreadImplForMessageLoop to use blink scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding a null check for Sami Created 6 years, 1 month 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
« no previous file with comments | « content/renderer/renderer_blink_platform_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "content/renderer/renderer_blink_platform_impl.h" 5 #include "content/renderer/renderer_blink_platform_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 base::Lock unicode_font_families_mutex_; 222 base::Lock unicode_font_families_mutex_;
223 std::map<int32_t, blink::WebFallbackFont> unicode_font_families_; 223 std::map<int32_t, blink::WebFallbackFont> unicode_font_families_;
224 #endif 224 #endif
225 }; 225 };
226 #endif // defined(OS_ANDROID) 226 #endif // defined(OS_ANDROID)
227 227
228 //------------------------------------------------------------------------------ 228 //------------------------------------------------------------------------------
229 229
230 RendererBlinkPlatformImpl::RendererBlinkPlatformImpl( 230 RendererBlinkPlatformImpl::RendererBlinkPlatformImpl(
231 RendererScheduler* renderer_scheduler) 231 RendererScheduler* renderer_scheduler)
232 : web_scheduler_(new WebSchedulerImpl(renderer_scheduler)), 232 : BlinkPlatformImpl(renderer_scheduler->DefaultTaskRunner()),
233 web_scheduler_(new WebSchedulerImpl(renderer_scheduler)),
233 clipboard_client_(new RendererClipboardClient), 234 clipboard_client_(new RendererClipboardClient),
234 clipboard_(new WebClipboardImpl(clipboard_client_.get())), 235 clipboard_(new WebClipboardImpl(clipboard_client_.get())),
235 mime_registry_(new RendererBlinkPlatformImpl::MimeRegistry), 236 mime_registry_(new RendererBlinkPlatformImpl::MimeRegistry),
236 sudden_termination_disables_(0), 237 sudden_termination_disables_(0),
237 plugin_refresh_allowed_(true), 238 plugin_refresh_allowed_(true),
238 default_task_runner_(renderer_scheduler->DefaultTaskRunner()), 239 default_task_runner_(renderer_scheduler->DefaultTaskRunner()),
239 child_thread_loop_(base::MessageLoopProxy::current()), 240 child_thread_loop_(base::MessageLoopProxy::current()),
240 web_scrollbar_behavior_(new WebScrollbarBehaviorImpl), 241 web_scrollbar_behavior_(new WebScrollbarBehaviorImpl),
241 bluetooth_(new WebBluetoothImpl) { 242 bluetooth_(new WebBluetoothImpl) {
242 if (g_sandbox_enabled && sandboxEnabled()) { 243 if (g_sandbox_enabled && sandboxEnabled()) {
(...skipping 13 matching lines...) Expand all
256 new WebDatabaseObserverImpl(sync_message_filter_.get())); 257 new WebDatabaseObserverImpl(sync_message_filter_.get()));
257 } 258 }
258 } 259 }
259 260
260 RendererBlinkPlatformImpl::~RendererBlinkPlatformImpl() { 261 RendererBlinkPlatformImpl::~RendererBlinkPlatformImpl() {
261 WebFileSystemImpl::DeleteThreadSpecificInstance(); 262 WebFileSystemImpl::DeleteThreadSpecificInstance();
262 } 263 }
263 264
264 //------------------------------------------------------------------------------ 265 //------------------------------------------------------------------------------
265 266
266 void RendererBlinkPlatformImpl::callOnMainThread(void (*func)(void*),
267 void* context) {
268 default_task_runner_->PostTask(FROM_HERE, base::Bind(func, context));
269 }
270
271 blink::WebScheduler* RendererBlinkPlatformImpl::scheduler() { 267 blink::WebScheduler* RendererBlinkPlatformImpl::scheduler() {
272 return web_scheduler_.get(); 268 return web_scheduler_.get();
273 } 269 }
274 270
275 blink::WebClipboard* RendererBlinkPlatformImpl::clipboard() { 271 blink::WebClipboard* RendererBlinkPlatformImpl::clipboard() {
276 blink::WebClipboard* clipboard = 272 blink::WebClipboard* clipboard =
277 GetContentClient()->renderer()->OverrideWebClipboard(); 273 GetContentClient()->renderer()->OverrideWebClipboard();
278 if (clipboard) 274 if (clipboard)
279 return clipboard; 275 return clipboard;
280 return clipboard_.get(); 276 return clipboard_.get();
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after
1224 //------------------------------------------------------------------------------ 1220 //------------------------------------------------------------------------------
1225 1221
1226 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( 1222 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting(
1227 const blink::WebBatteryStatus& status) { 1223 const blink::WebBatteryStatus& status) {
1228 if (!g_test_battery_status_listener) 1224 if (!g_test_battery_status_listener)
1229 return; 1225 return;
1230 g_test_battery_status_listener->updateBatteryStatus(status); 1226 g_test_battery_status_listener->updateBatteryStatus(status);
1231 } 1227 }
1232 1228
1233 } // namespace content 1229 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/renderer_blink_platform_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698