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

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

Issue 2471153002: [scheduler] Use Finch to control background throttling. (Closed)
Patch Set: 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() 435 m_scheduler(nullptr),
alex clarke (OOO till 29th) 2016/11/02 17:53:49 I think we can omit this (odd the line above exist
altimin 2016/11/02 21:10:02 Done.
436 ->currentThread()
437 ->scheduler()
438 ->createWebViewScheduler(this)
439 .release())),
440 m_lastFrameTimeMonotonic(0), 436 m_lastFrameTimeMonotonic(0),
441 m_overrideCompositorVisibility(false) { 437 m_overrideCompositorVisibility(false) {
442 Page::PageClients pageClients; 438 Page::PageClients pageClients;
443 pageClients.chromeClient = m_chromeClientImpl.get(); 439 pageClients.chromeClient = m_chromeClientImpl.get();
444 pageClients.contextMenuClient = &m_contextMenuClientImpl; 440 pageClients.contextMenuClient = &m_contextMenuClientImpl;
445 pageClients.editorClient = &m_editorClientImpl; 441 pageClients.editorClient = &m_editorClientImpl;
446 pageClients.spellCheckerClient = &m_spellCheckerClientImpl; 442 pageClients.spellCheckerClient = &m_spellCheckerClientImpl;
447 443
448 m_page = Page::createOrdinary(pageClients); 444 m_page = Page::createOrdinary(pageClients);
449 MediaKeysController::provideMediaKeysTo(*m_page, &m_mediaKeysClientImpl); 445 MediaKeysController::provideMediaKeysTo(*m_page, &m_mediaKeysClientImpl);
450 provideSpeechRecognitionTo( 446 provideSpeechRecognitionTo(
451 *m_page, SpeechRecognitionClientProxy::create( 447 *m_page, SpeechRecognitionClientProxy::create(
452 client ? client->speechRecognizer() : nullptr)); 448 client ? client->speechRecognizer() : nullptr));
453 provideContextFeaturesTo(*m_page, ContextFeaturesClientImpl::create()); 449 provideContextFeaturesTo(*m_page, ContextFeaturesClientImpl::create());
454 provideDatabaseClientTo(*m_page, DatabaseClientImpl::create()); 450 provideDatabaseClientTo(*m_page, DatabaseClientImpl::create());
455 451
456 provideStorageQuotaClientTo(*m_page, StorageQuotaClientImpl::create()); 452 provideStorageQuotaClientTo(*m_page, StorageQuotaClientImpl::create());
457 m_page->setValidationMessageClient( 453 m_page->setValidationMessageClient(
458 ValidationMessageClientImpl::create(*this)); 454 ValidationMessageClientImpl::create(*this));
459 provideDedicatedWorkerMessagingProxyProviderTo( 455 provideDedicatedWorkerMessagingProxyProviderTo(
460 *m_page, DedicatedWorkerMessagingProxyProviderImpl::create()); 456 *m_page, DedicatedWorkerMessagingProxyProviderImpl::create());
461 StorageNamespaceController::provideStorageNamespaceTo(*m_page, 457 StorageNamespaceController::provideStorageNamespaceTo(*m_page,
462 &m_storageClientImpl); 458 &m_storageClientImpl);
463 459
460 m_devToolsEmulator = DevToolsEmulator::create(this);
461
462 m_scheduler =
463 Platform::current()->currentThread()->scheduler()->createWebViewScheduler(
464 this, settingsImpl());
465
464 setVisibilityState(visibilityState, true); 466 setVisibilityState(visibilityState, true);
465 467
466 initializeLayerTreeView(); 468 initializeLayerTreeView();
467 469
468 m_devToolsEmulator = DevToolsEmulator::create(this);
469
470 allInstances().add(this); 470 allInstances().add(this);
471 471
472 m_pageImportanceSignals.setObserver(client); 472 m_pageImportanceSignals.setObserver(client);
473 m_resizeViewportAnchor = new ResizeViewportAnchor(*m_page); 473 m_resizeViewportAnchor = new ResizeViewportAnchor(*m_page);
474 } 474 }
475 475
476 WebViewImpl::~WebViewImpl() { 476 WebViewImpl::~WebViewImpl() {
477 DCHECK(!m_page); 477 DCHECK(!m_page);
478 478
479 // Each highlight uses m_owningWebViewImpl->m_linkHighlightsTimeline 479 // 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()) 4443 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame())
4444 return nullptr; 4444 return nullptr;
4445 return focusedFrame; 4445 return focusedFrame;
4446 } 4446 }
4447 4447
4448 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { 4448 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const {
4449 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4449 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4450 } 4450 }
4451 4451
4452 } // namespace blink 4452 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698