diff --git a/DEPS b/DEPS index 709a637..88db7d8 100644 --- a/DEPS +++ b/DEPS
@@ -40,7 +40,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '2790c52e36ddd8c46d8238f3c92f47779f79fb69', + 'skia_revision': 'bbab477b49e2aed0f257206ce457814c953d574b', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. @@ -52,7 +52,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': 'e735511d47d85f983da61284f8134fa324d6d1b7', + 'angle_revision': 'd0239396b81d1feb29ea6cd51a821b22a0eb08d2', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling build tools # and whatever else without interference from each other.
diff --git a/ash/mus/window_manager.cc b/ash/mus/window_manager.cc index f7b3aec..0f7c65a 100644 --- a/ash/mus/window_manager.cc +++ b/ash/mus/window_manager.cc
@@ -217,7 +217,6 @@ RootWindowController* WindowManager::CreateRootWindowController( std::unique_ptr<aura::WindowTreeHostMus> window_tree_host, const display::Display& display) { - window_tree_host->InitCompositor(); // TODO(sky): this is temporary, should use RootWindowController directly. aura::client::SetCaptureClient(window_tree_host->window(), wm_state_->capture_controller());
diff --git a/chrome/VERSION b/chrome/VERSION index 2ec4d1b0..c9e16c40 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=57 MINOR=0 -BUILD=2949 +BUILD=2950 PATCH=0
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/engagement/SiteEngagementService.java b/chrome/android/java/src/org/chromium/chrome/browser/engagement/SiteEngagementService.java new file mode 100644 index 0000000..316aa147 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/engagement/SiteEngagementService.java
@@ -0,0 +1,72 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.engagement; + +import org.chromium.base.ThreadUtils; +import org.chromium.base.annotations.CalledByNative; + +import org.chromium.chrome.browser.profiles.Profile; + +/** + * Provides access to the Site Engagement Service for a profile. + * + * Site engagement measures the level of engagement that a user has with an origin. This class + * allows Java to retrieve and modify engagement scores for URLs. + */ +public class SiteEngagementService { + + /** Pointer to the native side SiteEngagementServiceAndroid shim. */ + private long mNativePointer; + + /** + * Returns a SiteEngagementService for the provided profile. + * Must be called on the UI thread. + */ + public static SiteEngagementService getForProfile(Profile profile) { + assert ThreadUtils.runningOnUiThread(); + return nativeSiteEngagementServiceForProfile(profile); + } + + /** + * Returns the engagement score for the provided URL. + * Must be called on the UI thread. + */ + public double getScore(String url) { + assert ThreadUtils.runningOnUiThread(); + if (mNativePointer == 0) return 0.0; + return nativeGetScore(mNativePointer, url); + } + + /** + * Sets the provided URL to have the provided engagement score. + * Must be called on the UI thread. + */ + public void resetScoreForUrl(String url, double score) { + assert ThreadUtils.runningOnUiThread(); + if (mNativePointer == 0) return; + nativeResetScoreForURL(mNativePointer, url, score); + } + + @CalledByNative + private static SiteEngagementService create(long nativePointer) { + return new SiteEngagementService(nativePointer); + } + + /** This object may only be created via the static getForProfile method. */ + private SiteEngagementService(long nativePointer) { + mNativePointer = nativePointer; + } + + @CalledByNative + private void onNativeDestroyed() { + mNativePointer = 0; + } + + private static native SiteEngagementService nativeSiteEngagementServiceForProfile( + Profile profile); + private native double nativeGetScore(long nativeSiteEngagementServiceAndroid, String url); + private native void nativeResetScoreForURL( + long nativeSiteEngagementServiceAndroid, String url, double score); +}
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni index bc673e58..6ee404fe 100644 --- a/chrome/android/java_sources.gni +++ b/chrome/android/java_sources.gni
@@ -341,6 +341,7 @@ "java/src/org/chromium/chrome/browser/download/ui/SpaceDisplay.java", "java/src/org/chromium/chrome/browser/download/ui/ThumbnailProvider.java", "java/src/org/chromium/chrome/browser/download/ui/ThumbnailProviderImpl.java", + "java/src/org/chromium/chrome/browser/engagement/SiteEngagementService.java", "java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java", "java/src/org/chromium/chrome/browser/externalauth/UserRecoverableErrorHandler.java", "java/src/org/chromium/chrome/browser/externalauth/VerifiedHandler.java", @@ -1240,6 +1241,7 @@ "javatests/src/org/chromium/chrome/browser/download/SystemDownloadNotifierTest.java", "javatests/src/org/chromium/chrome/browser/download/ui/DownloadHistoryAdapterTest.java", "javatests/src/org/chromium/chrome/browser/download/ui/StubbedProvider.java", + "javatests/src/org/chromium/chrome/browser/engagement/SiteEngagementServiceTest.java", "javatests/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImplTest.java", "javatests/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandlerTest.java", "javatests/src/org/chromium/chrome/browser/externalnav/IntentWithGesturesHandlerTest.java",
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/engagement/SiteEngagementServiceTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/engagement/SiteEngagementServiceTest.java new file mode 100644 index 0000000..35e5468 --- /dev/null +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/engagement/SiteEngagementServiceTest.java
@@ -0,0 +1,65 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.engagement; + +import android.test.UiThreadTest; +import android.test.suitebuilder.annotation.SmallTest; + +import org.chromium.base.test.util.Feature; +import org.chromium.chrome.browser.ChromeActivity; +import org.chromium.chrome.browser.profiles.Profile; +import org.chromium.chrome.test.ChromeActivityTestCaseBase; + +/** + * Test for the Site Engagement Service Java binding. + */ +public class SiteEngagementServiceTest extends ChromeActivityTestCaseBase<ChromeActivity> { + + public SiteEngagementServiceTest() { + super(ChromeActivity.class); + } + + /** + * Verify that setting the engagement score for a URL and reading it back it works. + */ + @SmallTest + @UiThreadTest + @Feature({"Engagement"}) + public void testSettingAndRetrievingScore() { + final String url = "https://www.google.com"; + SiteEngagementService service = SiteEngagementService.getForProfile( + getActivity().getActivityTab().getProfile()); + + assertEquals(0.0, service.getScore(url)); + service.resetScoreForUrl(url, 5.0); + assertEquals(5.0, service.getScore(url)); + + service.resetScoreForUrl(url, 2.0); + assertEquals(2.0, service.getScore(url)); + } + + /** + * Verify that repeatedly fetching and throwing away the SiteEngagementService works. + */ + @SmallTest + @UiThreadTest + @Feature({"Engagement"}) + public void testRepeatedlyGettingService() { + final String url = "https://www.google.com"; + Profile profile = getActivity().getActivityTab().getProfile(); + + assertEquals(0.0, SiteEngagementService.getForProfile(profile).getScore(url)); + SiteEngagementService.getForProfile(profile).resetScoreForUrl(url, 5.0); + assertEquals(5.0, SiteEngagementService.getForProfile(profile).getScore(url)); + + SiteEngagementService.getForProfile(profile).resetScoreForUrl(url, 2.0); + assertEquals(2.0, SiteEngagementService.getForProfile(profile).getScore(url)); + } + + @Override + public void startMainActivity() throws InterruptedException { + startMainActivityOnBlankPage(); + } +}
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index a166fed8..f59ef26 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -3255,6 +3255,8 @@ "dom_distiller/tab_utils_android.h", "download/download_request_infobar_delegate_android.cc", "download/download_request_infobar_delegate_android.h", + "engagement/site_engagement_service_android.cc", + "engagement/site_engagement_service_android.h", "geolocation/geolocation_infobar_delegate_android.cc", "geolocation/geolocation_infobar_delegate_android.h", "history/android/android_history_provider_service.cc", @@ -3907,6 +3909,7 @@ "../android/java/src/org/chromium/chrome/browser/download/DownloadItem.java", "../android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java", "../android/java/src/org/chromium/chrome/browser/download/ui/ThumbnailProviderImpl.java", + "../android/java/src/org/chromium/chrome/browser/engagement/SiteEngagementService.java", "../android/java/src/org/chromium/chrome/browser/favicon/FaviconHelper.java", "../android/java/src/org/chromium/chrome/browser/favicon/LargeIconBridge.java", "../android/java/src/org/chromium/chrome/browser/feedback/ConnectivityChecker.java",
diff --git a/chrome/browser/android/chrome_jni_registrar.cc b/chrome/browser/android/chrome_jni_registrar.cc index 595bde4..c6abcc156 100644 --- a/chrome/browser/android/chrome_jni_registrar.cc +++ b/chrome/browser/android/chrome_jni_registrar.cc
@@ -109,6 +109,7 @@ #include "chrome/browser/autofill/android/personal_data_manager_android.h" #include "chrome/browser/dom_distiller/dom_distiller_service_factory_android.h" #include "chrome/browser/dom_distiller/tab_utils_android.h" +#include "chrome/browser/engagement/site_engagement_service_android.h" #include "chrome/browser/history/android/sqlite_cursor.h" #include "chrome/browser/invalidation/invalidation_service_factory_android.h" #include "chrome/browser/media/android/cdm/media_drm_credential_manager.h" @@ -373,6 +374,7 @@ {"SigninInvestigator", SigninInvestigatorAndroid::Register}, {"SigninManager", SigninManagerAndroid::Register}, {"SingleTabModel", RegisterSingleTabModel}, + {"SiteEngagementService", SiteEngagementServiceAndroid::Register}, #if BUILDFLAG(ENABLE_SPELLCHECK) {"SpellCheckerSessionBridge", spellcheck::android::RegisterSpellcheckJni}, #endif
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 793cedd..bfb73d1f 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -109,6 +109,7 @@ #include "chrome/common/pepper_permission_util.h" #include "chrome/common/pref_names.h" #include "chrome/common/render_messages.h" +#include "chrome/common/renderer_configuration.mojom.h" #include "chrome/common/secure_origin_whitelist.h" #include "chrome/common/stack_sampling_configuration.h" #include "chrome/common/url_constants.h" @@ -1082,8 +1083,11 @@ host->AddFilter(new cdm::CdmMessageFilterAndroid()); #endif - host->Send(new ChromeViewMsg_SetIsIncognitoProcess( - profile->IsOffTheRecord())); + bool is_incognito_process = profile->IsOffTheRecord(); + + chrome::mojom::RendererConfigurationAssociatedPtr rc_interface; + host->GetChannel()->GetRemoteAssociatedInterface(&rc_interface); + rc_interface->SetInitialConfiguration(is_incognito_process); for (size_t i = 0; i < extra_parts_.size(); ++i) extra_parts_[i]->RenderProcessWillLaunch(host); @@ -1091,7 +1095,7 @@ RendererContentSettingRules rules; if (host->IsForGuestsOnly()) { #if BUILDFLAG(ENABLE_EXTENSIONS) - GetGuestViewDefaultContentSettingRules(profile->IsOffTheRecord(), &rules); + GetGuestViewDefaultContentSettingRules(is_incognito_process, &rules); #else NOTREACHED(); #endif @@ -1099,6 +1103,8 @@ GetRendererContentSettingRules( HostContentSettingsMapFactory::GetForProfile(profile), &rules); } + // TODO(nigeltao): eliminate this legacy IPC. Instead, add an extra arg to + // the rc_interface->SetInitialConfiguration call. host->Send(new ChromeViewMsg_SetContentSettingRules(rules)); }
diff --git a/chrome/browser/engagement/site_engagement_service.cc b/chrome/browser/engagement/site_engagement_service.cc index 66a2b49..3fa29c7 100644 --- a/chrome/browser/engagement/site_engagement_service.cc +++ b/chrome/browser/engagement/site_engagement_service.cc
@@ -36,6 +36,10 @@ #include "content/public/browser/web_contents.h" #include "url/gurl.h" +#if defined(OS_ANDROID) +#include "chrome/browser/engagement/site_engagement_service_android.h" +#endif + namespace { const int FOUR_WEEKS_IN_DAYS = 28; @@ -238,6 +242,17 @@ return total_score; } +#if defined(OS_ANDROID) +SiteEngagementServiceAndroid* SiteEngagementService::GetAndroidService() const { + return android_service_.get(); +} + +void SiteEngagementService::SetAndroidService( + std::unique_ptr<SiteEngagementServiceAndroid> android_service) { + android_service_ = std::move(android_service); +} +#endif + SiteEngagementService::SiteEngagementService(Profile* profile, std::unique_ptr<base::Clock> clock) : profile_(profile), clock_(std::move(clock)), weak_factory_(this) {
diff --git a/chrome/browser/engagement/site_engagement_service.h b/chrome/browser/engagement/site_engagement_service.h index 65e22334..350d30a9 100644 --- a/chrome/browser/engagement/site_engagement_service.h +++ b/chrome/browser/engagement/site_engagement_service.h
@@ -14,6 +14,7 @@ #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/time/time.h" +#include "build/build_config.h" #include "chrome/browser/engagement/site_engagement_metrics.h" #include "chrome/browser/engagement/site_engagement_observer.h" #include "components/history/core/browser/history_service_observer.h" @@ -37,6 +38,10 @@ class Profile; class SiteEngagementScore; +#if defined(OS_ANDROID) +class SiteEngagementServiceAndroid; +#endif + class SiteEngagementScoreProvider { public: // Returns a non-negative integer representing the engagement score of the @@ -134,6 +139,7 @@ private: friend class SiteEngagementObserver; + friend class SiteEngagementServiceAndroid; FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest, CheckHistograms); FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest, CleanupEngagementScores); FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest, @@ -160,6 +166,13 @@ FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest, GetScoreFromSettings); FRIEND_TEST_ALL_PREFIXES(AppBannerSettingsHelperTest, SiteEngagementTrigger); +#if defined(OS_ANDROID) + // Shim class to expose the service to Java. + SiteEngagementServiceAndroid* GetAndroidService() const; + void SetAndroidService( + std::unique_ptr<SiteEngagementServiceAndroid> android_service); +#endif + // Only used in tests. SiteEngagementService(Profile* profile, std::unique_ptr<base::Clock> clock); @@ -253,6 +266,10 @@ // The clock used to vend times. std::unique_ptr<base::Clock> clock_; +#if defined(OS_ANDROID) + std::unique_ptr<SiteEngagementServiceAndroid> android_service_; +#endif + // Metrics are recorded at non-incognito browser startup, and then // approximately once per hour thereafter. Store the local time at which // metrics were previously uploaded: the first event which affects any
diff --git a/chrome/browser/engagement/site_engagement_service_android.cc b/chrome/browser/engagement/site_engagement_service_android.cc new file mode 100644 index 0000000..9d71bf9 --- /dev/null +++ b/chrome/browser/engagement/site_engagement_service_android.cc
@@ -0,0 +1,81 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/engagement/site_engagement_service_android.h" + +#include "base/android/jni_android.h" +#include "base/android/jni_string.h" +#include "base/memory/ptr_util.h" +#include "chrome/browser/profiles/profile_android.h" +#include "jni/SiteEngagementService_jni.h" +#include "url/gurl.h" + +using base::android::JavaParamRef; + +// static +bool SiteEngagementServiceAndroid::Register(JNIEnv* env) { + return RegisterNativesImpl(env); +} + +// static +const base::android::ScopedJavaGlobalRef<jobject>& +SiteEngagementServiceAndroid::GetOrCreate(JNIEnv* env, + SiteEngagementService* service) { + SiteEngagementServiceAndroid* android_service = service->GetAndroidService(); + if (!android_service) { + service->SetAndroidService( + base::MakeUnique<SiteEngagementServiceAndroid>(env, service)); + android_service = service->GetAndroidService(); + } + + return android_service->java_service_; +} + +SiteEngagementServiceAndroid::SiteEngagementServiceAndroid( + JNIEnv* env, + SiteEngagementService* service) + : service_(service) { + java_service_.Reset(Java_SiteEngagementService_create( + env, reinterpret_cast<uintptr_t>(this))); +} + +SiteEngagementServiceAndroid::~SiteEngagementServiceAndroid() { + Java_SiteEngagementService_onNativeDestroyed( + base::android::AttachCurrentThread(), java_service_); + java_service_.Reset(); +} + +double SiteEngagementServiceAndroid::GetScore( + JNIEnv* env, + const JavaParamRef<jobject>& caller, + const JavaParamRef<jstring>& jurl) const { + if (!jurl) + return 0; + + return service_->GetScore( + GURL(base::android::ConvertJavaStringToUTF16(env, jurl))); +} + +void SiteEngagementServiceAndroid::ResetScoreForURL( + JNIEnv* env, + const JavaParamRef<jobject>& caller, + const JavaParamRef<jstring>& jurl, + double score) { + if (jurl) { + service_->ResetScoreForURL( + GURL(base::android::ConvertJavaStringToUTF16(env, jurl)), score); + } +} + +base::android::ScopedJavaLocalRef<jobject> SiteEngagementServiceForProfile( + JNIEnv* env, + const JavaParamRef<jclass>& clazz, + const JavaParamRef<jobject>& jprofile) { + Profile* profile = ProfileAndroid::FromProfileAndroid(jprofile); + SiteEngagementService* service = SiteEngagementService::Get(profile); + DCHECK(service); + + return base::android::ScopedJavaLocalRef<jobject>( + SiteEngagementServiceAndroid::GetOrCreate(env, service)); +}
diff --git a/chrome/browser/engagement/site_engagement_service_android.h b/chrome/browser/engagement/site_engagement_service_android.h new file mode 100644 index 0000000..c68906a --- /dev/null +++ b/chrome/browser/engagement/site_engagement_service_android.h
@@ -0,0 +1,51 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_ANDROID_H_ +#define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_ANDROID_H_ + +#include <jni.h> + +#include "base/android/scoped_java_ref.h" +#include "base/macros.h" +#include "chrome/browser/engagement/site_engagement_service.h" + +// Wrapper class to expose the Site Engagement Service to Java. This object is +// owned by the |service_| which it wraps, and is lazily created when +// a Java-side SiteEngagementService is constructed. Once created, all future +// Java-side requests for a SiteEngagementService will use the same native +// object. +// +// This class may only be used on the UI thread. +class SiteEngagementServiceAndroid { + public: + static bool Register(JNIEnv* env); + + // Returns the Java-side SiteEngagementService object corresponding to + // |service|. + static const base::android::ScopedJavaGlobalRef<jobject>& GetOrCreate( + JNIEnv* env, + SiteEngagementService* service); + + SiteEngagementServiceAndroid(JNIEnv* env, SiteEngagementService* service); + + ~SiteEngagementServiceAndroid(); + + double GetScore(JNIEnv* env, + const base::android::JavaParamRef<jobject>& caller, + const base::android::JavaParamRef<jstring>& jurl) const; + + void ResetScoreForURL(JNIEnv* env, + const base::android::JavaParamRef<jobject>& caller, + const base::android::JavaParamRef<jstring>& jurl, + double score); + + private: + base::android::ScopedJavaGlobalRef<jobject> java_service_; + SiteEngagementService* service_; + + DISALLOW_COPY_AND_ASSIGN(SiteEngagementServiceAndroid); +}; + +#endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_ANDROID_H_
diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn index e6858ad4..df8259b8 100644 --- a/chrome/common/BUILD.gn +++ b/chrome/common/BUILD.gn
@@ -672,6 +672,7 @@ "conflicts/module_event_win.mojom", "field_trial_recorder.mojom", "network_diagnostics.mojom", + "renderer_configuration.mojom", "resource_usage_reporter.mojom", "shell_handler_win.mojom", ]
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index bee6e78..c706bed 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h
@@ -252,11 +252,6 @@ base::string16 /* identity */, bool /* identity_match */) -// Sent on process startup to indicate whether this process is running in -// incognito mode. -IPC_MESSAGE_CONTROL1(ChromeViewMsg_SetIsIncognitoProcess, - bool /* is_incognito_processs */) - // Sent in response to FrameHostMsg_DidBlockRunningInsecureContent. IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetAllowRunningInsecureContent, bool /* allowed */)
diff --git a/chrome/common/renderer_configuration.mojom b/chrome/common/renderer_configuration.mojom new file mode 100644 index 0000000..b04f1bc --- /dev/null +++ b/chrome/common/renderer_configuration.mojom
@@ -0,0 +1,15 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module chrome.mojom; + +// Configures the renderer. +interface RendererConfiguration { + // Configures the renderer, queued to send when the render process will + // launch. + // + // TODO(nigeltao): port the ChromeViewMsg_SetContentSettingRules legacy IPC + // message to be an additional arg here. + SetInitialConfiguration(bool is_incognito_process); +};
diff --git a/chrome/renderer/chrome_render_thread_observer.cc b/chrome/renderer/chrome_render_thread_observer.cc index 3b96a15..ed486e9 100644 --- a/chrome/renderer/chrome_render_thread_observer.cc +++ b/chrome/renderer/chrome_render_thread_observer.cc
@@ -40,6 +40,7 @@ #include "chrome/renderer/security_filter_peer.h" #include "components/visitedlink/renderer/visitedlink_slave.h" #include "content/public/child/resource_dispatcher_delegate.h" +#include "content/public/common/associated_interface_registry.h" #include "content/public/common/content_switches.h" #include "content/public/renderer/render_thread.h" #include "content/public/renderer/render_view.h" @@ -236,6 +237,7 @@ ChromeRenderThreadObserver::ChromeRenderThreadObserver() : field_trial_syncer_(this), visited_link_slave_(new visitedlink::VisitedLinkSlave), + renderer_configuration_binding_(this), weak_factory_(this) { const base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); @@ -274,12 +276,23 @@ ChromeRenderThreadObserver::~ChromeRenderThreadObserver() {} +void ChromeRenderThreadObserver::RegisterMojoInterfaces( + content::AssociatedInterfaceRegistry* associated_interfaces) { + associated_interfaces->AddInterface( + base::Bind(&ChromeRenderThreadObserver::OnRendererInterfaceRequest, + base::Unretained(this))); +} + +void ChromeRenderThreadObserver::UnregisterMojoInterfaces( + content::AssociatedInterfaceRegistry* associated_interfaces) { + associated_interfaces->RemoveInterface( + chrome::mojom::RendererConfiguration::Name_); +} + bool ChromeRenderThreadObserver::OnControlMessageReceived( const IPC::Message& message) { bool handled = true; IPC_BEGIN_MESSAGE_MAP(ChromeRenderThreadObserver, message) - IPC_MESSAGE_HANDLER(ChromeViewMsg_SetIsIncognitoProcess, - OnSetIsIncognitoProcess) IPC_MESSAGE_HANDLER(ChromeViewMsg_SetFieldTrialGroup, OnSetFieldTrialGroup) IPC_MESSAGE_HANDLER(ChromeViewMsg_SetContentSettingRules, OnSetContentSettingRules) @@ -290,6 +303,10 @@ void ChromeRenderThreadObserver::OnRenderProcessShutdown() { visited_link_slave_.reset(); + + // Workaround for http://crbug.com/672646 + if (renderer_configuration_binding_.is_bound()) + renderer_configuration_binding_.Unbind(); } void ChromeRenderThreadObserver::OnFieldTrialGroupFinalized( @@ -301,11 +318,17 @@ field_trial_recorder->FieldTrialActivated(trial_name); } -void ChromeRenderThreadObserver::OnSetIsIncognitoProcess( +void ChromeRenderThreadObserver::SetInitialConfiguration( bool is_incognito_process) { is_incognito_process_ = is_incognito_process; } +void ChromeRenderThreadObserver::OnRendererInterfaceRequest( + chrome::mojom::RendererConfigurationAssociatedRequest request) { + DCHECK(!renderer_configuration_binding_.is_bound()); + renderer_configuration_binding_.Bind(std::move(request)); +} + void ChromeRenderThreadObserver::OnSetContentSettingRules( const RendererContentSettingRules& rules) { content_setting_rules_ = rules;
diff --git a/chrome/renderer/chrome_render_thread_observer.h b/chrome/renderer/chrome_render_thread_observer.h index 0549d02..8d1cceb7 100644 --- a/chrome/renderer/chrome_render_thread_observer.h +++ b/chrome/renderer/chrome_render_thread_observer.h
@@ -12,9 +12,11 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/metrics/field_trial.h" +#include "chrome/common/renderer_configuration.mojom.h" #include "components/content_settings/core/common/content_settings.h" #include "components/variations/child_process_field_trial_syncer.h" #include "content/public/renderer/render_thread_observer.h" +#include "mojo/public/cpp/bindings/associated_binding.h" namespace content { class ResourceDispatcherDelegate; @@ -29,7 +31,8 @@ // happen. If a few messages are related, they should probably have their own // observer. class ChromeRenderThreadObserver : public content::RenderThreadObserver, - public base::FieldTrialList::Observer { + public base::FieldTrialList::Observer, + public chrome::mojom::RendererConfiguration { public: ChromeRenderThreadObserver(); ~ChromeRenderThreadObserver() override; @@ -46,6 +49,10 @@ private: // content::RenderThreadObserver: + void RegisterMojoInterfaces( + content::AssociatedInterfaceRegistry* associated_interfaces) override; + void UnregisterMojoInterfaces( + content::AssociatedInterfaceRegistry* associated_interfaces) override; bool OnControlMessageReceived(const IPC::Message& message) override; void OnRenderProcessShutdown() override; @@ -53,7 +60,12 @@ void OnFieldTrialGroupFinalized(const std::string& trial_name, const std::string& group_name) override; - void OnSetIsIncognitoProcess(bool is_incognito_process); + // chrome::mojom::RendererConfiguration: + void SetInitialConfiguration(bool is_incognito_process) override; + + void OnRendererInterfaceRequest( + chrome::mojom::RendererConfigurationAssociatedRequest request); + void OnSetContentSettingRules(const RendererContentSettingRules& rules); void OnSetFieldTrialGroup(const std::string& trial_name, const std::string& group_name); @@ -65,6 +77,9 @@ std::unique_ptr<visitedlink::VisitedLinkSlave> visited_link_slave_; + mojo::AssociatedBinding<chrome::mojom::RendererConfiguration> + renderer_configuration_binding_; + base::WeakPtrFactory<ChromeRenderThreadObserver> weak_factory_; DISALLOW_COPY_AND_ASSIGN(ChromeRenderThreadObserver);
diff --git a/components/arc/arc_bridge_service.cc b/components/arc/arc_bridge_service.cc index be3e44d..d8bb59a 100644 --- a/components/arc/arc_bridge_service.cc +++ b/components/arc/arc_bridge_service.cc
@@ -21,9 +21,6 @@ } // namespace -// Weak pointer. This class is owned by ArcServiceManager. -ArcBridgeService* g_arc_bridge_service = nullptr; - ArcBridgeService::ArcBridgeService() : state_(State::STOPPED), stop_reason_(StopReason::SHUTDOWN), @@ -35,18 +32,6 @@ } // static -ArcBridgeService* ArcBridgeService::Get() { - if (!g_arc_bridge_service) { - // ArcBridgeService may be indirectly referenced in unit tests where - // ArcBridgeService is optional. - LOG(ERROR) << "ArcBridgeService is not ready."; - return nullptr; - } - DCHECK(g_arc_bridge_service->CalledOnValidThread()); - return g_arc_bridge_service; -} - -// static bool ArcBridgeService::GetEnabled(const base::CommandLine* command_line) { return command_line->HasSwitch(chromeos::switches::kEnableArc) || (command_line->HasSwitch(chromeos::switches::kArcAvailable) &&
diff --git a/components/arc/arc_bridge_service.h b/components/arc/arc_bridge_service.h index acd3c00..51dede7 100644 --- a/components/arc/arc_bridge_service.h +++ b/components/arc/arc_bridge_service.h
@@ -90,10 +90,6 @@ virtual ~ArcBridgeService(); - // Gets the global instance of the ARC Bridge Service. This can only be - // called on the thread that this class was created on. - static ArcBridgeService* Get(); - // Return true if ARC has been enabled through a commandline // switch. static bool GetEnabled(const base::CommandLine* command_line);
diff --git a/components/arc/arc_bridge_service_impl.cc b/components/arc/arc_bridge_service_impl.cc index 51a7cd7..f3efcade 100644 --- a/components/arc/arc_bridge_service_impl.cc +++ b/components/arc/arc_bridge_service_impl.cc
@@ -21,9 +21,6 @@ #include "components/prefs/pref_service.h" namespace arc { - -extern ArcBridgeService* g_arc_bridge_service; - namespace { constexpr int64_t kReconnectDelayInSeconds = 5; } // namespace @@ -32,17 +29,11 @@ const scoped_refptr<base::TaskRunner>& blocking_task_runner) : session_started_(false), factory_(base::Bind(ArcSession::Create, this, blocking_task_runner)), - weak_factory_(this) { - DCHECK(!g_arc_bridge_service); - g_arc_bridge_service = this; -} + weak_factory_(this) {} ArcBridgeServiceImpl::~ArcBridgeServiceImpl() { if (arc_session_) arc_session_->RemoveObserver(this); - - DCHECK(g_arc_bridge_service == this); - g_arc_bridge_service = nullptr; } void ArcBridgeServiceImpl::RequestStart() {
diff --git a/components/arc/test/fake_arc_bridge_service.cc b/components/arc/test/fake_arc_bridge_service.cc index c6a8524..444492a 100644 --- a/components/arc/test/fake_arc_bridge_service.cc +++ b/components/arc/test/fake_arc_bridge_service.cc
@@ -6,16 +6,9 @@ namespace arc { -extern ArcBridgeService* g_arc_bridge_service; - -FakeArcBridgeService::FakeArcBridgeService() { - DCHECK(!g_arc_bridge_service); - g_arc_bridge_service = this; -} +FakeArcBridgeService::FakeArcBridgeService() = default; FakeArcBridgeService::~FakeArcBridgeService() { - DCHECK(g_arc_bridge_service == this); - g_arc_bridge_service = nullptr; SetStopped(); }
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index 6e24301e..5516a44 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -1701,6 +1701,8 @@ "android/java/java_type.h", "android/java/jni_helper.cc", "android/java/jni_helper.h", + "android/joystick_scroll_provider.cc", + "android/joystick_scroll_provider.h", "android/load_url_params.cc", "android/load_url_params.h", "android/overscroll_controller_android.cc",
diff --git a/content/browser/android/browser_jni_registrar.cc b/content/browser/android/browser_jni_registrar.cc index 51c9388..c9cde11 100644 --- a/content/browser/android/browser_jni_registrar.cc +++ b/content/browser/android/browser_jni_registrar.cc
@@ -19,6 +19,7 @@ #include "content/browser/android/content_view_statics.h" #include "content/browser/android/date_time_chooser_android.h" #include "content/browser/android/interstitial_page_delegate_android.h" +#include "content/browser/android/joystick_scroll_provider.h" #include "content/browser/android/load_url_params.h" #include "content/browser/android/tracing_controller_android.h" #include "content/browser/android/web_contents_observer_proxy.h" @@ -54,6 +55,7 @@ {"InterstitialPageDelegateAndroid", content::InterstitialPageDelegateAndroid:: RegisterInterstitialPageDelegateAndroid}, + {"JoystickScrollProvider", content::RegisterJoystickScrollProvider}, {"LoadUrlParams", content::RegisterLoadUrlParams}, {"MediaSessionImpl", content::MediaSessionAndroid::Register}, {"NavigationControllerAndroid",
diff --git a/content/browser/android/joystick_scroll_provider.cc b/content/browser/android/joystick_scroll_provider.cc new file mode 100644 index 0000000..c6d3fa7e --- /dev/null +++ b/content/browser/android/joystick_scroll_provider.cc
@@ -0,0 +1,97 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/android/joystick_scroll_provider.h" + +#include "base/supports_user_data.h" +#include "content/browser/renderer_host/input/web_input_event_builders_android.h" +#include "content/browser/renderer_host/render_widget_host_view_android.h" +#include "content/browser/web_contents/web_contents_impl.h" +#include "jni/JoystickScrollProvider_jni.h" + +using base::android::AttachCurrentThread; +using base::android::JavaRef; +using base::android::ScopedJavaLocalRef; + +namespace content { + +const void* const kJoystickScrollUserDataKey = &kJoystickScrollUserDataKey; + +namespace { +const double MILLISECONDS_IN_SECOND = 1000.0; +} + +// A helper class to attach JoystickScrollProvider to the WebContents. +class JoystickScrollProvider::UserData : public base::SupportsUserData::Data { + public: + explicit UserData(JoystickScrollProvider* rep) : rep_(rep) {} + + private: + std::unique_ptr<JoystickScrollProvider> rep_; + + DISALLOW_IMPLICIT_CONSTRUCTORS(UserData); +}; + +jlong Init(JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj, + const base::android::JavaParamRef<jobject>& jweb_contents) { + WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( + WebContents::FromJavaWebContents(jweb_contents)); + CHECK(web_contents) + << "A JoystickScrollProvider should be created with a valid WebContents."; + + DCHECK(!web_contents->GetUserData(kJoystickScrollUserDataKey)) + << "WebContents already has JoystickScrollProvider attached"; + + JoystickScrollProvider* native_object = + new JoystickScrollProvider(env, obj, web_contents); + return reinterpret_cast<intptr_t>(native_object); +} + +JoystickScrollProvider::JoystickScrollProvider(JNIEnv* env, + const JavaRef<jobject>& obj, + WebContentsImpl* web_contents) + : java_ref_(env, obj), web_contents_(web_contents) { + web_contents_->SetUserData(kJoystickScrollUserDataKey, new UserData(this)); +} + +JoystickScrollProvider::~JoystickScrollProvider() { + JNIEnv* env = AttachCurrentThread(); + ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); + java_ref_.reset(); + if (!j_obj.is_null()) { + Java_JoystickScrollProvider_onNativeObjectDestroyed( + env, j_obj, reinterpret_cast<intptr_t>(this)); + } +} + +void JoystickScrollProvider::ScrollBy( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj, + jlong time_ms, + jfloat dx_dip, + jfloat dy_dip) { + if (!web_contents_) + return; + + RenderWidgetHostViewAndroid* rwhv = static_cast<RenderWidgetHostViewAndroid*>( + web_contents_->GetRenderWidgetHostView()); + if (!rwhv) + return; + + if (!dx_dip && !dy_dip) + return; + + // Revert the direction for syntheric mouse wheel event. + blink::WebMouseWheelEvent event = WebMouseWheelEventBuilder::Build( + -dx_dip, -dy_dip, 1.0, time_ms / MILLISECONDS_IN_SECOND, 0, 0); + + rwhv->SendMouseWheelEvent(event); +} + +bool RegisterJoystickScrollProvider(JNIEnv* env) { + return RegisterNativesImpl(env); +} + +} // namespace content
diff --git a/content/browser/android/joystick_scroll_provider.h b/content/browser/android/joystick_scroll_provider.h new file mode 100644 index 0000000..ab9c72d --- /dev/null +++ b/content/browser/android/joystick_scroll_provider.h
@@ -0,0 +1,44 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_ANDROID_JOYSTICK_SCROLL_PROVIDER_H_ +#define CONTENT_BROWSER_ANDROID_JOYSTICK_SCROLL_PROVIDER_H_ + +#include "base/android/jni_android.h" +#include "base/android/jni_weak_ref.h" + +namespace content { + +class WebContentsImpl; + +class JoystickScrollProvider { + public: + JoystickScrollProvider(JNIEnv* env, + const base::android::JavaRef<jobject>& obj, + WebContentsImpl* web_contents); + + ~JoystickScrollProvider(); + + void ScrollBy(JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj, + jlong time_ms, + jfloat dx_dip, + jfloat dy_dip); + + private: + class UserData; + + // A weak reference to the Java JoystickScrollProvider object. + JavaObjectWeakGlobalRef java_ref_; + + WebContentsImpl* web_contents_; + + DISALLOW_COPY_AND_ASSIGN(JoystickScrollProvider); +}; + +bool RegisterJoystickScrollProvider(JNIEnv* env); + +} // namespace content + +#endif // CONTENT_BROWSER_ANDROID_JOYSTICK_SCROLL_PROVIDER_H_
diff --git a/content/public/android/BUILD.gn b/content/public/android/BUILD.gn index 3f2a418..9b1487c 100644 --- a/content/public/android/BUILD.gn +++ b/content/public/android/BUILD.gn
@@ -351,6 +351,7 @@ "java/src/org/chromium/content/browser/input/DateTimeChooserAndroid.java", "java/src/org/chromium/content/browser/input/HandleViewResources.java", "java/src/org/chromium/content/browser/input/ImeAdapter.java", + "java/src/org/chromium/content/browser/input/JoystickScrollProvider.java", "java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java", "java/src/org/chromium/content/browser/webcontents/WebContentsObserverProxy.java", "java/src/org/chromium/content_public/browser/LoadUrlParams.java",
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentView.java b/content/public/android/java/src/org/chromium/content/browser/ContentView.java index 9e775af..af83042 100644 --- a/content/public/android/java/src/org/chromium/content/browser/ContentView.java +++ b/content/public/android/java/src/org/chromium/content/browser/ContentView.java
@@ -224,7 +224,7 @@ */ @Override public void scrollBy(int x, int y) { - mContentViewCore.scrollBy(x, y, false); + mContentViewCore.scrollBy(x, y); } @Override
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java index 952f300..a3ad4b87 100644 --- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java +++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -344,7 +344,7 @@ private final RenderCoordinates mRenderCoordinates; // Provides smooth gamepad joystick-driven scrolling. - private final JoystickScrollProvider mJoystickScrollProvider; + private JoystickScrollProvider mJoystickScrollProvider; // Provides smooth gamepad joystick-driven zooming. private JoystickZoomProvider mJoystickZoomProvider; @@ -387,10 +387,6 @@ // because the OSK was just brought up. private final Rect mFocusPreOSKViewportRect = new Rect(); - // Store the x, y coordinates of the last touch or mouse event. - private float mLastFocalEventX; - private float mLastFocalEventY; - // Whether a touch scroll sequence is active, used to hide text selection // handles. Note that a scroll sequence will *always* bound a pinch // sequence, so this will also be true for the duration of a pinch gesture. @@ -453,7 +449,6 @@ mContext = context; mProductVersion = productVersion; mRenderCoordinates = new RenderCoordinates(); - mJoystickScrollProvider = new JoystickScrollProvider(this); mAccessibilityManager = (AccessibilityManager) getContext().getSystemService(Context.ACCESSIBILITY_SERVICE); mSystemCaptioningBridge = CaptioningBridgeFactory.getSystemCaptioningBridge(mContext); @@ -635,6 +630,9 @@ mRenderCoordinates.reset(); mRenderCoordinates.setDeviceScaleFactor(dipScale, windowAndroid.getContext()); + mJoystickScrollProvider = + new JoystickScrollProvider(webContents, getContainerView(), windowAndroid); + mNativeContentViewCore = nativeInit(webContents, mViewAndroidDelegate, windowNativePointer, dipScale, mRetainedJavaScriptObjects); mWebContents = nativeGetWebContentsAndroid(mNativeContentViewCore); @@ -670,6 +668,8 @@ addDisplayAndroidObserverIfNeeded(); + mJoystickScrollProvider.updateWindowAndroid(windowAndroid); + for (WindowAndroidChangedObserver observer : mWindowAndroidChangedObservers) { observer.onWindowAndroidChanged(windowAndroid); } @@ -1390,6 +1390,7 @@ GamepadList.onAttachedToWindow(mContext); mAccessibilityManager.addAccessibilityStateChangeListener(this); mSystemCaptioningBridge.addListener(this); + mJoystickScrollProvider.onViewAttachedToWindow(); mImeAdapter.onViewAttachedToWindow(); } @@ -1418,6 +1419,7 @@ public void onDetachedFromWindow() { mAttachedToWindow = false; mImeAdapter.onViewDetachedFromWindow(); + mJoystickScrollProvider.onViewDetachedFromWindow(); mZoomControlsDelegate.dismissZoomPicker(); removeDisplayAndroidObserver(); GamepadList.onDetachedFromWindow(); @@ -1542,7 +1544,11 @@ public void onFocusChanged(boolean gainFocus) { mImeAdapter.onViewFocusChanged(gainFocus); - mJoystickScrollProvider.setEnabled(gainFocus && !isFocusedNodeEditable()); + + // Used in test that bypasses initialize(). + if (mJoystickScrollProvider != null) { + mJoystickScrollProvider.setEnabled(gainFocus && !isFocusedNodeEditable()); + } if (gainFocus) { restoreSelectionPopupsIfNecessary(); @@ -1643,8 +1649,6 @@ public boolean onGenericMotionEvent(MotionEvent event) { if (GamepadList.onGenericMotionEvent(event)) return true; if ((event.getSource() & InputDevice.SOURCE_CLASS_POINTER) != 0) { - mLastFocalEventX = event.getX(); - mLastFocalEventY = event.getY(); switch (event.getActionMasked()) { case MotionEvent.ACTION_SCROLL: if (mNativeContentViewCore == 0) return false; @@ -1713,7 +1717,7 @@ * are overridden, so that View's mScrollX and mScrollY will be unchanged at * (0, 0). This is critical for drawing ContentView correctly. */ - public void scrollBy(float dxPix, float dyPix, boolean useLastFocalEventLocation) { + public void scrollBy(float dxPix, float dyPix) { if (mNativeContentViewCore == 0) return; if (dxPix == 0 && dyPix == 0) return; long time = SystemClock.uptimeMillis(); @@ -1722,11 +1726,8 @@ // such cases ensures a consistent gesture event stream. if (mPotentiallyActiveFlingCount > 0) nativeFlingCancel(mNativeContentViewCore, time); // x/y represents starting location of scroll. - final float x = useLastFocalEventLocation ? mLastFocalEventX : 0f; - final float y = useLastFocalEventLocation ? mLastFocalEventY : 0f; - nativeScrollBegin( - mNativeContentViewCore, time, x, y, -dxPix, -dyPix, !useLastFocalEventLocation); - nativeScrollBy(mNativeContentViewCore, time, x, y, dxPix, dyPix); + nativeScrollBegin(mNativeContentViewCore, time, 0f, 0f, -dxPix, -dyPix, true); + nativeScrollBy(mNativeContentViewCore, time, 0f, 0f, dxPix, dyPix); nativeScrollEnd(mNativeContentViewCore, time); } @@ -1739,7 +1740,7 @@ final float yCurrentPix = mRenderCoordinates.getScrollYPix(); final float dxPix = xPix - xCurrentPix; final float dyPix = yPix - yCurrentPix; - scrollBy(dxPix, dyPix, false); + scrollBy(dxPix, dyPix); } // NOTE: this can go away once ContentView.getScrollX() reports correct values. @@ -1833,8 +1834,6 @@ } if (!mPopupZoomer.isShowing()) mPopupZoomer.setLastTouch(xPix, yPix); - mLastFocalEventX = xPix; - mLastFocalEventY = yPix; } public void setZoomControlsDelegate(ZoomControlsDelegate zoomControlsDelegate) {
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/JoystickScrollProvider.java b/content/public/android/java/src/org/chromium/content/browser/input/JoystickScrollProvider.java index 1336b78b..8c57b5f 100644 --- a/content/public/android/java/src/org/chromium/content/browser/input/JoystickScrollProvider.java +++ b/content/public/android/java/src/org/chromium/content/browser/input/JoystickScrollProvider.java
@@ -4,17 +4,25 @@ package org.chromium.content.browser.input; +import android.content.Context; import android.util.TypedValue; import android.view.InputDevice; import android.view.MotionEvent; +import android.view.View; import android.view.animation.AnimationUtils; import org.chromium.base.Log; -import org.chromium.content.browser.ContentViewCore; +import org.chromium.base.annotations.CalledByNative; +import org.chromium.base.annotations.JNINamespace; +import org.chromium.content_public.browser.WebContents; +import org.chromium.ui.base.WindowAndroid; +import org.chromium.ui.display.DisplayAndroid; +import org.chromium.ui.display.DisplayAndroid.DisplayAndroidObserver; /** * This class implements auto scrolling and panning for gamepad left joystick motion event. */ +@JNINamespace("content") public class JoystickScrollProvider { private static final String TAG = "JoystickScroll"; @@ -24,11 +32,26 @@ private static final float JOYSTICK_SCROLL_DEADZONE = 0.2f; private static final float SCROLL_FACTOR_FALLBACK = 128f; - private final ContentViewCore mView; + private class JoystickScrollDisplayObserver implements DisplayAndroidObserver { + @Override + public void onRotationChanged(int rotation) {} + + @Override + public void onDIPScaleChanged(float dipScale) { + mDipScale = dipScale; + updateScrollFactor(); + } + } + + private WindowAndroid mWindowAndroid; + private View mContainerView; + private long mNativeJoystickScrollProvider; + private JoystickScrollDisplayObserver mDisplayObserver; private float mScrollVelocityX; private float mScrollVelocityY; private float mScrollFactor; + private float mDipScale = 1.0f; private long mLastAnimateTimeMillis; @@ -38,12 +61,20 @@ /** * Constructs a new JoystickScrollProvider. - * - * @param contentview The ContentViewCore used to create this. */ - public JoystickScrollProvider(ContentViewCore contentView) { - mView = contentView; + public JoystickScrollProvider( + WebContents webContents, View containerView, WindowAndroid windowAndroid) { + mNativeJoystickScrollProvider = nativeInit(webContents); + mContainerView = containerView; + mWindowAndroid = windowAndroid; mEnabled = true; + mDisplayObserver = new JoystickScrollDisplayObserver(); + } + + @CalledByNative + private void onNativeObjectDestroyed(long nativePointer) { + assert nativePointer == mNativeJoystickScrollProvider; + mNativeJoystickScrollProvider = 0; } /** @@ -56,6 +87,49 @@ if (!enabled) stop(); } + public void onViewAttachedToWindow() { + addDisplayAndroidObserver(); + } + + public void onViewDetachedFromWindow() { + removeDisplayAndroidObserver(); + } + + public void updateWindowAndroid(WindowAndroid windowAndroid) { + removeDisplayAndroidObserver(); + mWindowAndroid = windowAndroid; + addDisplayAndroidObserver(); + } + + private void addDisplayAndroidObserver() { + if (mWindowAndroid == null) return; + + DisplayAndroid display = mWindowAndroid.getDisplay(); + display.addObserver(mDisplayObserver); + mDisplayObserver.onDIPScaleChanged(display.getDipScale()); + } + + private void removeDisplayAndroidObserver() { + if (mWindowAndroid == null) return; + mWindowAndroid.getDisplay().removeObserver(mDisplayObserver); + } + + private void updateScrollFactor() { + Context context = mWindowAndroid == null ? null : mWindowAndroid.getContext().get(); + TypedValue outValue = new TypedValue(); + + if (context != null && context.getTheme().resolveAttribute( + android.R.attr.listPreferredItemHeight, outValue, true)) { + mScrollFactor = outValue.getDimension(context.getResources().getDisplayMetrics()); + } else { + if (context != null) { + Log.d(TAG, "Theme attribute listPreferredItemHeight not defined" + + " switching to fallback scroll factor"); + } + mScrollFactor = SCROLL_FACTOR_FALLBACK * mDipScale; + } + } + /** * This function processes motion event and computes new * scroll offest in pixels which is propertional to left joystick @@ -72,7 +146,13 @@ Log.d(TAG, "Joystick left stick axis: " + event.getAxisValue(MotionEvent.AXIS_X) + "," + event.getAxisValue(MotionEvent.AXIS_Y)); - computeNewScrollVelocity(event); + assert mScrollFactor != 0; + + mScrollVelocityX = getFilteredAxisValue(event, MotionEvent.AXIS_X) * mScrollFactor + * JOYSTICK_SCROLL_FACTOR_MULTIPLIER; + mScrollVelocityY = getFilteredAxisValue(event, MotionEvent.AXIS_Y) * mScrollFactor + * JOYSTICK_SCROLL_FACTOR_MULTIPLIER; + if (mScrollVelocityX == 0 && mScrollVelocityY == 0) { stop(); return false; @@ -86,7 +166,7 @@ }; } if (mLastAnimateTimeMillis == 0) { - mView.getContainerView().postOnAnimation(mScrollRunnable); + mContainerView.postOnAnimation(mScrollRunnable); mLastAnimateTimeMillis = AnimationUtils.currentAnimationTimeMillis(); } return true; @@ -100,9 +180,14 @@ final long dt = timeMillis - mLastAnimateTimeMillis; final float dx = (mScrollVelocityX * dt / 1000.f); final float dy = (mScrollVelocityY * dt / 1000.f); - mView.scrollBy(dx, dy, true); + + if (mNativeJoystickScrollProvider != 0) { + nativeScrollBy( + mNativeJoystickScrollProvider, timeMillis, dx / mDipScale, dy / mDipScale); + } + mLastAnimateTimeMillis = timeMillis; - mView.getContainerView().postOnAnimation(mScrollRunnable); + mContainerView.postOnAnimation(mScrollRunnable); } private void stop() { @@ -110,29 +195,6 @@ } /** - * Translates joystick axes movement to a scroll velocity. - */ - private void computeNewScrollVelocity(MotionEvent event) { - if (mScrollFactor == 0) { - TypedValue outValue = new TypedValue(); - if (!mView.getContext().getTheme().resolveAttribute( - android.R.attr.listPreferredItemHeight, outValue, true)) { - mScrollFactor = outValue.getDimension( - mView.getContext().getResources().getDisplayMetrics()); - } else { - Log.d(TAG, "Theme attribute listPreferredItemHeight not defined" - + "switching to fallback scroll factor "); - mScrollFactor = SCROLL_FACTOR_FALLBACK - * mView.getRenderCoordinates().getDeviceScaleFactor(); - } - } - mScrollVelocityX = getFilteredAxisValue(event, MotionEvent.AXIS_X) * mScrollFactor - * JOYSTICK_SCROLL_FACTOR_MULTIPLIER; - mScrollVelocityY = getFilteredAxisValue(event, MotionEvent.AXIS_Y) * mScrollFactor - * JOYSTICK_SCROLL_FACTOR_MULTIPLIER; - } - - /** * Removes noise from joystick motion events. */ private float getFilteredAxisValue(MotionEvent event, int axis) { @@ -143,4 +205,8 @@ } return 0f; } + + private native long nativeInit(WebContents webContents); + private native void nativeScrollBy( + long nativeJoystickScrollProvider, long timeMs, float dxDip, float dyDip); }
diff --git a/content/public/renderer/render_thread_observer.h b/content/public/renderer/render_thread_observer.h index fd2ca57..db090b2 100644 --- a/content/public/renderer/render_thread_observer.h +++ b/content/public/renderer/render_thread_observer.h
@@ -13,6 +13,7 @@ } namespace content { +class AssociatedInterfaceRegistry; // Base class for objects that want to filter control IPC messages and get // notified of events. @@ -21,6 +22,12 @@ RenderThreadObserver() {} virtual ~RenderThreadObserver() {} + // Allows handling incoming Mojo requests. + virtual void RegisterMojoInterfaces( + AssociatedInterfaceRegistry* associated_interfaces) {} + virtual void UnregisterMojoInterfaces( + AssociatedInterfaceRegistry* associated_interfaces) {} + // Allows filtering of control messages. virtual bool OnControlMessageReceived(const IPC::Message& message);
diff --git a/content/public/test/render_view_test.cc b/content/public/test/render_view_test.cc index 146ebf6..166a61e 100644 --- a/content/public/test/render_view_test.cc +++ b/content/public/test/render_view_test.cc
@@ -365,7 +365,7 @@ EXPECT_EQ(0u, result.numberOfLiveNodes); EXPECT_EQ(0u, result.numberOfLiveLayoutObjects); EXPECT_EQ(0u, result.numberOfLiveResources); - EXPECT_EQ(0u, result.numberOfLiveActiveDOMObjects); + EXPECT_EQ(0u, result.numberOfLiveSuspendableObjects); EXPECT_EQ(0u, result.numberOfLiveScriptPromises); EXPECT_EQ(0u, result.numberOfLiveFrames); EXPECT_EQ(0u, result.numberOfLiveV8PerContextData);
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index e3aee0f..d3d457c 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc
@@ -1180,9 +1180,11 @@ void RenderThreadImpl::AddObserver(RenderThreadObserver* observer) { observers_.AddObserver(observer); + observer->RegisterMojoInterfaces(&associated_interfaces_); } void RenderThreadImpl::RemoveObserver(RenderThreadObserver* observer) { + observer->UnregisterMojoInterfaces(&associated_interfaces_); observers_.RemoveObserver(observer); } @@ -1809,31 +1811,20 @@ namespace { static size_t GetMallocUsage() { - DWORD number_of_heaps = ::GetProcessHeaps(0, NULL); - if (number_of_heaps <= 0) + // Only checks the default process heap. + HANDLE heap = ::GetProcessHeap(); + if (heap == NULL) return 0; - + if (!::HeapLock(heap)) + return 0 ; size_t malloc_usage = 0; - std::unique_ptr<HANDLE[]> heaps(new HANDLE[number_of_heaps]); - // If some heaps were gone between the first GetProcessHeaps and here, - // GetProcessHeaps obtains small number of heaps. - // If some new heaps were available between the first GetProcessHeaps and - // here, GetProcessHeaps returns larger number than number_of_heaps. - // So we need to see min(number_of_obtained_heaps, number_of_heaps). - DWORD number_of_obtained_heaps = - ::GetProcessHeaps(number_of_heaps, heaps.get()); - for (size_t i = 0; i < number_of_heaps && i < number_of_obtained_heaps; i++) { - PROCESS_HEAP_ENTRY heap_entry; - ::HeapLock(heaps[i]); - heap_entry.lpData = NULL; - while (::HeapWalk(heaps[i], &heap_entry) != 0) { - if (heap_entry.lpData == heaps.get()) - continue; - if ((heap_entry.wFlags & PROCESS_HEAP_ENTRY_BUSY) != 0) - malloc_usage += heap_entry.cbData; - } - ::HeapUnlock(heaps[i]); + PROCESS_HEAP_ENTRY heap_entry; + heap_entry.lpData = NULL; + while (::HeapWalk(heap, &heap_entry) != 0) { + if ((heap_entry.wFlags & PROCESS_HEAP_ENTRY_BUSY) != 0) + malloc_usage += heap_entry.cbData; } + ::HeapUnlock(heap); return malloc_usage; }
diff --git a/content/shell/renderer/layout_test/leak_detector.cc b/content/shell/renderer/layout_test/leak_detector.cc index bc8de7e..302a121b 100644 --- a/content/shell/renderer/layout_test/leak_detector.cc +++ b/content/shell/renderer/layout_test/leak_detector.cc
@@ -30,9 +30,9 @@ const int kInitialNumberOfLiveFrames = 1; const int kInitialNumberOfWorkerGlobalScopes = 0; -// In the initial state, there are two ActiveDOMObjects (FontFaceSet created by -// HTMLDocument and SuspendableTimer created by DocumentLoader). -const int kInitialNumberOfLiveActiveDOMObject = 2; +// In the initial state, there are two SuspendableObjects (FontFaceSet created +// by HTMLDocument and SuspendableTimer created by DocumentLoader). +const int kInitialNumberOfLiveSuspendableObject = 2; // This includes not only about:blank's context but also ScriptRegexp (e.g. // created by isValidEmailAddress in EmailInputType.cpp). The leak detector @@ -49,8 +49,8 @@ previous_result_.numberOfLiveLayoutObjects = kInitialNumberOfLiveLayoutObjects; previous_result_.numberOfLiveResources = kInitialNumberOfLiveResources; - previous_result_.numberOfLiveActiveDOMObjects = - kInitialNumberOfLiveActiveDOMObject; + previous_result_.numberOfLiveSuspendableObjects = + kInitialNumberOfLiveSuspendableObject; previous_result_.numberOfLiveScriptPromises = kInitialNumberOfScriptPromises; previous_result_.numberOfLiveFrames = kInitialNumberOfLiveFrames; previous_result_.numberOfLiveV8PerContextData = @@ -104,12 +104,12 @@ list->AppendInteger(result.numberOfLiveResources); detail.Set("numberOfLiveResources", list); } - if (previous_result_.numberOfLiveActiveDOMObjects < - result.numberOfLiveActiveDOMObjects) { + if (previous_result_.numberOfLiveSuspendableObjects < + result.numberOfLiveSuspendableObjects) { base::ListValue* list = new base::ListValue(); - list->AppendInteger(previous_result_.numberOfLiveActiveDOMObjects); - list->AppendInteger(result.numberOfLiveActiveDOMObjects); - detail.Set("numberOfLiveActiveDOMObjects", list); + list->AppendInteger(previous_result_.numberOfLiveSuspendableObjects); + list->AppendInteger(result.numberOfLiveSuspendableObjects); + detail.Set("numberOfLiveSuspendableObjects", list); } if (previous_result_.numberOfLiveScriptPromises < result.numberOfLiveScriptPromises) {
diff --git a/mash/simple_wm/simple_wm.cc b/mash/simple_wm/simple_wm.cc index 03ef952..1fad35b4 100644 --- a/mash/simple_wm/simple_wm.cc +++ b/mash/simple_wm/simple_wm.cc
@@ -196,7 +196,6 @@ // Only handles a single root. DCHECK(!root_); window_tree_host_ = std::move(window_tree_host); - window_tree_host_->InitCompositor(); root_ = window_tree_host_->window(); DCHECK(window_manager_client_); window_manager_client_->AddActivationParent(root_);
diff --git a/third_party/WebKit/Source/bindings/core/v8/ActiveDOMCallback.cpp b/third_party/WebKit/Source/bindings/core/v8/ActiveDOMCallback.cpp index a9458246..c6d1f64 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ActiveDOMCallback.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ActiveDOMCallback.cpp
@@ -30,8 +30,8 @@ #include "bindings/core/v8/ActiveDOMCallback.h" -#include "core/dom/ActiveDOMObject.h" #include "core/dom/ExecutionContext.h" +#include "core/dom/SuspendableObject.h" #include "core/workers/WorkerGlobalScope.h" namespace blink {
diff --git a/third_party/WebKit/Source/bindings/core/v8/RetainedDOMInfo.cpp b/third_party/WebKit/Source/bindings/core/v8/RetainedDOMInfo.cpp index 473b4387..9e22b73b 100644 --- a/third_party/WebKit/Source/bindings/core/v8/RetainedDOMInfo.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/RetainedDOMInfo.cpp
@@ -93,38 +93,38 @@ return reinterpret_cast<intptr_t>(m_root.get()); } -ActiveDOMObjectsInfo::ActiveDOMObjectsInfo( +SuspendableObjectsInfo::SuspendableObjectsInfo( int numberOfObjectsWithPendingActivity) : m_numberOfObjectsWithPendingActivity(numberOfObjectsWithPendingActivity) { } -ActiveDOMObjectsInfo::~ActiveDOMObjectsInfo() {} +SuspendableObjectsInfo::~SuspendableObjectsInfo() {} -void ActiveDOMObjectsInfo::Dispose() { +void SuspendableObjectsInfo::Dispose() { delete this; } -bool ActiveDOMObjectsInfo::IsEquivalent(v8::RetainedObjectInfo* other) { +bool SuspendableObjectsInfo::IsEquivalent(v8::RetainedObjectInfo* other) { return this == other; } -intptr_t ActiveDOMObjectsInfo::GetHash() { +intptr_t SuspendableObjectsInfo::GetHash() { return PtrHash<void>::hash(this); } -const char* ActiveDOMObjectsInfo::GetGroupLabel() { +const char* SuspendableObjectsInfo::GetGroupLabel() { return "(Pending activities group)"; } -const char* ActiveDOMObjectsInfo::GetLabel() { +const char* SuspendableObjectsInfo::GetLabel() { return "Pending activities"; } -intptr_t ActiveDOMObjectsInfo::GetElementCount() { +intptr_t SuspendableObjectsInfo::GetElementCount() { return m_numberOfObjectsWithPendingActivity; } -intptr_t ActiveDOMObjectsInfo::GetEquivalenceClass() { +intptr_t SuspendableObjectsInfo::GetEquivalenceClass() { return reinterpret_cast<intptr_t>(this); }
diff --git a/third_party/WebKit/Source/bindings/core/v8/RetainedDOMInfo.h b/third_party/WebKit/Source/bindings/core/v8/RetainedDOMInfo.h index 0ccaaaa..1688167 100644 --- a/third_party/WebKit/Source/bindings/core/v8/RetainedDOMInfo.h +++ b/third_party/WebKit/Source/bindings/core/v8/RetainedDOMInfo.h
@@ -63,10 +63,10 @@ UntracedMember<Node> m_root; }; -class ActiveDOMObjectsInfo final : public RetainedObjectInfo { +class SuspendableObjectsInfo final : public RetainedObjectInfo { public: - explicit ActiveDOMObjectsInfo(int numberOfObjectsWithPendingActivity); - ~ActiveDOMObjectsInfo() override; + explicit SuspendableObjectsInfo(int numberOfObjectsWithPendingActivity); + ~SuspendableObjectsInfo() override; void Dispose() override; bool IsEquivalent(v8::RetainedObjectInfo* other) override; intptr_t GetHash() override;
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.cpp index 14bd407..0c41a6a 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.cpp
@@ -9,7 +9,7 @@ namespace blink { ScriptPromiseResolver::ScriptPromiseResolver(ScriptState* scriptState) - : ActiveDOMObject(scriptState->getExecutionContext()), + : SuspendableObject(scriptState->getExecutionContext()), m_state(Pending), m_scriptState(scriptState), m_timer(this, &ScriptPromiseResolver::onTimerFired), @@ -86,7 +86,7 @@ } DEFINE_TRACE(ScriptPromiseResolver) { - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.h b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.h index 0df407c9..48918360 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.h +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.h
@@ -10,8 +10,8 @@ #include "bindings/core/v8/ScriptState.h" #include "bindings/core/v8/ToV8.h" #include "core/CoreExport.h" -#include "core/dom/ActiveDOMObject.h" #include "core/dom/ExecutionContext.h" +#include "core/dom/SuspendableObject.h" #include "platform/ScriptForbiddenScope.h" #include "platform/Timer.h" #include "platform/heap/Handle.h" @@ -24,13 +24,13 @@ // functionalities. // - A ScriptPromiseResolver retains a ScriptState. A caller // can call resolve or reject from outside of a V8 context. -// - This class is an ActiveDOMObject and keeps track of the associated +// - This class is an SuspendableObject and keeps track of the associated // ExecutionContext state. When the ExecutionContext is suspended, // resolve or reject will be delayed. When it is stopped, resolve or reject // will be ignored. class CORE_EXPORT ScriptPromiseResolver : public GarbageCollectedFinalized<ScriptPromiseResolver>, - public ActiveDOMObject { + public SuspendableObject { USING_GARBAGE_COLLECTED_MIXIN(ScriptPromiseResolver); WTF_MAKE_NONCOPYABLE(ScriptPromiseResolver); @@ -86,7 +86,7 @@ ScriptState* getScriptState() const { return m_scriptState.get(); } - // ActiveDOMObject implementation. + // SuspendableObject implementation. void suspend() override; void resume() override; void contextDestroyed() override { detach(); } @@ -105,7 +105,7 @@ protected: // You need to call suspendIfNeeded after the construction because - // this is an ActiveDOMObject. + // this is an SuspendableObject. explicit ScriptPromiseResolver(ScriptState*); private:
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolverTest.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolverTest.cpp index 0db501b..cf19eabe 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolverTest.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolverTest.cpp
@@ -281,7 +281,7 @@ BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep, BlinkGC::ForcedGC); ASSERT_TRUE(ScriptPromiseResolverKeepAlive::isAlive()); - getExecutionContext()->suspendActiveDOMObjects(); + getExecutionContext()->suspendSuspendableObjects(); resolver->resolve("hello"); ThreadState::current()->collectGarbage( BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep, BlinkGC::ForcedGC);
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp b/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp index f12153a5..1a003fc 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
@@ -227,10 +227,11 @@ alreadyAdded = root; } } - if (m_liveRootGroupIdSet) + if (m_liveRootGroupIdSet) { profiler->SetRetainedObjectInfo( liveRootId(), - new ActiveDOMObjectsInfo(m_domObjectsWithPendingActivity)); + new SuspendableObjectsInfo(m_domObjectsWithPendingActivity)); + } } private:
diff --git a/third_party/WebKit/Source/core/BUILD.gn b/third_party/WebKit/Source/core/BUILD.gn index 222655a4..7dda8a1 100644 --- a/third_party/WebKit/Source/core/BUILD.gn +++ b/third_party/WebKit/Source/core/BUILD.gn
@@ -1098,7 +1098,6 @@ "css/resolver/FontBuilderTest.cpp", "css/resolver/MatchResultTest.cpp", "css/resolver/SharedStyleFinderTest.cpp", - "dom/ActiveDOMObjectTest.cpp", "dom/AttrTest.cpp", "dom/CSSSelectorWatchTest.cpp", "dom/DOMImplementationTest.cpp", @@ -1120,6 +1119,7 @@ "dom/StaticRangeTest.cpp", "dom/StyleElementTest.cpp", "dom/StyleEngineTest.cpp", + "dom/SuspendableObjectTest.cpp", "dom/TextTest.cpp", "dom/TreeScopeStyleSheetCollectionTest.cpp", "dom/TreeScopeTest.cpp",
diff --git a/third_party/WebKit/Source/core/animation/Animation.cpp b/third_party/WebKit/Source/core/animation/Animation.cpp index f6ba49b..6638823 100644 --- a/third_party/WebKit/Source/core/animation/Animation.cpp +++ b/third_party/WebKit/Source/core/animation/Animation.cpp
@@ -82,7 +82,7 @@ AnimationTimeline& timeline, AnimationEffectReadOnly* content) : ActiveScriptWrappable(this), - ActiveDOMObject(executionContext), + SuspendableObject(executionContext), m_playState(Idle), m_playbackRate(1), m_startTime(nullValue()), @@ -647,7 +647,7 @@ } ExecutionContext* Animation::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } bool Animation::hasPendingActivity() const { @@ -1127,7 +1127,7 @@ visitor->trace(m_finishedPromise); visitor->trace(m_readyPromise); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/animation/Animation.h b/third_party/WebKit/Source/core/animation/Animation.h index e654fe3..ccaf0de 100644 --- a/third_party/WebKit/Source/core/animation/Animation.h +++ b/third_party/WebKit/Source/core/animation/Animation.h
@@ -38,8 +38,8 @@ #include "core/CSSPropertyNames.h" #include "core/CoreExport.h" #include "core/animation/AnimationEffectReadOnly.h" -#include "core/dom/ActiveDOMObject.h" #include "core/dom/DOMException.h" +#include "core/dom/SuspendableObject.h" #include "core/events/EventTarget.h" #include "platform/animation/CompositorAnimationDelegate.h" #include "platform/animation/CompositorAnimationPlayerClient.h" @@ -57,7 +57,7 @@ class CORE_EXPORT Animation final : public EventTargetWithInlineData, public ActiveScriptWrappable, - public ActiveDOMObject, + public SuspendableObject, public CompositorAnimationDelegate, public CompositorAnimationPlayerClient { DEFINE_WRAPPERTYPEINFO();
diff --git a/third_party/WebKit/Source/core/css/FontFace.cpp b/third_party/WebKit/Source/core/css/FontFace.cpp index d6f98bd..2b35ed2 100644 --- a/third_party/WebKit/Source/core/css/FontFace.cpp +++ b/third_party/WebKit/Source/core/css/FontFace.cpp
@@ -155,7 +155,7 @@ FontFace::FontFace(ExecutionContext* context) : ActiveScriptWrappable(this), - ActiveDOMObject(context), + SuspendableObject(context), m_status(Unloaded) { suspendIfNeeded(); } @@ -164,7 +164,7 @@ const AtomicString& family, const FontFaceDescriptors& descriptors) : ActiveScriptWrappable(this), - ActiveDOMObject(context), + SuspendableObject(context), m_family(family), m_status(Unloaded) { Document* document = toDocument(context); @@ -644,7 +644,7 @@ visitor->trace(m_loadedProperty); visitor->trace(m_cssFontFace); visitor->trace(m_callbacks); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } bool FontFace::hadBlankText() const {
diff --git a/third_party/WebKit/Source/core/css/FontFace.h b/third_party/WebKit/Source/core/css/FontFace.h index d42407b1..6be7b398 100644 --- a/third_party/WebKit/Source/core/css/FontFace.h +++ b/third_party/WebKit/Source/core/css/FontFace.h
@@ -37,8 +37,8 @@ #include "bindings/core/v8/ScriptWrappable.h" #include "core/CSSPropertyNames.h" #include "core/css/CSSValue.h" -#include "core/dom/ActiveDOMObject.h" #include "core/dom/DOMException.h" +#include "core/dom/SuspendableObject.h" #include "platform/fonts/FontTraits.h" #include "wtf/text/WTFString.h" @@ -58,7 +58,7 @@ class FontFace : public GarbageCollectedFinalized<FontFace>, public ScriptWrappable, public ActiveScriptWrappable, - public ActiveDOMObject { + public SuspendableObject { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(FontFace); WTF_MAKE_NONCOPYABLE(FontFace);
diff --git a/third_party/WebKit/Source/core/css/FontFaceSet.cpp b/third_party/WebKit/Source/core/css/FontFaceSet.cpp index 88b70ca..48833a0 100644 --- a/third_party/WebKit/Source/core/css/FontFaceSet.cpp +++ b/third_party/WebKit/Source/core/css/FontFaceSet.cpp
@@ -113,7 +113,7 @@ } FontFaceSet::FontFaceSet(Document& document) - : ActiveDOMObject(&document), + : SuspendableObject(&document), m_shouldFireLoadingEvent(false), m_isLoading(false), m_ready( @@ -146,7 +146,7 @@ } ExecutionContext* FontFaceSet::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } AtomicString FontFaceSet::status() const { @@ -561,7 +561,7 @@ visitor->trace(m_asyncRunner); EventTargetWithInlineData::trace(visitor); Supplement<Document>::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); FontFace::LoadFontCallback::trace(visitor); }
diff --git a/third_party/WebKit/Source/core/css/FontFaceSet.h b/third_party/WebKit/Source/core/css/FontFaceSet.h index 713dabf..78a27b4 100644 --- a/third_party/WebKit/Source/core/css/FontFaceSet.h +++ b/third_party/WebKit/Source/core/css/FontFaceSet.h
@@ -29,8 +29,8 @@ #include "bindings/core/v8/Iterable.h" #include "bindings/core/v8/ScriptPromise.h" #include "core/css/FontFace.h" -#include "core/dom/ActiveDOMObject.h" #include "core/dom/Document.h" +#include "core/dom/SuspendableObject.h" #include "core/events/EventListener.h" #include "core/events/EventTarget.h" #include "platform/AsyncMethodRunner.h" @@ -56,7 +56,7 @@ class FontFaceSet final : public EventTargetWithInlineData, public Supplement<Document>, - public ActiveDOMObject, + public SuspendableObject, public FontFaceSetIterable, public FontFace::LoadFontCallback { USING_GARBAGE_COLLECTED_MIXIN(FontFaceSet); @@ -96,7 +96,7 @@ size_t approximateBlankCharacterCount() const; - // ActiveDOMObject + // SuspendableObject void suspend() override; void resume() override; void contextDestroyed() override;
diff --git a/third_party/WebKit/Source/core/css/MediaQueryList.cpp b/third_party/WebKit/Source/core/css/MediaQueryList.cpp index 5b17f10f..b036426e 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryList.cpp +++ b/third_party/WebKit/Source/core/css/MediaQueryList.cpp
@@ -39,7 +39,7 @@ MediaQueryMatcher* matcher, MediaQuerySet* media) : ActiveScriptWrappable(this), - ActiveDOMObject(context), + SuspendableObject(context), m_matcher(matcher), m_media(media), m_matchesDirty(true), @@ -121,7 +121,7 @@ visitor->trace(m_media); visitor->trace(m_listeners); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } const AtomicString& MediaQueryList::interfaceName() const { @@ -129,7 +129,7 @@ } ExecutionContext* MediaQueryList::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/MediaQueryList.h b/third_party/WebKit/Source/core/css/MediaQueryList.h index 8a0d6ba..2cc0938 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryList.h +++ b/third_party/WebKit/Source/core/css/MediaQueryList.h
@@ -23,7 +23,7 @@ #include "bindings/core/v8/ActiveScriptWrappable.h" #include "bindings/core/v8/ScriptWrappable.h" #include "core/CoreExport.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "core/events/EventTarget.h" #include "platform/heap/Handle.h" #include "wtf/Forward.h" @@ -43,7 +43,7 @@ class CORE_EXPORT MediaQueryList final : public EventTargetWithInlineData, public ActiveScriptWrappable, - public ActiveDOMObject { + public SuspendableObject { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(MediaQueryList); WTF_MAKE_NONCOPYABLE(MediaQueryList); @@ -78,7 +78,7 @@ // From ScriptWrappable bool hasPendingActivity() const final; - // From ActiveDOMObject + // From SuspendableObject void contextDestroyed() override; const AtomicString& interfaceName() const override;
diff --git a/third_party/WebKit/Source/core/dom/BUILD.gn b/third_party/WebKit/Source/core/dom/BUILD.gn index e0fd8d2..3329a9b 100644 --- a/third_party/WebKit/Source/core/dom/BUILD.gn +++ b/third_party/WebKit/Source/core/dom/BUILD.gn
@@ -10,7 +10,6 @@ sources = [ "AXObjectCache.cpp", "AXObjectCache.h", - "ActiveDOMObject.cpp", "Attr.cpp", "AttributeCollection.h", "CDATASection.cpp", @@ -266,6 +265,7 @@ "StyleSheetCandidate.h", "StyleSheetCollection.cpp", "StyleSheetCollection.h", + "SuspendableObject.cpp", "SynchronousMutationNotifier.cpp", "SynchronousMutationNotifier.h", "SynchronousMutationObserver.cpp",
diff --git a/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp b/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp index fbd88b6..22edb47 100644 --- a/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp +++ b/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp
@@ -27,18 +27,19 @@ #include "core/dom/ContextLifecycleNotifier.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "wtf/AutoReset.h" namespace blink { -void ContextLifecycleNotifier::notifyResumingActiveDOMObjects() { +void ContextLifecycleNotifier::notifyResumingSuspendableObjects() { AutoReset<IterationState> scope(&m_iterationState, AllowingNone); for (ContextLifecycleObserver* observer : m_observers) { if (observer->observerType() != - ContextLifecycleObserver::ActiveDOMObjectType) + ContextLifecycleObserver::SuspendableObjectType) continue; - ActiveDOMObject* activeDOMObject = static_cast<ActiveDOMObject*>(observer); + SuspendableObject* activeDOMObject = + static_cast<SuspendableObject*>(observer); #if DCHECK_IS_ON() DCHECK_EQ(activeDOMObject->getExecutionContext(), context()); DCHECK(activeDOMObject->suspendIfNeededCalled()); @@ -47,13 +48,14 @@ } } -void ContextLifecycleNotifier::notifySuspendingActiveDOMObjects() { +void ContextLifecycleNotifier::notifySuspendingSuspendableObjects() { AutoReset<IterationState> scope(&m_iterationState, AllowingNone); for (ContextLifecycleObserver* observer : m_observers) { if (observer->observerType() != - ContextLifecycleObserver::ActiveDOMObjectType) + ContextLifecycleObserver::SuspendableObjectType) continue; - ActiveDOMObject* activeDOMObject = static_cast<ActiveDOMObject*>(observer); + SuspendableObject* activeDOMObject = + static_cast<SuspendableObject*>(observer); #if DCHECK_IS_ON() DCHECK_EQ(activeDOMObject->getExecutionContext(), context()); DCHECK(activeDOMObject->suspendIfNeededCalled()); @@ -67,7 +69,7 @@ unsigned activeDOMObjects = 0; for (ContextLifecycleObserver* observer : m_observers) { if (observer->observerType() != - ContextLifecycleObserver::ActiveDOMObjectType) + ContextLifecycleObserver::SuspendableObjectType) continue; activeDOMObjects++; } @@ -75,13 +77,14 @@ } #if DCHECK_IS_ON() -bool ContextLifecycleNotifier::contains(ActiveDOMObject* object) const { +bool ContextLifecycleNotifier::contains(SuspendableObject* object) const { DCHECK(!isIteratingOverObservers()); for (ContextLifecycleObserver* observer : m_observers) { if (observer->observerType() != - ContextLifecycleObserver::ActiveDOMObjectType) + ContextLifecycleObserver::SuspendableObjectType) continue; - ActiveDOMObject* activeDOMObject = static_cast<ActiveDOMObject*>(observer); + SuspendableObject* activeDOMObject = + static_cast<SuspendableObject*>(observer); if (activeDOMObject == object) return true; }
diff --git a/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.h b/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.h index 15e46c4..4d1d775e 100644 --- a/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.h +++ b/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.h
@@ -34,7 +34,7 @@ namespace blink { -class ActiveDOMObject; +class SuspendableObject; class ContextLifecycleObserver; class ExecutionContext; @@ -43,8 +43,8 @@ WTF_MAKE_NONCOPYABLE(ContextLifecycleNotifier); public: - void notifyResumingActiveDOMObjects(); - void notifySuspendingActiveDOMObjects(); + void notifyResumingSuspendableObjects(); + void notifySuspendingSuspendableObjects(); unsigned activeDOMObjectCount() const; @@ -57,7 +57,7 @@ ContextLifecycleNotifier() {} #if DCHECK_IS_ON() - bool contains(ActiveDOMObject*) const; + bool contains(SuspendableObject*) const; #endif };
diff --git a/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.h b/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.h index 4c35bdd..fb4e518 100644 --- a/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.h +++ b/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.h
@@ -40,7 +40,7 @@ enum Type { GenericType, - ActiveDOMObjectType, + SuspendableObjectType, }; Type observerType() const { return m_observerType; }
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp index 9a9a62c..b40ae4a 100644 --- a/third_party/WebKit/Source/core/dom/Document.cpp +++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -2418,7 +2418,7 @@ ->sharedWorkerRepositoryClient() ->documentDetached(this); - // FIXME: consider using ActiveDOMObject. + // FIXME: consider using SuspendableObject. if (m_scriptedAnimationController) m_scriptedAnimationController->clearDocumentPointer(); m_scriptedAnimationController.clear();
diff --git a/third_party/WebKit/Source/core/dom/ExecutionContext.cpp b/third_party/WebKit/Source/core/dom/ExecutionContext.cpp index a8cf51e8..dc9c24d 100644 --- a/third_party/WebKit/Source/core/dom/ExecutionContext.cpp +++ b/third_party/WebKit/Source/core/dom/ExecutionContext.cpp
@@ -55,16 +55,16 @@ ExecutionContext::~ExecutionContext() {} -void ExecutionContext::suspendActiveDOMObjects() { +void ExecutionContext::suspendSuspendableObjects() { DCHECK(!m_activeDOMObjectsAreSuspended); - notifySuspendingActiveDOMObjects(); + notifySuspendingSuspendableObjects(); m_activeDOMObjectsAreSuspended = true; } -void ExecutionContext::resumeActiveDOMObjects() { +void ExecutionContext::resumeSuspendableObjects() { DCHECK(m_activeDOMObjectsAreSuspended); m_activeDOMObjectsAreSuspended = false; - notifyResumingActiveDOMObjects(); + notifyResumingSuspendableObjects(); } void ExecutionContext::notifyContextDestroyed() { @@ -73,20 +73,21 @@ } void ExecutionContext::suspendScheduledTasks() { - suspendActiveDOMObjects(); + suspendSuspendableObjects(); tasksWereSuspended(); } void ExecutionContext::resumeScheduledTasks() { - resumeActiveDOMObjects(); + resumeSuspendableObjects(); tasksWereResumed(); } -void ExecutionContext::suspendActiveDOMObjectIfNeeded(ActiveDOMObject* object) { +void ExecutionContext::suspendSuspendableObjectIfNeeded( + SuspendableObject* object) { #if DCHECK_IS_ON() DCHECK(contains(object)); #endif - // Ensure all ActiveDOMObjects are suspended also newly created ones. + // Ensure all SuspendableObjects are suspended also newly created ones. if (m_activeDOMObjectsAreSuspended) object->suspend(); }
diff --git a/third_party/WebKit/Source/core/dom/ExecutionContext.h b/third_party/WebKit/Source/core/dom/ExecutionContext.h index c56d193..89ba2e1 100644 --- a/third_party/WebKit/Source/core/dom/ExecutionContext.h +++ b/third_party/WebKit/Source/core/dom/ExecutionContext.h
@@ -43,7 +43,7 @@ namespace blink { -class ActiveDOMObject; +class SuspendableObject; class ConsoleMessage; class DOMTimerCoordinator; class ErrorEvent; @@ -126,16 +126,16 @@ virtual void removeURLFromMemoryCache(const KURL&); - void suspendActiveDOMObjects(); - void resumeActiveDOMObjects(); - void stopActiveDOMObjects(); + void suspendSuspendableObjects(); + void resumeSuspendableObjects(); + void stopSuspendableObjects(); void notifyContextDestroyed() override; void suspendScheduledTasks(); void resumeScheduledTasks(); // TODO(haraken): Remove these methods by making the customers inherit from - // ActiveDOMObject. ActiveDOMObject is a standard way to observe context + // SuspendableObject. SuspendableObject is a standard way to observe context // suspension/resumption. virtual bool tasksNeedSuspension() { return false; } virtual void tasksWereSuspended() {} @@ -146,9 +146,10 @@ } bool isContextDestroyed() const { return m_isContextDestroyed; } - // Called after the construction of an ActiveDOMObject to synchronize suspend + // Called after the construction of an SuspendableObject to synchronize + // suspend // state. - void suspendActiveDOMObjectIfNeeded(ActiveDOMObject*); + void suspendSuspendableObjectIfNeeded(SuspendableObject*); // Gets the next id in a circular sequence from 1 to 2^31-1. int circularSequentialID();
diff --git a/third_party/WebKit/Source/core/dom/IntersectionObserverController.cpp b/third_party/WebKit/Source/core/dom/IntersectionObserverController.cpp index 1e26176..d0888bc 100644 --- a/third_party/WebKit/Source/core/dom/IntersectionObserverController.cpp +++ b/third_party/WebKit/Source/core/dom/IntersectionObserverController.cpp
@@ -20,7 +20,7 @@ IntersectionObserverController::IntersectionObserverController( Document* document) - : ActiveDOMObject(document), + : SuspendableObject(document), m_weakPtrFactory(this), m_callbackFiredWhileSuspended(false) {} @@ -95,7 +95,7 @@ DEFINE_TRACE(IntersectionObserverController) { visitor->trace(m_trackedIntersectionObservers); visitor->trace(m_pendingIntersectionObservers); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/dom/IntersectionObserverController.h b/third_party/WebKit/Source/core/dom/IntersectionObserverController.h index 59e994b..c081ca82 100644 --- a/third_party/WebKit/Source/core/dom/IntersectionObserverController.h +++ b/third_party/WebKit/Source/core/dom/IntersectionObserverController.h
@@ -5,8 +5,8 @@ #ifndef IntersectionObserverController_h #define IntersectionObserverController_h -#include "core/dom/ActiveDOMObject.h" #include "core/dom/IntersectionObserver.h" +#include "core/dom/SuspendableObject.h" #include "platform/heap/Handle.h" #include "wtf/HashSet.h" #include "wtf/WeakPtr.h" @@ -20,7 +20,7 @@ class IntersectionObserverController : public GarbageCollectedFinalized<IntersectionObserverController>, - public ActiveDOMObject { + public SuspendableObject { USING_GARBAGE_COLLECTED_MIXIN(IntersectionObserverController); public:
diff --git a/third_party/WebKit/Source/core/dom/MessagePort.cpp b/third_party/WebKit/Source/core/dom/MessagePort.cpp index 44b3a66..fca2b5642 100644 --- a/third_party/WebKit/Source/core/dom/MessagePort.cpp +++ b/third_party/WebKit/Source/core/dom/MessagePort.cpp
@@ -52,7 +52,7 @@ MessagePort::MessagePort(ExecutionContext& executionContext) : ActiveScriptWrappable(this), - ActiveDOMObject(&executionContext), + SuspendableObject(&executionContext), m_started(false), m_closed(false) {} @@ -291,7 +291,7 @@ } DEFINE_TRACE(MessagePort) { - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); EventTargetWithInlineData::trace(visitor); }
diff --git a/third_party/WebKit/Source/core/dom/MessagePort.h b/third_party/WebKit/Source/core/dom/MessagePort.h index 9944dba..cad8a8c 100644 --- a/third_party/WebKit/Source/core/dom/MessagePort.h +++ b/third_party/WebKit/Source/core/dom/MessagePort.h
@@ -30,7 +30,7 @@ #include "bindings/core/v8/ActiveScriptWrappable.h" #include "bindings/core/v8/SerializedScriptValue.h" #include "core/CoreExport.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "core/events/EventListener.h" #include "core/events/EventTarget.h" #include "public/platform/WebMessagePortChannel.h" @@ -53,7 +53,7 @@ class CORE_EXPORT MessagePort : public EventTargetWithInlineData, public ActiveScriptWrappable, - public ActiveDOMObject, + public SuspendableObject, public WebMessagePortChannelClient { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(MessagePort); @@ -97,14 +97,14 @@ const AtomicString& interfaceName() const override; ExecutionContext* getExecutionContext() const override { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } MessagePort* toMessagePort() override { return this; } // ScriptWrappable implementation. bool hasPendingActivity() const final; - // ActiveDOMObject implementation. + // SuspendableObject implementation. void contextDestroyed() override { close(); } void setOnmessage(EventListener* listener) {
diff --git a/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp b/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp index 5072fc1..4a5d1ee 100644 --- a/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp +++ b/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp
@@ -69,7 +69,7 @@ ScriptedIdleTaskController::ScriptedIdleTaskController( ExecutionContext* context) - : ActiveDOMObject(context), + : SuspendableObject(context), m_scheduler(Platform::current()->currentThread()->scheduler()), m_nextCallbackId(0), m_suspended(false) { @@ -80,7 +80,7 @@ DEFINE_TRACE(ScriptedIdleTaskController) { visitor->trace(m_callbacks); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } int ScriptedIdleTaskController::nextCallbackId() {
diff --git a/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.h b/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.h index 3cc2084..765c90f 100644 --- a/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.h +++ b/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.h
@@ -5,8 +5,8 @@ #ifndef ScriptedIdleTaskController_h #define ScriptedIdleTaskController_h -#include "core/dom/ActiveDOMObject.h" #include "core/dom/IdleDeadline.h" +#include "core/dom/SuspendableObject.h" #include "platform/Timer.h" #include "platform/heap/Handle.h" #include "wtf/Vector.h" @@ -19,7 +19,7 @@ class ScriptedIdleTaskController : public GarbageCollectedFinalized<ScriptedIdleTaskController>, - public ActiveDOMObject { + public SuspendableObject { USING_GARBAGE_COLLECTED_MIXIN(ScriptedIdleTaskController); public: @@ -35,7 +35,7 @@ int registerCallback(IdleRequestCallback*, const IdleRequestOptions&); void cancelCallback(CallbackId); - // ActiveDOMObject interface. + // SuspendableObject interface. void contextDestroyed() override; void suspend() override; void resume() override;
diff --git a/third_party/WebKit/Source/core/dom/ActiveDOMObject.cpp b/third_party/WebKit/Source/core/dom/SuspendableObject.cpp similarity index 75% rename from third_party/WebKit/Source/core/dom/ActiveDOMObject.cpp rename to third_party/WebKit/Source/core/dom/SuspendableObject.cpp index 7921c5c7..5338ffd 100644 --- a/third_party/WebKit/Source/core/dom/ActiveDOMObject.cpp +++ b/third_party/WebKit/Source/core/dom/SuspendableObject.cpp
@@ -24,46 +24,49 @@ * */ -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "core/dom/ExecutionContext.h" #include "platform/InstanceCounters.h" namespace blink { -ActiveDOMObject::ActiveDOMObject(ExecutionContext* executionContext) - : ContextLifecycleObserver(executionContext, ActiveDOMObjectType) +SuspendableObject::SuspendableObject(ExecutionContext* executionContext) + : ContextLifecycleObserver(executionContext, SuspendableObjectType) #if DCHECK_IS_ON() , m_suspendIfNeededCalled(false) #endif { DCHECK(!executionContext || executionContext->isContextThread()); - InstanceCounters::incrementCounter(InstanceCounters::ActiveDOMObjectCounter); + InstanceCounters::incrementCounter( + InstanceCounters::SuspendableObjectCounter); } -ActiveDOMObject::~ActiveDOMObject() { - InstanceCounters::decrementCounter(InstanceCounters::ActiveDOMObjectCounter); +SuspendableObject::~SuspendableObject() { + InstanceCounters::decrementCounter( + InstanceCounters::SuspendableObjectCounter); #if DCHECK_IS_ON() DCHECK(m_suspendIfNeededCalled); #endif } -void ActiveDOMObject::suspendIfNeeded() { +void SuspendableObject::suspendIfNeeded() { #if DCHECK_IS_ON() DCHECK(!m_suspendIfNeededCalled); m_suspendIfNeededCalled = true; #endif if (ExecutionContext* context = getExecutionContext()) - context->suspendActiveDOMObjectIfNeeded(this); + context->suspendSuspendableObjectIfNeeded(this); } -void ActiveDOMObject::suspend() {} +void SuspendableObject::suspend() {} -void ActiveDOMObject::resume() {} +void SuspendableObject::resume() {} -void ActiveDOMObject::didMoveToNewExecutionContext(ExecutionContext* context) { +void SuspendableObject::didMoveToNewExecutionContext( + ExecutionContext* context) { setContext(context); if (context->isContextDestroyed()) {
diff --git a/third_party/WebKit/Source/core/dom/ActiveDOMObject.h b/third_party/WebKit/Source/core/dom/SuspendableObject.h similarity index 89% rename from third_party/WebKit/Source/core/dom/ActiveDOMObject.h rename to third_party/WebKit/Source/core/dom/SuspendableObject.h index 118e0f6..b040547 100644 --- a/third_party/WebKit/Source/core/dom/ActiveDOMObject.h +++ b/third_party/WebKit/Source/core/dom/SuspendableObject.h
@@ -24,8 +24,8 @@ * */ -#ifndef ActiveDOMObject_h -#define ActiveDOMObject_h +#ifndef SuspendableObject_h +#define SuspendableObject_h #include "core/CoreExport.h" #include "core/dom/ContextLifecycleObserver.h" @@ -33,9 +33,9 @@ namespace blink { -class CORE_EXPORT ActiveDOMObject : public ContextLifecycleObserver { +class CORE_EXPORT SuspendableObject : public ContextLifecycleObserver { public: - ActiveDOMObject(ExecutionContext*); + SuspendableObject(ExecutionContext*); // suspendIfNeeded() should be called exactly once after object construction // to synchronize the suspend state with that in ExecutionContext. @@ -52,7 +52,7 @@ void didMoveToNewExecutionContext(ExecutionContext*); protected: - virtual ~ActiveDOMObject(); + virtual ~SuspendableObject(); private: #if DCHECK_IS_ON() @@ -62,4 +62,4 @@ } // namespace blink -#endif // ActiveDOMObject_h +#endif // SuspendableObject_h
diff --git a/third_party/WebKit/Source/core/dom/ActiveDOMObjectTest.cpp b/third_party/WebKit/Source/core/dom/SuspendableObjectTest.cpp similarity index 76% rename from third_party/WebKit/Source/core/dom/ActiveDOMObjectTest.cpp rename to third_party/WebKit/Source/core/dom/SuspendableObjectTest.cpp index 1fe41bff..ab1fe49 100644 --- a/third_party/WebKit/Source/core/dom/ActiveDOMObjectTest.cpp +++ b/third_party/WebKit/Source/core/dom/SuspendableObjectTest.cpp
@@ -28,7 +28,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "core/dom/Document.h" #include "core/testing/DummyPageHolder.h" @@ -38,44 +38,45 @@ namespace blink { -class MockActiveDOMObject final - : public GarbageCollectedFinalized<MockActiveDOMObject>, - public ActiveDOMObject { - USING_GARBAGE_COLLECTED_MIXIN(MockActiveDOMObject); +class MockSuspendableObject final + : public GarbageCollectedFinalized<MockSuspendableObject>, + public SuspendableObject { + USING_GARBAGE_COLLECTED_MIXIN(MockSuspendableObject); public: - explicit MockActiveDOMObject(ExecutionContext* context) - : ActiveDOMObject(context) {} + explicit MockSuspendableObject(ExecutionContext* context) + : SuspendableObject(context) {} - DEFINE_INLINE_VIRTUAL_TRACE() { ActiveDOMObject::trace(visitor); } + DEFINE_INLINE_VIRTUAL_TRACE() { SuspendableObject::trace(visitor); } MOCK_METHOD0(suspend, void()); MOCK_METHOD0(resume, void()); MOCK_METHOD0(contextDestroyed, void()); }; -class ActiveDOMObjectTest : public ::testing::Test { +class SuspendableObjectTest : public ::testing::Test { protected: - ActiveDOMObjectTest(); + SuspendableObjectTest(); Document& srcDocument() const { return m_srcPageHolder->document(); } Document& destDocument() const { return m_destPageHolder->document(); } - MockActiveDOMObject& activeDOMObject() { return *m_activeDOMObject; } + MockSuspendableObject& activeDOMObject() { return *m_activeDOMObject; } private: std::unique_ptr<DummyPageHolder> m_srcPageHolder; std::unique_ptr<DummyPageHolder> m_destPageHolder; - Persistent<MockActiveDOMObject> m_activeDOMObject; + Persistent<MockSuspendableObject> m_activeDOMObject; }; -ActiveDOMObjectTest::ActiveDOMObjectTest() +SuspendableObjectTest::SuspendableObjectTest() : m_srcPageHolder(DummyPageHolder::create(IntSize(800, 600))), m_destPageHolder(DummyPageHolder::create(IntSize(800, 600))), - m_activeDOMObject(new MockActiveDOMObject(&m_srcPageHolder->document())) { + m_activeDOMObject( + new MockSuspendableObject(&m_srcPageHolder->document())) { m_activeDOMObject->suspendIfNeeded(); } -TEST_F(ActiveDOMObjectTest, NewContextObserved) { +TEST_F(SuspendableObjectTest, NewContextObserved) { unsigned initialSrcCount = srcDocument().activeDOMObjectCount(); unsigned initialDestCount = destDocument().activeDOMObjectCount(); @@ -86,19 +87,19 @@ EXPECT_EQ(initialDestCount + 1, destDocument().activeDOMObjectCount()); } -TEST_F(ActiveDOMObjectTest, MoveToActiveDocument) { +TEST_F(SuspendableObjectTest, MoveToActiveDocument) { EXPECT_CALL(activeDOMObject(), resume()); activeDOMObject().didMoveToNewExecutionContext(&destDocument()); } -TEST_F(ActiveDOMObjectTest, MoveToSuspendedDocument) { +TEST_F(SuspendableObjectTest, MoveToSuspendedDocument) { destDocument().suspendScheduledTasks(); EXPECT_CALL(activeDOMObject(), suspend()); activeDOMObject().didMoveToNewExecutionContext(&destDocument()); } -TEST_F(ActiveDOMObjectTest, MoveToStoppedDocument) { +TEST_F(SuspendableObjectTest, MoveToStoppedDocument) { destDocument().shutdown(); EXPECT_CALL(activeDOMObject(), contextDestroyed());
diff --git a/third_party/WebKit/Source/core/events/EventTarget.h b/third_party/WebKit/Source/core/events/EventTarget.h index 1e227290..75088002 100644 --- a/third_party/WebKit/Source/core/events/EventTarget.h +++ b/third_party/WebKit/Source/core/events/EventTarget.h
@@ -97,7 +97,8 @@ // file. // - Override EventTarget::interfaceName() and getExecutionContext(). The former // will typically return EventTargetNames::YourClassName. The latter will -// return ActiveDOMObject::executionContext (if you are an ActiveDOMObject) +// return SuspendableObject::executionContext (if you are an +// SuspendableObject) // or the document you're in. // - Your trace() method will need to call EventTargetWithInlineData::trace // depending on the base class of your class.
diff --git a/third_party/WebKit/Source/core/fileapi/FileReader.cpp b/third_party/WebKit/Source/core/fileapi/FileReader.cpp index 1ec15f7..15e1264a 100644 --- a/third_party/WebKit/Source/core/fileapi/FileReader.cpp +++ b/third_party/WebKit/Source/core/fileapi/FileReader.cpp
@@ -193,7 +193,7 @@ FileReader::FileReader(ExecutionContext* context) : ActiveScriptWrappable(this), - ActiveDOMObject(context), + SuspendableObject(context), m_state(kEmpty), m_loadingState(LoadingStateNone), m_stillFiringEvents(false), @@ -472,7 +472,7 @@ DEFINE_TRACE(FileReader) { visitor->trace(m_error); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/fileapi/FileReader.h b/third_party/WebKit/Source/core/fileapi/FileReader.h index ce98206..f1c04cb 100644 --- a/third_party/WebKit/Source/core/fileapi/FileReader.h +++ b/third_party/WebKit/Source/core/fileapi/FileReader.h
@@ -33,7 +33,7 @@ #include "bindings/core/v8/ActiveScriptWrappable.h" #include "core/CoreExport.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "core/events/EventTarget.h" #include "core/fileapi/FileError.h" #include "core/fileapi/FileReaderLoader.h" @@ -51,7 +51,7 @@ class CORE_EXPORT FileReader final : public EventTargetWithInlineData, public ActiveScriptWrappable, - public ActiveDOMObject, + public SuspendableObject, public FileReaderLoaderClient { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(FileReader); @@ -74,7 +74,7 @@ DOMException* error() { return m_error; } void result(StringOrArrayBuffer& resultAttribute) const; - // ActiveDOMObject + // SuspendableObject void contextDestroyed() override; // ScriptWrappable @@ -83,7 +83,7 @@ // EventTarget const AtomicString& interfaceName() const override; ExecutionContext* getExecutionContext() const override { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } // FileReaderLoaderClient
diff --git a/third_party/WebKit/Source/core/frame/DOMTimer.h b/third_party/WebKit/Source/core/frame/DOMTimer.h index d6c5d0b4..935ce517 100644 --- a/third_party/WebKit/Source/core/frame/DOMTimer.h +++ b/third_party/WebKit/Source/core/frame/DOMTimer.h
@@ -53,7 +53,7 @@ ~DOMTimer() override; - // ActiveDOMObject + // SuspendableObject void contextDestroyed() override; // Eager finalization is needed to promptly stop this Timer object.
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp index c30f6aa..603823a 100644 --- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp +++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
@@ -283,7 +283,7 @@ ASSERT(!m_document->isActive()); - // FIXME: This should be part of ActiveDOMObject shutdown + // FIXME: This should be part of SuspendableObject shutdown clearEventQueue(); m_unusedPreloadsTimer.stop();
diff --git a/third_party/WebKit/Source/core/frame/SuspendableTimer.cpp b/third_party/WebKit/Source/core/frame/SuspendableTimer.cpp index 825ebd6..585a1f1 100644 --- a/third_party/WebKit/Source/core/frame/SuspendableTimer.cpp +++ b/third_party/WebKit/Source/core/frame/SuspendableTimer.cpp
@@ -37,7 +37,7 @@ SuspendableTimer::SuspendableTimer(ExecutionContext* context) : TimerBase(TaskRunnerHelper::get(TaskType::Timer, context)), - ActiveDOMObject(context), + SuspendableObject(context), m_nextFireInterval(kNextFireIntervalInvalid), m_repeatInterval(0) #if ENABLE(ASSERT)
diff --git a/third_party/WebKit/Source/core/frame/SuspendableTimer.h b/third_party/WebKit/Source/core/frame/SuspendableTimer.h index 01cd04d..5ae6ca5 100644 --- a/third_party/WebKit/Source/core/frame/SuspendableTimer.h +++ b/third_party/WebKit/Source/core/frame/SuspendableTimer.h
@@ -28,17 +28,18 @@ #define SuspendableTimer_h #include "core/CoreExport.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "platform/Timer.h" namespace blink { -class CORE_EXPORT SuspendableTimer : public TimerBase, public ActiveDOMObject { +class CORE_EXPORT SuspendableTimer : public TimerBase, + public SuspendableObject { public: explicit SuspendableTimer(ExecutionContext*); ~SuspendableTimer() override; - // ActiveDOMObject + // SuspendableObject void contextDestroyed() override; void suspend() final; void resume() final;
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp index ecaa0dcc8..c2a9f80 100644 --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -361,7 +361,7 @@ Document& document) : HTMLElement(tagName, document), ActiveScriptWrappable(this), - ActiveDOMObject(&document), + SuspendableObject(&document), m_loadTimer(this, &HTMLMediaElement::loadTimerFired), m_progressEventTimer(this, &HTMLMediaElement::progressEventTimerFired), m_playbackProgressTimer(this, @@ -505,7 +505,7 @@ // load event from within the destructor. oldDocument.decrementLoadEventDelayCount(); - ActiveDOMObject::didMoveToNewExecutionContext(&document()); + SuspendableObject::didMoveToNewExecutionContext(&document()); HTMLElement::didMoveToNewDocument(oldDocument); } @@ -3769,7 +3769,7 @@ this); Supplementable<HTMLMediaElement>::trace(visitor); HTMLElement::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } DEFINE_TRACE_WRAPPERS(HTMLMediaElement) {
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.h b/third_party/WebKit/Source/core/html/HTMLMediaElement.h index d4860f3..fba321c 100644 --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.h +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.h
@@ -31,8 +31,8 @@ #include "bindings/core/v8/ScriptPromise.h" #include "bindings/core/v8/TraceWrapperMember.h" #include "core/CoreExport.h" -#include "core/dom/ActiveDOMObject.h" #include "core/dom/ExceptionCode.h" +#include "core/dom/SuspendableObject.h" #include "core/events/GenericEventQueue.h" #include "core/html/HTMLElement.h" #include "core/html/track/TextTrack.h" @@ -78,7 +78,7 @@ class CORE_EXPORT HTMLMediaElement : public HTMLElement, public Supplementable<HTMLMediaElement>, public ActiveScriptWrappable, - public ActiveDOMObject, + public SuspendableObject, private WebMediaPlayerClient { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElement); @@ -242,7 +242,7 @@ void disableAutomaticTextTrackSelection(); // EventTarget function. - // Both Node (via HTMLElement) and ActiveDOMObject define this method, which + // Both Node (via HTMLElement) and SuspendableObject define this method, which // causes an ambiguity error at compile time. This class's constructor // ensures that both implementations return document, so return the result // of one of them here. @@ -357,7 +357,7 @@ bool isInteractiveContent() const final; - // ActiveDOMObject functions. + // SuspendableObject functions. void contextDestroyed() final; virtual void updateDisplayState() {}
diff --git a/third_party/WebKit/Source/core/html/PublicURLManager.cpp b/third_party/WebKit/Source/core/html/PublicURLManager.cpp index 57655b2..4695a7a 100644 --- a/third_party/WebKit/Source/core/html/PublicURLManager.cpp +++ b/third_party/WebKit/Source/core/html/PublicURLManager.cpp
@@ -43,7 +43,7 @@ } PublicURLManager::PublicURLManager(ExecutionContext* context) - : ActiveDOMObject(context), m_isStopped(false) {} + : SuspendableObject(context), m_isStopped(false) {} String PublicURLManager::registerURL(ExecutionContext* context, URLRegistrable* registrable, @@ -107,7 +107,7 @@ } DEFINE_TRACE(PublicURLManager) { - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/html/PublicURLManager.h b/third_party/WebKit/Source/core/html/PublicURLManager.h index be663c6..926965d 100644 --- a/third_party/WebKit/Source/core/html/PublicURLManager.h +++ b/third_party/WebKit/Source/core/html/PublicURLManager.h
@@ -26,7 +26,7 @@ #ifndef PublicURLManager_h #define PublicURLManager_h -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "platform/heap/Handle.h" #include "wtf/HashMap.h" #include "wtf/text/WTFString.h" @@ -40,7 +40,7 @@ class PublicURLManager final : public GarbageCollectedFinalized<PublicURLManager>, - public ActiveDOMObject { + public SuspendableObject { USING_GARBAGE_COLLECTED_MIXIN(PublicURLManager); public: @@ -60,7 +60,7 @@ // Revokes all URLs associated with |uuid|. void revoke(const String& uuid); - // ActiveDOMObject interface. + // SuspendableObject interface. void contextDestroyed() override; DECLARE_VIRTUAL_TRACE();
diff --git a/third_party/WebKit/Source/core/streams/Stream.cpp b/third_party/WebKit/Source/core/streams/Stream.cpp index 38dea3af..b8153667 100644 --- a/third_party/WebKit/Source/core/streams/Stream.cpp +++ b/third_party/WebKit/Source/core/streams/Stream.cpp
@@ -37,7 +37,7 @@ namespace blink { Stream::Stream(ExecutionContext* context, const String& mediaType) - : ActiveDOMObject(context), m_mediaType(mediaType), m_isNeutered(false) { + : SuspendableObject(context), m_mediaType(mediaType), m_isNeutered(false) { // Create a new internal URL for a stream and register it with the provided // media type. m_internalURL = BlobURL::createInternalStreamURL(); @@ -77,7 +77,7 @@ } DEFINE_TRACE(Stream) { - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/streams/Stream.h b/third_party/WebKit/Source/core/streams/Stream.h index 1c2c780..781d4e7 100644 --- a/third_party/WebKit/Source/core/streams/Stream.h +++ b/third_party/WebKit/Source/core/streams/Stream.h
@@ -32,7 +32,7 @@ #define Stream_h #include "core/CoreExport.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "platform/heap/Handle.h" #include "platform/weborigin/KURL.h" #include "wtf/text/WTFString.h" @@ -42,7 +42,7 @@ class ExecutionContext; class CORE_EXPORT Stream final : public GarbageCollectedFinalized<Stream>, - public ActiveDOMObject { + public SuspendableObject { USING_GARBAGE_COLLECTED_MIXIN(Stream); public: @@ -76,7 +76,7 @@ void neuter() { m_isNeutered = true; } bool isNeutered() const { return m_isNeutered; } - // Implementation of ActiveDOMObject. + // Implementation of SuspendableObject. // // FIXME: Implement suspend() and resume() when necessary. void suspend() override;
diff --git a/third_party/WebKit/Source/core/streams/UnderlyingSourceBase.cpp b/third_party/WebKit/Source/core/streams/UnderlyingSourceBase.cpp index 7472addf..115b1f4 100644 --- a/third_party/WebKit/Source/core/streams/UnderlyingSourceBase.cpp +++ b/third_party/WebKit/Source/core/streams/UnderlyingSourceBase.cpp
@@ -66,7 +66,7 @@ } DEFINE_TRACE(UnderlyingSourceBase) { - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); visitor->trace(m_controller); }
diff --git a/third_party/WebKit/Source/core/streams/UnderlyingSourceBase.h b/third_party/WebKit/Source/core/streams/UnderlyingSourceBase.h index 3b3fc8da..fdbd2438 100644 --- a/third_party/WebKit/Source/core/streams/UnderlyingSourceBase.h +++ b/third_party/WebKit/Source/core/streams/UnderlyingSourceBase.h
@@ -11,7 +11,7 @@ #include "bindings/core/v8/ScriptValue.h" #include "bindings/core/v8/ScriptWrappable.h" #include "core/CoreExport.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "platform/heap/GarbageCollected.h" #include "platform/heap/Handle.h" @@ -23,7 +23,7 @@ : public GarbageCollectedFinalized<UnderlyingSourceBase>, public ScriptWrappable, public ActiveScriptWrappable, - public ActiveDOMObject { + public SuspendableObject { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(UnderlyingSourceBase); @@ -45,13 +45,13 @@ // ScriptWrappable bool hasPendingActivity() const; - // ActiveDOMObject + // SuspendableObject void contextDestroyed() override; protected: explicit UnderlyingSourceBase(ScriptState* scriptState) : ActiveScriptWrappable(this), - ActiveDOMObject(scriptState->getExecutionContext()) { + SuspendableObject(scriptState->getExecutionContext()) { this->suspendIfNeeded(); }
diff --git a/third_party/WebKit/Source/core/workers/AbstractWorker.cpp b/third_party/WebKit/Source/core/workers/AbstractWorker.cpp index 5a0f70aa..b278a5fd 100644 --- a/third_party/WebKit/Source/core/workers/AbstractWorker.cpp +++ b/third_party/WebKit/Source/core/workers/AbstractWorker.cpp
@@ -39,7 +39,7 @@ namespace blink { AbstractWorker::AbstractWorker(ExecutionContext* context) - : ActiveDOMObject(context) {} + : SuspendableObject(context) {} AbstractWorker::~AbstractWorker() {} @@ -84,7 +84,7 @@ DEFINE_TRACE(AbstractWorker) { EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/workers/AbstractWorker.h b/third_party/WebKit/Source/core/workers/AbstractWorker.h index d88771d..7cc39be4 100644 --- a/third_party/WebKit/Source/core/workers/AbstractWorker.h +++ b/third_party/WebKit/Source/core/workers/AbstractWorker.h
@@ -32,7 +32,7 @@ #define AbstractWorker_h #include "core/CoreExport.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "core/events/EventListener.h" #include "core/events/EventTarget.h" #include "platform/heap/Handle.h" @@ -45,13 +45,13 @@ class ExecutionContext; class CORE_EXPORT AbstractWorker : public EventTargetWithInlineData, - public ActiveDOMObject { + public SuspendableObject { USING_GARBAGE_COLLECTED_MIXIN(AbstractWorker); public: // EventTarget APIs ExecutionContext* getExecutionContext() const final { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(error);
diff --git a/third_party/WebKit/Source/core/workers/InProcessWorkerBase.h b/third_party/WebKit/Source/core/workers/InProcessWorkerBase.h index da27b03d..b7d7db7 100644 --- a/third_party/WebKit/Source/core/workers/InProcessWorkerBase.h +++ b/third_party/WebKit/Source/core/workers/InProcessWorkerBase.h
@@ -7,8 +7,8 @@ #include "bindings/core/v8/ActiveScriptWrappable.h" #include "core/CoreExport.h" -#include "core/dom/ActiveDOMObject.h" #include "core/dom/MessagePort.h" +#include "core/dom/SuspendableObject.h" #include "core/events/EventListener.h" #include "core/events/EventTarget.h" #include "core/workers/AbstractWorker.h" @@ -37,7 +37,7 @@ static bool canTransferArrayBuffersAndImageBitmaps() { return true; } void terminate(); - // ActiveDOMObject + // SuspendableObject void contextDestroyed() override; // ScriptWrappable
diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp index 275b024..3223a4d 100644 --- a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp +++ b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
@@ -31,10 +31,10 @@ #include "bindings/core/v8/ScriptSourceCode.h" #include "bindings/core/v8/SourceLocation.h" #include "bindings/core/v8/V8AbstractEventListener.h" -#include "core/dom/ActiveDOMObject.h" #include "core/dom/ContextLifecycleNotifier.h" #include "core/dom/ExceptionCode.h" #include "core/dom/ExecutionContextTask.h" +#include "core/dom/SuspendableObject.h" #include "core/events/ErrorEvent.h" #include "core/events/Event.h" #include "core/fetch/MemoryCache.h"
diff --git a/third_party/WebKit/Source/core/workers/Worklet.cpp b/third_party/WebKit/Source/core/workers/Worklet.cpp index 4cc7e92..a44d15d 100644 --- a/third_party/WebKit/Source/core/workers/Worklet.cpp +++ b/third_party/WebKit/Source/core/workers/Worklet.cpp
@@ -20,7 +20,7 @@ namespace blink { Worklet::Worklet(LocalFrame* frame) - : ActiveDOMObject(frame->document()), + : SuspendableObject(frame->document()), m_fetcher(frame->loader().documentLoader()->fetcher()) {} ScriptPromise Worklet::import(ScriptState* scriptState, const String& url) { @@ -71,7 +71,7 @@ DEFINE_TRACE(Worklet) { visitor->trace(m_fetcher); visitor->trace(m_scriptLoaders); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/workers/Worklet.h b/third_party/WebKit/Source/core/workers/Worklet.h index 2bb63bed..1efcf0b 100644 --- a/third_party/WebKit/Source/core/workers/Worklet.h +++ b/third_party/WebKit/Source/core/workers/Worklet.h
@@ -8,7 +8,7 @@ #include "bindings/core/v8/ScriptPromise.h" #include "bindings/core/v8/ScriptWrappable.h" #include "core/CoreExport.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "core/loader/resource/ScriptResource.h" #include "platform/heap/Handle.h" @@ -21,7 +21,7 @@ class CORE_EXPORT Worklet : public GarbageCollectedFinalized<Worklet>, public ScriptWrappable, - public ActiveDOMObject { + public SuspendableObject { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(Worklet); WTF_MAKE_NONCOPYABLE(Worklet); @@ -37,7 +37,7 @@ void notifyFinished(WorkletScriptLoader*); - // ActiveDOMObject + // SuspendableObject void contextDestroyed() final; DECLARE_VIRTUAL_TRACE();
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp index cc669529..6bc3d54 100644 --- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp +++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
@@ -224,7 +224,7 @@ ExecutionContext* context, PassRefPtr<SecurityOrigin> isolatedWorldSecurityOrigin) : ActiveScriptWrappable(this), - ActiveDOMObject(context), + SuspendableObject(context), m_timeoutMilliseconds(0), m_responseBlob(this, nullptr), m_state(kUnsent), @@ -1825,7 +1825,7 @@ } ExecutionContext* XMLHttpRequest::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } DEFINE_TRACE(XMLHttpRequest) { @@ -1839,7 +1839,7 @@ visitor->trace(m_blobLoader); XMLHttpRequestEventTarget::trace(visitor); DocumentParserClient::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } DEFINE_TRACE_WRAPPERS(XMLHttpRequest) {
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h index de8c1fd..e4b2c22 100644 --- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h +++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h
@@ -27,8 +27,8 @@ #include "bindings/core/v8/ScriptString.h" #include "bindings/core/v8/ScriptWrappable.h" #include "bindings/core/v8/TraceWrapperMember.h" -#include "core/dom/ActiveDOMObject.h" #include "core/dom/DocumentParserClient.h" +#include "core/dom/SuspendableObject.h" #include "core/loader/ThreadableLoaderClient.h" #include "core/xmlhttprequest/XMLHttpRequestEventTarget.h" #include "core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h" @@ -71,7 +71,7 @@ private ThreadableLoaderClient, public DocumentParserClient, public ActiveScriptWrappable, - public ActiveDOMObject { + public SuspendableObject { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(XMLHttpRequest); @@ -98,7 +98,7 @@ ResponseTypeArrayBuffer, }; - // ActiveDOMObject + // SuspendableObject void contextDestroyed() override; ExecutionContext* getExecutionContext() const override; void suspend() override;
diff --git a/third_party/WebKit/Source/modules/battery/BatteryManager.cpp b/third_party/WebKit/Source/modules/battery/BatteryManager.cpp index 8d0524b..8fdf4e88 100644 --- a/third_party/WebKit/Source/modules/battery/BatteryManager.cpp +++ b/third_party/WebKit/Source/modules/battery/BatteryManager.cpp
@@ -22,7 +22,7 @@ BatteryManager::BatteryManager(ExecutionContext* context) : ActiveScriptWrappable(this), - ActiveDOMObject(context), + SuspendableObject(context), PlatformEventController(toDocument(context)->page()) {} ScriptPromise BatteryManager::startRequest(ScriptState* scriptState) { @@ -123,7 +123,7 @@ visitor->trace(m_batteryProperty); PlatformEventController::trace(visitor); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/battery/BatteryManager.h b/third_party/WebKit/Source/modules/battery/BatteryManager.h index 076be413..825c8bde 100644 --- a/third_party/WebKit/Source/modules/battery/BatteryManager.h +++ b/third_party/WebKit/Source/modules/battery/BatteryManager.h
@@ -8,8 +8,8 @@ #include "bindings/core/v8/ActiveScriptWrappable.h" #include "bindings/core/v8/ScriptPromise.h" #include "bindings/core/v8/ScriptPromiseProperty.h" -#include "core/dom/ActiveDOMObject.h" #include "core/dom/ContextLifecycleObserver.h" +#include "core/dom/SuspendableObject.h" #include "core/frame/PlatformEventController.h" #include "modules/EventTargetModules.h" #include "modules/battery/battery_status.h" @@ -19,7 +19,7 @@ class BatteryManager final : public EventTargetWithInlineData, public ActiveScriptWrappable, - public ActiveDOMObject, + public SuspendableObject, public PlatformEventController { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(BatteryManager); @@ -55,7 +55,7 @@ void unregisterWithDispatcher() override; bool hasLastData() override; - // ActiveDOMObject implementation. + // SuspendableObject implementation. void suspend() override; void resume() override; void contextDestroyed() override;
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp index f19b0a7..0d4f5a8d 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp
@@ -44,7 +44,7 @@ ExecutionContext* context, std::unique_ptr<WebBluetoothRemoteGATTCharacteristicInit> webCharacteristic, BluetoothRemoteGATTService* service) - : ActiveDOMObject(context), + : SuspendableObject(context), m_webCharacteristic(std::move(webCharacteristic)), m_service(service), m_stopped(false) { @@ -63,7 +63,7 @@ BluetoothRemoteGATTCharacteristic* characteristic = new BluetoothRemoteGATTCharacteristic( context, std::move(webCharacteristic), service); - // See note in ActiveDOMObject about suspendIfNeeded. + // See note in SuspendableObject about suspendIfNeeded. characteristic->suspendIfNeeded(); return characteristic; } @@ -90,7 +90,7 @@ if (!m_stopped) { m_stopped = true; WebBluetooth* webbluetooth = BluetoothSupplement::fromExecutionContext( - ActiveDOMObject::getExecutionContext()); + SuspendableObject::getExecutionContext()); webbluetooth->characteristicObjectRemoved( m_webCharacteristic->characteristicInstanceID, this); } @@ -103,7 +103,7 @@ ExecutionContext* BluetoothRemoteGATTCharacteristic::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } void BluetoothRemoteGATTCharacteristic::addedEventListener( @@ -403,7 +403,7 @@ visitor->trace(m_properties); visitor->trace(m_value); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h index fd0664c..7b5c5707 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h
@@ -6,9 +6,9 @@ #define BluetoothRemoteGATTCharacteristic_h #include "bindings/core/v8/ScriptWrappable.h" -#include "core/dom/ActiveDOMObject.h" #include "core/dom/DOMArrayPiece.h" #include "core/dom/DOMDataView.h" +#include "core/dom/SuspendableObject.h" #include "modules/EventTargetModules.h" #include "modules/bluetooth/BluetoothRemoteGATTService.h" #include "platform/heap/Handle.h" @@ -34,7 +34,7 @@ // CallbackPromiseAdapter class comments. class BluetoothRemoteGATTCharacteristic final : public EventTargetWithInlineData, - public ActiveDOMObject, + public SuspendableObject, public WebBluetoothRemoteGATTCharacteristic { USING_PRE_FINALIZER(BluetoothRemoteGATTCharacteristic, dispose); DEFINE_WRAPPERTYPEINFO(); @@ -57,7 +57,7 @@ // WebBluetoothRemoteGATTCharacteristic interface: void dispatchCharacteristicValueChanged(const WebVector<uint8_t>&) override; - // ActiveDOMObject interface. + // SuspendableObject interface. void contextDestroyed() override; // USING_PRE_FINALIZER interface.
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp index f67e95d..a0b4661 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp +++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp
@@ -365,7 +365,7 @@ MediaKeys* mediaKeys, WebEncryptedMediaSessionType sessionType) : ActiveScriptWrappable(this), - ActiveDOMObject(scriptState->getExecutionContext()), + SuspendableObject(scriptState->getExecutionContext()), m_asyncEventQueue(GenericEventQueue::create(this)), m_mediaKeys(mediaKeys), m_sessionType(sessionType), @@ -1014,7 +1014,7 @@ } ExecutionContext* MediaKeySession::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } bool MediaKeySession::hasPendingActivity() const { @@ -1048,7 +1048,7 @@ visitor->trace(m_keyStatusesMap); visitor->trace(m_closedPromise); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.h b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.h index 4a25ed2c..88ce59c 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.h +++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.h
@@ -28,8 +28,8 @@ #include "bindings/core/v8/ActiveScriptWrappable.h" #include "bindings/core/v8/ScriptPromiseProperty.h" -#include "core/dom/ActiveDOMObject.h" #include "core/dom/DOMArrayPiece.h" +#include "core/dom/SuspendableObject.h" #include "modules/EventTargetModules.h" #include "modules/encryptedmedia/MediaKeyStatusMap.h" #include "platform/Timer.h" @@ -64,7 +64,7 @@ class MediaKeySession final : public EventTargetWithInlineData, public ActiveScriptWrappable, - public ActiveDOMObject, + public SuspendableObject, private WebContentDecryptionModuleSession::Client { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(MediaKeySession); @@ -99,7 +99,7 @@ // ScriptWrappable bool hasPendingActivity() const final; - // ActiveDOMObject + // SuspendableObject void contextDestroyed() override; DECLARE_VIRTUAL_TRACE();
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp index 903174d..c74c19c 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp +++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp
@@ -140,7 +140,7 @@ const WebVector<WebEncryptedMediaSessionType>& supportedSessionTypes, std::unique_ptr<WebContentDecryptionModule> cdm) : ActiveScriptWrappable(this), - ActiveDOMObject(context), + SuspendableObject(context), m_supportedSessionTypes(supportedSessionTypes), m_cdm(std::move(cdm)), m_mediaElement(nullptr), @@ -293,7 +293,7 @@ DEFINE_TRACE(MediaKeys) { visitor->trace(m_pendingActions); visitor->trace(m_mediaElement); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } void MediaKeys::contextDestroyed() { @@ -301,7 +301,7 @@ m_pendingActions.clear(); // We don't need the CDM anymore. Only destroyed after all related - // ActiveDOMObjects have been stopped. + // SuspendableObjects have been stopped. m_cdm.reset(); }
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.h b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.h index ca1369a..50a1966 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.h +++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.h
@@ -29,8 +29,8 @@ #include "bindings/core/v8/ActiveScriptWrappable.h" #include "bindings/core/v8/ScriptPromise.h" #include "bindings/core/v8/ScriptWrappable.h" -#include "core/dom/ActiveDOMObject.h" #include "core/dom/DOMArrayPiece.h" +#include "core/dom/SuspendableObject.h" #include "platform/Timer.h" #include "public/platform/WebContentDecryptionModule.h" #include "public/platform/WebEncryptedMediaTypes.h" @@ -53,7 +53,7 @@ // The WebContentDecryptionModule has the same lifetime as this object. class MediaKeys : public GarbageCollectedFinalized<MediaKeys>, public ActiveScriptWrappable, - public ActiveDOMObject, + public SuspendableObject, public ScriptWrappable { USING_GARBAGE_COLLECTED_MIXIN(MediaKeys); DEFINE_WRAPPERTYPEINFO(); @@ -92,7 +92,7 @@ DECLARE_VIRTUAL_TRACE(); - // ActiveDOMObject implementation. + // SuspendableObject implementation. // FIXME: This class could derive from ContextLifecycleObserver // again (http://crbug.com/483722). void contextDestroyed() override;
diff --git a/third_party/WebKit/Source/modules/eventsource/EventSource.cpp b/third_party/WebKit/Source/modules/eventsource/EventSource.cpp index acaee28..49fb42a 100644 --- a/third_party/WebKit/Source/modules/eventsource/EventSource.cpp +++ b/third_party/WebKit/Source/modules/eventsource/EventSource.cpp
@@ -66,7 +66,7 @@ const KURL& url, const EventSourceInit& eventSourceInit) : ActiveScriptWrappable(this), - ActiveDOMObject(context), + SuspendableObject(context), m_url(url), m_currentURL(url), m_withCredentials(eventSourceInit.withCredentials()), @@ -223,7 +223,7 @@ m_parser->stop(); // Stop trying to reconnect if EventSource was explicitly closed or if - // ActiveDOMObject::stop() was called. + // SuspendableObject::stop() was called. if (m_connectTimer.isActive()) { m_connectTimer.stop(); } @@ -241,7 +241,7 @@ } ExecutionContext* EventSource::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } void EventSource::didReceiveResponse( @@ -380,7 +380,7 @@ visitor->trace(m_parser); visitor->trace(m_loader); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); EventSourceParser::Client::trace(visitor); }
diff --git a/third_party/WebKit/Source/modules/eventsource/EventSource.h b/third_party/WebKit/Source/modules/eventsource/EventSource.h index dc5a544..cfdcea36 100644 --- a/third_party/WebKit/Source/modules/eventsource/EventSource.h +++ b/third_party/WebKit/Source/modules/eventsource/EventSource.h
@@ -33,7 +33,7 @@ #define EventSource_h #include "bindings/core/v8/ActiveScriptWrappable.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "core/events/EventTarget.h" #include "core/loader/ThreadableLoader.h" #include "core/loader/ThreadableLoaderClient.h" @@ -54,7 +54,7 @@ class MODULES_EXPORT EventSource final : public EventTargetWithInlineData, private ThreadableLoaderClient, public ActiveScriptWrappable, - public ActiveDOMObject, + public SuspendableObject, public EventSourceParser::Client { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(EventSource); @@ -84,7 +84,7 @@ const AtomicString& interfaceName() const override; ExecutionContext* getExecutionContext() const override; - // ActiveDOMObject + // SuspendableObject // // Note: suspend() is noop since ScopedPageLoadDeferrer calls // Page::setDefersLoading() and it defers delivery of events from the
diff --git a/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp b/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp index 4f5fb8f..c71f2d1 100644 --- a/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp +++ b/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp
@@ -22,7 +22,7 @@ class BodyStreamBuffer::LoaderClient final : public GarbageCollectedFinalized<LoaderClient>, - public ActiveDOMObject, + public SuspendableObject, public FetchDataLoader::Client { WTF_MAKE_NONCOPYABLE(LoaderClient); USING_GARBAGE_COLLECTED_MIXIN(LoaderClient); @@ -31,7 +31,9 @@ LoaderClient(ExecutionContext* executionContext, BodyStreamBuffer* buffer, FetchDataLoader::Client* client) - : ActiveDOMObject(executionContext), m_buffer(buffer), m_client(client) { + : SuspendableObject(executionContext), + m_buffer(buffer), + m_client(client) { suspendIfNeeded(); } @@ -64,7 +66,7 @@ DEFINE_INLINE_TRACE() { visitor->trace(m_buffer); visitor->trace(m_client); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); FetchDataLoader::Client::trace(visitor); }
diff --git a/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.cpp b/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.cpp index a209202..c09a108 100644 --- a/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.cpp +++ b/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.cpp
@@ -95,7 +95,7 @@ const KURL& rootURL) : DOMFileSystemBase(context, name, type, rootURL), ActiveScriptWrappable(this), - ActiveDOMObject(context), + SuspendableObject(context), m_numberOfPendingCallbacks(0), m_rootEntry(DirectoryEntry::create(this, DOMFilePath::root)) {} @@ -194,7 +194,7 @@ DEFINE_TRACE(DOMFileSystem) { DOMFileSystemBase::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); visitor->trace(m_rootEntry); }
diff --git a/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.h b/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.h index 4d6e193..976639f 100644 --- a/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.h +++ b/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.h
@@ -33,9 +33,9 @@ #include "bindings/core/v8/ActiveScriptWrappable.h" #include "bindings/core/v8/ScriptWrappable.h" -#include "core/dom/ActiveDOMObject.h" #include "core/dom/ExecutionContext.h" #include "core/dom/ExecutionContextTask.h" +#include "core/dom/SuspendableObject.h" #include "modules/ModulesExport.h" #include "modules/filesystem/DOMFileSystemBase.h" #include "modules/filesystem/EntriesCallback.h" @@ -53,7 +53,7 @@ class MODULES_EXPORT DOMFileSystem final : public DOMFileSystemBase, public ScriptWrappable, public ActiveScriptWrappable, - public ActiveDOMObject { + public SuspendableObject { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(DOMFileSystem);
diff --git a/third_party/WebKit/Source/modules/filesystem/FileWriter.cpp b/third_party/WebKit/Source/modules/filesystem/FileWriter.cpp index 5fd84a1..470b0cb 100644 --- a/third_party/WebKit/Source/modules/filesystem/FileWriter.cpp +++ b/third_party/WebKit/Source/modules/filesystem/FileWriter.cpp
@@ -51,7 +51,7 @@ FileWriter::FileWriter(ExecutionContext* context) : ActiveScriptWrappable(this), - ActiveDOMObject(context), + SuspendableObject(context), m_readyState(kInit), m_operationInProgress(OperationNone), m_queuedOperation(OperationNone), @@ -312,7 +312,7 @@ visitor->trace(m_blobBeingWritten); EventTargetWithInlineData::trace(visitor); FileWriterBase::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/filesystem/FileWriter.h b/third_party/WebKit/Source/modules/filesystem/FileWriter.h index a7d9eb0..ce9f868 100644 --- a/third_party/WebKit/Source/modules/filesystem/FileWriter.h +++ b/third_party/WebKit/Source/modules/filesystem/FileWriter.h
@@ -32,8 +32,8 @@ #define FileWriter_h #include "bindings/core/v8/ActiveScriptWrappable.h" -#include "core/dom/ActiveDOMObject.h" #include "core/dom/ExecutionContext.h" +#include "core/dom/SuspendableObject.h" #include "core/fileapi/FileError.h" #include "modules/EventTargetModules.h" #include "modules/filesystem/FileWriterBase.h" @@ -49,7 +49,7 @@ class FileWriter final : public EventTargetWithInlineData, public FileWriterBase, public ActiveScriptWrappable, - public ActiveDOMObject, + public SuspendableObject, public WebFileWriterClient { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(FileWriter); @@ -72,7 +72,7 @@ void didTruncate() override; void didFail(WebFileError) override; - // ActiveDOMObject + // SuspendableObject void contextDestroyed() override; // ScriptWrappable @@ -81,7 +81,7 @@ // EventTarget const AtomicString& interfaceName() const override; ExecutionContext* getExecutionContext() const override { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } DEFINE_ATTRIBUTE_EVENT_LISTENER(writestart);
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp index 63a80680..a48db45 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp
@@ -102,7 +102,7 @@ std::unique_ptr<WebIDBDatabase> backend, IDBDatabaseCallbacks* callbacks) : ActiveScriptWrappable(this), - ActiveDOMObject(context), + SuspendableObject(context), m_backend(std::move(backend)), m_databaseCallbacks(callbacks) { m_databaseCallbacks->connect(this); @@ -120,7 +120,7 @@ visitor->trace(m_enqueuedEvents); visitor->trace(m_databaseCallbacks); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } int64_t IDBDatabase::nextTransactionId() { @@ -579,7 +579,7 @@ } ExecutionContext* IDBDatabase::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } void IDBDatabase::recordApiCallsHistogram(IndexedDatabaseMethods method) {
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.h b/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.h index e0c9dc0..08c1672 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.h +++ b/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.h
@@ -29,8 +29,8 @@ #include "bindings/core/v8/ActiveScriptWrappable.h" #include "bindings/core/v8/ScriptState.h" #include "bindings/modules/v8/StringOrStringSequenceOrDOMStringList.h" -#include "core/dom/ActiveDOMObject.h" #include "core/dom/DOMStringList.h" +#include "core/dom/SuspendableObject.h" #include "modules/EventModules.h" #include "modules/EventTargetModules.h" #include "modules/ModulesExport.h" @@ -57,7 +57,7 @@ class MODULES_EXPORT IDBDatabase final : public EventTargetWithInlineData, public ActiveScriptWrappable, - public ActiveDOMObject { + public SuspendableObject { USING_GARBAGE_COLLECTED_MIXIN(IDBDatabase); DEFINE_WRAPPERTYPEINFO(); @@ -122,7 +122,7 @@ // ScriptWrappable bool hasPendingActivity() const final; - // ActiveDOMObject + // SuspendableObject void contextDestroyed() override; // EventTarget
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.h b/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.h index 37d8b18a..84987ed 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.h +++ b/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.h
@@ -58,7 +58,7 @@ const IDBDatabaseMetadata&) override; void onSuccess(int64_t oldVersion) override; - // ActiveDOMObject + // SuspendableObject void contextDestroyed() final; // EventTarget
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp index e51de04..987de55d 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp
@@ -67,7 +67,7 @@ IDBAny* source, IDBTransaction* transaction) : ActiveScriptWrappable(this), - ActiveDOMObject(scriptState->getExecutionContext()), + SuspendableObject(scriptState->getExecutionContext()), m_transaction(transaction), m_source(source) {} @@ -86,7 +86,7 @@ visitor->trace(m_cursorKey); visitor->trace(m_cursorPrimaryKey); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } ScriptValue IDBRequest::result(ScriptState* scriptState, @@ -415,7 +415,7 @@ } ExecutionContext* IDBRequest::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } DispatchEventResult IDBRequest::dispatchEventInternal(Event* event) {
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.h b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.h index 64e6ce58..e499ca1 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.h +++ b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.h
@@ -32,8 +32,8 @@ #include "bindings/core/v8/ActiveScriptWrappable.h" #include "bindings/core/v8/ScriptState.h" #include "bindings/core/v8/ScriptValue.h" -#include "core/dom/ActiveDOMObject.h" #include "core/dom/DOMStringList.h" +#include "core/dom/SuspendableObject.h" #include "core/events/EventListener.h" #include "core/events/EventTarget.h" #include "modules/EventModules.h" @@ -58,7 +58,7 @@ class MODULES_EXPORT IDBRequest : public EventTargetWithInlineData, public ActiveScriptWrappable, - public ActiveDOMObject { + public SuspendableObject { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(IDBRequest); @@ -125,7 +125,7 @@ // ScriptWrappable bool hasPendingActivity() const final; - // ActiveDOMObject + // SuspendableObject void contextDestroyed() override; // EventTarget
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp index 2b66f3b..8b78ea78 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp
@@ -103,7 +103,7 @@ WebIDBTransactionMode mode, IDBDatabase* db) : ActiveScriptWrappable(this), - ActiveDOMObject(scriptState->getExecutionContext()), + SuspendableObject(scriptState->getExecutionContext()), m_id(id), m_database(db), m_mode(mode), @@ -128,7 +128,7 @@ IDBOpenDBRequest* openDBRequest, const IDBDatabaseMetadata& oldMetadata) : ActiveScriptWrappable(this), - ActiveDOMObject(executionContext), + SuspendableObject(executionContext), m_id(id), m_database(db), m_openDBRequest(openDBRequest), @@ -156,7 +156,7 @@ visitor->trace(m_oldStoreMetadata); visitor->trace(m_deletedIndexes); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } void IDBTransaction::setError(DOMException* error) { @@ -459,7 +459,7 @@ } ExecutionContext* IDBTransaction::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } DispatchEventResult IDBTransaction::dispatchEventInternal(Event* event) {
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h index 0bb2f704..5ee6451a 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h +++ b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h
@@ -27,8 +27,8 @@ #define IDBTransaction_h #include "bindings/core/v8/ActiveScriptWrappable.h" -#include "core/dom/ActiveDOMObject.h" #include "core/dom/DOMStringList.h" +#include "core/dom/SuspendableObject.h" #include "core/events/EventListener.h" #include "modules/EventModules.h" #include "modules/EventTargetModules.h" @@ -55,7 +55,7 @@ class MODULES_EXPORT IDBTransaction final : public EventTargetWithInlineData, public ActiveScriptWrappable, - public ActiveDOMObject { + public SuspendableObject { USING_GARBAGE_COLLECTED_MIXIN(IDBTransaction); DEFINE_WRAPPERTYPEINFO();
diff --git a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp index e200810..a3ca3de 100644 --- a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp +++ b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp
@@ -161,7 +161,7 @@ const MediaRecorderOptions& options, ExceptionState& exceptionState) : ActiveScriptWrappable(this), - ActiveDOMObject(context), + SuspendableObject(context), m_stream(stream), m_streamAmountOfTracks(stream->getTracks().size()), m_mimeType(options.hasMimeType() ? options.mimeType() : kDefaultMimeType), @@ -304,7 +304,7 @@ } ExecutionContext* MediaRecorder::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } void MediaRecorder::suspend() { @@ -396,7 +396,7 @@ visitor->trace(m_dispatchScheduledEventRunner); visitor->trace(m_scheduledEvents); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.h b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.h index 5b1288e..4f0ae35 100644 --- a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.h +++ b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.h
@@ -6,7 +6,7 @@ #define MediaRecorder_h #include "bindings/core/v8/ActiveScriptWrappable.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "core/events/EventTarget.h" #include "modules/EventTargetModules.h" #include "modules/ModulesExport.h" @@ -26,7 +26,7 @@ class MODULES_EXPORT MediaRecorder final : public EventTargetWithInlineData, public WebMediaRecorderHandlerClient, public ActiveScriptWrappable, - public ActiveDOMObject { + public SuspendableObject { USING_GARBAGE_COLLECTED_MIXIN(MediaRecorder); DEFINE_WRAPPERTYPEINFO(); @@ -73,7 +73,7 @@ const AtomicString& interfaceName() const override; ExecutionContext* getExecutionContext() const override; - // ActiveDOMObject + // SuspendableObject void suspend() override; void resume() override; void contextDestroyed() override;
diff --git a/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp b/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp index 66412e6b..64fe029 100644 --- a/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp +++ b/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp
@@ -114,7 +114,7 @@ MediaSource::MediaSource(ExecutionContext* context) : ActiveScriptWrappable(this), - ActiveDOMObject(context), + SuspendableObject(context), m_readyState(closedKeyword()), m_asyncEventQueue(GenericEventQueue::create(this)), m_attachedElement(nullptr), @@ -320,7 +320,7 @@ } ExecutionContext* MediaSource::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } DEFINE_TRACE(MediaSource) { @@ -330,7 +330,7 @@ visitor->trace(m_activeSourceBuffers); visitor->trace(m_liveSeekableRange); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } void MediaSource::setWebMediaSourceAndOpen(
diff --git a/third_party/WebKit/Source/modules/mediasource/MediaSource.h b/third_party/WebKit/Source/modules/mediasource/MediaSource.h index 5083344..2ceaf0d8 100644 --- a/third_party/WebKit/Source/modules/mediasource/MediaSource.h +++ b/third_party/WebKit/Source/modules/mediasource/MediaSource.h
@@ -32,7 +32,7 @@ #define MediaSource_h #include "bindings/core/v8/ActiveScriptWrappable.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "core/html/HTMLMediaSource.h" #include "core/html/TimeRanges.h" #include "core/html/URLRegistry.h" @@ -52,7 +52,7 @@ class MediaSource final : public EventTargetWithInlineData, public HTMLMediaSource, public ActiveScriptWrappable, - public ActiveDOMObject { + public SuspendableObject { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(MediaSource); @@ -107,7 +107,7 @@ // ScriptWrappable bool hasPendingActivity() const final; - // ActiveDOMObject interface + // SuspendableObject interface void contextDestroyed() override; // URLRegistrable interface
diff --git a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp index 7a87c4a..f2edaca 100644 --- a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp +++ b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp
@@ -117,7 +117,7 @@ MediaSource* source, GenericEventQueue* asyncEventQueue) : ActiveScriptWrappable(this), - ActiveDOMObject(source->getExecutionContext()), + SuspendableObject(source->getExecutionContext()), m_webSourceBuffer(std::move(webSourceBuffer)), m_source(source), m_trackDefaults(TrackDefaultList::create()), @@ -1047,7 +1047,7 @@ } ExecutionContext* SourceBuffer::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } const AtomicString& SourceBuffer::interfaceName() const { @@ -1309,7 +1309,7 @@ visitor->trace(m_audioTracks); visitor->trace(m_videoTracks); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.h b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.h index e54e0eb4..63dda11 100644 --- a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.h +++ b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.h
@@ -32,7 +32,7 @@ #define SourceBuffer_h #include "bindings/core/v8/ActiveScriptWrappable.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "modules/EventTargetModules.h" #include "modules/mediasource/TrackDefaultList.h" #include "platform/AsyncMethodRunner.h" @@ -55,7 +55,7 @@ class SourceBuffer final : public EventTargetWithInlineData, public ActiveScriptWrappable, - public ActiveDOMObject, + public SuspendableObject, public WebSourceBufferClient { USING_GARBAGE_COLLECTED_MIXIN(SourceBuffer); DEFINE_WRAPPERTYPEINFO(); @@ -102,7 +102,7 @@ // ScriptWrappable bool hasPendingActivity() const final; - // ActiveDOMObject + // SuspendableObject void suspend() override; void resume() override; void contextDestroyed() override;
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaDevices.cpp b/third_party/WebKit/Source/modules/mediastream/MediaDevices.cpp index 1c0eaec..e5586d4f 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaDevices.cpp +++ b/third_party/WebKit/Source/modules/mediastream/MediaDevices.cpp
@@ -71,7 +71,7 @@ MediaDevices::MediaDevices(ExecutionContext* context) : ActiveScriptWrappable(this), - ActiveDOMObject(context), + SuspendableObject(context), m_observing(false), m_stopped(false), m_dispatchScheduledEventRunner(AsyncMethodRunner<MediaDevices>::create( @@ -153,7 +153,7 @@ } ExecutionContext* MediaDevices::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } void MediaDevices::removeAllEventListeners() { @@ -252,7 +252,7 @@ visitor->trace(m_dispatchScheduledEventRunner); visitor->trace(m_scheduledEvents); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaDevices.h b/third_party/WebKit/Source/modules/mediastream/MediaDevices.h index 338c5ff..3d8eef4 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaDevices.h +++ b/third_party/WebKit/Source/modules/mediastream/MediaDevices.h
@@ -7,7 +7,7 @@ #include "bindings/core/v8/ActiveScriptWrappable.h" #include "bindings/core/v8/ScriptPromise.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "core/events/EventTarget.h" #include "modules/EventTargetModules.h" #include "modules/ModulesExport.h" @@ -22,7 +22,7 @@ class MODULES_EXPORT MediaDevices final : public EventTargetWithInlineData, public ActiveScriptWrappable, - public ActiveDOMObject { + public SuspendableObject { USING_GARBAGE_COLLECTED_MIXIN(MediaDevices); DEFINE_WRAPPERTYPEINFO(); USING_PRE_FINALIZER(MediaDevices, dispose); @@ -46,7 +46,7 @@ // ScriptWrappable bool hasPendingActivity() const override; - // ActiveDOMObject overrides. + // SuspendableObject overrides. void contextDestroyed() override; void suspend() override; void resume() override;
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaDevicesRequest.cpp b/third_party/WebKit/Source/modules/mediastream/MediaDevicesRequest.cpp index d5e3be7..2dfd01ed 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaDevicesRequest.cpp +++ b/third_party/WebKit/Source/modules/mediastream/MediaDevicesRequest.cpp
@@ -43,7 +43,7 @@ MediaDevicesRequest::MediaDevicesRequest(ScriptState* state, UserMediaController* controller) - : ActiveDOMObject(state->getExecutionContext()), + : SuspendableObject(state->getExecutionContext()), m_controller(controller), m_resolver(ScriptPromiseResolver::create(state)) {} @@ -79,7 +79,7 @@ DEFINE_TRACE(MediaDevicesRequest) { visitor->trace(m_controller); visitor->trace(m_resolver); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaDevicesRequest.h b/third_party/WebKit/Source/modules/mediastream/MediaDevicesRequest.h index 880b893..ec281c5 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaDevicesRequest.h +++ b/third_party/WebKit/Source/modules/mediastream/MediaDevicesRequest.h
@@ -27,7 +27,7 @@ #define MediaDevicesRequest_h #include "bindings/core/v8/ScriptPromise.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "modules/ModulesExport.h" #include "modules/mediastream/MediaDeviceInfo.h" #include "platform/heap/Handle.h" @@ -41,7 +41,7 @@ class MODULES_EXPORT MediaDevicesRequest final : public GarbageCollectedFinalized<MediaDevicesRequest>, - public ActiveDOMObject { + public SuspendableObject { USING_GARBAGE_COLLECTED_MIXIN(MediaDevicesRequest); public: @@ -54,7 +54,7 @@ void succeed(const MediaDeviceInfoVector&); - // ActiveDOMObject + // SuspendableObject void contextDestroyed() override; DECLARE_VIRTUAL_TRACE();
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp index f27b7db..ff04878 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp +++ b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp
@@ -53,7 +53,7 @@ MediaStreamTrack::MediaStreamTrack(ExecutionContext* context, MediaStreamComponent* component) : ActiveScriptWrappable(this), - ActiveDOMObject(context), + SuspendableObject(context), m_readyState(MediaStreamSource::ReadyStateLive), m_isIteratingRegisteredMediaStreams(false), m_stopped(false), @@ -250,14 +250,14 @@ } ExecutionContext* MediaStreamTrack::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } DEFINE_TRACE(MediaStreamTrack) { visitor->trace(m_registeredMediaStreams); visitor->trace(m_component); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.h b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.h index daabc8c..c5f2ad3 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.h +++ b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.h
@@ -27,7 +27,7 @@ #define MediaStreamTrack_h #include "bindings/core/v8/ActiveScriptWrappable.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "modules/EventTargetModules.h" #include "modules/ModulesExport.h" #include "platform/mediastream/MediaStreamDescriptor.h" @@ -46,7 +46,7 @@ class MODULES_EXPORT MediaStreamTrack : public EventTargetWithInlineData, public ActiveScriptWrappable, - public ActiveDOMObject, + public SuspendableObject, public MediaStreamSource::Observer { USING_GARBAGE_COLLECTED_MIXIN(MediaStreamTrack); DEFINE_WRAPPERTYPEINFO(); @@ -95,7 +95,7 @@ // ScriptWrappable bool hasPendingActivity() const final; - // ActiveDOMObject + // SuspendableObject void contextDestroyed() override; std::unique_ptr<AudioSourceProvider> createWebAudioSource();
diff --git a/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.h b/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.h index 3e6aec2..0fb6cee 100644 --- a/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.h +++ b/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.h
@@ -31,7 +31,7 @@ #ifndef UserMediaRequest_h #define UserMediaRequest_h -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "modules/ModulesExport.h" #include "modules/mediastream/NavigatorUserMediaErrorCallback.h" #include "modules/mediastream/NavigatorUserMediaSuccessCallback.h"
diff --git a/third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp b/third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp index dced7b3..8cd6266 100644 --- a/third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp +++ b/third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp
@@ -93,7 +93,7 @@ } ExecutionContext* NetworkInformation::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } void NetworkInformation::addedEventListener( @@ -147,7 +147,7 @@ NetworkInformation::NetworkInformation(ExecutionContext* context) : ActiveScriptWrappable(this), - ActiveDOMObject(context), + SuspendableObject(context), m_type(networkStateNotifier().connectionType()), m_downlinkMaxMbps(networkStateNotifier().maxBandwidth()), m_observing(false), @@ -155,7 +155,7 @@ DEFINE_TRACE(NetworkInformation) { EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/netinfo/NetworkInformation.h b/third_party/WebKit/Source/modules/netinfo/NetworkInformation.h index c5c8d59..d75085a 100644 --- a/third_party/WebKit/Source/modules/netinfo/NetworkInformation.h +++ b/third_party/WebKit/Source/modules/netinfo/NetworkInformation.h
@@ -6,7 +6,7 @@ #define NetworkInformation_h #include "bindings/core/v8/ActiveScriptWrappable.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "core/events/EventTarget.h" #include "core/page/NetworkStateNotifier.h" #include "public/platform/WebConnectionType.h" @@ -18,7 +18,7 @@ class NetworkInformation final : public EventTargetWithInlineData, public ActiveScriptWrappable, - public ActiveDOMObject, + public SuspendableObject, public NetworkStateNotifier::NetworkStateObserver { USING_GARBAGE_COLLECTED_MIXIN(NetworkInformation); DEFINE_WRAPPERTYPEINFO(); @@ -41,7 +41,7 @@ // ScriptWrappable bool hasPendingActivity() const final; - // ActiveDOMObject overrides. + // SuspendableObject overrides. void contextDestroyed() override; DECLARE_VIRTUAL_TRACE(); @@ -70,7 +70,7 @@ // Whether this object is listening for events from NetworkStateNotifier. bool m_observing; - // Whether ActiveDOMObject::stop has been called. + // Whether SuspendableObject::stop has been called. bool m_contextStopped; };
diff --git a/third_party/WebKit/Source/modules/notifications/Notification.cpp b/third_party/WebKit/Source/modules/notifications/Notification.cpp index 2090e9a0..f2fa76b 100644 --- a/third_party/WebKit/Source/modules/notifications/Notification.cpp +++ b/third_party/WebKit/Source/modules/notifications/Notification.cpp
@@ -135,7 +135,7 @@ Type type, const WebNotificationData& data) : ActiveScriptWrappable(this), - ActiveDOMObject(context), + SuspendableObject(context), m_type(type), m_state(State::Loading), m_data(data) { @@ -404,7 +404,7 @@ visitor->trace(m_prepareShowMethodRunner); visitor->trace(m_loader); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/notifications/Notification.h b/third_party/WebKit/Source/modules/notifications/Notification.h index ef5b78d..829a09d 100644 --- a/third_party/WebKit/Source/modules/notifications/Notification.h +++ b/third_party/WebKit/Source/modules/notifications/Notification.h
@@ -35,8 +35,8 @@ #include "bindings/core/v8/ScriptPromise.h" #include "bindings/core/v8/ScriptValue.h" #include "bindings/core/v8/SerializedScriptValue.h" -#include "core/dom/ActiveDOMObject.h" #include "core/dom/DOMTimeStamp.h" +#include "core/dom/SuspendableObject.h" #include "modules/EventTargetModules.h" #include "modules/ModulesExport.h" #include "modules/vibration/NavigatorVibration.h" @@ -59,7 +59,7 @@ class MODULES_EXPORT Notification final : public EventTargetWithInlineData, public ActiveScriptWrappable, - public ActiveDOMObject, + public SuspendableObject, public WebNotificationDelegate { USING_GARBAGE_COLLECTED_MIXIN(Notification); DEFINE_WRAPPERTYPEINFO(); @@ -120,11 +120,11 @@ // EventTarget interface. ExecutionContext* getExecutionContext() const final { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } const AtomicString& interfaceName() const override; - // ActiveDOMObject interface. + // SuspendableObject interface. void contextDestroyed() override; // ScriptWrappable interface.
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCDTMFSender.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCDTMFSender.cpp index 3dee8313..09b0e0a 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCDTMFSender.cpp +++ b/third_party/WebKit/Source/modules/peerconnection/RTCDTMFSender.cpp
@@ -69,7 +69,7 @@ RTCDTMFSender::RTCDTMFSender(ExecutionContext* context, MediaStreamTrack* track, std::unique_ptr<WebRTCDTMFSenderHandler> handler) - : ActiveDOMObject(context), + : SuspendableObject(context), m_track(track), m_duration(defaultToneDurationMs), m_interToneGap(defaultInterToneGapMs), @@ -157,7 +157,7 @@ } ExecutionContext* RTCDTMFSender::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } void RTCDTMFSender::contextDestroyed() { @@ -188,7 +188,7 @@ visitor->trace(m_track); visitor->trace(m_scheduledEvents); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCDTMFSender.h b/third_party/WebKit/Source/modules/peerconnection/RTCDTMFSender.h index fd230bc..17bf0fa 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCDTMFSender.h +++ b/third_party/WebKit/Source/modules/peerconnection/RTCDTMFSender.h
@@ -26,7 +26,7 @@ #ifndef RTCDTMFSender_h #define RTCDTMFSender_h -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "modules/EventTargetModules.h" #include "platform/Timer.h" #include "public/platform/WebRTCDTMFSenderHandlerClient.h" @@ -41,7 +41,7 @@ class RTCDTMFSender final : public EventTargetWithInlineData, public WebRTCDTMFSenderHandlerClient, - public ActiveDOMObject { + public SuspendableObject { USING_GARBAGE_COLLECTED_MIXIN(RTCDTMFSender); DEFINE_WRAPPERTYPEINFO(); USING_PRE_FINALIZER(RTCDTMFSender, dispose); @@ -72,7 +72,7 @@ const AtomicString& interfaceName() const override; ExecutionContext* getExecutionContext() const override; - // ActiveDOMObject + // SuspendableObject void contextDestroyed() override; DECLARE_VIRTUAL_TRACE();
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.cpp index e89c0e1..033446a2 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.cpp +++ b/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.cpp
@@ -85,7 +85,7 @@ ExecutionContext* context, std::unique_ptr<WebRTCDataChannelHandler> handler) : ActiveScriptWrappable(this), - ActiveDOMObject(context), + SuspendableObject(context), m_handler(std::move(handler)), m_readyState(ReadyStateConnecting), m_binaryType(BinaryTypeArrayBuffer), @@ -296,10 +296,10 @@ } ExecutionContext* RTCDataChannel::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } -// ActiveDOMObject +// SuspendableObject void RTCDataChannel::suspend() { m_scheduledEventTimer.stop(); } @@ -375,7 +375,7 @@ DEFINE_TRACE(RTCDataChannel) { visitor->trace(m_scheduledEvents); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.h b/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.h index c89f3e5..e3379ab 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.h +++ b/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.h
@@ -27,7 +27,7 @@ #include "base/gtest_prod_util.h" #include "bindings/core/v8/ActiveScriptWrappable.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "modules/EventTargetModules.h" #include "platform/Timer.h" #include "platform/heap/Handle.h" @@ -50,7 +50,7 @@ : public EventTargetWithInlineData, NON_EXPORTED_BASE(public WebRTCDataChannelHandlerClient), public ActiveScriptWrappable, - public ActiveDOMObject { + public SuspendableObject { USING_GARBAGE_COLLECTED_MIXIN(RTCDataChannel); DEFINE_WRAPPERTYPEINFO(); USING_PRE_FINALIZER(RTCDataChannel, dispose); @@ -104,7 +104,7 @@ const AtomicString& interfaceName() const override; ExecutionContext* getExecutionContext() const override; - // ActiveDOMObject + // SuspendableObject void suspend() override; void resume() override; void contextDestroyed() override;
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp index b2ff332..d491884 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp +++ b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
@@ -488,7 +488,7 @@ WebMediaConstraints constraints, ExceptionState& exceptionState) : ActiveScriptWrappable(this), - ActiveDOMObject(context), + SuspendableObject(context), m_signalingState(SignalingStateStable), m_iceGatheringState(ICEGatheringStateNew), m_iceConnectionState(ICEConnectionStateNew), @@ -1364,7 +1364,7 @@ } ExecutionContext* RTCPeerConnection::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } void RTCPeerConnection::suspend() { @@ -1494,7 +1494,7 @@ visitor->trace(m_dispatchScheduledEventRunner); visitor->trace(m_scheduledEvents); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.h b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.h index 6da7a94c..a85434b 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.h +++ b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.h
@@ -33,7 +33,7 @@ #include "bindings/core/v8/ActiveScriptWrappable.h" #include "bindings/core/v8/ScriptPromise.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "modules/EventTargetModules.h" #include "modules/crypto/NormalizeAlgorithm.h" #include "modules/mediastream/MediaStream.h" @@ -65,7 +65,7 @@ class RTCPeerConnection final : public EventTargetWithInlineData, public WebRTCPeerConnectionHandlerClient, public ActiveScriptWrappable, - public ActiveDOMObject { + public SuspendableObject { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(RTCPeerConnection); USING_PRE_FINALIZER(RTCPeerConnection, dispose); @@ -186,7 +186,7 @@ const AtomicString& interfaceName() const override; ExecutionContext* getExecutionContext() const override; - // ActiveDOMObject + // SuspendableObject void suspend() override; void resume() override; void contextDestroyed() override;
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCSessionDescriptionRequestImpl.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCSessionDescriptionRequestImpl.cpp index df8b6f73..1526fa42 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCSessionDescriptionRequestImpl.cpp +++ b/third_party/WebKit/Source/modules/peerconnection/RTCSessionDescriptionRequestImpl.cpp
@@ -58,7 +58,7 @@ RTCPeerConnection* requester, RTCSessionDescriptionCallback* successCallback, RTCPeerConnectionErrorCallback* errorCallback) - : ActiveDOMObject(context), + : SuspendableObject(context), m_successCallback(successCallback), m_errorCallback(errorCallback), m_requester(requester) { @@ -101,7 +101,7 @@ visitor->trace(m_errorCallback); visitor->trace(m_requester); RTCSessionDescriptionRequest::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCSessionDescriptionRequestImpl.h b/third_party/WebKit/Source/modules/peerconnection/RTCSessionDescriptionRequestImpl.h index 30e73e9..b13b261 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCSessionDescriptionRequestImpl.h +++ b/third_party/WebKit/Source/modules/peerconnection/RTCSessionDescriptionRequestImpl.h
@@ -31,7 +31,7 @@ #ifndef RTCSessionDescriptionRequestImpl_h #define RTCSessionDescriptionRequestImpl_h -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "platform/heap/Handle.h" #include "platform/peerconnection/RTCSessionDescriptionRequest.h" #include "wtf/PassRefPtr.h" @@ -45,7 +45,7 @@ class RTCSessionDescriptionRequestImpl final : public RTCSessionDescriptionRequest, - public ActiveDOMObject { + public SuspendableObject { USING_GARBAGE_COLLECTED_MIXIN(RTCSessionDescriptionRequestImpl); public: @@ -59,7 +59,7 @@ void requestSucceeded(const WebRTCSessionDescription&) override; void requestFailed(const String& error) override; - // ActiveDOMObject + // SuspendableObject void contextDestroyed() override; DECLARE_VIRTUAL_TRACE();
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCStatsRequestImpl.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCStatsRequestImpl.cpp index 544ac47c..82ed1c1 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCStatsRequestImpl.cpp +++ b/third_party/WebKit/Source/modules/peerconnection/RTCStatsRequestImpl.cpp
@@ -44,7 +44,7 @@ RTCPeerConnection* requester, RTCStatsCallback* callback, MediaStreamTrack* selector) - : ActiveDOMObject(context), + : SuspendableObject(context), m_successCallback(callback), m_component(selector ? selector->component() : 0), m_requester(requester) { @@ -87,7 +87,7 @@ visitor->trace(m_component); visitor->trace(m_requester); RTCStatsRequest::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCStatsRequestImpl.h b/third_party/WebKit/Source/modules/peerconnection/RTCStatsRequestImpl.h index 7a7e34f6..3c19a831 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCStatsRequestImpl.h +++ b/third_party/WebKit/Source/modules/peerconnection/RTCStatsRequestImpl.h
@@ -25,7 +25,7 @@ #ifndef RTCStatsRequestImpl_h #define RTCStatsRequestImpl_h -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "modules/peerconnection/RTCStatsResponse.h" #include "platform/heap/Handle.h" #include "platform/peerconnection/RTCStatsRequest.h" @@ -39,7 +39,7 @@ class RTCStatsCallback; class RTCStatsRequestImpl final : public RTCStatsRequest, - public ActiveDOMObject { + public SuspendableObject { USING_GARBAGE_COLLECTED_MIXIN(RTCStatsRequestImpl); public: @@ -55,7 +55,7 @@ void requestSucceeded(RTCStatsResponseBase*) override; - // ActiveDOMObject + // SuspendableObject void contextDestroyed() override; DECLARE_VIRTUAL_TRACE();
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCVoidRequestImpl.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCVoidRequestImpl.cpp index 493efca0..26b74db1 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCVoidRequestImpl.cpp +++ b/third_party/WebKit/Source/modules/peerconnection/RTCVoidRequestImpl.cpp
@@ -54,7 +54,7 @@ RTCPeerConnection* requester, VoidCallback* successCallback, RTCPeerConnectionErrorCallback* errorCallback) - : ActiveDOMObject(context), + : SuspendableObject(context), m_successCallback(successCallback), m_errorCallback(errorCallback), m_requester(requester) { @@ -99,7 +99,7 @@ visitor->trace(m_errorCallback); visitor->trace(m_requester); RTCVoidRequest::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCVoidRequestImpl.h b/third_party/WebKit/Source/modules/peerconnection/RTCVoidRequestImpl.h index fc1f469..7e9ee24 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCVoidRequestImpl.h +++ b/third_party/WebKit/Source/modules/peerconnection/RTCVoidRequestImpl.h
@@ -31,8 +31,8 @@ #ifndef RTCVoidRequestImpl_h #define RTCVoidRequestImpl_h -#include "core/dom/ActiveDOMObject.h" #include "core/dom/ExceptionCode.h" +#include "core/dom/SuspendableObject.h" #include "platform/heap/Handle.h" #include "platform/peerconnection/RTCVoidRequest.h" @@ -42,7 +42,8 @@ class RTCPeerConnectionErrorCallback; class VoidCallback; -class RTCVoidRequestImpl final : public RTCVoidRequest, public ActiveDOMObject { +class RTCVoidRequestImpl final : public RTCVoidRequest, + public SuspendableObject { USING_GARBAGE_COLLECTED_MIXIN(RTCVoidRequestImpl); public: @@ -56,7 +57,7 @@ void requestSucceeded() override; void requestFailed(const String& error) override; - // ActiveDOMObject + // SuspendableObject void contextDestroyed() override; DECLARE_VIRTUAL_TRACE();
diff --git a/third_party/WebKit/Source/modules/permissions/PermissionStatus.cpp b/third_party/WebKit/Source/modules/permissions/PermissionStatus.cpp index 71f9f8e..b7a35d9 100644 --- a/third_party/WebKit/Source/modules/permissions/PermissionStatus.cpp +++ b/third_party/WebKit/Source/modules/permissions/PermissionStatus.cpp
@@ -37,7 +37,7 @@ MojoPermissionStatus status, MojoPermissionDescriptor descriptor) : ActiveScriptWrappable(this), - ActiveDOMObject(executionContext), + SuspendableObject(executionContext), m_status(status), m_descriptor(std::move(descriptor)) {} @@ -50,7 +50,7 @@ } ExecutionContext* PermissionStatus::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } void PermissionStatus::permissionChanged(MojoPermissionStatus status) { @@ -113,7 +113,7 @@ DEFINE_TRACE(PermissionStatus) { EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/permissions/PermissionStatus.h b/third_party/WebKit/Source/modules/permissions/PermissionStatus.h index e67c5bc5c..910db817 100644 --- a/third_party/WebKit/Source/modules/permissions/PermissionStatus.h +++ b/third_party/WebKit/Source/modules/permissions/PermissionStatus.h
@@ -6,7 +6,7 @@ #define PermissionStatus_h #include "bindings/core/v8/ActiveScriptWrappable.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "core/events/EventTarget.h" #include "platform/heap/Handle.h" #include "public/platform/modules/permissions/permission.mojom-blink.h" @@ -22,7 +22,7 @@ // ExecutionContext. class PermissionStatus final : public EventTargetWithInlineData, public ActiveScriptWrappable, - public ActiveDOMObject { + public SuspendableObject { USING_GARBAGE_COLLECTED_MIXIN(PermissionStatus); DEFINE_WRAPPERTYPEINFO(); @@ -46,7 +46,7 @@ // ScriptWrappable implementation. bool hasPendingActivity() const final; - // ActiveDOMObject implementation. + // SuspendableObject implementation. void suspend() override; void resume() override; void contextDestroyed() override;
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp b/third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp index 6393482..7e1a27a 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp +++ b/third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp
@@ -48,7 +48,7 @@ const KURL& url, bool value) : ActiveScriptWrappable(this), - ActiveDOMObject(executionContext), + SuspendableObject(executionContext), PageVisibilityObserver(toDocument(executionContext)->page()), m_url(url), m_value(value), @@ -63,7 +63,7 @@ } ExecutionContext* PresentationAvailability::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } void PresentationAvailability::addedEventListener( @@ -134,7 +134,7 @@ DEFINE_TRACE(PresentationAvailability) { EventTargetWithInlineData::trace(visitor); PageVisibilityObserver::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationAvailability.h b/third_party/WebKit/Source/modules/presentation/PresentationAvailability.h index 12ad7d9..cb64a3d 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationAvailability.h +++ b/third_party/WebKit/Source/modules/presentation/PresentationAvailability.h
@@ -6,7 +6,7 @@ #define PresentationAvailability_h #include "bindings/core/v8/ActiveScriptWrappable.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "core/events/EventTarget.h" #include "core/page/PageVisibilityObserver.h" #include "modules/ModulesExport.h" @@ -26,7 +26,7 @@ class MODULES_EXPORT PresentationAvailability final : public EventTargetWithInlineData, public ActiveScriptWrappable, - public ActiveDOMObject, + public SuspendableObject, public PageVisibilityObserver, public WebPresentationAvailabilityObserver { USING_GARBAGE_COLLECTED_MIXIN(PresentationAvailability); @@ -49,7 +49,7 @@ // ScriptWrappable implementation. bool hasPendingActivity() const final; - // ActiveDOMObject implementation. + // SuspendableObject implementation. void suspend() override; void resume() override; void contextDestroyed() override; @@ -69,7 +69,7 @@ RegisteredEventListener&) override; private: - // Current state of the ActiveDOMObject. It is Active when created. It + // Current state of the SuspendableObject. It is Active when created. It // becomes Suspended when suspend() is called and moves back to Active if // resume() is called. It becomes Inactive when stop() is called or at // destruction time.
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp b/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp index c5226b1..a378729c 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp +++ b/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp
@@ -87,7 +87,7 @@ } ExecutionContext* PresentationRequest::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } void PresentationRequest::addedEventListener( @@ -205,13 +205,13 @@ DEFINE_TRACE(PresentationRequest) { EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } PresentationRequest::PresentationRequest(ExecutionContext* executionContext, const KURL& url) : ActiveScriptWrappable(this), - ActiveDOMObject(executionContext), + SuspendableObject(executionContext), m_url(url) {} } // namespace blink
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationRequest.h b/third_party/WebKit/Source/modules/presentation/PresentationRequest.h index 70cd618..5404c17 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationRequest.h +++ b/third_party/WebKit/Source/modules/presentation/PresentationRequest.h
@@ -7,7 +7,7 @@ #include "bindings/core/v8/ActiveScriptWrappable.h" #include "bindings/core/v8/ScriptPromise.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "core/events/EventTarget.h" #include "platform/heap/Handle.h" #include "platform/heap/Heap.h" @@ -19,7 +19,7 @@ // which websites can start or join presentation connections. class PresentationRequest final : public EventTargetWithInlineData, public ActiveScriptWrappable, - public ActiveDOMObject { + public SuspendableObject { USING_GARBAGE_COLLECTED_MIXIN(PresentationRequest); DEFINE_WRAPPERTYPEINFO();
diff --git a/third_party/WebKit/Source/modules/sensor/Sensor.h b/third_party/WebKit/Source/modules/sensor/Sensor.h index 98a4a96e..5f9e8b5 100644 --- a/third_party/WebKit/Source/modules/sensor/Sensor.h +++ b/third_party/WebKit/Source/modules/sensor/Sensor.h
@@ -7,8 +7,8 @@ #include "bindings/core/v8/ActiveScriptWrappable.h" #include "bindings/core/v8/ScriptWrappable.h" -#include "core/dom/ActiveDOMObject.h" #include "core/dom/ContextLifecycleObserver.h" +#include "core/dom/SuspendableObject.h" #include "core/frame/PlatformEventController.h" #include "modules/EventTargetModules.h" #include "modules/sensor/SensorOptions.h"
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.h b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.h index 5802710..5f06610b 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.h +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.h
@@ -85,7 +85,7 @@ std::unique_ptr<WebServiceWorker::Handle>); ServiceWorker(ExecutionContext*, std::unique_ptr<WebServiceWorker::Handle>); - // ActiveDOMObject overrides. + // SuspendableObject overrides. void contextDestroyed() override; // A handle to the service worker representation in the embedder.
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp index 60c26b45..01f905d8 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
@@ -127,7 +127,7 @@ ExecutionContext* executionContext, std::unique_ptr<WebServiceWorkerRegistration::Handle> handle) : ActiveScriptWrappable(this), - ActiveDOMObject(executionContext), + SuspendableObject(executionContext), m_handle(std::move(handle)), m_stopped(false) { ASSERT(m_handle); @@ -153,7 +153,7 @@ visitor->trace(m_active); visitor->trace(m_navigationPreload); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); Supplementable<ServiceWorkerRegistration>::trace(visitor); }
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.h b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.h index e5599ca2..b748839 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.h +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.h
@@ -7,7 +7,7 @@ #include "bindings/core/v8/ActiveScriptWrappable.h" #include "bindings/core/v8/ScriptPromiseResolver.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "core/events/EventTarget.h" #include "modules/serviceworkers/NavigationPreloadManager.h" #include "modules/serviceworkers/ServiceWorker.h" @@ -29,7 +29,7 @@ class ServiceWorkerRegistration final : public EventTargetWithInlineData, public ActiveScriptWrappable, - public ActiveDOMObject, + public SuspendableObject, public WebServiceWorkerRegistrationProxy, public Supplementable<ServiceWorkerRegistration> { DEFINE_WRAPPERTYPEINFO(); @@ -43,7 +43,7 @@ // EventTarget overrides. const AtomicString& interfaceName() const override; ExecutionContext* getExecutionContext() const override { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } // WebServiceWorkerRegistrationProxy overrides. @@ -84,7 +84,7 @@ std::unique_ptr<WebServiceWorkerRegistration::Handle>); void dispose(); - // ActiveDOMObject overrides. + // SuspendableObject overrides. void contextDestroyed() override; // A handle to the registration representation in the embedder.
diff --git a/third_party/WebKit/Source/modules/speech/SpeechRecognition.cpp b/third_party/WebKit/Source/modules/speech/SpeechRecognition.cpp index b9ca706..521ec13 100644 --- a/third_party/WebKit/Source/modules/speech/SpeechRecognition.cpp +++ b/third_party/WebKit/Source/modules/speech/SpeechRecognition.cpp
@@ -148,7 +148,7 @@ } ExecutionContext* SpeechRecognition::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } void SpeechRecognition::contextDestroyed() { @@ -163,7 +163,7 @@ SpeechRecognition::SpeechRecognition(Page* page, ExecutionContext* context) : ActiveScriptWrappable(this), - ActiveDOMObject(context), + SuspendableObject(context), m_grammars(SpeechGrammarList::create()), // FIXME: The spec is not clear // on the default value for the // grammars attribute. @@ -186,7 +186,7 @@ visitor->trace(m_controller); visitor->trace(m_finalResults); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/speech/SpeechRecognition.h b/third_party/WebKit/Source/modules/speech/SpeechRecognition.h index dd17d5f1..a905315 100644 --- a/third_party/WebKit/Source/modules/speech/SpeechRecognition.h +++ b/third_party/WebKit/Source/modules/speech/SpeechRecognition.h
@@ -27,7 +27,7 @@ #define SpeechRecognition_h #include "bindings/core/v8/ActiveScriptWrappable.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "modules/EventTargetModules.h" #include "modules/ModulesExport.h" #include "modules/speech/SpeechGrammarList.h" @@ -48,7 +48,7 @@ class MODULES_EXPORT SpeechRecognition final : public EventTargetWithInlineData, public ActiveScriptWrappable, - public ActiveDOMObject { + public SuspendableObject { USING_GARBAGE_COLLECTED_MIXIN(SpeechRecognition); DEFINE_WRAPPERTYPEINFO(); @@ -104,7 +104,7 @@ // ScriptWrappable bool hasPendingActivity() const final; - // ActiveDOMObject + // SuspendableObject void contextDestroyed() override; DEFINE_ATTRIBUTE_EVENT_LISTENER(audiostart);
diff --git a/third_party/WebKit/Source/modules/vr/VRController.cpp b/third_party/WebKit/Source/modules/vr/VRController.cpp index 94c36f8..77e0259 100644 --- a/third_party/WebKit/Source/modules/vr/VRController.cpp +++ b/third_party/WebKit/Source/modules/vr/VRController.cpp
@@ -96,8 +96,6 @@ void VRController::contextDestroyed() { dispose(); - // The context is not automatically cleared, so do it manually. - ContextLifecycleObserver::clearContext(); } void VRController::dispose() {
diff --git a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp index 020e539..3481cdc 100644 --- a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp +++ b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp
@@ -90,7 +90,7 @@ // Constructor for rendering to the audio hardware. BaseAudioContext::BaseAudioContext(Document* document) : ActiveScriptWrappable(this), - ActiveDOMObject(document), + SuspendableObject(document), m_destinationNode(nullptr), m_isCleared(false), m_isResolvingResumePromises(false), @@ -123,7 +123,7 @@ size_t numberOfFrames, float sampleRate) : ActiveScriptWrappable(this), - ActiveDOMObject(document), + SuspendableObject(document), m_destinationNode(nullptr), m_isCleared(false), m_isResolvingResumePromises(false), @@ -850,7 +850,7 @@ } ExecutionContext* BaseAudioContext::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } void BaseAudioContext::startRendering() { @@ -877,7 +877,7 @@ visitor->trace(m_periodicWaveSawtooth); visitor->trace(m_periodicWaveTriangle); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } SecurityOrigin* BaseAudioContext::getSecurityOrigin() const {
diff --git a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h index 028ff3e9..4b83dea 100644 --- a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h +++ b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h
@@ -29,8 +29,8 @@ #include "bindings/core/v8/ActiveScriptWrappable.h" #include "bindings/core/v8/ScriptPromise.h" #include "bindings/core/v8/ScriptPromiseResolver.h" -#include "core/dom/ActiveDOMObject.h" #include "core/dom/DOMTypedArray.h" +#include "core/dom/SuspendableObject.h" #include "core/events/EventListener.h" #include "modules/EventTargetModules.h" #include "modules/ModulesExport.h" @@ -87,7 +87,7 @@ class MODULES_EXPORT BaseAudioContext : public EventTargetWithInlineData, public ActiveScriptWrappable, - public ActiveDOMObject { + public SuspendableObject { USING_GARBAGE_COLLECTED_MIXIN(BaseAudioContext); DEFINE_WRAPPERTYPEINFO();
diff --git a/third_party/WebKit/Source/modules/webdatabase/DatabaseContext.cpp b/third_party/WebKit/Source/modules/webdatabase/DatabaseContext.cpp index 6f5c0360..2ce7237 100644 --- a/third_party/WebKit/Source/modules/webdatabase/DatabaseContext.cpp +++ b/third_party/WebKit/Source/modules/webdatabase/DatabaseContext.cpp
@@ -69,7 +69,7 @@ // 1. "outlive" the ExecutionContext. // - This is needed because the DatabaseContext needs to remove itself from // the -// ExecutionContext's ActiveDOMObject list and ContextLifecycleObserver +// ExecutionContext's SuspendableObject list and ContextLifecycleObserver // list. This removal needs to be executed on the script's thread. Hence, // we // rely on the ExecutionContext's shutdown process to call @@ -98,12 +98,12 @@ } DatabaseContext::DatabaseContext(ExecutionContext* context) - : ActiveDOMObject(context), + : SuspendableObject(context), m_hasOpenDatabases(false), m_hasRequestedTermination(false) { DCHECK(isMainThread()); - // ActiveDOMObject expects this to be called to set internal flags. + // SuspendableObject expects this to be called to set internal flags. suspendIfNeeded(); // For debug accounting only. We must do this before we register the @@ -119,7 +119,7 @@ DEFINE_TRACE(DatabaseContext) { visitor->trace(m_databaseThread); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } // This is called if the associated ExecutionContext is destructing while
diff --git a/third_party/WebKit/Source/modules/webdatabase/DatabaseContext.h b/third_party/WebKit/Source/modules/webdatabase/DatabaseContext.h index af6ef8e..6f84ff7 100644 --- a/third_party/WebKit/Source/modules/webdatabase/DatabaseContext.h +++ b/third_party/WebKit/Source/modules/webdatabase/DatabaseContext.h
@@ -28,7 +28,7 @@ #ifndef DatabaseContext_h #define DatabaseContext_h -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "platform/heap/Handle.h" namespace blink { @@ -39,7 +39,7 @@ class SecurityOrigin; class DatabaseContext final : public GarbageCollectedFinalized<DatabaseContext>, - public ActiveDOMObject { + public SuspendableObject { USING_GARBAGE_COLLECTED_MIXIN(DatabaseContext); public: @@ -50,7 +50,7 @@ ~DatabaseContext() override; DECLARE_VIRTUAL_TRACE(); - // For life-cycle management (inherited from ActiveDOMObject): + // For life-cycle management (inherited from SuspendableObject): void contextDestroyed() override; DatabaseContext* backend();
diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIAccess.cpp b/third_party/WebKit/Source/modules/webmidi/MIDIAccess.cpp index 3f4ae378..21bf2ee 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIAccess.cpp +++ b/third_party/WebKit/Source/modules/webmidi/MIDIAccess.cpp
@@ -65,7 +65,7 @@ const Vector<MIDIAccessInitializer::PortDescriptor>& ports, ExecutionContext* executionContext) : ActiveScriptWrappable(this), - ActiveDOMObject(executionContext), + SuspendableObject(executionContext), m_accessor(std::move(accessor)), m_sysexEnabled(sysexEnabled), m_hasPendingActivity(false) { @@ -230,7 +230,7 @@ visitor->trace(m_inputs); visitor->trace(m_outputs); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIAccess.h b/third_party/WebKit/Source/modules/webmidi/MIDIAccess.h index 32b81a7..11a7a470 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIAccess.h +++ b/third_party/WebKit/Source/modules/webmidi/MIDIAccess.h
@@ -33,7 +33,7 @@ #include "bindings/core/v8/ActiveScriptWrappable.h" #include "bindings/core/v8/ScriptPromise.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "media/midi/midi_service.mojom-blink.h" #include "modules/EventTargetModules.h" #include "modules/webmidi/MIDIAccessInitializer.h" @@ -53,7 +53,7 @@ class MIDIAccess final : public EventTargetWithInlineData, public ActiveScriptWrappable, - public ActiveDOMObject, + public SuspendableObject, public MIDIAccessorClient { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(MIDIAccess); @@ -85,13 +85,13 @@ return EventTargetNames::MIDIAccess; } ExecutionContext* getExecutionContext() const override { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } // ScriptWrappable bool hasPendingActivity() const final; - // ActiveDOMObject + // SuspendableObject void contextDestroyed() override; // MIDIAccessorClient
diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIPort.cpp b/third_party/WebKit/Source/modules/webmidi/MIDIPort.cpp index 925b013..85ec5fd1 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIPort.cpp +++ b/third_party/WebKit/Source/modules/webmidi/MIDIPort.cpp
@@ -47,7 +47,7 @@ const String& version, PortState state) : ActiveScriptWrappable(this), - ActiveDOMObject(access->getExecutionContext()), + SuspendableObject(access->getExecutionContext()), m_id(id), m_manufacturer(manufacturer), m_name(name), @@ -164,7 +164,7 @@ DEFINE_TRACE(MIDIPort) { visitor->trace(m_access); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } DEFINE_TRACE_WRAPPERS(MIDIPort) {
diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIPort.h b/third_party/WebKit/Source/modules/webmidi/MIDIPort.h index 78902fea..ee3c88b 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIPort.h +++ b/third_party/WebKit/Source/modules/webmidi/MIDIPort.h
@@ -34,8 +34,8 @@ #include "bindings/core/v8/ActiveScriptWrappable.h" #include "bindings/core/v8/ScriptPromise.h" #include "bindings/core/v8/TraceWrapperMember.h" -#include "core/dom/ActiveDOMObject.h" #include "core/dom/ExceptionCode.h" +#include "core/dom/SuspendableObject.h" #include "media/midi/midi_service.mojom-blink.h" #include "modules/EventTargetModules.h" #include "modules/webmidi/MIDIAccessor.h" @@ -47,7 +47,7 @@ class MIDIPort : public EventTargetWithInlineData, public ActiveScriptWrappable, - public ActiveDOMObject { + public SuspendableObject { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(MIDIPort); @@ -93,7 +93,7 @@ // ScriptWrappable bool hasPendingActivity() const final; - // ActiveDOMObject + // SuspendableObject void contextDestroyed() override; protected:
diff --git a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp index 8610aa3..6624243 100644 --- a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp +++ b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp
@@ -219,7 +219,7 @@ DOMWebSocket::DOMWebSocket(ExecutionContext* context) : ActiveScriptWrappable(this), - ActiveDOMObject(context), + SuspendableObject(context), m_state(kConnecting), m_bufferedAmount(0), m_consumedBufferedAmount(0), @@ -650,7 +650,7 @@ } ExecutionContext* DOMWebSocket::getExecutionContext() const { - return ActiveDOMObject::getExecutionContext(); + return SuspendableObject::getExecutionContext(); } void DOMWebSocket::contextDestroyed() { @@ -863,7 +863,7 @@ visitor->trace(m_eventQueue); WebSocketChannelClient::trace(visitor); EventTargetWithInlineData::trace(visitor); - ActiveDOMObject::trace(visitor); + SuspendableObject::trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.h b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.h index 9b0127c..df7f4f1a 100644 --- a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.h +++ b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.h
@@ -33,7 +33,7 @@ #include "bindings/core/v8/ActiveScriptWrappable.h" #include "bindings/core/v8/ScriptWrappable.h" -#include "core/dom/ActiveDOMObject.h" +#include "core/dom/SuspendableObject.h" #include "core/events/EventListener.h" #include "core/events/EventTarget.h" #include "modules/EventTargetModules.h" @@ -63,7 +63,7 @@ class MODULES_EXPORT DOMWebSocket : public EventTargetWithInlineData, public ActiveScriptWrappable, - public ActiveDOMObject, + public SuspendableObject, public WebSocketChannelClient { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(DOMWebSocket); @@ -121,7 +121,7 @@ const AtomicString& interfaceName() const override; ExecutionContext* getExecutionContext() const override; - // ActiveDOMObject functions. + // SuspendableObject functions. void contextDestroyed() override; void suspend() override; void resume() override;
diff --git a/third_party/WebKit/Source/platform/AsyncMethodRunner.h b/third_party/WebKit/Source/platform/AsyncMethodRunner.h index 18b9c79d..d5280bf 100644 --- a/third_party/WebKit/Source/platform/AsyncMethodRunner.h +++ b/third_party/WebKit/Source/platform/AsyncMethodRunner.h
@@ -68,7 +68,7 @@ // If it's scheduled to run the method, cancel it and remember to schedule // it again when resume() is called. Mainly for implementing - // ActiveDOMObject::suspend(). + // SuspendableObject::suspend(). void suspend() { if (m_suspended) return;
diff --git a/third_party/WebKit/Source/platform/InstanceCounters.h b/third_party/WebKit/Source/platform/InstanceCounters.h index 23b9cf2..fe756f5 100644 --- a/third_party/WebKit/Source/platform/InstanceCounters.h +++ b/third_party/WebKit/Source/platform/InstanceCounters.h
@@ -42,7 +42,7 @@ public: enum CounterType { - ActiveDOMObjectCounter, + SuspendableObjectCounter, AudioHandlerCounter, DocumentCounter, FrameCounter,
diff --git a/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp b/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp index c62c432a..6145f8a 100644 --- a/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp +++ b/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp
@@ -227,7 +227,7 @@ void SuspendableScriptExecutor::dispose() { // Remove object as a ContextLifecycleObserver. - ActiveDOMObject::clearContext(); + SuspendableObject::clearContext(); m_keepAlive.clear(); stop(); }
diff --git a/third_party/WebKit/Source/web/WebHelperPluginImpl.cpp b/third_party/WebKit/Source/web/WebHelperPluginImpl.cpp index 2e98074..1baedd0 100644 --- a/third_party/WebKit/Source/web/WebHelperPluginImpl.cpp +++ b/third_party/WebKit/Source/web/WebHelperPluginImpl.cpp
@@ -86,10 +86,10 @@ void WebHelperPluginImpl::destroy() { // Defer deletion so we don't do too much work when called via - // stopActiveDOMObjects(). + // stopSuspendableObjects(). // FIXME: It's not clear why we still need this. The original code held a // Page and a WebFrame, and destroying it would cause JavaScript triggered by - // frame detach to run, which isn't allowed inside stopActiveDOMObjects(). + // frame detach to run, which isn't allowed inside stopSuspendableObjects(). // Removing this causes one Chrome test to fail with a timeout. m_destructionTimer.startOneShot(0, BLINK_FROM_HERE); }
diff --git a/third_party/WebKit/Source/web/WebLeakDetector.cpp b/third_party/WebKit/Source/web/WebLeakDetector.cpp index d21f237..b1814feb 100644 --- a/third_party/WebKit/Source/web/WebLeakDetector.cpp +++ b/third_party/WebKit/Source/web/WebLeakDetector.cpp
@@ -162,8 +162,8 @@ InstanceCounters::counterValue(InstanceCounters::LayoutObjectCounter); result.numberOfLiveResources = InstanceCounters::counterValue(InstanceCounters::ResourceCounter); - result.numberOfLiveActiveDOMObjects = - InstanceCounters::counterValue(InstanceCounters::ActiveDOMObjectCounter); + result.numberOfLiveSuspendableObjects = InstanceCounters::counterValue( + InstanceCounters::SuspendableObjectCounter); result.numberOfLiveScriptPromises = InstanceCounters::counterValue(InstanceCounters::ScriptPromiseCounter); result.numberOfLiveFrames =
diff --git a/third_party/WebKit/public/web/WebLeakDetector.h b/third_party/WebKit/public/web/WebLeakDetector.h index a80504a..9a6df54 100644 --- a/third_party/WebKit/public/web/WebLeakDetector.h +++ b/third_party/WebKit/public/web/WebLeakDetector.h
@@ -45,7 +45,7 @@ unsigned numberOfLiveNodes; unsigned numberOfLiveLayoutObjects; unsigned numberOfLiveResources; - unsigned numberOfLiveActiveDOMObjects; + unsigned numberOfLiveSuspendableObjects; unsigned numberOfLiveScriptPromises; unsigned numberOfLiveFrames; unsigned numberOfLiveV8PerContextData;
diff --git a/tools/perf/benchmarks/loading.py b/tools/perf/benchmarks/loading.py index ca02b47..ca094d8a 100644 --- a/tools/perf/benchmarks/loading.py +++ b/tools/perf/benchmarks/loading.py
@@ -30,10 +30,6 @@ if possible_browser.browser_type == 'reference': return True - # crbug.com/651188 - if possible_browser.browser_type == 'android-webview': - return True - return False @classmethod
diff --git a/tools/perf/benchmarks/page_cycler_v2.py b/tools/perf/benchmarks/page_cycler_v2.py index 43a10e9..49b5077a 100644 --- a/tools/perf/benchmarks/page_cycler_v2.py +++ b/tools/perf/benchmarks/page_cycler_v2.py
@@ -59,12 +59,6 @@ possible_browser.platform.GetDeviceTypeName() == 'AOSP on BullHead'): return True - # crbug.com/651188 - if ((possible_browser.platform.GetDeviceTypeName() == 'Nexus 6' or - possible_browser.platform.GetDeviceTypeName() == 'AOSP on Shamu') and - possible_browser.browser_type == 'android-webview'): - return True - return False
diff --git a/ui/aura/window_tree_host.cc b/ui/aura/window_tree_host.cc index a1bac9be..c0baf2d3 100644 --- a/ui/aura/window_tree_host.cc +++ b/ui/aura/window_tree_host.cc
@@ -66,14 +66,6 @@ window()->Show(); } -void WindowTreeHost::InitCompositor() { - compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()), - GetBoundsInPixels().size()); - compositor_->SetRootLayer(window()->layer()); - compositor_->SetDisplayColorSpace( - GetICCProfileForCurrentDisplay().GetColorSpace()); -} - void WindowTreeHost::AddObserver(WindowTreeHostObserver* observer) { observers_.AddObserver(observer); } @@ -269,6 +261,14 @@ } } +void WindowTreeHost::InitCompositor() { + compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()), + GetBoundsInPixels().size()); + compositor_->SetRootLayer(window()->layer()); + compositor_->SetDisplayColorSpace( + GetICCProfileForCurrentDisplay().GetColorSpace()); +} + void WindowTreeHost::OnAcceleratedWidgetAvailable() { compositor_->SetAcceleratedWidget(GetAcceleratedWidget()); prop_.reset(new ui::ViewProp(GetAcceleratedWidget(),
diff --git a/ui/aura/window_tree_host.h b/ui/aura/window_tree_host.h index 0ee92d43..6bf153b92 100644 --- a/ui/aura/window_tree_host.h +++ b/ui/aura/window_tree_host.h
@@ -60,8 +60,6 @@ void InitHost(); - void InitCompositor(); - void AddObserver(WindowTreeHostObserver* observer); void RemoveObserver(WindowTreeHostObserver* observer); @@ -193,6 +191,7 @@ void DestroyDispatcher(); void CreateCompositor(); + void InitCompositor(); void OnAcceleratedWidgetAvailable(); // Returns the location of the RootWindow on native screen.