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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2471153002: [scheduler] Use Finch to control background throttling. (Closed)
Patch Set: Addressed comments from alexclarke@ Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 m_baseBackgroundColor(Color::white), 425 m_baseBackgroundColor(Color::white),
426 m_backgroundColorOverride(Color::transparent), 426 m_backgroundColorOverride(Color::transparent),
427 m_zoomFactorOverride(0), 427 m_zoomFactorOverride(0),
428 m_userGestureObserved(false), 428 m_userGestureObserved(false),
429 m_shouldDispatchFirstVisuallyNonEmptyLayout(false), 429 m_shouldDispatchFirstVisuallyNonEmptyLayout(false),
430 m_shouldDispatchFirstLayoutAfterFinishedParsing(false), 430 m_shouldDispatchFirstLayoutAfterFinishedParsing(false),
431 m_shouldDispatchFirstLayoutAfterFinishedLoading(false), 431 m_shouldDispatchFirstLayoutAfterFinishedLoading(false),
432 m_displayMode(WebDisplayModeBrowser), 432 m_displayMode(WebDisplayModeBrowser),
433 m_elasticOverscroll(FloatSize()), 433 m_elasticOverscroll(FloatSize()),
434 m_mutator(nullptr), 434 m_mutator(nullptr),
435 m_scheduler(wrapUnique(Platform::current()
436 ->currentThread()
437 ->scheduler()
438 ->createWebViewScheduler(this)
439 .release())),
440 m_lastFrameTimeMonotonic(0), 435 m_lastFrameTimeMonotonic(0),
441 m_overrideCompositorVisibility(false) { 436 m_overrideCompositorVisibility(false) {
442 Page::PageClients pageClients; 437 Page::PageClients pageClients;
443 pageClients.chromeClient = m_chromeClientImpl.get(); 438 pageClients.chromeClient = m_chromeClientImpl.get();
444 pageClients.contextMenuClient = &m_contextMenuClientImpl; 439 pageClients.contextMenuClient = &m_contextMenuClientImpl;
445 pageClients.editorClient = &m_editorClientImpl; 440 pageClients.editorClient = &m_editorClientImpl;
446 pageClients.spellCheckerClient = &m_spellCheckerClientImpl; 441 pageClients.spellCheckerClient = &m_spellCheckerClientImpl;
447 442
448 m_page = Page::createOrdinary(pageClients); 443 m_page = Page::createOrdinary(pageClients);
449 MediaKeysController::provideMediaKeysTo(*m_page, &m_mediaKeysClientImpl); 444 MediaKeysController::provideMediaKeysTo(*m_page, &m_mediaKeysClientImpl);
450 provideSpeechRecognitionTo( 445 provideSpeechRecognitionTo(
451 *m_page, SpeechRecognitionClientProxy::create( 446 *m_page, SpeechRecognitionClientProxy::create(
452 client ? client->speechRecognizer() : nullptr)); 447 client ? client->speechRecognizer() : nullptr));
453 provideContextFeaturesTo(*m_page, ContextFeaturesClientImpl::create()); 448 provideContextFeaturesTo(*m_page, ContextFeaturesClientImpl::create());
454 provideDatabaseClientTo(*m_page, DatabaseClientImpl::create()); 449 provideDatabaseClientTo(*m_page, DatabaseClientImpl::create());
455 450
456 provideStorageQuotaClientTo(*m_page, StorageQuotaClientImpl::create()); 451 provideStorageQuotaClientTo(*m_page, StorageQuotaClientImpl::create());
457 m_page->setValidationMessageClient( 452 m_page->setValidationMessageClient(
458 ValidationMessageClientImpl::create(*this)); 453 ValidationMessageClientImpl::create(*this));
459 provideDedicatedWorkerMessagingProxyProviderTo( 454 provideDedicatedWorkerMessagingProxyProviderTo(
460 *m_page, DedicatedWorkerMessagingProxyProviderImpl::create()); 455 *m_page, DedicatedWorkerMessagingProxyProviderImpl::create());
461 StorageNamespaceController::provideStorageNamespaceTo(*m_page, 456 StorageNamespaceController::provideStorageNamespaceTo(*m_page,
462 &m_storageClientImpl); 457 &m_storageClientImpl);
463 458
459 m_devToolsEmulator = DevToolsEmulator::create(this);
460
461 m_scheduler =
462 Platform::current()->currentThread()->scheduler()->createWebViewScheduler(
463 this, settingsImpl());
464
464 setVisibilityState(visibilityState, true); 465 setVisibilityState(visibilityState, true);
465 466
466 initializeLayerTreeView(); 467 initializeLayerTreeView();
467 468
468 m_devToolsEmulator = DevToolsEmulator::create(this);
469
470 allInstances().add(this); 469 allInstances().add(this);
471 470
472 m_pageImportanceSignals.setObserver(client); 471 m_pageImportanceSignals.setObserver(client);
473 m_resizeViewportAnchor = new ResizeViewportAnchor(*m_page); 472 m_resizeViewportAnchor = new ResizeViewportAnchor(*m_page);
474 } 473 }
475 474
476 WebViewImpl::~WebViewImpl() { 475 WebViewImpl::~WebViewImpl() {
477 DCHECK(!m_page); 476 DCHECK(!m_page);
478 477
479 // Each highlight uses m_owningWebViewImpl->m_linkHighlightsTimeline 478 // Each highlight uses m_owningWebViewImpl->m_linkHighlightsTimeline
(...skipping 3963 matching lines...) Expand 10 before | Expand all | Expand 10 after
4443 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) 4442 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame())
4444 return nullptr; 4443 return nullptr;
4445 return focusedFrame; 4444 return focusedFrame;
4446 } 4445 }
4447 4446
4448 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { 4447 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const {
4449 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4448 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4450 } 4449 }
4451 4450
4452 } // namespace blink 4451 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698