diff options
author | Dana Jansens <danakj@google.com> | 2016-03-09 12:57:22 -0800 |
---|---|---|
committer | Dana Jansens <danakj@google.com> | 2016-03-09 21:00:02 +0000 |
commit | 71331253d6537b9409518dec2368388c5d73cb94 (patch) | |
tree | d3a6572ec863fe33893dd79353f17c763c4194b0 | |
parent | aa5b4809788929faac190ac72bdcac0cbb2e7fc4 (diff) | |
download | chromium_src-71331253d6537b9409518dec2368388c5d73cb94.zip chromium_src-71331253d6537b9409518dec2368388c5d73cb94.tar.gz chromium_src-71331253d6537b9409518dec2368388c5d73cb94.tar.bz2 |
blink: Rename modules/ method to prefix with get when they collide.
This focuses on modules/ to rename methods that are named foo() and
that return a Foo*, which will have collisions when foo() is renamed
to Foo() in chromium style.
This patch uses the following to do many of the replacements, so it's
a bit on the larger side..
git gs '\b$foo()'|grep '\.\(cpp\|h\|cc\):'|cut -d: -f1|sort|uniq|xargs sed -ie 's/\b$foo()/$getFoo()/g'
R=haraken@chromium.org
TBR=brettw, chrishtr
BUG=582312
Review URL: https://codereview.chromium.org/1773813007 .
Cr-Commit-Position: refs/heads/master@{#380209}
558 files changed, 2442 insertions, 2440 deletions
diff --git a/android_webview/renderer/aw_render_frame_ext.cc b/android_webview/renderer/aw_render_frame_ext.cc index 673cc5a..69b06f0 100644 --- a/android_webview/renderer/aw_render_frame_ext.cc +++ b/android_webview/renderer/aw_render_frame_ext.cc @@ -143,7 +143,7 @@ void AwRenderFrameExt::DidCommitProvisionalLoad(bool is_new_navigation, content::DocumentState* document_state = content::DocumentState::FromDataSource(frame->dataSource()); if (document_state->can_load_local_resources()) { - blink::WebSecurityOrigin origin = frame->document().securityOrigin(); + blink::WebSecurityOrigin origin = frame->document().getSecurityOrigin(); origin.grantLoadLocalResources(); } } diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc index 8486b3e..93ef2c2 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc @@ -566,7 +566,7 @@ bool ChromeContentRendererClient::OverrideCreatePlugin( GURL url(params.url); #if defined(ENABLE_PLUGINS) ChromeViewHostMsg_GetPluginInfo_Output output; - WebString top_origin = frame->top()->securityOrigin().toString(); + WebString top_origin = frame->top()->getSecurityOrigin().toString(); render_frame->Send(new ChromeViewHostMsg_GetPluginInfo( render_frame->GetRoutingID(), url, blink::WebStringToGURL(top_origin), orig_mime_type, &output)); diff --git a/chrome/renderer/content_settings_observer.cc b/chrome/renderer/content_settings_observer.cc index 129c3f1..2e48be5 100644 --- a/chrome/renderer/content_settings_observer.cc +++ b/chrome/renderer/content_settings_observer.cc @@ -92,7 +92,7 @@ static const char kDotSWF[] = ".swf"; static const char kDotHTML[] = ".html"; GURL GetOriginOrURL(const WebFrame* frame) { - WebString top_origin = frame->top()->securityOrigin().toString(); + WebString top_origin = frame->top()->getSecurityOrigin().toString(); // The |top_origin| is unique ("null") e.g., for file:// URLs. Use the // document URL as the primary URL in those cases. // TODO(alexmos): This is broken for --site-per-process, since top() can be a @@ -247,7 +247,7 @@ void ContentSettingsObserver::DidCommitProvisionalLoad( GURL url = frame->document().url(); // If we start failing this DCHECK, please makes sure we don't regress // this bug: http://code.google.com/p/chromium/issues/detail?id=79304 - DCHECK(frame->document().securityOrigin().toString() == "null" || + DCHECK(frame->document().getSecurityOrigin().toString() == "null" || !url.SchemeIs(url::kDataScheme)); } @@ -255,15 +255,15 @@ bool ContentSettingsObserver::allowDatabase(const WebString& name, const WebString& display_name, unsigned long estimated_size) { WebFrame* frame = render_frame()->GetWebFrame(); - if (frame->securityOrigin().isUnique() || - frame->top()->securityOrigin().isUnique()) + if (frame->getSecurityOrigin().isUnique() || + frame->top()->getSecurityOrigin().isUnique()) return false; bool result = false; Send(new ChromeViewHostMsg_AllowDatabase( routing_id(), - blink::WebStringToGURL(frame->securityOrigin().toString()), - blink::WebStringToGURL(frame->top()->securityOrigin().toString()), + blink::WebStringToGURL(frame->getSecurityOrigin().toString()), + blink::WebStringToGURL(frame->top()->getSecurityOrigin().toString()), name, display_name, &result)); return result; } @@ -271,8 +271,8 @@ bool ContentSettingsObserver::allowDatabase(const WebString& name, void ContentSettingsObserver::requestFileSystemAccessAsync( const WebContentSettingCallbacks& callbacks) { WebFrame* frame = render_frame()->GetWebFrame(); - if (frame->securityOrigin().isUnique() || - frame->top()->securityOrigin().isUnique()) { + if (frame->getSecurityOrigin().isUnique() || + frame->top()->getSecurityOrigin().isUnique()) { WebContentSettingCallbacks permissionCallbacks(callbacks); permissionCallbacks.doDeny(); return; @@ -287,8 +287,8 @@ void ContentSettingsObserver::requestFileSystemAccessAsync( Send(new ChromeViewHostMsg_RequestFileSystemAccessAsync( routing_id(), current_request_id_, - blink::WebStringToGURL(frame->securityOrigin().toString()), - blink::WebStringToGURL(frame->top()->securityOrigin().toString()))); + blink::WebStringToGURL(frame->getSecurityOrigin().toString()), + blink::WebStringToGURL(frame->top()->getSecurityOrigin().toString()))); } bool ContentSettingsObserver::allowImage(bool enabled_per_settings, @@ -317,15 +317,15 @@ bool ContentSettingsObserver::allowImage(bool enabled_per_settings, bool ContentSettingsObserver::allowIndexedDB(const WebString& name, const WebSecurityOrigin& origin) { WebFrame* frame = render_frame()->GetWebFrame(); - if (frame->securityOrigin().isUnique() || - frame->top()->securityOrigin().isUnique()) + if (frame->getSecurityOrigin().isUnique() || + frame->top()->getSecurityOrigin().isUnique()) return false; bool result = false; Send(new ChromeViewHostMsg_AllowIndexedDB( routing_id(), - blink::WebStringToGURL(frame->securityOrigin().toString()), - blink::WebStringToGURL(frame->top()->securityOrigin().toString()), + blink::WebStringToGURL(frame->getSecurityOrigin().toString()), + blink::WebStringToGURL(frame->top()->getSecurityOrigin().toString()), name, &result)); return result; } @@ -352,10 +352,9 @@ bool ContentSettingsObserver::allowScript(bool enabled_per_settings) { bool allow = true; if (content_setting_rules_) { ContentSetting setting = GetContentSettingFromRules( - content_setting_rules_->script_rules, - frame, + content_setting_rules_->script_rules, frame, blink::WebStringToGURL( - frame->document().securityOrigin().toString())); + frame->document().getSecurityOrigin().toString())); allow = setting != CONTENT_SETTING_BLOCK; } allow = allow || IsWhitelistedForContentSettings(); @@ -385,13 +384,13 @@ bool ContentSettingsObserver::allowScriptFromSource( bool ContentSettingsObserver::allowStorage(bool local) { WebFrame* frame = render_frame()->GetWebFrame(); - if (frame->securityOrigin().isUnique() || - frame->top()->securityOrigin().isUnique()) + if (frame->getSecurityOrigin().isUnique() || + frame->top()->getSecurityOrigin().isUnique()) return false; bool result = false; StoragePermissionsKey key( - blink::WebStringToGURL(frame->document().securityOrigin().toString()), + blink::WebStringToGURL(frame->document().getSecurityOrigin().toString()), local); std::map<StoragePermissionsKey, bool>::const_iterator permissions = cached_storage_permissions_.find(key); @@ -400,8 +399,8 @@ bool ContentSettingsObserver::allowStorage(bool local) { Send(new ChromeViewHostMsg_AllowDOMStorage( routing_id(), - blink::WebStringToGURL(frame->securityOrigin().toString()), - blink::WebStringToGURL(frame->top()->securityOrigin().toString()), + blink::WebStringToGURL(frame->getSecurityOrigin().toString()), + blink::WebStringToGURL(frame->top()->getSecurityOrigin().toString()), local, &result)); cached_storage_permissions_[key] = result; return result; @@ -494,7 +493,7 @@ void ContentSettingsObserver::didUseKeygen() { WebFrame* frame = render_frame()->GetWebFrame(); Send(new ChromeViewHostMsg_DidUseKeygen( routing_id(), - blink::WebStringToGURL(frame->securityOrigin().toString()))); + blink::WebStringToGURL(frame->getSecurityOrigin().toString()))); } void ContentSettingsObserver::didNotAllowPlugins() { @@ -563,7 +562,7 @@ void ContentSettingsObserver::ClearBlockedContentSettings() { bool ContentSettingsObserver::IsPlatformApp() { #if defined(ENABLE_EXTENSIONS) WebFrame* frame = render_frame()->GetWebFrame(); - WebSecurityOrigin origin = frame->document().securityOrigin(); + WebSecurityOrigin origin = frame->document().getSecurityOrigin(); const extensions::Extension* extension = GetExtension(origin); return extension && extension->is_platform_app(); #else @@ -596,8 +595,8 @@ bool ContentSettingsObserver::IsWhitelistedForContentSettings() const { return true; WebFrame* web_frame = render_frame()->GetWebFrame(); - return IsWhitelistedForContentSettings(web_frame->document().securityOrigin(), - web_frame->document().url()); + return IsWhitelistedForContentSettings( + web_frame->document().getSecurityOrigin(), web_frame->document().url()); } bool ContentSettingsObserver::IsWhitelistedForContentSettings( diff --git a/chrome/renderer/extensions/app_bindings.cc b/chrome/renderer/extensions/app_bindings.cc index 1fc204c..0961814 100644 --- a/chrome/renderer/extensions/app_bindings.cc +++ b/chrome/renderer/extensions/app_bindings.cc @@ -73,7 +73,7 @@ void AppBindings::GetDetails( v8::Local<v8::Value> AppBindings::GetDetailsImpl(blink::WebLocalFrame* frame) { v8::Isolate* isolate = frame->mainWorldScriptContext()->GetIsolate(); - if (frame->document().securityOrigin().isUnique()) + if (frame->document().getSecurityOrigin().isUnique()) return v8::Null(isolate); const Extension* extension = @@ -117,7 +117,7 @@ void AppBindings::GetRunningState( // To distinguish between ready_to_run and cannot_run states, we need the app // from the top frame. blink::WebSecurityOrigin top_frame_security_origin = - context()->web_frame()->top()->securityOrigin(); + context()->web_frame()->top()->getSecurityOrigin(); const RendererExtensionRegistry* extensions = RendererExtensionRegistry::Get(); diff --git a/chrome/renderer/extensions/chrome_extensions_renderer_client.cc b/chrome/renderer/extensions/chrome_extensions_renderer_client.cc index 66fca4c..0f3d463 100644 --- a/chrome/renderer/extensions/chrome_extensions_renderer_client.cc +++ b/chrome/renderer/extensions/chrome_extensions_renderer_client.cc @@ -85,7 +85,8 @@ bool CrossesExtensionExtents(blink::WebLocalFrame* frame, // in an extension process (other than the Chrome Web Store), we want to // keep it in process to allow the opener to script it. blink::WebDocument opener_document = opener_frame->document(); - blink::WebSecurityOrigin opener_origin = opener_document.securityOrigin(); + blink::WebSecurityOrigin opener_origin = + opener_document.getSecurityOrigin(); bool opener_is_extension_url = !opener_origin.isUnique() && extension_registry->GetExtensionOrAppByURL( opener_document.url()) != nullptr; diff --git a/chrome/renderer/extensions/media_galleries_custom_bindings.cc b/chrome/renderer/extensions/media_galleries_custom_bindings.cc index a9f4cab..a13ea64 100644 --- a/chrome/renderer/extensions/media_galleries_custom_bindings.cc +++ b/chrome/renderer/extensions/media_galleries_custom_bindings.cc @@ -37,8 +37,8 @@ void MediaGalleriesCustomBindings::GetMediaFileSystemObject( blink::WebLocalFrame* webframe = blink::WebLocalFrame::frameForCurrentContext(); - const GURL origin = - blink::WebStringToGURL(webframe->document().securityOrigin().toString()); + const GURL origin = blink::WebStringToGURL( + webframe->document().getSecurityOrigin().toString()); std::string fs_name = storage::GetFileSystemName(origin, storage::kFileSystemTypeExternal); fs_name.append("_"); diff --git a/chrome/renderer/extensions/resource_request_policy.cc b/chrome/renderer/extensions/resource_request_policy.cc index 0a3464f..4495605 100644 --- a/chrome/renderer/extensions/resource_request_policy.cc +++ b/chrome/renderer/extensions/resource_request_policy.cc @@ -76,7 +76,7 @@ bool ResourceRequestPolicy::CanRequestResource( // but this is ok for the checks below. We only care if it matches the // current extension or has a devtools scheme. GURL page_origin = - blink::WebStringToGURL(frame->top()->securityOrigin().toString()); + blink::WebStringToGURL(frame->top()->getSecurityOrigin().toString()); // Exceptions are: // - empty origin (needed for some edge cases when we have empty origins) diff --git a/chrome/renderer/plugins/chrome_plugin_placeholder.cc b/chrome/renderer/plugins/chrome_plugin_placeholder.cc index f08b9b8..393e915 100644 --- a/chrome/renderer/plugins/chrome_plugin_placeholder.cc +++ b/chrome/renderer/plugins/chrome_plugin_placeholder.cc @@ -260,7 +260,8 @@ void ChromePluginPlaceholder::PluginListChanged() { ChromeViewHostMsg_GetPluginInfo_Output output; std::string mime_type(GetPluginParams().mimeType.utf8()); - blink::WebString top_origin = GetFrame()->top()->securityOrigin().toString(); + blink::WebString top_origin = + GetFrame()->top()->getSecurityOrigin().toString(); render_frame()->Send( new ChromeViewHostMsg_GetPluginInfo(routing_id(), GURL(GetPluginParams().url), diff --git a/chrome/renderer/plugins/power_saver_info.cc b/chrome/renderer/plugins/power_saver_info.cc index c54ed8c..2445c4f 100644 --- a/chrome/renderer/plugins/power_saver_info.cc +++ b/chrome/renderer/plugins/power_saver_info.cc @@ -102,7 +102,7 @@ PowerSaverInfo PowerSaverInfo::Get(content::RenderFrame* render_frame, info.blocked_for_background_tab = render_frame->IsHidden(); auto status = render_frame->GetPeripheralContentStatus( - render_frame->GetWebFrame()->top()->securityOrigin(), + render_frame->GetWebFrame()->top()->getSecurityOrigin(), url::Origin(params.url), gfx::Size()); // Early-exit from the whole Power Saver system if the content is diff --git a/chrome/renderer/worker_content_settings_client_proxy.cc b/chrome/renderer/worker_content_settings_client_proxy.cc index cdf81ae..ce38f34 100644 --- a/chrome/renderer/worker_content_settings_client_proxy.cc +++ b/chrome/renderer/worker_content_settings_client_proxy.cc @@ -19,14 +19,14 @@ WorkerContentSettingsClientProxy::WorkerContentSettingsClientProxy( blink::WebFrame* frame) : routing_id_(render_frame->GetRoutingID()), is_unique_origin_(false) { - if (frame->document().securityOrigin().isUnique() || - frame->top()->securityOrigin().isUnique()) + if (frame->document().getSecurityOrigin().isUnique() || + frame->top()->getSecurityOrigin().isUnique()) is_unique_origin_ = true; sync_message_filter_ = content::RenderThread::Get()->GetSyncMessageFilter(); document_origin_url_ = - blink::WebStringToGURL(frame->document().securityOrigin().toString()); + blink::WebStringToGURL(frame->document().getSecurityOrigin().toString()); top_frame_origin_url_ = - blink::WebStringToGURL(frame->top()->securityOrigin().toString()); + blink::WebStringToGURL(frame->top()->getSecurityOrigin().toString()); } WorkerContentSettingsClientProxy::~WorkerContentSettingsClientProxy() {} diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc index d18ff7b..ba1b36c 100644 --- a/components/autofill/content/renderer/password_autofill_agent.cc +++ b/components/autofill/content/renderer/password_autofill_agent.cc @@ -529,13 +529,13 @@ bool FillFormOnPasswordReceived( // identical origin. blink::WebFrame* cur_frame = password_element.document().frame(); blink::WebString bottom_frame_origin = - cur_frame->securityOrigin().toString(); + cur_frame->getSecurityOrigin().toString(); DCHECK(cur_frame); while (cur_frame->parent()) { cur_frame = cur_frame->parent(); - if (!bottom_frame_origin.equals(cur_frame->securityOrigin().toString())) + if (!bottom_frame_origin.equals(cur_frame->getSecurityOrigin().toString())) return false; } @@ -977,7 +977,7 @@ void PasswordAutofillAgent::SendPasswordForms(bool only_visible) { blink::WebFrame* frame = render_frame()->GetWebFrame(); // Make sure that this security origin is allowed to use password manager. - blink::WebSecurityOrigin origin = frame->document().securityOrigin(); + blink::WebSecurityOrigin origin = frame->document().getSecurityOrigin(); if (logger) { logger->LogURL(Logger::STRING_SECURITY_ORIGIN, GURL(origin.toString().utf8())); diff --git a/components/autofill/content/renderer/password_generation_agent.cc b/components/autofill/content/renderer/password_generation_agent.cc index 1cbd613..c41310d 100644 --- a/components/autofill/content/renderer/password_generation_agent.cc +++ b/components/autofill/content/renderer/password_generation_agent.cc @@ -239,7 +239,7 @@ bool PasswordGenerationAgent::ShouldAnalyzeDocument() const { // Make sure that this security origin is allowed to use password manager. // Generating a password that can't be saved is a bad idea. blink::WebSecurityOrigin origin = - render_frame()->GetWebFrame()->document().securityOrigin(); + render_frame()->GetWebFrame()->document().getSecurityOrigin(); if (!origin.canAccessPasswordManager()) { VLOG(1) << "No PasswordManager access"; return false; diff --git a/components/nacl/renderer/ppb_nacl_private_impl.cc b/components/nacl/renderer/ppb_nacl_private_impl.cc index 57c7874..eb325e4 100644 --- a/components/nacl/renderer/ppb_nacl_private_impl.cc +++ b/components/nacl/renderer/ppb_nacl_private_impl.cc @@ -108,7 +108,7 @@ bool CanOpenViaFastPath(content::PepperPluginInstance* plugin_instance, // same-origin policy which prevents the app from requesting resources from // another app. blink::WebSecurityOrigin security_origin = - plugin_instance->GetContainer()->element().document().securityOrigin(); + plugin_instance->GetContainer()->element().document().getSecurityOrigin(); return security_origin.canRequest(gurl); } @@ -333,7 +333,7 @@ blink::WebURLLoader* CreateWebURLLoader(const blink::WebDocument& document, // Options settings here follow the original behavior in the trusted // plugin and PepperURLLoaderHost. - if (document.securityOrigin().canRequest(gurl)) { + if (document.getSecurityOrigin().canRequest(gurl)) { options.allowCredentials = true; } else { // Allow CORS. diff --git a/components/plugins/renderer/loadable_plugin_placeholder.cc b/components/plugins/renderer/loadable_plugin_placeholder.cc index b13ece5..11495d8 100644 --- a/components/plugins/renderer/loadable_plugin_placeholder.cc +++ b/components/plugins/renderer/loadable_plugin_placeholder.cc @@ -209,8 +209,8 @@ void LoadablePluginPlaceholder::OnUnobscuredRectUpdate( // On a size update check if we now qualify as a essential plugin. url::Origin content_origin = url::Origin(GetPluginParams().url); auto status = render_frame()->GetPeripheralContentStatus( - render_frame()->GetWebFrame()->top()->securityOrigin(), content_origin, - gfx::Size(width, height)); + render_frame()->GetWebFrame()->top()->getSecurityOrigin(), + content_origin, gfx::Size(width, height)); if (status != content::RenderFrame::CONTENT_STATUS_PERIPHERAL) { MarkPluginEssential( heuristic_run_before_ diff --git a/content/renderer/geolocation_dispatcher.cc b/content/renderer/geolocation_dispatcher.cc index 1c61eca..5943718 100644 --- a/content/renderer/geolocation_dispatcher.cc +++ b/content/renderer/geolocation_dispatcher.cc @@ -81,7 +81,7 @@ void GeolocationDispatcher::requestPermission( permission_service_->RequestPermission( PermissionName::GEOLOCATION, - permissionRequest.securityOrigin().toString().utf8(), + permissionRequest.getSecurityOrigin().toString().utf8(), base::Bind(&GeolocationDispatcher::OnPermissionSet, base::Unretained(this), permission_request_id)); } diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc index 8831cf0..9e84f2d 100644 --- a/content/renderer/media/android/webmediaplayer_android.cc +++ b/content/renderer/media/android/webmediaplayer_android.cc @@ -320,7 +320,7 @@ void WebMediaPlayerAndroid::DoLoad(LoadType load_type, DCHECK(main_thread_checker_.CalledOnValidThread()); media::ReportMetrics(load_type, GURL(url), - frame_->document().securityOrigin()); + frame_->document().getSecurityOrigin()); switch (load_type) { case LoadTypeURL: @@ -1647,8 +1647,8 @@ void WebMediaPlayerAndroid::ReportHLSMetrics() const { bool is_hls = IsHLSStream(); UMA_HISTOGRAM_BOOLEAN("Media.Android.IsHttpLiveStreamingMedia", is_hls); if (is_hls) { - media::RecordOriginOfHLSPlayback( - blink::WebStringToGURL(frame_->document().securityOrigin().toString())); + media::RecordOriginOfHLSPlayback(blink::WebStringToGURL( + frame_->document().getSecurityOrigin().toString())); } // Assuming that |is_hls| is the ground truth, test predictions. diff --git a/content/renderer/media/cdm/pepper_cdm_wrapper_impl.cc b/content/renderer/media/cdm/pepper_cdm_wrapper_impl.cc index 45405f4..6a53a2f 100644 --- a/content/renderer/media/cdm/pepper_cdm_wrapper_impl.cc +++ b/content/renderer/media/cdm/pepper_cdm_wrapper_impl.cc @@ -38,7 +38,7 @@ scoped_ptr<PepperCdmWrapper> PepperCdmWrapperImpl::Create( // though the CDM is no longer necessary. // TODO: Consider avoiding this possibility entirely. http://crbug.com/575236 GURL frame_security_origin( - blink::WebStringToGURL(frame->securityOrigin().toString())); + blink::WebStringToGURL(frame->getSecurityOrigin().toString())); if (frame_security_origin != security_origin) { LOG(ERROR) << "Frame has a different origin than the EME call."; return scoped_ptr<PepperCdmWrapper>(); diff --git a/content/renderer/media/midi_dispatcher.cc b/content/renderer/media/midi_dispatcher.cc index 4cb43e4..26e6444 100644 --- a/content/renderer/media/midi_dispatcher.cc +++ b/content/renderer/media/midi_dispatcher.cc @@ -40,7 +40,7 @@ void MidiDispatcher::requestPermission(const WebMIDIPermissionRequest& request, : PermissionName::MIDI; permission_service_->RequestPermission( - permission_name, request.securityOrigin().toString().utf8(), + permission_name, request.getSecurityOrigin().toString().utf8(), base::Bind(&MidiDispatcher::OnPermissionSet, base::Unretained(this), permission_request_id)); } diff --git a/content/renderer/media/peer_connection_tracker.cc b/content/renderer/media/peer_connection_tracker.cc index 130f077..74a01da 100644 --- a/content/renderer/media/peer_connection_tracker.cc +++ b/content/renderer/media/peer_connection_tracker.cc @@ -656,7 +656,7 @@ void PeerConnectionTracker::TrackGetUserMedia( DCHECK(main_thread_.CalledOnValidThread()); SendTarget()->Send(new PeerConnectionTrackerHost_GetUserMedia( - user_media_request.securityOrigin().toString().utf8(), + user_media_request.getSecurityOrigin().toString().utf8(), user_media_request.audio(), user_media_request.video(), SerializeMediaConstraints(user_media_request.audioConstraints()), SerializeMediaConstraints(user_media_request.videoConstraints()))); diff --git a/content/renderer/media/user_media_client_impl.cc b/content/renderer/media/user_media_client_impl.cc index db0fb2e..bc84e59 100644 --- a/content/renderer/media/user_media_client_impl.cc +++ b/content/renderer/media/user_media_client_impl.cc @@ -203,8 +203,8 @@ void UserMediaClientImpl::requestUserMedia( } CopyBlinkRequestToStreamControls(user_media_request, &controls); - security_origin = - blink::WebStringToGURL(user_media_request.securityOrigin().toString()); + security_origin = blink::WebStringToGURL( + user_media_request.getSecurityOrigin().toString()); DCHECK(render_frame()->GetWebFrame() == static_cast<blink::WebFrame*>( user_media_request.ownerDocument().frame())); @@ -285,7 +285,7 @@ void UserMediaClientImpl::requestMediaDevices( GURL security_origin; if (!media_devices_request.isNull()) { security_origin = blink::WebStringToGURL( - media_devices_request.securityOrigin().toString()); + media_devices_request.getSecurityOrigin().toString()); } DVLOG(1) << "UserMediaClientImpl::requestMediaDevices(" diff --git a/content/renderer/mojo_context_state.cc b/content/renderer/mojo_context_state.cc index 5495fb9..6d71589 100644 --- a/content/renderer/mojo_context_state.cc +++ b/content/renderer/mojo_context_state.cc @@ -99,7 +99,8 @@ MojoContextState::MojoContextState(blink::WebFrame* frame, module_added_(false), module_prefix_(for_layout_tests ? "layout-test-mojom://" - : frame_->securityOrigin().toString().utf8() + "/") { + : frame_->getSecurityOrigin().toString().utf8() + + "/") { gin::PerContextData* context_data = gin::PerContextData::From(context); gin::ContextHolder* context_holder = context_data->context_holder(); runner_.reset(new MojoMainRunner(frame_, context_holder)); diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc index 1c8fba3..e0fa103 100644 --- a/content/renderer/pepper/pepper_plugin_instance_impl.cc +++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc @@ -299,7 +299,7 @@ bool SecurityOriginForInstance(PP_Instance instance_id, return false; WebElement plugin_element = instance->container()->element(); - *security_origin = plugin_element.document().securityOrigin(); + *security_origin = plugin_element.document().getSecurityOrigin(); return true; } @@ -3180,8 +3180,8 @@ bool PepperPluginInstanceImpl::CanAccessMainFrame() const { blink::WebDocument main_document = containing_document.frame()->view()->mainFrame()->document(); - return containing_document.securityOrigin().canAccess( - main_document.securityOrigin()); + return containing_document.getSecurityOrigin().canAccess( + main_document.getSecurityOrigin()); } void PepperPluginInstanceImpl::KeepSizeAttributesBeforeFullscreen() { diff --git a/content/renderer/pepper/plugin_instance_throttler_impl.cc b/content/renderer/pepper/plugin_instance_throttler_impl.cc index 5a153b7..009e7d5 100644 --- a/content/renderer/pepper/plugin_instance_throttler_impl.cc +++ b/content/renderer/pepper/plugin_instance_throttler_impl.cc @@ -141,7 +141,7 @@ void PluginInstanceThrottlerImpl::Initialize( if (frame) { float zoom_factor = GetWebPlugin()->container()->pageZoomFactor(); auto status = frame->GetPeripheralContentStatus( - frame->GetWebFrame()->top()->securityOrigin(), content_origin, + frame->GetWebFrame()->top()->getSecurityOrigin(), content_origin, gfx::Size(roundf(unobscured_size.width() / zoom_factor), roundf(unobscured_size.height() / zoom_factor))); if (status != RenderFrame::CONTENT_STATUS_PERIPHERAL) { diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index 0639df5..125edab 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc @@ -2445,7 +2445,7 @@ blink::WebPlugin* RenderFrameImpl::createPlugin( WebPluginInfo info; std::string mime_type; bool found = false; - WebString top_origin = frame->top()->securityOrigin().toString(); + WebString top_origin = frame->top()->getSecurityOrigin().toString(); Send(new FrameHostMsg_GetPluginInfo(routing_id_, params.url, blink::WebStringToGURL(top_origin), params.mimeType.utf8(), &found, &info, @@ -2480,14 +2480,14 @@ blink::WebMediaPlayer* RenderFrameImpl::createMediaPlayer( blink::WebMediaStreamRegistry::lookupMediaStreamDescriptor(url)); if (!web_stream.isNull()) return CreateWebMediaPlayerForMediaStream(client, sink_id, - frame_->securityOrigin()); + frame_->getSecurityOrigin()); RenderThreadImpl* render_thread = RenderThreadImpl::current(); scoped_refptr<media::RestartableAudioRendererSink> audio_renderer_sink = AudioDeviceFactory::NewRestartableAudioRendererSink( AudioDeviceFactory::kSourceMediaElement, routing_id_, 0, - sink_id.utf8(), frame_->securityOrigin()); + sink_id.utf8(), frame_->getSecurityOrigin()); media::WebMediaPlayerParams::Context3DCB context_3d_cb = base::Bind(&GetSharedMainThreadContext3D); @@ -3718,7 +3718,7 @@ void RenderFrameImpl::willSendRequest( // If we need to set the first party, then we need to set the request's // initiator as well; it will not be updated during redirects. - request.setRequestorOrigin(frame->document().securityOrigin()); + request.setRequestorOrigin(frame->document().getSecurityOrigin()); } WebDataSource* provisional_data_source = frame->provisionalDataSource(); @@ -3845,7 +3845,7 @@ void RenderFrameImpl::willSendRequest( extra_data->set_render_frame_id(routing_id_); extra_data->set_is_main_frame(!parent); extra_data->set_frame_origin( - blink::WebStringToGURL(frame->document().securityOrigin().toString())); + blink::WebStringToGURL(frame->document().getSecurityOrigin().toString())); extra_data->set_parent_is_main_frame(parent && !parent->parent()); extra_data->set_parent_render_frame_id(parent_routing_id); extra_data->set_allow_download( @@ -4072,7 +4072,7 @@ void RenderFrameImpl::requestStorageQuota( blink::WebStorageQuotaType type, unsigned long long requested_size, blink::WebStorageQuotaCallbacks callbacks) { - WebSecurityOrigin origin = frame_->document().securityOrigin(); + WebSecurityOrigin origin = frame_->document().getSecurityOrigin(); if (origin.isUnique()) { // Unique origins cannot store persistent state. callbacks.didFail(blink::WebStorageQuotaErrorAbort); @@ -4227,17 +4227,15 @@ bool RenderFrameImpl::allowWebGL(bool default_value) { bool blocked = true; Send(new FrameHostMsg_Are3DAPIsBlocked( routing_id_, - blink::WebStringToGURL(frame_->top()->securityOrigin().toString()), - THREE_D_API_TYPE_WEBGL, - &blocked)); + blink::WebStringToGURL(frame_->top()->getSecurityOrigin().toString()), + THREE_D_API_TYPE_WEBGL, &blocked)); return !blocked; } void RenderFrameImpl::didLoseWebGLContext(int arb_robustness_status_code) { Send(new FrameHostMsg_DidLose3DContext( - blink::WebStringToGURL(frame_->top()->securityOrigin().toString()), - THREE_D_API_TYPE_WEBGL, - arb_robustness_status_code)); + blink::WebStringToGURL(frame_->top()->getSecurityOrigin().toString()), + THREE_D_API_TYPE_WEBGL, arb_robustness_status_code)); } blink::WebScreenOrientationClient* @@ -4474,10 +4472,11 @@ void RenderFrameImpl::SendDidCommitProvisionalLoad( // TODO(alexmos): Origins for URLs with non-standard schemes are excluded due // to https://crbug.com/439608 and will be replicated as unique origins. if (!is_swapped_out_) { - std::string scheme = frame->document().securityOrigin().protocol().utf8(); + std::string scheme = + frame->document().getSecurityOrigin().protocol().utf8(); if (url::IsStandard(scheme.c_str(), url::Component(0, static_cast<int>(scheme.length())))) { - params.origin = frame->document().securityOrigin(); + params.origin = frame->document().getSecurityOrigin(); } } diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc index be020d4..a47e73d 100644 --- a/content/renderer/render_view_browsertest.cc +++ b/content/renderer/render_view_browsertest.cc @@ -178,7 +178,7 @@ FrameReplicationState ReconstructReplicationStateForTesting( result.sandbox_flags = frame->effectiveSandboxFlags(); // result.should_enforce_strict_mixed_content_checking is calculated in the // browser... - result.origin = frame->securityOrigin(); + result.origin = frame->getSecurityOrigin(); return result; } @@ -932,7 +932,8 @@ TEST_F(RenderViewImplTest, OriginReplicationForSwapOut) { EXPECT_TRUE(web_frame->firstChild()->isWebRemoteFrame()); // Expect the origin to be updated properly. - blink::WebSecurityOrigin origin = web_frame->firstChild()->securityOrigin(); + blink::WebSecurityOrigin origin = + web_frame->firstChild()->getSecurityOrigin(); EXPECT_EQ(origin.toString(), WebString::fromUTF8(replication_state.origin.Serialize())); @@ -943,7 +944,7 @@ TEST_F(RenderViewImplTest, OriginReplicationForSwapOut) { RenderFrame::FromWebFrame(web_frame->lastChild())); child_frame2->SwapOut(kProxyRoutingId + 1, true, replication_state); EXPECT_TRUE(web_frame->lastChild()->isWebRemoteFrame()); - EXPECT_TRUE(web_frame->lastChild()->securityOrigin().isUnique()); + EXPECT_TRUE(web_frame->lastChild()->getSecurityOrigin().isUnique()); } // Test for https://crbug.com/568676, where a parent detaches a remote child diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index d831ca9..807be31 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -1623,11 +1623,11 @@ WebView* RenderViewImpl::createView(WebLocalFrame* creator, params.opener_top_level_frame_url = creator->top()->document().url(); } else { params.opener_top_level_frame_url = - blink::WebStringToGURL(creator->top()->securityOrigin().toString()); + blink::WebStringToGURL(creator->top()->getSecurityOrigin().toString()); } GURL security_url(blink::WebStringToGURL( - creator->document().securityOrigin().toString())); + creator->document().getSecurityOrigin().toString())); if (!security_url.is_valid()) security_url = GURL(); params.opener_security_origin = security_url; diff --git a/extensions/renderer/content_watcher.cc b/extensions/renderer/content_watcher.cc index 95c8a57..8c99e11 100644 --- a/extensions/renderer/content_watcher.cc +++ b/extensions/renderer/content_watcher.cc @@ -89,10 +89,10 @@ void ContentWatcher::DidMatchCSS( void ContentWatcher::NotifyBrowserOfChange( blink::WebLocalFrame* changed_frame) const { blink::WebFrame* const top_frame = changed_frame->top(); - const blink::WebSecurityOrigin top_origin = top_frame->securityOrigin(); + const blink::WebSecurityOrigin top_origin = top_frame->getSecurityOrigin(); // Want to aggregate matched selectors from all frames where an // extension with access to top_origin could run on the frame. - if (!top_origin.canAccess(changed_frame->document().securityOrigin())) { + if (!top_origin.canAccess(changed_frame->document().getSecurityOrigin())) { // If the changed frame can't be accessed by the top frame, then // no change in it could affect the set of selectors we'd send back. return; @@ -101,7 +101,7 @@ void ContentWatcher::NotifyBrowserOfChange( std::set<base::StringPiece> transitive_selectors; for (blink::WebFrame* frame = top_frame; frame; frame = frame->traverseNext(/*wrap=*/false)) { - if (top_origin.canAccess(frame->securityOrigin())) { + if (top_origin.canAccess(frame->getSecurityOrigin())) { std::map<blink::WebFrame*, std::set<std::string> >::const_iterator frame_selectors = matching_selectors_.find(frame); if (frame_selectors != matching_selectors_.end()) { diff --git a/extensions/renderer/extension_frame_helper.cc b/extensions/renderer/extension_frame_helper.cc index c063f84a..300e16e 100644 --- a/extensions/renderer/extension_frame_helper.cc +++ b/extensions/renderer/extension_frame_helper.cc @@ -44,7 +44,7 @@ bool RenderFrameMatches(const ExtensionFrameHelper* frame_helper, // This logic matches ExtensionWebContentsObserver::GetExtensionFromFrame. blink::WebSecurityOrigin origin = - frame_helper->render_frame()->GetWebFrame()->securityOrigin(); + frame_helper->render_frame()->GetWebFrame()->getSecurityOrigin(); if (origin.isUnique() || !base::EqualsASCII(base::StringPiece16(origin.protocol()), kExtensionScheme) || diff --git a/extensions/renderer/extension_injection_host.cc b/extensions/renderer/extension_injection_host.cc index 8e0d9b3..6e5b042 100644 --- a/extensions/renderer/extension_injection_host.cc +++ b/extensions/renderer/extension_injection_host.cc @@ -51,7 +51,7 @@ PermissionsData::AccessType ExtensionInjectionHost::CanExecuteOnFrame( int tab_id, bool is_declarative) const { blink::WebSecurityOrigin top_frame_security_origin = - render_frame->GetWebFrame()->top()->securityOrigin(); + render_frame->GetWebFrame()->top()->getSecurityOrigin(); // Only whitelisted extensions may run scripts on another extension's page. if (top_frame_security_origin.protocol().utf8() == kExtensionScheme && top_frame_security_origin.host().utf8() != extension_->id() && diff --git a/extensions/renderer/programmatic_script_injector.cc b/extensions/renderer/programmatic_script_injector.cc index e19a4c9..eea394b 100644 --- a/extensions/renderer/programmatic_script_injector.cc +++ b/extensions/renderer/programmatic_script_injector.cc @@ -34,7 +34,7 @@ ProgrammaticScriptInjector::ProgrammaticScriptInjector( finished_(false) { if (url_.SchemeIs(url::kAboutScheme)) { origin_for_about_error_ = - render_frame->GetWebFrame()->securityOrigin().toString().utf8(); + render_frame->GetWebFrame()->getSecurityOrigin().toString().utf8(); } } diff --git a/extensions/renderer/script_context.cc b/extensions/renderer/script_context.cc index abf38d4..f6f47f3 100644 --- a/extensions/renderer/script_context.cc +++ b/extensions/renderer/script_context.cc @@ -292,8 +292,8 @@ GURL ScriptContext::GetEffectiveDocumentURL(const blink::WebFrame* frame, if (parent && !parent->document().isNull()) { // Only return the parent URL if the frame can access it. const blink::WebDocument& parent_document = parent->document(); - if (frame->document().securityOrigin().canAccess( - parent_document.securityOrigin())) { + if (frame->document().getSecurityOrigin().canAccess( + parent_document.getSecurityOrigin())) { return parent_document.url(); } } diff --git a/extensions/renderer/script_context.h b/extensions/renderer/script_context.h index b59a97f..48c873c 100644 --- a/extensions/renderer/script_context.h +++ b/extensions/renderer/script_context.h @@ -133,7 +133,7 @@ class ScriptContext : public RequestSender::Source { // Get the URL of this context's web frame. // // TODO(kalman): Remove this and replace with a GetOrigin() call which reads - // of WebDocument::securityOrigin(): + // of WebDocument::getSecurityOrigin(): // - The URL can change (e.g. pushState) but the origin cannot. Luckily it // appears as though callers don't make security decisions based on the // result of url() so it's not a problem... yet. diff --git a/extensions/renderer/script_context_set.cc b/extensions/renderer/script_context_set.cc index 18f367c..35a05b6 100644 --- a/extensions/renderer/script_context_set.cc +++ b/extensions/renderer/script_context_set.cc @@ -45,11 +45,11 @@ ScriptContext* ScriptContextSet::Register( GURL frame_url = ScriptContext::GetDataSourceURLForFrame(frame); Feature::Context context_type = ClassifyJavaScriptContext(extension, extension_group, frame_url, - frame->document().securityOrigin()); + frame->document().getSecurityOrigin()); Feature::Context effective_context_type = ClassifyJavaScriptContext( effective_extension, extension_group, ScriptContext::GetEffectiveDocumentURL(frame, frame_url, true), - frame->document().securityOrigin()); + frame->document().getSecurityOrigin()); ScriptContext* context = new ScriptContext(v8_context, frame, extension, context_type, diff --git a/media/blink/webencryptedmediaclient_impl.cc b/media/blink/webencryptedmediaclient_impl.cc index abf9eff..8d2aa2e 100644 --- a/media/blink/webencryptedmediaclient_impl.cc +++ b/media/blink/webencryptedmediaclient_impl.cc @@ -102,12 +102,12 @@ void WebEncryptedMediaClientImpl::requestMediaKeySystemAccess( if (GetMediaClient()) { GURL security_origin( - blink::WebStringToGURL(request.securityOrigin().toString())); + blink::WebStringToGURL(request.getSecurityOrigin().toString())); GetMediaClient()->RecordRapporURL("Media.OriginUrl.EME", security_origin); blink::WebString error_message; - if (!request.securityOrigin().isPotentiallyTrustworthy(error_message)) { + if (!request.getSecurityOrigin().isPotentiallyTrustworthy(error_message)) { GetMediaClient()->RecordRapporURL("Media.OriginUrl.EME.Insecure", security_origin); } @@ -115,7 +115,7 @@ void WebEncryptedMediaClientImpl::requestMediaKeySystemAccess( key_system_config_selector_.SelectConfig( request.keySystem(), request.supportedConfigurations(), - request.securityOrigin(), are_secure_codecs_supported_cb_.Run(), + request.getSecurityOrigin(), are_secure_codecs_supported_cb_.Run(), base::Bind(&WebEncryptedMediaClientImpl::OnRequestSucceeded, weak_factory_.GetWeakPtr(), request), base::Bind(&WebEncryptedMediaClientImpl::OnRequestNotSupported, @@ -139,8 +139,8 @@ void WebEncryptedMediaClientImpl::OnRequestSucceeded( // TODO(sandersd): Pass |are_secure_codecs_required| along and use it to // configure the CDM security level and use of secure surfaces on Android. request.requestSucceeded(WebContentDecryptionModuleAccessImpl::Create( - request.keySystem(), request.securityOrigin(), accumulated_configuration, - cdm_config, weak_factory_.GetWeakPtr())); + request.keySystem(), request.getSecurityOrigin(), + accumulated_configuration, cdm_config, weak_factory_.GetWeakPtr())); } void WebEncryptedMediaClientImpl::OnRequestNotSupported( diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc index 96f787e..071e70e 100644 --- a/media/blink/webmediaplayer_impl.cc +++ b/media/blink/webmediaplayer_impl.cc @@ -282,7 +282,7 @@ void WebMediaPlayerImpl::DoLoad(LoadType load_type, DCHECK(main_task_runner_->BelongsToCurrentThread()); GURL gurl(url); - ReportMetrics(load_type, gurl, frame_->document().securityOrigin()); + ReportMetrics(load_type, gurl, frame_->document().getSecurityOrigin()); // Set subresource URL for crash reporting. base::debug::SetCrashKeyValue("subresource_url", gurl.spec()); @@ -1270,7 +1270,7 @@ void WebMediaPlayerImpl::SetReadyState(WebMediaPlayer::ReadyState state) { client_->readyStateChanged(); } -blink::WebAudioSourceProvider* WebMediaPlayerImpl::audioSourceProvider() { +blink::WebAudioSourceProvider* WebMediaPlayerImpl::getAudioSourceProvider() { return audio_source_provider_.get(); } diff --git a/media/blink/webmediaplayer_impl.h b/media/blink/webmediaplayer_impl.h index 9cba070..0dd640d 100644 --- a/media/blink/webmediaplayer_impl.h +++ b/media/blink/webmediaplayer_impl.h @@ -158,7 +158,7 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl bool premultiply_alpha, bool flip_y) override; - blink::WebAudioSourceProvider* audioSourceProvider() override; + blink::WebAudioSourceProvider* getAudioSourceProvider() override; void setContentDecryptionModule( blink::WebContentDecryptionModule* cdm, diff --git a/third_party/WebKit/Source/bindings/core/v8/ActiveDOMCallback.cpp b/third_party/WebKit/Source/bindings/core/v8/ActiveDOMCallback.cpp index 7ad6a7a..b0b057b 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ActiveDOMCallback.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ActiveDOMCallback.cpp @@ -47,13 +47,13 @@ ActiveDOMCallback::~ActiveDOMCallback() bool ActiveDOMCallback::canInvokeCallback() const { - ExecutionContext* context = executionContext(); + ExecutionContext* context = getExecutionContext(); return context && !context->activeDOMObjectsAreSuspended() && !context->activeDOMObjectsAreStopped(); } bool ActiveDOMCallback::isScriptControllerTerminating() const { - ExecutionContext* context = executionContext(); + ExecutionContext* context = getExecutionContext(); if (context && context->isWorkerGlobalScope()) { WorkerOrWorkletScriptController* scriptController = toWorkerGlobalScope(context)->scriptController(); if (!scriptController || scriptController->isExecutionForbidden() || scriptController->isExecutionTerminating()) diff --git a/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp b/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp index 66d06a05..a9f64e9 100644 --- a/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp @@ -42,7 +42,7 @@ namespace blink { static bool isOriginAccessibleFromDOMWindow(const SecurityOrigin* targetOrigin, const LocalDOMWindow* accessingWindow) { - return accessingWindow && accessingWindow->document()->securityOrigin()->canAccessCheckSuborigins(targetOrigin); + return accessingWindow && accessingWindow->document()->getSecurityOrigin()->canAccessCheckSuborigins(targetOrigin); } static bool canAccessFrame(v8::Isolate* isolate, const LocalDOMWindow* accessingWindow, const SecurityOrigin* targetFrameOrigin, const DOMWindow* targetWindow, ExceptionState& exceptionState) @@ -75,7 +75,7 @@ bool BindingSecurity::shouldAllowAccessTo(v8::Isolate* isolate, const LocalDOMWi const Frame* frame = target->frame(); if (!frame || !frame->securityContext()) return false; - return canAccessFrame(isolate, accessingWindow, frame->securityContext()->securityOrigin(), target, exceptionState); + return canAccessFrame(isolate, accessingWindow, frame->securityContext()->getSecurityOrigin(), target, exceptionState); } bool BindingSecurity::shouldAllowAccessTo(v8::Isolate* isolate, const LocalDOMWindow* accessingWindow, const DOMWindow* target, SecurityReportingOption reportingOption) @@ -84,7 +84,7 @@ bool BindingSecurity::shouldAllowAccessTo(v8::Isolate* isolate, const LocalDOMWi const Frame* frame = target->frame(); if (!frame || !frame->securityContext()) return false; - return canAccessFrame(isolate, accessingWindow, frame->securityContext()->securityOrigin(), target, reportingOption); + return canAccessFrame(isolate, accessingWindow, frame->securityContext()->getSecurityOrigin(), target, reportingOption); } bool BindingSecurity::shouldAllowAccessTo(v8::Isolate* isolate, const LocalDOMWindow* accessingWindow, const EventTarget* target, ExceptionState& exceptionState) @@ -100,7 +100,7 @@ bool BindingSecurity::shouldAllowAccessTo(v8::Isolate* isolate, const LocalDOMWi const Frame* frame = window->frame(); if (!frame || !frame->securityContext()) return false; - return canAccessFrame(isolate, accessingWindow, frame->securityContext()->securityOrigin(), window, exceptionState); + return canAccessFrame(isolate, accessingWindow, frame->securityContext()->getSecurityOrigin(), window, exceptionState); } bool BindingSecurity::shouldAllowAccessTo(v8::Isolate* isolate, const LocalDOMWindow* accessingWindow, const Location* target, ExceptionState& exceptionState) @@ -109,7 +109,7 @@ bool BindingSecurity::shouldAllowAccessTo(v8::Isolate* isolate, const LocalDOMWi const Frame* frame = target->frame(); if (!frame || !frame->securityContext()) return false; - return canAccessFrame(isolate, accessingWindow, frame->securityContext()->securityOrigin(), frame->domWindow(), exceptionState); + return canAccessFrame(isolate, accessingWindow, frame->securityContext()->getSecurityOrigin(), frame->domWindow(), exceptionState); } bool BindingSecurity::shouldAllowAccessTo(v8::Isolate* isolate, const LocalDOMWindow* accessingWindow, const Location* target, SecurityReportingOption reportingOption) @@ -118,28 +118,28 @@ bool BindingSecurity::shouldAllowAccessTo(v8::Isolate* isolate, const LocalDOMWi const Frame* frame = target->frame(); if (!frame || !frame->securityContext()) return false; - return canAccessFrame(isolate, accessingWindow, frame->securityContext()->securityOrigin(), frame->domWindow(), reportingOption); + return canAccessFrame(isolate, accessingWindow, frame->securityContext()->getSecurityOrigin(), frame->domWindow(), reportingOption); } bool BindingSecurity::shouldAllowAccessTo(v8::Isolate* isolate, const LocalDOMWindow* accessingWindow, const Node* target, ExceptionState& exceptionState) { if (!target) return false; - return canAccessFrame(isolate, accessingWindow, target->document().securityOrigin(), target->document().domWindow(), exceptionState); + return canAccessFrame(isolate, accessingWindow, target->document().getSecurityOrigin(), target->document().domWindow(), exceptionState); } bool BindingSecurity::shouldAllowAccessTo(v8::Isolate* isolate, const LocalDOMWindow* accessingWindow, const Node* target, SecurityReportingOption reportingOption) { if (!target) return false; - return canAccessFrame(isolate, accessingWindow, target->document().securityOrigin(), target->document().domWindow(), reportingOption); + return canAccessFrame(isolate, accessingWindow, target->document().getSecurityOrigin(), target->document().domWindow(), reportingOption); } bool BindingSecurity::shouldAllowAccessToFrame(v8::Isolate* isolate, const LocalDOMWindow* accessingWindow, const Frame* target, SecurityReportingOption reportingOption) { if (!target || !target->securityContext()) return false; - return canAccessFrame(isolate, accessingWindow, target->securityContext()->securityOrigin(), target->domWindow(), reportingOption); + return canAccessFrame(isolate, accessingWindow, target->securityContext()->getSecurityOrigin(), target->domWindow(), reportingOption); } } // namespace blink diff --git a/third_party/WebKit/Source/bindings/core/v8/CallbackPromiseAdapter.h b/third_party/WebKit/Source/bindings/core/v8/CallbackPromiseAdapter.h index 3ec99b3..baabc3c 100644 --- a/third_party/WebKit/Source/bindings/core/v8/CallbackPromiseAdapter.h +++ b/third_party/WebKit/Source/bindings/core/v8/CallbackPromiseAdapter.h @@ -160,7 +160,7 @@ private: { typename S::WebType result(adopt(r)); ScriptPromiseResolver* resolver = this->resolver(); - if (!resolver->executionContext() || resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!resolver->getExecutionContext() || resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; resolver->resolve(S::take(resolver, pass(result))); } @@ -172,7 +172,7 @@ private: void onSuccess() override { ScriptPromiseResolver* resolver = this->resolver(); - if (!resolver->executionContext() || resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!resolver->getExecutionContext() || resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; resolver->resolve(); } @@ -185,7 +185,7 @@ private: { typename T::WebType result(adopt(e)); ScriptPromiseResolver* resolver = this->resolver(); - if (!resolver->executionContext() || resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!resolver->getExecutionContext() || resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; resolver->reject(T::take(resolver, pass(result))); } @@ -197,7 +197,7 @@ private: void onError() override { ScriptPromiseResolver* resolver = this->resolver(); - if (!resolver->executionContext() || resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!resolver->getExecutionContext() || resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; resolver->reject(); } diff --git a/third_party/WebKit/Source/bindings/core/v8/ExceptionState.cpp b/third_party/WebKit/Source/bindings/core/v8/ExceptionState.cpp index a2a79c2..191f03d 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ExceptionState.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ExceptionState.cpp @@ -52,7 +52,7 @@ ScriptPromise ExceptionState::reject(ScriptState* scriptState) void ExceptionState::reject(ScriptPromiseResolver* resolver) { - resolver->reject(m_exception.newLocal(resolver->scriptState()->isolate())); + resolver->reject(m_exception.newLocal(resolver->getScriptState()->isolate())); clearException(); } diff --git a/third_party/WebKit/Source/bindings/core/v8/Iterable.h b/third_party/WebKit/Source/bindings/core/v8/Iterable.h index e91c67b..e493adb 100644 --- a/third_party/WebKit/Source/bindings/core/v8/Iterable.h +++ b/third_party/WebKit/Source/bindings/core/v8/Iterable.h @@ -71,7 +71,7 @@ public: } v8::Local<v8::Value> result; - if (!V8ScriptRunner::callFunction(v8Callback, scriptState->executionContext(), v8ThisArg, 3, args, isolate).ToLocal(&result)) { + if (!V8ScriptRunner::callFunction(v8Callback, scriptState->getExecutionContext(), v8ThisArg, 3, args, isolate).ToLocal(&result)) { exceptionState.rethrowV8Exception(tryCatch.Exception()); return; } diff --git a/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp b/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp index 5351df6..5dd9f1c 100644 --- a/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp @@ -162,7 +162,7 @@ static v8::Local<v8::Value> installPrivateScriptRunner(v8::Isolate* isolate) static v8::Local<v8::Object> classObjectOfPrivateScript(ScriptState* scriptState, String className) { ASSERT(scriptState->perContextData()); - ASSERT(scriptState->executionContext()); + ASSERT(scriptState->getExecutionContext()); v8::Isolate* isolate = scriptState->isolate(); v8::Local<v8::Value> compiledClass = scriptState->perContextData()->compiledPrivateScript(className); if (compiledClass.IsEmpty()) { @@ -196,7 +196,7 @@ static void initializeHolderIfNeeded(ScriptState* scriptState, v8::Local<v8::Obj if (classObject->Get(scriptState->context(), v8String(isolate, "initialize")).ToLocal(&initializeFunction) && initializeFunction->IsFunction()) { v8::TryCatch block(isolate); v8::Local<v8::Value> result; - if (!V8ScriptRunner::callFunction(v8::Local<v8::Function>::Cast(initializeFunction), scriptState->executionContext(), holder, 0, 0, isolate).ToLocal(&result)) { + if (!V8ScriptRunner::callFunction(v8::Local<v8::Function>::Cast(initializeFunction), scriptState->getExecutionContext(), holder, 0, 0, isolate).ToLocal(&result)) { fprintf(stderr, "Private script error: Object constructor threw an exception.\n"); dumpV8Message(context, block.Message()); RELEASE_ASSERT_NOT_REACHED(); @@ -305,7 +305,7 @@ v8::Local<v8::Value> PrivateScriptRunner::runDOMAttributeGetter(ScriptState* scr initializeHolderIfNeeded(scriptState, classObject, holder); v8::TryCatch block(isolate); v8::Local<v8::Value> result; - if (!V8ScriptRunner::callFunction(v8::Local<v8::Function>::Cast(getter), scriptState->executionContext(), holder, 0, 0, isolate).ToLocal(&result)) { + if (!V8ScriptRunner::callFunction(v8::Local<v8::Function>::Cast(getter), scriptState->getExecutionContext(), holder, 0, 0, isolate).ToLocal(&result)) { rethrowExceptionInPrivateScript(isolate, block, scriptStateInUserScript, ExceptionState::GetterContext, attributeName, className); block.ReThrow(); return v8::Local<v8::Value>(); @@ -331,7 +331,7 @@ bool PrivateScriptRunner::runDOMAttributeSetter(ScriptState* scriptState, Script v8::Local<v8::Value> argv[] = { v8Value }; v8::TryCatch block(isolate); v8::Local<v8::Value> result; - if (!V8ScriptRunner::callFunction(v8::Local<v8::Function>::Cast(setter), scriptState->executionContext(), holder, WTF_ARRAY_LENGTH(argv), argv, isolate).ToLocal(&result)) { + if (!V8ScriptRunner::callFunction(v8::Local<v8::Function>::Cast(setter), scriptState->getExecutionContext(), holder, WTF_ARRAY_LENGTH(argv), argv, isolate).ToLocal(&result)) { rethrowExceptionInPrivateScript(isolate, block, scriptStateInUserScript, ExceptionState::SetterContext, attributeName, className); block.ReThrow(); return false; @@ -350,7 +350,7 @@ v8::Local<v8::Value> PrivateScriptRunner::runDOMMethod(ScriptState* scriptState, initializeHolderIfNeeded(scriptState, classObject, holder); v8::TryCatch block(scriptState->isolate()); v8::Local<v8::Value> result; - if (!V8ScriptRunner::callFunction(v8::Local<v8::Function>::Cast(method), scriptState->executionContext(), holder, argc, argv, scriptState->isolate()).ToLocal(&result)) { + if (!V8ScriptRunner::callFunction(v8::Local<v8::Function>::Cast(method), scriptState->getExecutionContext(), holder, argc, argv, scriptState->isolate()).ToLocal(&result)) { rethrowExceptionInPrivateScript(scriptState->isolate(), block, scriptStateInUserScript, ExceptionState::ExecutionContext, methodName, className); block.ReThrow(); return v8::Local<v8::Value>(); diff --git a/third_party/WebKit/Source/bindings/core/v8/ReadableStreamOperationsTest.cpp b/third_party/WebKit/Source/bindings/core/v8/ReadableStreamOperationsTest.cpp index 49ddfe5..ba889fe 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ReadableStreamOperationsTest.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ReadableStreamOperationsTest.cpp @@ -59,10 +59,10 @@ public: { ASSERT(!v.isEmpty()); m_isSet = true; - v8::TryCatch block(v.scriptState()->isolate()); + v8::TryCatch block(v.getScriptState()->isolate()); v8::Local<v8::Value> value; v8::Local<v8::Value> item = v.v8Value(); - if (!item->IsObject() || !v8Call(v8UnpackIteratorResult(v.scriptState(), item.As<v8::Object>(), &m_isDone), value)) { + if (!item->IsObject() || !v8Call(v8UnpackIteratorResult(v.getScriptState(), item.As<v8::Object>(), &m_isDone), value)) { m_isValid = false; return; } @@ -134,7 +134,7 @@ public: , m_block(isolate()) , m_document(Document::create()) { - scriptState()->setExecutionContext(m_document.get()); + getScriptState()->setExecutionContext(m_document.get()); } ~ReadableStreamOperationsTest() override { @@ -143,8 +143,8 @@ public: EXPECT_FALSE(m_block.HasCaught()); } - ScriptState* scriptState() const { return m_scope.scriptState(); } - v8::Isolate* isolate() const { return scriptState()->isolate(); } + ScriptState* getScriptState() const { return m_scope.getScriptState(); } + v8::Isolate* isolate() const { return getScriptState()->isolate(); } ScriptValue eval(const char* s) { @@ -155,11 +155,11 @@ public: ADD_FAILURE(); return ScriptValue(); } - if (!v8Call(v8::Script::Compile(scriptState()->context(), source), script)) { + if (!v8Call(v8::Script::Compile(getScriptState()->context(), source), script)) { ADD_FAILURE() << "Compilation fails"; return ScriptValue(); } - return ScriptValue(scriptState(), script->Run(scriptState()->context())); + return ScriptValue(getScriptState(), script->Run(getScriptState()->context())); } ScriptValue evalWithPrintingError(const char* s) { @@ -179,23 +179,23 @@ public: TEST_F(ReadableStreamOperationsTest, IsReadableStream) { - EXPECT_FALSE(ReadableStreamOperations::isReadableStream(scriptState(), ScriptValue(scriptState(), v8::Undefined(isolate())))); - EXPECT_FALSE(ReadableStreamOperations::isReadableStream(scriptState(), ScriptValue::createNull(scriptState()))); - EXPECT_FALSE(ReadableStreamOperations::isReadableStream(scriptState(), ScriptValue(scriptState(), v8::Object::New(isolate())))); + EXPECT_FALSE(ReadableStreamOperations::isReadableStream(getScriptState(), ScriptValue(getScriptState(), v8::Undefined(isolate())))); + EXPECT_FALSE(ReadableStreamOperations::isReadableStream(getScriptState(), ScriptValue::createNull(getScriptState()))); + EXPECT_FALSE(ReadableStreamOperations::isReadableStream(getScriptState(), ScriptValue(getScriptState(), v8::Object::New(isolate())))); ScriptValue stream = evalWithPrintingError("new ReadableStream()"); EXPECT_FALSE(stream.isEmpty()); - EXPECT_TRUE(ReadableStreamOperations::isReadableStream(scriptState(), stream)); + EXPECT_TRUE(ReadableStreamOperations::isReadableStream(getScriptState(), stream)); } TEST_F(ReadableStreamOperationsTest, IsReadableStreamReaderInvalid) { - EXPECT_FALSE(ReadableStreamOperations::isReadableStreamReader(scriptState(), ScriptValue(scriptState(), v8::Undefined(isolate())))); - EXPECT_FALSE(ReadableStreamOperations::isReadableStreamReader(scriptState(), ScriptValue::createNull(scriptState()))); - EXPECT_FALSE(ReadableStreamOperations::isReadableStreamReader(scriptState(), ScriptValue(scriptState(), v8::Object::New(isolate())))); + EXPECT_FALSE(ReadableStreamOperations::isReadableStreamReader(getScriptState(), ScriptValue(getScriptState(), v8::Undefined(isolate())))); + EXPECT_FALSE(ReadableStreamOperations::isReadableStreamReader(getScriptState(), ScriptValue::createNull(getScriptState()))); + EXPECT_FALSE(ReadableStreamOperations::isReadableStreamReader(getScriptState(), ScriptValue(getScriptState(), v8::Object::New(isolate())))); ScriptValue stream = evalWithPrintingError("new ReadableStream()"); EXPECT_FALSE(stream.isEmpty()); - EXPECT_FALSE(ReadableStreamOperations::isReadableStreamReader(scriptState(), stream)); + EXPECT_FALSE(ReadableStreamOperations::isReadableStreamReader(getScriptState(), stream)); } TEST_F(ReadableStreamOperationsTest, GetReader) @@ -203,23 +203,23 @@ TEST_F(ReadableStreamOperationsTest, GetReader) ScriptValue stream = evalWithPrintingError("new ReadableStream()"); EXPECT_FALSE(stream.isEmpty()); - EXPECT_FALSE(ReadableStreamOperations::isLocked(scriptState(), stream)); + EXPECT_FALSE(ReadableStreamOperations::isLocked(getScriptState(), stream)); ScriptValue reader; { TrackExceptionState es; - reader = ReadableStreamOperations::getReader(scriptState(), stream, es); + reader = ReadableStreamOperations::getReader(getScriptState(), stream, es); ASSERT_FALSE(es.hadException()); } - EXPECT_TRUE(ReadableStreamOperations::isLocked(scriptState(), stream)); + EXPECT_TRUE(ReadableStreamOperations::isLocked(getScriptState(), stream)); ASSERT_FALSE(reader.isEmpty()); - EXPECT_FALSE(ReadableStreamOperations::isReadableStream(scriptState(), reader)); - EXPECT_TRUE(ReadableStreamOperations::isReadableStreamReader(scriptState(), reader)); + EXPECT_FALSE(ReadableStreamOperations::isReadableStream(getScriptState(), reader)); + EXPECT_TRUE(ReadableStreamOperations::isReadableStreamReader(getScriptState(), reader)); // Already locked! { TrackExceptionState es; - reader = ReadableStreamOperations::getReader(scriptState(), stream, es); + reader = ReadableStreamOperations::getReader(getScriptState(), stream, es); ASSERT_TRUE(es.hadException()); } ASSERT_TRUE(reader.isEmpty()); @@ -230,11 +230,11 @@ TEST_F(ReadableStreamOperationsTest, IsDisturbed) ScriptValue stream = evalWithPrintingError("stream = new ReadableStream()"); EXPECT_FALSE(stream.isEmpty()); - EXPECT_FALSE(ReadableStreamOperations::isDisturbed(scriptState(), stream)); + EXPECT_FALSE(ReadableStreamOperations::isDisturbed(getScriptState(), stream)); ASSERT_FALSE(evalWithPrintingError("stream.cancel()").isEmpty()); - EXPECT_TRUE(ReadableStreamOperations::isDisturbed(scriptState(), stream)); + EXPECT_TRUE(ReadableStreamOperations::isDisturbed(getScriptState(), stream)); } TEST_F(ReadableStreamOperationsTest, Read) @@ -244,16 +244,16 @@ TEST_F(ReadableStreamOperationsTest, Read) "function start(c) { controller = c; }" "new ReadableStream({start}).getReader()"); EXPECT_FALSE(reader.isEmpty()); - ASSERT_TRUE(ReadableStreamOperations::isReadableStreamReader(scriptState(), reader)); + ASSERT_TRUE(ReadableStreamOperations::isReadableStreamReader(getScriptState(), reader)); Iteration* it1 = new Iteration(); Iteration* it2 = new Iteration(); - ReadableStreamOperations::read(scriptState(), reader).then( - Function::createFunction(scriptState(), it1), - NotReached::createFunction(scriptState())); - ReadableStreamOperations::read(scriptState(), reader).then( - Function::createFunction(scriptState(), it2), - NotReached::createFunction(scriptState())); + ReadableStreamOperations::read(getScriptState(), reader).then( + Function::createFunction(getScriptState(), it1), + NotReached::createFunction(getScriptState())); + ReadableStreamOperations::read(getScriptState(), reader).then( + Function::createFunction(getScriptState(), it2), + NotReached::createFunction(getScriptState())); v8::MicrotasksScope::PerformCheckpoint(isolate()); EXPECT_FALSE(it1->isSet()); @@ -280,26 +280,26 @@ TEST_F(ReadableStreamOperationsTest, Read) TEST_F(ReadableStreamOperationsTest, CreateReadableStreamWithCustomUnderlyingSourceAndStrategy) { - auto underlyingSource = new TestUnderlyingSource(scriptState()); + auto underlyingSource = new TestUnderlyingSource(getScriptState()); - ScriptValue strategy = ReadableStreamOperations::createCountQueuingStrategy(scriptState(), 10); + ScriptValue strategy = ReadableStreamOperations::createCountQueuingStrategy(getScriptState(), 10); ASSERT_FALSE(strategy.isEmpty()); - ScriptValue stream = ReadableStreamOperations::createReadableStream(scriptState(), underlyingSource, strategy); + ScriptValue stream = ReadableStreamOperations::createReadableStream(getScriptState(), underlyingSource, strategy); ASSERT_FALSE(stream.isEmpty()); EXPECT_EQ(10, underlyingSource->desiredSize()); - underlyingSource->enqueue(ScriptValue::from(scriptState(), "a")); + underlyingSource->enqueue(ScriptValue::from(getScriptState(), "a")); EXPECT_EQ(9, underlyingSource->desiredSize()); - underlyingSource->enqueue(ScriptValue::from(scriptState(), "b")); + underlyingSource->enqueue(ScriptValue::from(getScriptState(), "b")); EXPECT_EQ(8, underlyingSource->desiredSize()); ScriptValue reader; { TrackExceptionState es; - reader = ReadableStreamOperations::getReader(scriptState(), stream, es); + reader = ReadableStreamOperations::getReader(getScriptState(), stream, es); ASSERT_FALSE(es.hadException()); } ASSERT_FALSE(reader.isEmpty()); @@ -307,9 +307,9 @@ TEST_F(ReadableStreamOperationsTest, CreateReadableStreamWithCustomUnderlyingSou Iteration* it1 = new Iteration(); Iteration* it2 = new Iteration(); Iteration* it3 = new Iteration(); - ReadableStreamOperations::read(scriptState(), reader).then(Function::createFunction(scriptState(), it1), NotReached::createFunction(scriptState())); - ReadableStreamOperations::read(scriptState(), reader).then(Function::createFunction(scriptState(), it2), NotReached::createFunction(scriptState())); - ReadableStreamOperations::read(scriptState(), reader).then(Function::createFunction(scriptState(), it3), NotReached::createFunction(scriptState())); + ReadableStreamOperations::read(getScriptState(), reader).then(Function::createFunction(getScriptState(), it1), NotReached::createFunction(getScriptState())); + ReadableStreamOperations::read(getScriptState(), reader).then(Function::createFunction(getScriptState(), it2), NotReached::createFunction(getScriptState())); + ReadableStreamOperations::read(getScriptState(), reader).then(Function::createFunction(getScriptState(), it3), NotReached::createFunction(getScriptState())); v8::MicrotasksScope::PerformCheckpoint(isolate()); diff --git a/third_party/WebKit/Source/bindings/core/v8/RejectedPromises.cpp b/third_party/WebKit/Source/bindings/core/v8/RejectedPromises.cpp index 8b075ca4..60cc07d 100644 --- a/third_party/WebKit/Source/bindings/core/v8/RejectedPromises.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/RejectedPromises.cpp @@ -50,7 +50,7 @@ public: // If execution termination has been triggered, quietly bail out. if (m_scriptState->isolate()->IsExecutionTerminating()) return; - ExecutionContext* executionContext = m_scriptState->executionContext(); + ExecutionContext* executionContext = m_scriptState->getExecutionContext(); if (!executionContext) return; @@ -99,7 +99,7 @@ public: void revoke() { - ExecutionContext* executionContext = m_scriptState->executionContext(); + ExecutionContext* executionContext = m_scriptState->getExecutionContext(); if (!executionContext) return; diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp index daa0565..c14bd9f 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp @@ -468,7 +468,7 @@ bool ScriptController::canExecuteScripts(ReasonForCallingCanExecuteScripts reaso } if (frame()->document() && frame()->document()->isViewSource()) { - ASSERT(frame()->document()->securityOrigin()->isUnique()); + ASSERT(frame()->document()->getSecurityOrigin()->isUnique()); return true; } @@ -585,7 +585,7 @@ void ScriptController::executeScriptInIsolatedWorld(int worldID, const WillBeHea if (!isolatedWorldWindowProxy->isContextInitialized()) return; - ScriptState* scriptState = isolatedWorldWindowProxy->scriptState(); + ScriptState* scriptState = isolatedWorldWindowProxy->getScriptState(); v8::Context::Scope scope(scriptState->context()); v8::Local<v8::Array> resultArray = v8::Array::New(isolate(), sources.size()); diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptFunction.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptFunction.cpp index 3e6b096..41d5aac 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptFunction.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptFunction.cpp @@ -20,7 +20,7 @@ void ScriptFunction::callCallback(const v8::FunctionCallbackInfo<v8::Value>& arg { ASSERT(args.Data()->IsExternal()); ScriptFunction* scriptFunction = static_cast<ScriptFunction*>(v8::Local<v8::External>::Cast(args.Data())->Value()); - ScriptValue result = scriptFunction->call(ScriptValue(scriptFunction->scriptState(), args[0])); + ScriptValue result = scriptFunction->call(ScriptValue(scriptFunction->getScriptState(), args[0])); v8SetReturnValue(args, result.v8Value()); } diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptFunction.h b/third_party/WebKit/Source/bindings/core/v8/ScriptFunction.h index 0ffe709..2159275 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptFunction.h +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptFunction.h @@ -53,7 +53,7 @@ namespace blink { class CORE_EXPORT ScriptFunction : public GarbageCollectedFinalized<ScriptFunction> { public: virtual ~ScriptFunction() { } - ScriptState* scriptState() const { return m_scriptState.get(); } + ScriptState* getScriptState() const { return m_scriptState.get(); } DEFINE_INLINE_VIRTUAL_TRACE() { } protected: diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptPromise.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptPromise.cpp index b3a198b..e473714 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromise.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromise.cpp @@ -174,7 +174,7 @@ ScriptPromise ScriptPromise::InternalResolver::promise() const { if (m_resolver.isEmpty()) return ScriptPromise(); - return ScriptPromise(m_resolver.scriptState(), v8Promise()); + return ScriptPromise(m_resolver.getScriptState(), v8Promise()); } void ScriptPromise::InternalResolver::resolve(v8::Local<v8::Value> value) diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseProperty.h b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseProperty.h index 73d270e..61679bc 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseProperty.h +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseProperty.h @@ -96,7 +96,7 @@ void ScriptPromiseProperty<HolderType, ResolvedType, RejectedType>::resolve(Pass ASSERT_NOT_REACHED(); return; } - if (!executionContext() || executionContext()->activeDOMObjectsAreStopped()) + if (!getExecutionContext() || getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolved = value; resolveOrReject(Resolved); @@ -110,7 +110,7 @@ void ScriptPromiseProperty<HolderType, ResolvedType, RejectedType>::reject(PassR ASSERT_NOT_REACHED(); return; } - if (!executionContext() || executionContext()->activeDOMObjectsAreStopped()) + if (!getExecutionContext() || getExecutionContext()->activeDOMObjectsAreStopped()) return; m_rejected = value; resolveOrReject(Rejected); diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyBase.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyBase.cpp index c355d76..edd1331 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyBase.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyBase.cpp @@ -32,11 +32,11 @@ static void clearHandle(const v8::WeakCallbackInfo<ScopedPersistent<v8::Object>> ScriptPromise ScriptPromisePropertyBase::promise(DOMWrapperWorld& world) { - if (!executionContext()) + if (!getExecutionContext()) return ScriptPromise(); v8::HandleScope handleScope(m_isolate); - v8::Local<v8::Context> context = toV8Context(executionContext(), world); + v8::Local<v8::Context> context = toV8Context(getExecutionContext(), world); if (context.IsEmpty()) return ScriptPromise(); ScriptState* scriptState = ScriptState::from(context); @@ -72,7 +72,7 @@ ScriptPromise ScriptPromisePropertyBase::promise(DOMWrapperWorld& world) void ScriptPromisePropertyBase::resolveOrReject(State targetState) { - ASSERT(executionContext()); + ASSERT(getExecutionContext()); ASSERT(m_state == Pending); ASSERT(targetState == Resolved || targetState == Rejected); diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyTest.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyTest.cpp index f6601dd..98e0bc0 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyTest.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromisePropertyTest.cpp @@ -369,7 +369,7 @@ TEST_F(ScriptPromisePropertyGarbageCollectedTest, Resolve_DeadContext) } destroyContext(); - EXPECT_TRUE(!property()->executionContext() || property()->executionContext()->activeDOMObjectsAreStopped()); + EXPECT_TRUE(!property()->getExecutionContext() || property()->getExecutionContext()->activeDOMObjectsAreStopped()); property()->resolve(new GarbageCollectedScriptWrappable("value")); EXPECT_EQ(Property::Pending, property()->getState()); diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.cpp index bc0ba8d..c673c46 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.cpp @@ -7,7 +7,7 @@ namespace blink { ScriptPromiseResolver::ScriptPromiseResolver(ScriptState* scriptState) - : ActiveDOMObject(scriptState->executionContext()) + : ActiveDOMObject(scriptState->getExecutionContext()) , m_state(Pending) , m_scriptState(scriptState) , m_timer(this, &ScriptPromiseResolver::onTimerFired) @@ -16,7 +16,7 @@ ScriptPromiseResolver::ScriptPromiseResolver(ScriptState* scriptState) , m_isPromiseCalled(false) #endif { - if (executionContext()->activeDOMObjectsAreStopped()) { + if (getExecutionContext()->activeDOMObjectsAreStopped()) { m_state = Detached; m_resolver.clear(); } @@ -60,7 +60,7 @@ void ScriptPromiseResolver::keepAliveWhilePending() void ScriptPromiseResolver::onTimerFired(Timer<ScriptPromiseResolver>*) { ASSERT(m_state == Resolving || m_state == Rejecting); - if (!scriptState()->contextIsValid()) { + if (!getScriptState()->contextIsValid()) { detach(); return; } @@ -71,8 +71,8 @@ void ScriptPromiseResolver::onTimerFired(Timer<ScriptPromiseResolver>*) void ScriptPromiseResolver::resolveOrRejectImmediately() { - ASSERT(!executionContext()->activeDOMObjectsAreStopped()); - ASSERT(!executionContext()->activeDOMObjectsAreSuspended()); + ASSERT(!getExecutionContext()->activeDOMObjectsAreStopped()); + ASSERT(!getExecutionContext()->activeDOMObjectsAreSuspended()); { if (m_state == Resolving) { m_resolver.resolve(m_value.newLocal(m_scriptState->isolate())); diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.h b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.h index 11542e1..1a35e83 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.h +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.h @@ -38,7 +38,7 @@ public: } #if ENABLE(ASSERT) - // Eagerly finalized so as to ensure valid access to executionContext() + // Eagerly finalized so as to ensure valid access to getExecutionContext() // from the destructor's assert. EAGERLY_FINALIZE(); @@ -49,7 +49,7 @@ public: // - this resolver is destructed before it is resolved, rejected, // detached, the V8 isolate is terminated or the associated // ExecutionContext is stopped. - ASSERT(m_state == Detached || !m_isPromiseCalled || !scriptState()->contextIsValid() || !executionContext() || executionContext()->activeDOMObjectsAreStopped()); + ASSERT(m_state == Detached || !m_isPromiseCalled || !getScriptState()->contextIsValid() || !getExecutionContext() || getExecutionContext()->activeDOMObjectsAreStopped()); } #endif @@ -70,7 +70,7 @@ public: void resolve() { resolve(ToV8UndefinedGenerator()); } void reject() { reject(ToV8UndefinedGenerator()); } - ScriptState* scriptState() { return m_scriptState.get(); } + ScriptState* getScriptState() { return m_scriptState.get(); } // Note that an empty ScriptPromise will be returned after resolve or // reject is called. @@ -82,7 +82,7 @@ public: return m_resolver.promise(); } - ScriptState* scriptState() const { return m_scriptState.get(); } + ScriptState* getScriptState() const { return m_scriptState.get(); } // ActiveDOMObject implementation. void suspend() override; @@ -118,7 +118,7 @@ private: template<typename T> void resolveOrReject(T value, ResolutionState newState) { - if (m_state != Pending || !scriptState()->contextIsValid() || !executionContext() || executionContext()->activeDOMObjectsAreStopped()) + if (m_state != Pending || !getScriptState()->contextIsValid() || !getExecutionContext() || getExecutionContext()->activeDOMObjectsAreStopped()) return; ASSERT(newState == Resolving || newState == Rejecting); m_state = newState; @@ -128,7 +128,7 @@ private: m_scriptState->isolate(), toV8(value, m_scriptState->context()->Global(), m_scriptState->isolate())); - if (executionContext()->activeDOMObjectsAreSuspended()) { + if (getExecutionContext()->activeDOMObjectsAreSuspended()) { // Retain this object until it is actually resolved or rejected. keepAliveWhilePending(); return; diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolverTest.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolverTest.cpp index 1c946d9..23f2b2a 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolverTest.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolverTest.cpp @@ -38,7 +38,7 @@ private: ScriptValue call(ScriptValue value) override { ASSERT(!value.isEmpty()); - *m_value = toCoreString(value.v8Value()->ToString(scriptState()->context()).ToLocalChecked()); + *m_value = toCoreString(value.v8Value()->ToString(getScriptState()->context()).ToLocalChecked()); return value; } @@ -54,7 +54,7 @@ public: ~ScriptPromiseResolverTest() override { - ScriptState::Scope scope(scriptState()); + ScriptState::Scope scope(getScriptState()); // FIXME: We put this statement here to clear an exception from the // isolate. createClosure(callback, v8::Undefined(isolate()), isolate()); @@ -64,16 +64,16 @@ public: } OwnPtr<DummyPageHolder> m_pageHolder; - ScriptState* scriptState() const { return ScriptState::forMainWorld(&m_pageHolder->frame()); } - ExecutionContext* executionContext() const { return &m_pageHolder->document(); } - v8::Isolate* isolate() const { return scriptState()->isolate(); } + ScriptState* getScriptState() const { return ScriptState::forMainWorld(&m_pageHolder->frame()); } + ExecutionContext* getExecutionContext() const { return &m_pageHolder->document(); } + v8::Isolate* isolate() const { return getScriptState()->isolate(); } }; TEST_F(ScriptPromiseResolverTest, construct) { - ASSERT_FALSE(executionContext()->activeDOMObjectsAreStopped()); - ScriptState::Scope scope(scriptState()); - ScriptPromiseResolver::create(scriptState()); + ASSERT_FALSE(getExecutionContext()->activeDOMObjectsAreStopped()); + ScriptState::Scope scope(getScriptState()); + ScriptPromiseResolver::create(getScriptState()); } TEST_F(ScriptPromiseResolverTest, resolve) @@ -81,16 +81,16 @@ TEST_F(ScriptPromiseResolverTest, resolve) ScriptPromiseResolver* resolver = nullptr; ScriptPromise promise; { - ScriptState::Scope scope(scriptState()); - resolver = ScriptPromiseResolver::create(scriptState()); + ScriptState::Scope scope(getScriptState()); + resolver = ScriptPromiseResolver::create(getScriptState()); promise = resolver->promise(); } String onFulfilled, onRejected; ASSERT_FALSE(promise.isEmpty()); { - ScriptState::Scope scope(scriptState()); - promise.then(Function::createFunction(scriptState(), &onFulfilled), Function::createFunction(scriptState(), &onRejected)); + ScriptState::Scope scope(getScriptState()); + promise.then(Function::createFunction(getScriptState(), &onFulfilled), Function::createFunction(getScriptState(), &onRejected)); } EXPECT_EQ(String(), onFulfilled); @@ -104,7 +104,7 @@ TEST_F(ScriptPromiseResolverTest, resolve) resolver->resolve("hello"); { - ScriptState::Scope scope(scriptState()); + ScriptState::Scope scope(getScriptState()); EXPECT_TRUE(resolver->promise().isEmpty()); } @@ -129,16 +129,16 @@ TEST_F(ScriptPromiseResolverTest, reject) ScriptPromiseResolver* resolver = nullptr; ScriptPromise promise; { - ScriptState::Scope scope(scriptState()); - resolver = ScriptPromiseResolver::create(scriptState()); + ScriptState::Scope scope(getScriptState()); + resolver = ScriptPromiseResolver::create(getScriptState()); promise = resolver->promise(); } String onFulfilled, onRejected; ASSERT_FALSE(promise.isEmpty()); { - ScriptState::Scope scope(scriptState()); - promise.then(Function::createFunction(scriptState(), &onFulfilled), Function::createFunction(scriptState(), &onRejected)); + ScriptState::Scope scope(getScriptState()); + promise.then(Function::createFunction(getScriptState(), &onFulfilled), Function::createFunction(getScriptState(), &onRejected)); } EXPECT_EQ(String(), onFulfilled); @@ -152,7 +152,7 @@ TEST_F(ScriptPromiseResolverTest, reject) resolver->reject("hello"); { - ScriptState::Scope scope(scriptState()); + ScriptState::Scope scope(getScriptState()); EXPECT_TRUE(resolver->promise().isEmpty()); } @@ -177,21 +177,21 @@ TEST_F(ScriptPromiseResolverTest, stop) ScriptPromiseResolver* resolver = nullptr; ScriptPromise promise; { - ScriptState::Scope scope(scriptState()); - resolver = ScriptPromiseResolver::create(scriptState()); + ScriptState::Scope scope(getScriptState()); + resolver = ScriptPromiseResolver::create(getScriptState()); promise = resolver->promise(); } String onFulfilled, onRejected; ASSERT_FALSE(promise.isEmpty()); { - ScriptState::Scope scope(scriptState()); - promise.then(Function::createFunction(scriptState(), &onFulfilled), Function::createFunction(scriptState(), &onRejected)); + ScriptState::Scope scope(getScriptState()); + promise.then(Function::createFunction(getScriptState(), &onFulfilled), Function::createFunction(getScriptState(), &onRejected)); } - executionContext()->stopActiveDOMObjects(); + getExecutionContext()->stopActiveDOMObjects(); { - ScriptState::Scope scope(scriptState()); + ScriptState::Scope scope(getScriptState()); EXPECT_TRUE(resolver->promise().isEmpty()); } @@ -235,8 +235,8 @@ TEST_F(ScriptPromiseResolverTest, keepAliveUntilResolved) ScriptPromiseResolverKeepAlive::reset(); ScriptPromiseResolver* resolver = nullptr; { - ScriptState::Scope scope(scriptState()); - resolver = ScriptPromiseResolverKeepAlive::create(scriptState()); + ScriptState::Scope scope(getScriptState()); + resolver = ScriptPromiseResolverKeepAlive::create(getScriptState()); } resolver->keepAliveWhilePending(); Heap::collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep, BlinkGC::ForcedGC); @@ -252,8 +252,8 @@ TEST_F(ScriptPromiseResolverTest, keepAliveUntilRejected) ScriptPromiseResolverKeepAlive::reset(); ScriptPromiseResolver* resolver = nullptr; { - ScriptState::Scope scope(scriptState()); - resolver = ScriptPromiseResolverKeepAlive::create(scriptState()); + ScriptState::Scope scope(getScriptState()); + resolver = ScriptPromiseResolverKeepAlive::create(getScriptState()); } resolver->keepAliveWhilePending(); Heap::collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep, BlinkGC::ForcedGC); @@ -269,14 +269,14 @@ TEST_F(ScriptPromiseResolverTest, keepAliveUntilStopped) ScriptPromiseResolverKeepAlive::reset(); ScriptPromiseResolver* resolver = nullptr; { - ScriptState::Scope scope(scriptState()); - resolver = ScriptPromiseResolverKeepAlive::create(scriptState()); + ScriptState::Scope scope(getScriptState()); + resolver = ScriptPromiseResolverKeepAlive::create(getScriptState()); } resolver->keepAliveWhilePending(); Heap::collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep, BlinkGC::ForcedGC); EXPECT_TRUE(ScriptPromiseResolverKeepAlive::isAlive()); - executionContext()->stopActiveDOMObjects(); + getExecutionContext()->stopActiveDOMObjects(); Heap::collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep, BlinkGC::ForcedGC); EXPECT_FALSE(ScriptPromiseResolverKeepAlive::isAlive()); } @@ -286,19 +286,19 @@ TEST_F(ScriptPromiseResolverTest, suspend) ScriptPromiseResolverKeepAlive::reset(); ScriptPromiseResolver* resolver = nullptr; { - ScriptState::Scope scope(scriptState()); - resolver = ScriptPromiseResolverKeepAlive::create(scriptState()); + ScriptState::Scope scope(getScriptState()); + resolver = ScriptPromiseResolverKeepAlive::create(getScriptState()); } resolver->keepAliveWhilePending(); Heap::collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep, BlinkGC::ForcedGC); ASSERT_TRUE(ScriptPromiseResolverKeepAlive::isAlive()); - executionContext()->suspendActiveDOMObjects(); + getExecutionContext()->suspendActiveDOMObjects(); resolver->resolve("hello"); Heap::collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep, BlinkGC::ForcedGC); EXPECT_TRUE(ScriptPromiseResolverKeepAlive::isAlive()); - executionContext()->stopActiveDOMObjects(); + getExecutionContext()->stopActiveDOMObjects(); Heap::collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep, BlinkGC::ForcedGC); EXPECT_FALSE(ScriptPromiseResolverKeepAlive::isAlive()); } @@ -308,16 +308,16 @@ TEST_F(ScriptPromiseResolverTest, resolveVoid) ScriptPromiseResolver* resolver = nullptr; ScriptPromise promise; { - ScriptState::Scope scope(scriptState()); - resolver = ScriptPromiseResolver::create(scriptState()); + ScriptState::Scope scope(getScriptState()); + resolver = ScriptPromiseResolver::create(getScriptState()); promise = resolver->promise(); } String onFulfilled, onRejected; ASSERT_FALSE(promise.isEmpty()); { - ScriptState::Scope scope(scriptState()); - promise.then(Function::createFunction(scriptState(), &onFulfilled), Function::createFunction(scriptState(), &onRejected)); + ScriptState::Scope scope(getScriptState()); + promise.then(Function::createFunction(getScriptState(), &onFulfilled), Function::createFunction(getScriptState(), &onRejected)); } resolver->resolve(); @@ -332,16 +332,16 @@ TEST_F(ScriptPromiseResolverTest, rejectVoid) ScriptPromiseResolver* resolver = nullptr; ScriptPromise promise; { - ScriptState::Scope scope(scriptState()); - resolver = ScriptPromiseResolver::create(scriptState()); + ScriptState::Scope scope(getScriptState()); + resolver = ScriptPromiseResolver::create(getScriptState()); promise = resolver->promise(); } String onFulfilled, onRejected; ASSERT_FALSE(promise.isEmpty()); { - ScriptState::Scope scope(scriptState()); - promise.then(Function::createFunction(scriptState(), &onFulfilled), Function::createFunction(scriptState(), &onRejected)); + ScriptState::Scope scope(getScriptState()); + promise.then(Function::createFunction(getScriptState(), &onFulfilled), Function::createFunction(getScriptState(), &onRejected)); } resolver->reject(); diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseTest.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseTest.cpp index 01d144e..73b38ba 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseTest.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseTest.cpp @@ -88,16 +88,16 @@ public: String toString(const ScriptValue& value) { - return toCoreString(value.v8Value()->ToString(scriptState()->context()).ToLocalChecked()); + return toCoreString(value.v8Value()->ToString(getScriptState()->context()).ToLocalChecked()); } Vector<String> toStringArray(const ScriptValue& value) { NonThrowableExceptionState exceptionState; - return toImplArray<Vector<String>>(value.v8Value(), 0, scriptState()->isolate(), exceptionState); + return toImplArray<Vector<String>>(value.v8Value(), 0, getScriptState()->isolate(), exceptionState); } - ScriptState* scriptState() const { return m_scope.scriptState(); } + ScriptState* getScriptState() const { return m_scope.getScriptState(); } v8::Isolate* isolate() const { return m_scope.isolate(); } protected: @@ -108,17 +108,17 @@ protected: TEST_F(ScriptPromiseTest, constructFromNonPromise) { v8::TryCatch trycatch(isolate()); - ScriptPromise promise(scriptState(), v8::Undefined(isolate())); + ScriptPromise promise(getScriptState(), v8::Undefined(isolate())); ASSERT_TRUE(trycatch.HasCaught()); ASSERT_TRUE(promise.isEmpty()); } TEST_F(ScriptPromiseTest, thenResolve) { - Resolver resolver(scriptState()); + Resolver resolver(getScriptState()); ScriptPromise promise = resolver.promise(); ScriptValue onFulfilled, onRejected; - promise.then(Function::createFunction(scriptState(), &onFulfilled), Function::createFunction(scriptState(), &onRejected)); + promise.then(Function::createFunction(getScriptState(), &onFulfilled), Function::createFunction(getScriptState(), &onRejected)); ASSERT_FALSE(promise.isEmpty()); EXPECT_TRUE(onFulfilled.isEmpty()); @@ -138,11 +138,11 @@ TEST_F(ScriptPromiseTest, thenResolve) TEST_F(ScriptPromiseTest, resolveThen) { - Resolver resolver(scriptState()); + Resolver resolver(getScriptState()); ScriptPromise promise = resolver.promise(); ScriptValue onFulfilled, onRejected; resolver.resolve(v8String(isolate(), "hello")); - promise.then(Function::createFunction(scriptState(), &onFulfilled), Function::createFunction(scriptState(), &onRejected)); + promise.then(Function::createFunction(getScriptState(), &onFulfilled), Function::createFunction(getScriptState(), &onRejected)); ASSERT_FALSE(promise.isEmpty()); EXPECT_TRUE(onFulfilled.isEmpty()); @@ -156,10 +156,10 @@ TEST_F(ScriptPromiseTest, resolveThen) TEST_F(ScriptPromiseTest, thenReject) { - Resolver resolver(scriptState()); + Resolver resolver(getScriptState()); ScriptPromise promise = resolver.promise(); ScriptValue onFulfilled, onRejected; - promise.then(Function::createFunction(scriptState(), &onFulfilled), Function::createFunction(scriptState(), &onRejected)); + promise.then(Function::createFunction(getScriptState(), &onFulfilled), Function::createFunction(getScriptState(), &onRejected)); ASSERT_FALSE(promise.isEmpty()); EXPECT_TRUE(onFulfilled.isEmpty()); @@ -179,11 +179,11 @@ TEST_F(ScriptPromiseTest, thenReject) TEST_F(ScriptPromiseTest, rejectThen) { - Resolver resolver(scriptState()); + Resolver resolver(getScriptState()); ScriptPromise promise = resolver.promise(); ScriptValue onFulfilled, onRejected; resolver.reject(v8String(isolate(), "hello")); - promise.then(Function::createFunction(scriptState(), &onFulfilled), Function::createFunction(scriptState(), &onRejected)); + promise.then(Function::createFunction(getScriptState(), &onFulfilled), Function::createFunction(getScriptState(), &onRejected)); ASSERT_FALSE(promise.isEmpty()); EXPECT_TRUE(onFulfilled.isEmpty()); @@ -197,8 +197,8 @@ TEST_F(ScriptPromiseTest, rejectThen) TEST_F(ScriptPromiseTest, castPromise) { - ScriptPromise promise = Resolver(scriptState()).promise(); - ScriptPromise newPromise = ScriptPromise::cast(scriptState(), promise.v8Value()); + ScriptPromise promise = Resolver(getScriptState()).promise(); + ScriptPromise newPromise = ScriptPromise::cast(getScriptState(), promise.v8Value()); ASSERT_FALSE(promise.isEmpty()); EXPECT_EQ(promise.v8Value(), newPromise.v8Value()); @@ -208,11 +208,11 @@ TEST_F(ScriptPromiseTest, castNonPromise) { ScriptValue onFulfilled1, onFulfilled2, onRejected1, onRejected2; - ScriptValue value = ScriptValue(scriptState(), v8String(isolate(), "hello")); - ScriptPromise promise1 = ScriptPromise::cast(scriptState(), ScriptValue(value)); - ScriptPromise promise2 = ScriptPromise::cast(scriptState(), ScriptValue(value)); - promise1.then(Function::createFunction(scriptState(), &onFulfilled1), Function::createFunction(scriptState(), &onRejected1)); - promise2.then(Function::createFunction(scriptState(), &onFulfilled2), Function::createFunction(scriptState(), &onRejected2)); + ScriptValue value = ScriptValue(getScriptState(), v8String(isolate(), "hello")); + ScriptPromise promise1 = ScriptPromise::cast(getScriptState(), ScriptValue(value)); + ScriptPromise promise2 = ScriptPromise::cast(getScriptState(), ScriptValue(value)); + promise1.then(Function::createFunction(getScriptState(), &onFulfilled1), Function::createFunction(getScriptState(), &onRejected1)); + promise2.then(Function::createFunction(getScriptState(), &onFulfilled2), Function::createFunction(getScriptState(), &onRejected2)); ASSERT_FALSE(promise1.isEmpty()); ASSERT_FALSE(promise2.isEmpty()); @@ -238,9 +238,9 @@ TEST_F(ScriptPromiseTest, reject) { ScriptValue onFulfilled, onRejected; - ScriptValue value = ScriptValue(scriptState(), v8String(isolate(), "hello")); - ScriptPromise promise = ScriptPromise::reject(scriptState(), ScriptValue(value)); - promise.then(Function::createFunction(scriptState(), &onFulfilled), Function::createFunction(scriptState(), &onRejected)); + ScriptValue value = ScriptValue(getScriptState(), v8String(isolate(), "hello")); + ScriptPromise promise = ScriptPromise::reject(getScriptState(), ScriptValue(value)); + promise.then(Function::createFunction(getScriptState(), &onFulfilled), Function::createFunction(getScriptState(), &onRejected)); ASSERT_FALSE(promise.isEmpty()); ASSERT_TRUE(promise.v8Value()->IsPromise()); @@ -257,8 +257,8 @@ TEST_F(ScriptPromiseTest, reject) TEST_F(ScriptPromiseTest, rejectWithExceptionState) { ScriptValue onFulfilled, onRejected; - ScriptPromise promise = ScriptPromise::rejectWithDOMException(scriptState(), DOMException::create(SyntaxError, "some syntax error")); - promise.then(Function::createFunction(scriptState(), &onFulfilled), Function::createFunction(scriptState(), &onRejected)); + ScriptPromise promise = ScriptPromise::rejectWithDOMException(getScriptState(), DOMException::create(SyntaxError, "some syntax error")); + promise.then(Function::createFunction(getScriptState(), &onFulfilled), Function::createFunction(getScriptState(), &onRejected)); ASSERT_FALSE(promise.isEmpty()); EXPECT_TRUE(onFulfilled.isEmpty()); @@ -274,10 +274,10 @@ TEST_F(ScriptPromiseTest, allWithEmptyPromises) { ScriptValue onFulfilled, onRejected; - ScriptPromise promise = ScriptPromise::all(scriptState(), Vector<ScriptPromise>()); + ScriptPromise promise = ScriptPromise::all(getScriptState(), Vector<ScriptPromise>()); ASSERT_FALSE(promise.isEmpty()); - promise.then(Function::createFunction(scriptState(), &onFulfilled), Function::createFunction(scriptState(), &onRejected)); + promise.then(Function::createFunction(getScriptState(), &onFulfilled), Function::createFunction(getScriptState(), &onRejected)); EXPECT_TRUE(onFulfilled.isEmpty()); EXPECT_TRUE(onRejected.isEmpty()); @@ -294,12 +294,12 @@ TEST_F(ScriptPromiseTest, allWithResolvedPromises) ScriptValue onFulfilled, onRejected; Vector<ScriptPromise> promises; - promises.append(ScriptPromise::cast(scriptState(), v8String(isolate(), "hello"))); - promises.append(ScriptPromise::cast(scriptState(), v8String(isolate(), "world"))); + promises.append(ScriptPromise::cast(getScriptState(), v8String(isolate(), "hello"))); + promises.append(ScriptPromise::cast(getScriptState(), v8String(isolate(), "world"))); - ScriptPromise promise = ScriptPromise::all(scriptState(), promises); + ScriptPromise promise = ScriptPromise::all(getScriptState(), promises); ASSERT_FALSE(promise.isEmpty()); - promise.then(Function::createFunction(scriptState(), &onFulfilled), Function::createFunction(scriptState(), &onRejected)); + promise.then(Function::createFunction(getScriptState(), &onFulfilled), Function::createFunction(getScriptState(), &onRejected)); EXPECT_TRUE(onFulfilled.isEmpty()); EXPECT_TRUE(onRejected.isEmpty()); @@ -319,12 +319,12 @@ TEST_F(ScriptPromiseTest, allWithRejectedPromise) ScriptValue onFulfilled, onRejected; Vector<ScriptPromise> promises; - promises.append(ScriptPromise::cast(scriptState(), v8String(isolate(), "hello"))); - promises.append(ScriptPromise::reject(scriptState(), v8String(isolate(), "world"))); + promises.append(ScriptPromise::cast(getScriptState(), v8String(isolate(), "hello"))); + promises.append(ScriptPromise::reject(getScriptState(), v8String(isolate(), "world"))); - ScriptPromise promise = ScriptPromise::all(scriptState(), promises); + ScriptPromise promise = ScriptPromise::all(getScriptState(), promises); ASSERT_FALSE(promise.isEmpty()); - promise.then(Function::createFunction(scriptState(), &onFulfilled), Function::createFunction(scriptState(), &onRejected)); + promise.then(Function::createFunction(getScriptState(), &onFulfilled), Function::createFunction(getScriptState(), &onRejected)); EXPECT_TRUE(onFulfilled.isEmpty()); EXPECT_TRUE(onRejected.isEmpty()); diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp index c3fc68b..aa1d36a 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp @@ -96,7 +96,7 @@ ScriptValue ScriptState::getFromExtrasExports(const char* name) return ScriptValue(this, v8Value); } -ExecutionContext* ScriptState::executionContext() const +ExecutionContext* ScriptState::getExecutionContext() const { v8::HandleScope scope(m_isolate); return toExecutionContext(context()); diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptState.h b/third_party/WebKit/Source/bindings/core/v8/ScriptState.h index 5b5c5a0..e7fb0d6 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptState.h +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptState.h @@ -87,7 +87,7 @@ public: v8::Isolate* isolate() const { return m_isolate; } DOMWrapperWorld& world() const { return *m_world; } LocalDOMWindow* domWindow() const; - virtual ExecutionContext* executionContext() const; + virtual ExecutionContext* getExecutionContext() const; virtual void setExecutionContext(ExecutionContext*); int contextIdInDebugger(); diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp index 4aae6c2..1bcc70b6 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp @@ -39,7 +39,7 @@ public: ScriptStreamer::setSmallScriptThresholdForTesting(0); } - ScriptState* scriptState() const { return m_scope.scriptState(); } + ScriptState* getScriptState() const { return m_scope.getScriptState(); } v8::Isolate* isolate() const { return m_scope.isolate(); } PendingScript* pendingScript() const { return m_pendingScript.get(); } @@ -115,7 +115,7 @@ private: TEST_F(ScriptStreamingTest, MAYBE_CompilingStreamedScript) { // Test that we can successfully compile a streamed script. - ScriptStreamer::startStreaming(pendingScript(), ScriptStreamer::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner); + ScriptStreamer::startStreaming(pendingScript(), ScriptStreamer::ParsingBlocking, m_settings.get(), m_scope.getScriptState(), m_loadingTaskRunner); TestScriptResourceClient client; pendingScript()->watchForLoad(&client); @@ -146,7 +146,7 @@ TEST_F(ScriptStreamingTest, CompilingStreamedScriptWithParseError) // Test that scripts with parse errors are handled properly. In those cases, // the V8 side typically finished before loading finishes: make sure we // handle it gracefully. - ScriptStreamer::startStreaming(pendingScript(), ScriptStreamer::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner); + ScriptStreamer::startStreaming(pendingScript(), ScriptStreamer::ParsingBlocking, m_settings.get(), m_scope.getScriptState(), m_loadingTaskRunner); TestScriptResourceClient client; pendingScript()->watchForLoad(&client); appendData("function foo() {"); @@ -178,7 +178,7 @@ TEST_F(ScriptStreamingTest, CancellingStreaming) { // Test that the upper layers (PendingScript and up) can be ramped down // while streaming is ongoing, and ScriptStreamer handles it gracefully. - ScriptStreamer::startStreaming(pendingScript(), ScriptStreamer::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner); + ScriptStreamer::startStreaming(pendingScript(), ScriptStreamer::ParsingBlocking, m_settings.get(), m_scope.getScriptState(), m_loadingTaskRunner); TestScriptResourceClient client; pendingScript()->watchForLoad(&client); appendData("function foo() {"); @@ -207,7 +207,7 @@ TEST_F(ScriptStreamingTest, SuppressingStreaming) // is suppressed (V8 doesn't parse while the script is loading), and the // upper layer (ScriptResourceClient) should get a notification when the // script is loaded. - ScriptStreamer::startStreaming(pendingScript(), ScriptStreamer::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner); + ScriptStreamer::startStreaming(pendingScript(), ScriptStreamer::ParsingBlocking, m_settings.get(), m_scope.getScriptState(), m_loadingTaskRunner); TestScriptResourceClient client; pendingScript()->watchForLoad(&client); appendData("function foo() {"); @@ -236,7 +236,7 @@ TEST_F(ScriptStreamingTest, EmptyScripts) // Empty scripts should also be streamed properly, that is, the upper layer // (ScriptResourceClient) should be notified when an empty script has been // loaded. - ScriptStreamer::startStreaming(pendingScript(), ScriptStreamer::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner); + ScriptStreamer::startStreaming(pendingScript(), ScriptStreamer::ParsingBlocking, m_settings.get(), m_scope.getScriptState(), m_loadingTaskRunner); TestScriptResourceClient client; pendingScript()->watchForLoad(&client); @@ -257,7 +257,7 @@ TEST_F(ScriptStreamingTest, SmallScripts) // Small scripts shouldn't be streamed. ScriptStreamer::setSmallScriptThresholdForTesting(100); - ScriptStreamer::startStreaming(pendingScript(), ScriptStreamer::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner); + ScriptStreamer::startStreaming(pendingScript(), ScriptStreamer::ParsingBlocking, m_settings.get(), m_scope.getScriptState(), m_loadingTaskRunner); TestScriptResourceClient client; pendingScript()->watchForLoad(&client); @@ -287,7 +287,7 @@ TEST_F(ScriptStreamingTest, MAYBE_ScriptsWithSmallFirstChunk) // chunk is small. ScriptStreamer::setSmallScriptThresholdForTesting(100); - ScriptStreamer::startStreaming(pendingScript(), ScriptStreamer::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner); + ScriptStreamer::startStreaming(pendingScript(), ScriptStreamer::ParsingBlocking, m_settings.get(), m_scope.getScriptState(), m_loadingTaskRunner); TestScriptResourceClient client; pendingScript()->watchForLoad(&client); @@ -323,7 +323,7 @@ TEST_F(ScriptStreamingTest, MAYBE_EncodingChanges) // loading it. m_resource->setEncoding("windows-1252"); - ScriptStreamer::startStreaming(pendingScript(), ScriptStreamer::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner); + ScriptStreamer::startStreaming(pendingScript(), ScriptStreamer::ParsingBlocking, m_settings.get(), m_scope.getScriptState(), m_loadingTaskRunner); TestScriptResourceClient client; pendingScript()->watchForLoad(&client); @@ -358,7 +358,7 @@ TEST_F(ScriptStreamingTest, MAYBE_EncodingFromBOM) // will also affect encoding detection. m_resource->setEncoding("windows-1252"); // This encoding is wrong on purpose. - ScriptStreamer::startStreaming(pendingScript(), ScriptStreamer::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner); + ScriptStreamer::startStreaming(pendingScript(), ScriptStreamer::ParsingBlocking, m_settings.get(), m_scope.getScriptState(), m_loadingTaskRunner); TestScriptResourceClient client; pendingScript()->watchForLoad(&client); diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptValue.h b/third_party/WebKit/Source/bindings/core/v8/ScriptValue.h index 06b5c25..209e50e 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptValue.h +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptValue.h @@ -85,7 +85,7 @@ public: ASSERT(isEmpty() || m_scriptState); } - ScriptState* scriptState() const + ScriptState* getScriptState() const { return m_scriptState.get(); } diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp index e6a30e4..bb3c413 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp @@ -1792,7 +1792,7 @@ bool SerializedScriptValueReader::readRegExp(v8::Local<v8::Value>* value) uint32_t flags; if (!doReadUint32(&flags)) return false; - if (!v8::RegExp::New(scriptState()->context(), pattern.As<v8::String>(), static_cast<v8::RegExp::Flags>(flags)).ToLocal(value)) + if (!v8::RegExp::New(getScriptState()->context(), pattern.As<v8::String>(), static_cast<v8::RegExp::Flags>(flags)).ToLocal(value)) return false; return true; } @@ -1966,7 +1966,7 @@ PassRefPtr<BlobDataHandle> SerializedScriptValueReader::getOrCreateBlobDataHandl v8::Local<v8::Value> ScriptValueDeserializer::deserialize() { - v8::Isolate* isolate = m_reader.scriptState()->isolate(); + v8::Isolate* isolate = m_reader.getScriptState()->isolate(); if (!m_reader.readVersion(m_version) || m_version > SerializedScriptValue::wireFormatVersion) return v8::Null(isolate); m_reader.setVersion(m_version); @@ -1983,28 +1983,28 @@ v8::Local<v8::Value> ScriptValueDeserializer::deserialize() bool ScriptValueDeserializer::newSparseArray(uint32_t) { - v8::Local<v8::Array> array = v8::Array::New(m_reader.scriptState()->isolate(), 0); + v8::Local<v8::Array> array = v8::Array::New(m_reader.getScriptState()->isolate(), 0); openComposite(array); return true; } bool ScriptValueDeserializer::newDenseArray(uint32_t length) { - v8::Local<v8::Array> array = v8::Array::New(m_reader.scriptState()->isolate(), length); + v8::Local<v8::Array> array = v8::Array::New(m_reader.getScriptState()->isolate(), length); openComposite(array); return true; } bool ScriptValueDeserializer::newMap() { - v8::Local<v8::Map> map = v8::Map::New(m_reader.scriptState()->isolate()); + v8::Local<v8::Map> map = v8::Map::New(m_reader.getScriptState()->isolate()); openComposite(map); return true; } bool ScriptValueDeserializer::newSet() { - v8::Local<v8::Set> set = v8::Set::New(m_reader.scriptState()->isolate()); + v8::Local<v8::Set> set = v8::Set::New(m_reader.getScriptState()->isolate()); openComposite(set); return true; } @@ -2020,7 +2020,7 @@ bool ScriptValueDeserializer::consumeTopOfStack(v8::Local<v8::Value>* object) bool ScriptValueDeserializer::newObject() { - v8::Local<v8::Object> object = v8::Object::New(m_reader.scriptState()->isolate()); + v8::Local<v8::Object> object = v8::Object::New(m_reader.getScriptState()->isolate()); if (object.IsEmpty()) return false; openComposite(object); @@ -2036,7 +2036,7 @@ bool ScriptValueDeserializer::completeObject(uint32_t numProperties, v8::Local<v return false; object = composite.As<v8::Object>(); } else { - object = v8::Object::New(m_reader.scriptState()->isolate()); + object = v8::Object::New(m_reader.getScriptState()->isolate()); } if (object.IsEmpty()) return false; @@ -2052,7 +2052,7 @@ bool ScriptValueDeserializer::completeSparseArray(uint32_t numProperties, uint32 return false; array = composite.As<v8::Array>(); } else { - array = v8::Array::New(m_reader.scriptState()->isolate()); + array = v8::Array::New(m_reader.getScriptState()->isolate()); } if (array.IsEmpty()) return false; @@ -2074,7 +2074,7 @@ bool ScriptValueDeserializer::completeDenseArray(uint32_t numProperties, uint32_ return false; if (length > stackDepth()) return false; - v8::Local<v8::Context> context = m_reader.scriptState()->context(); + v8::Local<v8::Context> context = m_reader.getScriptState()->context(); for (unsigned i = 0, stackPos = stackDepth() - length; i < length; i++, stackPos++) { v8::Local<v8::Value> elem = element(stackPos); if (!elem->IsUndefined()) { @@ -2095,7 +2095,7 @@ bool ScriptValueDeserializer::completeMap(uint32_t length, v8::Local<v8::Value>* v8::Local<v8::Map> map = composite.As<v8::Map>(); if (map.IsEmpty()) return false; - v8::Local<v8::Context> context = m_reader.scriptState()->context(); + v8::Local<v8::Context> context = m_reader.getScriptState()->context(); ASSERT(length % 2 == 0); for (unsigned i = stackDepth() - length; i + 1 < stackDepth(); i += 2) { v8::Local<v8::Value> key = element(i); @@ -2117,7 +2117,7 @@ bool ScriptValueDeserializer::completeSet(uint32_t length, v8::Local<v8::Value>* v8::Local<v8::Set> set = composite.As<v8::Set>(); if (set.IsEmpty()) return false; - v8::Local<v8::Context> context = m_reader.scriptState()->context(); + v8::Local<v8::Context> context = m_reader.getScriptState()->context(); for (unsigned i = stackDepth() - length; i < stackDepth(); i++) { v8::Local<v8::Value> key = element(i); if (set->Add(context, key).IsEmpty()) @@ -2139,8 +2139,8 @@ bool ScriptValueDeserializer::tryGetTransferredMessagePort(uint32_t index, v8::L return false; if (index >= m_transferredMessagePorts->size()) return false; - v8::Local<v8::Object> creationContext = m_reader.scriptState()->context()->Global(); - *object = toV8(m_transferredMessagePorts->at(index).get(), creationContext, m_reader.scriptState()->isolate()); + v8::Local<v8::Object> creationContext = m_reader.getScriptState()->context()->Global(); + *object = toV8(m_transferredMessagePorts->at(index).get(), creationContext, m_reader.getScriptState()->isolate()); return !object->IsEmpty(); } @@ -2153,8 +2153,8 @@ bool ScriptValueDeserializer::tryGetTransferredArrayBuffer(uint32_t index, v8::L v8::Local<v8::Value> result = m_arrayBuffers.at(index); if (result.IsEmpty()) { RefPtr<DOMArrayBuffer> buffer = DOMArrayBuffer::create(m_arrayBufferContents->at(index)); - v8::Isolate* isolate = m_reader.scriptState()->isolate(); - v8::Local<v8::Object> creationContext = m_reader.scriptState()->context()->Global(); + v8::Isolate* isolate = m_reader.getScriptState()->isolate(); + v8::Local<v8::Object> creationContext = m_reader.getScriptState()->context()->Global(); result = toV8(buffer.get(), creationContext, isolate); if (result.IsEmpty()) return false; @@ -2173,8 +2173,8 @@ bool ScriptValueDeserializer::tryGetTransferredImageBitmap(uint32_t index, v8::L v8::Local<v8::Value> result = m_imageBitmaps.at(index); if (result.IsEmpty()) { RefPtrWillBeRawPtr<ImageBitmap> bitmap = ImageBitmap::create(m_imageBitmapContents->at(index)); - v8::Isolate* isolate = m_reader.scriptState()->isolate(); - v8::Local<v8::Object> creationContext = m_reader.scriptState()->context()->Global(); + v8::Isolate* isolate = m_reader.getScriptState()->isolate(); + v8::Local<v8::Object> creationContext = m_reader.getScriptState()->context()->Global(); result = toV8(bitmap.get(), creationContext, isolate); if (result.IsEmpty()) return false; @@ -2194,8 +2194,8 @@ bool ScriptValueDeserializer::tryGetTransferredSharedArrayBuffer(uint32_t index, v8::Local<v8::Value> result = m_arrayBuffers.at(index); if (result.IsEmpty()) { RefPtr<DOMSharedArrayBuffer> buffer = DOMSharedArrayBuffer::create(m_arrayBufferContents->at(index)); - v8::Isolate* isolate = m_reader.scriptState()->isolate(); - v8::Local<v8::Object> creationContext = m_reader.scriptState()->context()->Global(); + v8::Isolate* isolate = m_reader.getScriptState()->isolate(); + v8::Local<v8::Object> creationContext = m_reader.getScriptState()->context()->Global(); result = toV8(buffer.get(), creationContext, isolate); if (result.IsEmpty()) return false; @@ -2223,7 +2223,7 @@ bool ScriptValueDeserializer::initializeObject(v8::Local<v8::Object> object, uin unsigned length = 2 * numProperties; if (length > stackDepth()) return false; - v8::Local<v8::Context> context = m_reader.scriptState()->context(); + v8::Local<v8::Context> context = m_reader.getScriptState()->context(); for (unsigned i = stackDepth() - length; i < stackDepth(); i += 2) { v8::Local<v8::Value> propertyName = element(i); v8::Local<v8::Value> propertyValue = element(i + 1); diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h b/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h index 2669c30..f1eaabc 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h @@ -496,7 +496,7 @@ public: bool isEof() const { return m_position >= m_length; } - ScriptState* scriptState() const { return m_scriptState.get(); } + ScriptState* getScriptState() const { return m_scriptState.get(); } protected: v8::Isolate* isolate() const { return m_scriptState->isolate(); } diff --git a/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValueTest.cpp b/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValueTest.cpp index ab84251..4083290 100644 --- a/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValueTest.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValueTest.cpp @@ -23,7 +23,7 @@ public: } v8::Isolate* isolate() const { return m_scope.isolate(); } - v8::Local<v8::Object> creationContext() const { return m_scope.scriptState()->context()->Global(); } + v8::Local<v8::Object> creationContext() const { return m_scope.getScriptState()->context()->Global(); } protected: V8TestingScope m_scope; diff --git a/third_party/WebKit/Source/bindings/core/v8/ToV8Test.cpp b/third_party/WebKit/Source/bindings/core/v8/ToV8Test.cpp index 9306a98..fc91bc5 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ToV8Test.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ToV8Test.cpp @@ -26,7 +26,7 @@ public: template<typename T> void testToV8(const char* expected, T value, const char* path, int lineNumber) { - v8::Local<v8::Value> actual = toV8(value, m_scope.scriptState()->context()->Global(), m_scope.isolate()); + v8::Local<v8::Value> actual = toV8(value, m_scope.getScriptState()->context()->Global(), m_scope.isolate()); if (actual.IsEmpty()) { ADD_FAILURE_AT(path, lineNumber) << "toV8 returns an empty value."; return; @@ -161,7 +161,7 @@ TEST_F(ToV8Test, undefinedType) TEST_F(ToV8Test, scriptValue) { - ScriptValue value(m_scope.scriptState(), v8::Number::New(m_scope.isolate(), 1234)); + ScriptValue value(m_scope.getScriptState(), v8::Number::New(m_scope.isolate(), 1234)); TEST_TOV8("1234", value); } @@ -233,7 +233,7 @@ TEST_F(ToV8Test, dictionaryVector) dictionary.append(std::make_pair("one", 1)); dictionary.append(std::make_pair("two", 2)); TEST_TOV8("[object Object]", dictionary); - v8::Local<v8::Context> context = m_scope.scriptState()->context(); + v8::Local<v8::Context> context = m_scope.getScriptState()->context(); v8::Local<v8::Object> result = toV8(dictionary, context->Global(), m_scope.isolate())->ToObject(context).ToLocalChecked(); v8::Local<v8::Value> one = result->Get(context, v8String(m_scope.isolate(), "one")).ToLocalChecked(); EXPECT_EQ(1, one->NumberValue(context).FromJust()); @@ -305,9 +305,9 @@ TEST_F(ToV8Test, basicTypeHeapVectors) TEST_F(ToV8Test, withScriptState) { - ScriptValue value(m_scope.scriptState(), v8::Number::New(m_scope.isolate(), 1234.0)); + ScriptValue value(m_scope.getScriptState(), v8::Number::New(m_scope.isolate(), 1234.0)); - v8::Local<v8::Value> actual = toV8(value, m_scope.scriptState()); + v8::Local<v8::Value> actual = toV8(value, m_scope.getScriptState()); EXPECT_FALSE(actual.IsEmpty()); double actualAsNumber = actual.As<v8::Number>()->Value(); diff --git a/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp b/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp index e6cbbd5..4888c6d 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp @@ -140,8 +140,8 @@ void V8AbstractEventListener::invokeEventHandler(ScriptState* scriptState, Event event->target()->uncaughtExceptionInEventHandler(); if (!tryCatch.CanContinue()) { // Result of TerminateExecution(). - if (scriptState->executionContext()->isWorkerGlobalScope()) - toWorkerGlobalScope(scriptState->executionContext())->scriptController()->forbidExecution(); + if (scriptState->getExecutionContext()->isWorkerGlobalScope()) + toWorkerGlobalScope(scriptState->getExecutionContext())->scriptController()->forbidExecution(); return; } tryCatch.Reset(); diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp index 890547a..9911985 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp @@ -711,10 +711,10 @@ ExecutionContext* toExecutionContext(v8::Local<v8::Context> context) v8::Local<v8::Object> global = context->Global(); v8::Local<v8::Object> windowWrapper = V8Window::findInstanceInPrototypeChain(global, context->GetIsolate()); if (!windowWrapper.IsEmpty()) - return V8Window::toImpl(windowWrapper)->executionContext(); + return V8Window::toImpl(windowWrapper)->getExecutionContext(); v8::Local<v8::Object> workerWrapper = V8WorkerGlobalScope::findInstanceInPrototypeChain(global, context->GetIsolate()); if (!workerWrapper.IsEmpty()) - return V8WorkerGlobalScope::toImpl(workerWrapper)->executionContext(); + return V8WorkerGlobalScope::toImpl(workerWrapper)->getExecutionContext(); ASSERT(s_toExecutionContextForModules); return (*s_toExecutionContextForModules)(context); } @@ -787,8 +787,8 @@ v8::Local<v8::Context> toV8Context(ExecutionContext* context, DOMWrapperWorld& w return toV8Context(frame, world); } else if (context->isWorkerGlobalScope()) { if (WorkerOrWorkletScriptController* script = toWorkerOrWorkletGlobalScope(context)->scriptController()) { - if (script->scriptState()->contextIsValid()) - return script->scriptState()->context(); + if (script->getScriptState()->contextIsValid()) + return script->getScriptState()->context(); } } return v8::Local<v8::Context>(); diff --git a/third_party/WebKit/Source/bindings/core/v8/V8BindingForTesting.cpp b/third_party/WebKit/Source/bindings/core/v8/V8BindingForTesting.cpp index 3708e99..c992e3c 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8BindingForTesting.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8BindingForTesting.cpp @@ -23,7 +23,7 @@ ScriptStateForTesting::ScriptStateForTesting(v8::Local<v8::Context> context, Pas { } -ExecutionContext* ScriptStateForTesting::executionContext() const +ExecutionContext* ScriptStateForTesting::getExecutionContext() const { return m_executionContext; } @@ -46,7 +46,7 @@ V8TestingScope::~V8TestingScope() m_scriptState->disposePerContextData(); } -ScriptState* V8TestingScope::scriptState() const +ScriptState* V8TestingScope::getScriptState() const { return m_scriptState.get(); } diff --git a/third_party/WebKit/Source/bindings/core/v8/V8BindingForTesting.h b/third_party/WebKit/Source/bindings/core/v8/V8BindingForTesting.h index 6b7c973..4b6b7da 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8BindingForTesting.h +++ b/third_party/WebKit/Source/bindings/core/v8/V8BindingForTesting.h @@ -17,7 +17,7 @@ namespace blink { class ScriptStateForTesting : public ScriptState { public: static PassRefPtr<ScriptStateForTesting> create(v8::Local<v8::Context>, PassRefPtr<DOMWrapperWorld>); - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; void setExecutionContext(ExecutionContext*) override; private: ScriptStateForTesting(v8::Local<v8::Context>, PassRefPtr<DOMWrapperWorld>); @@ -28,7 +28,7 @@ class V8TestingScope { DISALLOW_NEW(); public: explicit V8TestingScope(v8::Isolate*); - ScriptState* scriptState() const; + ScriptState* getScriptState() const; v8::Isolate* isolate() const; v8::Local<v8::Context> context() const; ~V8TestingScope(); diff --git a/third_party/WebKit/Source/bindings/core/v8/V8BindingTest.cpp b/third_party/WebKit/Source/bindings/core/v8/V8BindingTest.cpp index 677d96a..c272430 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8BindingTest.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8BindingTest.cpp @@ -20,7 +20,7 @@ public: template<typename T> v8::Local<v8::Value> toV8(T value) { - return blink::toV8(value, m_scope.scriptState()->context()->Global(), m_scope.isolate()); + return blink::toV8(value, m_scope.getScriptState()->context()->Global(), m_scope.isolate()); } V8TestingScope m_scope; diff --git a/third_party/WebKit/Source/bindings/core/v8/V8CustomElementLifecycleCallbacks.cpp b/third_party/WebKit/Source/bindings/core/v8/V8CustomElementLifecycleCallbacks.cpp index 2b32849..c028c9b 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8CustomElementLifecycleCallbacks.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8CustomElementLifecycleCallbacks.cpp @@ -89,7 +89,7 @@ static void weakCallback(const v8::WeakCallbackInfo<ScopedPersistent<T>>& data) V8CustomElementLifecycleCallbacks::V8CustomElementLifecycleCallbacks(ScriptState* scriptState, v8::Local<v8::Object> prototype, v8::MaybeLocal<v8::Function> created, v8::MaybeLocal<v8::Function> attached, v8::MaybeLocal<v8::Function> detached, v8::MaybeLocal<v8::Function> attributeChanged) : CustomElementLifecycleCallbacks(flagSet(attached, detached, attributeChanged)) - , ContextLifecycleObserver(scriptState->executionContext()) + , ContextLifecycleObserver(scriptState->getExecutionContext()) , m_scriptState(scriptState) , m_prototype(scriptState->isolate(), prototype) , m_created(scriptState->isolate(), created) @@ -109,7 +109,7 @@ V8CustomElementLifecycleCallbacks::V8CustomElementLifecycleCallbacks(ScriptState V8PerContextData* V8CustomElementLifecycleCallbacks::creationContextData() { - if (!executionContext()) + if (!getExecutionContext()) return 0; v8::Local<v8::Context> context = m_scriptState->context(); @@ -141,7 +141,7 @@ void V8CustomElementLifecycleCallbacks::created(Element* element) // FIXME: callbacks while paused should be queued up for execution to // continue then be delivered in order rather than delivered immediately. // Bug 329665 tracks similar behavior for other synchronous events. - if (!executionContext() || executionContext()->activeDOMObjectsAreStopped()) + if (!getExecutionContext() || getExecutionContext()->activeDOMObjectsAreStopped()) return; if (!m_scriptState->contextIsValid()) @@ -170,7 +170,7 @@ void V8CustomElementLifecycleCallbacks::created(Element* element) v8::TryCatch exceptionCatcher(isolate); exceptionCatcher.SetVerbose(true); - ScriptController::callFunction(executionContext(), callback, receiver, 0, 0, isolate); + ScriptController::callFunction(getExecutionContext(), callback, receiver, 0, 0, isolate); } void V8CustomElementLifecycleCallbacks::attached(Element* element) @@ -188,7 +188,7 @@ void V8CustomElementLifecycleCallbacks::attributeChanged(Element* element, const // FIXME: callbacks while paused should be queued up for execution to // continue then be delivered in order rather than delivered immediately. // Bug 329665 tracks similar behavior for other synchronous events. - if (!executionContext() || executionContext()->activeDOMObjectsAreStopped()) + if (!getExecutionContext() || getExecutionContext()->activeDOMObjectsAreStopped()) return; if (!m_scriptState->contextIsValid()) @@ -212,7 +212,7 @@ void V8CustomElementLifecycleCallbacks::attributeChanged(Element* element, const v8::TryCatch exceptionCatcher(isolate); exceptionCatcher.SetVerbose(true); - ScriptController::callFunction(executionContext(), callback, receiver, WTF_ARRAY_LENGTH(argv), argv, isolate); + ScriptController::callFunction(getExecutionContext(), callback, receiver, WTF_ARRAY_LENGTH(argv), argv, isolate); } void V8CustomElementLifecycleCallbacks::call(const ScopedPersistent<v8::Function>& weakCallback, Element* element) @@ -220,7 +220,7 @@ void V8CustomElementLifecycleCallbacks::call(const ScopedPersistent<v8::Function // FIXME: callbacks while paused should be queued up for execution to // continue then be delivered in order rather than delivered immediately. // Bug 329665 tracks similar behavior for other synchronous events. - if (!executionContext() || executionContext()->activeDOMObjectsAreStopped()) + if (!getExecutionContext() || getExecutionContext()->activeDOMObjectsAreStopped()) return; if (!m_scriptState->contextIsValid()) @@ -238,7 +238,7 @@ void V8CustomElementLifecycleCallbacks::call(const ScopedPersistent<v8::Function v8::TryCatch exceptionCatcher(isolate); exceptionCatcher.SetVerbose(true); - ScriptController::callFunction(executionContext(), callback, receiver, 0, 0, isolate); + ScriptController::callFunction(getExecutionContext(), callback, receiver, 0, 0, isolate); } DEFINE_TRACE(V8CustomElementLifecycleCallbacks) diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ErrorHandler.cpp b/third_party/WebKit/Source/bindings/core/v8/V8ErrorHandler.cpp index c03012f..7bea7df 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8ErrorHandler.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8ErrorHandler.cpp @@ -56,7 +56,7 @@ v8::Local<v8::Value> V8ErrorHandler::callListenerFunction(ScriptState* scriptSta if (errorEvent->world() && errorEvent->world() != &world()) return v8::Null(isolate()); - v8::Local<v8::Object> listener = getListenerObject(scriptState->executionContext()); + v8::Local<v8::Object> listener = getListenerObject(scriptState->getExecutionContext()); if (listener.IsEmpty() || !listener->IsFunction()) return v8::Null(isolate()); @@ -74,10 +74,10 @@ v8::Local<v8::Value> V8ErrorHandler::callListenerFunction(ScriptState* scriptSta v8::TryCatch tryCatch(isolate()); tryCatch.SetVerbose(true); v8::MaybeLocal<v8::Value> result; - if (scriptState->executionContext()->isWorkerGlobalScope()) { - result = V8ScriptRunner::callFunction(callFunction, scriptState->executionContext(), thisValue, WTF_ARRAY_LENGTH(parameters), parameters, isolate()); + if (scriptState->getExecutionContext()->isWorkerGlobalScope()) { + result = V8ScriptRunner::callFunction(callFunction, scriptState->getExecutionContext(), thisValue, WTF_ARRAY_LENGTH(parameters), parameters, isolate()); } else { - result = ScriptController::callFunction(scriptState->executionContext(), callFunction, thisValue, WTF_ARRAY_LENGTH(parameters), parameters, isolate()); + result = ScriptController::callFunction(scriptState->getExecutionContext(), callFunction, thisValue, WTF_ARRAY_LENGTH(parameters), parameters, isolate()); } v8::Local<v8::Value> returnValue; if (!result.ToLocal(&returnValue)) diff --git a/third_party/WebKit/Source/bindings/core/v8/V8EventListener.cpp b/third_party/WebKit/Source/bindings/core/v8/V8EventListener.cpp index 4d68a93..95c22fb 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8EventListener.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8EventListener.cpp @@ -44,7 +44,7 @@ V8EventListener::V8EventListener(bool isAttribute, ScriptState* scriptState) v8::Local<v8::Function> V8EventListener::getListenerFunction(ScriptState* scriptState) { - v8::Local<v8::Object> listener = getListenerObject(scriptState->executionContext()); + v8::Local<v8::Object> listener = getListenerObject(scriptState->getExecutionContext()); // Has the listener been disposed? if (listener.IsEmpty()) @@ -79,10 +79,10 @@ v8::Local<v8::Value> V8EventListener::callListenerFunction(ScriptState* scriptSt if (handlerFunction.IsEmpty() || receiver.IsEmpty()) return v8::Local<v8::Value>(); - if (!scriptState->executionContext()->isDocument()) + if (!scriptState->getExecutionContext()->isDocument()) return v8::Local<v8::Value>(); - LocalFrame* frame = toDocument(scriptState->executionContext())->frame(); + LocalFrame* frame = toDocument(scriptState->getExecutionContext())->frame(); if (!frame) return v8::Local<v8::Value>(); diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp index ddf9a44..e6327a1 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp @@ -280,7 +280,7 @@ static void promiseRejectHandlerInWorker(v8::PromiseRejectMessage data) if (!scriptState->contextIsValid()) return; - ExecutionContext* executionContext = scriptState->executionContext(); + ExecutionContext* executionContext = scriptState->getExecutionContext(); if (!executionContext) return; @@ -410,7 +410,7 @@ static void messageHandlerInWorker(v8::Local<v8::Message> message, v8::Local<v8: ScriptState* scriptState = ScriptState::current(isolate); // During the frame teardown, there may not be a valid context. - if (ExecutionContext* context = scriptState->executionContext()) { + if (ExecutionContext* context = scriptState->getExecutionContext()) { String errorMessage = toCoreStringWithNullCheck(message->Get()); TOSTRING_VOID(V8StringResource<>, sourceURL, message->GetScriptOrigin().ResourceName()); int scriptId = 0; diff --git a/third_party/WebKit/Source/bindings/core/v8/V8IntersectionObserverCallback.cpp b/third_party/WebKit/Source/bindings/core/v8/V8IntersectionObserverCallback.cpp index 5abf33f..37fd6d4 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8IntersectionObserverCallback.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8IntersectionObserverCallback.cpp @@ -13,7 +13,7 @@ namespace blink { V8IntersectionObserverCallback::V8IntersectionObserverCallback(v8::Local<v8::Function> callback, v8::Local<v8::Object> owner, ScriptState* scriptState) - : ActiveDOMCallback(scriptState->executionContext()) + : ActiveDOMCallback(scriptState->getExecutionContext()) , m_callback(scriptState->isolate(), callback) , m_scriptState(scriptState) { @@ -55,7 +55,7 @@ void V8IntersectionObserverCallback::handleEvent(const HeapVector<Member<Interse v8::TryCatch exceptionCatcher(m_scriptState->isolate()); exceptionCatcher.SetVerbose(true); - ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(m_scriptState->isolate()), thisObject, 2, argv, m_scriptState->isolate()); + ScriptController::callFunction(m_scriptState->getExecutionContext(), m_callback.newLocal(m_scriptState->isolate()), thisObject, 2, argv, m_scriptState->isolate()); } void V8IntersectionObserverCallback::setWeakCallback(const v8::WeakCallbackInfo<V8IntersectionObserverCallback>& data) diff --git a/third_party/WebKit/Source/bindings/core/v8/V8IntersectionObserverCallback.h b/third_party/WebKit/Source/bindings/core/v8/V8IntersectionObserverCallback.h index bd119f7..18be3a8 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8IntersectionObserverCallback.h +++ b/third_party/WebKit/Source/bindings/core/v8/V8IntersectionObserverCallback.h @@ -22,7 +22,7 @@ public: DECLARE_VIRTUAL_TRACE(); void handleEvent(const HeapVector<Member<IntersectionObserverEntry>>&, IntersectionObserver&) override; - ExecutionContext* executionContext() const override { return ContextLifecycleObserver::executionContext(); } + ExecutionContext* getExecutionContext() const override { return ContextLifecycleObserver::getExecutionContext(); } private: static void setWeakCallback(const v8::WeakCallbackInfo<V8IntersectionObserverCallback>&); diff --git a/third_party/WebKit/Source/bindings/core/v8/V8LazyEventListener.cpp b/third_party/WebKit/Source/bindings/core/v8/V8LazyEventListener.cpp index 43aa082..b078f01 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8LazyEventListener.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8LazyEventListener.cpp @@ -76,7 +76,7 @@ v8::Local<v8::Object> toObjectWrapper(T* domObject, ScriptState* scriptState) v8::Local<v8::Value> V8LazyEventListener::callListenerFunction(ScriptState* scriptState, v8::Local<v8::Value> jsEvent, Event* event) { ASSERT(!jsEvent.IsEmpty()); - v8::Local<v8::Object> listenerObject = getListenerObject(scriptState->executionContext()); + v8::Local<v8::Object> listenerObject = getListenerObject(scriptState->getExecutionContext()); if (listenerObject.IsEmpty()) return v8::Local<v8::Value>(); @@ -85,10 +85,10 @@ v8::Local<v8::Value> V8LazyEventListener::callListenerFunction(ScriptState* scri if (handlerFunction.IsEmpty() || receiver.IsEmpty()) return v8::Local<v8::Value>(); - if (!scriptState->executionContext()->isDocument()) + if (!scriptState->getExecutionContext()->isDocument()) return v8::Local<v8::Value>(); - LocalFrame* frame = toDocument(scriptState->executionContext())->frame(); + LocalFrame* frame = toDocument(scriptState->getExecutionContext())->frame(); if (!frame) return v8::Local<v8::Value>(); diff --git a/third_party/WebKit/Source/bindings/core/v8/V8MutationCallback.cpp b/third_party/WebKit/Source/bindings/core/v8/V8MutationCallback.cpp index 89eadb5..61c92a4 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8MutationCallback.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8MutationCallback.cpp @@ -36,7 +36,7 @@ namespace blink { V8MutationCallback::V8MutationCallback(v8::Local<v8::Function> callback, v8::Local<v8::Object> owner, ScriptState* scriptState) - : ActiveDOMCallback(scriptState->executionContext()) + : ActiveDOMCallback(scriptState->getExecutionContext()) , m_callback(scriptState->isolate(), callback) , m_scriptState(scriptState) { @@ -79,7 +79,7 @@ void V8MutationCallback::call(const WillBeHeapVector<RefPtrWillBeMember<Mutation v8::TryCatch exceptionCatcher(isolate); exceptionCatcher.SetVerbose(true); - ScriptController::callFunction(executionContext(), m_callback.newLocal(isolate), thisObject, WTF_ARRAY_LENGTH(argv), argv, isolate); + ScriptController::callFunction(getExecutionContext(), m_callback.newLocal(isolate), thisObject, WTF_ARRAY_LENGTH(argv), argv, isolate); } void V8MutationCallback::setWeakCallback(const v8::WeakCallbackInfo<V8MutationCallback>& data) diff --git a/third_party/WebKit/Source/bindings/core/v8/V8MutationCallback.h b/third_party/WebKit/Source/bindings/core/v8/V8MutationCallback.h index b774495..1d2cca7 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8MutationCallback.h +++ b/third_party/WebKit/Source/bindings/core/v8/V8MutationCallback.h @@ -49,7 +49,7 @@ public: ~V8MutationCallback() override; void call(const WillBeHeapVector<RefPtrWillBeMember<MutationRecord>>&, MutationObserver*) override; - ExecutionContext* executionContext() const override { return ContextLifecycleObserver::executionContext(); } + ExecutionContext* getExecutionContext() const override { return ContextLifecycleObserver::getExecutionContext(); } DECLARE_VIRTUAL_TRACE(); diff --git a/third_party/WebKit/Source/bindings/core/v8/V8NodeFilterCondition.cpp b/third_party/WebKit/Source/bindings/core/v8/V8NodeFilterCondition.cpp index a0f0d44..4b7da58 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8NodeFilterCondition.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8NodeFilterCondition.cpp @@ -101,7 +101,7 @@ unsigned V8NodeFilterCondition::acceptNode(Node* node, ExceptionState& exception } v8::Local<v8::Value> result; - if (!ScriptController::callFunction(m_scriptState->executionContext(), callback, receiver, 1, info.get(), isolate).ToLocal(&result)) { + if (!ScriptController::callFunction(m_scriptState->getExecutionContext(), callback, receiver, 1, info.get(), isolate).ToLocal(&result)) { exceptionState.rethrowV8Exception(exceptionCatcher.Exception()); return NodeFilter::FILTER_REJECT; } diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ObjectBuilder.h b/third_party/WebKit/Source/bindings/core/v8/V8ObjectBuilder.h index df75e7d..652fca7d 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8ObjectBuilder.h +++ b/third_party/WebKit/Source/bindings/core/v8/V8ObjectBuilder.h @@ -21,7 +21,7 @@ class CORE_EXPORT V8ObjectBuilder final { public: explicit V8ObjectBuilder(ScriptState*); - ScriptState* scriptState() const { return m_scriptState.get(); } + ScriptState* getScriptState() const { return m_scriptState.get(); } V8ObjectBuilder& add(const String& name, const V8ObjectBuilder&); diff --git a/third_party/WebKit/Source/bindings/core/v8/V8PerformanceObserverCallback.cpp b/third_party/WebKit/Source/bindings/core/v8/V8PerformanceObserverCallback.cpp index 7261466..8ef9ca9 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8PerformanceObserverCallback.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8PerformanceObserverCallback.cpp @@ -16,7 +16,7 @@ namespace blink { V8PerformanceObserverCallback::V8PerformanceObserverCallback(v8::Local<v8::Function> callback, v8::Local<v8::Object> owner, ScriptState* scriptState) - : ActiveDOMCallback(scriptState->executionContext()) + : ActiveDOMCallback(scriptState->getExecutionContext()) , m_callback(scriptState->isolate(), callback) , m_scriptState(scriptState) { @@ -58,7 +58,7 @@ void V8PerformanceObserverCallback::handleEvent(PerformanceObserverEntryList* en v8::TryCatch exceptionCatcher(m_scriptState->isolate()); exceptionCatcher.SetVerbose(true); - ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(m_scriptState->isolate()), thisObject, 2, argv, m_scriptState->isolate()); + ScriptController::callFunction(m_scriptState->getExecutionContext(), m_callback.newLocal(m_scriptState->isolate()), thisObject, 2, argv, m_scriptState->isolate()); } void V8PerformanceObserverCallback::setWeakCallback(const v8::WeakCallbackInfo<V8PerformanceObserverCallback>& data) diff --git a/third_party/WebKit/Source/bindings/core/v8/V8PerformanceObserverCallback.h b/third_party/WebKit/Source/bindings/core/v8/V8PerformanceObserverCallback.h index 2fb1b71..b75fbd6 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8PerformanceObserverCallback.h +++ b/third_party/WebKit/Source/bindings/core/v8/V8PerformanceObserverCallback.h @@ -26,7 +26,7 @@ public: DECLARE_VIRTUAL_TRACE(); void handleEvent(PerformanceObserverEntryList*, PerformanceObserver*) override; - ExecutionContext* executionContext() const override { return ContextLifecycleObserver::executionContext(); } + ExecutionContext* getExecutionContext() const override { return ContextLifecycleObserver::getExecutionContext(); } private: CORE_EXPORT V8PerformanceObserverCallback(v8::Local<v8::Function>, v8::Local<v8::Object>, ScriptState*); diff --git a/third_party/WebKit/Source/bindings/core/v8/V8WorkerGlobalScopeEventListener.cpp b/third_party/WebKit/Source/bindings/core/v8/V8WorkerGlobalScopeEventListener.cpp index 4955654..bed546f 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8WorkerGlobalScopeEventListener.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8WorkerGlobalScopeEventListener.cpp @@ -54,7 +54,7 @@ void V8WorkerGlobalScopeEventListener::handleEvent(ScriptState* scriptState, Eve // See issue 889829. RefPtrWillBeRawPtr<V8AbstractEventListener> protect(this); - WorkerOrWorkletScriptController* script = toWorkerGlobalScope(scriptState->executionContext())->scriptController(); + WorkerOrWorkletScriptController* script = toWorkerGlobalScope(scriptState->getExecutionContext())->scriptController(); if (!script) return; @@ -77,7 +77,7 @@ v8::Local<v8::Value> V8WorkerGlobalScopeEventListener::callListenerFunction(Scri return v8::Local<v8::Value>(); v8::Local<v8::Value> parameters[1] = { jsEvent }; - v8::MaybeLocal<v8::Value> maybeResult = V8ScriptRunner::callFunction(handlerFunction, scriptState->executionContext(), receiver, WTF_ARRAY_LENGTH(parameters), parameters, isolate()); + v8::MaybeLocal<v8::Value> maybeResult = V8ScriptRunner::callFunction(handlerFunction, scriptState->getExecutionContext(), receiver, WTF_ARRAY_LENGTH(parameters), parameters, isolate()); TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "UpdateCounters", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateCountersEvent::data()); @@ -91,7 +91,7 @@ v8::Local<v8::Value> V8WorkerGlobalScopeEventListener::callListenerFunction(Scri // This is almost identical to V8AbstractEventListener::getReceiverObject(). v8::Local<v8::Object> V8WorkerGlobalScopeEventListener::getReceiverObject(ScriptState* scriptState, Event* event) { - v8::Local<v8::Object> listener = getListenerObject(scriptState->executionContext()); + v8::Local<v8::Object> listener = getListenerObject(scriptState->getExecutionContext()); if (!listener.IsEmpty() && !listener->IsFunction()) return listener; diff --git a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp index 60c4b8c..19e6242 100644 --- a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp @@ -257,7 +257,7 @@ bool WindowProxy::initialize() if (m_world->isMainWorld()) { // ActivityLogger for main world is updated within updateDocument(). updateDocument(); - origin = m_frame->securityContext()->securityOrigin(); + origin = m_frame->securityContext()->getSecurityOrigin(); // FIXME: Can this be removed when CSP moves to browser? ContentSecurityPolicy* csp = m_frame->securityContext()->contentSecurityPolicy(); context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSecurityPolicy::SuppressReport)); @@ -475,7 +475,7 @@ void WindowProxy::setSecurityToken(SecurityOrigin* origin) if (m_world->isPrivateScriptIsolatedWorld()) { token = "private-script://" + token; } else if (m_world->isIsolatedWorld()) { - SecurityOrigin* frameSecurityOrigin = m_frame->securityContext()->securityOrigin(); + SecurityOrigin* frameSecurityOrigin = m_frame->securityContext()->getSecurityOrigin(); String frameSecurityToken = frameSecurityOrigin->toString(); // We need to check the return value of domainWasSetInDOM() on the // frame's SecurityOrigin because, if that's the case, only @@ -504,7 +504,7 @@ void WindowProxy::updateDocument() return; updateActivityLogger(); updateDocumentProperty(); - updateSecurityOrigin(m_frame->securityContext()->securityOrigin()); + updateSecurityOrigin(m_frame->securityContext()->getSecurityOrigin()); } static v8::Local<v8::Value> getNamedProperty(HTMLDocument* htmlDocument, const AtomicString& key, v8::Local<v8::Object> creationContext, v8::Isolate* isolate) diff --git a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.h b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.h index e5fab9f..64c2768 100644 --- a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.h +++ b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.h @@ -59,7 +59,7 @@ public: DECLARE_TRACE(); v8::Local<v8::Context> contextIfInitialized() const { return m_scriptState ? m_scriptState->context() : v8::Local<v8::Context>(); } - ScriptState* scriptState() const { return m_scriptState.get(); } + ScriptState* getScriptState() const { return m_scriptState.get(); } // Update document object of the frame. void updateDocument(); diff --git a/third_party/WebKit/Source/bindings/core/v8/WindowProxyManager.cpp b/third_party/WebKit/Source/bindings/core/v8/WindowProxyManager.cpp index b523afb..db724b7 100644 --- a/third_party/WebKit/Source/bindings/core/v8/WindowProxyManager.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/WindowProxyManager.cpp @@ -78,7 +78,7 @@ void WindowProxyManager::collectIsolatedContexts(Vector<std::pair<ScriptState*, SecurityOrigin* origin = isolatedWorldWindowProxy->world().isolatedWorldSecurityOrigin(); if (!isolatedWorldWindowProxy->isContextInitialized()) continue; - result.append(std::make_pair(isolatedWorldWindowProxy->scriptState(), origin)); + result.append(std::make_pair(isolatedWorldWindowProxy->getScriptState(), origin)); } } diff --git a/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp b/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp index fbdbb4d..e0e0c22 100644 --- a/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp @@ -152,7 +152,7 @@ bool WorkerOrWorkletScriptController::initializeContextIfNeeded() WorkerThreadDebugger::setContextDebugData(context); // Create a new JS object and use it as the prototype for the shadow global object. - const WrapperTypeInfo* wrapperTypeInfo = m_globalScope->scriptWrappable()->wrapperTypeInfo(); + const WrapperTypeInfo* wrapperTypeInfo = m_globalScope->getScriptWrappable()->wrapperTypeInfo(); v8::Local<v8::Function> globalScopeConstructor = m_scriptState->perContextData()->constructorForType(wrapperTypeInfo); if (globalScopeConstructor.IsEmpty()) @@ -164,7 +164,7 @@ bool WorkerOrWorkletScriptController::initializeContextIfNeeded() return false; } - jsGlobalScope = V8DOMWrapper::associateObjectWithWrapper(m_isolate, m_globalScope->scriptWrappable(), wrapperTypeInfo, jsGlobalScope); + jsGlobalScope = V8DOMWrapper::associateObjectWithWrapper(m_isolate, m_globalScope->getScriptWrappable(), wrapperTypeInfo, jsGlobalScope); // Insert the object instance as the prototype of the shadow object. v8::Local<v8::Object> globalObject = v8::Local<v8::Object>::Cast(m_scriptState->context()->Global()->GetPrototype()); diff --git a/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.h b/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.h index 9ae090f..208b9a0 100644 --- a/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.h +++ b/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.h @@ -83,7 +83,7 @@ public: void disableEval(const String&); // Used by Inspector agents: - ScriptState* scriptState() { return m_scriptState.get(); } + ScriptState* getScriptState() { return m_scriptState.get(); } // Used by V8 bindings: v8::Local<v8::Context> context() { return m_scriptState ? m_scriptState->context() : v8::Local<v8::Context>(); } diff --git a/third_party/WebKit/Source/bindings/modules/v8/ScriptValueSerializerForModules.cpp b/third_party/WebKit/Source/bindings/modules/v8/ScriptValueSerializerForModules.cpp index 7a984be..4f0ce8a 100644 --- a/third_party/WebKit/Source/bindings/modules/v8/ScriptValueSerializerForModules.cpp +++ b/third_party/WebKit/Source/bindings/modules/v8/ScriptValueSerializerForModules.cpp @@ -342,8 +342,8 @@ bool SerializedScriptValueReaderForModules::readDOMFileSystem(v8::Local<v8::Valu return false; if (!readWebCoreString(&url)) return false; - DOMFileSystem* fs = DOMFileSystem::create(scriptState()->executionContext(), name, static_cast<FileSystemType>(type), KURL(ParsedURLString, url)); - *value = toV8(fs, scriptState()->context()->Global(), isolate()); + DOMFileSystem* fs = DOMFileSystem::create(getScriptState()->getExecutionContext(), name, static_cast<FileSystemType>(type), KURL(ParsedURLString, url)); + *value = toV8(fs, getScriptState()->context()->Global(), isolate()); return !value->IsEmpty(); } @@ -400,7 +400,7 @@ bool SerializedScriptValueReaderForModules::readCryptoKey(v8::Local<v8::Value>* return false; } - *value = toV8(CryptoKey::create(key), scriptState()->context()->Global(), isolate()); + *value = toV8(CryptoKey::create(key), getScriptState()->context()->Global(), isolate()); return !value->IsEmpty(); } diff --git a/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModulesTest.cpp b/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModulesTest.cpp index a2dacf1..25d91f5 100644 --- a/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModulesTest.cpp +++ b/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModulesTest.cpp @@ -105,7 +105,7 @@ public: { } - ScriptState* scriptState() const { return m_scope.scriptState(); } + ScriptState* getScriptState() const { return m_scope.getScriptState(); } private: V8TestingScope m_scope; @@ -113,13 +113,13 @@ private: TEST_F(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyStringValue) { - v8::Isolate* isolate = scriptState()->isolate(); + v8::Isolate* isolate = getScriptState()->isolate(); // object = { foo: "zoo" } v8::Local<v8::Object> object = v8::Object::New(isolate); - ASSERT_TRUE(v8CallBoolean(object->Set(scriptState()->context(), v8AtomicString(isolate, "foo"), v8AtomicString(isolate, "zoo")))); + ASSERT_TRUE(v8CallBoolean(object->Set(getScriptState()->context(), v8AtomicString(isolate, "foo"), v8AtomicString(isolate, "zoo")))); - ScriptValue scriptValue(scriptState(), object); + ScriptValue scriptValue(getScriptState(), object); checkKeyPathStringValue(isolate, scriptValue, "foo", "zoo"); checkKeyPathNullValue(isolate, scriptValue, "bar"); @@ -127,13 +127,13 @@ TEST_F(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyStringValue) TEST_F(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyNumberValue) { - v8::Isolate* isolate = scriptState()->isolate(); + v8::Isolate* isolate = getScriptState()->isolate(); // object = { foo: 456 } v8::Local<v8::Object> object = v8::Object::New(isolate); - ASSERT_TRUE(v8CallBoolean(object->Set(scriptState()->context(), v8AtomicString(isolate, "foo"), v8::Number::New(isolate, 456)))); + ASSERT_TRUE(v8CallBoolean(object->Set(getScriptState()->context(), v8AtomicString(isolate, "foo"), v8::Number::New(isolate, 456)))); - ScriptValue scriptValue(scriptState(), object); + ScriptValue scriptValue(getScriptState(), object); checkKeyPathNumberValue(isolate, scriptValue, "foo", 456); checkKeyPathNullValue(isolate, scriptValue, "bar"); @@ -141,15 +141,15 @@ TEST_F(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyNumberValue) TEST_F(IDBKeyFromValueAndKeyPathTest, SubProperty) { - v8::Isolate* isolate = scriptState()->isolate(); + v8::Isolate* isolate = getScriptState()->isolate(); // object = { foo: { bar: "zee" } } v8::Local<v8::Object> object = v8::Object::New(isolate); v8::Local<v8::Object> subProperty = v8::Object::New(isolate); - ASSERT_TRUE(v8CallBoolean(subProperty->Set(scriptState()->context(), v8AtomicString(isolate, "bar"), v8AtomicString(isolate, "zee")))); - ASSERT_TRUE(v8CallBoolean(object->Set(scriptState()->context(), v8AtomicString(isolate, "foo"), subProperty))); + ASSERT_TRUE(v8CallBoolean(subProperty->Set(getScriptState()->context(), v8AtomicString(isolate, "bar"), v8AtomicString(isolate, "zee")))); + ASSERT_TRUE(v8CallBoolean(object->Set(getScriptState()->context(), v8AtomicString(isolate, "foo"), subProperty))); - ScriptValue scriptValue(scriptState(), object); + ScriptValue scriptValue(getScriptState(), object); checkKeyPathStringValue(isolate, scriptValue, "foo.bar", "zee"); checkKeyPathNullValue(isolate, scriptValue, "bar"); @@ -160,54 +160,54 @@ class InjectIDBKeyTest : public IDBKeyFromValueAndKeyPathTest { TEST_F(InjectIDBKeyTest, ImplicitValues) { - v8::Isolate* isolate = scriptState()->isolate(); + v8::Isolate* isolate = getScriptState()->isolate(); { v8::Local<v8::String> string = v8String(isolate, "string"); - ScriptValue value = ScriptValue(scriptState(), string); - checkInjectionIgnored(scriptState(), IDBKey::createNumber(123), value, "length"); + ScriptValue value = ScriptValue(getScriptState(), string); + checkInjectionIgnored(getScriptState(), IDBKey::createNumber(123), value, "length"); } { v8::Local<v8::Array> array = v8::Array::New(isolate); - ScriptValue value = ScriptValue(scriptState(), array); - checkInjectionIgnored(scriptState(), IDBKey::createNumber(456), value, "length"); + ScriptValue value = ScriptValue(getScriptState(), array); + checkInjectionIgnored(getScriptState(), IDBKey::createNumber(456), value, "length"); } } TEST_F(InjectIDBKeyTest, TopLevelPropertyStringValue) { - v8::Isolate* isolate = scriptState()->isolate(); + v8::Isolate* isolate = getScriptState()->isolate(); // object = { foo: "zoo" } v8::Local<v8::Object> object = v8::Object::New(isolate); - ASSERT_TRUE(v8CallBoolean(object->Set(scriptState()->context(), v8AtomicString(isolate, "foo"), v8AtomicString(isolate, "zoo")))); + ASSERT_TRUE(v8CallBoolean(object->Set(getScriptState()->context(), v8AtomicString(isolate, "foo"), v8AtomicString(isolate, "zoo")))); - ScriptValue scriptObject(scriptState(), object); - checkInjection(scriptState(), IDBKey::createString("myNewKey"), scriptObject, "bar"); - checkInjection(scriptState(), IDBKey::createNumber(1234), scriptObject, "bar"); + ScriptValue scriptObject(getScriptState(), object); + checkInjection(getScriptState(), IDBKey::createString("myNewKey"), scriptObject, "bar"); + checkInjection(getScriptState(), IDBKey::createNumber(1234), scriptObject, "bar"); - checkInjectionDisallowed(scriptState(), scriptObject, "foo.bar"); + checkInjectionDisallowed(getScriptState(), scriptObject, "foo.bar"); } TEST_F(InjectIDBKeyTest, SubProperty) { - v8::Isolate* isolate = scriptState()->isolate(); + v8::Isolate* isolate = getScriptState()->isolate(); // object = { foo: { bar: "zee" } } v8::Local<v8::Object> object = v8::Object::New(isolate); v8::Local<v8::Object> subProperty = v8::Object::New(isolate); - ASSERT_TRUE(v8CallBoolean(subProperty->Set(scriptState()->context(), v8AtomicString(isolate, "bar"), v8AtomicString(isolate, "zee")))); - ASSERT_TRUE(v8CallBoolean(object->Set(scriptState()->context(), v8AtomicString(isolate, "foo"), subProperty))); - - ScriptValue scriptObject(scriptState(), object); - checkInjection(scriptState(), IDBKey::createString("myNewKey"), scriptObject, "foo.baz"); - checkInjection(scriptState(), IDBKey::createNumber(789), scriptObject, "foo.baz"); - checkInjection(scriptState(), IDBKey::createDate(4567), scriptObject, "foo.baz"); - checkInjection(scriptState(), IDBKey::createDate(4567), scriptObject, "bar"); - checkInjection(scriptState(), IDBKey::createArray(IDBKey::KeyArray()), scriptObject, "foo.baz"); - checkInjection(scriptState(), IDBKey::createArray(IDBKey::KeyArray()), scriptObject, "bar"); - - checkInjectionDisallowed(scriptState(), scriptObject, "foo.bar.baz"); - checkInjection(scriptState(), IDBKey::createString("zoo"), scriptObject, "foo.xyz.foo"); + ASSERT_TRUE(v8CallBoolean(subProperty->Set(getScriptState()->context(), v8AtomicString(isolate, "bar"), v8AtomicString(isolate, "zee")))); + ASSERT_TRUE(v8CallBoolean(object->Set(getScriptState()->context(), v8AtomicString(isolate, "foo"), subProperty))); + + ScriptValue scriptObject(getScriptState(), object); + checkInjection(getScriptState(), IDBKey::createString("myNewKey"), scriptObject, "foo.baz"); + checkInjection(getScriptState(), IDBKey::createNumber(789), scriptObject, "foo.baz"); + checkInjection(getScriptState(), IDBKey::createDate(4567), scriptObject, "foo.baz"); + checkInjection(getScriptState(), IDBKey::createDate(4567), scriptObject, "bar"); + checkInjection(getScriptState(), IDBKey::createArray(IDBKey::KeyArray()), scriptObject, "foo.baz"); + checkInjection(getScriptState(), IDBKey::createArray(IDBKey::KeyArray()), scriptObject, "bar"); + + checkInjectionDisallowed(getScriptState(), scriptObject, "foo.bar.baz"); + checkInjection(getScriptState(), IDBKey::createString("zoo"), scriptObject, "foo.xyz.foo"); } } // namespace diff --git a/third_party/WebKit/Source/bindings/modules/v8/custom/V8CustomSQLStatementErrorCallback.cpp b/third_party/WebKit/Source/bindings/modules/v8/custom/V8CustomSQLStatementErrorCallback.cpp index f3bb73ec..20a6aef 100644 --- a/third_party/WebKit/Source/bindings/modules/v8/custom/V8CustomSQLStatementErrorCallback.cpp +++ b/third_party/WebKit/Source/bindings/modules/v8/custom/V8CustomSQLStatementErrorCallback.cpp @@ -74,7 +74,7 @@ bool V8SQLStatementErrorCallback::handleEvent(SQLTransaction* transaction, SQLEr // statement, if any, or onto the next overall step otherwise. Otherwise, // the error callback did not return false, or there was no error callback. // Jump to the last step in the overall steps. - if (!ScriptController::callFunction(executionContext(), m_callback.newLocal(isolate), m_scriptState->context()->Global(), WTF_ARRAY_LENGTH(argv), argv, isolate).ToLocal(&result)) + if (!ScriptController::callFunction(getExecutionContext(), m_callback.newLocal(isolate), m_scriptState->context()->Global(), WTF_ARRAY_LENGTH(argv), argv, isolate).ToLocal(&result)) return true; bool value; diff --git a/third_party/WebKit/Source/bindings/scripts/v8_types.py b/third_party/WebKit/Source/bindings/scripts/v8_types.py index 5df76db..3c60c1f 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_types.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_types.py @@ -886,7 +886,7 @@ CPP_VALUE_TO_V8_VALUE = { 'StringOrNull': '{cpp_value}.isNull() ? v8::Local<v8::Value>(v8::Null({isolate})) : v8String({isolate}, {cpp_value})', # Special cases 'Dictionary': '{cpp_value}.v8Value()', - 'EventHandler': '{cpp_value} ? v8::Local<v8::Value>(V8AbstractEventListener::cast({cpp_value})->getListenerObject(impl->executionContext())) : v8::Local<v8::Value>(v8::Null({isolate}))', + 'EventHandler': '{cpp_value} ? v8::Local<v8::Value>(V8AbstractEventListener::cast({cpp_value})->getListenerObject(impl->getExecutionContext())) : v8::Local<v8::Value>(v8::Null({isolate}))', 'ScriptValue': '{cpp_value}.v8Value()', 'SerializedScriptValue': '{cpp_value} ? {cpp_value}->deserialize() : v8::Local<v8::Value>(v8::Null({isolate}))', # General diff --git a/third_party/WebKit/Source/bindings/templates/callback_interface.cpp b/third_party/WebKit/Source/bindings/templates/callback_interface.cpp index 1e57223..22f1506 100644 --- a/third_party/WebKit/Source/bindings/templates/callback_interface.cpp +++ b/third_party/WebKit/Source/bindings/templates/callback_interface.cpp @@ -8,7 +8,7 @@ namespace blink { {{v8_class}}::{{v8_class}}(v8::Local<v8::Function> callback, ScriptState* scriptState) - : ActiveDOMCallback(scriptState->executionContext()) + : ActiveDOMCallback(scriptState->getExecutionContext()) , m_scriptState(scriptState) { m_callback.set(scriptState->isolate(), callback); @@ -63,10 +63,10 @@ DEFINE_TRACE({{v8_class}}) {% if method.idl_type == 'boolean' %} v8::TryCatch exceptionCatcher(m_scriptState->isolate()); exceptionCatcher.SetVerbose(true); - ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(m_scriptState->isolate()), {{this_handle_parameter}}{{method.arguments | length}}, argv, m_scriptState->isolate()); + ScriptController::callFunction(m_scriptState->getExecutionContext(), m_callback.newLocal(m_scriptState->isolate()), {{this_handle_parameter}}{{method.arguments | length}}, argv, m_scriptState->isolate()); return !exceptionCatcher.HasCaught(); {% else %}{# void #} - ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(m_scriptState->isolate()), {{this_handle_parameter}}{{method.arguments | length}}, argv, m_scriptState->isolate()); + ScriptController::callFunction(m_scriptState->getExecutionContext(), m_callback.newLocal(m_scriptState->isolate()), {{this_handle_parameter}}{{method.arguments | length}}, argv, m_scriptState->isolate()); {% endif %} } diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackInterface.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackInterface.cpp index 6f9bdad..94735c0 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackInterface.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackInterface.cpp @@ -18,7 +18,7 @@ namespace blink { V8TestCallbackInterface::V8TestCallbackInterface(v8::Local<v8::Function> callback, ScriptState* scriptState) - : ActiveDOMCallback(scriptState->executionContext()) + : ActiveDOMCallback(scriptState->getExecutionContext()) , m_scriptState(scriptState) { m_callback.set(scriptState->isolate(), callback); @@ -45,7 +45,7 @@ void V8TestCallbackInterface::voidMethod() ScriptState::Scope scope(m_scriptState.get()); v8::Local<v8::Value> *argv = 0; - ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(m_scriptState->isolate()), v8::Undefined(m_scriptState->isolate()), 0, argv, m_scriptState->isolate()); + ScriptController::callFunction(m_scriptState->getExecutionContext(), m_callback.newLocal(m_scriptState->isolate()), v8::Undefined(m_scriptState->isolate()), 0, argv, m_scriptState->isolate()); } bool V8TestCallbackInterface::booleanMethod() @@ -61,7 +61,7 @@ bool V8TestCallbackInterface::booleanMethod() v8::TryCatch exceptionCatcher(m_scriptState->isolate()); exceptionCatcher.SetVerbose(true); - ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(m_scriptState->isolate()), v8::Undefined(m_scriptState->isolate()), 0, argv, m_scriptState->isolate()); + ScriptController::callFunction(m_scriptState->getExecutionContext(), m_callback.newLocal(m_scriptState->isolate()), v8::Undefined(m_scriptState->isolate()), 0, argv, m_scriptState->isolate()); return !exceptionCatcher.HasCaught(); } @@ -82,7 +82,7 @@ void V8TestCallbackInterface::voidMethodBooleanArg(bool boolArg) } v8::Local<v8::Value> argv[] = { boolArgHandle }; - ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(m_scriptState->isolate()), v8::Undefined(m_scriptState->isolate()), 1, argv, m_scriptState->isolate()); + ScriptController::callFunction(m_scriptState->getExecutionContext(), m_callback.newLocal(m_scriptState->isolate()), v8::Undefined(m_scriptState->isolate()), 1, argv, m_scriptState->isolate()); } void V8TestCallbackInterface::voidMethodSequenceArg(const Vector<RefPtr<TestInterfaceEmpty>>& sequenceArg) @@ -102,7 +102,7 @@ void V8TestCallbackInterface::voidMethodSequenceArg(const Vector<RefPtr<TestInte } v8::Local<v8::Value> argv[] = { sequenceArgHandle }; - ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(m_scriptState->isolate()), v8::Undefined(m_scriptState->isolate()), 1, argv, m_scriptState->isolate()); + ScriptController::callFunction(m_scriptState->getExecutionContext(), m_callback.newLocal(m_scriptState->isolate()), v8::Undefined(m_scriptState->isolate()), 1, argv, m_scriptState->isolate()); } void V8TestCallbackInterface::voidMethodFloatArg(float floatArg) @@ -122,7 +122,7 @@ void V8TestCallbackInterface::voidMethodFloatArg(float floatArg) } v8::Local<v8::Value> argv[] = { floatArgHandle }; - ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(m_scriptState->isolate()), v8::Undefined(m_scriptState->isolate()), 1, argv, m_scriptState->isolate()); + ScriptController::callFunction(m_scriptState->getExecutionContext(), m_callback.newLocal(m_scriptState->isolate()), v8::Undefined(m_scriptState->isolate()), 1, argv, m_scriptState->isolate()); } void V8TestCallbackInterface::voidMethodTestInterfaceEmptyArg(TestInterfaceEmpty* testInterfaceEmptyArg) @@ -142,7 +142,7 @@ void V8TestCallbackInterface::voidMethodTestInterfaceEmptyArg(TestInterfaceEmpty } v8::Local<v8::Value> argv[] = { testInterfaceEmptyArgHandle }; - ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(m_scriptState->isolate()), v8::Undefined(m_scriptState->isolate()), 1, argv, m_scriptState->isolate()); + ScriptController::callFunction(m_scriptState->getExecutionContext(), m_callback.newLocal(m_scriptState->isolate()), v8::Undefined(m_scriptState->isolate()), 1, argv, m_scriptState->isolate()); } void V8TestCallbackInterface::voidMethodTestInterfaceEmptyStringArg(TestInterfaceEmpty* testInterfaceEmptyArg, const String& stringArg) @@ -168,7 +168,7 @@ void V8TestCallbackInterface::voidMethodTestInterfaceEmptyStringArg(TestInterfac } v8::Local<v8::Value> argv[] = { testInterfaceEmptyArgHandle, stringArgHandle }; - ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(m_scriptState->isolate()), v8::Undefined(m_scriptState->isolate()), 2, argv, m_scriptState->isolate()); + ScriptController::callFunction(m_scriptState->getExecutionContext(), m_callback.newLocal(m_scriptState->isolate()), v8::Undefined(m_scriptState->isolate()), 2, argv, m_scriptState->isolate()); } void V8TestCallbackInterface::callbackWithThisValueVoidMethodStringArg(ScriptValue thisValue, const String& stringArg) @@ -194,7 +194,7 @@ void V8TestCallbackInterface::callbackWithThisValueVoidMethodStringArg(ScriptVal } v8::Local<v8::Value> argv[] = { stringArgHandle }; - ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(m_scriptState->isolate()), thisHandle, 1, argv, m_scriptState->isolate()); + ScriptController::callFunction(m_scriptState->getExecutionContext(), m_callback.newLocal(m_scriptState->isolate()), thisHandle, 1, argv, m_scriptState->isolate()); } void V8TestCallbackInterface::voidMethodWillBeGarbageCollectedSequenceArg(const WillBeHeapVector<RefPtrWillBeMember<TestInterfaceWillBeGarbageCollected>>& sequenceArg) @@ -214,7 +214,7 @@ void V8TestCallbackInterface::voidMethodWillBeGarbageCollectedSequenceArg(const } v8::Local<v8::Value> argv[] = { sequenceArgHandle }; - ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(m_scriptState->isolate()), v8::Undefined(m_scriptState->isolate()), 1, argv, m_scriptState->isolate()); + ScriptController::callFunction(m_scriptState->getExecutionContext(), m_callback.newLocal(m_scriptState->isolate()), v8::Undefined(m_scriptState->isolate()), 1, argv, m_scriptState->isolate()); } void V8TestCallbackInterface::voidMethodWillBeGarbageCollectedArrayArg(const WillBeHeapVector<RefPtrWillBeMember<TestInterfaceWillBeGarbageCollected>>& arrayArg) @@ -234,7 +234,7 @@ void V8TestCallbackInterface::voidMethodWillBeGarbageCollectedArrayArg(const Wil } v8::Local<v8::Value> argv[] = { arrayArgHandle }; - ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(m_scriptState->isolate()), v8::Undefined(m_scriptState->isolate()), 1, argv, m_scriptState->isolate()); + ScriptController::callFunction(m_scriptState->getExecutionContext(), m_callback.newLocal(m_scriptState->isolate()), v8::Undefined(m_scriptState->isolate()), 1, argv, m_scriptState->isolate()); } } // namespace blink diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp index 810b29a..ae452ba 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp @@ -1143,7 +1143,7 @@ static void implementsEventHandlerAttributeAttributeGetter(const v8::FunctionCal v8::Local<v8::Object> holder = info.Holder(); TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); EventListener* cppValue(impl->implementsEventHandlerAttribute()); - v8SetReturnValue(info, cppValue ? v8::Local<v8::Value>(V8AbstractEventListener::cast(cppValue)->getListenerObject(impl->executionContext())) : v8::Local<v8::Value>(v8::Null(info.GetIsolate()))); + v8SetReturnValue(info, cppValue ? v8::Local<v8::Value>(V8AbstractEventListener::cast(cppValue)->getListenerObject(impl->getExecutionContext())) : v8::Local<v8::Value>(v8::Null(info.GetIsolate()))); } static void implementsEventHandlerAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp index 330fc20..e8fa04b 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp @@ -111,7 +111,7 @@ static void eventHandlerAttributeAttributeGetter(const v8::FunctionCallbackInfo< v8::Local<v8::Object> holder = info.Holder(); TestInterfaceNode* impl = V8TestInterfaceNode::toImpl(holder); EventListener* cppValue(impl->eventHandlerAttribute()); - v8SetReturnValue(info, cppValue ? v8::Local<v8::Value>(V8AbstractEventListener::cast(cppValue)->getListenerObject(impl->executionContext())) : v8::Local<v8::Value>(v8::Null(info.GetIsolate()))); + v8SetReturnValue(info, cppValue ? v8::Local<v8::Value>(V8AbstractEventListener::cast(cppValue)->getListenerObject(impl->getExecutionContext())) : v8::Local<v8::Value>(v8::Null(info.GetIsolate()))); } static void eventHandlerAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp index 8e79a8e..8c0c6b3 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp @@ -1819,7 +1819,7 @@ static void eventHandlerAttributeAttributeGetter(const v8::FunctionCallbackInfo< v8::Local<v8::Object> holder = info.Holder(); TestObject* impl = V8TestObject::toImpl(holder); EventListener* cppValue(impl->eventHandlerAttribute()); - v8SetReturnValue(info, cppValue ? v8::Local<v8::Value>(V8AbstractEventListener::cast(cppValue)->getListenerObject(impl->executionContext())) : v8::Local<v8::Value>(v8::Null(info.GetIsolate()))); + v8SetReturnValue(info, cppValue ? v8::Local<v8::Value>(V8AbstractEventListener::cast(cppValue)->getListenerObject(impl->getExecutionContext())) : v8::Local<v8::Value>(v8::Null(info.GetIsolate()))); } static void eventHandlerAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) diff --git a/third_party/WebKit/Source/core/animation/Animation.cpp b/third_party/WebKit/Source/core/animation/Animation.cpp index 38bb75c..bd2be7e 100644 --- a/third_party/WebKit/Source/core/animation/Animation.cpp +++ b/third_party/WebKit/Source/core/animation/Animation.cpp @@ -613,7 +613,7 @@ void Animation::finish(ExceptionState& exceptionState) ScriptPromise Animation::finished(ScriptState* scriptState) { if (!m_finishedPromise) { - m_finishedPromise = new AnimationPromise(scriptState->executionContext(), this, AnimationPromise::Finished); + m_finishedPromise = new AnimationPromise(scriptState->getExecutionContext(), this, AnimationPromise::Finished); if (playStateInternal() == Finished) m_finishedPromise->resolve(this); } @@ -623,7 +623,7 @@ ScriptPromise Animation::finished(ScriptState* scriptState) ScriptPromise Animation::ready(ScriptState* scriptState) { if (!m_readyPromise) { - m_readyPromise = new AnimationPromise(scriptState->executionContext(), this, AnimationPromise::Ready); + m_readyPromise = new AnimationPromise(scriptState->getExecutionContext(), this, AnimationPromise::Ready); if (playStateInternal() != Pending) m_readyPromise->resolve(this); } @@ -635,9 +635,9 @@ const AtomicString& Animation::interfaceName() const return EventTargetNames::AnimationPlayer; } -ExecutionContext* Animation::executionContext() const +ExecutionContext* Animation::getExecutionContext() const { - return ContextLifecycleObserver::executionContext(); + return ContextLifecycleObserver::getExecutionContext(); } bool Animation::hasPendingActivity() const @@ -831,7 +831,7 @@ bool Animation::update(TimingUpdateReason reason) if (reason == TimingUpdateForAnimationFrame && (idle || hasStartTime())) { if (idle) { const AtomicString& eventType = EventTypeNames::cancel; - if (executionContext() && hasEventListeners(eventType)) { + if (getExecutionContext() && hasEventListeners(eventType)) { double eventCurrentTime = nullValue(); m_pendingCancelledEvent = AnimationPlayerEvent::create(eventType, eventCurrentTime, timeline()->currentTime()); m_pendingCancelledEvent->setTarget(this); @@ -840,7 +840,7 @@ bool Animation::update(TimingUpdateReason reason) } } else { const AtomicString& eventType = EventTypeNames::finish; - if (executionContext() && hasEventListeners(eventType)) { + if (getExecutionContext() && hasEventListeners(eventType)) { double eventCurrentTime = currentTimeInternal() * 1000; m_pendingFinishedEvent = AnimationPlayerEvent::create(eventType, eventCurrentTime, timeline()->currentTime()); m_pendingFinishedEvent->setTarget(this); @@ -1052,7 +1052,7 @@ Animation::PlayStateUpdateScope::~PlayStateUpdateScope() bool Animation::addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener> listener, const EventListenerOptions& options) { if (eventType == EventTypeNames::finish) - UseCounter::count(executionContext(), UseCounter::AnimationFinishEvent); + UseCounter::count(getExecutionContext(), UseCounter::AnimationFinishEvent); return EventTargetWithInlineData::addEventListenerInternal(eventType, listener, options); } diff --git a/third_party/WebKit/Source/core/animation/Animation.h b/third_party/WebKit/Source/core/animation/Animation.h index d01236d..fb009a5 100644 --- a/third_party/WebKit/Source/core/animation/Animation.h +++ b/third_party/WebKit/Source/core/animation/Animation.h @@ -114,7 +114,7 @@ public: DEFINE_ATTRIBUTE_EVENT_LISTENER(cancel); const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; bool hasPendingActivity() const override; void contextDestroyed() override; diff --git a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp index 18b38a5..e037017 100644 --- a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp @@ -90,7 +90,7 @@ FontResource* CSSFontFaceSrcValue::fetch(Document* document) if (!m_fetched) { FetchRequest request(ResourceRequest(m_absoluteResource), FetchInitiatorTypeNames::css); request.setContentSecurityCheck(m_shouldCheckContentSecurityPolicy); - SecurityOrigin* securityOrigin = document->securityOrigin(); + SecurityOrigin* securityOrigin = document->getSecurityOrigin(); setCrossOriginAccessControl(request, securityOrigin); request.mutableResourceRequest().setHTTPReferrer(SecurityPolicy::generateReferrer(m_referrer.referrerPolicy, request.url(), m_referrer.referrer)); RefPtrWillBeRawPtr<FontResource> resource = FontResource::fetch(request, document->fetcher()); diff --git a/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp b/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp index aaf2bb0..29560b0 100644 --- a/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp @@ -120,7 +120,7 @@ StyleImage* CSSImageSetValue::cacheImage(Document* document, float deviceScaleFa request.mutableResourceRequest().setHTTPReferrer(image.referrer); if (crossOrigin != CrossOriginAttributeNotSet) - request.setCrossOriginAccessControl(document->securityOrigin(), crossOrigin); + request.setCrossOriginAccessControl(document->getSecurityOrigin(), crossOrigin); if (RefPtrWillBeRawPtr<ImageResource> cachedImage = ImageResource::fetch(request, document->fetcher())) m_cachedImage = StyleFetchedImageSet::create(cachedImage.get(), image.scaleFactor, this, request.url()); diff --git a/third_party/WebKit/Source/core/css/CSSImageValue.cpp b/third_party/WebKit/Source/core/css/CSSImageValue.cpp index b4df55b..81bf0fe 100644 --- a/third_party/WebKit/Source/core/css/CSSImageValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSImageValue.cpp @@ -66,7 +66,7 @@ StyleFetchedImage* CSSImageValue::cacheImage(Document* document, CrossOriginAttr request.mutableResourceRequest().setHTTPReferrer(SecurityPolicy::generateReferrer(m_referrer.referrerPolicy, request.url(), m_referrer.referrer)); if (crossOrigin != CrossOriginAttributeNotSet) - request.setCrossOriginAccessControl(document->securityOrigin(), crossOrigin); + request.setCrossOriginAccessControl(document->getSecurityOrigin(), crossOrigin); if (RefPtrWillBeRawPtr<ImageResource> cachedImage = ImageResource::fetch(request, document->fetcher())) m_cachedImage = StyleFetchedImage::create(cachedImage.get(), document, request.url()); diff --git a/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp b/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp index d3dacc2..0317960 100644 --- a/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp +++ b/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp @@ -268,9 +268,9 @@ bool CSSStyleSheet::canAccessRules() const Document* document = ownerDocument(); if (!document) return true; - if (document->securityOrigin()->canRequestNoSuborigin(baseURL)) + if (document->getSecurityOrigin()->canRequestNoSuborigin(baseURL)) return true; - if (m_allowRuleAccessFromOrigin && document->securityOrigin()->canAccessCheckSuborigins(m_allowRuleAccessFromOrigin.get())) + if (m_allowRuleAccessFromOrigin && document->getSecurityOrigin()->canAccessCheckSuborigins(m_allowRuleAccessFromOrigin.get())) return true; return false; } diff --git a/third_party/WebKit/Source/core/css/FontFace.cpp b/third_party/WebKit/Source/core/css/FontFace.cpp index 3c49e50..32f009a 100644 --- a/third_party/WebKit/Source/core/css/FontFace.cpp +++ b/third_party/WebKit/Source/core/css/FontFace.cpp @@ -361,7 +361,7 @@ void FontFace::setError(DOMException* error) ScriptPromise FontFace::fontStatusPromise(ScriptState* scriptState) { if (!m_loadedProperty) { - m_loadedProperty = new LoadedProperty(scriptState->executionContext(), this, LoadedProperty::Loaded); + m_loadedProperty = new LoadedProperty(scriptState->getExecutionContext(), this, LoadedProperty::Loaded); if (m_status == Loaded) m_loadedProperty->resolve(this); else if (m_status == Error) @@ -372,7 +372,7 @@ ScriptPromise FontFace::fontStatusPromise(ScriptState* scriptState) ScriptPromise FontFace::load(ScriptState* scriptState) { - loadInternal(scriptState->executionContext()); + loadInternal(scriptState->getExecutionContext()); return fontStatusPromise(scriptState); } @@ -646,7 +646,7 @@ bool FontFace::hadBlankText() const bool FontFace::hasPendingActivity() const { - return m_status == Loading && executionContext() && !executionContext()->activeDOMObjectsAreStopped(); + return m_status == Loading && getExecutionContext() && !getExecutionContext()->activeDOMObjectsAreStopped(); } } // namespace blink diff --git a/third_party/WebKit/Source/core/css/FontFaceSet.cpp b/third_party/WebKit/Source/core/css/FontFaceSet.cpp index 06f1c46..2673d28 100644 --- a/third_party/WebKit/Source/core/css/FontFaceSet.cpp +++ b/third_party/WebKit/Source/core/css/FontFaceSet.cpp @@ -117,7 +117,7 @@ FontFaceSet::FontFaceSet(Document& document) : ActiveDOMObject(&document) , m_shouldFireLoadingEvent(false) , m_isLoading(false) - , m_ready(new ReadyProperty(executionContext(), this, ReadyProperty::Ready)) + , m_ready(new ReadyProperty(getExecutionContext(), this, ReadyProperty::Ready)) , m_asyncRunner(AsyncMethodRunner<FontFaceSet>::create(this, &FontFaceSet::handlePendingEventsAndPromises)) { suspendIfNeeded(); @@ -132,12 +132,12 @@ FontFaceSet::~FontFaceSet() Document* FontFaceSet::document() const { - return toDocument(executionContext()); + return toDocument(getExecutionContext()); } bool FontFaceSet::inActiveDocumentContext() const { - ExecutionContext* context = executionContext(); + ExecutionContext* context = getExecutionContext(); return context && toDocument(context)->isActive(); } @@ -152,9 +152,9 @@ const AtomicString& FontFaceSet::interfaceName() const return EventTargetNames::FontFaceSet; } -ExecutionContext* FontFaceSet::executionContext() const +ExecutionContext* FontFaceSet::getExecutionContext() const { - return ActiveDOMObject::executionContext(); + return ActiveDOMObject::getExecutionContext(); } AtomicString FontFaceSet::status() const @@ -393,7 +393,7 @@ ScriptPromise FontFaceSet::load(ScriptState* scriptState, const String& fontStri RefPtrWillBeRawPtr<LoadFontPromiseResolver> resolver = LoadFontPromiseResolver::create(faces, scriptState); ScriptPromise promise = resolver->promise(); - resolver->loadFonts(executionContext()); // After this, resolver->promise() may return null. + resolver->loadFonts(getExecutionContext()); // After this, resolver->promise() may return null. return promise; } diff --git a/third_party/WebKit/Source/core/css/FontFaceSet.h b/third_party/WebKit/Source/core/css/FontFaceSet.h index a4cba76..223864d 100644 --- a/third_party/WebKit/Source/core/css/FontFaceSet.h +++ b/third_party/WebKit/Source/core/css/FontFaceSet.h @@ -89,7 +89,7 @@ public: size_t size() const; AtomicString status() const; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; const AtomicString& interfaceName() const override; Document* document() const; diff --git a/third_party/WebKit/Source/core/css/MediaQueryList.cpp b/third_party/WebKit/Source/core/css/MediaQueryList.cpp index 74e0b77..c13cf2c 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryList.cpp +++ b/third_party/WebKit/Source/core/css/MediaQueryList.cpp @@ -144,9 +144,9 @@ const AtomicString& MediaQueryList::interfaceName() const return EventTargetNames::MediaQueryList; } -ExecutionContext* MediaQueryList::executionContext() const +ExecutionContext* MediaQueryList::getExecutionContext() const { - return ContextLifecycleObserver::executionContext(); + return ContextLifecycleObserver::getExecutionContext(); } } // namespace blink diff --git a/third_party/WebKit/Source/core/css/MediaQueryList.h b/third_party/WebKit/Source/core/css/MediaQueryList.h index 37d2352..b5fb6f8 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryList.h +++ b/third_party/WebKit/Source/core/css/MediaQueryList.h @@ -72,7 +72,7 @@ public: void contextDestroyed() override; const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; private: MediaQueryList(ExecutionContext*, PassRefPtrWillBeRawPtr<MediaQueryMatcher>, PassRefPtrWillBeRawPtr<MediaQuerySet>); diff --git a/third_party/WebKit/Source/core/css/StyleRuleImport.cpp b/third_party/WebKit/Source/core/css/StyleRuleImport.cpp index 35a3723..4610135 100644 --- a/third_party/WebKit/Source/core/css/StyleRuleImport.cpp +++ b/third_party/WebKit/Source/core/css/StyleRuleImport.cpp @@ -93,7 +93,7 @@ void StyleRuleImport::setCSSStyleSheet(const String& href, const KURL& baseURL, m_styleSheet = StyleSheetContents::create(this, href, context); - m_styleSheet->parseAuthorStyleSheet(cachedStyleSheet, document ? document->securityOrigin() : 0); + m_styleSheet->parseAuthorStyleSheet(cachedStyleSheet, document ? document->getSecurityOrigin() : 0); m_loading = false; diff --git a/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp index 67ae3a2..33cf98c 100644 --- a/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp +++ b/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp @@ -83,7 +83,7 @@ void ScopedStyleResolver::appendCSSStyleSheet(CSSStyleSheet& cssSheet, const Med unsigned index = m_authorStyleSheets.size(); m_authorStyleSheets.append(&cssSheet); StyleSheetContents* sheet = cssSheet.contents(); - AddRuleFlags addRuleFlags = treeScope().document().securityOrigin()->canRequest(sheet->baseURL()) ? RuleHasDocumentSecurityOrigin : RuleHasNoSpecialState; + AddRuleFlags addRuleFlags = treeScope().document().getSecurityOrigin()->canRequest(sheet->baseURL()) ? RuleHasDocumentSecurityOrigin : RuleHasNoSpecialState; const RuleSet& ruleSet = sheet->ensureRuleSet(medium, addRuleFlags); addKeyframeRules(ruleSet); diff --git a/third_party/WebKit/Source/core/dom/ActiveDOMObject.cpp b/third_party/WebKit/Source/core/dom/ActiveDOMObject.cpp index c37ee77..21e8468 100644 --- a/third_party/WebKit/Source/core/dom/ActiveDOMObject.cpp +++ b/third_party/WebKit/Source/core/dom/ActiveDOMObject.cpp @@ -52,9 +52,9 @@ ActiveDOMObject::~ActiveDOMObject() ASSERT(m_suspendIfNeededCalled); - // Oilpan: not valid to access executionContext() in the destructor. + // Oilpan: not valid to access getExecutionContext() in the destructor. #if !ENABLE(OILPAN) - ASSERT(!executionContext() || executionContext()->isContextThread()); + ASSERT(!getExecutionContext() || getExecutionContext()->isContextThread()); #endif } @@ -64,7 +64,7 @@ void ActiveDOMObject::suspendIfNeeded() ASSERT(!m_suspendIfNeededCalled); m_suspendIfNeededCalled = true; #endif - if (ExecutionContext* context = executionContext()) + if (ExecutionContext* context = getExecutionContext()) context->suspendActiveDOMObjectIfNeeded(this); } diff --git a/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp b/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp index bf8cbb4d..f4f0b9b 100644 --- a/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp +++ b/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp @@ -48,7 +48,7 @@ void ContextLifecycleNotifier::notifyResumingActiveDOMObjects() if (observer->observerType() != ContextLifecycleObserver::ActiveDOMObjectType) continue; ActiveDOMObject* activeDOMObject = static_cast<ActiveDOMObject*>(observer); - ASSERT(activeDOMObject->executionContext() == context()); + ASSERT(activeDOMObject->getExecutionContext() == context()); ASSERT(activeDOMObject->suspendIfNeededCalled()); activeDOMObject->resume(); } @@ -67,7 +67,7 @@ void ContextLifecycleNotifier::notifySuspendingActiveDOMObjects() if (observer->observerType() != ContextLifecycleObserver::ActiveDOMObjectType) continue; ActiveDOMObject* activeDOMObject = static_cast<ActiveDOMObject*>(observer); - ASSERT(activeDOMObject->executionContext() == context()); + ASSERT(activeDOMObject->getExecutionContext() == context()); ASSERT(activeDOMObject->suspendIfNeededCalled()); activeDOMObject->suspend(); } @@ -86,7 +86,7 @@ void ContextLifecycleNotifier::notifyStoppingActiveDOMObjects() if (observer->observerType() != ContextLifecycleObserver::ActiveDOMObjectType) continue; ActiveDOMObject* activeDOMObject = static_cast<ActiveDOMObject*>(observer); - ASSERT(activeDOMObject->executionContext() == context()); + ASSERT(activeDOMObject->getExecutionContext() == context()); ASSERT(activeDOMObject->suspendIfNeededCalled()); activeDOMObject->stop(); } diff --git a/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.h b/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.h index 939e9be..37091e0 100644 --- a/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.h +++ b/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.h @@ -37,7 +37,7 @@ class ContextLifecycleNotifier; class CORE_EXPORT ContextLifecycleObserver : public LifecycleObserver<ExecutionContext, ContextLifecycleObserver, ContextLifecycleNotifier> { public: - ExecutionContext* executionContext() const { return lifecycleContext(); } + ExecutionContext* getExecutionContext() const { return lifecycleContext(); } enum Type { GenericType, diff --git a/third_party/WebKit/Source/core/dom/DOMImplementation.cpp b/third_party/WebKit/Source/core/dom/DOMImplementation.cpp index d7e98ed..16ed9f1 100644 --- a/third_party/WebKit/Source/core/dom/DOMImplementation.cpp +++ b/third_party/WebKit/Source/core/dom/DOMImplementation.cpp @@ -88,7 +88,7 @@ PassRefPtrWillBeRawPtr<XMLDocument> DOMImplementation::createDocument(const Atom doc = XMLDocument::create(init); } - doc->setSecurityOrigin(document().securityOrigin()->isolatedCopy()); + doc->setSecurityOrigin(document().getSecurityOrigin()->isolatedCopy()); doc->setContextFeatures(document().contextFeatures()); RefPtrWillBeRawPtr<Node> documentElement = nullptr; @@ -210,7 +210,7 @@ PassRefPtrWillBeRawPtr<HTMLDocument> DOMImplementation::createHTMLDocument(const headElement->appendChild(titleElement); titleElement->appendChild(d->createTextNode(title), ASSERT_NO_EXCEPTION); } - d->setSecurityOrigin(document().securityOrigin()->isolatedCopy()); + d->setSecurityOrigin(document().getSecurityOrigin()->isolatedCopy()); d->setContextFeatures(document().contextFeatures()); return d.release(); } diff --git a/third_party/WebKit/Source/core/dom/DOMURL.cpp b/third_party/WebKit/Source/core/dom/DOMURL.cpp index 95d938d..19be7c2 100644 --- a/third_party/WebKit/Source/core/dom/DOMURL.cpp +++ b/third_party/WebKit/Source/core/dom/DOMURL.cpp @@ -75,11 +75,11 @@ String DOMURL::createObjectURL(ExecutionContext* executionContext, Blob* blob, E String DOMURL::createPublicURL(ExecutionContext* executionContext, URLRegistrable* registrable, const String& uuid) { - KURL publicURL = BlobURL::createPublicURL(executionContext->securityOrigin()); + KURL publicURL = BlobURL::createPublicURL(executionContext->getSecurityOrigin()); if (publicURL.isEmpty()) return String(); - executionContext->publicURLManager().registerURL(executionContext->securityOrigin(), publicURL, registrable, uuid); + executionContext->publicURLManager().registerURL(executionContext->getSecurityOrigin(), publicURL, registrable, uuid); return publicURL.getString(); } diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp index 8070153..3e2e08c 100644 --- a/third_party/WebKit/Source/core/dom/Document.cpp +++ b/third_party/WebKit/Source/core/dom/Document.cpp @@ -2434,11 +2434,11 @@ void Document::open(Document* enteredDocument, ExceptionState& exceptionState) } if (enteredDocument) { - if (!securityOrigin()->canAccess(enteredDocument->securityOrigin())) { + if (!getSecurityOrigin()->canAccess(enteredDocument->getSecurityOrigin())) { exceptionState.throwSecurityError("Can only call open() on same-origin documents."); return; } - setSecurityOrigin(enteredDocument->securityOrigin()); + setSecurityOrigin(enteredDocument->getSecurityOrigin()); setURL(enteredDocument->url()); m_cookieURL = enteredDocument->cookieURL(); } @@ -2864,7 +2864,7 @@ void Document::write(const SegmentedString& text, Document* enteredDocument, Exc return; } - if (enteredDocument && !securityOrigin()->canAccess(enteredDocument->securityOrigin())) { + if (enteredDocument && !getSecurityOrigin()->canAccess(enteredDocument->getSecurityOrigin())) { exceptionState.throwSecurityError("Can only call write() on same-origin documents."); return; } @@ -3178,7 +3178,7 @@ void Document::processReferrerPolicy(const String& policy) String Document::outgoingReferrer() const { - if (securityOrigin()->isUnique()) { + if (getSecurityOrigin()->isUnique()) { // Return |no-referrer|. return String(); } @@ -3353,7 +3353,7 @@ void Document::cloneDataFromDocument(const Document& other) setCompatibilityMode(other.getCompatibilityMode()); setEncodingData(other.m_encodingData); setContextFeatures(other.contextFeatures()); - setSecurityOrigin(other.securityOrigin()->isolatedCopy()); + setSecurityOrigin(other.getSecurityOrigin()->isolatedCopy()); setMimeType(other.contentType()); } @@ -3394,9 +3394,9 @@ bool Document::isSecureContextImpl(String* errorMessage, const SecureContextChec if (SchemeRegistry::schemeShouldBypassSecureContextCheck(origin->protocol())) return true; } else { - if (!isOriginPotentiallyTrustworthy(securityOrigin(), errorMessage)) + if (!isOriginPotentiallyTrustworthy(getSecurityOrigin(), errorMessage)) return false; - if (SchemeRegistry::schemeShouldBypassSecureContextCheck(securityOrigin()->protocol())) + if (SchemeRegistry::schemeShouldBypassSecureContextCheck(getSecurityOrigin()->protocol())) return true; } @@ -3411,7 +3411,7 @@ bool Document::isSecureContextImpl(String* errorMessage, const SecureContextChec if (!isOriginPotentiallyTrustworthy(origin.get(), errorMessage)) return false; } else { - if (!isOriginPotentiallyTrustworthy(context->securityOrigin(), errorMessage)) + if (!isOriginPotentiallyTrustworthy(context->getSecurityOrigin(), errorMessage)) return false; } } @@ -3952,11 +3952,11 @@ EventListener* Document::getWindowAttributeEventListener(const AtomicString& eve return domWindow->getAttributeEventListener(eventType); } -EventQueue* Document::eventQueue() const +EventQueue* Document::getEventQueue() const { if (!m_domWindow) return 0; - return m_domWindow->eventQueue(); + return m_domWindow->getEventQueue(); } void Document::enqueueAnimationFrameEvent(PassRefPtrWillBeRawPtr<Event> event) @@ -4097,7 +4097,7 @@ String Document::cookie(ExceptionState& exceptionState) const // InvalidStateError exception on getting if the Document has no // browsing context. - if (!securityOrigin()->canAccessCookies()) { + if (!getSecurityOrigin()->canAccessCookies()) { if (isSandboxed(SandboxOrigin)) exceptionState.throwSecurityError("The document is sandboxed and lacks the 'allow-same-origin' flag."); else if (url().protocolIs("data")) @@ -4123,7 +4123,7 @@ void Document::setCookie(const String& value, ExceptionState& exceptionState) // InvalidStateError exception on setting if the Document has no // browsing context. - if (!securityOrigin()->canAccessCookies()) { + if (!getSecurityOrigin()->canAccessCookies()) { if (isSandboxed(SandboxOrigin)) exceptionState.throwSecurityError("The document is sandboxed and lacks the 'allow-same-origin' flag."); else if (url().protocolIs("data")) @@ -4149,7 +4149,7 @@ const AtomicString& Document::referrer() const String Document::domain() const { - return securityOrigin()->domain(); + return getSecurityOrigin()->domain(); } void Document::setDomain(const String& newDomain, ExceptionState& exceptionState) @@ -4161,8 +4161,8 @@ void Document::setDomain(const String& newDomain, ExceptionState& exceptionState return; } - if (SchemeRegistry::isDomainRelaxationForbiddenForURLScheme(securityOrigin()->protocol())) { - exceptionState.throwSecurityError("Assignment is forbidden for the '" + securityOrigin()->protocol() + "' scheme."); + if (SchemeRegistry::isDomainRelaxationForbiddenForURLScheme(getSecurityOrigin()->protocol())) { + exceptionState.throwSecurityError("Assignment is forbidden for the '" + getSecurityOrigin()->protocol() + "' scheme."); return; } @@ -4171,8 +4171,8 @@ void Document::setDomain(const String& newDomain, ExceptionState& exceptionState return; } - OriginAccessEntry accessEntry(securityOrigin()->protocol(), newDomain, OriginAccessEntry::AllowSubdomains); - OriginAccessEntry::MatchResult result = accessEntry.matchesOrigin(*securityOrigin()); + OriginAccessEntry accessEntry(getSecurityOrigin()->protocol(), newDomain, OriginAccessEntry::AllowSubdomains); + OriginAccessEntry::MatchResult result = accessEntry.matchesOrigin(*getSecurityOrigin()); if (result == OriginAccessEntry::DoesNotMatchOrigin) { exceptionState.throwSecurityError("'" + newDomain + "' is not a suffix of '" + domain() + "'."); return; @@ -4183,9 +4183,9 @@ void Document::setDomain(const String& newDomain, ExceptionState& exceptionState return; } - securityOrigin()->setDomainFromDOM(newDomain); + getSecurityOrigin()->setDomainFromDOM(newDomain); if (m_frame) - m_frame->script().updateSecurityOrigin(securityOrigin()); + m_frame->script().updateSecurityOrigin(getSecurityOrigin()); } // http://www.whatwg.org/specs/web-apps/current-work/#dom-document-lastmodified @@ -4228,7 +4228,7 @@ const KURL& Document::firstPartyForCookies() const // We use 'matchesDomain' here, as it turns out that some folks embed HTTPS login forms // into HTTP pages; we should allow this kind of upgrade. - if (accessEntry.matchesDomain(*currentDocument->securityOrigin()) == OriginAccessEntry::DoesNotMatchOrigin) + if (accessEntry.matchesDomain(*currentDocument->getSecurityOrigin()) == OriginAccessEntry::DoesNotMatchOrigin) return SecurityOrigin::urlWithUniqueSecurityOrigin(); currentDocument = currentDocument->parentDocument(); @@ -4916,7 +4916,7 @@ bool Document::useSecureKeyboardEntryWhenActive() const void Document::initSecurityContext(const DocumentInit& initializer) { - ASSERT(!securityOrigin()); + ASSERT(!getSecurityOrigin()); if (!initializer.hasSecurityContext()) { // No source for a security context. @@ -4946,13 +4946,13 @@ void Document::initSecurityContext(const DocumentInit& initializer) // but we're also sandboxed, the only thing we inherit is the ability // to load local resources. This lets about:blank iframes in file:// // URL documents load images and other resources from the file system. - if (initializer.owner() && initializer.owner()->securityOrigin()->canLoadLocalResources()) - securityOrigin()->grantLoadLocalResources(); + if (initializer.owner() && initializer.owner()->getSecurityOrigin()->canLoadLocalResources()) + getSecurityOrigin()->grantLoadLocalResources(); } else if (initializer.owner()) { m_cookieURL = initializer.owner()->cookieURL(); // We alias the SecurityOrigins to match Firefox, see Bug 15313 // https://bugs.webkit.org/show_bug.cgi?id=15313 - setSecurityOrigin(initializer.owner()->securityOrigin()); + setSecurityOrigin(initializer.owner()->getSecurityOrigin()); } else { m_cookieURL = m_url; setSecurityOrigin(SecurityOrigin::create(m_url)); @@ -4962,7 +4962,7 @@ void Document::initSecurityContext(const DocumentInit& initializer) // the former via the 'treat-as-public-address' directive (see // https://mikewest.github.io/cors-rfc1918/#csp). if (initializer.isHostedInReservedIPRange()) { - setAddressSpace(securityOrigin()->isLocalhost() ? WebAddressSpaceLocal : WebAddressSpacePrivate); + setAddressSpace(getSecurityOrigin()->isLocalhost() ? WebAddressSpaceLocal : WebAddressSpacePrivate); } else { setAddressSpace(WebAddressSpacePublic); } @@ -4977,21 +4977,21 @@ void Document::initSecurityContext(const DocumentInit& initializer) initContentSecurityPolicy(); } - if (securityOrigin()->hasSuborigin()) - enforceSuborigin(securityOrigin()->suboriginName()); + if (getSecurityOrigin()->hasSuborigin()) + enforceSuborigin(getSecurityOrigin()->suboriginName()); if (Settings* settings = initializer.settings()) { if (!settings->webSecurityEnabled()) { // Web security is turned off. We should let this document access every other document. This is used primary by testing // harnesses for web sites. - securityOrigin()->grantUniversalAccess(); - } else if (securityOrigin()->isLocal()) { + getSecurityOrigin()->grantUniversalAccess(); + } else if (getSecurityOrigin()->isLocal()) { if (settings->allowUniversalAccessFromFileURLs()) { // Some clients want local URLs to have universal access, but that setting is dangerous for other clients. - securityOrigin()->grantUniversalAccess(); + getSecurityOrigin()->grantUniversalAccess(); } else if (!settings->allowFileAccessFromFileURLs()) { // Some clients do not want local URLs to have access to other local URLs. - securityOrigin()->blockLocalAccessFromLocalOrigin(); + getSecurityOrigin()->blockLocalAccessFromLocalOrigin(); } } } @@ -5001,8 +5001,8 @@ void Document::initSecurityContext(const DocumentInit& initializer) setBaseURLOverride(initializer.parentBaseURL()); } - if (securityOrigin()->hasSuborigin()) - enforceSuborigin(securityOrigin()->suboriginName()); + if (getSecurityOrigin()->hasSuborigin()) + enforceSuborigin(getSecurityOrigin()->suboriginName()); } void Document::initContentSecurityPolicy(PassRefPtrWillBeRawPtr<ContentSecurityPolicy> csp) @@ -5024,7 +5024,7 @@ void Document::initContentSecurityPolicy(PassRefPtrWillBeRawPtr<ContentSecurityP bool Document::isSecureTransitionTo(const KURL& url) const { RefPtr<SecurityOrigin> other = SecurityOrigin::create(url); - return securityOrigin()->canAccess(other.get()); + return getSecurityOrigin()->canAccess(other.get()); } bool Document::allowInlineEventHandlers(Node* node, EventListener* listener, const String& contextURL, const WTF::OrdinalNumber& contextLine) @@ -5073,7 +5073,7 @@ void Document::didUpdateSecurityOrigin() { if (!m_frame) return; - m_frame->updateSecurityOrigin(securityOrigin()); + m_frame->updateSecurityOrigin(getSecurityOrigin()); } bool Document::isContextThread() const @@ -5121,7 +5121,7 @@ void Document::initDNSPrefetch() Settings* settings = this->settings(); m_haveExplicitlyDisabledDNSPrefetch = false; - m_isDNSPrefetchEnabled = settings && settings->dnsPrefetchingEnabled() && securityOrigin()->protocol() == "http"; + m_isDNSPrefetchEnabled = settings && settings->dnsPrefetchingEnabled() && getSecurityOrigin()->protocol() == "http"; // Inherit DNS prefetch opt-out from parent frame if (Document* parent = parentDocument()) { @@ -5184,7 +5184,7 @@ void Document::addConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage> consoleM if (!m_frame) return; - if (!consoleMessage->scriptState() && consoleMessage->url().isNull() && !consoleMessage->lineNumber()) { + if (!consoleMessage->getScriptState() && consoleMessage->url().isNull() && !consoleMessage->lineNumber()) { consoleMessage->setURL(url().getString()); if (!isInDocumentWrite() && scriptableDocumentParser()) { ScriptableDocumentParser* parser = scriptableDocumentParser(); diff --git a/third_party/WebKit/Source/core/dom/Document.h b/third_party/WebKit/Source/core/dom/Document.h index c13baa7..49e3bf2 100644 --- a/third_party/WebKit/Source/core/dom/Document.h +++ b/third_party/WebKit/Source/core/dom/Document.h @@ -230,7 +230,7 @@ public: using ContainerNode::ref; using ContainerNode::deref; #endif - using SecurityContext::securityOrigin; + using SecurityContext::getSecurityOrigin; using SecurityContext::contentSecurityPolicy; using TreeScope::getElementById; @@ -326,8 +326,8 @@ public: void setXMLStandalone(bool, ExceptionState&); void setHasXMLDeclaration(bool hasXMLDeclaration) { m_hasXMLDeclaration = hasXMLDeclaration ? 1 : 0; } - String origin() const { return securityOrigin()->toString(); } - String suborigin() const { return securityOrigin()->suboriginName(); } + String origin() const { return getSecurityOrigin()->toString(); } + String suborigin() const { return getSecurityOrigin()->suboriginName(); } String visibilityState() const; PageVisibilityState pageVisibilityState() const; @@ -1092,7 +1092,7 @@ private: ScriptedIdleTaskController& ensureScriptedIdleTaskController(); void initSecurityContext(const DocumentInit&); SecurityContext& securityContext() final { return *this; } - EventQueue* eventQueue() const final; + EventQueue* getEventQueue() const final; // FIXME: Rename the StyleRecalc state to LayoutTreeUpdate. bool hasPendingStyleRecalc() const { return m_lifecycle.state() == DocumentLifecycle::VisualUpdatePending; } diff --git a/third_party/WebKit/Source/core/dom/ExecutionContext.cpp b/third_party/WebKit/Source/core/dom/ExecutionContext.cpp index bda769b..26e13a7 100644 --- a/third_party/WebKit/Source/core/dom/ExecutionContext.cpp +++ b/third_party/WebKit/Source/core/dom/ExecutionContext.cpp @@ -144,7 +144,7 @@ bool ExecutionContext::shouldSanitizeScriptError(const String& sourceURL, Access { if (corsStatus == OpaqueResource) return true; - return !(securityOrigin()->canRequestNoSuborigin(completeURL(sourceURL)) || corsStatus == SharableCrossOrigin); + return !(getSecurityOrigin()->canRequestNoSuborigin(completeURL(sourceURL)) || corsStatus == SharableCrossOrigin); } void ExecutionContext::reportException(PassRefPtrWillBeRawPtr<ErrorEvent> event, int scriptId, PassRefPtr<ScriptCallStack> callStack, AccessControlStatus corsStatus) @@ -213,9 +213,9 @@ PublicURLManager& ExecutionContext::publicURLManager() return *m_publicURLManager; } -SecurityOrigin* ExecutionContext::securityOrigin() +SecurityOrigin* ExecutionContext::getSecurityOrigin() { - return securityContext().securityOrigin(); + return securityContext().getSecurityOrigin(); } ContentSecurityPolicy* ExecutionContext::contentSecurityPolicy() diff --git a/third_party/WebKit/Source/core/dom/ExecutionContext.h b/third_party/WebKit/Source/core/dom/ExecutionContext.h index e5e67bc..9932d1d 100644 --- a/third_party/WebKit/Source/core/dom/ExecutionContext.h +++ b/third_party/WebKit/Source/core/dom/ExecutionContext.h @@ -83,7 +83,7 @@ public: virtual bool isContextThread() const { return true; } - SecurityOrigin* securityOrigin(); + SecurityOrigin* getSecurityOrigin(); ContentSecurityPolicy* contentSecurityPolicy(); const KURL& url() const; KURL completeURL(const String& url) const; @@ -140,7 +140,7 @@ public: int circularSequentialID(); virtual EventTarget* errorEventTarget() = 0; - virtual EventQueue* eventQueue() const = 0; + virtual EventQueue* getEventQueue() const = 0; // Methods related to window interaction. It should be used to manage window // focusing and window creation permission for an ExecutionContext. diff --git a/third_party/WebKit/Source/core/dom/Fullscreen.cpp b/third_party/WebKit/Source/core/dom/Fullscreen.cpp index eda47e5..b2977f4 100644 --- a/third_party/WebKit/Source/core/dom/Fullscreen.cpp +++ b/third_party/WebKit/Source/core/dom/Fullscreen.cpp @@ -242,7 +242,7 @@ void Fullscreen::requestFullscreen(Element& element, RequestType requestType) if (!UserGestureIndicator::processingUserGesture()) { String message = ExceptionMessages::failedToExecute("requestFullScreen", "Element", "API can only be initiated by a user gesture."); - document()->executionContext()->addConsoleMessage( + document()->getExecutionContext()->addConsoleMessage( ConsoleMessage::create(JSMessageSource, WarningMessageLevel, message)); break; } diff --git a/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp b/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp index d64ffc5..385b164 100644 --- a/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp +++ b/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp @@ -86,7 +86,7 @@ IntersectionObserver* IntersectionObserver::create(const IntersectionObserverIni RefPtrWillBeRawPtr<Node> root = observerInit.root(); if (!root) { // TODO(szager): Use Document instead of document element for implicit root. (crbug.com/570538) - ExecutionContext* context = callback.executionContext(); + ExecutionContext* context = callback.getExecutionContext(); ASSERT(context->isDocument()); Frame* mainFrame = toDocument(context)->frame()->tree().top(); if (mainFrame && mainFrame->isLocalFrame()) @@ -180,7 +180,7 @@ void IntersectionObserver::observe(Element* target) if (target->ensureIntersectionObserverData().getObservationFor(*this)) return; - bool shouldReportRootBounds = target->document().frame()->securityContext()->securityOrigin()->canAccess(rootNode()->document().frame()->securityContext()->securityOrigin()); + bool shouldReportRootBounds = target->document().frame()->securityContext()->getSecurityOrigin()->canAccess(rootNode()->document().frame()->securityContext()->getSecurityOrigin()); IntersectionObservation* observation = new IntersectionObservation(*this, *target, shouldReportRootBounds); target->ensureIntersectionObserverData().addObservation(*observation); m_observations.add(observation); @@ -199,7 +199,7 @@ void IntersectionObserver::computeIntersectionObservations() { if (!m_root || !m_root->inDocument()) return; - Document* callbackDocument = toDocument(m_callback->executionContext()); + Document* callbackDocument = toDocument(m_callback->getExecutionContext()); if (!callbackDocument) return; LocalDOMWindow* callbackDOMWindow = callbackDocument->domWindow(); @@ -262,7 +262,7 @@ String IntersectionObserver::rootMargin() const void IntersectionObserver::enqueueIntersectionObserverEntry(IntersectionObserverEntry& entry) { m_entries.append(&entry); - toDocument(m_callback->executionContext())->ensureIntersectionObserverController().scheduleIntersectionObserverForDelivery(*this); + toDocument(m_callback->getExecutionContext())->ensureIntersectionObserverController().scheduleIntersectionObserverForDelivery(*this); } static LayoutUnit computeMargin(const Length& length, LayoutUnit referenceLength) diff --git a/third_party/WebKit/Source/core/dom/IntersectionObserverCallback.h b/third_party/WebKit/Source/core/dom/IntersectionObserverCallback.h index 277d3b0..ada2e2b 100644 --- a/third_party/WebKit/Source/core/dom/IntersectionObserverCallback.h +++ b/third_party/WebKit/Source/core/dom/IntersectionObserverCallback.h @@ -17,7 +17,7 @@ class IntersectionObserverCallback : public GarbageCollectedFinalized<Intersecti public: virtual ~IntersectionObserverCallback() {} virtual void handleEvent(const HeapVector<Member<IntersectionObserverEntry>>&, IntersectionObserver&) = 0; - virtual ExecutionContext* executionContext() const = 0; + virtual ExecutionContext* getExecutionContext() const = 0; DEFINE_INLINE_VIRTUAL_TRACE() { } }; diff --git a/third_party/WebKit/Source/core/dom/IntersectionObserverController.cpp b/third_party/WebKit/Source/core/dom/IntersectionObserverController.cpp index 15cfa0c..055b3c6 100644 --- a/third_party/WebKit/Source/core/dom/IntersectionObserverController.cpp +++ b/third_party/WebKit/Source/core/dom/IntersectionObserverController.cpp @@ -48,7 +48,7 @@ void IntersectionObserverController::resume() void IntersectionObserverController::deliverIntersectionObservations(Timer<IntersectionObserverController>*) { - if (executionContext()->activeDOMObjectsAreSuspended()) { + if (getExecutionContext()->activeDOMObjectsAreSuspended()) { m_timerFiredWhileSuspended = true; return; } diff --git a/third_party/WebKit/Source/core/dom/MessagePort.cpp b/third_party/WebKit/Source/core/dom/MessagePort.cpp index 4c57d77..7f856d1 100644 --- a/third_party/WebKit/Source/core/dom/MessagePort.cpp +++ b/third_party/WebKit/Source/core/dom/MessagePort.cpp @@ -67,7 +67,7 @@ void MessagePort::postMessage(ExecutionContext* context, PassRefPtr<SerializedSc { if (!isEntangled()) return; - ASSERT(executionContext()); + ASSERT(getExecutionContext()); ASSERT(m_entangledChannel); OwnPtr<MessagePortChannelArray> channels; @@ -86,7 +86,7 @@ void MessagePort::postMessage(ExecutionContext* context, PassRefPtr<SerializedSc } if (message->containsTransferableArrayBuffer()) - executionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, "MessagePort cannot send an ArrayBuffer as a transferable object yet. See http://crbug.com/334408")); + getExecutionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, "MessagePort cannot send an ArrayBuffer as a transferable object yet. See http://crbug.com/334408")); WebString messageString = message->toWireString(); OwnPtr<WebMessagePortChannelArray> webChannels = toWebMessagePortChannelArray(channels.release()); @@ -129,8 +129,8 @@ PassOwnPtr<WebMessagePortChannel> MessagePort::disentangle() // This code may be called from another thread, and so should not call any non-threadsafe APIs (i.e. should not call into the entangled channel or access mutable variables). void MessagePort::messageAvailable() { - ASSERT(executionContext()); - executionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&MessagePort::dispatchMessages, m_weakFactory.createWeakPtr())); + ASSERT(getExecutionContext()); + getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&MessagePort::dispatchMessages, m_weakFactory.createWeakPtr())); } void MessagePort::start() @@ -139,7 +139,7 @@ void MessagePort::start() if (!isEntangled()) return; - ASSERT(executionContext()); + ASSERT(getExecutionContext()); if (m_started) return; @@ -158,7 +158,7 @@ void MessagePort::entangle(PassOwnPtr<WebMessagePortChannel> remote) { // Only invoked to set our initial entanglement. ASSERT(!m_entangledChannel); - ASSERT(executionContext()); + ASSERT(getExecutionContext()); m_entangledChannel = remote; m_entangledChannel->setClient(this); @@ -207,10 +207,10 @@ void MessagePort::dispatchMessages() OwnPtr<MessagePortChannelArray> channels; while (tryGetMessage(message, channels)) { // close() in Worker onmessage handler should prevent next message from dispatching. - if (executionContext()->isWorkerGlobalScope() && toWorkerGlobalScope(executionContext())->isClosing()) + if (getExecutionContext()->isWorkerGlobalScope() && toWorkerGlobalScope(getExecutionContext())->isClosing()) return; - MessagePortArray* ports = MessagePort::entanglePorts(*executionContext(), channels.release()); + MessagePortArray* ports = MessagePort::entanglePorts(*getExecutionContext(), channels.release()); RefPtrWillBeRawPtr<Event> evt = MessageEvent::create(ports, message.release()); dispatchEvent(evt.release()); @@ -282,13 +282,13 @@ DEFINE_TRACE(MessagePort) v8::Isolate* MessagePort::scriptIsolate() { - ASSERT(executionContext()); - return toIsolate(executionContext()); + ASSERT(getExecutionContext()); + return toIsolate(getExecutionContext()); } v8::Local<v8::Context> MessagePort::scriptContextForMessageConversion() { - ASSERT(executionContext()); + ASSERT(getExecutionContext()); if (!m_scriptStateForConversion) { v8::Isolate* isolate = scriptIsolate(); m_scriptStateForConversion = ScriptState::create(v8::Context::New(isolate), DOMWrapperWorld::create(isolate)); diff --git a/third_party/WebKit/Source/core/dom/MessagePort.h b/third_party/WebKit/Source/core/dom/MessagePort.h index 556ceee..d3fa1e0 100644 --- a/third_party/WebKit/Source/core/dom/MessagePort.h +++ b/third_party/WebKit/Source/core/dom/MessagePort.h @@ -86,7 +86,7 @@ public: bool started() const { return m_started; } const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override { return ContextLifecycleObserver::executionContext(); } + ExecutionContext* getExecutionContext() const override { return ContextLifecycleObserver::getExecutionContext(); } MessagePort* toMessagePort() override { return this; } bool hasPendingActivity() const override; diff --git a/third_party/WebKit/Source/core/dom/MutationCallback.h b/third_party/WebKit/Source/core/dom/MutationCallback.h index 0ed7cae..0e737c7 100644 --- a/third_party/WebKit/Source/core/dom/MutationCallback.h +++ b/third_party/WebKit/Source/core/dom/MutationCallback.h @@ -45,7 +45,7 @@ public: virtual ~MutationCallback() { } virtual void call(const WillBeHeapVector<RefPtrWillBeMember<MutationRecord>>&, MutationObserver*) = 0; - virtual ExecutionContext* executionContext() const = 0; + virtual ExecutionContext* getExecutionContext() const = 0; DEFINE_INLINE_VIRTUAL_TRACE() { } }; diff --git a/third_party/WebKit/Source/core/dom/MutationObserver.cpp b/third_party/WebKit/Source/core/dom/MutationObserver.cpp index c87e202..17cfe91 100644 --- a/third_party/WebKit/Source/core/dom/MutationObserver.cpp +++ b/third_party/WebKit/Source/core/dom/MutationObserver.cpp @@ -71,7 +71,7 @@ MutationObserver::~MutationObserver() ASSERT(m_registrations.isEmpty()); #endif if (!m_records.isEmpty()) - InspectorInstrumentation::didClearAllMutationRecords(m_callback->executionContext(), this); + InspectorInstrumentation::didClearAllMutationRecords(m_callback->getExecutionContext(), this); } void MutationObserver::observe(Node* node, const MutationObserverInit& observerInit, ExceptionState& exceptionState) @@ -135,14 +135,14 @@ MutationRecordVector MutationObserver::takeRecords() { MutationRecordVector records; records.swap(m_records); - InspectorInstrumentation::didClearAllMutationRecords(m_callback->executionContext(), this); + InspectorInstrumentation::didClearAllMutationRecords(m_callback->getExecutionContext(), this); return records; } void MutationObserver::disconnect() { m_records.clear(); - InspectorInstrumentation::didClearAllMutationRecords(m_callback->executionContext(), this); + InspectorInstrumentation::didClearAllMutationRecords(m_callback->getExecutionContext(), this); MutationObserverRegistrationSet registrations(m_registrations); for (auto& registration : registrations) { // The registration may be already unregistered while iteration. @@ -190,7 +190,7 @@ void MutationObserver::enqueueMutationRecord(PassRefPtrWillBeRawPtr<MutationReco ASSERT(isMainThread()); m_records.append(mutation); activateObserver(this); - InspectorInstrumentation::didEnqueueMutationRecord(m_callback->executionContext(), this); + InspectorInstrumentation::didEnqueueMutationRecord(m_callback->getExecutionContext(), this); } void MutationObserver::setHasTransientRegistration() @@ -209,7 +209,7 @@ WillBeHeapHashSet<RawPtrWillBeMember<Node>> MutationObserver::getObservedNodes() bool MutationObserver::shouldBeSuspended() const { - return m_callback->executionContext() && m_callback->executionContext()->activeDOMObjectsAreSuspended(); + return m_callback->getExecutionContext() && m_callback->getExecutionContext()->activeDOMObjectsAreSuspended(); } void MutationObserver::deliver() @@ -232,9 +232,9 @@ void MutationObserver::deliver() MutationRecordVector records; records.swap(m_records); - InspectorInstrumentation::willDeliverMutationRecords(m_callback->executionContext(), this); + InspectorInstrumentation::willDeliverMutationRecords(m_callback->getExecutionContext(), this); m_callback->call(records, this); - InspectorInstrumentation::didDeliverMutationRecords(m_callback->executionContext()); + InspectorInstrumentation::didDeliverMutationRecords(m_callback->getExecutionContext()); } void MutationObserver::resumeSuspendedObservers() diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp index 2169025..1e36ff9 100644 --- a/third_party/WebKit/Source/core/dom/Node.cpp +++ b/third_party/WebKit/Source/core/dom/Node.cpp @@ -1782,7 +1782,7 @@ const AtomicString& Node::interfaceName() const return EventTargetNames::Node; } -ExecutionContext* Node::executionContext() const +ExecutionContext* Node::getExecutionContext() const { return document().contextDocument().get(); } diff --git a/third_party/WebKit/Source/core/dom/Node.h b/third_party/WebKit/Source/core/dom/Node.h index b94ed79..b3422f8 100644 --- a/third_party/WebKit/Source/core/dom/Node.h +++ b/third_party/WebKit/Source/core/dom/Node.h @@ -627,7 +627,7 @@ public: Node* toNode() final; const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const final; + ExecutionContext* getExecutionContext() const final; void removeAllEventListeners() override; void removeAllEventListenersRecursively(); diff --git a/third_party/WebKit/Source/core/dom/RemoteSecurityContext.cpp b/third_party/WebKit/Source/core/dom/RemoteSecurityContext.cpp index 669ea43..fd94703 100644 --- a/third_party/WebKit/Source/core/dom/RemoteSecurityContext.cpp +++ b/third_party/WebKit/Source/core/dom/RemoteSecurityContext.cpp @@ -14,7 +14,7 @@ RemoteSecurityContext::RemoteSecurityContext() { // RemoteSecurityContext's origin is expected to stay uninitialized until // we set it using replicated origin data from the browser process. - ASSERT(!securityOrigin()); + ASSERT(!getSecurityOrigin()); // CSP will not be replicated for RemoteSecurityContexts, as it is moving // to the browser process. For now, initialize CSP to a default diff --git a/third_party/WebKit/Source/core/dom/ScopedWindowFocusAllowedIndicator.h b/third_party/WebKit/Source/core/dom/ScopedWindowFocusAllowedIndicator.h index 3b22181..51c5367 100644 --- a/third_party/WebKit/Source/core/dom/ScopedWindowFocusAllowedIndicator.h +++ b/third_party/WebKit/Source/core/dom/ScopedWindowFocusAllowedIndicator.h @@ -37,8 +37,8 @@ private: void dispose() { - if (executionContext()) - executionContext()->consumeWindowInteraction(); + if (getExecutionContext()) + getExecutionContext()->consumeWindowInteraction(); } DEFINE_INLINE_TRACE() @@ -50,7 +50,7 @@ private: // In Oilpan, destructors are not allowed to touch other on-heap objects. // The Observer indirection is needed to keep // ScopedWindowFocusAllowedIndicator off-heap and thus allows its destructor - // to call executionContext()->consumeWindowInteraction(). + // to call getExecutionContext()->consumeWindowInteraction(). OwnPtrWillBePersistent<Observer> m_observer; }; diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp index a89f7df..b33f34f 100644 --- a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp +++ b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp @@ -293,7 +293,7 @@ bool ScriptLoader::fetchScript(const String& sourceUrl, FetchRequest::DeferOptio CrossOriginAttributeValue crossOrigin = crossOriginAttributeValue(m_element->fastGetAttribute(HTMLNames::crossoriginAttr)); if (crossOrigin != CrossOriginAttributeNotSet) - request.setCrossOriginAccessControl(elementDocument->securityOrigin(), crossOrigin); + request.setCrossOriginAccessControl(elementDocument->getSecurityOrigin(), crossOrigin); request.setCharset(scriptCharset()); // Skip fetch-related CSP checks if the script element has a valid nonce, or if dynamically @@ -340,7 +340,7 @@ void ScriptLoader::logScriptMimetype(ScriptResource* resource, LocalFrame* frame bool text = mimetype.lower().startsWith("text/"); bool application = mimetype.lower().startsWith("application/"); bool expectedJs = MIMETypeRegistry::isSupportedJavaScriptMIMEType(mimetype) || (text && isLegacySupportedJavaScriptLanguage(mimetype.substring(5))); - bool sameOrigin = m_element->document().securityOrigin()->canRequest(m_resource->url()); + bool sameOrigin = m_element->document().getSecurityOrigin()->canRequest(m_resource->url()); if (expectedJs) { return; } @@ -405,7 +405,7 @@ bool ScriptLoader::executeScript(const ScriptSourceCode& sourceCode, double* com accessControlStatus = OpaqueResource; else accessControlStatus = SharableCrossOrigin; - } else if (sourceCode.resource()->passesAccessControlCheck(m_element->document().securityOrigin())) { + } else if (sourceCode.resource()->passesAccessControlCheck(m_element->document().getSecurityOrigin())) { accessControlStatus = SharableCrossOrigin; } } diff --git a/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp b/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp index 1df2916d..b0bdb09 100644 --- a/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp +++ b/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp @@ -87,13 +87,13 @@ ScriptedIdleTaskController::CallbackId ScriptedIdleTaskController::registerCallb m_scheduler->postIdleTask(BLINK_FROM_HERE, WTF::bind<double>(&internal::IdleRequestCallbackWrapper::idleTaskFired, callbackWrapper)); if (timeoutMillis > 0) m_scheduler->timerTaskRunner()->postDelayedTask(BLINK_FROM_HERE, WTF::bind(&internal::IdleRequestCallbackWrapper::timeoutFired, callbackWrapper), timeoutMillis); - TRACE_EVENT_INSTANT1("devtools.timeline", "RequestIdleCallback", TRACE_EVENT_SCOPE_THREAD, "data", InspectorIdleCallbackRequestEvent::data(executionContext(), id, timeoutMillis)); + TRACE_EVENT_INSTANT1("devtools.timeline", "RequestIdleCallback", TRACE_EVENT_SCOPE_THREAD, "data", InspectorIdleCallbackRequestEvent::data(getExecutionContext(), id, timeoutMillis)); return id; } void ScriptedIdleTaskController::cancelCallback(CallbackId id) { - TRACE_EVENT_INSTANT1("devtools.timeline", "CancelIdleCallback", TRACE_EVENT_SCOPE_THREAD, "data", InspectorIdleCallbackCancelEvent::data(executionContext(), id)); + TRACE_EVENT_INSTANT1("devtools.timeline", "CancelIdleCallback", TRACE_EVENT_SCOPE_THREAD, "data", InspectorIdleCallbackCancelEvent::data(getExecutionContext(), id)); m_callbacks.remove(id); } @@ -127,7 +127,7 @@ void ScriptedIdleTaskController::runCallback(CallbackId id, double deadlineSecon idleCallbackDeadlineHistogram.count(allottedTimeMillis); TRACE_EVENT1("devtools.timeline", "FireIdleCallback", - "data", InspectorIdleCallbackFireEvent::data(executionContext(), id, allottedTimeMillis, callbackType == IdleDeadline::CallbackType::CalledByTimeout)); + "data", InspectorIdleCallbackFireEvent::data(getExecutionContext(), id, allottedTimeMillis, callbackType == IdleDeadline::CallbackType::CalledByTimeout)); callback->handleEvent(IdleDeadline::create(deadlineSeconds, callbackType)); double overrunMillis = std::max((monotonicallyIncreasingTime() - deadlineSeconds) * 1000, 0.0); diff --git a/third_party/WebKit/Source/core/dom/SecurityContext.cpp b/third_party/WebKit/Source/core/dom/SecurityContext.cpp index 847debb..f830e2d 100644 --- a/third_party/WebKit/Source/core/dom/SecurityContext.cpp +++ b/third_party/WebKit/Source/core/dom/SecurityContext.cpp @@ -63,7 +63,7 @@ void SecurityContext::enforceSandboxFlags(SandboxFlags mask) { m_sandboxFlags |= mask; - if (isSandboxed(SandboxOrigin) && securityOrigin() && !securityOrigin()->isUnique()) { + if (isSandboxed(SandboxOrigin) && getSecurityOrigin() && !getSecurityOrigin()->isUnique()) { setSecurityOrigin(SecurityOrigin::createUnique()); didUpdateSecurityOrigin(); } diff --git a/third_party/WebKit/Source/core/dom/SecurityContext.h b/third_party/WebKit/Source/core/dom/SecurityContext.h index d0c1f53..b420c26 100644 --- a/third_party/WebKit/Source/core/dom/SecurityContext.h +++ b/third_party/WebKit/Source/core/dom/SecurityContext.h @@ -57,7 +57,7 @@ public: InsecureRequestsUpgrade }; - SecurityOrigin* securityOrigin() const { return m_securityOrigin.get(); } + SecurityOrigin* getSecurityOrigin() const { return m_securityOrigin.get(); } ContentSecurityPolicy* contentSecurityPolicy() const { return m_contentSecurityPolicy.get(); } // Explicitly override the security origin for this security context. diff --git a/third_party/WebKit/Source/core/events/EventTarget.cpp b/third_party/WebKit/Source/core/events/EventTarget.cpp index 4bb9aaa..82e2d26 100644 --- a/third_party/WebKit/Source/core/events/EventTarget.cpp +++ b/third_party/WebKit/Source/core/events/EventTarget.cpp @@ -113,7 +113,7 @@ MessagePort* EventTarget::toMessagePort() inline LocalDOMWindow* EventTarget::executingWindow() { - if (ExecutionContext* context = executionContext()) + if (ExecutionContext* context = getExecutionContext()) return context->executingWindow(); return nullptr; } @@ -260,7 +260,7 @@ bool EventTarget::dispatchEventForBindings(PassRefPtrWillBeRawPtr<Event> event, return false; } - if (!executionContext()) + if (!getExecutionContext()) return false; event->setTrusted(false); @@ -377,7 +377,7 @@ DispatchEventResult EventTarget::fireEventListeners(Event* event) event->setType(unprefixedTypeName); } - Editor::countEvent(executionContext(), event); + Editor::countEvent(getExecutionContext(), event); countLegacyEvents(legacyTypeName, listenersVector, legacyListenersVector); return dispatchEventResult(*event); } @@ -435,7 +435,7 @@ void EventTarget::fireEventListeners(Event* event, EventTargetData* d, EventList if (event->immediatePropagationStopped()) break; - ExecutionContext* context = executionContext(); + ExecutionContext* context = getExecutionContext(); if (!context) break; diff --git a/third_party/WebKit/Source/core/events/EventTarget.h b/third_party/WebKit/Source/core/events/EventTarget.h index 8c9e9e9..fa1cd9f 100644 --- a/third_party/WebKit/Source/core/events/EventTarget.h +++ b/third_party/WebKit/Source/core/events/EventTarget.h @@ -102,7 +102,7 @@ public: // very strange compiler errors. // - If you added an onfoo attribute, use DEFINE_ATTRIBUTE_EVENT_LISTENER(foo) // in your class declaration. -// - Override EventTarget::interfaceName() and executionContext(). The former +// - Override EventTarget::interfaceName() and getExecutionContext(). The former // will typically return EventTargetNames::YourClassName. The latter will // return ActiveDOMObject::executionContext (if you are an ActiveDOMObject) // or the document you're in. @@ -123,7 +123,7 @@ public: #endif virtual const AtomicString& interfaceName() const = 0; - virtual ExecutionContext* executionContext() const = 0; + virtual ExecutionContext* getExecutionContext() const = 0; virtual Node* toNode(); virtual const LocalDOMWindow* toDOMWindow() const; diff --git a/third_party/WebKit/Source/core/fetch/FetchContext.h b/third_party/WebKit/Source/core/fetch/FetchContext.h index 6b67914..d425950 100644 --- a/third_party/WebKit/Source/core/fetch/FetchContext.h +++ b/third_party/WebKit/Source/core/fetch/FetchContext.h @@ -102,7 +102,7 @@ public: virtual bool updateTimingInfoForIFrameNavigation(ResourceTimingInfo*) { return false; } virtual void sendImagePing(const KURL&); virtual void addConsoleMessage(const String&) const; - virtual SecurityOrigin* securityOrigin() const { return nullptr; } + virtual SecurityOrigin* getSecurityOrigin() const { return nullptr; } virtual void upgradeInsecureRequest(FetchRequest&); virtual void addClientHintsIfNecessary(FetchRequest&); virtual void addCSPHeaderIfNecessary(Resource::Type, FetchRequest&); diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp index 6b31bcc..1834568 100644 --- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp +++ b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp @@ -236,7 +236,7 @@ bool ResourceFetcher::canAccessResource(Resource* resource, SecurityOrigin* sour return false; if (!sourceOrigin) - sourceOrigin = context().securityOrigin(); + sourceOrigin = context().getSecurityOrigin(); if (sourceOrigin->canRequestNoSuborigin(url)) return true; @@ -1067,7 +1067,7 @@ bool ResourceFetcher::canAccessRedirect(Resource* resource, ResourceRequest& new if (options.corsEnabled == IsCORSEnabled) { SecurityOrigin* sourceOrigin = options.securityOrigin.get(); if (!sourceOrigin) - sourceOrigin = context().securityOrigin(); + sourceOrigin = context().getSecurityOrigin(); String errorMessage; StoredCredentials withCredentials = resource->lastResourceRequest().allowStoredCredentials() ? AllowStoredCredentials : DoNotAllowStoredCredentials; diff --git a/third_party/WebKit/Source/core/fileapi/FileReader.cpp b/third_party/WebKit/Source/core/fileapi/FileReader.cpp index b654c90..8d12ba4 100644 --- a/third_party/WebKit/Source/core/fileapi/FileReader.cpp +++ b/third_party/WebKit/Source/core/fileapi/FileReader.cpp @@ -226,7 +226,7 @@ void FileReader::contextDestroyed() return; if (hasPendingActivity()) - ThrottlingController::finishReader(executionContext(), this, ThrottlingController::removeReader(executionContext(), this)); + ThrottlingController::finishReader(getExecutionContext(), this, ThrottlingController::removeReader(getExecutionContext(), this)); terminate(); } @@ -286,7 +286,7 @@ void FileReader::readInternal(Blob* blob, FileReaderLoader::ReadType type, Excep return; } - ExecutionContext* context = executionContext(); + ExecutionContext* context = getExecutionContext(); if (!context) { exceptionState.throwDOMException(AbortError, "Reading from a detached FileReader is not supported."); return; @@ -319,7 +319,7 @@ void FileReader::executePendingRead() m_loader = FileReaderLoader::create(m_readType, this); m_loader->setEncoding(m_encoding); m_loader->setDataType(m_blobType); - m_loader->start(executionContext(), m_blobDataHandle); + m_loader->start(getExecutionContext(), m_blobDataHandle); m_blobDataHandle = nullptr; } @@ -339,7 +339,7 @@ void FileReader::abort() m_loadingState = LoadingStateAborted; // Schedule to have the abort done later since abort() might be called from the event handler and we do not want the resource loading code to be in the stack. - executionContext()->postTask( + getExecutionContext()->postTask( BLINK_FROM_HERE, createSameThreadTask(&delayedAbort, this)); } @@ -352,14 +352,14 @@ void FileReader::doAbort() m_error = FileError::create(FileError::ABORT_ERR); // Unregister the reader. - ThrottlingController::FinishReaderType finalStep = ThrottlingController::removeReader(executionContext(), this); + ThrottlingController::FinishReaderType finalStep = ThrottlingController::removeReader(getExecutionContext(), this); fireEvent(EventTypeNames::error); fireEvent(EventTypeNames::abort); fireEvent(EventTypeNames::loadend); // All possible events have fired and we're done, no more pending activity. - ThrottlingController::finishReader(executionContext(), this, finalStep); + ThrottlingController::finishReader(getExecutionContext(), this, finalStep); } void FileReader::result(StringOrArrayBuffer& resultAttribute) const @@ -417,13 +417,13 @@ void FileReader::didFinishLoading() m_state = DONE; // Unregister the reader. - ThrottlingController::FinishReaderType finalStep = ThrottlingController::removeReader(executionContext(), this); + ThrottlingController::FinishReaderType finalStep = ThrottlingController::removeReader(getExecutionContext(), this); fireEvent(EventTypeNames::load); fireEvent(EventTypeNames::loadend); // All possible events have fired and we're done, no more pending activity. - ThrottlingController::finishReader(executionContext(), this, finalStep); + ThrottlingController::finishReader(getExecutionContext(), this, finalStep); } void FileReader::didFail(FileError::ErrorCode errorCode) @@ -439,18 +439,18 @@ void FileReader::didFail(FileError::ErrorCode errorCode) m_error = FileError::create(static_cast<FileError::ErrorCode>(errorCode)); // Unregister the reader. - ThrottlingController::FinishReaderType finalStep = ThrottlingController::removeReader(executionContext(), this); + ThrottlingController::FinishReaderType finalStep = ThrottlingController::removeReader(getExecutionContext(), this); fireEvent(EventTypeNames::error); fireEvent(EventTypeNames::loadend); // All possible events have fired and we're done, no more pending activity. - ThrottlingController::finishReader(executionContext(), this, finalStep); + ThrottlingController::finishReader(getExecutionContext(), this, finalStep); } void FileReader::fireEvent(const AtomicString& type) { - InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(executionContext(), m_asyncOperationId); + InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(getExecutionContext(), m_asyncOperationId); if (!m_loader) { dispatchEvent(ProgressEvent::create(type, false, 0, 0)); InspectorInstrumentation::traceAsyncCallbackCompleted(cookie); diff --git a/third_party/WebKit/Source/core/fileapi/FileReader.h b/third_party/WebKit/Source/core/fileapi/FileReader.h index 0f6b262..b467918 100644 --- a/third_party/WebKit/Source/core/fileapi/FileReader.h +++ b/third_party/WebKit/Source/core/fileapi/FileReader.h @@ -82,7 +82,7 @@ public: // EventTarget const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override { return ContextLifecycleObserver::executionContext(); } + ExecutionContext* getExecutionContext() const override { return ContextLifecycleObserver::getExecutionContext(); } // FileReaderLoaderClient void didStartLoading() override; diff --git a/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp b/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp index d09c8db..19ec6a5 100644 --- a/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp +++ b/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp @@ -82,7 +82,7 @@ FileReaderLoader::~FileReaderLoader() void FileReaderLoader::startInternal(ExecutionContext& executionContext, const Stream* stream, PassRefPtr<BlobDataHandle> blobData) { // The blob is read by routing through the request handling layer given a temporary public url. - m_urlForReading = BlobURL::createPublicURL(executionContext.securityOrigin()); + m_urlForReading = BlobURL::createPublicURL(executionContext.getSecurityOrigin()); if (m_urlForReading.isEmpty()) { failed(FileError::SECURITY_ERR); return; @@ -90,10 +90,10 @@ void FileReaderLoader::startInternal(ExecutionContext& executionContext, const S if (blobData) { ASSERT(!stream); - BlobRegistry::registerPublicBlobURL(executionContext.securityOrigin(), m_urlForReading, blobData); + BlobRegistry::registerPublicBlobURL(executionContext.getSecurityOrigin(), m_urlForReading, blobData); } else { ASSERT(stream); - BlobRegistry::registerStreamURL(executionContext.securityOrigin(), m_urlForReading, stream->url()); + BlobRegistry::registerStreamURL(executionContext.getSecurityOrigin(), m_urlForReading, stream->url()); } // Construct and load the request. diff --git a/third_party/WebKit/Source/core/frame/DOMTimer.cpp b/third_party/WebKit/Source/core/frame/DOMTimer.cpp index 5914cd4..513d725 100644 --- a/third_party/WebKit/Source/core/frame/DOMTimer.cpp +++ b/third_party/WebKit/Source/core/frame/DOMTimer.cpp @@ -98,7 +98,7 @@ void DOMTimer::disposeTimer() void DOMTimer::fired() { - ExecutionContext* context = executionContext(); + ExecutionContext* context = getExecutionContext(); ASSERT(context); context->timers()->setTimerNestingLevel(m_nestingLevel); ASSERT(!context->activeDOMObjectsAreSuspended()); @@ -137,8 +137,8 @@ void DOMTimer::fired() TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "UpdateCounters", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateCountersEvent::data()); // ExecutionContext might be already gone when we executed action->execute(). - if (executionContext()) - executionContext()->timers()->setTimerNestingLevel(0); + if (getExecutionContext()) + getExecutionContext()->timers()->setTimerNestingLevel(0); } void DOMTimer::stop() @@ -152,7 +152,7 @@ void DOMTimer::stop() WebTaskRunner* DOMTimer::timerTaskRunner() const { - return executionContext()->timers()->timerTaskRunner(); + return getExecutionContext()->timers()->timerTaskRunner(); } DEFINE_TRACE(DOMTimer) diff --git a/third_party/WebKit/Source/core/frame/DOMWindow.cpp b/third_party/WebKit/Source/core/frame/DOMWindow.cpp index ebf7826..26aee8f 100644 --- a/third_party/WebKit/Source/core/frame/DOMWindow.cpp +++ b/third_party/WebKit/Source/core/frame/DOMWindow.cpp @@ -141,7 +141,7 @@ bool DOMWindow::isInsecureScriptAccess(LocalDOMWindow& callingWindow, const Stri // FIXME: The name canAccess seems to be a roundabout way to ask "can execute script". // Can we name the SecurityOrigin function better to make this more clear? - if (callingWindow.document()->securityOrigin()->canAccessCheckSuborigins(frame()->securityContext()->securityOrigin())) + if (callingWindow.document()->getSecurityOrigin()->canAccessCheckSuborigins(frame()->securityContext()->getSecurityOrigin())) return false; } @@ -180,7 +180,7 @@ void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, const Mes if (targetOrigin == "/") { if (!sourceDocument) return; - target = sourceDocument->securityOrigin(); + target = sourceDocument->getSecurityOrigin(); } else if (targetOrigin != "*") { target = SecurityOrigin::createFromString(targetOrigin); // It doesn't make sense target a postMessage at a unique origin @@ -191,7 +191,7 @@ void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, const Mes } } - OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(executionContext(), ports, exceptionState); + OwnPtr<MessagePortChannelArray> channels = MessagePort::disentanglePorts(getExecutionContext(), ports, exceptionState); if (exceptionState.hadException()) return; @@ -199,13 +199,13 @@ void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, const Mes // in order to capture the source of the message correctly. if (!sourceDocument) return; - String sourceOrigin = sourceDocument->securityOrigin()->toString(); - String sourceSuborigin = sourceDocument->securityOrigin()->suboriginName(); + String sourceOrigin = sourceDocument->getSecurityOrigin()->toString(); + String sourceSuborigin = sourceDocument->getSecurityOrigin()->suboriginName(); - KURL targetUrl = isLocalDOMWindow() ? document()->url() : KURL(KURL(), frame()->securityContext()->securityOrigin()->toString()); - if (MixedContentChecker::isMixedContent(sourceDocument->securityOrigin(), targetUrl)) + KURL targetUrl = isLocalDOMWindow() ? document()->url() : KURL(KURL(), frame()->securityContext()->getSecurityOrigin()->toString()); + if (MixedContentChecker::isMixedContent(sourceDocument->getSecurityOrigin(), targetUrl)) UseCounter::count(frame(), UseCounter::PostMessageFromSecureToInsecure); - else if (MixedContentChecker::isMixedContent(frame()->securityContext()->securityOrigin(), sourceDocument->url())) + else if (MixedContentChecker::isMixedContent(frame()->securityContext()->getSecurityOrigin(), sourceDocument->url())) UseCounter::count(frame(), UseCounter::PostMessageFromInsecureToSecure); RefPtrWillBeRawPtr<MessageEvent> event = MessageEvent::create(channels.release(), message, sourceOrigin, String(), source, sourceSuborigin); @@ -237,9 +237,9 @@ String DOMWindow::sanitizedCrossDomainAccessErrorMessage(const LocalDOMWindow* c if (callingWindowURL.isNull()) return String(); - ASSERT(!callingWindow->document()->securityOrigin()->canAccessCheckSuborigins(frame()->securityContext()->securityOrigin())); + ASSERT(!callingWindow->document()->getSecurityOrigin()->canAccessCheckSuborigins(frame()->securityContext()->getSecurityOrigin())); - const SecurityOrigin* activeOrigin = callingWindow->document()->securityOrigin(); + const SecurityOrigin* activeOrigin = callingWindow->document()->getSecurityOrigin(); String message = "Blocked a frame with origin \"" + activeOrigin->toString() + "\" from accessing a cross-origin frame."; // FIXME: Evaluate which details from 'crossDomainAccessErrorMessage' may safely be reported to JavaScript. @@ -257,8 +257,8 @@ String DOMWindow::crossDomainAccessErrorMessage(const LocalDOMWindow* callingWin return String(); // FIXME: This message, and other console messages, have extra newlines. Should remove them. - const SecurityOrigin* activeOrigin = callingWindow->document()->securityOrigin(); - const SecurityOrigin* targetOrigin = frame()->securityContext()->securityOrigin(); + const SecurityOrigin* activeOrigin = callingWindow->document()->getSecurityOrigin(); + const SecurityOrigin* targetOrigin = frame()->securityContext()->getSecurityOrigin(); ASSERT(!activeOrigin->canAccessCheckSuborigins(targetOrigin)); String message = "Blocked a frame with origin \"" + activeOrigin->toString() + "\" from accessing a frame with origin \"" + targetOrigin->toString() + "\". "; diff --git a/third_party/WebKit/Source/core/frame/DOMWindowTimers.cpp b/third_party/WebKit/Source/core/frame/DOMWindowTimers.cpp index cc713a8..d2c6c6e 100644 --- a/third_party/WebKit/Source/core/frame/DOMWindowTimers.cpp +++ b/third_party/WebKit/Source/core/frame/DOMWindowTimers.cpp @@ -67,7 +67,7 @@ static bool isAllowed(ScriptState* scriptState, ExecutionContext* executionConte int setTimeout(ScriptState* scriptState, EventTarget& eventTarget, const ScriptValue& handler, int timeout, const Vector<ScriptValue>& arguments) { - ExecutionContext* executionContext = eventTarget.executionContext(); + ExecutionContext* executionContext = eventTarget.getExecutionContext(); if (!isAllowed(scriptState, executionContext, false)) return 0; if (timeout >= 0 && executionContext->isDocument()) { @@ -81,7 +81,7 @@ int setTimeout(ScriptState* scriptState, EventTarget& eventTarget, const ScriptV int setTimeout(ScriptState* scriptState, EventTarget& eventTarget, const String& handler, int timeout, const Vector<ScriptValue>&) { - ExecutionContext* executionContext = eventTarget.executionContext(); + ExecutionContext* executionContext = eventTarget.getExecutionContext(); if (!isAllowed(scriptState, executionContext, true)) return 0; // Don't allow setting timeouts to run empty functions. Was historically a @@ -99,7 +99,7 @@ int setTimeout(ScriptState* scriptState, EventTarget& eventTarget, const String& int setInterval(ScriptState* scriptState, EventTarget& eventTarget, const ScriptValue& handler, int timeout, const Vector<ScriptValue>& arguments) { - ExecutionContext* executionContext = eventTarget.executionContext(); + ExecutionContext* executionContext = eventTarget.getExecutionContext(); if (!isAllowed(scriptState, executionContext, false)) return 0; OwnPtrWillBeRawPtr<ScheduledAction> action = ScheduledAction::create(scriptState, handler, arguments); @@ -108,7 +108,7 @@ int setInterval(ScriptState* scriptState, EventTarget& eventTarget, const Script int setInterval(ScriptState* scriptState, EventTarget& eventTarget, const String& handler, int timeout, const Vector<ScriptValue>&) { - ExecutionContext* executionContext = eventTarget.executionContext(); + ExecutionContext* executionContext = eventTarget.getExecutionContext(); if (!isAllowed(scriptState, executionContext, true)) return 0; // Don't allow setting timeouts to run empty functions. Was historically a @@ -121,13 +121,13 @@ int setInterval(ScriptState* scriptState, EventTarget& eventTarget, const String void clearTimeout(EventTarget& eventTarget, int timeoutID) { - if (ExecutionContext* context = eventTarget.executionContext()) + if (ExecutionContext* context = eventTarget.getExecutionContext()) DOMTimer::removeByID(context, timeoutID); } void clearInterval(EventTarget& eventTarget, int timeoutID) { - if (ExecutionContext* context = eventTarget.executionContext()) + if (ExecutionContext* context = eventTarget.getExecutionContext()) DOMTimer::removeByID(context, timeoutID); } diff --git a/third_party/WebKit/Source/core/frame/Deprecation.cpp b/third_party/WebKit/Source/core/frame/Deprecation.cpp index 2dd4451..74f4e4d 100644 --- a/third_party/WebKit/Source/core/frame/Deprecation.cpp +++ b/third_party/WebKit/Source/core/frame/Deprecation.cpp @@ -154,9 +154,9 @@ void Deprecation::countDeprecationCrossOriginIframe(const Document& document, Us if (!frame) return; // Check to see if the frame can script into the top level document. - SecurityOrigin* securityOrigin = frame->securityContext()->securityOrigin(); + SecurityOrigin* securityOrigin = frame->securityContext()->getSecurityOrigin(); Frame* top = frame->tree().top(); - if (top && !securityOrigin->canAccess(top->securityContext()->securityOrigin())) + if (top && !securityOrigin->canAccess(top->securityContext()->getSecurityOrigin())) countDeprecation(frame, feature); } diff --git a/third_party/WebKit/Source/core/frame/Frame.cpp b/third_party/WebKit/Source/core/frame/Frame.cpp index 95a0e41..e979f67 100644 --- a/third_party/WebKit/Source/core/frame/Frame.cpp +++ b/third_party/WebKit/Source/core/frame/Frame.cpp @@ -183,7 +183,7 @@ static bool canAccessAncestor(const SecurityOrigin& activeSecurityOrigin, const const bool isLocalActiveOrigin = activeSecurityOrigin.isLocal(); for (const Frame* ancestorFrame = targetFrame; ancestorFrame; ancestorFrame = ancestorFrame->tree().parent()) { - const SecurityOrigin* ancestorSecurityOrigin = ancestorFrame->securityContext()->securityOrigin(); + const SecurityOrigin* ancestorSecurityOrigin = ancestorFrame->securityContext()->getSecurityOrigin(); if (activeSecurityOrigin.canAccess(ancestorSecurityOrigin)) return true; @@ -221,8 +221,8 @@ bool Frame::canNavigate(const Frame& targetFrame) return false; } - ASSERT(securityContext()->securityOrigin()); - SecurityOrigin& origin = *securityContext()->securityOrigin(); + ASSERT(securityContext()->getSecurityOrigin()); + SecurityOrigin& origin = *securityContext()->getSecurityOrigin(); // This is the normal case. A document can navigate its decendant frames, // or, more generally, a document can navigate a frame if the document is @@ -262,7 +262,7 @@ Frame* Frame::findUnsafeParentScrollPropagationBoundary() Frame* ancestorFrame = tree().parent(); while (ancestorFrame) { - if (!ancestorFrame->securityContext()->securityOrigin()->canAccess(securityContext()->securityOrigin())) + if (!ancestorFrame->securityContext()->getSecurityOrigin()->canAccess(securityContext()->getSecurityOrigin())) return currentFrame; currentFrame = ancestorFrame; ancestorFrame = ancestorFrame->tree().parent(); diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp index 0b59c07..5973ff2 100644 --- a/third_party/WebKit/Source/core/frame/FrameView.cpp +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp @@ -4086,9 +4086,9 @@ void FrameView::notifyRenderThrottlingObservers() // // Check if we can access our parent's security origin. m_crossOriginForThrottling = false; - const SecurityOrigin* origin = frame().securityContext()->securityOrigin(); + const SecurityOrigin* origin = frame().securityContext()->getSecurityOrigin(); for (Frame* parentFrame = m_frame->tree().parent(); parentFrame; parentFrame = parentFrame->tree().parent()) { - const SecurityOrigin* parentOrigin = parentFrame->securityContext()->securityOrigin(); + const SecurityOrigin* parentOrigin = parentFrame->securityContext()->getSecurityOrigin(); if (!origin->canAccess(parentOrigin)) { m_crossOriginForThrottling = true; break; diff --git a/third_party/WebKit/Source/core/frame/History.cpp b/third_party/WebKit/Source/core/frame/History.cpp index b9d17ff..ac21801 100644 --- a/third_party/WebKit/Source/core/frame/History.cpp +++ b/third_party/WebKit/Source/core/frame/History.cpp @@ -212,9 +212,9 @@ void History::stateObjectAdded(PassRefPtr<SerializedScriptValue> data, const Str return; KURL fullURL = urlForState(urlString); - if (!canChangeToUrl(fullURL, m_frame->document()->securityOrigin(), m_frame->document()->url())) { + if (!canChangeToUrl(fullURL, m_frame->document()->getSecurityOrigin(), m_frame->document()->url())) { // We can safely expose the URL to JavaScript, as a) no redirection takes place: JavaScript already had this URL, b) JavaScript can only access a same-origin History object. - exceptionState.throwSecurityError("A history state object with URL '" + fullURL.elidedString() + "' cannot be created in a document with origin '" + m_frame->document()->securityOrigin()->toString() + "' and URL '" + m_frame->document()->url().elidedString() + "'."); + exceptionState.throwSecurityError("A history state object with URL '" + fullURL.elidedString() + "' cannot be created in a document with origin '" + m_frame->document()->getSecurityOrigin()->toString() + "' and URL '" + m_frame->document()->url().elidedString() + "'."); return; } diff --git a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp index a3a1d3e..072f78b 100644 --- a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp +++ b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp @@ -168,7 +168,7 @@ ImageBitmap::ImageBitmap(HTMLImageElement* image, const IntRect& cropRect, Docum m_image = cropImage(image->cachedImage()->image(), cropRect, flipY, m_isPremultiplied, PremultiplyAlpha); if (!m_image) return; - m_image->setOriginClean(!image->wouldTaintOrigin(document->securityOrigin())); + m_image->setOriginClean(!image->wouldTaintOrigin(document->getSecurityOrigin())); } ImageBitmap::ImageBitmap(HTMLVideoElement* video, const IntRect& cropRect, Document* document, const ImageBitmapOptions& options) @@ -199,7 +199,7 @@ ImageBitmap::ImageBitmap(HTMLVideoElement* video, const IntRect& cropRect, Docum } else { m_image = StaticBitmapImage::create(buffer->newSkImageSnapshot(PreferNoAcceleration, SnapshotReasonUnknown)); } - m_image->setOriginClean(!video->wouldTaintOrigin(document->securityOrigin())); + m_image->setOriginClean(!video->wouldTaintOrigin(document->getSecurityOrigin())); } ImageBitmap::ImageBitmap(HTMLCanvasElement* canvas, const IntRect& cropRect, const ImageBitmapOptions& options) diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp index 42d770e..3b20c40 100644 --- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp +++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp @@ -123,7 +123,7 @@ public: , m_userGestureToken(userGestureToken) , m_disposalAllowed(true) { - m_asyncOperationId = InspectorInstrumentation::traceAsyncOperationStarting(executionContext(), "postMessage"); + m_asyncOperationId = InspectorInstrumentation::traceAsyncOperationStarting(getExecutionContext(), "postMessage"); } PassRefPtrWillBeRawPtr<MessageEvent> event() const { return m_event.get(); } @@ -153,7 +153,7 @@ public: private: void fired() override { - InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncOperationCompletedCallbackStarting(executionContext(), m_asyncOperationId); + InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncOperationCompletedCallbackStarting(getExecutionContext(), m_asyncOperationId); m_disposalAllowed = false; m_window->postMessageTimerFired(this); dispose(); @@ -374,7 +374,7 @@ PassRefPtrWillBeRawPtr<Document> LocalDOMWindow::installNewDocument(const String return m_document; } -EventQueue* LocalDOMWindow::eventQueue() const +EventQueue* LocalDOMWindow::getEventQueue() const { return m_eventQueue.get(); } @@ -478,7 +478,7 @@ void LocalDOMWindow::dispose() removeAllEventListeners(); } -ExecutionContext* LocalDOMWindow::executionContext() const +ExecutionContext* LocalDOMWindow::getExecutionContext() const { return m_document.get(); } @@ -714,8 +714,8 @@ void LocalDOMWindow::dispatchMessageEventWithOriginCheck(SecurityOrigin* intende { if (intendedTargetOrigin) { // Check target origin now since the target document may have changed since the timer was scheduled. - if (!intendedTargetOrigin->isSameSchemeHostPortAndSuborigin(document()->securityOrigin())) { - String message = ExceptionMessages::failedToExecute("postMessage", "DOMWindow", "The target origin provided ('" + intendedTargetOrigin->toString() + "') does not match the recipient window's origin ('" + document()->securityOrigin()->toString() + "')."); + if (!intendedTargetOrigin->isSameSchemeHostPortAndSuborigin(document()->getSecurityOrigin())) { + String message = ExceptionMessages::failedToExecute("postMessage", "DOMWindow", "The target origin provided ('" + intendedTargetOrigin->toString() + "') does not match the recipient window's origin ('" + document()->getSecurityOrigin()->toString() + "')."); RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(SecurityMessageSource, ErrorMessageLevel, message); consoleMessage->setCallStack(stackTrace); frameConsole()->addMessage(consoleMessage.release()); diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.h b/third_party/WebKit/Source/core/frame/LocalDOMWindow.h index 7145596..246acb9 100644 --- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.h +++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.h @@ -80,7 +80,7 @@ public: PassRefPtrWillBeRawPtr<Document> installNewDocument(const String& mimeType, const DocumentInit&, bool forceXHTML = false); // EventTarget overrides: - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; const LocalDOMWindow* toDOMWindow() const override; LocalDOMWindow* toDOMWindow() override; @@ -185,7 +185,7 @@ public: void willDetachDocumentFromFrame(); - EventQueue* eventQueue() const; + EventQueue* getEventQueue() const; void enqueueWindowEvent(PassRefPtrWillBeRawPtr<Event>); void enqueueDocumentEvent(PassRefPtrWillBeRawPtr<Event>); void enqueuePageshowEvent(PageshowEventPersistence); diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp index a669f98..f62b5e3 100644 --- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp +++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp @@ -377,7 +377,7 @@ void LocalFrame::printNavigationErrorMessage(const Frame& targetFrame, const cha { // URLs aren't available for RemoteFrames, so the error message uses their // origin instead. - String targetFrameDescription = targetFrame.isLocalFrame() ? "with URL '" + toLocalFrame(targetFrame).document()->url().getString() + "'" : "with origin '" + targetFrame.securityContext()->securityOrigin()->toString() + "'"; + String targetFrameDescription = targetFrame.isLocalFrame() ? "with URL '" + toLocalFrame(targetFrame).document()->url().getString() + "'" : "with origin '" + targetFrame.securityContext()->getSecurityOrigin()->toString() + "'"; String message = "Unsafe JavaScript attempt to initiate navigation for frame " + targetFrameDescription + " from frame with URL '" + document()->url().getString() + "'. " + reason + "\n"; localDOMWindow()->printErrorMessage(message); diff --git a/third_party/WebKit/Source/core/frame/Location.cpp b/third_party/WebKit/Source/core/frame/Location.cpp index 41184f7..5a4b03d 100644 --- a/third_party/WebKit/Source/core/frame/Location.cpp +++ b/third_party/WebKit/Source/core/frame/Location.cpp @@ -123,7 +123,7 @@ PassRefPtrWillBeRawPtr<DOMStringList> Location::ancestorOrigins() const if (!m_frame) return origins.release(); for (Frame* frame = m_frame->tree().parent(); frame; frame = frame->tree().parent()) - origins->append(frame->securityContext()->securityOrigin()->toString()); + origins->append(frame->securityContext()->getSecurityOrigin()->toString()); return origins.release(); } diff --git a/third_party/WebKit/Source/core/frame/OriginsUsingFeatures.cpp b/third_party/WebKit/Source/core/frame/OriginsUsingFeatures.cpp index 696e8df..8f4cbb4 100644 --- a/third_party/WebKit/Source/core/frame/OriginsUsingFeatures.cpp +++ b/third_party/WebKit/Source/core/frame/OriginsUsingFeatures.cpp @@ -35,7 +35,7 @@ void OriginsUsingFeatures::countMainWorldOnly(const ScriptState* scriptState, Do static Document* documentFromEventTarget(EventTarget& target) { - ExecutionContext* executionContext = target.executionContext(); + ExecutionContext* executionContext = target.getExecutionContext(); if (!executionContext) return nullptr; if (executionContext->isDocument()) diff --git a/third_party/WebKit/Source/core/frame/RemoteDOMWindow.cpp b/third_party/WebKit/Source/core/frame/RemoteDOMWindow.cpp index 9a11eb9..a85da55 100644 --- a/third_party/WebKit/Source/core/frame/RemoteDOMWindow.cpp +++ b/third_party/WebKit/Source/core/frame/RemoteDOMWindow.cpp @@ -11,7 +11,7 @@ namespace blink { -ExecutionContext* RemoteDOMWindow::executionContext() const +ExecutionContext* RemoteDOMWindow::getExecutionContext() const { return nullptr; } diff --git a/third_party/WebKit/Source/core/frame/RemoteDOMWindow.h b/third_party/WebKit/Source/core/frame/RemoteDOMWindow.h index e269f3e0..73e9113 100644 --- a/third_party/WebKit/Source/core/frame/RemoteDOMWindow.h +++ b/third_party/WebKit/Source/core/frame/RemoteDOMWindow.h @@ -18,7 +18,7 @@ public: } // EventTarget overrides: - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; // DOMWindow overrides: DECLARE_VIRTUAL_TRACE(); diff --git a/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp b/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp index 8626d53..4f9f3cd 100644 --- a/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp +++ b/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp @@ -121,7 +121,7 @@ bool SubresourceIntegrity::CheckSubresourceIntegrity(const IntegrityMetadataSet& { Document& document = element.document(); - if (!resource.isEligibleForIntegrityCheck(document.securityOrigin())) { + if (!resource.isEligibleForIntegrityCheck(document.getSecurityOrigin())) { UseCounter::count(document, UseCounter::SRIElementIntegrityAttributeButIneligible); logErrorToConsole("Subresource Integrity: The resource '" + resourceUrl.elidedString() + "' has an integrity attribute, but the resource requires the request to be CORS enabled to check the integrity, and it is not. The resource has been blocked because the integrity cannot be enforced.", document); return false; diff --git a/third_party/WebKit/Source/core/frame/UseCounter.cpp b/third_party/WebKit/Source/core/frame/UseCounter.cpp index 7815f13..7ab2b2d 100644 --- a/third_party/WebKit/Source/core/frame/UseCounter.cpp +++ b/third_party/WebKit/Source/core/frame/UseCounter.cpp @@ -741,9 +741,9 @@ void UseCounter::countCrossOriginIframe(const Document& document, Feature featur if (!frame) return; // Check to see if the frame can script into the top level document. - SecurityOrigin* securityOrigin = frame->securityContext()->securityOrigin(); + SecurityOrigin* securityOrigin = frame->securityContext()->getSecurityOrigin(); Frame* top = frame->tree().top(); - if (top && !securityOrigin->canAccess(top->securityContext()->securityOrigin())) + if (top && !securityOrigin->canAccess(top->securityContext()->getSecurityOrigin())) count(frame, feature); } diff --git a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp index 3b59427..306f3a8 100644 --- a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp +++ b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp @@ -156,7 +156,7 @@ bool CSPDirectiveList::checkAncestors(SourceListDirective* directive, LocalFrame // // TODO(mkwst): Move this check up into the browser process. See // https://crbug.com/555418. - KURL url(KURL(), current->securityContext()->securityOrigin()->toString()); + KURL url(KURL(), current->securityContext()->getSecurityOrigin()->toString()); if (!directive->allows(url, ContentSecurityPolicy::DidNotRedirect)) return false; } diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp index 15ee42f..f1c88b8 100644 --- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp +++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp @@ -160,10 +160,10 @@ void ContentSecurityPolicy::bindToExecutionContext(ExecutionContext* executionCo void ContentSecurityPolicy::applyPolicySideEffectsToExecutionContext() { ASSERT(m_executionContext); - ASSERT(securityOrigin()); + ASSERT(getSecurityOrigin()); // Ensure that 'self' processes correctly. - m_selfProtocol = securityOrigin()->protocol(); - m_selfSource = adoptPtr(new CSPSource(this, m_selfProtocol, securityOrigin()->host(), securityOrigin()->port(), String(), CSPSource::NoWildcard, CSPSource::NoWildcard)); + m_selfProtocol = getSecurityOrigin()->protocol(); + m_selfSource = adoptPtr(new CSPSource(this, m_selfProtocol, getSecurityOrigin()->host(), getSecurityOrigin()->port(), String(), CSPSource::NoWildcard, CSPSource::NoWildcard)); if (didSetReferrerPolicy()) m_executionContext->setReferrerPolicy(m_referrerPolicy); @@ -182,8 +182,8 @@ void ContentSecurityPolicy::applyPolicySideEffectsToExecutionContext() if (m_insecureRequestsPolicy == SecurityContext::InsecureRequestsUpgrade) { UseCounter::count(document, UseCounter::UpgradeInsecureRequestsEnabled); document->setInsecureRequestsPolicy(m_insecureRequestsPolicy); - if (!securityOrigin()->host().isNull()) - document->addInsecureNavigationUpgrade(securityOrigin()->host().impl()->hash()); + if (!getSecurityOrigin()->host().isNull()) + document->addInsecureNavigationUpgrade(getSecurityOrigin()->host().impl()->hash()); } for (const auto& consoleMessage : m_consoleMessages) @@ -703,9 +703,9 @@ bool ContentSecurityPolicy::didSetReferrerPolicy() const return false; } -SecurityOrigin* ContentSecurityPolicy::securityOrigin() const +SecurityOrigin* ContentSecurityPolicy::getSecurityOrigin() const { - return m_executionContext->securityContext().securityOrigin(); + return m_executionContext->securityContext().getSecurityOrigin(); } const KURL ContentSecurityPolicy::url() const @@ -747,7 +747,7 @@ static String stripURLForUseInReport(Document* document, const KURL& url) return String(); if (!url.isHierarchical() || url.protocolIs("file")) return url.protocol(); - return document->securityOrigin()->canRequest(url) ? url.strippedForUseAsReferrer() : SecurityOrigin::create(url)->toString(); + return document->getSecurityOrigin()->canRequest(url) ? url.strippedForUseAsReferrer() : SecurityOrigin::create(url)->toString(); } static void gatherSecurityPolicyViolationEventData(SecurityPolicyViolationEventInit& init, Document* document, const String& directiveText, const String& effectiveDirective, const KURL& blockedURL, const String& header) @@ -1037,7 +1037,7 @@ bool ContentSecurityPolicy::selfMatchesInnerURL() const // if we're in a context that bypasses Content Security Policy in the main world. // // TODO(mkwst): Revisit this once embedders have an opportunity to update their extension models. - return m_executionContext && SchemeRegistry::schemeShouldBypassContentSecurityPolicy(m_executionContext->securityOrigin()->protocol()); + return m_executionContext && SchemeRegistry::schemeShouldBypassContentSecurityPolicy(m_executionContext->getSecurityOrigin()->protocol()); } bool ContentSecurityPolicy::shouldBypassMainWorld(const ExecutionContext* context) diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.h b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.h index bc32fa2..32d16af 100644 --- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.h +++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.h @@ -277,7 +277,7 @@ private: void applyPolicySideEffectsToExecutionContext(); - SecurityOrigin* securityOrigin() const; + SecurityOrigin* getSecurityOrigin() const; KURL completeURL(const String&) const; void logToConsole(const String& message, MessageLevel = ErrorMessageLevel); diff --git a/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp b/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp index 7693672..f858f4f 100644 --- a/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp @@ -343,7 +343,7 @@ void HTMLAnchorElement::handleClick(Event* event) if (hasAttribute(downloadAttr)) { request.setRequestContext(WebURLRequest::RequestContextDownload); - bool isSameOrigin = completedURL.protocolIsData() || document().securityOrigin()->canRequest(completedURL); + bool isSameOrigin = completedURL.protocolIsData() || document().getSecurityOrigin()->canRequest(completedURL); const AtomicString& suggestedName = (isSameOrigin ? fastGetAttribute(downloadAttr) : nullAtom); frame->loader().client()->loadURLExternally(request, NavigationPolicyDownload, suggestedName, false); diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp index 282719c..9206c3f 100644 --- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp @@ -635,9 +635,9 @@ void HTMLCanvasElement::removeListener(CanvasDrawListener* listener) m_listeners.remove(listener); } -SecurityOrigin* HTMLCanvasElement::securityOrigin() const +SecurityOrigin* HTMLCanvasElement::getSecurityOrigin() const { - return document().securityOrigin(); + return document().getSecurityOrigin(); } bool HTMLCanvasElement::originClean() const diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.h b/third_party/WebKit/Source/core/html/HTMLCanvasElement.h index e9ee1b4..21f6e93 100644 --- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.h +++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.h @@ -125,7 +125,7 @@ public: PassRefPtr<Image> copiedImage(SourceDrawingBuffer, AccelerationHint) const; void clearCopiedImage(); - SecurityOrigin* securityOrigin() const; + SecurityOrigin* getSecurityOrigin() const; bool originClean() const; void setOriginTainted() { m_originClean = false; } diff --git a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp index 45cf691..42ebd73 100644 --- a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp @@ -283,7 +283,7 @@ bool HTMLFrameOwnerElement::loadOrRedirectSubframe(const KURL& url, const Atomic return true; } - if (!document().securityOrigin()->canDisplay(url)) { + if (!document().getSecurityOrigin()->canDisplay(url)) { FrameLoader::reportLocalLoadFailed(parentFrame.get(), url.getString()); return false; } diff --git a/third_party/WebKit/Source/core/html/HTMLKeygenElement.cpp b/third_party/WebKit/Source/core/html/HTMLKeygenElement.cpp index 90b3c40..97a5741 100644 --- a/third_party/WebKit/Source/core/html/HTMLKeygenElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLKeygenElement.cpp @@ -105,7 +105,7 @@ void HTMLKeygenElement::appendToFormData(FormData& formData) const AtomicString& keyType = fastGetAttribute(keytypeAttr); if (!keyType.isNull() && !equalIgnoringCase(keyType, "rsa")) return; - SecurityOrigin* topOrigin = document().frame()->tree().top()->securityContext()->securityOrigin(); + SecurityOrigin* topOrigin = document().frame()->tree().top()->securityContext()->getSecurityOrigin(); String value = Platform::current()->signedPublicKeyAndChallengeString( shadowSelect()->selectedIndex(), fastGetAttribute(challengeAttr), document().baseURL(), KURL(KURL(), topOrigin->toString())); diff --git a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp index f6d32a7..6bc0897 100644 --- a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp @@ -570,7 +570,7 @@ void LinkStyle::setCSSStyleSheet(const String& href, const KURL& baseURL, const m_sheet->setTitle(m_owner->title()); setCrossOriginStylesheetStatus(m_sheet.get()); - styleSheet->parseAuthorStyleSheet(cachedStyleSheet, m_owner->document().securityOrigin()); + styleSheet->parseAuthorStyleSheet(cachedStyleSheet, m_owner->document().getSecurityOrigin()); m_loading = false; styleSheet->notifyLoadedSheet(cachedStyleSheet); @@ -692,7 +692,7 @@ void LinkStyle::setCrossOriginStylesheetStatus(CSSStyleSheet* sheet) if (m_fetchFollowingCORS && resource() && !resource()->errorOccurred()) { // Record the security origin the CORS access check succeeded at, if cross origin. // Only origins that are script accessible to it may access the stylesheet's rules. - sheet->setAllowRuleAccessFromOrigin(m_owner->document().securityOrigin()); + sheet->setAllowRuleAccessFromOrigin(m_owner->document().getSecurityOrigin()); } m_fetchFollowingCORS = false; } @@ -707,7 +707,7 @@ void LinkStyle::process() if (m_owner->relAttribute().getIconType() != InvalidIcon && builder.url().isValid() && !builder.url().isEmpty()) { if (!m_owner->shouldLoadLink()) return; - if (!document().securityOrigin()->canDisplay(builder.url())) + if (!document().getSecurityOrigin()->canDisplay(builder.url())) return; if (!document().contentSecurityPolicy()->allowImageFromSource(builder.url())) return; @@ -750,7 +750,7 @@ void LinkStyle::process() FetchRequest request = builder.build(lowPriority); CrossOriginAttributeValue crossOrigin = crossOriginAttributeValue(m_owner->fastGetAttribute(HTMLNames::crossoriginAttr)); if (crossOrigin != CrossOriginAttributeNotSet) { - request.setCrossOriginAccessControl(document().securityOrigin(), crossOrigin); + request.setCrossOriginAccessControl(document().getSecurityOrigin(), crossOrigin); setFetchFollowingCORS(); } setResource(CSSStyleSheetResource::fetch(request, document().fetcher())); diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp index 854d842..843fe17 100644 --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp @@ -422,7 +422,7 @@ void HTMLMediaElement::dispose() // to update the delayed load count. But if the Document hasn't // been detached cleanly from any frame or it isn't dying in the // same GC, we do update the delayed load count from the prefinalizer. - if (ActiveDOMObject::executionContext()) + if (ActiveDOMObject::getExecutionContext()) setShouldDelayLoadEvent(false); // If the MediaSource object survived, notify that the media element @@ -1034,7 +1034,7 @@ void HTMLMediaElement::startPlayerLoad() if (layoutObject()) layoutObject()->setShouldDoFullPaintInvalidation(); // Make sure if we create/re-create the WebMediaPlayer that we update our wrapper. - m_audioSourceProvider.wrap(m_webMediaPlayer->audioSourceProvider()); + m_audioSourceProvider.wrap(m_webMediaPlayer->getAudioSourceProvider()); m_webMediaPlayer->setVolume(effectiveMediaVolume()); m_webMediaPlayer->setPoster(posterImageURL()); @@ -1190,7 +1190,7 @@ bool HTMLMediaElement::isSafeToLoadURL(const KURL& url, InvalidURLAction actionI } LocalFrame* frame = document().frame(); - if (!frame || !document().securityOrigin()->canDisplay(url)) { + if (!frame || !document().getSecurityOrigin()->canDisplay(url)) { if (actionIfInvalid == Complain) FrameLoader::reportLocalLoadFailed(frame, url.elidedString()); WTF_LOG(Media, "HTMLMediaElement::isSafeToLoadURL(%p, %s) -> FALSE rejected by SecurityOrigin", this, urlForLoggingMedia(url).utf8().data()); @@ -3069,7 +3069,7 @@ void HTMLMediaElement::stopPeriodicTimers() void HTMLMediaElement::clearMediaPlayerAndAudioSourceProviderClientWithoutLocking() { - audioSourceProvider().setClient(nullptr); + getAudioSourceProvider().setClient(nullptr); if (m_webMediaPlayer) { m_audioSourceProvider.wrap(nullptr); m_webMediaPlayer.clear(); @@ -3502,7 +3502,7 @@ void HTMLMediaElement::resetMediaPlayerAndMediaSource() m_playingRemotely = false; if (m_audioSourceNode) - audioSourceProvider().setClient(m_audioSourceNode); + getAudioSourceProvider().setClient(m_audioSourceNode); } void HTMLMediaElement::setAudioSourceNode(AudioSourceProviderClient* sourceNode) @@ -3511,7 +3511,7 @@ void HTMLMediaElement::setAudioSourceNode(AudioSourceProviderClient* sourceNode) m_audioSourceNode = sourceNode; AudioSourceProviderClientLockScope scope(*this); - audioSourceProvider().setClient(m_audioSourceNode); + getAudioSourceProvider().setClient(m_audioSourceNode); } void HTMLMediaElement::setAllowHiddenVolumeControls(bool allow) @@ -3727,7 +3727,7 @@ void HTMLMediaElement::rejectPlayPromises(ExceptionCode code, const String& mess void HTMLMediaElement::clearWeakMembers(Visitor* visitor) { if (!Heap::isHeapObjectAlive(m_audioSourceNode)) - audioSourceProvider().setClient(nullptr); + getAudioSourceProvider().setClient(nullptr); } void HTMLMediaElement::AudioSourceProviderImpl::wrap(WebAudioSourceProvider* provider) diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.h b/third_party/WebKit/Source/core/html/HTMLMediaElement.h index 5f22ef0..a388248 100644 --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.h +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.h @@ -203,7 +203,7 @@ public: // 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. - using HTMLElement::executionContext; + using HTMLElement::getExecutionContext; bool hasSingleSecurityOrigin() const { return webMediaPlayer() && webMediaPlayer()->hasSingleSecurityOrigin(); } @@ -236,7 +236,7 @@ public: AudioSourceProviderClient* audioSourceNode() { return m_audioSourceNode; } void setAudioSourceNode(AudioSourceProviderClient*); - AudioSourceProvider& audioSourceProvider() { return m_audioSourceProvider; } + AudioSourceProvider& getAudioSourceProvider() { return m_audioSourceProvider; } enum InvalidURLAction { DoNothing, Complain }; bool isSafeToLoadURL(const KURL&, InvalidURLAction); diff --git a/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp b/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp index 088e801..921c864 100644 --- a/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp @@ -453,7 +453,7 @@ bool HTMLPlugInElement::allowedToLoadFrameURL(const String& url) { KURL completeURL = document().completeURL(url); if (contentFrame() && protocolIsJavaScript(completeURL) - && !document().securityOrigin()->canAccess(contentFrame()->securityContext()->securityOrigin())) + && !document().getSecurityOrigin()->canAccess(contentFrame()->securityContext()->getSecurityOrigin())) return false; return document().frame()->isURLAllowed(completeURL); } @@ -583,7 +583,7 @@ bool HTMLPlugInElement::allowedToLoadObject(const KURL& url, const String& mimeT if (MIMETypeRegistry::isJavaAppletMIMEType(mimeType)) return false; - if (!document().securityOrigin()->canDisplay(url)) { + if (!document().getSecurityOrigin()->canDisplay(url)) { FrameLoader::reportLocalLoadFailed(frame, url.getString()); return false; } diff --git a/third_party/WebKit/Source/core/html/PublicURLManager.cpp b/third_party/WebKit/Source/core/html/PublicURLManager.cpp index bf44c55..92bf4a7 100644 --- a/third_party/WebKit/Source/core/html/PublicURLManager.cpp +++ b/third_party/WebKit/Source/core/html/PublicURLManager.cpp @@ -76,7 +76,7 @@ void PublicURLManager::revoke(const String& uuid) for (auto& registeredUrl : registeredURLs) { if (uuid == registeredUrl.value) { KURL url(ParsedURLString, registeredUrl.key); - executionContext()->removeURLFromMemoryCache(url); + getExecutionContext()->removeURLFromMemoryCache(url); registry->unregisterURL(url); urlsToRemove.append(registeredUrl.key); } diff --git a/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp b/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp index 696fccc..e58ca02 100644 --- a/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp +++ b/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp @@ -71,7 +71,7 @@ bool CanvasRenderingContext::wouldTaintOrigin(CanvasImageSource* imageSource) return true; } - bool taintOrigin = imageSource->wouldTaintOrigin(canvas()->securityOrigin()); + bool taintOrigin = imageSource->wouldTaintOrigin(canvas()->getSecurityOrigin()); if (hasURL) { if (taintOrigin) diff --git a/third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp b/third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp index ade5d0e..f73104b 100644 --- a/third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp +++ b/third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp @@ -124,7 +124,7 @@ HTMLImportChild* HTMLImportsController::load(HTMLImport* parent, HTMLImportChild return child; } - request.setCrossOriginAccessControl(master()->securityOrigin(), CrossOriginAttributeAnonymous); + request.setCrossOriginAccessControl(master()->getSecurityOrigin(), CrossOriginAttributeAnonymous); RefPtrWillBeRawPtr<RawResource> resource = RawResource::fetchImport(request, parent->document()->fetcher()); if (!resource) return nullptr; diff --git a/third_party/WebKit/Source/core/html/parser/PreloadRequest.cpp b/third_party/WebKit/Source/core/html/parser/PreloadRequest.cpp index dbbdd2d..8093323 100644 --- a/third_party/WebKit/Source/core/html/parser/PreloadRequest.cpp +++ b/third_party/WebKit/Source/core/html/parser/PreloadRequest.cpp @@ -38,11 +38,11 @@ FetchRequest PreloadRequest::resourceRequest(Document* document) FetchRequest request(resourceRequest, initiatorInfo); if (m_resourceType == Resource::ImportResource) { - SecurityOrigin* securityOrigin = document->contextDocument()->securityOrigin(); + SecurityOrigin* securityOrigin = document->contextDocument()->getSecurityOrigin(); request.setCrossOriginAccessControl(securityOrigin, CrossOriginAttributeAnonymous); } if (m_crossOrigin != CrossOriginAttributeNotSet) - request.setCrossOriginAccessControl(document->securityOrigin(), m_crossOrigin); + request.setCrossOriginAccessControl(document->getSecurityOrigin(), m_crossOrigin); request.setDefer(m_defer); request.setResourceWidth(m_resourceWidth); request.clientHintsPreferences().updateFrom(m_clientHintsPreferences); diff --git a/third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp b/third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp index 069bba1..54b8cff 100644 --- a/third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp +++ b/third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp @@ -344,7 +344,7 @@ void XSSAuditor::init(Document* document, XSSAuditorDelegate* auditorDelegate) m_didSendValidXSSProtectionHeader = xssProtectionHeader != ReflectedXSSUnset && xssProtectionHeader != ReflectedXSSInvalid; if ((xssProtectionHeader == FilterReflectedXSS || xssProtectionHeader == BlockReflectedXSS) && !reportURL.isEmpty()) { xssProtectionReportURL = document->completeURL(reportURL); - if (MixedContentChecker::isMixedContent(document->securityOrigin(), xssProtectionReportURL)) { + if (MixedContentChecker::isMixedContent(document->getSecurityOrigin(), xssProtectionReportURL)) { errorDetails = "insecure reporting URL for secure page"; xssProtectionHeader = ReflectedXSSInvalid; xssProtectionReportURL = KURL(); diff --git a/third_party/WebKit/Source/core/html/track/TextTrack.cpp b/third_party/WebKit/Source/core/html/track/TextTrack.cpp index 2f122e2..9cdcaf2 100644 --- a/third_party/WebKit/Source/core/html/track/TextTrack.cpp +++ b/third_party/WebKit/Source/core/html/track/TextTrack.cpp @@ -448,10 +448,10 @@ const AtomicString& TextTrack::interfaceName() const return EventTargetNames::TextTrack; } -ExecutionContext* TextTrack::executionContext() const +ExecutionContext* TextTrack::getExecutionContext() const { HTMLMediaElement* owner = mediaElement(); - return owner ? owner->executionContext() : 0; + return owner ? owner->getExecutionContext() : 0; } HTMLMediaElement* TextTrack::mediaElement() const diff --git a/third_party/WebKit/Source/core/html/track/TextTrack.h b/third_party/WebKit/Source/core/html/track/TextTrack.h index cf93726..5b072a5 100644 --- a/third_party/WebKit/Source/core/html/track/TextTrack.h +++ b/third_party/WebKit/Source/core/html/track/TextTrack.h @@ -115,7 +115,7 @@ public: // EventTarget methods const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; DECLARE_VIRTUAL_TRACE(); diff --git a/third_party/WebKit/Source/core/html/track/TextTrackList.cpp b/third_party/WebKit/Source/core/html/track/TextTrackList.cpp index e6169d8..82aed0d 100644 --- a/third_party/WebKit/Source/core/html/track/TextTrackList.cpp +++ b/third_party/WebKit/Source/core/html/track/TextTrackList.cpp @@ -257,9 +257,9 @@ const AtomicString& TextTrackList::interfaceName() const return EventTargetNames::TextTrackList; } -ExecutionContext* TextTrackList::executionContext() const +ExecutionContext* TextTrackList::getExecutionContext() const { - return m_owner ? m_owner->executionContext() : 0; + return m_owner ? m_owner->getExecutionContext() : 0; } #if !ENABLE(OILPAN) diff --git a/third_party/WebKit/Source/core/html/track/TextTrackList.h b/third_party/WebKit/Source/core/html/track/TextTrackList.h index 9fc73e2..e2057f5 100644 --- a/third_party/WebKit/Source/core/html/track/TextTrackList.h +++ b/third_party/WebKit/Source/core/html/track/TextTrackList.h @@ -62,7 +62,7 @@ public: // EventTarget const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack); DEFINE_ATTRIBUTE_EVENT_LISTENER(change); diff --git a/third_party/WebKit/Source/core/html/track/TrackListBase.h b/third_party/WebKit/Source/core/html/track/TrackListBase.h index 522e428..f044b60 100644 --- a/third_party/WebKit/Source/core/html/track/TrackListBase.h +++ b/third_party/WebKit/Source/core/html/track/TrackListBase.h @@ -53,10 +53,10 @@ public: DEFINE_ATTRIBUTE_EVENT_LISTENER(removetrack); // EventTarget interface - ExecutionContext* executionContext() const override + ExecutionContext* getExecutionContext() const override { if (m_mediaElement) - return m_mediaElement->executionContext(); + return m_mediaElement->getExecutionContext(); return nullptr; } diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp index eb462a3..7a7a2da 100644 --- a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp +++ b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp @@ -1127,10 +1127,10 @@ void VTTCue::applyUserOverrideCSSProperties() CSSPropertyFontSize, settings->textTrackTextSize()); } -ExecutionContext* VTTCue::executionContext() const +ExecutionContext* VTTCue::getExecutionContext() const { ASSERT(m_cueBackgroundBox); - return m_cueBackgroundBox->executionContext(); + return m_cueBackgroundBox->getExecutionContext(); } Document& VTTCue::document() const diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.h b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.h index 0fde730..0b495c2 100644 --- a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.h +++ b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.h @@ -141,7 +141,7 @@ public: }; CueAlignment getCueAlignment() const { return m_cueAlignment; } - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; #ifndef NDEBUG String toString() const override; diff --git a/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp b/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp index 22d2cd2..65f1577 100644 --- a/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp +++ b/third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp @@ -74,7 +74,7 @@ static inline ImageBitmapSource* toImageBitmapSourceInternal(const ImageBitmapSo ScriptPromise ImageBitmapFactories::createImageBitmap(ScriptState* scriptState, EventTarget& eventTarget, const ImageBitmapSourceUnion& bitmapSource, ExceptionState& exceptionState) { UseCounter::Feature feature = UseCounter::CreateImageBitmap; - UseCounter::count(scriptState->executionContext(), feature); + UseCounter::count(scriptState->getExecutionContext(), feature); ImageBitmapOptions options; return createImageBitmap(scriptState, eventTarget, bitmapSource, options, exceptionState); } @@ -87,7 +87,7 @@ ScriptPromise ImageBitmapFactories::createImageBitmap(ScriptState* scriptState, ImageBitmapLoader* loader = ImageBitmapFactories::ImageBitmapLoader::create(from(eventTarget), IntRect(), options, scriptState); ScriptPromise promise = loader->promise(); from(eventTarget).addLoader(loader); - loader->loadBlobAsync(eventTarget.executionContext(), blob); + loader->loadBlobAsync(eventTarget.getExecutionContext(), blob); return promise; } IntSize srcSize = bitmapSourceInternal->bitmapSourceSize(); @@ -97,7 +97,7 @@ ScriptPromise ImageBitmapFactories::createImageBitmap(ScriptState* scriptState, ScriptPromise ImageBitmapFactories::createImageBitmap(ScriptState* scriptState, EventTarget& eventTarget, const ImageBitmapSourceUnion& bitmapSource, int sx, int sy, int sw, int sh, ExceptionState& exceptionState) { UseCounter::Feature feature = UseCounter::CreateImageBitmap; - UseCounter::count(scriptState->executionContext(), feature); + UseCounter::count(scriptState->getExecutionContext(), feature); ImageBitmapOptions options; return createImageBitmap(scriptState, eventTarget, bitmapSource, sx, sy, sw, sh, options, exceptionState); } @@ -119,7 +119,7 @@ ScriptPromise ImageBitmapFactories::createImageBitmap(ScriptState* scriptState, ImageBitmapLoader* loader = ImageBitmapFactories::ImageBitmapLoader::create(from(eventTarget), IntRect(sx, sy, sw, sh), options, scriptState); ScriptPromise promise = loader->promise(); from(eventTarget).addLoader(loader); - loader->loadBlobAsync(eventTarget.executionContext(), blob); + loader->loadBlobAsync(eventTarget.getExecutionContext(), blob); return promise; } @@ -136,8 +136,8 @@ ImageBitmapFactories& ImageBitmapFactories::from(EventTarget& eventTarget) if (LocalDOMWindow* window = eventTarget.toDOMWindow()) return fromInternal(*window); - ASSERT(eventTarget.executionContext()->isWorkerGlobalScope()); - return ImageBitmapFactories::fromInternal(*toWorkerGlobalScope(eventTarget.executionContext())); + ASSERT(eventTarget.getExecutionContext()->isWorkerGlobalScope()); + return ImageBitmapFactories::fromInternal(*toWorkerGlobalScope(eventTarget.getExecutionContext())); } template<class GlobalObject> @@ -185,7 +185,7 @@ DEFINE_TRACE(ImageBitmapFactories) void ImageBitmapFactories::ImageBitmapLoader::rejectPromise() { - m_resolver->reject(ScriptValue(m_resolver->scriptState(), v8::Null(m_resolver->scriptState()->isolate()))); + m_resolver->reject(ScriptValue(m_resolver->getScriptState(), v8::Null(m_resolver->getScriptState()->isolate()))); m_factory->didFinishLoading(this); } diff --git a/third_party/WebKit/Source/core/inspector/AsyncCallTracker.cpp b/third_party/WebKit/Source/core/inspector/AsyncCallTracker.cpp index ed82b46..9abb8d8 100644 --- a/third_party/WebKit/Source/core/inspector/AsyncCallTracker.cpp +++ b/third_party/WebKit/Source/core/inspector/AsyncCallTracker.cpp @@ -73,8 +73,8 @@ public: void contextDestroyed() override { - ASSERT(executionContext()); - OwnPtrWillBeRawPtr<ExecutionContextData> self = m_tracker->m_executionContextDataMap.take(executionContext()); + ASSERT(getExecutionContext()); + OwnPtrWillBeRawPtr<ExecutionContextData> self = m_tracker->m_executionContextDataMap.take(getExecutionContext()); ASSERT_UNUSED(self, self == this); ContextLifecycleObserver::contextDestroyed(); disposeCallChains(); @@ -232,30 +232,30 @@ bool AsyncCallTracker::willFireAnimationFrame(ExecutionContext* context, int cal void AsyncCallTracker::didEnqueueEvent(EventTarget* eventTarget, Event* event) { - ASSERT(eventTarget->executionContext()); + ASSERT(eventTarget->getExecutionContext()); ASSERT(m_debuggerAgent->trackingAsyncCalls()); ScriptForbiddenScope::AllowUserAgentScript allowScripting; int operationId = m_debuggerAgent->traceAsyncOperationStarting(event->type()); - ExecutionContextData* data = createContextDataIfNeeded(eventTarget->executionContext()); + ExecutionContextData* data = createContextDataIfNeeded(eventTarget->getExecutionContext()); data->m_eventCallChains.set(event, operationId); } void AsyncCallTracker::didRemoveEvent(EventTarget* eventTarget, Event* event) { - ASSERT(eventTarget->executionContext()); + ASSERT(eventTarget->getExecutionContext()); ASSERT(m_debuggerAgent->trackingAsyncCalls()); - if (ExecutionContextData* data = m_executionContextDataMap.get(eventTarget->executionContext())) + if (ExecutionContextData* data = m_executionContextDataMap.get(eventTarget->getExecutionContext())) data->m_eventCallChains.remove(event); } void AsyncCallTracker::willHandleEvent(EventTarget* eventTarget, Event* event, EventListener* listener, bool useCapture) { - ASSERT(eventTarget->executionContext()); + ASSERT(eventTarget->getExecutionContext()); ASSERT(m_debuggerAgent->trackingAsyncCalls()); if (XMLHttpRequest* xhr = toXmlHttpRequest(eventTarget)) { willHandleXHREvent(xhr, event); } else { - ExecutionContext* context = eventTarget->executionContext(); + ExecutionContext* context = eventTarget->getExecutionContext(); if (ExecutionContextData* data = m_executionContextDataMap.get(context)) willFireAsyncCall(data->m_eventCallChains.get(event)); else @@ -265,26 +265,26 @@ void AsyncCallTracker::willHandleEvent(EventTarget* eventTarget, Event* event, E void AsyncCallTracker::willLoadXHR(XMLHttpRequest* xhr, ThreadableLoaderClient*, const AtomicString&, const KURL&, bool async, PassRefPtr<EncodedFormData>, const HTTPHeaderMap&, bool) { - ASSERT(xhr->executionContext()); + ASSERT(xhr->getExecutionContext()); ASSERT(m_debuggerAgent->trackingAsyncCalls()); if (!async) return; int operationId = m_debuggerAgent->traceAsyncOperationStarting(xhrSendName); - ExecutionContextData* data = createContextDataIfNeeded(xhr->executionContext()); + ExecutionContextData* data = createContextDataIfNeeded(xhr->getExecutionContext()); data->m_xhrCallChains.set(xhr, operationId); } void AsyncCallTracker::didDispatchXHRLoadendEvent(XMLHttpRequest* xhr) { - ASSERT(xhr->executionContext()); + ASSERT(xhr->getExecutionContext()); ASSERT(m_debuggerAgent->trackingAsyncCalls()); - if (ExecutionContextData* data = m_executionContextDataMap.get(xhr->executionContext())) + if (ExecutionContextData* data = m_executionContextDataMap.get(xhr->getExecutionContext())) data->m_xhrCallChains.remove(xhr); } void AsyncCallTracker::willHandleXHREvent(XMLHttpRequest* xhr, Event* event) { - ExecutionContext* context = xhr->executionContext(); + ExecutionContext* context = xhr->getExecutionContext(); ASSERT(context); ASSERT(m_debuggerAgent->trackingAsyncCalls()); if (ExecutionContextData* data = m_executionContextDataMap.get(context)) diff --git a/third_party/WebKit/Source/core/inspector/ConsoleMessage.cpp b/third_party/WebKit/Source/core/inspector/ConsoleMessage.cpp index ae175e6..c3ac028 100644 --- a/third_party/WebKit/Source/core/inspector/ConsoleMessage.cpp +++ b/third_party/WebKit/Source/core/inspector/ConsoleMessage.cpp @@ -104,7 +104,7 @@ void ConsoleMessage::setCallStack(PassRefPtr<ScriptCallStack> callStack) } } -ScriptState* ConsoleMessage::scriptState() const +ScriptState* ConsoleMessage::getScriptState() const { if (m_scriptState) return m_scriptState->get(); @@ -181,12 +181,12 @@ unsigned ConsoleMessage::columnNumber() const void ConsoleMessage::frameWindowDiscarded(LocalDOMWindow* window) { - if (scriptState() && scriptState()->domWindow() == window) + if (getScriptState() && getScriptState()->domWindow() == window) setScriptState(nullptr); if (!m_scriptArguments) return; - if (m_scriptArguments->scriptState()->domWindow() != window) + if (m_scriptArguments->getScriptState()->domWindow() != window) return; if (!m_message) m_message = "<message collected>"; diff --git a/third_party/WebKit/Source/core/inspector/ConsoleMessage.h b/third_party/WebKit/Source/core/inspector/ConsoleMessage.h index 73ab452..7f8213e 100644 --- a/third_party/WebKit/Source/core/inspector/ConsoleMessage.h +++ b/third_party/WebKit/Source/core/inspector/ConsoleMessage.h @@ -40,7 +40,7 @@ public: void setLineNumber(unsigned); PassRefPtr<ScriptCallStack> callStack() const; void setCallStack(PassRefPtr<ScriptCallStack>); - ScriptState* scriptState() const; + ScriptState* getScriptState() const; void setScriptState(ScriptState*); PassRefPtrWillBeRawPtr<ScriptArguments> scriptArguments() const; void setScriptArguments(PassRefPtrWillBeRawPtr<ScriptArguments>); diff --git a/third_party/WebKit/Source/core/inspector/InspectedFrames.cpp b/third_party/WebKit/Source/core/inspector/InspectedFrames.cpp index 8d2b396..dbf9886 100644 --- a/third_party/WebKit/Source/core/inspector/InspectedFrames.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectedFrames.cpp @@ -32,7 +32,7 @@ bool InspectedFrames::contains(LocalFrame* frame) const LocalFrame* InspectedFrames::frameWithSecurityOrigin(const String& originRawString) { for (LocalFrame* frame : *this) { - if (frame->document()->securityOrigin()->toRawString() == originRawString) + if (frame->document()->getSecurityOrigin()->toRawString() == originRawString) return frame; } return nullptr; diff --git a/third_party/WebKit/Source/core/inspector/InspectorConsoleAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorConsoleAgent.cpp index 4cf502f..7d2a924 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorConsoleAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorConsoleAgent.cpp @@ -189,15 +189,15 @@ void InspectorConsoleAgent::sendConsoleMessageToFrontend(ConsoleMessage* console if (consoleMessage->scriptId()) jsonObj->setScriptId(String::number(consoleMessage->scriptId())); jsonObj->setUrl(consoleMessage->url()); - ScriptState* scriptState = consoleMessage->scriptState(); + ScriptState* scriptState = consoleMessage->getScriptState(); if (scriptState) jsonObj->setExecutionContextId(scriptState->contextIdInDebugger()); if (consoleMessage->source() == NetworkMessageSource && consoleMessage->requestIdentifier()) jsonObj->setNetworkRequestId(IdentifiersFactory::requestId(consoleMessage->requestIdentifier())); RefPtrWillBeRawPtr<ScriptArguments> arguments = consoleMessage->scriptArguments(); if (arguments && arguments->argumentCount()) { - ScriptState::Scope scope(arguments->scriptState()); - v8::Local<v8::Context> context = arguments->scriptState()->context(); + ScriptState::Scope scope(arguments->getScriptState()); + v8::Local<v8::Context> context = arguments->getScriptState()->context(); OwnPtr<protocol::Array<protocol::Runtime::RemoteObject>> jsonArgs = protocol::Array<protocol::Runtime::RemoteObject>::create(); if (consoleMessage->type() == TableMessageType && generatePreview) { v8::Local<v8::Value> table = arguments->argumentAt(0).v8Value(); diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp index 4b6756f..84867dc 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp @@ -95,10 +95,10 @@ void InspectorDOMDebuggerAgent::eventListenersInfoForTarget(v8::Isolate* isolate // We need to handle LocalDOMWindow specially, because LocalDOMWindow wrapper exists on prototype chain. if (!target) target = toDOMWindow(isolate, value); - if (!target || !target->executionContext()) + if (!target || !target->getExecutionContext()) return; - ExecutionContext* executionContext = target->executionContext(); + ExecutionContext* executionContext = target->getExecutionContext(); // Nodes and their Listeners for the concerned event types (order is top to bottom) Vector<AtomicString> eventTypes = target->eventTypes(); diff --git a/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp b/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp index 77d6c37..de8806f 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp @@ -154,7 +154,7 @@ InstrumentingAgents* instrumentingAgentsFor(EventTarget* eventTarget) { if (!eventTarget) return 0; - return instrumentingAgentsFor(eventTarget->executionContext()); + return instrumentingAgentsFor(eventTarget->getExecutionContext()); } InstrumentingAgents* instrumentingAgentsFor(LayoutObject* layoutObject) diff --git a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp index 21429a3..cbe1efe 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp @@ -705,7 +705,7 @@ PassOwnPtr<protocol::Page::Frame> InspectorPageAgent::buildObjectForFrame(LocalF .setLoaderId(IdentifiersFactory::loaderId(frame->loader().documentLoader())) .setUrl(urlWithoutFragment(frame->document()->url()).getString()) .setMimeType(frame->loader().documentLoader()->responseMIMEType()) - .setSecurityOrigin(frame->document()->securityOrigin()->toRawString()).build(); + .setSecurityOrigin(frame->document()->getSecurityOrigin()->toRawString()).build(); // FIXME: This doesn't work for OOPI. Frame* parentFrame = frame->tree().parent(); if (parentFrame && parentFrame->isLocalFrame()) diff --git a/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp index 3ebbcf4..e8cfe18 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp @@ -649,7 +649,7 @@ void InspectorResourceAgent::willLoadXHR(XMLHttpRequest* xhr, ThreadableLoaderCl ASSERT(!m_pendingRequest); m_pendingRequest = client; m_pendingRequestType = InspectorPageAgent::XHRResource; - m_pendingXHRReplayData = XHRReplayData::create(xhr->executionContext(), method, urlWithoutFragment(url), async, formData.get(), includeCredentials); + m_pendingXHRReplayData = XHRReplayData::create(xhr->getExecutionContext(), method, urlWithoutFragment(url), async, formData.get(), includeCredentials); for (const auto& header : headers) m_pendingXHRReplayData->addHeader(header.key, header.value); } @@ -999,7 +999,7 @@ void InspectorResourceAgent::replayXHR(ErrorString*, const String& requestId) if (!xhrReplayData) return; - ExecutionContext* executionContext = xhrReplayData->executionContext(); + ExecutionContext* executionContext = xhrReplayData->getExecutionContext(); if (!executionContext) { m_resourcesData->setXHRReplayData(requestId, 0); return; diff --git a/third_party/WebKit/Source/core/inspector/ScriptArguments.h b/third_party/WebKit/Source/core/inspector/ScriptArguments.h index 9c72f7b..861b1b2 100644 --- a/third_party/WebKit/Source/core/inspector/ScriptArguments.h +++ b/third_party/WebKit/Source/core/inspector/ScriptArguments.h @@ -51,7 +51,7 @@ public: const ScriptValue& argumentAt(size_t) const; size_t argumentCount() const { return m_arguments.size(); } - ScriptState* scriptState() const { return m_scriptState.get(); } + ScriptState* getScriptState() const { return m_scriptState.get(); } bool getFirstArgumentAsString(String&) const; diff --git a/third_party/WebKit/Source/core/inspector/WorkerRuntimeAgent.cpp b/third_party/WebKit/Source/core/inspector/WorkerRuntimeAgent.cpp index 747bcff..d5540d2 100644 --- a/third_party/WebKit/Source/core/inspector/WorkerRuntimeAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/WorkerRuntimeAgent.cpp @@ -57,13 +57,13 @@ void WorkerRuntimeAgent::enable(ErrorString* errorString) return; InspectorRuntimeAgent::enable(errorString); - ScriptState* scriptState = m_workerGlobalScope->scriptController()->scriptState(); + ScriptState* scriptState = m_workerGlobalScope->scriptController()->getScriptState(); reportExecutionContextCreated(scriptState, "", m_workerGlobalScope->url().getString(), "", ""); } ScriptState* WorkerRuntimeAgent::defaultScriptState() { - return m_workerGlobalScope->scriptController()->scriptState(); + return m_workerGlobalScope->scriptController()->getScriptState(); } void WorkerRuntimeAgent::muteConsole() diff --git a/third_party/WebKit/Source/core/layout/shapes/ShapeOutsideInfo.cpp b/third_party/WebKit/Source/core/layout/shapes/ShapeOutsideInfo.cpp index 9aafdd4..6df9027 100644 --- a/third_party/WebKit/Source/core/layout/shapes/ShapeOutsideInfo.cpp +++ b/third_party/WebKit/Source/core/layout/shapes/ShapeOutsideInfo.cpp @@ -90,7 +90,7 @@ static bool checkShapeImageOrigin(Document& document, const StyleImage& styleIma ASSERT(styleImage.cachedImage()); ImageResource& imageResource = *(styleImage.cachedImage()); - if (imageResource.isAccessAllowed(document.securityOrigin())) + if (imageResource.isAccessAllowed(document.getSecurityOrigin())) return true; const KURL& url = imageResource.url(); diff --git a/third_party/WebKit/Source/core/loader/BeaconLoader.cpp b/third_party/WebKit/Source/core/loader/BeaconLoader.cpp index 5d4bf31..75ff002 100644 --- a/third_party/WebKit/Source/core/loader/BeaconLoader.cpp +++ b/third_party/WebKit/Source/core/loader/BeaconLoader.cpp @@ -130,7 +130,7 @@ bool BeaconLoader::sendBeacon(LocalFrame* frame, int allowance, const KURL& beac BeaconLoader::BeaconLoader(LocalFrame* frame, ResourceRequest& request, const FetchInitiatorInfo& initiatorInfo, StoredCredentials credentialsAllowed) : PingLoader(frame, request, initiatorInfo, credentialsAllowed) - , m_beaconOrigin(frame->document()->securityOrigin()) + , m_beaconOrigin(frame->document()->getSecurityOrigin()) { } diff --git a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp index c9ccdf9..7a42c3e 100644 --- a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp +++ b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp @@ -141,7 +141,7 @@ void DocumentThreadableLoader::start(const ResourceRequest& request) // Setting an outgoing referer is only supported in the async code path. ASSERT(m_async || request.httpReferrer().isEmpty()); - m_sameOriginRequest = securityOrigin()->canRequestNoSuborigin(request.url()); + m_sameOriginRequest = getSecurityOrigin()->canRequestNoSuborigin(request.url()); m_requestContext = request.requestContext(); m_redirectMode = request.fetchRedirectMode(); @@ -272,7 +272,7 @@ void DocumentThreadableLoader::makeCrossOriginAccessRequest(const ResourceReques if ((m_options.preflightPolicy == ConsiderPreflight && FetchUtils::isSimpleOrForbiddenRequest(request.httpMethod(), request.httpHeaderFields())) || m_options.preflightPolicy == PreventPreflight) { ResourceRequest crossOriginRequest(request); ResourceLoaderOptions crossOriginOptions(m_resourceLoaderOptions); - updateRequestForAccessControl(crossOriginRequest, securityOrigin(), effectiveAllowCredentials()); + updateRequestForAccessControl(crossOriginRequest, getSecurityOrigin(), effectiveAllowCredentials()); // We update the credentials mode according to effectiveAllowCredentials() here for backward compatibility. But this is not correct. // FIXME: We should set it in the caller of DocumentThreadableLoader. crossOriginRequest.setFetchCredentialsMode(effectiveAllowCredentials() == AllowStoredCredentials ? WebURLRequest::FetchCredentialsModeInclude : WebURLRequest::FetchCredentialsModeOmit); @@ -292,12 +292,12 @@ void DocumentThreadableLoader::makeCrossOriginAccessRequest(const ResourceReques m_actualOptions = crossOriginOptions; bool shouldForcePreflight = InspectorInstrumentation::shouldForceCORSPreflight(m_document); - bool canSkipPreflight = CrossOriginPreflightResultCache::shared().canSkipPreflight(securityOrigin()->toString(), m_actualRequest.url(), effectiveAllowCredentials(), m_actualRequest.httpMethod(), m_actualRequest.httpHeaderFields()); + bool canSkipPreflight = CrossOriginPreflightResultCache::shared().canSkipPreflight(getSecurityOrigin()->toString(), m_actualRequest.url(), effectiveAllowCredentials(), m_actualRequest.httpMethod(), m_actualRequest.httpHeaderFields()); if (canSkipPreflight && !shouldForcePreflight) { loadActualRequest(); // |this| may be dead here in async mode. } else { - ResourceRequest preflightRequest = createAccessControlPreflightRequest(m_actualRequest, securityOrigin()); + ResourceRequest preflightRequest = createAccessControlPreflightRequest(m_actualRequest, getSecurityOrigin()); // Create a ResourceLoaderOptions for preflight. ResourceLoaderOptions preflightOptions = m_actualOptions; preflightOptions.allowCredentials = DoNotAllowStoredCredentials; @@ -475,7 +475,7 @@ void DocumentThreadableLoader::redirectReceived(Resource* resource, ResourceRequ // The redirect response must pass the access control check if the // original request was not same-origin. allowRedirect = CrossOriginAccessControl::isLegalRedirectLocation(request.url(), accessControlErrorDescription) - && (m_sameOriginRequest || passesAccessControlCheck(redirectResponse, effectiveAllowCredentials(), securityOrigin(), accessControlErrorDescription, m_requestContext)); + && (m_sameOriginRequest || passesAccessControlCheck(redirectResponse, effectiveAllowCredentials(), getSecurityOrigin(), accessControlErrorDescription, m_requestContext)); } if (allowRedirect) { @@ -571,7 +571,7 @@ void DocumentThreadableLoader::handlePreflightResponse(const ResourceResponse& r { String accessControlErrorDescription; - if (!passesAccessControlCheck(response, effectiveAllowCredentials(), securityOrigin(), accessControlErrorDescription, m_requestContext)) { + if (!passesAccessControlCheck(response, effectiveAllowCredentials(), getSecurityOrigin(), accessControlErrorDescription, m_requestContext)) { handlePreflightFailure(response.url().getString(), "Response to preflight request doesn't pass access control check: " + accessControlErrorDescription); // |this| may be dead here in async mode. return; @@ -592,7 +592,7 @@ void DocumentThreadableLoader::handlePreflightResponse(const ResourceResponse& r return; } - CrossOriginPreflightResultCache::shared().appendEntry(securityOrigin()->toString(), m_actualRequest.url(), preflightResult.release()); + CrossOriginPreflightResultCache::shared().appendEntry(getSecurityOrigin()->toString(), m_actualRequest.url(), preflightResult.release()); } void DocumentThreadableLoader::reportResponseReceived(unsigned long identifier, const ResourceResponse& response) @@ -646,12 +646,12 @@ void DocumentThreadableLoader::handleResponse(unsigned long identifier, const Re // loadFallbackRequestForServiceWorker(). // FIXME: We should use |m_sameOriginRequest| when we will support // Suborigins (crbug.com/336894) for Service Worker. - ASSERT(m_fallbackRequestForServiceWorker.isNull() || securityOrigin()->canRequest(m_fallbackRequestForServiceWorker.url())); + ASSERT(m_fallbackRequestForServiceWorker.isNull() || getSecurityOrigin()->canRequest(m_fallbackRequestForServiceWorker.url())); m_fallbackRequestForServiceWorker = ResourceRequest(); if (!m_sameOriginRequest && m_options.crossOriginRequestPolicy == UseAccessControl) { String accessControlErrorDescription; - if (!passesAccessControlCheck(response, effectiveAllowCredentials(), securityOrigin(), accessControlErrorDescription, m_requestContext)) { + if (!passesAccessControlCheck(response, effectiveAllowCredentials(), getSecurityOrigin(), accessControlErrorDescription, m_requestContext)) { reportResponseReceived(identifier, response); ThreadableLoaderClient* client = m_client; @@ -772,7 +772,7 @@ void DocumentThreadableLoader::loadActualRequest() m_actualRequest = ResourceRequest(); m_actualOptions = ResourceLoaderOptions(); - actualRequest.setHTTPOrigin(securityOrigin()); + actualRequest.setHTTPOrigin(getSecurityOrigin()); clearResource(); @@ -908,7 +908,7 @@ bool DocumentThreadableLoader::isAllowedRedirect(const KURL& url) const if (m_options.crossOriginRequestPolicy == AllowCrossOriginRequests) return true; - return m_sameOriginRequest && securityOrigin()->canRequest(url); + return m_sameOriginRequest && getSecurityOrigin()->canRequest(url); } bool DocumentThreadableLoader::isAllowedByContentSecurityPolicy(const KURL& url, ContentSecurityPolicy::RedirectStatus redirectStatus) const @@ -926,9 +926,9 @@ StoredCredentials DocumentThreadableLoader::effectiveAllowCredentials() const return m_resourceLoaderOptions.allowCredentials; } -SecurityOrigin* DocumentThreadableLoader::securityOrigin() const +SecurityOrigin* DocumentThreadableLoader::getSecurityOrigin() const { - return m_securityOrigin ? m_securityOrigin.get() : document().securityOrigin(); + return m_securityOrigin ? m_securityOrigin.get() : document().getSecurityOrigin(); } Document& DocumentThreadableLoader::document() const diff --git a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.h b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.h index a559661..f4552e5 100644 --- a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.h +++ b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.h @@ -178,7 +178,7 @@ class CORE_EXPORT DocumentThreadableLoader final : public ThreadableLoader, priv RefPtrWillBePersistent<RawResource> m_resource; // End of ResourceOwner re-implementation, see above. - SecurityOrigin* securityOrigin() const; + SecurityOrigin* getSecurityOrigin() const; Document& document() const; ThreadableLoaderClient* m_client; @@ -195,7 +195,7 @@ class CORE_EXPORT DocumentThreadableLoader final : public ThreadableLoader, priv // True while the initial URL and all the URLs of the redirects // this object has followed, if any, are same-origin to - // securityOrigin(). + // getSecurityOrigin(). bool m_sameOriginRequest; // Set to true if the current request is cross-origin and not simple. bool m_crossOriginNonSimpleRequest; diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp index ee95def..5bdfcb1 100644 --- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp +++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp @@ -102,7 +102,7 @@ void FrameFetchContext::addAdditionalRequestHeaders(ResourceRequest& request, Fe RefPtr<SecurityOrigin> outgoingOrigin; if (!request.didSetHTTPReferrer()) { ASSERT(m_document); - outgoingOrigin = m_document->securityOrigin(); + outgoingOrigin = m_document->getSecurityOrigin(); request.setHTTPReferrer(SecurityPolicy::generateReferrer(m_document->getReferrerPolicy(), request.url(), m_document->outgoingReferrer())); } else { RELEASE_ASSERT(SecurityPolicy::generateReferrer(request.getReferrerPolicy(), request.url(), request.httpReferrer()).referrer == request.httpReferrer()); @@ -411,7 +411,7 @@ ResourceRequestBlockedReason FrameFetchContext::canRequestInternal(Resource::Typ SecurityOrigin* securityOrigin = options.securityOrigin.get(); if (!securityOrigin && m_document) - securityOrigin = m_document->securityOrigin(); + securityOrigin = m_document->getSecurityOrigin(); if (originRestriction != FetchRequest::NoOriginRestriction && securityOrigin && !securityOrigin->canDisplay(url)) { if (!forPreload) @@ -547,7 +547,7 @@ ResourceRequestBlockedReason FrameFetchContext::canRequestInternal(Resource::Typ // block them at some point in the future. if (resourceRequest.frameType() != WebURLRequest::FrameTypeTopLevel) { ASSERT(frame()->document()); - if (SchemeRegistry::shouldTreatURLSchemeAsLegacy(url.protocol()) && !SchemeRegistry::shouldTreatURLSchemeAsLegacy(frame()->document()->securityOrigin()->protocol())) + if (SchemeRegistry::shouldTreatURLSchemeAsLegacy(url.protocol()) && !SchemeRegistry::shouldTreatURLSchemeAsLegacy(frame()->document()->getSecurityOrigin()->protocol())) UseCounter::count(frame()->document(), UseCounter::LegacyProtocolEmbeddedAsSubresource); if (!url.user().isEmpty() || !url.pass().isEmpty()) UseCounter::count(frame()->document(), UseCounter::RequestedSubresourceWithEmbeddedCredentials); @@ -640,9 +640,9 @@ void FrameFetchContext::addConsoleMessage(const String& message) const frame()->document()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, message)); } -SecurityOrigin* FrameFetchContext::securityOrigin() const +SecurityOrigin* FrameFetchContext::getSecurityOrigin() const { - return m_document ? m_document->securityOrigin() : nullptr; + return m_document ? m_document->getSecurityOrigin() : nullptr; } void FrameFetchContext::upgradeInsecureRequest(FetchRequest& fetchRequest) diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.h b/third_party/WebKit/Source/core/loader/FrameFetchContext.h index f88ebd9..abce8e5 100644 --- a/third_party/WebKit/Source/core/loader/FrameFetchContext.h +++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.h @@ -99,7 +99,7 @@ public: bool updateTimingInfoForIFrameNavigation(ResourceTimingInfo*) override; void sendImagePing(const KURL&) override; void addConsoleMessage(const String&) const override; - SecurityOrigin* securityOrigin() const override; + SecurityOrigin* getSecurityOrigin() const override; void upgradeInsecureRequest(FetchRequest&) override; void addClientHintsIfNecessary(FetchRequest&) override; void addCSPHeaderIfNecessary(Resource::Type, FetchRequest&) override; diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp index 89cbfe3..aafb689 100644 --- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp +++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp @@ -421,7 +421,7 @@ void FrameLoader::receivedFirstData() HistoryCommitType historyCommitType = loadTypeToCommitType(m_loadType); if (historyCommitType == StandardCommit && (m_documentLoader->urlForHistory().isEmpty() || (opener() && !m_currentItem && m_documentLoader->originalRequest().url().isEmpty()))) historyCommitType = HistoryInertCommit; - else if (historyCommitType == InitialCommitInChildFrame && MixedContentChecker::isMixedContent(m_frame->tree().top()->securityContext()->securityOrigin(), m_documentLoader->url())) + else if (historyCommitType == InitialCommitInChildFrame && MixedContentChecker::isMixedContent(m_frame->tree().top()->securityContext()->getSecurityOrigin(), m_documentLoader->url())) historyCommitType = HistoryInertCommit; setHistoryItemStateForCommit(historyCommitType, HistoryNavigationType::DifferentDocument); @@ -797,7 +797,7 @@ bool FrameLoader::prepareRequestForThisFrame(FrameLoadRequest& request) if (m_frame->script().executeScriptIfJavaScriptURL(url)) return false; - if (!request.originDocument()->securityOrigin()->canDisplay(url)) { + if (!request.originDocument()->getSecurityOrigin()->canDisplay(url)) { reportLocalLoadFailed(m_frame, url.elidedString()); return false; } @@ -1449,10 +1449,10 @@ bool FrameLoader::shouldInterruptLoadForXFrameOptions(const String& content, con UseCounter::count(m_frame->domWindow()->document(), UseCounter::XFrameOptionsSameOrigin); RefPtr<SecurityOrigin> origin = SecurityOrigin::create(url); // Out-of-process ancestors are always a different origin. - if (!topFrame->isLocalFrame() || !origin->isSameSchemeHostPort(toLocalFrame(topFrame)->document()->securityOrigin())) + if (!topFrame->isLocalFrame() || !origin->isSameSchemeHostPort(toLocalFrame(topFrame)->document()->getSecurityOrigin())) return true; for (Frame* frame = m_frame->tree().parent(); frame; frame = frame->tree().parent()) { - if (!frame->isLocalFrame() || !origin->isSameSchemeHostPort(toLocalFrame(frame)->document()->securityOrigin())) { + if (!frame->isLocalFrame() || !origin->isSameSchemeHostPort(toLocalFrame(frame)->document()->getSecurityOrigin())) { UseCounter::count(m_frame->domWindow()->document(), UseCounter::XFrameOptionsSameOriginWithBadAncestorChain); break; } diff --git a/third_party/WebKit/Source/core/loader/ImageLoader.cpp b/third_party/WebKit/Source/core/loader/ImageLoader.cpp index 59c5c6a..f13a418 100644 --- a/third_party/WebKit/Source/core/loader/ImageLoader.cpp +++ b/third_party/WebKit/Source/core/loader/ImageLoader.cpp @@ -242,7 +242,7 @@ static void configureRequest(FetchRequest& request, ImageLoader::BypassMainWorld CrossOriginAttributeValue crossOrigin = crossOriginAttributeValue(element.fastGetAttribute(HTMLNames::crossoriginAttr)); if (crossOrigin != CrossOriginAttributeNotSet) - request.setCrossOriginAccessControl(element.document().securityOrigin(), crossOrigin); + request.setCrossOriginAccessControl(element.document().getSecurityOrigin(), crossOrigin); if (clientHintsPreferences.shouldSendResourceWidth() && isHTMLImageElement(element)) request.setResourceWidth(toHTMLImageElement(element).getResourceWidth()); diff --git a/third_party/WebKit/Source/core/loader/LinkLoader.cpp b/third_party/WebKit/Source/core/loader/LinkLoader.cpp index 9f0beda..024c817 100644 --- a/third_party/WebKit/Source/core/loader/LinkLoader.cpp +++ b/third_party/WebKit/Source/core/loader/LinkLoader.cpp @@ -277,7 +277,7 @@ static Resource* preloadIfNeeded(const LinkRelAttribute& relAttribute, const KUR linkRequest.setPriority(document.fetcher()->loadPriority(resourceType, linkRequest)); if (crossOrigin != CrossOriginAttributeNotSet) - linkRequest.setCrossOriginAccessControl(document.securityOrigin(), crossOrigin); + linkRequest.setCrossOriginAccessControl(document.getSecurityOrigin(), crossOrigin); Settings* settings = document.settings(); if (settings && settings->logPreload()) document.addConsoleMessage(ConsoleMessage::create(OtherMessageSource, DebugMessageLevel, String("Preload triggered for " + href.host() + href.path()))); @@ -341,7 +341,7 @@ bool LinkLoader::loadLink(const LinkRelAttribute& relAttribute, CrossOriginAttri FetchRequest linkRequest(ResourceRequest(document.completeURL(href)), FetchInitiatorTypeNames::link); if (crossOrigin != CrossOriginAttributeNotSet) - linkRequest.setCrossOriginAccessControl(document.securityOrigin(), crossOrigin); + linkRequest.setCrossOriginAccessControl(document.getSecurityOrigin(), crossOrigin); setResource(LinkFetchResource::fetch(Resource::LinkPrefetch, linkRequest, document.fetcher())); } diff --git a/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp b/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp index 205392f5..a3a27f4 100644 --- a/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp +++ b/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp @@ -55,7 +55,7 @@ namespace { KURL mainResourceUrlForFrame(Frame* frame) { if (frame->isRemoteFrame()) - return KURL(KURL(), frame->securityContext()->securityOrigin()->toString()); + return KURL(KURL(), frame->securityContext()->getSecurityOrigin()->toString()); return toLocalFrame(frame)->document()->url(); } @@ -67,7 +67,7 @@ static void measureStricterVersionOfIsMixedContent(Frame* frame, const KURL& url // What about other "secure" contexts the SchemeRegistry knows about? We'll // use this method to measure the occurance of non-webby mixed content to // make sure we're not breaking the world without realizing it. - SecurityOrigin* origin = frame->securityContext()->securityOrigin(); + SecurityOrigin* origin = frame->securityContext()->getSecurityOrigin(); if (MixedContentChecker::isMixedContent(origin, url)) { if (origin->protocol() != "https") UseCounter::count(frame, UseCounter::MixedContentInNonHTTPSFrameThatRestrictsMixedContent); @@ -101,12 +101,12 @@ Frame* MixedContentChecker::inWhichFrameIsContentMixed(Frame* frame, WebURLReque // Check the top frame first. if (Frame* top = frame->tree().top()) { measureStricterVersionOfIsMixedContent(top, url); - if (isMixedContent(top->securityContext()->securityOrigin(), url)) + if (isMixedContent(top->securityContext()->getSecurityOrigin(), url)) return top; } measureStricterVersionOfIsMixedContent(frame, url); - if (isMixedContent(frame->securityContext()->securityOrigin(), url)) + if (isMixedContent(frame->securityContext()->getSecurityOrigin(), url)) return frame; // No mixed content, no problem. @@ -321,7 +321,7 @@ bool MixedContentChecker::shouldBlockFetch(LocalFrame* frame, WebURLRequest::Req // distinguish mixed content signals from different frames on the // same page. FrameLoaderClient* client = frame->loader().client(); - SecurityOrigin* securityOrigin = mixedFrame->securityContext()->securityOrigin(); + SecurityOrigin* securityOrigin = mixedFrame->securityContext()->getSecurityOrigin(); bool allowed = false; // If we're in strict mode, we'll automagically fail everything, and intentionally skip @@ -355,7 +355,7 @@ bool MixedContentChecker::shouldBlockFetch(LocalFrame* frame, WebURLRequest::Req // allowing an insecure script to run on https://a.com and not // realizing that they are in fact allowing an insecure script on // https://b.com. - if (!settings->allowRunningOfInsecureContent() && requestIsSubframeSubresource(effectiveFrame, frameType) && isMixedContent(frame->securityContext()->securityOrigin(), url)) { + if (!settings->allowRunningOfInsecureContent() && requestIsSubframeSubresource(effectiveFrame, frameType) && isMixedContent(frame->securityContext()->getSecurityOrigin(), url)) { UseCounter::count(mixedFrame, UseCounter::BlockableMixedContentInSubframeBlocked); allowed = false; break; @@ -411,7 +411,7 @@ bool MixedContentChecker::shouldBlockWebSocket(LocalFrame* frame, const KURL& ur // distinguish mixed content signals from different frames on the // same page. FrameLoaderClient* client = frame->loader().client(); - SecurityOrigin* securityOrigin = mixedFrame->securityContext()->securityOrigin(); + SecurityOrigin* securityOrigin = mixedFrame->securityContext()->getSecurityOrigin(); bool allowed = false; // If we're in strict mode, we'll automagically fail everything, and intentionally skip diff --git a/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp b/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp index 16ce767..a5f2726 100644 --- a/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp +++ b/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp @@ -328,7 +328,7 @@ void NavigationScheduler::scheduleLocationChange(Document* originDocument, const // fragment part, we don't need to schedule the location change. We'll skip this // optimization for cross-origin navigations to minimize the navigator's ability to // execute timing attacks. - if (originDocument->securityOrigin()->canAccess(m_frame->document()->securityOrigin())) { + if (originDocument->getSecurityOrigin()->canAccess(m_frame->document()->getSecurityOrigin())) { KURL parsedURL(ParsedURLString, url); if (parsedURL.hasFragmentIdentifier() && equalIgnoringFragmentIdentifier(m_frame->document()->url(), parsedURL)) { FrameLoadRequest request(originDocument, m_frame->document()->completeURL(url), "_self"); diff --git a/third_party/WebKit/Source/core/loader/PingLoader.cpp b/third_party/WebKit/Source/core/loader/PingLoader.cpp index 22ab060..bea5c41 100644 --- a/third_party/WebKit/Source/core/loader/PingLoader.cpp +++ b/third_party/WebKit/Source/core/loader/PingLoader.cpp @@ -67,7 +67,7 @@ static void finishPingRequestInitialization(ResourceRequest& request, LocalFrame void PingLoader::loadImage(LocalFrame* frame, const KURL& url) { - if (!frame->document()->securityOrigin()->canDisplay(url)) { + if (!frame->document()->getSecurityOrigin()->canDisplay(url)) { FrameLoader::reportLocalLoadFailed(frame, url.getString()); return; } @@ -117,7 +117,7 @@ void PingLoader::sendViolationReport(LocalFrame* frame, const KURL& reportURL, P FetchInitiatorInfo initiatorInfo; initiatorInfo.name = FetchInitiatorTypeNames::violationreport; - PingLoader::start(frame, request, initiatorInfo, SecurityOrigin::create(reportURL)->isSameSchemeHostPort(frame->document()->securityOrigin()) ? AllowStoredCredentials : DoNotAllowStoredCredentials); + PingLoader::start(frame, request, initiatorInfo, SecurityOrigin::create(reportURL)->isSameSchemeHostPort(frame->document()->getSecurityOrigin()) ? AllowStoredCredentials : DoNotAllowStoredCredentials); } void PingLoader::start(LocalFrame* frame, ResourceRequest& request, const FetchInitiatorInfo& initiatorInfo, StoredCredentials credentialsAllowed) diff --git a/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp b/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp index 077ad6d..3f458a2 100644 --- a/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp +++ b/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp @@ -39,7 +39,7 @@ namespace blink { static inline bool canReferToParentFrameEncoding(const LocalFrame* frame, const LocalFrame* parentFrame) { - return parentFrame && parentFrame->document()->securityOrigin()->canAccess(frame->document()->securityOrigin()); + return parentFrame && parentFrame->document()->getSecurityOrigin()->canAccess(frame->document()->getSecurityOrigin()); } diff --git a/third_party/WebKit/Source/core/loader/TextTrackLoader.cpp b/third_party/WebKit/Source/core/loader/TextTrackLoader.cpp index 958e886..c7461a1 100644 --- a/third_party/WebKit/Source/core/loader/TextTrackLoader.cpp +++ b/third_party/WebKit/Source/core/loader/TextTrackLoader.cpp @@ -110,10 +110,10 @@ bool TextTrackLoader::load(const KURL& url, CrossOriginAttributeValue crossOrigi FetchRequest cueRequest(ResourceRequest(document().completeURL(url)), FetchInitiatorTypeNames::texttrack); if (crossOrigin != CrossOriginAttributeNotSet) { - cueRequest.setCrossOriginAccessControl(document().securityOrigin(), crossOrigin); - } else if (!document().securityOrigin()->canRequestNoSuborigin(url)) { + cueRequest.setCrossOriginAccessControl(document().getSecurityOrigin(), crossOrigin); + } else if (!document().getSecurityOrigin()->canRequestNoSuborigin(url)) { // Text track elements without 'crossorigin' set on the parent are "No CORS"; report error if not same-origin. - corsPolicyPreventedLoad(document().securityOrigin(), url); + corsPolicyPreventedLoad(document().getSecurityOrigin(), url); return false; } diff --git a/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.cpp b/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.cpp index 050aa2f..62cd2ff 100644 --- a/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.cpp +++ b/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.cpp @@ -103,7 +103,7 @@ const AtomicString& ApplicationCache::interfaceName() const return EventTargetNames::ApplicationCache; } -ExecutionContext* ApplicationCache::executionContext() const +ExecutionContext* ApplicationCache::getExecutionContext() const { if (m_frame) return m_frame->document(); diff --git a/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.h b/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.h index 032800b..ec4438e 100644 --- a/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.h +++ b/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.h @@ -74,7 +74,7 @@ public: DEFINE_ATTRIBUTE_EVENT_LISTENER(obsolete); const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; static const AtomicString& toEventType(ApplicationCacheHost::EventID); diff --git a/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp b/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp index bc444ac..2c571c5 100644 --- a/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp +++ b/third_party/WebKit/Source/core/loader/appcache/ApplicationCacheHost.cpp @@ -242,7 +242,7 @@ void ApplicationCacheHost::dispatchDOMEvent(EventID id, int progressTotal, int p return; const AtomicString& eventType = ApplicationCache::toEventType(id); - if (eventType.isEmpty() || !m_domApplicationCache->executionContext()) + if (eventType.isEmpty() || !m_domApplicationCache->getExecutionContext()) return; RefPtrWillBeRawPtr<Event> event = nullptr; if (id == PROGRESS_EVENT) diff --git a/third_party/WebKit/Source/core/origin_trials/DocumentOriginTrialContext.h b/third_party/WebKit/Source/core/origin_trials/DocumentOriginTrialContext.h index 01231c9..d407ae8 100644 --- a/third_party/WebKit/Source/core/origin_trials/DocumentOriginTrialContext.h +++ b/third_party/WebKit/Source/core/origin_trials/DocumentOriginTrialContext.h @@ -24,7 +24,7 @@ public: explicit DocumentOriginTrialContext(Document*); ~DocumentOriginTrialContext() override = default; - ExecutionContext* executionContext() override { return m_parent; } + ExecutionContext* getExecutionContext() override { return m_parent; } Vector<String> getTokens() override; DECLARE_VIRTUAL_TRACE(); diff --git a/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.cpp b/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.cpp index 6d9cc0f..ae76e45 100644 --- a/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.cpp +++ b/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.cpp @@ -19,7 +19,7 @@ namespace { String getCurrentOrigin(ExecutionContext* executionContext) { - return executionContext->securityOrigin()->toString(); + return executionContext->getSecurityOrigin()->toString(); } String getDisabledMessage(const String& featureName) @@ -49,8 +49,8 @@ bool OriginTrialContext::isFeatureEnabled(const String& featureName, String* err // Feature trials are only enabled for secure origins bool isSecure = errorMessage - ? executionContext()->isSecureContext(*errorMessage) - : executionContext()->isSecureContext(); + ? getExecutionContext()->isSecureContext(*errorMessage) + : getExecutionContext()->isSecureContext(); if (!isSecure) { // The execution context should always set a message here, if a valid // pointer was passed in. If it does not, then we should find out why @@ -74,7 +74,7 @@ bool OriginTrialContext::isFeatureEnabled(const String& featureName, String* err bool OriginTrialContext::hasValidToken(Vector<String> tokens, const String& featureName, String* errorMessage, WebTrialTokenValidator* validator) { - String origin = getCurrentOrigin(executionContext()); + String origin = getCurrentOrigin(getExecutionContext()); for (const String& token : tokens) { // Check with the validator service to verify the signature. diff --git a/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h b/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h index 044a7d8..6b9f0d7 100644 --- a/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h +++ b/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h @@ -39,7 +39,7 @@ public: static const char kTrialHeaderName[]; virtual ~OriginTrialContext() = default; - virtual ExecutionContext* executionContext() = 0; + virtual ExecutionContext* getExecutionContext() = 0; virtual Vector<String> getTokens() = 0; DECLARE_VIRTUAL_TRACE(); diff --git a/third_party/WebKit/Source/core/origin_trials/OriginTrialContextTest.cpp b/third_party/WebKit/Source/core/origin_trials/OriginTrialContextTest.cpp index a033346..cad84e1 100644 --- a/third_party/WebKit/Source/core/origin_trials/OriginTrialContextTest.cpp +++ b/third_party/WebKit/Source/core/origin_trials/OriginTrialContextTest.cpp @@ -79,7 +79,7 @@ public: ~TestOriginTrialContext() override = default; - ExecutionContext* executionContext() override { return m_parent.get(); } + ExecutionContext* getExecutionContext() override { return m_parent.get(); } void addToken(const String& token) { diff --git a/third_party/WebKit/Source/core/origin_trials/testing/InternalsFrobulate.cpp b/third_party/WebKit/Source/core/origin_trials/testing/InternalsFrobulate.cpp index f2b361f..dea7235 100644 --- a/third_party/WebKit/Source/core/origin_trials/testing/InternalsFrobulate.cpp +++ b/third_party/WebKit/Source/core/origin_trials/testing/InternalsFrobulate.cpp @@ -14,7 +14,7 @@ namespace blink { bool InternalsFrobulate::frobulate(ScriptState* scriptState, Internals& internals, ExceptionState& exceptionState) { String errorMessage; - if (!OriginTrials::experimentalFrameworkSampleAPIEnabled(scriptState->executionContext(), errorMessage)) { + if (!OriginTrials::experimentalFrameworkSampleAPIEnabled(scriptState->getExecutionContext(), errorMessage)) { exceptionState.throwDOMException(NotSupportedError, errorMessage); return false; } diff --git a/third_party/WebKit/Source/core/page/DragController.cpp b/third_party/WebKit/Source/core/page/DragController.cpp index 5288d40..0abda3e 100644 --- a/third_party/WebKit/Source/core/page/DragController.cpp +++ b/third_party/WebKit/Source/core/page/DragController.cpp @@ -215,7 +215,7 @@ void DragController::dragExited(DragData* dragData) RefPtrWillBeRawPtr<FrameView> frameView(mainFrame->view()); if (frameView) { - DataTransferAccessPolicy policy = (!m_documentUnderMouse || m_documentUnderMouse->securityOrigin()->isLocal()) ? DataTransferReadable : DataTransferTypesReadable; + DataTransferAccessPolicy policy = (!m_documentUnderMouse || m_documentUnderMouse->getSecurityOrigin()->isLocal()) ? DataTransferReadable : DataTransferTypesReadable; DataTransfer* dataTransfer = createDraggingDataTransfer(policy, dragData); dataTransfer->setSourceOperation(dragData->draggingSourceOperationMask()); mainFrame->eventHandler().cancelDragAndDrop(createMouseEvent(dragData), dataTransfer); @@ -331,7 +331,7 @@ bool DragController::tryDocumentDrag(DragData* dragData, DragDestinationAction a if (!m_documentUnderMouse) return false; - if (m_dragInitiator && !m_documentUnderMouse->securityOrigin()->canAccess(m_dragInitiator->securityOrigin())) + if (m_dragInitiator && !m_documentUnderMouse->getSecurityOrigin()->canAccess(m_dragInitiator->getSecurityOrigin())) return false; bool isHandlingDrag = false; @@ -589,7 +589,7 @@ bool DragController::tryDHTMLDrag(DragData* dragData, DragOperation& operation) return false; RefPtrWillBeRawPtr<FrameView> viewProtector(mainFrame->view()); - DataTransferAccessPolicy policy = m_documentUnderMouse->securityOrigin()->isLocal() ? DataTransferReadable : DataTransferTypesReadable; + DataTransferAccessPolicy policy = m_documentUnderMouse->getSecurityOrigin()->isLocal() ? DataTransferReadable : DataTransferTypesReadable; DataTransfer* dataTransfer = createDraggingDataTransfer(policy, dragData); DragOperation srcOpMask = dragData->draggingSourceOperationMask(); dataTransfer->setSourceOperation(srcOpMask); diff --git a/third_party/WebKit/Source/core/page/EventSource.cpp b/third_party/WebKit/Source/core/page/EventSource.cpp index 90a5c5d..f194725 100644 --- a/third_party/WebKit/Source/core/page/EventSource.cpp +++ b/third_party/WebKit/Source/core/page/EventSource.cpp @@ -113,9 +113,9 @@ void EventSource::connect() { ASSERT(m_state == CONNECTING); ASSERT(!m_loader); - ASSERT(executionContext()); + ASSERT(getExecutionContext()); - ExecutionContext& executionContext = *this->executionContext(); + ExecutionContext& executionContext = *this->getExecutionContext(); ResourceRequest request(m_url); request.setHTTPMethod(HTTPNames::GET); request.setHTTPHeaderField(HTTPNames::Accept, "text/event-stream"); @@ -129,7 +129,7 @@ void EventSource::connect() request.setHTTPHeaderField(HTTPNames::Last_Event_ID, AtomicString(reinterpret_cast<const LChar*>(lastEventIdUtf8.data()), lastEventIdUtf8.length())); } - SecurityOrigin* origin = executionContext.securityOrigin(); + SecurityOrigin* origin = executionContext.getSecurityOrigin(); ThreadableLoaderOptions options; options.preflightPolicy = PreventPreflight; @@ -150,7 +150,7 @@ void EventSource::connect() void EventSource::networkRequestEnded() { - InspectorInstrumentation::didFinishEventSourceRequest(executionContext(), this); + InspectorInstrumentation::didFinishEventSourceRequest(getExecutionContext(), this); m_loader = nullptr; @@ -213,9 +213,9 @@ const AtomicString& EventSource::interfaceName() const return EventTargetNames::EventSource; } -ExecutionContext* EventSource::executionContext() const +ExecutionContext* EventSource::getExecutionContext() const { - return ContextLifecycleObserver::executionContext(); + return ContextLifecycleObserver::getExecutionContext(); } void EventSource::didReceiveResponse(unsigned long, const ResourceResponse& response, PassOwnPtr<WebDataConsumerHandle> handle) @@ -238,7 +238,7 @@ void EventSource::didReceiveResponse(unsigned long, const ResourceResponse& resp message.append(charset); message.appendLiteral("\") that is not UTF-8. Aborting the connection."); // FIXME: We are missing the source line. - executionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, message.toString())); + getExecutionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, message.toString())); } } else { // To keep the signal-to-noise ratio low, we only log 200-response with an invalid MIME type. @@ -248,7 +248,7 @@ void EventSource::didReceiveResponse(unsigned long, const ResourceResponse& resp message.append(response.mimeType()); message.appendLiteral("\") that is not \"text/event-stream\". Aborting the connection."); // FIXME: We are missing the source line. - executionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, message.toString())); + getExecutionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, message.toString())); } } @@ -299,7 +299,7 @@ void EventSource::didFailAccessControlCheck(const ResourceError& error) ASSERT(m_loader); String message = "EventSource cannot load " + error.failingURL() + ". " + error.localizedDescription(); - executionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, message)); + getExecutionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, message)); abortConnectionAttempt(); } @@ -316,7 +316,7 @@ void EventSource::onMessageEvent(const AtomicString& eventType, const String& da RefPtrWillBeRawPtr<MessageEvent> e = MessageEvent::create(); e->initMessageEvent(eventType, false, false, SerializedScriptValueFactory::instance().create(data), m_eventStreamOrigin, lastEventId, 0, nullptr); - InspectorInstrumentation::willDispatchEventSourceEvent(executionContext(), this, eventType, lastEventId, data); + InspectorInstrumentation::willDispatchEventSourceEvent(getExecutionContext(), this, eventType, lastEventId, data); dispatchEvent(e); } diff --git a/third_party/WebKit/Source/core/page/EventSource.h b/third_party/WebKit/Source/core/page/EventSource.h index 73ef19c..08cb7e1 100644 --- a/third_party/WebKit/Source/core/page/EventSource.h +++ b/third_party/WebKit/Source/core/page/EventSource.h @@ -77,7 +77,7 @@ public: void close(); const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; // Note: We don't need to override suspend() because it is noop since // ScopedPageLoadDeferrer calls Page::setDefersLoading() and it defers diff --git a/third_party/WebKit/Source/core/page/NetworkStateNotifierTest.cpp b/third_party/WebKit/Source/core/page/NetworkStateNotifierTest.cpp index 143dbd0..a977923 100644 --- a/third_party/WebKit/Source/core/page/NetworkStateNotifierTest.cpp +++ b/third_party/WebKit/Source/core/page/NetworkStateNotifierTest.cpp @@ -100,7 +100,7 @@ public: { } - ExecutionContext* executionContext() + ExecutionContext* getExecutionContext() { return m_document.get(); } @@ -119,12 +119,12 @@ protected: void addObserverOnNotification(StateObserver* observer, StateObserver* observerToAdd) { - observer->setNotificationCallback(bind(&NetworkStateNotifier::addObserver, &m_notifier, observerToAdd, executionContext())); + observer->setNotificationCallback(bind(&NetworkStateNotifier::addObserver, &m_notifier, observerToAdd, getExecutionContext())); } void removeObserverOnNotification(StateObserver* observer, StateObserver* observerToRemove) { - observer->setNotificationCallback(bind(&NetworkStateNotifier::removeObserver, &m_notifier, observerToRemove, executionContext())); + observer->setNotificationCallback(bind(&NetworkStateNotifier::removeObserver, &m_notifier, observerToRemove, getExecutionContext())); } bool verifyObservations(const StateObserver& observer, WebConnectionType type, double maxBandwidthMbps) @@ -142,7 +142,7 @@ protected: TEST_F(NetworkStateNotifierTest, AddObserver) { StateObserver observer; - m_notifier.addObserver(&observer, executionContext()); + m_notifier.addObserver(&observer, getExecutionContext()); EXPECT_TRUE(verifyObservations(observer, WebConnectionTypeNone, kNoneMaxBandwidthMbps)); setConnection(WebConnectionTypeBluetooth, kBluetoothMaxBandwidthMbps); @@ -153,9 +153,9 @@ TEST_F(NetworkStateNotifierTest, AddObserver) TEST_F(NetworkStateNotifierTest, RemoveObserver) { StateObserver observer1, observer2; - m_notifier.addObserver(&observer1, executionContext()); - m_notifier.removeObserver(&observer1, executionContext()); - m_notifier.addObserver(&observer2, executionContext()); + m_notifier.addObserver(&observer1, getExecutionContext()); + m_notifier.removeObserver(&observer1, getExecutionContext()); + m_notifier.addObserver(&observer2, getExecutionContext()); setConnection(WebConnectionTypeBluetooth, kBluetoothMaxBandwidthMbps); EXPECT_TRUE(verifyObservations(observer1, WebConnectionTypeNone, kNoneMaxBandwidthMbps)); @@ -165,8 +165,8 @@ TEST_F(NetworkStateNotifierTest, RemoveObserver) TEST_F(NetworkStateNotifierTest, RemoveSoleObserver) { StateObserver observer1; - m_notifier.addObserver(&observer1, executionContext()); - m_notifier.removeObserver(&observer1, executionContext()); + m_notifier.addObserver(&observer1, getExecutionContext()); + m_notifier.removeObserver(&observer1, getExecutionContext()); setConnection(WebConnectionTypeBluetooth, kBluetoothMaxBandwidthMbps); EXPECT_TRUE(verifyObservations(observer1, WebConnectionTypeNone, kNoneMaxBandwidthMbps)); @@ -175,7 +175,7 @@ TEST_F(NetworkStateNotifierTest, RemoveSoleObserver) TEST_F(NetworkStateNotifierTest, AddObserverWhileNotifying) { StateObserver observer1, observer2; - m_notifier.addObserver(&observer1, executionContext()); + m_notifier.addObserver(&observer1, getExecutionContext()); addObserverOnNotification(&observer1, &observer2); setConnection(WebConnectionTypeBluetooth, kBluetoothMaxBandwidthMbps); @@ -186,7 +186,7 @@ TEST_F(NetworkStateNotifierTest, AddObserverWhileNotifying) TEST_F(NetworkStateNotifierTest, RemoveSoleObserverWhileNotifying) { StateObserver observer1; - m_notifier.addObserver(&observer1, executionContext()); + m_notifier.addObserver(&observer1, getExecutionContext()); removeObserverOnNotification(&observer1, &observer1); setConnection(WebConnectionTypeBluetooth, kBluetoothMaxBandwidthMbps); @@ -199,8 +199,8 @@ TEST_F(NetworkStateNotifierTest, RemoveSoleObserverWhileNotifying) TEST_F(NetworkStateNotifierTest, RemoveCurrentObserverWhileNotifying) { StateObserver observer1, observer2; - m_notifier.addObserver(&observer1, executionContext()); - m_notifier.addObserver(&observer2, executionContext()); + m_notifier.addObserver(&observer1, getExecutionContext()); + m_notifier.addObserver(&observer2, getExecutionContext()); removeObserverOnNotification(&observer1, &observer1); setConnection(WebConnectionTypeBluetooth, kBluetoothMaxBandwidthMbps); @@ -215,8 +215,8 @@ TEST_F(NetworkStateNotifierTest, RemoveCurrentObserverWhileNotifying) TEST_F(NetworkStateNotifierTest, RemovePastObserverWhileNotifying) { StateObserver observer1, observer2; - m_notifier.addObserver(&observer1, executionContext()); - m_notifier.addObserver(&observer2, executionContext()); + m_notifier.addObserver(&observer1, getExecutionContext()); + m_notifier.addObserver(&observer2, getExecutionContext()); removeObserverOnNotification(&observer2, &observer1); setConnection(WebConnectionTypeBluetooth, kBluetoothMaxBandwidthMbps); @@ -231,9 +231,9 @@ TEST_F(NetworkStateNotifierTest, RemovePastObserverWhileNotifying) TEST_F(NetworkStateNotifierTest, RemoveFutureObserverWhileNotifying) { StateObserver observer1, observer2, observer3; - m_notifier.addObserver(&observer1, executionContext()); - m_notifier.addObserver(&observer2, executionContext()); - m_notifier.addObserver(&observer3, executionContext()); + m_notifier.addObserver(&observer1, getExecutionContext()); + m_notifier.addObserver(&observer2, getExecutionContext()); + m_notifier.addObserver(&observer3, getExecutionContext()); removeObserverOnNotification(&observer1, &observer2); setConnection(WebConnectionTypeBluetooth, kBluetoothMaxBandwidthMbps); @@ -245,7 +245,7 @@ TEST_F(NetworkStateNotifierTest, RemoveFutureObserverWhileNotifying) TEST_F(NetworkStateNotifierTest, MultipleContextsAddObserver) { StateObserver observer1, observer2; - m_notifier.addObserver(&observer1, executionContext()); + m_notifier.addObserver(&observer1, getExecutionContext()); m_notifier.addObserver(&observer2, executionContext2()); setConnection(WebConnectionTypeBluetooth, kBluetoothMaxBandwidthMbps); @@ -256,7 +256,7 @@ TEST_F(NetworkStateNotifierTest, MultipleContextsAddObserver) TEST_F(NetworkStateNotifierTest, RemoveContext) { StateObserver observer1, observer2; - m_notifier.addObserver(&observer1, executionContext()); + m_notifier.addObserver(&observer1, getExecutionContext()); m_notifier.addObserver(&observer2, executionContext2()); m_notifier.removeObserver(&observer2, executionContext2()); @@ -268,9 +268,9 @@ TEST_F(NetworkStateNotifierTest, RemoveContext) TEST_F(NetworkStateNotifierTest, RemoveAllContexts) { StateObserver observer1, observer2; - m_notifier.addObserver(&observer1, executionContext()); + m_notifier.addObserver(&observer1, getExecutionContext()); m_notifier.addObserver(&observer2, executionContext2()); - m_notifier.removeObserver(&observer1, executionContext()); + m_notifier.removeObserver(&observer1, getExecutionContext()); m_notifier.removeObserver(&observer2, executionContext2()); setConnection(WebConnectionTypeBluetooth, kBluetoothMaxBandwidthMbps); diff --git a/third_party/WebKit/Source/core/streams/ReadableStream.cpp b/third_party/WebKit/Source/core/streams/ReadableStream.cpp index 3525d3d..77ff8d7 100644 --- a/third_party/WebKit/Source/core/streams/ReadableStream.cpp +++ b/third_party/WebKit/Source/core/streams/ReadableStream.cpp @@ -28,7 +28,7 @@ private: explicit ConstUndefined(ScriptState* scriptState) : ScriptFunction(scriptState) { } ScriptValue call(ScriptValue value) override { - return ScriptValue(scriptState(), v8::Undefined(scriptState()->isolate())); + return ScriptValue(getScriptState(), v8::Undefined(getScriptState()->isolate())); } }; diff --git a/third_party/WebKit/Source/core/streams/ReadableStreamController.h b/third_party/WebKit/Source/core/streams/ReadableStreamController.h index 435db84..adc54f0 100644 --- a/third_party/WebKit/Source/core/streams/ReadableStreamController.h +++ b/third_party/WebKit/Source/core/streams/ReadableStreamController.h @@ -21,7 +21,7 @@ public: DEFINE_INLINE_TRACE() {} explicit ReadableStreamController(ScriptValue stream) - : m_scriptState(stream.scriptState()) + : m_scriptState(stream.getScriptState()) , m_stream(stream.isolate(), stream.v8Value()) { m_stream.setWeak(&m_stream, ReadableStreamController::streamWeakCallback); diff --git a/third_party/WebKit/Source/core/streams/ReadableStreamImpl.h b/third_party/WebKit/Source/core/streams/ReadableStreamImpl.h index 9704911..aeb47f6 100644 --- a/third_party/WebKit/Source/core/streams/ReadableStreamImpl.h +++ b/third_party/WebKit/Source/core/streams/ReadableStreamImpl.h @@ -139,7 +139,7 @@ private: void resolveAllPendingReadsAsDone() override { for (auto& resolver : m_pendingReads) { - ScriptState* scriptState = resolver->scriptState(); + ScriptState* scriptState = resolver->getScriptState(); if (!scriptState->contextIsValid()) continue; ScriptState::Scope scope(scriptState); @@ -181,7 +181,7 @@ bool ReadableStreamImpl<ChunkTypeTraits>::enqueue(typename ChunkTypeTraits::Pass } ScriptPromiseResolver* resolver = m_pendingReads.takeFirst(); - ScriptState* scriptState = resolver->scriptState(); + ScriptState* scriptState = resolver->getScriptState(); if (!scriptState->contextIsValid()) return false; ScriptState::Scope scope(scriptState); diff --git a/third_party/WebKit/Source/core/streams/ReadableStreamReaderTest.cpp b/third_party/WebKit/Source/core/streams/ReadableStreamReaderTest.cpp index 352a30f..af7b78e 100644 --- a/third_party/WebKit/Source/core/streams/ReadableStreamReaderTest.cpp +++ b/third_party/WebKit/Source/core/streams/ReadableStreamReaderTest.cpp @@ -49,7 +49,7 @@ private: ScriptValue call(ScriptValue value) override { ASSERT(!value.isEmpty()); - *m_value = toCoreString(value.v8Value()->ToString(scriptState()->context()).ToLocalChecked()); + *m_value = toCoreString(value.v8Value()->ToString(getScriptState()->context()).ToLocalChecked()); return value; } @@ -74,14 +74,14 @@ private: ScriptValue call(ScriptValue result) override { ASSERT(!result.isEmpty()); - v8::Isolate* isolate = scriptState()->isolate(); + v8::Isolate* isolate = getScriptState()->isolate(); if (!result.isObject()) { return result; } v8::Local<v8::Object> object = result.v8Value().As<v8::Object>(); v8::Local<v8::String> doneString = v8String(isolate, "done"); v8::Local<v8::String> valueString = v8String(isolate, "value"); - v8::Local<v8::Context> context = scriptState()->context(); + v8::Local<v8::Context> context = getScriptState()->context(); v8::Maybe<bool> hasDone = object->Has(context, doneString); v8::Maybe<bool> hasValue = object->Has(context, valueString); @@ -98,7 +98,7 @@ private: m_result->isSet = true; m_result->isDone = done.As<v8::Boolean>()->Value(); - m_result->valueString = toCoreString(value->ToString(scriptState()->context()).ToLocalChecked()); + m_result->valueString = toCoreString(value->ToString(getScriptState()->context()).ToLocalChecked()); return result; } @@ -136,18 +136,18 @@ public: m_stream->error(DOMException::create(AbortError, "done")); } - ScriptState* scriptState() { return ScriptState::forMainWorld(m_page->document().frame()); } - v8::Isolate* isolate() { return scriptState()->isolate(); } - ExecutionContext* executionContext() { return scriptState()->executionContext(); } + ScriptState* getScriptState() { return ScriptState::forMainWorld(m_page->document().frame()); } + v8::Isolate* isolate() { return getScriptState()->isolate(); } + ExecutionContext* getExecutionContext() { return getScriptState()->getExecutionContext(); } v8::Local<v8::Function> createCaptor(String* value) { - return StringCapturingFunction::createFunction(scriptState(), value); + return StringCapturingFunction::createFunction(getScriptState(), value); } v8::Local<v8::Function> createResultCaptor(ReadResult* value) { - return ReadResultCapturingFunction::createFunction(scriptState(), value); + return ReadResultCapturingFunction::createFunction(getScriptState(), value); } OwnPtr<DummyPageHolder> m_page; @@ -156,22 +156,22 @@ public: TEST_F(ReadableStreamReaderTest, Construct) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); - ReadableStreamReader* reader = new ReadableStreamReader(executionContext(), m_stream); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); + ReadableStreamReader* reader = new ReadableStreamReader(getExecutionContext(), m_stream); EXPECT_TRUE(reader->isActive()); EXPECT_FALSE(exceptionState.hadException()); } TEST_F(ReadableStreamReaderTest, Release) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); String onFulfilled, onRejected; - ReadableStreamReader* reader = new ReadableStreamReader(executionContext(), m_stream); + ReadableStreamReader* reader = new ReadableStreamReader(getExecutionContext(), m_stream); EXPECT_TRUE(reader->isActive()); - reader->closed(scriptState()).then(createCaptor(&onFulfilled), createCaptor(&onRejected)); + reader->closed(getScriptState()).then(createCaptor(&onFulfilled), createCaptor(&onRejected)); reader->releaseLock(exceptionState); EXPECT_FALSE(reader->isActive()); EXPECT_FALSE(exceptionState.hadException()); @@ -183,7 +183,7 @@ TEST_F(ReadableStreamReaderTest, Release) EXPECT_TRUE(onFulfilled.isNull()); EXPECT_EQ("AbortError: the reader is already released", onRejected); - ReadableStreamReader* another = new ReadableStreamReader(executionContext(), m_stream); + ReadableStreamReader* another = new ReadableStreamReader(getExecutionContext(), m_stream); EXPECT_TRUE(another->isActive()); EXPECT_FALSE(reader->isActive()); reader->releaseLock(exceptionState); @@ -194,9 +194,9 @@ TEST_F(ReadableStreamReaderTest, Release) TEST_F(ReadableStreamReaderTest, ReadAfterRelease) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); - ReadableStreamReader* reader = new ReadableStreamReader(executionContext(), m_stream); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); + ReadableStreamReader* reader = new ReadableStreamReader(getExecutionContext(), m_stream); EXPECT_TRUE(reader->isActive()); reader->releaseLock(exceptionState); EXPECT_FALSE(exceptionState.hadException()); @@ -204,7 +204,7 @@ TEST_F(ReadableStreamReaderTest, ReadAfterRelease) ReadResult result; String onRejected; - reader->read(scriptState()).then(createResultCaptor(&result), createCaptor(&onRejected)); + reader->read(getScriptState()).then(createResultCaptor(&result), createCaptor(&onRejected)); EXPECT_FALSE(result.isSet); EXPECT_TRUE(onRejected.isNull()); @@ -217,11 +217,11 @@ TEST_F(ReadableStreamReaderTest, ReadAfterRelease) TEST_F(ReadableStreamReaderTest, ReleaseShouldFailWhenCalledWhileReading) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); - ReadableStreamReader* reader = new ReadableStreamReader(executionContext(), m_stream); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); + ReadableStreamReader* reader = new ReadableStreamReader(getExecutionContext(), m_stream); EXPECT_TRUE(reader->isActive()); - reader->read(scriptState()); + reader->read(getScriptState()); reader->releaseLock(exceptionState); EXPECT_TRUE(reader->isActive()); @@ -236,16 +236,16 @@ TEST_F(ReadableStreamReaderTest, ReleaseShouldFailWhenCalledWhileReading) TEST_F(ReadableStreamReaderTest, EnqueueThenRead) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); m_stream->enqueue("hello"); m_stream->enqueue("world"); - ReadableStreamReader* reader = new ReadableStreamReader(executionContext(), m_stream); + ReadableStreamReader* reader = new ReadableStreamReader(getExecutionContext(), m_stream); EXPECT_EQ(ReadableStream::Readable, m_stream->stateInternal()); ReadResult result; String onRejected; - reader->read(scriptState()).then(createResultCaptor(&result), createCaptor(&onRejected)); + reader->read(getScriptState()).then(createResultCaptor(&result), createCaptor(&onRejected)); EXPECT_FALSE(result.isSet); EXPECT_TRUE(onRejected.isNull()); @@ -259,7 +259,7 @@ TEST_F(ReadableStreamReaderTest, EnqueueThenRead) ReadResult result2; String onRejected2; - reader->read(scriptState()).then(createResultCaptor(&result2), createCaptor(&onRejected2)); + reader->read(getScriptState()).then(createResultCaptor(&result2), createCaptor(&onRejected2)); EXPECT_FALSE(result2.isSet); EXPECT_TRUE(onRejected2.isNull()); @@ -275,15 +275,15 @@ TEST_F(ReadableStreamReaderTest, EnqueueThenRead) TEST_F(ReadableStreamReaderTest, ReadThenEnqueue) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); - ReadableStreamReader* reader = new ReadableStreamReader(executionContext(), m_stream); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); + ReadableStreamReader* reader = new ReadableStreamReader(getExecutionContext(), m_stream); EXPECT_EQ(ReadableStream::Readable, m_stream->stateInternal()); ReadResult result, result2; String onRejected, onRejected2; - reader->read(scriptState()).then(createResultCaptor(&result), createCaptor(&onRejected)); - reader->read(scriptState()).then(createResultCaptor(&result2), createCaptor(&onRejected2)); + reader->read(getScriptState()).then(createResultCaptor(&result), createCaptor(&onRejected)); + reader->read(getScriptState()).then(createResultCaptor(&result2), createCaptor(&onRejected2)); EXPECT_FALSE(result.isSet); EXPECT_TRUE(onRejected.isNull()); @@ -319,9 +319,9 @@ TEST_F(ReadableStreamReaderTest, ReadThenEnqueue) TEST_F(ReadableStreamReaderTest, ClosedReader) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); - ReadableStreamReader* reader = new ReadableStreamReader(executionContext(), m_stream); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); + ReadableStreamReader* reader = new ReadableStreamReader(getExecutionContext(), m_stream); m_stream->close(); @@ -331,8 +331,8 @@ TEST_F(ReadableStreamReaderTest, ClosedReader) ReadResult result; String onReadRejected; v8::MicrotasksScope::PerformCheckpoint(isolate()); - reader->closed(scriptState()).then(createCaptor(&onClosedFulfilled), createCaptor(&onClosedRejected)); - reader->read(scriptState()).then(createResultCaptor(&result), createCaptor(&onReadRejected)); + reader->closed(getScriptState()).then(createCaptor(&onClosedFulfilled), createCaptor(&onClosedRejected)); + reader->read(getScriptState()).then(createResultCaptor(&result), createCaptor(&onReadRejected)); EXPECT_TRUE(onClosedFulfilled.isNull()); EXPECT_TRUE(onClosedRejected.isNull()); EXPECT_FALSE(result.isSet); @@ -350,9 +350,9 @@ TEST_F(ReadableStreamReaderTest, ClosedReader) TEST_F(ReadableStreamReaderTest, ErroredReader) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); - ReadableStreamReader* reader = new ReadableStreamReader(executionContext(), m_stream); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); + ReadableStreamReader* reader = new ReadableStreamReader(getExecutionContext(), m_stream); m_stream->error(DOMException::create(SyntaxError, "some error")); @@ -362,8 +362,8 @@ TEST_F(ReadableStreamReaderTest, ErroredReader) String onClosedFulfilled, onClosedRejected; String onReadFulfilled, onReadRejected; v8::MicrotasksScope::PerformCheckpoint(isolate()); - reader->closed(scriptState()).then(createCaptor(&onClosedFulfilled), createCaptor(&onClosedRejected)); - reader->read(scriptState()).then(createCaptor(&onReadFulfilled), createCaptor(&onReadRejected)); + reader->closed(getScriptState()).then(createCaptor(&onClosedFulfilled), createCaptor(&onClosedRejected)); + reader->read(getScriptState()).then(createCaptor(&onReadFulfilled), createCaptor(&onReadRejected)); EXPECT_TRUE(onClosedFulfilled.isNull()); EXPECT_TRUE(onClosedRejected.isNull()); EXPECT_TRUE(onReadFulfilled.isNull()); @@ -379,15 +379,15 @@ TEST_F(ReadableStreamReaderTest, ErroredReader) TEST_F(ReadableStreamReaderTest, PendingReadsShouldBeResolvedWhenClosed) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); - ReadableStreamReader* reader = new ReadableStreamReader(executionContext(), m_stream); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); + ReadableStreamReader* reader = new ReadableStreamReader(getExecutionContext(), m_stream); EXPECT_EQ(ReadableStream::Readable, m_stream->stateInternal()); ReadResult result, result2; String onRejected, onRejected2; - reader->read(scriptState()).then(createResultCaptor(&result), createCaptor(&onRejected)); - reader->read(scriptState()).then(createResultCaptor(&result2), createCaptor(&onRejected2)); + reader->read(getScriptState()).then(createResultCaptor(&result), createCaptor(&onRejected)); + reader->read(getScriptState()).then(createResultCaptor(&result2), createCaptor(&onRejected2)); v8::MicrotasksScope::PerformCheckpoint(isolate()); EXPECT_FALSE(result.isSet); @@ -417,15 +417,15 @@ TEST_F(ReadableStreamReaderTest, PendingReadsShouldBeResolvedWhenClosed) TEST_F(ReadableStreamReaderTest, PendingReadsShouldBeRejectedWhenErrored) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); - ReadableStreamReader* reader = new ReadableStreamReader(executionContext(), m_stream); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); + ReadableStreamReader* reader = new ReadableStreamReader(getExecutionContext(), m_stream); EXPECT_EQ(ReadableStream::Readable, m_stream->stateInternal()); String onFulfilled, onFulfilled2; String onRejected, onRejected2; - reader->read(scriptState()).then(createCaptor(&onFulfilled), createCaptor(&onRejected)); - reader->read(scriptState()).then(createCaptor(&onFulfilled2), createCaptor(&onRejected2)); + reader->read(getScriptState()).then(createCaptor(&onFulfilled), createCaptor(&onRejected)); + reader->read(getScriptState()).then(createCaptor(&onFulfilled2), createCaptor(&onRejected2)); v8::MicrotasksScope::PerformCheckpoint(isolate()); EXPECT_TRUE(onFulfilled.isNull()); @@ -450,15 +450,15 @@ TEST_F(ReadableStreamReaderTest, PendingReadsShouldBeRejectedWhenErrored) TEST_F(ReadableStreamReaderTest, PendingReadsShouldBeResolvedWhenCanceled) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); - ReadableStreamReader* reader = new ReadableStreamReader(executionContext(), m_stream); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); + ReadableStreamReader* reader = new ReadableStreamReader(getExecutionContext(), m_stream); EXPECT_EQ(ReadableStream::Readable, m_stream->stateInternal()); ReadResult result, result2; String onRejected, onRejected2; - reader->read(scriptState()).then(createResultCaptor(&result), createCaptor(&onRejected)); - reader->read(scriptState()).then(createResultCaptor(&result2), createCaptor(&onRejected2)); + reader->read(getScriptState()).then(createResultCaptor(&result), createCaptor(&onRejected)); + reader->read(getScriptState()).then(createResultCaptor(&result2), createCaptor(&onRejected2)); v8::MicrotasksScope::PerformCheckpoint(isolate()); EXPECT_FALSE(result.isSet); @@ -466,7 +466,7 @@ TEST_F(ReadableStreamReaderTest, PendingReadsShouldBeResolvedWhenCanceled) EXPECT_FALSE(result2.isSet); EXPECT_TRUE(onRejected2.isNull()); - reader->cancel(scriptState(), ScriptValue(scriptState(), v8::Undefined(isolate()))); + reader->cancel(getScriptState(), ScriptValue(getScriptState(), v8::Undefined(isolate()))); EXPECT_TRUE(reader->isActive()); EXPECT_FALSE(result.isSet); EXPECT_TRUE(onRejected.isNull()); @@ -489,14 +489,14 @@ TEST_F(ReadableStreamReaderTest, PendingReadsShouldBeResolvedWhenCanceled) TEST_F(ReadableStreamReaderTest, CancelShouldNotWorkWhenNotActive) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); - ReadableStreamReader* reader = new ReadableStreamReader(executionContext(), m_stream); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); + ReadableStreamReader* reader = new ReadableStreamReader(getExecutionContext(), m_stream); reader->releaseLock(exceptionState); EXPECT_FALSE(reader->isActive()); String onFulfilled, onRejected; - reader->cancel(scriptState(), ScriptValue(scriptState(), v8::Undefined(isolate()))).then(createCaptor(&onFulfilled), createCaptor(&onRejected)); + reader->cancel(getScriptState(), ScriptValue(getScriptState(), v8::Undefined(isolate()))).then(createCaptor(&onFulfilled), createCaptor(&onRejected)); EXPECT_EQ(ReadableStream::Readable, m_stream->stateInternal()); EXPECT_TRUE(onFulfilled.isNull()); @@ -512,15 +512,15 @@ TEST_F(ReadableStreamReaderTest, CancelShouldNotWorkWhenNotActive) TEST_F(ReadableStreamReaderTest, Cancel) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); - ReadableStreamReader* reader = new ReadableStreamReader(executionContext(), m_stream); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); + ReadableStreamReader* reader = new ReadableStreamReader(getExecutionContext(), m_stream); EXPECT_EQ(ReadableStream::Readable, m_stream->stateInternal()); String onClosedFulfilled, onClosedRejected; String onCancelFulfilled, onCancelRejected; - reader->closed(scriptState()).then(createCaptor(&onClosedFulfilled), createCaptor(&onClosedRejected)); - reader->cancel(scriptState(), ScriptValue(scriptState(), v8::Undefined(isolate()))).then(createCaptor(&onCancelFulfilled), createCaptor(&onCancelRejected)); + reader->closed(getScriptState()).then(createCaptor(&onClosedFulfilled), createCaptor(&onClosedRejected)); + reader->cancel(getScriptState(), ScriptValue(getScriptState(), v8::Undefined(isolate()))).then(createCaptor(&onCancelFulfilled), createCaptor(&onCancelRejected)); EXPECT_EQ(ReadableStream::Closed, m_stream->stateInternal()); EXPECT_TRUE(onClosedFulfilled.isNull()); @@ -538,13 +538,13 @@ TEST_F(ReadableStreamReaderTest, Cancel) TEST_F(ReadableStreamReaderTest, Close) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); - ReadableStreamReader* reader = new ReadableStreamReader(executionContext(), m_stream); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); + ReadableStreamReader* reader = new ReadableStreamReader(getExecutionContext(), m_stream); EXPECT_EQ(ReadableStream::Readable, m_stream->stateInternal()); String onFulfilled, onRejected; - reader->closed(scriptState()).then(createCaptor(&onFulfilled), createCaptor(&onRejected)); + reader->closed(getScriptState()).then(createCaptor(&onFulfilled), createCaptor(&onRejected)); m_stream->close(); @@ -560,13 +560,13 @@ TEST_F(ReadableStreamReaderTest, Close) TEST_F(ReadableStreamReaderTest, Error) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); - ReadableStreamReader* reader = new ReadableStreamReader(executionContext(), m_stream); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); + ReadableStreamReader* reader = new ReadableStreamReader(getExecutionContext(), m_stream); EXPECT_EQ(ReadableStream::Readable, m_stream->stateInternal()); String onFulfilled, onRejected; - reader->closed(scriptState()).then(createCaptor(&onFulfilled), createCaptor(&onRejected)); + reader->closed(getScriptState()).then(createCaptor(&onFulfilled), createCaptor(&onRejected)); m_stream->error(DOMException::create(SyntaxError, "some error")); diff --git a/third_party/WebKit/Source/core/streams/ReadableStreamTest.cpp b/third_party/WebKit/Source/core/streams/ReadableStreamTest.cpp index 031ecdd..8ee42c8 100644 --- a/third_party/WebKit/Source/core/streams/ReadableStreamTest.cpp +++ b/third_party/WebKit/Source/core/streams/ReadableStreamTest.cpp @@ -51,7 +51,7 @@ private: ScriptValue call(ScriptValue value) override { ASSERT(!value.isEmpty()); - *m_value = toCoreString(value.v8Value()->ToString(scriptState()->context()).ToLocalChecked()); + *m_value = toCoreString(value.v8Value()->ToString(getScriptState()->context()).ToLocalChecked()); return value; } @@ -114,12 +114,12 @@ public: { } - ScriptState* scriptState() { return ScriptState::forMainWorld(m_page->document().frame()); } - v8::Isolate* isolate() { return scriptState()->isolate(); } + ScriptState* getScriptState() { return ScriptState::forMainWorld(m_page->document().frame()); } + v8::Isolate* isolate() { return getScriptState()->isolate(); } v8::Local<v8::Function> createCaptor(String* value) { - return StringCapturingFunction::createFunction(scriptState(), value); + return StringCapturingFunction::createFunction(getScriptState(), value); } StringStream* construct(MockStrategy* strategy) @@ -159,8 +159,8 @@ public: TEST_F(ReadableStreamTest, Start) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); Checkpoint checkpoint; { InSequence s; @@ -193,8 +193,8 @@ TEST_F(ReadableStreamTest, Start) TEST_F(ReadableStreamTest, StartFail) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); StringStream* stream = new StringStream(m_underlyingSource); EXPECT_FALSE(exceptionState.hadException()); EXPECT_FALSE(stream->isStarted()); @@ -212,8 +212,8 @@ TEST_F(ReadableStreamTest, StartFail) TEST_F(ReadableStreamTest, ErrorAndEnqueue) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); StringStream* stream = construct(); stream->error(DOMException::create(NotFoundError, "error")); @@ -226,8 +226,8 @@ TEST_F(ReadableStreamTest, ErrorAndEnqueue) TEST_F(ReadableStreamTest, CloseAndEnqueue) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); StringStream* stream = construct(); stream->close(); @@ -240,8 +240,8 @@ TEST_F(ReadableStreamTest, CloseAndEnqueue) TEST_F(ReadableStreamTest, CloseWhenErrored) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); StringStream* stream = construct(); EXPECT_EQ(ReadableStream::Readable, stream->stateInternal()); @@ -253,8 +253,8 @@ TEST_F(ReadableStreamTest, CloseWhenErrored) TEST_F(ReadableStreamTest, ReadQueue) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); StringStream* stream = construct(); Checkpoint checkpoint; @@ -289,8 +289,8 @@ TEST_F(ReadableStreamTest, ReadQueue) TEST_F(ReadableStreamTest, CloseWhenReadable) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); StringStream* stream = construct(); EXPECT_TRUE(stream->enqueue("hello")); @@ -302,7 +302,7 @@ TEST_F(ReadableStreamTest, CloseWhenReadable) EXPECT_FALSE(stream->isPulling()); EXPECT_TRUE(stream->isDraining()); - stream->read(scriptState()); + stream->read(getScriptState()); v8::MicrotasksScope::PerformCheckpoint(isolate()); @@ -310,7 +310,7 @@ TEST_F(ReadableStreamTest, CloseWhenReadable) EXPECT_FALSE(stream->isPulling()); EXPECT_TRUE(stream->isDraining()); - stream->read(scriptState()); + stream->read(getScriptState()); EXPECT_EQ(ReadableStream::Closed, stream->stateInternal()); EXPECT_FALSE(stream->isPulling()); @@ -319,15 +319,15 @@ TEST_F(ReadableStreamTest, CloseWhenReadable) TEST_F(ReadableStreamTest, CancelWhenClosed) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); StringStream* stream = construct(); String onFulfilled, onRejected; stream->close(); EXPECT_EQ(ReadableStream::Closed, stream->stateInternal()); EXPECT_FALSE(stream->isDisturbed()); - ScriptPromise promise = stream->cancel(scriptState(), ScriptValue()); + ScriptPromise promise = stream->cancel(getScriptState(), ScriptValue()); EXPECT_TRUE(stream->isDisturbed()); EXPECT_EQ(ReadableStream::Closed, stream->stateInternal()); @@ -342,15 +342,15 @@ TEST_F(ReadableStreamTest, CancelWhenClosed) TEST_F(ReadableStreamTest, CancelWhenErrored) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); StringStream* stream = construct(); String onFulfilled, onRejected; stream->error(DOMException::create(NotFoundError, "error")); EXPECT_EQ(ReadableStream::Errored, stream->stateInternal()); EXPECT_FALSE(stream->isDisturbed()); - ScriptPromise promise = stream->cancel(scriptState(), ScriptValue()); + ScriptPromise promise = stream->cancel(getScriptState(), ScriptValue()); EXPECT_TRUE(stream->isDisturbed()); EXPECT_EQ(ReadableStream::Errored, stream->stateInternal()); @@ -365,24 +365,24 @@ TEST_F(ReadableStreamTest, CancelWhenErrored) TEST_F(ReadableStreamTest, CancelWhenReadable) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); StringStream* stream = construct(); String onFulfilled, onRejected; String onCancelFulfilled, onCancelRejected; - ScriptValue reason(scriptState(), v8String(scriptState()->isolate(), "reason")); - ScriptPromise promise = ScriptPromise::cast(scriptState(), v8String(scriptState()->isolate(), "hello")); + ScriptValue reason(getScriptState(), v8String(getScriptState()->isolate(), "reason")); + ScriptPromise promise = ScriptPromise::cast(getScriptState(), v8String(getScriptState()->isolate(), "hello")); { InSequence s; - EXPECT_CALL(*m_underlyingSource, cancelSource(scriptState(), reason)).WillOnce(ReturnPointee(&promise)); + EXPECT_CALL(*m_underlyingSource, cancelSource(getScriptState(), reason)).WillOnce(ReturnPointee(&promise)); } stream->enqueue("hello"); EXPECT_EQ(ReadableStream::Readable, stream->stateInternal()); EXPECT_FALSE(stream->isDisturbed()); - ScriptPromise cancelResult = stream->cancel(scriptState(), reason); + ScriptPromise cancelResult = stream->cancel(getScriptState(), reason); EXPECT_TRUE(stream->isDisturbed()); cancelResult.then(createCaptor(&onCancelFulfilled), createCaptor(&onCancelRejected)); @@ -399,18 +399,18 @@ TEST_F(ReadableStreamTest, CancelWhenReadable) TEST_F(ReadableStreamTest, CancelWhenLocked) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); String onFulfilled, onRejected; StringStream* stream = construct(); - ReadableStreamReader* reader = stream->getReader(scriptState()->executionContext(), exceptionState); + ReadableStreamReader* reader = stream->getReader(getScriptState()->getExecutionContext(), exceptionState); EXPECT_TRUE(reader->isActive()); EXPECT_FALSE(exceptionState.hadException()); EXPECT_EQ(ReadableStream::Readable, stream->stateInternal()); EXPECT_FALSE(stream->isDisturbed()); - stream->cancel(scriptState(), ScriptValue(scriptState(), v8::Undefined(isolate()))).then(createCaptor(&onFulfilled), createCaptor(&onRejected)); + stream->cancel(getScriptState(), ScriptValue(getScriptState(), v8::Undefined(isolate()))).then(createCaptor(&onFulfilled), createCaptor(&onRejected)); EXPECT_FALSE(stream->isDisturbed()); EXPECT_TRUE(onFulfilled.isNull()); @@ -426,8 +426,8 @@ TEST_F(ReadableStreamTest, CancelWhenLocked) TEST_F(ReadableStreamTest, ReadableArrayBufferStreamCompileTest) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); // This test tests if ReadableStreamImpl<DOMArrayBuffer> can be // instantiated. new ReadableStreamImpl<ReadableStreamChunkTypeTraits<DOMArrayBuffer>>(m_underlyingSource); @@ -435,8 +435,8 @@ TEST_F(ReadableStreamTest, ReadableArrayBufferStreamCompileTest) TEST_F(ReadableStreamTest, ReadableArrayBufferViewStreamCompileTest) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); // This test tests if ReadableStreamImpl<DOMArrayBufferVIew> can be // instantiated. new ReadableStreamImpl<ReadableStreamChunkTypeTraits<DOMArrayBufferView>>(m_underlyingSource); @@ -444,8 +444,8 @@ TEST_F(ReadableStreamTest, ReadableArrayBufferViewStreamCompileTest) TEST_F(ReadableStreamTest, BackpressureOnEnqueueing) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); auto strategy = MockStrategy::create(); Checkpoint checkpoint; @@ -478,8 +478,8 @@ TEST_F(ReadableStreamTest, BackpressureOnEnqueueing) TEST_F(ReadableStreamTest, BackpressureOnReading) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); auto strategy = MockStrategy::create(); Checkpoint checkpoint; @@ -512,14 +512,14 @@ TEST_F(ReadableStreamTest, BackpressureOnReading) stream->enqueue("world"); checkpoint.Call(0); - stream->read(scriptState()); + stream->read(getScriptState()); checkpoint.Call(1); - stream->read(scriptState()); + stream->read(getScriptState()); checkpoint.Call(2); stream->enqueue("foo"); stream->enqueue("bar"); checkpoint.Call(3); - stream->read(scriptState()); + stream->read(getScriptState()); checkpoint.Call(4); stream->error(DOMException::create(AbortError, "done")); @@ -528,17 +528,17 @@ TEST_F(ReadableStreamTest, BackpressureOnReading) // Note: Detailed tests are on ReadableStreamReaderTest. TEST_F(ReadableStreamTest, ReadableStreamReader) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); StringStream* stream = construct(); - ReadableStreamReader* reader = stream->getReader(scriptState()->executionContext(), exceptionState); + ReadableStreamReader* reader = stream->getReader(getScriptState()->getExecutionContext(), exceptionState); ASSERT_TRUE(reader); EXPECT_FALSE(exceptionState.hadException()); EXPECT_TRUE(reader->isActive()); EXPECT_TRUE(stream->isLockedTo(reader)); - ReadableStreamReader* another = stream->getReader(scriptState()->executionContext(), exceptionState); + ReadableStreamReader* another = stream->getReader(getScriptState()->getExecutionContext(), exceptionState); ASSERT_EQ(nullptr, another); EXPECT_TRUE(exceptionState.hadException()); EXPECT_TRUE(reader->isActive()); @@ -547,17 +547,17 @@ TEST_F(ReadableStreamTest, ReadableStreamReader) TEST_F(ReadableStreamTest, GetClosedReader) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); StringStream* stream = construct(); stream->close(); - ReadableStreamReader* reader = stream->getReader(scriptState()->executionContext(), exceptionState); + ReadableStreamReader* reader = stream->getReader(getScriptState()->getExecutionContext(), exceptionState); ASSERT_TRUE(reader); EXPECT_FALSE(exceptionState.hadException()); String onFulfilled, onRejected; - reader->closed(scriptState()).then(createCaptor(&onFulfilled), createCaptor(&onRejected)); + reader->closed(getScriptState()).then(createCaptor(&onFulfilled), createCaptor(&onRejected)); EXPECT_TRUE(reader->isActive()); EXPECT_TRUE(onFulfilled.isNull()); @@ -570,17 +570,17 @@ TEST_F(ReadableStreamTest, GetClosedReader) TEST_F(ReadableStreamTest, GetErroredReader) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); StringStream* stream = construct(); stream->error(DOMException::create(SyntaxError, "some error")); - ReadableStreamReader* reader = stream->getReader(scriptState()->executionContext(), exceptionState); + ReadableStreamReader* reader = stream->getReader(getScriptState()->getExecutionContext(), exceptionState); ASSERT_TRUE(reader); EXPECT_FALSE(exceptionState.hadException()); String onFulfilled, onRejected; - reader->closed(scriptState()).then(createCaptor(&onFulfilled), createCaptor(&onRejected)); + reader->closed(getScriptState()).then(createCaptor(&onFulfilled), createCaptor(&onRejected)); EXPECT_TRUE(reader->isActive()); EXPECT_TRUE(onFulfilled.isNull()); @@ -593,8 +593,8 @@ TEST_F(ReadableStreamTest, GetErroredReader) TEST_F(ReadableStreamTest, StrictStrategy) { - ScriptState::Scope scope(scriptState()); - ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate()); + ScriptState::Scope scope(getScriptState()); + ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", getScriptState()->context()->Global(), isolate()); Checkpoint checkpoint; { InSequence s; @@ -613,23 +613,23 @@ TEST_F(ReadableStreamTest, StrictStrategy) EXPECT_CALL(*m_underlyingSource, pullSource()); } StringStream* stream = new StringStream(m_underlyingSource, new StringStream::StrictStrategy); - ReadableStreamReader* reader = stream->getReader(scriptState()->executionContext(), exceptionState); + ReadableStreamReader* reader = stream->getReader(getScriptState()->getExecutionContext(), exceptionState); checkpoint.Call(0); stream->didSourceStart(); checkpoint.Call(1); EXPECT_FALSE(stream->isPulling()); - reader->read(scriptState()); + reader->read(getScriptState()); EXPECT_TRUE(stream->isPulling()); checkpoint.Call(2); stream->enqueue("hello"); EXPECT_FALSE(stream->isPulling()); checkpoint.Call(3); - reader->read(scriptState()); + reader->read(getScriptState()); EXPECT_TRUE(stream->isPulling()); checkpoint.Call(4); - reader->read(scriptState()); + reader->read(getScriptState()); EXPECT_TRUE(stream->isPulling()); checkpoint.Call(5); stream->enqueue("hello"); @@ -641,10 +641,10 @@ TEST_F(ReadableStreamTest, StrictStrategy) stream->enqueue("hello"); EXPECT_FALSE(stream->isPulling()); checkpoint.Call(8); - reader->read(scriptState()); + reader->read(getScriptState()); EXPECT_FALSE(stream->isPulling()); checkpoint.Call(9); - reader->read(scriptState()); + reader->read(getScriptState()); EXPECT_TRUE(stream->isPulling()); stream->error(DOMException::create(AbortError, "done")); diff --git a/third_party/WebKit/Source/core/streams/UnderlyingSourceBase.h b/third_party/WebKit/Source/core/streams/UnderlyingSourceBase.h index 8105024..c0ad8ad 100644 --- a/third_party/WebKit/Source/core/streams/UnderlyingSourceBase.h +++ b/third_party/WebKit/Source/core/streams/UnderlyingSourceBase.h @@ -39,7 +39,7 @@ public: protected: explicit UnderlyingSourceBase(ScriptState* scriptState) - : ContextLifecycleObserver(scriptState->executionContext()) + : ContextLifecycleObserver(scriptState->getExecutionContext()) { } diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp index 12f24bf..be3f7e0 100644 --- a/third_party/WebKit/Source/core/testing/Internals.cpp +++ b/third_party/WebKit/Source/core/testing/Internals.cpp @@ -244,14 +244,14 @@ void Internals::resetToConsistentState(Page* page) } Internals::Internals(ScriptState* scriptState) - : ContextLifecycleObserver(scriptState->executionContext()) + : ContextLifecycleObserver(scriptState->getExecutionContext()) , m_runtimeFlags(InternalRuntimeFlags::create()) { } Document* Internals::contextDocument() const { - return toDocument(executionContext()); + return toDocument(getExecutionContext()); } LocalFrame* Internals::frame() const @@ -2283,7 +2283,7 @@ private: v8::Local<v8::Value> v8Value = value.v8Value(); ASSERT(v8Value->IsNumber()); int intValue = v8Value.As<v8::Integer>()->Value(); - return ScriptValue(scriptState(), v8::Integer::New(scriptState()->isolate(), intValue + 1)); + return ScriptValue(getScriptState(), v8::Integer::New(getScriptState()->isolate(), intValue + 1)); } }; diff --git a/third_party/WebKit/Source/core/testing/NullExecutionContext.h b/third_party/WebKit/Source/core/testing/NullExecutionContext.h index 9f88e8c..70f72d2 100644 --- a/third_party/WebKit/Source/core/testing/NullExecutionContext.h +++ b/third_party/WebKit/Source/core/testing/NullExecutionContext.h @@ -27,7 +27,7 @@ public: void postTask(const WebTraceLocation&, PassOwnPtr<ExecutionContextTask>) override; EventTarget* errorEventTarget() override { return nullptr; } - EventQueue* eventQueue() const override { return m_queue.get(); } + EventQueue* getEventQueue() const override { return m_queue.get(); } bool tasksNeedSuspension() override { return m_tasksNeedSuspension; } void setTasksNeedSuspension(bool flag) { m_tasksNeedSuspension = flag; } diff --git a/third_party/WebKit/Source/core/testing/v8/WebCoreTestSupport.cpp b/third_party/WebKit/Source/core/testing/v8/WebCoreTestSupport.cpp index 31c5437..7b225b9 100644 --- a/third_party/WebKit/Source/core/testing/v8/WebCoreTestSupport.cpp +++ b/third_party/WebKit/Source/core/testing/v8/WebCoreTestSupport.cpp @@ -40,7 +40,7 @@ v8::Local<v8::Value> createInternalsObject(v8::Local<v8::Context> context) { ScriptState* scriptState = ScriptState::from(context); v8::Local<v8::Object> global = scriptState->context()->Global(); - ExecutionContext* executionContext = scriptState->executionContext(); + ExecutionContext* executionContext = scriptState->getExecutionContext(); if (executionContext->isDocument()) return toV8(Internals::create(scriptState), global, scriptState->isolate()); return v8::Local<v8::Value>(); @@ -65,7 +65,7 @@ void resetInternalsObject(v8::Local<v8::Context> context) ScriptState* scriptState = ScriptState::from(context); ScriptState::Scope scope(scriptState); - Document* document = toDocument(scriptState->executionContext()); + Document* document = toDocument(scriptState->getExecutionContext()); ASSERT(document); LocalFrame* frame = document->frame(); // Should the document have been detached, the page is assumed being destroyed (=> no reset required.) diff --git a/third_party/WebKit/Source/core/timing/Performance.cpp b/third_party/WebKit/Source/core/timing/Performance.cpp index 683c9c7..8b236f6 100644 --- a/third_party/WebKit/Source/core/timing/Performance.cpp +++ b/third_party/WebKit/Source/core/timing/Performance.cpp @@ -64,7 +64,7 @@ Performance::~Performance() { } -ExecutionContext* Performance::executionContext() const +ExecutionContext* Performance::getExecutionContext() const { if (!frame()) return nullptr; diff --git a/third_party/WebKit/Source/core/timing/Performance.h b/third_party/WebKit/Source/core/timing/Performance.h index 92c9ca1..42681246 100644 --- a/third_party/WebKit/Source/core/timing/Performance.h +++ b/third_party/WebKit/Source/core/timing/Performance.h @@ -51,7 +51,7 @@ public: } ~Performance() override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; MemoryInfo* memory(); PerformanceNavigation* navigation() const; diff --git a/third_party/WebKit/Source/core/timing/PerformanceBase.cpp b/third_party/WebKit/Source/core/timing/PerformanceBase.cpp index 9923bc0..2028b93 100644 --- a/third_party/WebKit/Source/core/timing/PerformanceBase.cpp +++ b/third_party/WebKit/Source/core/timing/PerformanceBase.cpp @@ -227,8 +227,8 @@ void PerformanceBase::addResourceTiming(const ResourceTimingInfo& info) if (isResourceTimingBufferFull() && !hasObserverFor(PerformanceEntry::Resource)) return; SecurityOrigin* securityOrigin = nullptr; - if (ExecutionContext* context = executionContext()) - securityOrigin = context->securityOrigin(); + if (ExecutionContext* context = getExecutionContext()) + securityOrigin = context->getSecurityOrigin(); if (!securityOrigin) return; diff --git a/third_party/WebKit/Source/core/timing/PerformanceObserver.cpp b/third_party/WebKit/Source/core/timing/PerformanceObserver.cpp index bd5e7b3..e7b8e1e 100644 --- a/third_party/WebKit/Source/core/timing/PerformanceObserver.cpp +++ b/third_party/WebKit/Source/core/timing/PerformanceObserver.cpp @@ -79,7 +79,7 @@ void PerformanceObserver::enqueuePerformanceEntry(PerformanceEntry& entry) bool PerformanceObserver::shouldBeSuspended() const { - return m_callback->executionContext() && m_callback->executionContext()->activeDOMObjectsAreSuspended(); + return m_callback->getExecutionContext() && m_callback->getExecutionContext()->activeDOMObjectsAreSuspended(); } void PerformanceObserver::deliver() diff --git a/third_party/WebKit/Source/core/timing/PerformanceObserverCallback.h b/third_party/WebKit/Source/core/timing/PerformanceObserverCallback.h index 7f44590..02190b6 100644 --- a/third_party/WebKit/Source/core/timing/PerformanceObserverCallback.h +++ b/third_party/WebKit/Source/core/timing/PerformanceObserverCallback.h @@ -19,7 +19,7 @@ public: virtual ~PerformanceObserverCallback() { } virtual void handleEvent(PerformanceObserverEntryList*, PerformanceObserver*) = 0; - virtual ExecutionContext* executionContext() const = 0; + virtual ExecutionContext* getExecutionContext() const = 0; DEFINE_INLINE_VIRTUAL_TRACE() { } }; diff --git a/third_party/WebKit/Source/core/timing/WorkerPerformance.cpp b/third_party/WebKit/Source/core/timing/WorkerPerformance.cpp index 54ae42a..a546eb0 100644 --- a/third_party/WebKit/Source/core/timing/WorkerPerformance.cpp +++ b/third_party/WebKit/Source/core/timing/WorkerPerformance.cpp @@ -43,9 +43,9 @@ WorkerPerformance::WorkerPerformance(WorkerGlobalScope* context) { } -ExecutionContext* WorkerPerformance::executionContext() const +ExecutionContext* WorkerPerformance::getExecutionContext() const { - return ContextLifecycleObserver::executionContext(); + return ContextLifecycleObserver::getExecutionContext(); } DEFINE_TRACE(WorkerPerformance) diff --git a/third_party/WebKit/Source/core/timing/WorkerPerformance.h b/third_party/WebKit/Source/core/timing/WorkerPerformance.h index b041078..c62e55b 100644 --- a/third_party/WebKit/Source/core/timing/WorkerPerformance.h +++ b/third_party/WebKit/Source/core/timing/WorkerPerformance.h @@ -52,7 +52,7 @@ public: return new WorkerPerformance(context); } - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; MemoryInfo* memory(); diff --git a/third_party/WebKit/Source/core/workers/AbstractWorker.cpp b/third_party/WebKit/Source/core/workers/AbstractWorker.cpp index f60bda9..fc94b81 100644 --- a/third_party/WebKit/Source/core/workers/AbstractWorker.cpp +++ b/third_party/WebKit/Source/core/workers/AbstractWorker.cpp @@ -50,19 +50,19 @@ AbstractWorker::~AbstractWorker() KURL AbstractWorker::resolveURL(const String& url, ExceptionState& exceptionState) { // FIXME: This should use the dynamic global scope (bug #27887) - KURL scriptURL = executionContext()->completeURL(url); + KURL scriptURL = getExecutionContext()->completeURL(url); if (!scriptURL.isValid()) { exceptionState.throwDOMException(SyntaxError, "'" + url + "' is not a valid URL."); return KURL(); } // We can safely expose the URL in the following exceptions, as these checks happen synchronously before redirection. JavaScript receives no new information. - if (!executionContext()->securityOrigin()->canRequestNoSuborigin(scriptURL)) { - exceptionState.throwSecurityError("Script at '" + scriptURL.elidedString() + "' cannot be accessed from origin '" + executionContext()->securityOrigin()->toString() + "'."); + if (!getExecutionContext()->getSecurityOrigin()->canRequestNoSuborigin(scriptURL)) { + exceptionState.throwSecurityError("Script at '" + scriptURL.elidedString() + "' cannot be accessed from origin '" + getExecutionContext()->getSecurityOrigin()->toString() + "'."); return KURL(); } - if (executionContext()->contentSecurityPolicy() && !executionContext()->contentSecurityPolicy()->allowWorkerContextFromSource(scriptURL)) { + if (getExecutionContext()->contentSecurityPolicy() && !getExecutionContext()->contentSecurityPolicy()->allowWorkerContextFromSource(scriptURL)) { exceptionState.throwSecurityError("Access to the script at '" + scriptURL.elidedString() + "' is denied by the document's Content Security Policy."); return KURL(); } diff --git a/third_party/WebKit/Source/core/workers/AbstractWorker.h b/third_party/WebKit/Source/core/workers/AbstractWorker.h index d092c94..a90cb60 100644 --- a/third_party/WebKit/Source/core/workers/AbstractWorker.h +++ b/third_party/WebKit/Source/core/workers/AbstractWorker.h @@ -50,7 +50,7 @@ class CORE_EXPORT AbstractWorker : public RefCountedGarbageCollectedEventTargetW WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(AbstractWorker); public: // EventTarget APIs - ExecutionContext* executionContext() const final { return ActiveDOMObject::executionContext(); } + ExecutionContext* getExecutionContext() const final { return ActiveDOMObject::getExecutionContext(); } DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(error); diff --git a/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp b/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp index 2185d87..0c46c5e 100644 --- a/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp +++ b/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp @@ -90,7 +90,7 @@ ContentSecurityPolicy* InProcessWorkerBase::contentSecurityPolicy() void InProcessWorkerBase::onResponse() { - InspectorInstrumentation::didReceiveScriptResponse(executionContext(), m_scriptLoader->identifier()); + InspectorInstrumentation::didReceiveScriptResponse(getExecutionContext(), m_scriptLoader->identifier()); } void InProcessWorkerBase::onFinished() @@ -99,8 +99,8 @@ void InProcessWorkerBase::onFinished() dispatchEvent(Event::createCancelable(EventTypeNames::error)); } else { ASSERT(m_contextProxy); - m_contextProxy->startWorkerGlobalScope(m_scriptLoader->url(), executionContext()->userAgent(), m_scriptLoader->script()); - InspectorInstrumentation::scriptImported(executionContext(), m_scriptLoader->identifier(), m_scriptLoader->script()); + m_contextProxy->startWorkerGlobalScope(m_scriptLoader->url(), getExecutionContext()->userAgent(), m_scriptLoader->script()); + InspectorInstrumentation::scriptImported(getExecutionContext(), m_scriptLoader->identifier(), m_scriptLoader->script()); } m_contentSecurityPolicy = m_scriptLoader->releaseContentSecurityPolicy(); m_scriptLoader = nullptr; diff --git a/third_party/WebKit/Source/core/workers/SharedWorker.cpp b/third_party/WebKit/Source/core/workers/SharedWorker.cpp index 3f089e8..12da7b9 100644 --- a/third_party/WebKit/Source/core/workers/SharedWorker.cpp +++ b/third_party/WebKit/Source/core/workers/SharedWorker.cpp @@ -71,8 +71,8 @@ SharedWorker* SharedWorker::create(ExecutionContext* context, const String& url, // We don't currently support nested workers, so workers can only be created from documents. Document* document = toDocument(context); - if (!document->securityOrigin()->canAccessSharedWorkers()) { - exceptionState.throwSecurityError("Access to shared workers is denied to origin '" + document->securityOrigin()->toString() + "'."); + if (!document->getSecurityOrigin()->canAccessSharedWorkers()) { + exceptionState.throwSecurityError("Access to shared workers is denied to origin '" + document->getSecurityOrigin()->toString() + "'."); return nullptr; } diff --git a/third_party/WebKit/Source/core/workers/WorkerConsole.cpp b/third_party/WebKit/Source/core/workers/WorkerConsole.cpp index 00f2f11..33f96f7 100644 --- a/third_party/WebKit/Source/core/workers/WorkerConsole.cpp +++ b/third_party/WebKit/Source/core/workers/WorkerConsole.cpp @@ -55,7 +55,7 @@ ExecutionContext* WorkerConsole::context() { if (!m_scope) return nullptr; - return m_scope->executionContext(); + return m_scope->getExecutionContext(); } DEFINE_TRACE(WorkerConsole) diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp index d25af6e..2c5aa68 100644 --- a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp +++ b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp @@ -88,7 +88,7 @@ WorkerGlobalScope::WorkerGlobalScope(const KURL& url, const String& userAgent, W { setSecurityOrigin(SecurityOrigin::create(url)); if (starterOriginPrivilageData) - securityOrigin()->transferPrivilegesFrom(starterOriginPrivilageData); + getSecurityOrigin()->transferPrivilegesFrom(starterOriginPrivilageData); if (m_workerClients) m_workerClients->reattachThread(); @@ -108,10 +108,10 @@ void WorkerGlobalScope::applyContentSecurityPolicyFromVector(const Vector<CSPHea } for (const auto& policyAndType : headers) contentSecurityPolicy()->didReceiveHeader(policyAndType.first, policyAndType.second, ContentSecurityPolicyHeaderSourceHTTP); - contentSecurityPolicy()->bindToExecutionContext(executionContext()); + contentSecurityPolicy()->bindToExecutionContext(getExecutionContext()); } -ExecutionContext* WorkerGlobalScope::executionContext() const +ExecutionContext* WorkerGlobalScope::getExecutionContext() const { return const_cast<WorkerGlobalScope*>(this); } @@ -233,9 +233,9 @@ void WorkerGlobalScope::didEvaluateWorkerScript() void WorkerGlobalScope::importScripts(const Vector<String>& urls, ExceptionState& exceptionState) { ASSERT(contentSecurityPolicy()); - ASSERT(executionContext()); + ASSERT(getExecutionContext()); - ExecutionContext& executionContext = *this->executionContext(); + ExecutionContext& executionContext = *this->getExecutionContext(); Vector<KURL> completedURLs; for (const String& urlString : urls) { @@ -320,7 +320,7 @@ bool WorkerGlobalScope::isJSExecutionForbidden() const return m_scriptController->isExecutionForbidden(); } -WorkerEventQueue* WorkerGlobalScope::eventQueue() const +WorkerEventQueue* WorkerGlobalScope::getEventQueue() const { return m_eventQueue.get(); } @@ -353,8 +353,8 @@ void WorkerGlobalScope::countDeprecation(UseCounter::Feature feature) const if (!m_deprecationWarningBits.hasRecordedMeasurement(feature)) { m_deprecationWarningBits.recordMeasurement(feature); ASSERT(!Deprecation::deprecationMessage(feature).isEmpty()); - ASSERT(executionContext()); - executionContext()->addConsoleMessage(ConsoleMessage::create(DeprecationMessageSource, WarningMessageLevel, Deprecation::deprecationMessage(feature))); + ASSERT(getExecutionContext()); + getExecutionContext()->addConsoleMessage(ConsoleMessage::create(DeprecationMessageSource, WarningMessageLevel, Deprecation::deprecationMessage(feature))); } } @@ -378,9 +378,9 @@ bool WorkerGlobalScope::isSecureContext(String& errorMessage, const SecureContex // |isSecureContext| check here, we can check the responsible // document for a privileged context at worker creation time, pass // it in via WorkerThreadStartupData, and check it here. - if (securityOrigin()->isPotentiallyTrustworthy()) + if (getSecurityOrigin()->isPotentiallyTrustworthy()) return true; - errorMessage = securityOrigin()->isPotentiallyTrustworthyErrorMessage(); + errorMessage = getSecurityOrigin()->isPotentiallyTrustworthyErrorMessage(); return false; } diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h index e5a2dba..5816921 100644 --- a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h +++ b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h @@ -73,8 +73,8 @@ public: bool isWorkerGlobalScope() const final { return true; } - ExecutionContext* executionContext() const final; - ScriptWrappable* scriptWrappable() const final + ExecutionContext* getExecutionContext() const final; + ScriptWrappable* getScriptWrappable() const final { return const_cast<WorkerGlobalScope*>(this); } @@ -119,7 +119,7 @@ public: v8::Local<v8::Object> associateWithWrapper(v8::Isolate*, const WrapperTypeInfo*, v8::Local<v8::Object> wrapper) final; // ExecutionContext - WorkerEventQueue* eventQueue() const final; + WorkerEventQueue* getEventQueue() const final; SecurityContext& securityContext() final { return *this; } bool isContextThread() const final; @@ -135,7 +135,7 @@ public: WorkerClients* clients() { return m_workerClients.get(); } - using SecurityContext::securityOrigin; + using SecurityContext::getSecurityOrigin; using SecurityContext::contentSecurityPolicy; void addConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) final; diff --git a/third_party/WebKit/Source/core/workers/WorkerMessagingProxy.cpp b/third_party/WebKit/Source/core/workers/WorkerMessagingProxy.cpp index 21d5c66..a246e1b 100644 --- a/third_party/WebKit/Source/core/workers/WorkerMessagingProxy.cpp +++ b/third_party/WebKit/Source/core/workers/WorkerMessagingProxy.cpp @@ -73,7 +73,7 @@ void processMessageOnWorkerGlobalScope(PassRefPtr<SerializedScriptValue> message } // namespace WorkerMessagingProxy::WorkerMessagingProxy(InProcessWorkerBase* workerObject, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients) - : m_executionContext(workerObject->executionContext()) + : m_executionContext(workerObject->getExecutionContext()) , m_workerObjectProxy(WorkerObjectProxy::create(this)) , m_workerObject(workerObject) , m_mayBeDestroyed(false) @@ -108,7 +108,7 @@ void WorkerMessagingProxy::startWorkerGlobalScope(const KURL& scriptURL, const S return; } Document* document = toDocument(m_executionContext.get()); - SecurityOrigin* starterOrigin = document->securityOrigin(); + SecurityOrigin* starterOrigin = document->getSecurityOrigin(); ContentSecurityPolicy* csp = m_workerObject->contentSecurityPolicy() ? m_workerObject->contentSecurityPolicy() : document->contentSecurityPolicy(); ASSERT(csp); diff --git a/third_party/WebKit/Source/core/workers/WorkerMessagingProxy.h b/third_party/WebKit/Source/core/workers/WorkerMessagingProxy.h index aac6138..6367fc2 100644 --- a/third_party/WebKit/Source/core/workers/WorkerMessagingProxy.h +++ b/third_party/WebKit/Source/core/workers/WorkerMessagingProxy.h @@ -74,7 +74,7 @@ public: void workerThreadTerminated(); void workerThreadCreated(); - ExecutionContext* executionContext() const { return m_executionContext.get(); } + ExecutionContext* getExecutionContext() const { return m_executionContext.get(); } protected: WorkerMessagingProxy(InProcessWorkerBase*, PassOwnPtrWillBeRawPtr<WorkerClients>); diff --git a/third_party/WebKit/Source/core/workers/WorkerObjectProxy.cpp b/third_party/WebKit/Source/core/workers/WorkerObjectProxy.cpp index 7fb674d..0bd3b33 100644 --- a/third_party/WebKit/Source/core/workers/WorkerObjectProxy.cpp +++ b/third_party/WebKit/Source/core/workers/WorkerObjectProxy.cpp @@ -49,57 +49,57 @@ PassOwnPtr<WorkerObjectProxy> WorkerObjectProxy::create(WorkerMessagingProxy* me void WorkerObjectProxy::postMessageToWorkerObject(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels) { - executionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::postMessageToWorkerObject, m_messagingProxy, message, channels)); + getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::postMessageToWorkerObject, m_messagingProxy, message, channels)); } void WorkerObjectProxy::postTaskToMainExecutionContext(PassOwnPtr<ExecutionContextTask> task) { - executionContext()->postTask(BLINK_FROM_HERE, task); + getExecutionContext()->postTask(BLINK_FROM_HERE, task); } void WorkerObjectProxy::confirmMessageFromWorkerObject(bool hasPendingActivity) { - executionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::confirmMessageFromWorkerObject, m_messagingProxy, hasPendingActivity)); + getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::confirmMessageFromWorkerObject, m_messagingProxy, hasPendingActivity)); } void WorkerObjectProxy::reportPendingActivity(bool hasPendingActivity) { - executionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::reportPendingActivity, m_messagingProxy, hasPendingActivity)); + getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::reportPendingActivity, m_messagingProxy, hasPendingActivity)); } void WorkerObjectProxy::reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, int exceptionId) { - executionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::reportException, m_messagingProxy, errorMessage, lineNumber, columnNumber, sourceURL, exceptionId)); + getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::reportException, m_messagingProxy, errorMessage, lineNumber, columnNumber, sourceURL, exceptionId)); } void WorkerObjectProxy::reportConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage> consoleMessage) { - executionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::reportConsoleMessage, m_messagingProxy, consoleMessage->source(), consoleMessage->level(), consoleMessage->message(), consoleMessage->lineNumber(), consoleMessage->url())); + getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::reportConsoleMessage, m_messagingProxy, consoleMessage->source(), consoleMessage->level(), consoleMessage->message(), consoleMessage->lineNumber(), consoleMessage->url())); } void WorkerObjectProxy::postMessageToPageInspector(const String& message) { - ExecutionContext* context = executionContext(); + ExecutionContext* context = getExecutionContext(); if (context->isDocument()) toDocument(context)->postInspectorTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::postMessageToPageInspector, m_messagingProxy, message)); } void WorkerObjectProxy::postWorkerConsoleAgentEnabled() { - ExecutionContext* context = executionContext(); + ExecutionContext* context = getExecutionContext(); if (context->isDocument()) toDocument(context)->postInspectorTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::postWorkerConsoleAgentEnabled, m_messagingProxy)); } void WorkerObjectProxy::workerGlobalScopeClosed() { - executionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::terminateWorkerGlobalScope, m_messagingProxy)); + getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::terminateWorkerGlobalScope, m_messagingProxy)); } void WorkerObjectProxy::workerThreadTerminated() { // This will terminate the MessagingProxy. - executionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::workerThreadTerminated, m_messagingProxy)); + getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::workerThreadTerminated, m_messagingProxy)); } WorkerObjectProxy::WorkerObjectProxy(WorkerMessagingProxy* messagingProxy) @@ -107,10 +107,10 @@ WorkerObjectProxy::WorkerObjectProxy(WorkerMessagingProxy* messagingProxy) { } -ExecutionContext* WorkerObjectProxy::executionContext() +ExecutionContext* WorkerObjectProxy::getExecutionContext() { ASSERT(m_messagingProxy); - return m_messagingProxy->executionContext(); + return m_messagingProxy->getExecutionContext(); } } // namespace blink diff --git a/third_party/WebKit/Source/core/workers/WorkerObjectProxy.h b/third_party/WebKit/Source/core/workers/WorkerObjectProxy.h index aac3d97..c1a60c7 100644 --- a/third_party/WebKit/Source/core/workers/WorkerObjectProxy.h +++ b/third_party/WebKit/Source/core/workers/WorkerObjectProxy.h @@ -76,7 +76,7 @@ public: protected: WorkerObjectProxy(WorkerMessagingProxy*); - virtual ExecutionContext* executionContext(); + virtual ExecutionContext* getExecutionContext(); private: // This object always outlives this proxy. diff --git a/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h b/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h index 3c369eb..86cbdb1 100644 --- a/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h +++ b/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h @@ -15,7 +15,7 @@ class WorkerOrWorkletScriptController; class CORE_EXPORT WorkerOrWorkletGlobalScope : public ExecutionContext { public: - virtual ScriptWrappable* scriptWrappable() const = 0; + virtual ScriptWrappable* getScriptWrappable() const = 0; virtual WorkerOrWorkletScriptController* scriptController() = 0; }; diff --git a/third_party/WebKit/Source/core/xml/DocumentXSLT.cpp b/third_party/WebKit/Source/core/xml/DocumentXSLT.cpp index d5d6ee6..54d5c60 100644 --- a/third_party/WebKit/Source/core/xml/DocumentXSLT.cpp +++ b/third_party/WebKit/Source/core/xml/DocumentXSLT.cpp @@ -44,7 +44,7 @@ public: ASSERT(event->type() == "DOMContentLoaded"); ScriptState::Scope scope(scriptState); - Document& document = *toDocument(scriptState->executionContext()); + Document& document = *toDocument(scriptState->getExecutionContext()); ASSERT(!document.parsing()); // Processing instruction (XML documents only). diff --git a/third_party/WebKit/Source/core/xml/XSLTProcessor.cpp b/third_party/WebKit/Source/core/xml/XSLTProcessor.cpp index 436c690..774add4 100644 --- a/third_party/WebKit/Source/core/xml/XSLTProcessor.cpp +++ b/third_party/WebKit/Source/core/xml/XSLTProcessor.cpp @@ -88,7 +88,7 @@ PassRefPtrWillBeRawPtr<Document> XSLTProcessor::createDocumentFromSource(const S if (oldDocument) { DocumentXSLT::from(*result).setTransformSourceDocument(oldDocument.get()); - result->updateSecurityOrigin(oldDocument->securityOrigin()); + result->updateSecurityOrigin(oldDocument->getSecurityOrigin()); result->setCookieURL(oldDocument->cookieURL()); RefPtrWillBeRawPtr<ContentSecurityPolicy> csp = ContentSecurityPolicy::create(); diff --git a/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp b/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp index 40ef1fc..9f79b05 100644 --- a/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp +++ b/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp @@ -646,7 +646,7 @@ static bool shouldAllowExternalLoad(const KURL& url) // content. If we had more context, we could potentially allow the parser to // load a DTD. As things stand, we take the conservative route and allow // same-origin requests only. - if (!XMLDocumentParserScope::currentDocument->securityOrigin()->canRequest(url)) { + if (!XMLDocumentParserScope::currentDocument->getSecurityOrigin()->canRequest(url)) { // FIXME: This is copy/pasted. We should probably build console logging into canRequest(). if (!url.isNull()) { String message = "Unsafe attempt to load URL " + url.elidedString() + diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp index 518397a..b70d02b 100644 --- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp +++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp @@ -175,7 +175,7 @@ private: : m_xhr(xhr) , m_loader(FileReaderLoader::ReadByClient, this) { - m_loader.start(m_xhr->executionContext(), handle); + m_loader.start(m_xhr->getExecutionContext(), handle); } Member<XMLHttpRequest> m_xhr; @@ -184,7 +184,7 @@ private: XMLHttpRequest* XMLHttpRequest::create(ScriptState* scriptState) { - ExecutionContext* context = scriptState->executionContext(); + ExecutionContext* context = scriptState->getExecutionContext(); DOMWrapperWorld& world = scriptState->world(); RefPtr<SecurityOrigin> isolatedWorldSecurityOrigin = world.isIsolatedWorld() ? world.isolatedWorldSecurityOrigin() : nullptr; XMLHttpRequest* xmlHttpRequest = new XMLHttpRequest(context, isolatedWorldSecurityOrigin); @@ -235,13 +235,13 @@ XMLHttpRequest::~XMLHttpRequest() Document* XMLHttpRequest::document() const { - ASSERT(executionContext()->isDocument()); - return toDocument(executionContext()); + ASSERT(getExecutionContext()->isDocument()); + return toDocument(getExecutionContext()); } -SecurityOrigin* XMLHttpRequest::securityOrigin() const +SecurityOrigin* XMLHttpRequest::getSecurityOrigin() const { - return m_isolatedWorldSecurityOrigin ? m_isolatedWorldSecurityOrigin.get() : executionContext()->securityOrigin(); + return m_isolatedWorldSecurityOrigin ? m_isolatedWorldSecurityOrigin.get() : getExecutionContext()->getSecurityOrigin(); } XMLHttpRequest::State XMLHttpRequest::readyState() const @@ -276,7 +276,7 @@ void XMLHttpRequest::initResponseDocument() bool isHTML = responseIsHTML(); if ((m_response.isHTTP() && !responseIsXML() && !isHTML) || (isHTML && m_responseTypeCode == ResponseTypeDefault) - || executionContext()->isWorkerGlobalScope()) { + || getExecutionContext()->isWorkerGlobalScope()) { m_responseDocument = nullptr; return; } @@ -288,7 +288,7 @@ void XMLHttpRequest::initResponseDocument() m_responseDocument = XMLDocument::create(init); // FIXME: Set Last-Modified. - m_responseDocument->setSecurityOrigin(securityOrigin()); + m_responseDocument->setSecurityOrigin(getSecurityOrigin()); m_responseDocument->setContextFeatures(document()->contextFeatures()); m_responseDocument->setMimeType(finalResponseMIMETypeWithFallback()); } @@ -391,7 +391,7 @@ void XMLHttpRequest::setTimeout(unsigned timeout, ExceptionState& exceptionState { // FIXME: Need to trigger or update the timeout Timer here, if needed. http://webkit.org/b/98156 // XHR2 spec, 4.7.3. "This implies that the timeout attribute can be set while fetching is in progress. If that occurs it will still be measured relative to the start of fetching." - if (executionContext()->isDocument() && !m_async) { + if (getExecutionContext()->isDocument() && !m_async) { exceptionState.throwDOMException(InvalidAccessError, "Timeouts cannot be set for synchronous requests made from a document."); return; } @@ -416,7 +416,7 @@ void XMLHttpRequest::setResponseType(const String& responseType, ExceptionState& // Newer functionality is not available to synchronous requests in window contexts, as a spec-mandated // attempt to discourage synchronous XHR use. responseType is one such piece of functionality. - if (!m_async && executionContext()->isDocument()) { + if (!m_async && getExecutionContext()->isDocument()) { exceptionState.throwDOMException(InvalidAccessError, "The response type cannot be changed for synchronous requests made from a document."); return; } @@ -500,12 +500,12 @@ void XMLHttpRequest::changeState(State newState) void XMLHttpRequest::dispatchReadyStateChangeEvent() { - if (!executionContext()) + if (!getExecutionContext()) return; ScopedEventDispatchProtect protect(&m_eventDispatchRecursionLevel); if (m_async || (m_state <= OPENED || m_state == DONE)) { - TRACE_EVENT1("devtools.timeline", "XHRReadyStateChange", "data", InspectorXhrReadyStateChangeEvent::data(executionContext(), this)); + TRACE_EVENT1("devtools.timeline", "XHRReadyStateChange", "data", InspectorXhrReadyStateChangeEvent::data(getExecutionContext(), this)); XMLHttpRequestProgressEventThrottle::DeferredEventAction action = XMLHttpRequestProgressEventThrottle::Ignore; if (m_state == DONE) { if (m_error) @@ -518,7 +518,7 @@ void XMLHttpRequest::dispatchReadyStateChangeEvent() } if (m_state == DONE && !m_error) { - TRACE_EVENT1("devtools.timeline", "XHRLoad", "data", InspectorXhrLoadEvent::data(executionContext(), this)); + TRACE_EVENT1("devtools.timeline", "XHRLoad", "data", InspectorXhrLoadEvent::data(getExecutionContext(), this)); dispatchProgressEventFromSnapshot(EventTypeNames::load); dispatchProgressEventFromSnapshot(EventTypeNames::loadend); TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "UpdateCounters", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateCountersEvent::data()); @@ -535,19 +535,19 @@ void XMLHttpRequest::setWithCredentials(bool value, ExceptionState& exceptionSta // FIXME: According to XMLHttpRequest Level 2 we should throw InvalidAccessError exception here. // However for time being only print warning message to warn web developers. if (!m_async) - Deprecation::countDeprecation(executionContext(), UseCounter::SyncXHRWithCredentials); + Deprecation::countDeprecation(getExecutionContext(), UseCounter::SyncXHRWithCredentials); m_includeCredentials = value; } void XMLHttpRequest::open(const AtomicString& method, const String& urlString, ExceptionState& exceptionState) { - open(method, executionContext()->completeURL(urlString), true, exceptionState); + open(method, getExecutionContext()->completeURL(urlString), true, exceptionState); } void XMLHttpRequest::open(const AtomicString& method, const String& urlString, bool async, const String& username, const String& password, ExceptionState& exceptionState) { - KURL url(executionContext()->completeURL(urlString)); + KURL url(getExecutionContext()->completeURL(urlString)); if (!username.isNull()) url.setUser(username); if (!password.isNull()) @@ -578,13 +578,13 @@ void XMLHttpRequest::open(const AtomicString& method, const KURL& url, bool asyn return; } - if (!ContentSecurityPolicy::shouldBypassMainWorld(executionContext()) && !executionContext()->contentSecurityPolicy()->allowConnectToSource(url)) { + if (!ContentSecurityPolicy::shouldBypassMainWorld(getExecutionContext()) && !getExecutionContext()->contentSecurityPolicy()->allowConnectToSource(url)) { // We can safely expose the URL to JavaScript, as these checks happen synchronously before redirection. JavaScript receives no new information. exceptionState.throwSecurityError("Refused to connect to '" + url.elidedString() + "' because it violates the document's Content Security Policy."); return; } - if (!async && executionContext()->isDocument()) { + if (!async && getExecutionContext()->isDocument()) { if (document()->settings() && !document()->settings()->syncXHRInDocumentsEnabled()) { exceptionState.throwDOMException(InvalidAccessError, "Synchronous requests are disabled for this page."); return; @@ -608,7 +608,7 @@ void XMLHttpRequest::open(const AtomicString& method, const KURL& url, bool asyn // Refer : https://xhr.spec.whatwg.org/#sync-warning // Use count for XHR synchronous requests on main thread only. if (!document()->processingBeforeUnload()) - Deprecation::countDeprecation(executionContext(), UseCounter::XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload); + Deprecation::countDeprecation(getExecutionContext(), UseCounter::XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload); } m_method = FetchUtils::normalizeMethod(method); @@ -629,7 +629,7 @@ void XMLHttpRequest::open(const AtomicString& method, const KURL& url, bool asyn bool XMLHttpRequest::initSend(ExceptionState& exceptionState) { - if (!executionContext()) + if (!getExecutionContext()) return false; if (m_state != OPENED || m_loader) { @@ -643,7 +643,7 @@ bool XMLHttpRequest::initSend(ExceptionState& exceptionState) void XMLHttpRequest::send(const ArrayBufferOrArrayBufferViewOrBlobOrDocumentOrStringOrFormData& body, ExceptionState& exceptionState) { - InspectorInstrumentation::willSendXMLHttpRequest(executionContext(), url()); + InspectorInstrumentation::willSendXMLHttpRequest(getExecutionContext(), url()); if (body.isNull()) { send(String(), exceptionState); @@ -867,14 +867,14 @@ void XMLHttpRequest::createRequest(PassRefPtr<EncodedFormData> httpBody, Excepti } } - m_sameOriginRequest = securityOrigin()->canRequestNoSuborigin(m_url); + m_sameOriginRequest = getSecurityOrigin()->canRequestNoSuborigin(m_url); // We also remember whether upload events should be allowed for this request in case the upload listeners are // added after the request is started. m_uploadEventsAllowed = m_sameOriginRequest || uploadEvents || !FetchUtils::isSimpleRequest(m_method, m_requestHeaders); - ASSERT(executionContext()); - ExecutionContext& executionContext = *this->executionContext(); + ASSERT(getExecutionContext()); + ExecutionContext& executionContext = *this->getExecutionContext(); ResourceRequest request(m_url); request.setHTTPMethod(m_method); @@ -904,7 +904,7 @@ void XMLHttpRequest::createRequest(PassRefPtr<EncodedFormData> httpBody, Excepti ResourceLoaderOptions resourceLoaderOptions; resourceLoaderOptions.allowCredentials = (m_sameOriginRequest || m_includeCredentials) ? AllowStoredCredentials : DoNotAllowStoredCredentials; resourceLoaderOptions.credentialsRequested = m_includeCredentials ? ClientRequestedCredentials : ClientDidNotRequestCredentials; - resourceLoaderOptions.securityOrigin = securityOrigin(); + resourceLoaderOptions.securityOrigin = getSecurityOrigin(); // When responseType is set to "blob", we redirect the downloaded data to a // file-handle directly. @@ -1072,7 +1072,7 @@ void XMLHttpRequest::dispatchProgressEvent(const AtomicString& type, long long r m_progressEventThrottle->dispatchProgressEvent(type, lengthComputable, loaded, total); if (type == EventTypeNames::loadend) - InspectorInstrumentation::didDispatchXHRLoadendEvent(executionContext(), this); + InspectorInstrumentation::didDispatchXHRLoadendEvent(getExecutionContext(), this); } void XMLHttpRequest::dispatchProgressEventFromSnapshot(const AtomicString& type) @@ -1112,7 +1112,7 @@ void XMLHttpRequest::handleRequestError(ExceptionCode exceptionCode, const Atomi { WTF_LOG(Network, "XMLHttpRequest %p handleRequestError()", this); - InspectorInstrumentation::didFailXHRLoading(executionContext(), this, this, m_method, m_url); + InspectorInstrumentation::didFailXHRLoading(getExecutionContext(), this, this, m_method, m_url); if (!m_async) { ASSERT(exceptionCode); @@ -1171,7 +1171,7 @@ void XMLHttpRequest::setRequestHeader(const AtomicString& name, const AtomicStri // No script (privileged or not) can set unsafe headers. if (FetchUtils::isForbiddenHeaderName(name)) { - logConsoleError(executionContext(), "Refused to set unsafe header \"" + name + "\""); + logConsoleError(getExecutionContext(), "Refused to set unsafe header \"" + name + "\""); return; } @@ -1229,7 +1229,7 @@ String XMLHttpRequest::getAllResponseHeaders() const // // TODO: Consider removing canLoadLocalResources() call. // crbug.com/567527 - if (FetchUtils::isForbiddenResponseHeaderName(it->key) && !securityOrigin()->canLoadLocalResources()) + if (FetchUtils::isForbiddenResponseHeaderName(it->key) && !getSecurityOrigin()->canLoadLocalResources()) continue; if (!m_sameOriginRequest && !isOnAccessControlResponseHeaderWhitelist(it->key) && !accessControlExposeHeaderSet.contains(it->key)) @@ -1252,8 +1252,8 @@ const AtomicString& XMLHttpRequest::getResponseHeader(const AtomicString& name) return nullAtom; // See comment in getAllResponseHeaders above. - if (FetchUtils::isForbiddenResponseHeaderName(name) && !securityOrigin()->canLoadLocalResources()) { - logConsoleError(executionContext(), "Refused to get unsafe header \"" + name + "\""); + if (FetchUtils::isForbiddenResponseHeaderName(name) && !getSecurityOrigin()->canLoadLocalResources()) { + logConsoleError(getExecutionContext(), "Refused to get unsafe header \"" + name + "\""); return nullAtom; } @@ -1261,7 +1261,7 @@ const AtomicString& XMLHttpRequest::getResponseHeader(const AtomicString& name) parseAccessControlExposeHeadersAllowList(m_response.httpHeaderField(HTTPNames::Access_Control_Expose_Headers), accessControlExposeHeaderSet); if (!m_sameOriginRequest && !isOnAccessControlResponseHeaderWhitelist(name) && !accessControlExposeHeaderSet.contains(name)) { - logConsoleError(executionContext(), "Refused to get unsafe header \"" + name + "\""); + logConsoleError(getExecutionContext(), "Refused to get unsafe header \"" + name + "\""); return nullAtom; } return m_response.httpHeaderField(name); @@ -1345,7 +1345,7 @@ void XMLHttpRequest::didFail(const ResourceError& error) // Network failures are already reported to Web Inspector by ResourceLoader. if (error.domain() == errorDomainBlinkInternal) - logConsoleError(executionContext(), "XMLHttpRequest cannot load " + error.failingURL() + ". " + error.localizedDescription()); + logConsoleError(getExecutionContext(), "XMLHttpRequest cannot load " + error.failingURL() + ". " + error.localizedDescription()); handleNetworkError(); // Now the XMLHttpRequest instance may be dead. @@ -1470,14 +1470,14 @@ void XMLHttpRequest::notifyParserStopped() void XMLHttpRequest::endLoading() { - InspectorInstrumentation::didFinishXHRLoading(executionContext(), this, this, m_method, m_url); + InspectorInstrumentation::didFinishXHRLoading(getExecutionContext(), this, this, m_method, m_url); if (m_loader) m_loader = nullptr; changeState(DONE); - if (!executionContext()->isDocument() || !document() || !document()->frame() || !document()->frame()->page()) + if (!getExecutionContext()->isDocument() || !document() || !document()->frame() || !document()->frame()->page()) return; if (status() >= 200 && status() < 300) { @@ -1598,7 +1598,7 @@ void XMLHttpRequest::didReceiveData(const char* data, unsigned len) m_binaryResponseBuilder->append(data, len); } else if (m_responseTypeCode == ResponseTypeLegacyStream) { if (!m_responseLegacyStream) - m_responseLegacyStream = Stream::create(executionContext(), responseType()); + m_responseLegacyStream = Stream::create(getExecutionContext(), responseType()); m_responseLegacyStream->addData(data, len); } @@ -1660,7 +1660,7 @@ void XMLHttpRequest::resume() void XMLHttpRequest::stop() { - InspectorInstrumentation::didFailXHRLoading(executionContext(), this, this, m_method, m_url); + InspectorInstrumentation::didFailXHRLoading(getExecutionContext(), this, this, m_method, m_url); m_progressEventThrottle->stop(); internalAbort(); } @@ -1689,9 +1689,9 @@ const AtomicString& XMLHttpRequest::interfaceName() const return EventTargetNames::XMLHttpRequest; } -ExecutionContext* XMLHttpRequest::executionContext() const +ExecutionContext* XMLHttpRequest::getExecutionContext() const { - return ActiveDOMObject::executionContext(); + return ActiveDOMObject::getExecutionContext(); } DEFINE_TRACE(XMLHttpRequest) diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h index 38c7f46..c592a29 100644 --- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h +++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h @@ -95,7 +95,7 @@ public: // ActiveDOMObject void contextDestroyed() override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; bool hasPendingActivity() const override; void suspend() override; void resume() override; @@ -153,7 +153,7 @@ private: XMLHttpRequest(ExecutionContext*, PassRefPtr<SecurityOrigin>); Document* document() const; - SecurityOrigin* securityOrigin() const; + SecurityOrigin* getSecurityOrigin() const; void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) override; void didReceiveResponse(unsigned long identifier, const ResourceResponse&, PassOwnPtr<WebDataConsumerHandle>) override; diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.cpp b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.cpp index 44dc4fa..ff5a02e 100644 --- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.cpp +++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.cpp @@ -127,7 +127,7 @@ void XMLHttpRequestProgressEventThrottle::dispatchProgressProgressEvent(PassRefP { XMLHttpRequest::State state = m_target->readyState(); if (m_target->readyState() == XMLHttpRequest::LOADING && m_hasDispatchedProgressProgressEvent) { - TRACE_EVENT1("devtools.timeline", "XHRReadyStateChange", "data", InspectorXhrReadyStateChangeEvent::data(m_target->executionContext(), m_target)); + TRACE_EVENT1("devtools.timeline", "XHRReadyStateChange", "data", InspectorXhrReadyStateChangeEvent::data(m_target->getExecutionContext(), m_target)); m_target->dispatchEvent(Event::create(EventTypeNames::readystatechange)); TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "UpdateCounters", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateCountersEvent::data()); } diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestUpload.cpp b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestUpload.cpp index 1d04877..07cd817 100644 --- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestUpload.cpp +++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestUpload.cpp @@ -44,9 +44,9 @@ const AtomicString& XMLHttpRequestUpload::interfaceName() const return EventTargetNames::XMLHttpRequestUpload; } -ExecutionContext* XMLHttpRequestUpload::executionContext() const +ExecutionContext* XMLHttpRequestUpload::getExecutionContext() const { - return m_xmlHttpRequest->executionContext(); + return m_xmlHttpRequest->getExecutionContext(); } void XMLHttpRequestUpload::dispatchProgressEvent(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestUpload.h b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestUpload.h index 2d0adb5..3d30862 100644 --- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestUpload.h +++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestUpload.h @@ -50,7 +50,7 @@ public: XMLHttpRequest* xmlHttpRequest() const { return m_xmlHttpRequest; } const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; void dispatchEventAndLoadEnd(const AtomicString&, bool, unsigned long long, unsigned long long); void dispatchProgressEvent(unsigned long long, unsigned long long); diff --git a/third_party/WebKit/Source/modules/accessibility/AXImageMapLink.cpp b/third_party/WebKit/Source/modules/accessibility/AXImageMapLink.cpp index daee556..0a9ceba 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXImageMapLink.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXImageMapLink.cpp @@ -91,7 +91,7 @@ Element* AXImageMapLink::actionElement() const Element* AXImageMapLink::anchorElement() const { - return node() ? toElement(node()) : nullptr; + return getNode() ? toElement(getNode()) : nullptr; } KURL AXImageMapLink::url() const @@ -111,7 +111,7 @@ LayoutRect AXImageMapLink::elementRect() const LayoutObject* layoutObject; if (m_parent && m_parent->isAXLayoutObject()) - layoutObject = toAXLayoutObject(m_parent)->layoutObject(); + layoutObject = toAXLayoutObject(m_parent)->getLayoutObject(); else layoutObject = map->layoutObject(); diff --git a/third_party/WebKit/Source/modules/accessibility/AXImageMapLink.h b/third_party/WebKit/Source/modules/accessibility/AXImageMapLink.h index b4c0f7b..95e1ffa 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXImageMapLink.h +++ b/third_party/WebKit/Source/modules/accessibility/AXImageMapLink.h @@ -47,7 +47,7 @@ public: ~AXImageMapLink() override; DECLARE_VIRTUAL_TRACE(); - HTMLAreaElement* areaElement() const { return toHTMLAreaElement(node()); } + HTMLAreaElement* areaElement() const { return toHTMLAreaElement(getNode()); } HTMLMapElement* mapElement() const; diff --git a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp index 699c13c..37efbf4 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp @@ -218,7 +218,7 @@ LayoutRect AXLayoutObject::elementRect() const return m_cachedElementRect; } -LayoutBoxModelObject* AXLayoutObject::layoutBoxModelObject() const +LayoutBoxModelObject* AXLayoutObject::getLayoutBoxModelObject() const { if (!m_layoutObject || !m_layoutObject->isBoxModelObject()) return 0; @@ -264,7 +264,7 @@ static bool isImageOrAltText(LayoutBoxModelObject* box, Node* node) AccessibilityRole AXLayoutObject::nativeAccessibilityRoleIgnoringAria() const { Node* node = m_layoutObject->node(); - LayoutBoxModelObject* cssBox = layoutBoxModelObject(); + LayoutBoxModelObject* cssBox = getLayoutBoxModelObject(); if ((cssBox && cssBox->isListItem()) || isHTMLLIElement(node)) return ListItemRole; @@ -351,26 +351,26 @@ void AXLayoutObject::detach() static bool isLinkable(const AXObject& object) { - if (!object.layoutObject()) + if (!object.getLayoutObject()) return false; // See https://wiki.mozilla.org/Accessibility/AT-Windows-API for the elements // Mozilla considers linkable. - return object.isLink() || object.isImage() || object.layoutObject()->isText(); + return object.isLink() || object.isImage() || object.getLayoutObject()->isText(); } // Requires layoutObject to be present because it relies on style // user-modify. Don't move this logic to AXNodeObject. bool AXLayoutObject::isEditable() const { - if (layoutObject() && layoutObject()->isTextControl()) + if (getLayoutObject() && getLayoutObject()->isTextControl()) return true; - if (node() && node()->isContentEditable()) + if (getNode() && getNode()->isContentEditable()) return true; if (isWebArea()) { - Document& document = layoutObject()->document(); + Document& document = getLayoutObject()->document(); HTMLElement* body = document.body(); if (body && body->isContentEditable()) return true; @@ -388,7 +388,7 @@ bool AXLayoutObject::isRichlyEditable() const if (isARIATextControl()) return false; - if (node() && node()->isContentRichlyEditable()) + if (getNode() && getNode()->isContentRichlyEditable()) return true; if (isWebArea()) { @@ -581,7 +581,7 @@ bool AXLayoutObject::computeAccessibilityIsIgnored(IgnoredReasons* ignoredReason if (controlObject && controlObject->isCheckboxOrRadio() && controlObject->nameFromLabelElement()) { if (ignoredReasons) { HTMLLabelElement* label = labelElementContainer(); - if (label && label != node()) { + if (label && label != getNode()) { AXObject* labelAXObject = axObjectCache().getOrCreate(label); ignoredReasons->append(IgnoredReason(AXLabelContainer, labelAXObject)); } @@ -987,7 +987,7 @@ KURL AXLayoutObject::url() const void AXLayoutObject::loadInlineTextBoxes() { - if (!layoutObject() || !layoutObject()->isText()) + if (!getLayoutObject() || !getLayoutObject()->isText()) return; clearChildren(); @@ -1086,7 +1086,7 @@ String AXLayoutObject::stringValue() const if (!m_layoutObject) return String(); - LayoutBoxModelObject* cssBox = layoutBoxModelObject(); + LayoutBoxModelObject* cssBox = getLayoutBoxModelObject(); if (cssBox && cssBox->isMenuList()) { // LayoutMenuList will go straight to the text() of its selected item. @@ -1119,8 +1119,8 @@ String AXLayoutObject::stringValue() const // Handle other HTML input elements that aren't text controls, like date and time // controls, by returning the string value, with the exception of checkboxes // and radio buttons (which would return "on"). - if (node() && isHTMLInputElement(node())) { - HTMLInputElement* input = toHTMLInputElement(node()); + if (getNode() && isHTMLInputElement(getNode())) { + HTMLInputElement* input = toHTMLInputElement(getNode()); if (input->type() != InputTypeNames::checkbox && input->type() != InputTypeNames::radio) return input->value(); } @@ -1726,12 +1726,12 @@ double AXLayoutObject::estimatedLoadingProgress() const // DOM and layout tree access. // -Node* AXLayoutObject::node() const +Node* AXLayoutObject::getNode() const { return m_layoutObject ? m_layoutObject->node() : 0; } -Document* AXLayoutObject::document() const +Document* AXLayoutObject::getDocument() const { if (!m_layoutObject) return 0; @@ -1789,10 +1789,10 @@ AXObject::AXRange AXLayoutObject::selection() const if (textSelection.isValid()) return textSelection; - if (!layoutObject() || !layoutObject()->frame()) + if (!getLayoutObject() || !getLayoutObject()->frame()) return AXRange(); - VisibleSelection selection = layoutObject()->frame()->selection().selection(); + VisibleSelection selection = getLayoutObject()->frame()->selection().selection(); if (selection.isNone()) return AXRange(); @@ -1855,13 +1855,13 @@ AXObject::AXRange AXLayoutObject::selectionUnderObject() const if (textSelection.isValid()) return textSelection; - if (!node() || !layoutObject()->frame()) + if (!getNode() || !getLayoutObject()->frame()) return AXRange(); - VisibleSelection selection = layoutObject()->frame()->selection().selection(); + VisibleSelection selection = getLayoutObject()->frame()->selection().selection(); RefPtrWillBeRawPtr<Range> selectionRange = firstRangeOf(selection); - ContainerNode* parentNode = node()->parentNode(); - int nodeIndex = node()->nodeIndex(); + ContainerNode* parentNode = getNode()->parentNode(); + int nodeIndex = getNode()->nodeIndex(); if (!selectionRange // Selection is contained in node. || !(parentNode @@ -1880,14 +1880,14 @@ AXObject::AXRange AXLayoutObject::selectionUnderObject() const AXObject::AXRange AXLayoutObject::textControlSelection() const { - if (!layoutObject()) + if (!getLayoutObject()) return AXRange(); LayoutObject* layout = nullptr; - if (layoutObject()->isTextControl()) { - layout = layoutObject(); + if (getLayoutObject()->isTextControl()) { + layout = getLayoutObject(); } else { - Element* focusedElement = document()->focusedElement(); + Element* focusedElement = getDocument()->focusedElement(); if (focusedElement && focusedElement->layoutObject() && focusedElement->layoutObject()->isTextControl()) layout = focusedElement->layoutObject(); @@ -1910,21 +1910,21 @@ AXObject::AXRange AXLayoutObject::textControlSelection() const int AXLayoutObject::indexForVisiblePosition(const VisiblePosition& position) const { - if (layoutObject() && layoutObject()->isTextControl()) { + if (getLayoutObject() && getLayoutObject()->isTextControl()) { HTMLTextFormControlElement* textControl = toLayoutTextControl( - layoutObject())->textFormControlElement(); + getLayoutObject())->textFormControlElement(); return textControl->indexForVisiblePosition(position); } - if (!node()) + if (!getNode()) return 0; Position indexPosition = position.deepEquivalent(); if (indexPosition.isNull()) return 0; - RefPtrWillBeRawPtr<Range> range = Range::create(*document()); - range->setStart(node(), 0, IGNORE_EXCEPTION); + RefPtrWillBeRawPtr<Range> range = Range::create(*getDocument()); + range->setStart(getNode(), 0, IGNORE_EXCEPTION); range->setEnd(indexPosition, IGNORE_EXCEPTION); return TextIterator::rangeLength(range->startPosition(), range->endPosition()); @@ -1952,7 +1952,7 @@ AXLayoutObject* AXLayoutObject::getUnignoredObjectFromNode(Node& node) const void AXLayoutObject::setSelection(const AXRange& selection) { - if (!layoutObject() || !selection.isValid()) + if (!getLayoutObject() || !selection.isValid()) return; AXObject* anchorObject = selection.anchorObject ? @@ -1966,9 +1966,9 @@ void AXLayoutObject::setSelection(const AXRange& selection) } if (anchorObject == focusObject - && anchorObject->layoutObject()->isTextControl()) { + && anchorObject->getLayoutObject()->isTextControl()) { HTMLTextFormControlElement* textControl = toLayoutTextControl( - anchorObject->layoutObject())->textFormControlElement(); + anchorObject->getLayoutObject())->textFormControlElement(); if (selection.anchorOffset <= selection.focusOffset) { textControl->setSelectionRange( selection.anchorOffset, selection.focusOffset, @@ -1983,20 +1983,20 @@ void AXLayoutObject::setSelection(const AXRange& selection) Node* anchorNode = nullptr; while (anchorObject && !anchorNode) { - anchorNode = anchorObject->node(); + anchorNode = anchorObject->getNode(); anchorObject = anchorObject->parentObject(); } Node* focusNode = nullptr; while (focusObject && !focusNode) { - focusNode = focusObject->node(); + focusNode = focusObject->getNode(); focusObject = focusObject->parentObject(); } if (!anchorNode || !focusNode) return; - LocalFrame* frame = layoutObject()->frame(); + LocalFrame* frame = getLayoutObject()->frame(); if (!frame) return; @@ -2007,24 +2007,24 @@ void AXLayoutObject::setSelection(const AXRange& selection) bool AXLayoutObject::isValidSelectionBound(const AXObject* boundObject) const { - return layoutObject() && boundObject && !boundObject->isDetached() - && boundObject->isAXLayoutObject() && boundObject->layoutObject() - && boundObject->layoutObject()->frame() == layoutObject()->frame() + return getLayoutObject() && boundObject && !boundObject->isDetached() + && boundObject->isAXLayoutObject() && boundObject->getLayoutObject() + && boundObject->getLayoutObject()->frame() == getLayoutObject()->frame() && &boundObject->axObjectCache() == &axObjectCache(); } void AXLayoutObject::setValue(const String& string) { - if (!node() || !node()->isElementNode()) + if (!getNode() || !getNode()->isElementNode()) return; if (!m_layoutObject || !m_layoutObject->isBoxModelObject()) return; LayoutBoxModelObject* layoutObject = toLayoutBoxModelObject(m_layoutObject); - if (layoutObject->isTextField() && isHTMLInputElement(*node())) - toHTMLInputElement(*node()).setValue(string, DispatchInputAndChangeEvent); - else if (layoutObject->isTextArea() && isHTMLTextAreaElement(*node())) - toHTMLTextAreaElement(*node()).setValue(string, DispatchInputAndChangeEvent); + if (layoutObject->isTextField() && isHTMLInputElement(*getNode())) + toHTMLInputElement(*getNode()).setValue(string, DispatchInputAndChangeEvent); + else if (layoutObject->isTextArea() && isHTMLTextAreaElement(*getNode())) + toHTMLTextAreaElement(*getNode()).setValue(string, DispatchInputAndChangeEvent); } // @@ -2033,10 +2033,10 @@ void AXLayoutObject::setValue(const String& string) void AXLayoutObject::handleActiveDescendantChanged() { - Element* element = toElement(layoutObject()->node()); + Element* element = toElement(getLayoutObject()->node()); if (!element) return; - Document& doc = layoutObject()->document(); + Document& doc = getLayoutObject()->document(); if (!doc.frame()->selection().isFocusedAndActive() || doc.focusedElement() != element) return; AXLayoutObject* activedescendant = toAXLayoutObject(activeDescendant()); @@ -2092,7 +2092,7 @@ void AXLayoutObject::textChanged() if (!m_layoutObject) return; - Settings* settings = document()->settings(); + Settings* settings = getDocument()->settings(); if (settings && settings->inlineTextBoxAccessibilityEnabled() && roleValue() == StaticTextRole) childrenChanged(); @@ -2144,21 +2144,21 @@ VisiblePosition AXLayoutObject::visiblePositionForIndex(int index) const void AXLayoutObject::addInlineTextBoxChildren(bool force) { - Settings* settings = document()->settings(); + Settings* settings = getDocument()->settings(); if (!force && (!settings || !settings->inlineTextBoxAccessibilityEnabled())) return; - if (!layoutObject() || !layoutObject()->isText()) + if (!getLayoutObject() || !getLayoutObject()->isText()) return; - if (layoutObject()->needsLayout()) { + if (getLayoutObject()->needsLayout()) { // If a LayoutText needs layout, its inline text boxes are either // nonexistent or invalid, so defer until the layout happens and // the layoutObject calls AXObjectCacheImpl::inlineTextBoxesUpdated. return; } - LayoutText* layoutText = toLayoutText(layoutObject()); + LayoutText* layoutText = toLayoutText(getLayoutObject()); for (RefPtr<AbstractInlineTextBox> box = layoutText->firstAbstractInlineTextBox(); box.get(); box = box->nextInlineTextBox()) { AXObject* axObject = axObjectCache().getOrCreate(box.get()); if (!axObject->accessibilityIsIgnored()) @@ -2355,7 +2355,7 @@ void AXLayoutObject::offsetBoundingBoxForRemoteSVGElement(LayoutRect& rect) cons // meaning that they should be exposed to the AX hierarchy. void AXLayoutObject::addHiddenChildren() { - Node* node = this->node(); + Node* node = this->getNode(); if (!node) return; @@ -2403,7 +2403,7 @@ void AXLayoutObject::addHiddenChildren() void AXLayoutObject::addTextFieldChildren() { - Node* node = this->node(); + Node* node = this->getNode(); if (!isHTMLInputElement(node)) return; @@ -2420,7 +2420,7 @@ void AXLayoutObject::addTextFieldChildren() void AXLayoutObject::addImageMapChildren() { - LayoutBoxModelObject* cssBox = layoutBoxModelObject(); + LayoutBoxModelObject* cssBox = getLayoutBoxModelObject(); if (!cssBox || !cssBox->isLayoutImage()) return; @@ -2445,7 +2445,7 @@ void AXLayoutObject::addImageMapChildren() void AXLayoutObject::addCanvasChildren() { - if (!isHTMLCanvasElement(node())) + if (!isHTMLCanvasElement(getNode())) return; // If it's a canvas, it won't have laid out children, but it might have accessible fallback content. @@ -2475,9 +2475,9 @@ void AXLayoutObject::addFrameChildren() void AXLayoutObject::addPopupChildren() { - if (!isHTMLInputElement(node())) + if (!isHTMLInputElement(getNode())) return; - if (AXObject* axPopup = toHTMLInputElement(node())->popupRootAXObject()) + if (AXObject* axPopup = toHTMLInputElement(getNode())->popupRootAXObject()) m_children.append(axPopup); } @@ -2530,7 +2530,7 @@ LayoutRect AXLayoutObject::computeElementRect() const result = LayoutRect(obj->absoluteElementBoundingBoxRect()); } - Document* document = this->document(); + Document* document = this->getDocument(); if (document && document->isSVGDocument()) offsetBoundingBoxForRemoteSVGElement(result); if (document && document->frame() && document->frame()->pagePopupOwner()) { diff --git a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.h b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.h index 79acacc..0610bac 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.h +++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.h @@ -54,9 +54,9 @@ public: ~AXLayoutObject() override; // Public, overridden from AXObject. - LayoutObject* layoutObject() const final { return m_layoutObject; } + LayoutObject* getLayoutObject() const final { return m_layoutObject; } LayoutRect elementRect() const override; - LayoutBoxModelObject* layoutBoxModelObject() const; + LayoutBoxModelObject* getLayoutBoxModelObject() const; bool shouldNotifyActiveDescendant() const; ScrollableArea* getScrollableAreaIfScrollable() const final; AccessibilityRole determineAccessibilityRole() override; @@ -176,8 +176,8 @@ protected: double estimatedLoadingProgress() const override; // DOM and layout tree access. - Node* node() const override; - Document* document() const override; + Node* getNode() const override; + Document* getDocument() const override; FrameView* documentFrameView() const override; Element* anchorElement() const override; diff --git a/third_party/WebKit/Source/modules/accessibility/AXListBox.cpp b/third_party/WebKit/Source/modules/accessibility/AXListBox.cpp index d025d1b..0d04e15 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXListBox.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXListBox.cpp @@ -64,10 +64,10 @@ AccessibilityRole AXListBox::determineAccessibilityRole() AXObject* AXListBox::activeDescendant() const { - if (!isHTMLSelectElement(node())) + if (!isHTMLSelectElement(getNode())) return nullptr; - HTMLSelectElement* select = toHTMLSelectElement(node()); + HTMLSelectElement* select = toHTMLSelectElement(getNode()); int activeIndex = select->activeSelectionEndListIndex(); if (activeIndex >= 0 && activeIndex < static_cast<int>(select->length())) { HTMLOptionElement* option = select->item(m_activeIndex); @@ -79,10 +79,10 @@ AXObject* AXListBox::activeDescendant() const void AXListBox::activeIndexChanged() { - if (!isHTMLSelectElement(node())) + if (!isHTMLSelectElement(getNode())) return; - HTMLSelectElement* select = toHTMLSelectElement(node()); + HTMLSelectElement* select = toHTMLSelectElement(getNode()); int activeIndex = select->activeSelectionEndListIndex(); if (activeIndex == m_activeIndex) return; diff --git a/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp b/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp index 2f45e76..58b655b 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXListBoxOption.cpp @@ -73,7 +73,7 @@ bool AXListBoxOption::isParentPresentationalRole() const if (!parent) return false; - LayoutObject* layoutObject = parent->layoutObject(); + LayoutObject* layoutObject = parent->getLayoutObject(); if (!layoutObject) return false; @@ -85,13 +85,13 @@ bool AXListBoxOption::isParentPresentationalRole() const bool AXListBoxOption::isEnabled() const { - if (!node()) + if (!getNode()) return false; if (equalIgnoringCase(getAttribute(aria_disabledAttr), "true")) return false; - if (toElement(node())->hasAttribute(disabledAttr)) + if (toElement(getNode())->hasAttribute(disabledAttr)) return false; return true; @@ -99,7 +99,7 @@ bool AXListBoxOption::isEnabled() const bool AXListBoxOption::isSelected() const { - return isHTMLOptionElement(node()) && toHTMLOptionElement(node())->selected(); + return isHTMLOptionElement(getNode()) && toHTMLOptionElement(getNode())->selected(); } bool AXListBoxOption::isSelectedOptionActive() const @@ -113,7 +113,7 @@ bool AXListBoxOption::isSelectedOptionActive() const bool AXListBoxOption::computeAccessibilityIsIgnored(IgnoredReasons* ignoredReasons) const { - if (!node()) + if (!getNode()) return true; if (accessibilityIsIgnoredByDefault(ignoredReasons)) @@ -124,10 +124,10 @@ bool AXListBoxOption::computeAccessibilityIsIgnored(IgnoredReasons* ignoredReaso bool AXListBoxOption::canSetSelectedAttribute() const { - if (!isHTMLOptionElement(node())) + if (!isHTMLOptionElement(getNode())) return false; - if (toHTMLOptionElement(node())->isDisabledFormControl()) + if (toHTMLOptionElement(getNode())->isDisabledFormControl()) return false; HTMLSelectElement* selectElement = listBoxOptionParentNode(); @@ -143,7 +143,7 @@ String AXListBoxOption::textAlternative(bool recursive, bool inAriaLabelledByTra if (nameSources) ASSERT(relatedObjects); - if (!node()) + if (!getNode()) return String(); bool foundTextAlternative = false; @@ -152,7 +152,7 @@ String AXListBoxOption::textAlternative(bool recursive, bool inAriaLabelledByTra return textAlternative; nameFrom = AXNameFromContents; - textAlternative = toHTMLOptionElement(node())->displayLabel(); + textAlternative = toHTMLOptionElement(getNode())->displayLabel(); if (nameSources) { nameSources->append(NameSource(foundTextAlternative)); nameSources->last().type = nameFrom; @@ -183,11 +183,11 @@ void AXListBoxOption::setSelected(bool selected) HTMLSelectElement* AXListBoxOption::listBoxOptionParentNode() const { - if (!node()) + if (!getNode()) return 0; - if (isHTMLOptionElement(node())) - return toHTMLOptionElement(node())->ownerSelectElement(); + if (isHTMLOptionElement(getNode())) + return toHTMLOptionElement(getNode())->ownerSelectElement(); return 0; } @@ -201,7 +201,7 @@ int AXListBoxOption::listBoxOptionIndex() const const WillBeHeapVector<RawPtrWillBeMember<HTMLElement>>& listItems = selectElement->listItems(); unsigned length = listItems.size(); for (unsigned i = 0; i < length; i++) { - if (listItems[i] == node()) + if (listItems[i] == getNode()) return i; } diff --git a/third_party/WebKit/Source/modules/accessibility/AXMediaControls.cpp b/third_party/WebKit/Source/modules/accessibility/AXMediaControls.cpp index a80c49c..309e230 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXMediaControls.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXMediaControls.cpp @@ -69,10 +69,10 @@ AXObject* AccessibilityMediaControl::create(LayoutObject* layoutObject, AXObject MediaControlElementType AccessibilityMediaControl::controlType() const { - if (!layoutObject() || !layoutObject()->node()) + if (!getLayoutObject() || !getLayoutObject()->node()) return MediaTimelineContainer; // Timeline container is not accessible. - return mediaControlElementType(layoutObject()->node()); + return mediaControlElementType(getLayoutObject()->node()); } String AccessibilityMediaControl::textAlternative(bool recursive, bool inAriaLabelledByTraversal, AXObjectSet& visited, AXNameFrom& nameFrom, AXRelatedObjectVector* relatedObjects, NameSources* nameSources) const diff --git a/third_party/WebKit/Source/modules/accessibility/AXMenuList.cpp b/third_party/WebKit/Source/modules/accessibility/AXMenuList.cpp index ee2682d..1927720 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXMenuList.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXMenuList.cpp @@ -123,10 +123,10 @@ AccessibilityExpanded AXMenuList::isExpanded() const bool AXMenuList::canSetFocusAttribute() const { - if (!node()) + if (!getNode()) return false; - return !toElement(node())->isDisabledFormControl(); + return !toElement(getNode())->isDisabledFormControl(); } void AXMenuList::didUpdateActiveOption(int optionIndex) @@ -162,7 +162,7 @@ void AXMenuList::didHidePopup() AXMenuListPopup* popup = toAXMenuListPopup(children()[0].get()); popup->didHide(); - if (node() && node()->focused()) + if (getNode() && getNode()->focused()) axObjectCache().postNotification(this, AXObjectCacheImpl::AXFocusedUIElementChanged); } diff --git a/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.cpp b/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.cpp index f8b18a7..d2b1eec 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.cpp @@ -136,7 +136,7 @@ String AXMenuListOption::textAlternative(bool recursive, bool inAriaLabelledByTr if (nameSources) ASSERT(relatedObjects); - if (!node()) + if (!getNode()) return String(); bool foundTextAlternative = false; diff --git a/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.h b/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.h index 2ca40f3..466cfff 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.h +++ b/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.h @@ -44,7 +44,7 @@ private: bool isMenuListOption() const override { return true; } - Node* node() const override { return m_element; } + Node* getNode() const override { return m_element; } void detach() override; bool isDetached() const override { return !m_element; } AccessibilityRole roleValue() const override; diff --git a/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.cpp b/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.cpp index 2bda5d3..5ba4242 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.cpp @@ -82,7 +82,7 @@ int AXMenuListPopup::getSelectedIndex() const if (!m_parent) return -1; - Node* parentNode = m_parent->node(); + Node* parentNode = m_parent->getNode(); if (!isHTMLSelectElement(parentNode)) return -1; @@ -105,7 +105,7 @@ void AXMenuListPopup::addChildren() if (!m_parent) return; - Node* parentNode = m_parent->node(); + Node* parentNode = m_parent->getNode(); if (!isHTMLSelectElement(parentNode)) return; diff --git a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp index 5fa5f18..1716a57 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp @@ -140,7 +140,7 @@ void AXNodeObject::alterSliderValue(bool increase) value += increase ? step : -step; setValue(String::number(value)); - axObjectCache().postNotification(node(), AXObjectCacheImpl::AXValueChanged); + axObjectCache().postNotification(getNode(), AXObjectCacheImpl::AXValueChanged); } String AXNodeObject::ariaAccessibilityDescription() const @@ -176,7 +176,7 @@ bool AXNodeObject::computeAccessibilityIsIgnored(IgnoredReasons* ignoredReasons) if (controlObject && controlObject->isCheckboxOrRadio() && controlObject->nameFromLabelElement()) { if (ignoredReasons) { HTMLLabelElement* label = labelElementContainer(); - if (label && label != node()) { + if (label && label != getNode()) { AXObject* labelAXObject = axObjectCache().getOrCreate(label); ignoredReasons->append(IgnoredReason(AXLabelContainer, labelAXObject)); } @@ -186,8 +186,8 @@ bool AXNodeObject::computeAccessibilityIsIgnored(IgnoredReasons* ignoredReasons) return true; } - Element* element = node()->isElementNode() ? toElement(node()) : node()->parentElement(); - if (!layoutObject() + Element* element = getNode()->isElementNode() ? toElement(getNode()) : getNode()->parentElement(); + if (!getLayoutObject() && (!element || !element->isInCanvasSubtree()) && !equalIgnoringCase(getAttribute(aria_hiddenAttr), "false")) { if (ignoredReasons) @@ -213,7 +213,7 @@ static bool isPresentationalInTable(AXObject* parent, HTMLElement* currentElemen if (!currentElement) return false; - Node* parentNode = parent->node(); + Node* parentNode = parent->getNode(); if (!parentNode || !parentNode->isHTMLElement()) return false; @@ -230,7 +230,7 @@ static bool isPresentationalInTable(AXObject* parent, HTMLElement* currentElemen if (isHTMLTableRowElement(*currentElement) && isHTMLTableSectionElement(toHTMLElement(*parentNode))) { // Because TableSections have ignored role, presentation should be checked with its parent node AXObject* tableObject = parent->parentObject(); - Node* tableNode = tableObject ? tableObject->node() : 0; + Node* tableNode = tableObject ? tableObject->getNode() : 0; return isHTMLTableElement(tableNode) && tableObject->hasInheritedPresentationalRole(); } return false; @@ -238,7 +238,7 @@ static bool isPresentationalInTable(AXObject* parent, HTMLElement* currentElemen static bool isRequiredOwnedElement(AXObject* parent, AccessibilityRole currentRole, HTMLElement* currentElement) { - Node* parentNode = parent->node(); + Node* parentNode = parent->getNode(); if (!parentNode || !parentNode->isHTMLElement()) return false; @@ -283,13 +283,13 @@ const AXObject* AXNodeObject::inheritsPresentationalRoleFrom() const return 0; HTMLElement* element = nullptr; - if (node() && node()->isHTMLElement()) - element = toHTMLElement(node()); + if (getNode() && getNode()->isHTMLElement()) + element = toHTMLElement(getNode()); if (!parent->hasInheritedPresentationalRole()) { - if (!layoutObject() || !layoutObject()->isBoxModelObject()) + if (!getLayoutObject() || !getLayoutObject()->isBoxModelObject()) return 0; - LayoutBoxModelObject* cssBox = toLayoutBoxModelObject(layoutObject()); + LayoutBoxModelObject* cssBox = toLayoutBoxModelObject(getLayoutObject()); if (!cssBox->isTableCell() && !cssBox->isTableRow()) return 0; @@ -305,10 +305,10 @@ const AXObject* AXNodeObject::inheritsPresentationalRoleFrom() const bool AXNodeObject::isDescendantOfElementType(const HTMLQualifiedName& tagName) const { - if (!node()) + if (!getNode()) return false; - for (Element* parent = node()->parentElement(); parent; parent = parent->parentElement()) { + for (Element* parent = getNode()->parentElement(); parent; parent = parent->parentElement()) { if (parent->hasTagName(tagName)) return true; } @@ -317,39 +317,39 @@ bool AXNodeObject::isDescendantOfElementType(const HTMLQualifiedName& tagName) c AccessibilityRole AXNodeObject::nativeAccessibilityRoleIgnoringAria() const { - if (!node()) + if (!getNode()) return UnknownRole; // HTMLAnchorElement sets isLink only when it has hrefAttr. // We assume that it is also LinkRole if it has event listners even though it doesn't have hrefAttr. - if (node()->isLink() || (isHTMLAnchorElement(*node()) && isClickable())) + if (getNode()->isLink() || (isHTMLAnchorElement(*getNode()) && isClickable())) return LinkRole; - if (isHTMLButtonElement(*node())) + if (isHTMLButtonElement(*getNode())) return buttonRoleType(); - if (isHTMLDetailsElement(*node())) + if (isHTMLDetailsElement(*getNode())) return DetailsRole; - if (isHTMLSummaryElement(*node())) { - ContainerNode* parent = FlatTreeTraversal::parent(*node()); + if (isHTMLSummaryElement(*getNode())) { + ContainerNode* parent = FlatTreeTraversal::parent(*getNode()); if (parent && isHTMLDetailsElement(parent)) return DisclosureTriangleRole; return UnknownRole; } - if (isHTMLInputElement(*node())) { - HTMLInputElement& input = toHTMLInputElement(*node()); + if (isHTMLInputElement(*getNode())) { + HTMLInputElement& input = toHTMLInputElement(*getNode()); const AtomicString& type = input.type(); if (input.dataList()) return ComboBoxRole; if (type == InputTypeNames::button) { - if ((node()->parentNode() && isHTMLMenuElement(node()->parentNode())) || (parentObject() && parentObject()->roleValue() == MenuRole)) + if ((getNode()->parentNode() && isHTMLMenuElement(getNode()->parentNode())) || (parentObject() && parentObject()->roleValue() == MenuRole)) return MenuItemRole; return buttonRoleType(); } if (type == InputTypeNames::checkbox) { - if ((node()->parentNode() && isHTMLMenuElement(node()->parentNode())) || (parentObject() && parentObject()->roleValue() == MenuRole)) + if ((getNode()->parentNode() && isHTMLMenuElement(getNode()->parentNode())) || (parentObject() && parentObject()->roleValue() == MenuRole)) return MenuItemCheckBoxRole; return CheckBoxRole; } @@ -363,7 +363,7 @@ AccessibilityRole AXNodeObject::nativeAccessibilityRoleIgnoringAria() const if (type == InputTypeNames::file) return ButtonRole; if (type == InputTypeNames::radio) { - if ((node()->parentNode() && isHTMLMenuElement(node()->parentNode())) || (parentObject() && parentObject()->roleValue() == MenuRole)) + if ((getNode()->parentNode() && isHTMLMenuElement(getNode()->parentNode())) || (parentObject() && parentObject()->roleValue() == MenuRole)) return MenuItemRadioRole; return RadioButtonRole; } @@ -380,91 +380,91 @@ AccessibilityRole AXNodeObject::nativeAccessibilityRoleIgnoringAria() const return TextFieldRole; } - if (isHTMLSelectElement(*node())) { - HTMLSelectElement& selectElement = toHTMLSelectElement(*node()); + if (isHTMLSelectElement(*getNode())) { + HTMLSelectElement& selectElement = toHTMLSelectElement(*getNode()); return selectElement.multiple() ? ListBoxRole : PopUpButtonRole; } - if (isHTMLTextAreaElement(*node())) + if (isHTMLTextAreaElement(*getNode())) return TextFieldRole; if (headingLevel()) return HeadingRole; - if (isHTMLDivElement(*node())) + if (isHTMLDivElement(*getNode())) return DivRole; - if (isHTMLMeterElement(*node())) + if (isHTMLMeterElement(*getNode())) return MeterRole; - if (isHTMLOutputElement(*node())) + if (isHTMLOutputElement(*getNode())) return StatusRole; - if (isHTMLParagraphElement(*node())) + if (isHTMLParagraphElement(*getNode())) return ParagraphRole; - if (isHTMLLabelElement(*node())) + if (isHTMLLabelElement(*getNode())) return LabelRole; - if (isHTMLLegendElement(*node())) + if (isHTMLLegendElement(*getNode())) return LegendRole; - if (isHTMLRubyElement(*node())) + if (isHTMLRubyElement(*getNode())) return RubyRole; - if (isHTMLDListElement(*node())) + if (isHTMLDListElement(*getNode())) return DescriptionListRole; - if (node()->hasTagName(ddTag)) + if (getNode()->hasTagName(ddTag)) return DescriptionListDetailRole; - if (node()->hasTagName(dtTag)) + if (getNode()->hasTagName(dtTag)) return DescriptionListTermRole; - if (node()->nodeName() == "math") + if (getNode()->nodeName() == "math") return MathRole; - if (node()->hasTagName(rpTag) || node()->hasTagName(rtTag)) + if (getNode()->hasTagName(rpTag) || getNode()->hasTagName(rtTag)) return AnnotationRole; - if (isHTMLFormElement(*node())) + if (isHTMLFormElement(*getNode())) return FormRole; - if (node()->hasTagName(abbrTag)) + if (getNode()->hasTagName(abbrTag)) return AbbrRole; - if (node()->hasTagName(articleTag)) + if (getNode()->hasTagName(articleTag)) return ArticleRole; - if (node()->hasTagName(mainTag)) + if (getNode()->hasTagName(mainTag)) return MainRole; - if (node()->hasTagName(markTag)) + if (getNode()->hasTagName(markTag)) return MarkRole; - if (node()->hasTagName(navTag)) + if (getNode()->hasTagName(navTag)) return NavigationRole; - if (node()->hasTagName(asideTag)) + if (getNode()->hasTagName(asideTag)) return ComplementaryRole; - if (node()->hasTagName(preTag)) + if (getNode()->hasTagName(preTag)) return PreRole; - if (node()->hasTagName(sectionTag)) + if (getNode()->hasTagName(sectionTag)) return RegionRole; - if (node()->hasTagName(addressTag)) + if (getNode()->hasTagName(addressTag)) return ContentInfoRole; - if (isHTMLDialogElement(*node())) + if (isHTMLDialogElement(*getNode())) return DialogRole; // The HTML element should not be exposed as an element. That's what the LayoutView element does. - if (isHTMLHtmlElement(*node())) + if (isHTMLHtmlElement(*getNode())) return IgnoredRole; - if (isHTMLIFrameElement(*node())) { + if (isHTMLIFrameElement(*getNode())) { const AtomicString& ariaRole = getAttribute(roleAttr); if (ariaRole == "none" || ariaRole == "presentation") return IframePresentationalRole; @@ -473,31 +473,31 @@ AccessibilityRole AXNodeObject::nativeAccessibilityRoleIgnoringAria() const // There should only be one banner/contentInfo per page. If header/footer are being used within an article or section // then it should not be exposed as whole page's banner/contentInfo - if (node()->hasTagName(headerTag) && !isDescendantOfElementType(articleTag) && !isDescendantOfElementType(sectionTag)) + if (getNode()->hasTagName(headerTag) && !isDescendantOfElementType(articleTag) && !isDescendantOfElementType(sectionTag)) return BannerRole; - if (node()->hasTagName(footerTag) && !isDescendantOfElementType(articleTag) && !isDescendantOfElementType(sectionTag)) + if (getNode()->hasTagName(footerTag) && !isDescendantOfElementType(articleTag) && !isDescendantOfElementType(sectionTag)) return FooterRole; - if (node()->hasTagName(blockquoteTag)) + if (getNode()->hasTagName(blockquoteTag)) return BlockquoteRole; - if (node()->hasTagName(captionTag)) + if (getNode()->hasTagName(captionTag)) return CaptionRole; - if (node()->hasTagName(figcaptionTag)) + if (getNode()->hasTagName(figcaptionTag)) return FigcaptionRole; - if (node()->hasTagName(figureTag)) + if (getNode()->hasTagName(figureTag)) return FigureRole; - if (node()->nodeName() == "TIME") + if (getNode()->nodeName() == "TIME") return TimeRole; if (isEmbeddedObject()) return EmbeddedObjectRole; - if (isHTMLHRElement(*node())) + if (isHTMLHRElement(*getNode())) return SplitterRole; return UnknownRole; @@ -505,21 +505,21 @@ AccessibilityRole AXNodeObject::nativeAccessibilityRoleIgnoringAria() const AccessibilityRole AXNodeObject::determineAccessibilityRole() { - if (!node()) + if (!getNode()) return UnknownRole; if ((m_ariaRole = determineAriaRoleAttribute()) != UnknownRole) return m_ariaRole; - if (node()->isTextNode()) + if (getNode()->isTextNode()) return StaticTextRole; AccessibilityRole role = nativeAccessibilityRoleIgnoringAria(); if (role != UnknownRole) return role; - if (node()->isElementNode()) { - Element* element = toElement(node()); + if (getNode()->isElementNode()) { + Element* element = toElement(getNode()); if (element->isInCanvasSubtree()) { - document()->updateLayoutTreeForNode(element); + getDocument()->updateLayoutTreeForNode(element); if (element->isFocusable()) return GroupRole; } @@ -614,7 +614,7 @@ bool AXNodeObject::isGenericFocusableElement() const // cases already, so we don't need to include them here. if (roleValue() == WebAreaRole) return false; - if (isHTMLBodyElement(node())) + if (isHTMLBodyElement(getNode())) return false; // An SVG root is focusable by default, but it's probably not interactive, so don't @@ -676,12 +676,12 @@ Element* AXNodeObject::menuItemElementForMenu() const if (ariaRoleAttribute() != MenuRole) return 0; - return siblingWithAriaRole("menuitem", node()); + return siblingWithAriaRole("menuitem", getNode()); } Element* AXNodeObject::mouseButtonListener() const { - Node* node = this->node(); + Node* node = this->getNode(); if (!node) return 0; @@ -751,7 +751,7 @@ bool AXNodeObject::isAnchor() const bool AXNodeObject::isControl() const { - Node* node = this->node(); + Node* node = this->getNode(); if (!node) return false; @@ -761,7 +761,7 @@ bool AXNodeObject::isControl() const bool AXNodeObject::isControllingVideoElement() const { - Node* node = this->node(); + Node* node = this->getNode(); if (!node) return true; @@ -770,12 +770,12 @@ bool AXNodeObject::isControllingVideoElement() const bool AXNodeObject::isEmbeddedObject() const { - return isHTMLPlugInElement(node()); + return isHTMLPlugInElement(getNode()); } bool AXNodeObject::isFieldset() const { - return isHTMLFieldSetElement(node()); + return isHTMLFieldSetElement(getNode()); } bool AXNodeObject::isHeading() const @@ -785,7 +785,7 @@ bool AXNodeObject::isHeading() const bool AXNodeObject::isHovered() const { - Node* node = this->node(); + Node* node = this->getNode(); if (!node) return false; @@ -804,7 +804,7 @@ bool AXNodeObject::isImageButton() const bool AXNodeObject::isInputImage() const { - Node* node = this->node(); + Node* node = this->getNode(); if (roleValue() == ButtonRole && isHTMLInputElement(node)) return toHTMLInputElement(*node).type() == InputTypeNames::image; @@ -839,12 +839,12 @@ bool AXNodeObject::isMultiSelectable() const if (equalIgnoringCase(ariaMultiSelectable, "false")) return false; - return isHTMLSelectElement(node()) && toHTMLSelectElement(*node()).multiple(); + return isHTMLSelectElement(getNode()) && toHTMLSelectElement(*getNode()).multiple(); } bool AXNodeObject::isNativeCheckboxOrRadio() const { - Node* node = this->node(); + Node* node = this->getNode(); if (!isHTMLInputElement(node)) return false; @@ -854,7 +854,7 @@ bool AXNodeObject::isNativeCheckboxOrRadio() const bool AXNodeObject::isNativeImage() const { - Node* node = this->node(); + Node* node = this->getNode(); if (!node) return false; @@ -872,7 +872,7 @@ bool AXNodeObject::isNativeImage() const bool AXNodeObject::isNativeTextControl() const { - Node* node = this->node(); + Node* node = this->getNode(); if (!node) return false; @@ -901,7 +901,7 @@ bool AXNodeObject::isNonNativeTextControl() const bool AXNodeObject::isPasswordField() const { - Node* node = this->node(); + Node* node = this->getNode(); if (!isHTMLInputElement(node)) return false; @@ -929,7 +929,7 @@ bool AXNodeObject::isSlider() const bool AXNodeObject::isNativeSlider() const { - Node* node = this->node(); + Node* node = this->getNode(); if (!node) return false; @@ -941,7 +941,7 @@ bool AXNodeObject::isNativeSlider() const bool AXNodeObject::isChecked() const { - Node* node = this->node(); + Node* node = this->getNode(); if (!node) return false; @@ -970,12 +970,12 @@ bool AXNodeObject::isChecked() const bool AXNodeObject::isClickable() const { - if (node()) { - if (node()->isElementNode() && toElement(node())->isDisabledFormControl()) + if (getNode()) { + if (getNode()->isElementNode() && toElement(getNode())->isDisabledFormControl()) return false; - // Note: we can't call node()->willRespondToMouseClickEvents() because that triggers a style recalc and can delete this. - if (node()->hasEventListeners(EventTypeNames::mouseup) || node()->hasEventListeners(EventTypeNames::mousedown) || node()->hasEventListeners(EventTypeNames::click) || node()->hasEventListeners(EventTypeNames::DOMActivate)) + // Note: we can't call getNode()->willRespondToMouseClickEvents() because that triggers a style recalc and can delete this. + if (getNode()->hasEventListeners(EventTypeNames::mouseup) || getNode()->hasEventListeners(EventTypeNames::mousedown) || getNode()->hasEventListeners(EventTypeNames::click) || getNode()->hasEventListeners(EventTypeNames::DOMActivate)) return true; } @@ -987,7 +987,7 @@ bool AXNodeObject::isEnabled() const if (isDescendantOfDisabledNode()) return false; - Node* node = this->node(); + Node* node = this->getNode(); if (!node || !node->isElementNode()) return true; @@ -996,9 +996,9 @@ bool AXNodeObject::isEnabled() const AccessibilityExpanded AXNodeObject::isExpanded() const { - if (node() && isHTMLSummaryElement(*node())) { - if (node()->parentNode() && isHTMLDetailsElement(node()->parentNode())) - return toElement(node()->parentNode())->hasAttribute(openAttr) ? ExpandedExpanded : ExpandedCollapsed; + if (getNode() && isHTMLSummaryElement(*getNode())) { + if (getNode()->parentNode() && isHTMLDetailsElement(getNode()->parentNode())) + return toElement(getNode()->parentNode())->hasAttribute(openAttr) ? ExpandedExpanded : ExpandedCollapsed; } const AtomicString& expanded = getAttribute(aria_expandedAttr); @@ -1015,11 +1015,11 @@ bool AXNodeObject::isPressed() const if (!isButton()) return false; - Node* node = this->node(); + Node* node = this->getNode(); if (!node) return false; - // ARIA button with aria-pressed not undefined, then check for aria-pressed attribute rather than node()->active() + // ARIA button with aria-pressed not undefined, then check for aria-pressed attribute rather than getNode()->active() if (ariaRoleAttribute() == ToggleButtonRole) { if (equalIgnoringCase(getAttribute(aria_pressedAttr), "true") || equalIgnoringCase(getAttribute(aria_pressedAttr), "mixed")) @@ -1032,7 +1032,7 @@ bool AXNodeObject::isPressed() const bool AXNodeObject::isReadOnly() const { - Node* node = this->node(); + Node* node = this->getNode(); if (!node) return true; @@ -1050,7 +1050,7 @@ bool AXNodeObject::isReadOnly() const bool AXNodeObject::isRequired() const { - Node* n = this->node(); + Node* n = this->getNode(); if (n && (n->isElementNode() && toElement(n)->isFormControlElement()) && hasAttribute(requiredAttr)) return toHTMLFormControlElement(n)->isRequired(); @@ -1062,7 +1062,7 @@ bool AXNodeObject::isRequired() const bool AXNodeObject::canSetFocusAttribute() const { - Node* node = this->node(); + Node* node = this->getNode(); if (!node) return false; @@ -1099,7 +1099,7 @@ bool AXNodeObject::canSetValueAttribute() const bool AXNodeObject::canvasHasFallbackContent() const { - Node* node = this->node(); + Node* node = this->getNode(); if (!isHTMLCanvasElement(node)) return false; @@ -1112,7 +1112,7 @@ bool AXNodeObject::canvasHasFallbackContent() const int AXNodeObject::headingLevel() const { // headings can be in block flow and non-block flow - Node* node = this->node(); + Node* node = this->getNode(); if (!node) return 0; @@ -1149,7 +1149,7 @@ int AXNodeObject::headingLevel() const unsigned AXNodeObject::hierarchicalLevel() const { - Node* node = this->node(); + Node* node = this->getNode(); if (!node || !node->isElementNode()) return 0; Element* element = toElement(node); @@ -1236,7 +1236,7 @@ String AXNodeObject::text() const if (!isTextControl()) return String(); - Node* node = this->node(); + Node* node = this->getNode(); if (!node) return String(); @@ -1262,10 +1262,10 @@ AccessibilityButtonState AXNodeObject::checkboxOrRadioValue() const RGBA32 AXNodeObject::colorValue() const { - if (!isHTMLInputElement(node()) || !isColorWell()) + if (!isHTMLInputElement(getNode()) || !isColorWell()) return AXObject::colorValue(); - HTMLInputElement* input = toHTMLInputElement(node()); + HTMLInputElement* input = toHTMLInputElement(getNode()); const AtomicString& type = input->getAttribute(typeAttr); if (!equalIgnoringCase(type, "color")) return AXObject::colorValue(); @@ -1294,9 +1294,9 @@ InvalidState AXNodeObject::getInvalidState() const return InvalidStateOther; } - if (node() && node()->isElementNode() - && toElement(node())->isFormControlElement()) { - HTMLFormControlElement* element = toHTMLFormControlElement(node()); + if (getNode() && getNode()->isElementNode() + && toElement(getNode())->isFormControlElement()) { + HTMLFormControlElement* element = toHTMLFormControlElement(getNode()); WillBeHeapVector<RefPtrWillBeMember<HTMLFormControlElement>> invalidControls; bool isInvalid = !element->checkValidity( @@ -1355,10 +1355,10 @@ float AXNodeObject::valueForRange() const return getAttribute(aria_valuenowAttr).toFloat(); if (isNativeSlider()) - return toHTMLInputElement(*node()).valueAsNumber(); + return toHTMLInputElement(*getNode()).valueAsNumber(); - if (isHTMLMeterElement(node())) - return toHTMLMeterElement(*node()).value(); + if (isHTMLMeterElement(getNode())) + return toHTMLMeterElement(*getNode()).value(); return 0.0; } @@ -1369,10 +1369,10 @@ float AXNodeObject::maxValueForRange() const return getAttribute(aria_valuemaxAttr).toFloat(); if (isNativeSlider()) - return toHTMLInputElement(*node()).maximum(); + return toHTMLInputElement(*getNode()).maximum(); - if (isHTMLMeterElement(node())) - return toHTMLMeterElement(*node()).max(); + if (isHTMLMeterElement(getNode())) + return toHTMLMeterElement(*getNode()).max(); return 0.0; } @@ -1383,10 +1383,10 @@ float AXNodeObject::minValueForRange() const return getAttribute(aria_valueminAttr).toFloat(); if (isNativeSlider()) - return toHTMLInputElement(*node()).minimum(); + return toHTMLInputElement(*getNode()).minimum(); - if (isHTMLMeterElement(node())) - return toHTMLMeterElement(*node()).min(); + if (isHTMLMeterElement(getNode())) + return toHTMLMeterElement(*getNode()).min(); return 0.0; } @@ -1396,13 +1396,13 @@ float AXNodeObject::stepValueForRange() const if (!isNativeSlider()) return 0.0; - Decimal step = toHTMLInputElement(*node()).createStepRange(RejectAny).step(); + Decimal step = toHTMLInputElement(*getNode()).createStepRange(RejectAny).step(); return step.toString().toFloat(); } String AXNodeObject::stringValue() const { - Node* node = this->node(); + Node* node = this->getNode(); if (!node) return String(); @@ -1509,7 +1509,7 @@ String AXNodeObject::textAlternative(bool recursive, bool inAriaLabelledByTraver bool foundTextAlternative = false; - if (!node() && !layoutObject()) + if (!getNode() && !getLayoutObject()) return String(); String textAlternative = ariaTextAlternative(recursive, inAriaLabelledByTraversal, visited, nameFrom, relatedObjects, nameSources, &foundTextAlternative); @@ -1545,7 +1545,7 @@ String AXNodeObject::textAlternative(bool recursive, bool inAriaLabelledByTraver nameSources->last().type = nameFrom; } - Node* node = this->node(); + Node* node = this->getNode(); if (node && node->isTextNode()) textAlternative = toText(node)->wholeText(); else if (isHTMLBRElement(node)) @@ -1627,7 +1627,7 @@ String AXNodeObject::textFromDescendants(AXObjectSet& visited, bool recursive) c // so we should return "HelloWorld", but given <div>Hello</div><div>World</div> the // strings are in separate boxes so we should return "Hello World". if (previous && accumulatedText.length() && !isHTMLSpace(accumulatedText[accumulatedText.length() - 1])) { - if (!isInSameNonInlineBlockFlow(child->layoutObject(), previous->layoutObject())) + if (!isInSameNonInlineBlockFlow(child->getLayoutObject(), previous->getLayoutObject())) accumulatedText.append(' '); } @@ -1649,7 +1649,7 @@ bool AXNodeObject::nameFromLabelElement() const // but it's necessary because nameFromLabelElement needs to be called from // computeAccessibilityIsIgnored, which isn't allowed to call axObjectCache->getOrCreate. - if (!node() && !layoutObject()) + if (!getNode() && !getLayoutObject()) return false; // Step 2A from: http://www.w3.org/TR/accname-aam-1.1 @@ -1670,8 +1670,8 @@ bool AXNodeObject::nameFromLabelElement() const // Based on http://rawgit.com/w3c/aria/master/html-aam/html-aam.html#accessible-name-and-description-calculation // 5.1/5.5 Text inputs, Other labelable Elements HTMLElement* htmlElement = nullptr; - if (node()->isHTMLElement()) - htmlElement = toHTMLElement(node()); + if (getNode()->isHTMLElement()) + htmlElement = toHTMLElement(getNode()); if (htmlElement && htmlElement->isLabelable()) { HTMLLabelElement* label = labelForElement(htmlElement); if (label) @@ -1689,10 +1689,10 @@ LayoutRect AXNodeObject::elementRect() const // FIXME: If there are a lot of elements in the canvas, it will be inefficient. // We can avoid the inefficient calculations by using AXComputedObjectAttributeCache. - if (node()->parentElement()->isInCanvasSubtree()) { + if (getNode()->parentElement()->isInCanvasSubtree()) { LayoutRect rect; - for (Node& child : NodeTraversal::childrenOf(*node())) { + for (Node& child : NodeTraversal::childrenOf(*getNode())) { if (child.isHTMLElement()) { if (AXObject* obj = axObjectCache().get(&child)) { if (rect.isEmpty()) @@ -1745,7 +1745,7 @@ static Node* getParentNodeForComputeParent(Node* node) AXObject* AXNodeObject::computeParent() const { ASSERT(!isDetached()); - if (Node* parentNode = getParentNodeForComputeParent(node())) + if (Node* parentNode = getParentNodeForComputeParent(getNode())) return axObjectCache().getOrCreate(parentNode); return nullptr; @@ -1753,7 +1753,7 @@ AXObject* AXNodeObject::computeParent() const AXObject* AXNodeObject::computeParentIfExists() const { - if (Node* parentNode = getParentNodeForComputeParent(node())) + if (Node* parentNode = getParentNodeForComputeParent(getNode())) return axObjectCache().get(parentNode); return nullptr; @@ -1761,10 +1761,10 @@ AXObject* AXNodeObject::computeParentIfExists() const AXObject* AXNodeObject::rawFirstChild() const { - if (!node()) + if (!getNode()) return 0; - Node* firstChild = node()->firstChild(); + Node* firstChild = getNode()->firstChild(); if (!firstChild) return 0; @@ -1774,10 +1774,10 @@ AXObject* AXNodeObject::rawFirstChild() const AXObject* AXNodeObject::rawNextSibling() const { - if (!node()) + if (!getNode()) return 0; - Node* nextSibling = node()->nextSibling(); + Node* nextSibling = getNode()->nextSibling(); if (!nextSibling) return 0; @@ -1797,7 +1797,7 @@ void AXNodeObject::addChildren() m_haveChildren = true; // The only time we add children from the DOM tree to a node with a layoutObject is when it's a canvas. - if (layoutObject() && !isHTMLCanvasElement(*m_node)) + if (getLayoutObject() && !isHTMLCanvasElement(*m_node)) return; HeapVector<Member<AXObject>> ownedChildren; @@ -1847,10 +1847,10 @@ bool AXNodeObject::canHaveChildren() const // If this is an AXLayoutObject, then it's okay if this object // doesn't have a node - there are some layoutObjects that don't have associated // nodes, like scroll areas and css-generated text. - if (!node() && !isAXLayoutObject()) + if (!getNode() && !isAXLayoutObject()) return false; - if (node() && isHTMLMapElement(node())) + if (getNode() && isHTMLMapElement(getNode())) return false; AccessibilityRole role = roleValue(); @@ -1883,7 +1883,7 @@ bool AXNodeObject::canHaveChildren() const Element* AXNodeObject::actionElement() const { - Node* node = this->node(); + Node* node = this->getNode(); if (!node) return 0; @@ -1926,7 +1926,7 @@ Element* AXNodeObject::actionElement() const Element* AXNodeObject::anchorElement() const { - Node* node = this->node(); + Node* node = this->getNode(); if (!node) return 0; @@ -1942,11 +1942,11 @@ Element* AXNodeObject::anchorElement() const return 0; } -Document* AXNodeObject::document() const +Document* AXNodeObject::getDocument() const { - if (!node()) + if (!getNode()) return 0; - return &node()->document(); + return &getNode()->document(); } void AXNodeObject::setNode(Node* node) @@ -1974,7 +1974,7 @@ AXObject* AXNodeObject::correspondingControlForLabelElement() const HTMLLabelElement* AXNodeObject::labelElementContainer() const { - if (!node()) + if (!getNode()) return 0; // the control element should not be considered part of the label @@ -1986,7 +1986,7 @@ HTMLLabelElement* AXNodeObject::labelElementContainer() const return 0; // find if this has a ancestor that is a label - return Traversal<HTMLLabelElement>::firstAncestorOrSelf(*node()); + return Traversal<HTMLLabelElement>::firstAncestorOrSelf(*getNode()); } void AXNodeObject::setFocused(bool on) @@ -1994,11 +1994,11 @@ void AXNodeObject::setFocused(bool on) if (!canSetFocusAttribute()) return; - Document* document = this->document(); + Document* document = this->getDocument(); if (!on) { document->clearFocusedElement(); } else { - Node* node = this->node(); + Node* node = this->getNode(); if (node && node->isElementNode()) { // If this node is already the currently focused node, then calling focus() won't do anything. // That is a problem when focus is removed from the webpage to chrome, and then returns. @@ -2028,7 +2028,7 @@ void AXNodeObject::decrement() void AXNodeObject::childrenChanged() { // This method is meant as a quick way of marking a portion of the accessibility tree dirty. - if (!node() && !layoutObject()) + if (!getNode() && !getLayoutObject()) return; // If this is not part of the accessibility tree because an ancestor @@ -2069,8 +2069,8 @@ void AXNodeObject::selectionChanged() // or the web area if the selection is just in the document somewhere. if (isFocused() || isWebArea()) { axObjectCache().postNotification(this, AXObjectCacheImpl::AXSelectedTextChanged); - if (document()) { - AXObject* documentObject = axObjectCache().getOrCreate(document()); + if (getDocument()) { + AXObject* documentObject = axObjectCache().getOrCreate(getDocument()); axObjectCache().postNotification(documentObject, AXObjectCacheImpl::AXDocumentSelectionChanged); } } else { @@ -2083,7 +2083,7 @@ void AXNodeObject::textChanged() // If this element supports ARIA live regions, or is part of a region with an ARIA editable role, // then notify the AT of changes. AXObjectCacheImpl& cache = axObjectCache(); - for (Node* parentNode = node(); parentNode; parentNode = parentNode->parentNode()) { + for (Node* parentNode = getNode(); parentNode; parentNode = parentNode->parentNode()) { AXObject* parent = cache.get(parentNode); if (!parent) continue; @@ -2122,7 +2122,7 @@ void AXNodeObject::computeAriaOwnsChildren(HeapVector<Member<AXObject>>& ownedCh // Based on http://rawgit.com/w3c/aria/master/html-aam/html-aam.html#accessible-name-and-description-calculation String AXNodeObject::nativeTextAlternative(AXObjectSet& visited, AXNameFrom& nameFrom, AXRelatedObjectVector* relatedObjects, NameSources* nameSources, bool* foundTextAlternative) const { - if (!node()) + if (!getNode()) return String(); // If nameSources is non-null, relatedObjects is used in filling it in, so it must be non-null as well. @@ -2133,14 +2133,14 @@ String AXNodeObject::nativeTextAlternative(AXObjectSet& visited, AXNameFrom& nam AXRelatedObjectVector localRelatedObjects; const HTMLInputElement* inputElement = nullptr; - if (isHTMLInputElement(node())) - inputElement = toHTMLInputElement(node()); + if (isHTMLInputElement(getNode())) + inputElement = toHTMLInputElement(getNode()); // 5.1/5.5 Text inputs, Other labelable Elements // If you change this logic, update AXNodeObject::nameFromLabelElement, too. HTMLElement* htmlElement = nullptr; - if (node()->isHTMLElement()) - htmlElement = toHTMLElement(node()); + if (getNode()->isHTMLElement()) + htmlElement = toHTMLElement(getNode()); if (htmlElement && htmlElement->isLabelable()) { // label nameFrom = AXNameFromRelatedElement; @@ -2263,7 +2263,7 @@ String AXNodeObject::nativeTextAlternative(AXObjectSet& visited, AXNameFrom& nam NameSource& source = nameSources->last(); source.type = nameFrom; } - HTMLElement* element = toHTMLElement(node()); + HTMLElement* element = toHTMLElement(getNode()); const AtomicString& placeholder = element->fastGetAttribute(placeholderAttr); if (!placeholder.isEmpty()) { textAlternative = placeholder; @@ -2279,7 +2279,7 @@ String AXNodeObject::nativeTextAlternative(AXObjectSet& visited, AXNameFrom& nam } // 5.7 figure and figcaption Elements - if (node()->hasTagName(figureTag)) { + if (getNode()->hasTagName(figureTag)) { // figcaption nameFrom = AXNameFromRelatedElement; if (nameSources) { @@ -2288,7 +2288,7 @@ String AXNodeObject::nativeTextAlternative(AXObjectSet& visited, AXNameFrom& nam nameSources->last().nativeSource = AXTextFromNativeHTMLFigcaption; } Element* figcaption = nullptr; - for (Element& element : ElementTraversal::descendantsOf(*(node()))) { + for (Element& element : ElementTraversal::descendantsOf(*(getNode()))) { if (element.hasTagName(figcaptionTag)) { figcaption = &element; break; @@ -2319,7 +2319,7 @@ String AXNodeObject::nativeTextAlternative(AXObjectSet& visited, AXNameFrom& nam } // 5.8 img or area Element - if (isHTMLImageElement(node()) || isHTMLAreaElement(node()) || (layoutObject() && layoutObject()->isSVGImage())) { + if (isHTMLImageElement(getNode()) || isHTMLAreaElement(getNode()) || (getLayoutObject() && getLayoutObject()->isSVGImage())) { // alt nameFrom = AXNameFromAttribute; if (nameSources) { @@ -2342,8 +2342,8 @@ String AXNodeObject::nativeTextAlternative(AXObjectSet& visited, AXNameFrom& nam } // 5.9 table Element - if (isHTMLTableElement(node())) { - HTMLTableElement* tableElement = toHTMLTableElement(node()); + if (isHTMLTableElement(getNode())) { + HTMLTableElement* tableElement = toHTMLTableElement(getNode()); // caption nameFrom = AXNameFromCaption; @@ -2397,16 +2397,16 @@ String AXNodeObject::nativeTextAlternative(AXObjectSet& visited, AXNameFrom& nam } // Per SVG AAM 1.0's modifications to 2D of this algorithm. - if (node()->isSVGElement()) { + if (getNode()->isSVGElement()) { nameFrom = AXNameFromRelatedElement; if (nameSources) { nameSources->append(NameSource(*foundTextAlternative)); nameSources->last().type = nameFrom; nameSources->last().nativeSource = AXTextFromNativeHTMLTitleElement; } - ASSERT(node()->isContainerNode()); + ASSERT(getNode()->isContainerNode()); Element* title = ElementTraversal::firstChild( - toContainerNode(*(node())), + toContainerNode(*(getNode())), HasTagName(SVGNames::titleTag)); if (title) { @@ -2432,14 +2432,14 @@ String AXNodeObject::nativeTextAlternative(AXObjectSet& visited, AXNameFrom& nam } // Fieldset / legend. - if (isHTMLFieldSetElement(node())) { + if (isHTMLFieldSetElement(getNode())) { nameFrom = AXNameFromRelatedElement; if (nameSources) { nameSources->append(NameSource(*foundTextAlternative)); nameSources->last().type = nameFrom; nameSources->last().nativeSource = AXTextFromNativeHTMLLegend; } - HTMLElement* legend = toHTMLFieldSetElement(node())->legend(); + HTMLElement* legend = toHTMLFieldSetElement(getNode())->legend(); if (legend) { AXObject* legendAXObject = axObjectCache().getOrCreate(legend); // Avoid an infinite loop @@ -2466,7 +2466,7 @@ String AXNodeObject::nativeTextAlternative(AXObjectSet& visited, AXNameFrom& nam // Document. if (isWebArea()) { - Document* document = this->document(); + Document* document = this->getDocument(); if (document) { nameFrom = AXNameFromAttribute; if (nameSources) { @@ -2542,7 +2542,7 @@ String AXNodeObject::description(AXNameFrom nameFrom, AXDescriptionFrom& descrip if (descriptionSources) ASSERT(relatedObjects); - if (!node()) + if (!getNode()) return String(); String description; @@ -2578,8 +2578,8 @@ String AXNodeObject::description(AXNameFrom nameFrom, AXDescriptionFrom& descrip } HTMLElement* htmlElement = nullptr; - if (node()->isHTMLElement()) - htmlElement = toHTMLElement(node()); + if (getNode()->isHTMLElement()) + htmlElement = toHTMLElement(getNode()); // placeholder, 5.1.2 from: http://rawgit.com/w3c/aria/master/html-aam/html-aam.html if (nameFrom != AXNameFromPlaceholder && htmlElement && htmlElement->isTextFormControl()) { @@ -2589,7 +2589,7 @@ String AXNodeObject::description(AXNameFrom nameFrom, AXDescriptionFrom& descrip DescriptionSource& source = descriptionSources->last(); source.type = descriptionFrom; } - HTMLElement* element = toHTMLElement(node()); + HTMLElement* element = toHTMLElement(getNode()); const AtomicString& placeholder = element->fastGetAttribute(placeholderAttr); if (!placeholder.isEmpty()) { description = placeholder; @@ -2605,8 +2605,8 @@ String AXNodeObject::description(AXNameFrom nameFrom, AXDescriptionFrom& descrip } const HTMLInputElement* inputElement = nullptr; - if (isHTMLInputElement(node())) - inputElement = toHTMLInputElement(node()); + if (isHTMLInputElement(getNode())) + inputElement = toHTMLInputElement(getNode()); // value, 5.2.2 from: http://rawgit.com/w3c/aria/master/html-aam/html-aam.html if (nameFrom != AXNameFromValue && inputElement && inputElement->isTextButton()) { @@ -2629,8 +2629,8 @@ String AXNodeObject::description(AXNameFrom nameFrom, AXDescriptionFrom& descrip } // table caption, 5.9.2 from: http://rawgit.com/w3c/aria/master/html-aam/html-aam.html - if (nameFrom != AXNameFromCaption && isHTMLTableElement(node())) { - HTMLTableElement* tableElement = toHTMLTableElement(node()); + if (nameFrom != AXNameFromCaption && isHTMLTableElement(getNode())) { + HTMLTableElement* tableElement = toHTMLTableElement(getNode()); descriptionFrom = AXDescriptionFromRelatedElement; if (descriptionSources) { @@ -2660,7 +2660,7 @@ String AXNodeObject::description(AXNameFrom nameFrom, AXDescriptionFrom& descrip } // summary, 5.6.2 from: http://rawgit.com/w3c/aria/master/html-aam/html-aam.html - if (nameFrom != AXNameFromContents && isHTMLSummaryElement(node())) { + if (nameFrom != AXNameFromContents && isHTMLSummaryElement(getNode())) { descriptionFrom = AXDescriptionFromContents; if (descriptionSources) { descriptionSources->append(DescriptionSource(foundDescription)); @@ -2742,15 +2742,15 @@ String AXNodeObject::placeholder(AXNameFrom nameFrom, AXDescriptionFrom descript if (descriptionFrom == AXDescriptionFromPlaceholder) return String(); - if (!node()) + if (!getNode()) return String(); String placeholder; - if (isHTMLInputElement(*node())) { - HTMLInputElement* inputElement = toHTMLInputElement(node()); + if (isHTMLInputElement(*getNode())) { + HTMLInputElement* inputElement = toHTMLInputElement(getNode()); placeholder = inputElement->strippedPlaceholder(); - } else if (isHTMLTextAreaElement(*node())) { - HTMLTextAreaElement* textAreaElement = toHTMLTextAreaElement(node()); + } else if (isHTMLTextAreaElement(*getNode())) { + HTMLTextAreaElement* textAreaElement = toHTMLTextAreaElement(getNode()); placeholder = textAreaElement->strippedPlaceholder(); } return placeholder; diff --git a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.h b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.h index f135a89..40a4d97 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.h +++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.h @@ -180,8 +180,8 @@ protected: // DOM and Render tree access. Element* actionElement() const override; Element* anchorElement() const override; - Document* document() const override; - Node* node() const override { return m_node; } + Document* getDocument() const override; + Node* getNode() const override { return m_node; } // Modify or take an action on an object. void setFocused(bool) final; diff --git a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp index 5a2abc3..3800577 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp @@ -465,7 +465,7 @@ bool AXObject::isMenuRelated() const bool AXObject::isPasswordFieldAndShouldHideValue() const { - Settings* settings = document()->settings(); + Settings* settings = getDocument()->settings(); if (!settings || settings->accessibilityPasswordValuesEnabled()) return false; @@ -563,10 +563,10 @@ bool AXObject::isInertOrAriaHidden() const bool AXObject::computeIsInertOrAriaHidden(IgnoredReasons* ignoredReasons) const { - if (node()) { - if (node()->isInert()) { + if (getNode()) { + if (getNode()->isInert()) { if (ignoredReasons) { - HTMLDialogElement* dialog = getActiveDialogElement(node()); + HTMLDialogElement* dialog = getActiveDialogElement(getNode()); if (dialog) { AXObject* dialogObject = axObjectCache().getOrCreate(dialog); if (dialogObject) @@ -703,7 +703,7 @@ String AXObject::name(AXNameFrom& nameFrom, AXObject::AXObjectVector* nameObject String text = textAlternative(false, false, visited, nameFrom, &relatedObjects, nullptr); AccessibilityRole role = roleValue(); - if (!node() || (!isHTMLBRElement(node()) && role != StaticTextRole && role != InlineTextBoxRole)) + if (!getNode() || (!isHTMLBRElement(getNode()) && role != StaticTextRole && role != InlineTextBoxRole)) text = collapseWhitespace(text); if (nameObjects) { @@ -736,17 +736,17 @@ bool AXObject::isHiddenForTextAlternativeCalculation() const if (equalIgnoringCase(getAttribute(aria_hiddenAttr), "false")) return false; - if (layoutObject()) - return layoutObject()->style()->visibility() != VISIBLE; + if (getLayoutObject()) + return getLayoutObject()->style()->visibility() != VISIBLE; // This is an obscure corner case: if a node has no LayoutObject, that means it's not rendered, // but we still may be exploring it as part of a text alternative calculation, for example if it // was explicitly referenced by aria-labelledby. So we need to explicitly call the style resolver // to check whether it's invisible or display:none, rather than relying on the style cached in the // LayoutObject. - Document* doc = document(); - if (doc && doc->frame() && node() && node()->isElementNode()) { - RefPtr<ComputedStyle> style = doc->ensureStyleResolver().styleForElement(toElement(node())); + Document* doc = getDocument(); + if (doc && doc->frame() && getNode() && getNode()->isElementNode()) { + RefPtr<ComputedStyle> style = doc->ensureStyleResolver().styleForElement(toElement(getNode())); return style->display() == NONE || style->visibility() != VISIBLE; } @@ -854,7 +854,7 @@ String AXObject::textFromElements(bool inAriaLabelledbyTraversal, AXObjectSet& v void AXObject::tokenVectorFromAttribute(Vector<String>& tokens, const QualifiedName& attribute) const { - Node* node = this->node(); + Node* node = this->getNode(); if (!node || !node->isElementNode()) return; @@ -873,7 +873,7 @@ void AXObject::elementsFromAttribute(WillBeHeapVector<RawPtrWillBeMember<Element if (ids.isEmpty()) return; - TreeScope& scope = node()->treeScope(); + TreeScope& scope = getNode()->treeScope(); for (const auto& id : ids) { if (Element* idElement = scope.getElementById(AtomicString(id))) elements.append(idElement); @@ -961,7 +961,7 @@ AccessibilityButtonState AXObject::checkboxOrRadioValue() const bool AXObject::isMultiline() const { - Node* node = this->node(); + Node* node = this->getNode(); if (!node) return false; @@ -1182,7 +1182,7 @@ void AXObject::clearChildren() m_haveChildren = false; } -Document* AXObject::document() const +Document* AXObject::getDocument() const { FrameView* frameView = documentFrameView(); if (!frameView) @@ -1213,7 +1213,7 @@ String AXObject::language() const // as a last resort, fall back to the content language specified in the meta tag if (!parent) { - Document* doc = document(); + Document* doc = getDocument(); if (doc) return doc->contentLanguage(); return nullAtom; @@ -1224,7 +1224,7 @@ String AXObject::language() const bool AXObject::hasAttribute(const QualifiedName& attribute) const { - Node* elementNode = node(); + Node* elementNode = getNode(); if (!elementNode) return false; @@ -1237,7 +1237,7 @@ bool AXObject::hasAttribute(const QualifiedName& attribute) const const AtomicString& AXObject::getAttribute(const QualifiedName& attribute) const { - Node* elementNode = node(); + Node* elementNode = getNode(); if (!elementNode) return nullAtom; @@ -1531,12 +1531,12 @@ void AXObject::selectionChanged() int AXObject::lineForPosition(const VisiblePosition& position) const { - if (position.isNull() || !node()) + if (position.isNull() || !getNode()) return -1; // If the position is not in the same editable region as this AX object, return -1. Node* containerNode = position.deepEquivalent().computeContainerNode(); - if (!containerNode->containsIncludingShadowDOM(node()) && !node()->containsIncludingShadowDOM(containerNode)) + if (!containerNode->containsIncludingShadowDOM(getNode()) && !getNode()->containsIncludingShadowDOM(containerNode)) return -1; int lineCount = -1; diff --git a/third_party/WebKit/Source/modules/accessibility/AXObject.h b/third_party/WebKit/Source/modules/accessibility/AXObject.h index 243fa2f..0495800 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXObject.h +++ b/third_party/WebKit/Source/modules/accessibility/AXObject.h @@ -824,9 +824,9 @@ public: virtual double estimatedLoadingProgress() const { return 0; } // DOM and layout tree access. - virtual Node* node() const { return 0; } - virtual LayoutObject* layoutObject() const { return 0; } - virtual Document* document() const; + virtual Node* getNode() const { return 0; } + virtual LayoutObject* getLayoutObject() const { return 0; } + virtual Document* getDocument() const; virtual FrameView* documentFrameView() const; virtual Element* anchorElement() const { return 0; } virtual Element* actionElement() const { return 0; } diff --git a/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp b/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp index 17a69f0..0a764099 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp @@ -178,7 +178,7 @@ AXObject* AXObjectCacheImpl::focusedObject() Element* adjustedFocusedElement = focusedDocument->adjustedFocusedElement(); if (isHTMLInputElement(adjustedFocusedElement)) { if (AXObject* axPopup = toHTMLInputElement(adjustedFocusedElement)->popupRootAXObject()) { - if (Element* focusedElementInPopup = axPopup->document()->focusedElement()) + if (Element* focusedElementInPopup = axPopup->getDocument()->focusedElement()) focusedNode = focusedElementInPopup; } @@ -681,7 +681,7 @@ void AXObjectCacheImpl::notificationPostTimerFired(Timer<AXObjectCacheImpl>*) // Notifications should only be sent after the layoutObject has finished if (obj->isAXLayoutObject()) { AXLayoutObject* layoutObj = toAXLayoutObject(obj); - LayoutObject* layoutObject = layoutObj->layoutObject(); + LayoutObject* layoutObject = layoutObj->getLayoutObject(); if (layoutObject && layoutObject->view()) ASSERT(!layoutObject->view()->layoutState()); } @@ -779,7 +779,7 @@ void AXObjectCacheImpl::updateAriaOwns(const AXObject* owner, const Vector<Strin // // Figure out the children that are owned by this object and are in the tree. - TreeScope& scope = owner->node()->treeScope(); + TreeScope& scope = owner->getNode()->treeScope(); Vector<AXID> newChildAXIDs; for (const String& idName : idVector) { Element* element = scope.getElementById(AtomicString(idName)); @@ -1145,17 +1145,17 @@ bool isNodeAriaVisible(Node* node) void AXObjectCacheImpl::postPlatformNotification(AXObject* obj, AXNotification notification) { - if (!obj || !obj->document() || !obj->documentFrameView() || !obj->documentFrameView()->frame().page()) + if (!obj || !obj->getDocument() || !obj->documentFrameView() || !obj->documentFrameView()->frame().page()) return; - ChromeClient& client = obj->document()->axObjectCacheOwner().page()->chromeClient(); + ChromeClient& client = obj->getDocument()->axObjectCacheOwner().page()->chromeClient(); if (notification == AXActiveDescendantChanged - && obj->document()->focusedElement() - && obj->node() == obj->document()->focusedElement()) { + && obj->getDocument()->focusedElement() + && obj->getNode() == obj->getDocument()->focusedElement()) { // Calling handleFocusedUIElementChanged will focus the new active // descendant and send the AXFocusedUIElementChanged notification. - handleFocusedUIElementChanged(0, obj->document()->focusedElement()); + handleFocusedUIElementChanged(0, obj->getDocument()->focusedElement()); } client.postAccessibilityNotification(obj, notification); diff --git a/third_party/WebKit/Source/modules/accessibility/AXSlider.cpp b/third_party/WebKit/Source/modules/accessibility/AXSlider.cpp index fab9cdb..dbe20eb 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXSlider.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXSlider.cpp @@ -148,7 +148,7 @@ LayoutRect AXSliderThumb::elementRect() const if (!m_parent) return LayoutRect(); - LayoutObject* sliderLayoutObject = m_parent->layoutObject(); + LayoutObject* sliderLayoutObject = m_parent->getLayoutObject(); if (!sliderLayoutObject || !sliderLayoutObject->isSlider()) return LayoutRect(); return toElement(sliderLayoutObject->node())->userAgentShadowRoot()->getElementById(ShadowElementNames::sliderThumb())->boundingBox(); diff --git a/third_party/WebKit/Source/modules/accessibility/AXTable.cpp b/third_party/WebKit/Source/modules/accessibility/AXTable.cpp index ce598f4..79b6ea7 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXTable.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXTable.cpp @@ -100,7 +100,7 @@ static bool elementHasAriaRole(const Element* element) bool AXTable::isDataTable() const { - if (!m_layoutObject || !node()) + if (!m_layoutObject || !getNode()) return false; // Do not consider it a data table if it has an ARIA role. @@ -110,7 +110,7 @@ bool AXTable::isDataTable() const // When a section of the document is contentEditable, all tables should be // treated as data tables, otherwise users may not be able to work with rich // text editors that allow creating and editing tables. - if (node() && node()->hasEditableStyle()) + if (getNode() && getNode()->hasEditableStyle()) return true; // This employs a heuristic to determine if this table should appear. diff --git a/third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp b/third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp index 7835080..ee2d673 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp @@ -52,7 +52,7 @@ AXTableCell* AXTableCell::create(LayoutObject* layoutObject, AXObjectCacheImpl& bool AXTableCell::isTableHeaderCell() const { - return node() && node()->hasTagName(thTag); + return getNode() && getNode()->hasTagName(thTag); } bool AXTableCell::isRowHeaderCell() const diff --git a/third_party/WebKit/Source/modules/accessibility/AXTableColumn.cpp b/third_party/WebKit/Source/modules/accessibility/AXTableColumn.cpp index e7a6c3c..15d4bb1 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXTableColumn.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXTableColumn.cpp @@ -70,7 +70,7 @@ void AXTableColumn::headerObjectsForColumn(AXObjectVector& headers) if (!m_parent) return; - LayoutObject* layoutObject = m_parent->layoutObject(); + LayoutObject* layoutObject = m_parent->getLayoutObject(); if (!layoutObject) return; diff --git a/third_party/WebKit/Source/modules/accessibility/InspectorTypeBuilderHelper.cpp b/third_party/WebKit/Source/modules/accessibility/InspectorTypeBuilderHelper.cpp index 11fbef5..b0886b7 100644 --- a/third_party/WebKit/Source/modules/accessibility/InspectorTypeBuilderHelper.cpp +++ b/third_party/WebKit/Source/modules/accessibility/InspectorTypeBuilderHelper.cpp @@ -90,7 +90,7 @@ PassOwnPtr<AXValue> createBooleanValue(bool value, const String& type) PassOwnPtr<AXRelatedNode> relatedNodeForAXObject(const AXObject* axObject, String* name = nullptr) { - Node* node = axObject->node(); + Node* node = axObject->getNode(); if (!node) return PassOwnPtr<AXRelatedNode>(); int backendNodeId = DOMNodeIds::idForNode(node); diff --git a/third_party/WebKit/Source/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.cpp b/third_party/WebKit/Source/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.cpp index f0554b4..d09afbb 100644 --- a/third_party/WebKit/Source/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.cpp +++ b/third_party/WebKit/Source/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.cpp @@ -56,13 +56,13 @@ void SetSinkIdResolver::startAsync() void SetSinkIdResolver::timerFired(Timer<SetSinkIdResolver>* timer) { - ExecutionContext* context = executionContext(); + ExecutionContext* context = getExecutionContext(); ASSERT(context && context->isDocument()); OwnPtr<SetSinkIdCallbacks> callbacks = adoptPtr(new SetSinkIdCallbacks(this, *m_element, m_sinkId)); WebMediaPlayer* webMediaPlayer = m_element->webMediaPlayer(); if (webMediaPlayer) { // Using leakPtr() to transfer ownership because |webMediaPlayer| is a platform object that takes raw pointers - webMediaPlayer->setSinkId(m_sinkId, WebSecurityOrigin(context->securityOrigin()), callbacks.leakPtr()); + webMediaPlayer->setSinkId(m_sinkId, WebSecurityOrigin(context->getSecurityOrigin()), callbacks.leakPtr()); } else { if (AudioOutputDeviceClient* client = AudioOutputDeviceClient::from(context)) { client->checkIfAudioSinkExistsAndIsAuthorized(context, m_sinkId, callbacks.release()); diff --git a/third_party/WebKit/Source/modules/audio_output_devices/SetSinkIdCallbacks.cpp b/third_party/WebKit/Source/modules/audio_output_devices/SetSinkIdCallbacks.cpp index 1c24924..07b3a8ed 100644 --- a/third_party/WebKit/Source/modules/audio_output_devices/SetSinkIdCallbacks.cpp +++ b/third_party/WebKit/Source/modules/audio_output_devices/SetSinkIdCallbacks.cpp @@ -44,7 +44,7 @@ SetSinkIdCallbacks::~SetSinkIdCallbacks() void SetSinkIdCallbacks::onSuccess() { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; HTMLMediaElementAudioOutputDevice& aodElement = HTMLMediaElementAudioOutputDevice::from(*m_element); @@ -54,7 +54,7 @@ void SetSinkIdCallbacks::onSuccess() void SetSinkIdCallbacks::onError(WebSetSinkIdError error) { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->reject(ToException(error)); diff --git a/third_party/WebKit/Source/modules/background_sync/SyncCallbacks.cpp b/third_party/WebKit/Source/modules/background_sync/SyncCallbacks.cpp index a8b1fac..9e2af89 100644 --- a/third_party/WebKit/Source/modules/background_sync/SyncCallbacks.cpp +++ b/third_party/WebKit/Source/modules/background_sync/SyncCallbacks.cpp @@ -26,13 +26,13 @@ SyncRegistrationCallbacks::~SyncRegistrationCallbacks() void SyncRegistrationCallbacks::onSuccess(WebPassOwnPtr<WebSyncRegistration> webSyncRegistration) { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) { + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) { return; } OwnPtr<WebSyncRegistration> registration = webSyncRegistration.release(); if (!registration) { - m_resolver->resolve(v8::Null(m_resolver->scriptState()->isolate())); + m_resolver->resolve(v8::Null(m_resolver->getScriptState()->isolate())); return; } m_resolver->resolve(); @@ -40,7 +40,7 @@ void SyncRegistrationCallbacks::onSuccess(WebPassOwnPtr<WebSyncRegistration> web void SyncRegistrationCallbacks::onError(const WebSyncError& error) { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) { + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) { return; } m_resolver->reject(SyncError::take(m_resolver.get(), error)); @@ -60,7 +60,7 @@ SyncGetRegistrationsCallbacks::~SyncGetRegistrationsCallbacks() void SyncGetRegistrationsCallbacks::onSuccess(const WebVector<WebSyncRegistration*>& webSyncRegistrations) { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) { + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) { return; } Vector<String> tags; @@ -72,7 +72,7 @@ void SyncGetRegistrationsCallbacks::onSuccess(const WebVector<WebSyncRegistratio void SyncGetRegistrationsCallbacks::onError(const WebSyncError& error) { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) { + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) { return; } m_resolver->reject(SyncError::take(m_resolver.get(), error)); diff --git a/third_party/WebKit/Source/modules/background_sync/SyncManager.cpp b/third_party/WebKit/Source/modules/background_sync/SyncManager.cpp index f58803e..a70b1be 100644 --- a/third_party/WebKit/Source/modules/background_sync/SyncManager.cpp +++ b/third_party/WebKit/Source/modules/background_sync/SyncManager.cpp @@ -44,8 +44,8 @@ ScriptPromise SyncManager::registerFunction(ScriptState* scriptState, ExecutionC if (!m_registration->active()) return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(AbortError, "Registration failed - no active Service Worker")); - if (scriptState->executionContext()->isDocument()) { - Document* document = toDocument(scriptState->executionContext()); + if (scriptState->getExecutionContext()->isDocument()) { + Document* document = toDocument(scriptState->getExecutionContext()); if (!document->domWindow() || !document->frame()) return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(InvalidStateError, "Document is detached from window.")); if (!document->frame()->isMainFrame()) diff --git a/third_party/WebKit/Source/modules/battery/BatteryManager.cpp b/third_party/WebKit/Source/modules/battery/BatteryManager.cpp index e2a281f..5304ce5 100644 --- a/third_party/WebKit/Source/modules/battery/BatteryManager.cpp +++ b/third_party/WebKit/Source/modules/battery/BatteryManager.cpp @@ -33,10 +33,10 @@ BatteryManager::BatteryManager(ExecutionContext* context) ScriptPromise BatteryManager::startRequest(ScriptState* scriptState) { if (!m_batteryProperty) { - m_batteryProperty = new BatteryProperty(scriptState->executionContext(), this, BatteryProperty::Ready); + m_batteryProperty = new BatteryProperty(scriptState->getExecutionContext(), this, BatteryProperty::Ready); // If the context is in a stopped state already, do not start updating. - if (!executionContext() || executionContext()->activeDOMObjectsAreStopped()) { + if (!getExecutionContext() || getExecutionContext()->activeDOMObjectsAreStopped()) { m_batteryProperty->resolve(this); } else { m_hasEventListener = true; @@ -79,7 +79,7 @@ void BatteryManager::didUpdateData() return; } - Document* document = toDocument(executionContext()); + Document* document = toDocument(getExecutionContext()); ASSERT(document); if (document->activeDOMObjectsAreSuspended() || document->activeDOMObjectsAreStopped()) return; diff --git a/third_party/WebKit/Source/modules/battery/BatteryManager.h b/third_party/WebKit/Source/modules/battery/BatteryManager.h index 114273c..52f2657 100644 --- a/third_party/WebKit/Source/modules/battery/BatteryManager.h +++ b/third_party/WebKit/Source/modules/battery/BatteryManager.h @@ -29,7 +29,7 @@ public: // EventTarget implementation. const WTF::AtomicString& interfaceName() const override { return EventTargetNames::BatteryManager; } - ExecutionContext* executionContext() const override { return ContextLifecycleObserver::executionContext(); } + ExecutionContext* getExecutionContext() const override { return ContextLifecycleObserver::getExecutionContext(); } bool charging(); double chargingTime(); diff --git a/third_party/WebKit/Source/modules/battery/NavigatorBattery.cpp b/third_party/WebKit/Source/modules/battery/NavigatorBattery.cpp index 38816d7..d38a7ad 100644 --- a/third_party/WebKit/Source/modules/battery/NavigatorBattery.cpp +++ b/third_party/WebKit/Source/modules/battery/NavigatorBattery.cpp @@ -21,7 +21,7 @@ ScriptPromise NavigatorBattery::getBattery(ScriptState* scriptState, Navigator& ScriptPromise NavigatorBattery::getBattery(ScriptState* scriptState) { if (!m_batteryManager) - m_batteryManager = BatteryManager::create(scriptState->executionContext()); + m_batteryManager = BatteryManager::create(scriptState->getExecutionContext()); return m_batteryManager->startRequest(scriptState); } diff --git a/third_party/WebKit/Source/modules/bluetooth/Bluetooth.cpp b/third_party/WebKit/Source/modules/bluetooth/Bluetooth.cpp index c881c4d..c2b6821 100644 --- a/third_party/WebKit/Source/modules/bluetooth/Bluetooth.cpp +++ b/third_party/WebKit/Source/modules/bluetooth/Bluetooth.cpp @@ -145,7 +145,7 @@ ScriptPromise Bluetooth::requestDevice(ScriptState* scriptState, const RequestDe // 1. If the incumbent settings object is not a secure context, reject promise with a SecurityError and abort these steps. String errorMessage; - if (!scriptState->executionContext()->isSecureContext(errorMessage)) { + if (!scriptState->getExecutionContext()->isSecureContext(errorMessage)) { return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(SecurityError, errorMessage)); } diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp index b763a3b..57585d5 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp @@ -34,7 +34,7 @@ BluetoothDevice::BluetoothDevice(ExecutionContext* context, PassOwnPtr<WebBlueto BluetoothDevice* BluetoothDevice::take(ScriptPromiseResolver* resolver, PassOwnPtr<WebBluetoothDevice> webDevice) { ASSERT(webDevice); - BluetoothDevice* device = new BluetoothDevice(resolver->executionContext(), webDevice); + BluetoothDevice* device = new BluetoothDevice(resolver->getExecutionContext(), webDevice); device->suspendIfNeeded(); return device; } @@ -60,7 +60,7 @@ bool BluetoothDevice::disconnectGATTIfConnected() { if (m_gatt->connected()) { m_gatt->setConnected(false); - BluetoothSupplement::fromExecutionContext(executionContext())->disconnect(id()); + BluetoothSupplement::fromExecutionContext(getExecutionContext())->disconnect(id()); return true; } return false; @@ -71,9 +71,9 @@ const WTF::AtomicString& BluetoothDevice::interfaceName() const return EventTargetNames::BluetoothDevice; } -ExecutionContext* BluetoothDevice::executionContext() const +ExecutionContext* BluetoothDevice::getExecutionContext() const { - return ActiveDOMObject::executionContext(); + return ActiveDOMObject::getExecutionContext(); } DEFINE_TRACE(BluetoothDevice) diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h b/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h index bd38f71..f4a8072b 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h @@ -76,7 +76,7 @@ public: // EventTarget methods: const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; // Interface required by Garbage Collection: DECLARE_VIRTUAL_TRACE(); diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp index d457702..0214f94 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp @@ -46,7 +46,7 @@ BluetoothRemoteGATTCharacteristic* BluetoothRemoteGATTCharacteristic::take(Scrip if (!webCharacteristic) { return nullptr; } - BluetoothRemoteGATTCharacteristic* characteristic = new BluetoothRemoteGATTCharacteristic(resolver->executionContext(), webCharacteristic); + BluetoothRemoteGATTCharacteristic* characteristic = new BluetoothRemoteGATTCharacteristic(resolver->getExecutionContext(), webCharacteristic); // See note in ActiveDOMObject about suspendIfNeeded. characteristic->suspendIfNeeded(); return characteristic; @@ -80,7 +80,7 @@ void BluetoothRemoteGATTCharacteristic::notifyCharacteristicObjectRemoved() { if (!m_stopped) { m_stopped = true; - WebBluetooth* webbluetooth = BluetoothSupplement::fromExecutionContext(ActiveDOMObject::executionContext()); + WebBluetooth* webbluetooth = BluetoothSupplement::fromExecutionContext(ActiveDOMObject::getExecutionContext()); webbluetooth->characteristicObjectRemoved(m_webCharacteristic->characteristicInstanceID, this); } } @@ -90,9 +90,9 @@ const WTF::AtomicString& BluetoothRemoteGATTCharacteristic::interfaceName() cons return EventTargetNames::BluetoothRemoteGATTCharacteristic; } -ExecutionContext* BluetoothRemoteGATTCharacteristic::executionContext() const +ExecutionContext* BluetoothRemoteGATTCharacteristic::getExecutionContext() const { - return ActiveDOMObject::executionContext(); + return ActiveDOMObject::getExecutionContext(); } bool BluetoothRemoteGATTCharacteristic::addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener> listener, const EventListenerOptions& options) @@ -100,7 +100,7 @@ bool BluetoothRemoteGATTCharacteristic::addEventListenerInternal(const AtomicStr // We will also need to unregister a characteristic once all the event // listeners have been removed. See http://crbug.com/541390 if (eventType == EventTypeNames::characteristicvaluechanged) { - WebBluetooth* webbluetooth = BluetoothSupplement::fromExecutionContext(executionContext()); + WebBluetooth* webbluetooth = BluetoothSupplement::fromExecutionContext(getExecutionContext()); webbluetooth->registerCharacteristicObject(m_webCharacteristic->characteristicInstanceID, this); } return EventTarget::addEventListenerInternal(eventType, listener, options); @@ -112,7 +112,7 @@ public: void onSuccess(const WebVector<uint8_t>& value) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; RefPtr<DOMDataView> domDataView = ConvertWebVectorToDataView(value); @@ -124,7 +124,7 @@ public: void onError(const WebBluetoothError& e) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->reject(BluetoothError::take(m_resolver, e)); } @@ -151,7 +151,7 @@ public: void onSuccess(const WebVector<uint8_t>& value) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; if (m_webCharacteristic) { @@ -162,7 +162,7 @@ public: void onError(const WebBluetoothError& e) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->reject(BluetoothError::take(m_resolver, e)); } diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h index 3d7d20b..b48d85f 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h @@ -67,7 +67,7 @@ public: // EventTarget methods: const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const; + ExecutionContext* getExecutionContext() const; // Interface required by garbage collection. DECLARE_VIRTUAL_TRACE(); diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp index 9ca7aad..cb2509f 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp @@ -49,7 +49,7 @@ public: void onSuccess() override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_device->gatt()->setConnected(true); if (!m_device->page()->isPageVisible()) { @@ -66,7 +66,7 @@ public: void onError(const WebBluetoothError& e) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->reject(BluetoothError::take(m_resolver, e)); } @@ -81,7 +81,7 @@ ScriptPromise BluetoothRemoteGATTServer::connect(ScriptState* scriptState) // This is a short term solution instead of implementing a tab indicator // for bluetooth connections. // https://crbug.com/579746 - if (!toDocument(scriptState->executionContext())->page()->isPageVisible()) { + if (!toDocument(scriptState->getExecutionContext())->page()->isPageVisible()) { return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(SecurityError, kPageHiddenError)); } diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothSupplement.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothSupplement.cpp index e77a7ed..14169ac 100644 --- a/third_party/WebKit/Source/modules/bluetooth/BluetoothSupplement.cpp +++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothSupplement.cpp @@ -36,7 +36,7 @@ WebBluetooth* BluetoothSupplement::from(LocalFrame* frame) WebBluetooth* BluetoothSupplement::fromScriptState(ScriptState* scriptState) { - return fromExecutionContext(scriptState->executionContext()); + return fromExecutionContext(scriptState->getExecutionContext()); } WebBluetooth* BluetoothSupplement::fromExecutionContext(ExecutionContext* executionContext) diff --git a/third_party/WebKit/Source/modules/cachestorage/Cache.cpp b/third_party/WebKit/Source/modules/cachestorage/Cache.cpp index 01ec160..e6962b1 100644 --- a/third_party/WebKit/Source/modules/cachestorage/Cache.cpp +++ b/third_party/WebKit/Source/modules/cachestorage/Cache.cpp @@ -49,15 +49,15 @@ public: void onSuccess(const WebServiceWorkerResponse& webResponse) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; - m_resolver->resolve(Response::create(m_resolver->scriptState()->executionContext(), webResponse)); + m_resolver->resolve(Response::create(m_resolver->getScriptState()->getExecutionContext(), webResponse)); m_resolver.clear(); } void onError(WebServiceWorkerCacheError reason) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; if (reason == WebServiceWorkerCacheErrorNotFound) m_resolver->resolve(); @@ -79,18 +79,18 @@ public: void onSuccess(const WebVector<WebServiceWorkerResponse>& webResponses) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; HeapVector<Member<Response>> responses; for (size_t i = 0; i < webResponses.size(); ++i) - responses.append(Response::create(m_resolver->scriptState()->executionContext(), webResponses[i])); + responses.append(Response::create(m_resolver->getScriptState()->getExecutionContext(), webResponses[i])); m_resolver->resolve(responses); m_resolver.clear(); } void onError(WebServiceWorkerCacheError reason) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->reject(CacheStorageError::createException(reason)); m_resolver.clear(); @@ -109,7 +109,7 @@ public: void onSuccess() override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->resolve(true); m_resolver.clear(); @@ -117,7 +117,7 @@ public: void onError(WebServiceWorkerCacheError reason) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; if (reason == WebServiceWorkerCacheErrorNotFound) m_resolver->resolve(false); @@ -139,18 +139,18 @@ public: void onSuccess(const WebVector<WebServiceWorkerRequest>& webRequests) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; HeapVector<Member<Request>> requests; for (size_t i = 0; i < webRequests.size(); ++i) - requests.append(Request::create(m_resolver->scriptState()->executionContext(), webRequests[i])); + requests.append(Request::create(m_resolver->getScriptState()->getExecutionContext(), webRequests[i])); m_resolver->resolve(requests); m_resolver.clear(); } void onError(WebServiceWorkerCacheError reason) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->reject(CacheStorageError::createException(reason)); m_resolver.clear(); @@ -230,24 +230,24 @@ public: ScriptValue call(ScriptValue value) override { NonThrowableExceptionState exceptionState; - HeapVector<Member<Response>> responses = toMemberNativeArray<Response, V8Response>(value.v8Value(), m_requests.size(), scriptState()->isolate(), exceptionState); + HeapVector<Member<Response>> responses = toMemberNativeArray<Response, V8Response>(value.v8Value(), m_requests.size(), getScriptState()->isolate(), exceptionState); for (const auto& response : responses) { if (!response->ok()) { - ScriptPromise rejection = ScriptPromise::reject(scriptState(), V8ThrowException::createTypeError(scriptState()->isolate(), "Request failed")); - return ScriptValue(scriptState(), rejection.v8Value()); + ScriptPromise rejection = ScriptPromise::reject(getScriptState(), V8ThrowException::createTypeError(getScriptState()->isolate(), "Request failed")); + return ScriptValue(getScriptState(), rejection.v8Value()); } if (varyHeaderContainsAsterisk(response)) { - ScriptPromise rejection = ScriptPromise::reject(scriptState(), V8ThrowException::createTypeError(scriptState()->isolate(), "Vary header contains *")); - return ScriptValue(scriptState(), rejection.v8Value()); + ScriptPromise rejection = ScriptPromise::reject(getScriptState(), V8ThrowException::createTypeError(getScriptState()->isolate(), "Vary header contains *")); + return ScriptValue(getScriptState(), rejection.v8Value()); } } for (const auto& response : responses) RecordResponseTypeForAdd(response); - ScriptPromise putPromise = m_cache->putImpl(scriptState(), m_requests, responses); - return ScriptValue(scriptState(), putPromise.v8Value()); + ScriptPromise putPromise = m_cache->putImpl(getScriptState(), m_requests, responses); + return ScriptValue(getScriptState(), putPromise.v8Value()); } DEFINE_INLINE_VIRTUAL_TRACE() @@ -285,7 +285,7 @@ public: ASSERT(index < m_batchOperations.size()); if (m_completed) return; - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_batchOperations[index] = batchOperation; if (--m_numberOfRemainingOperations != 0) @@ -298,9 +298,9 @@ public: if (m_completed) return; m_completed = true; - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; - ScriptState* state = m_resolver->scriptState(); + ScriptState* state = m_resolver->getScriptState(); ScriptState::Scope scope(state); m_resolver->reject(V8ThrowException::createTypeError(state->isolate(), errorMessage)); } @@ -487,7 +487,7 @@ ScriptPromise Cache::matchImpl(ScriptState* scriptState, const Request* request, { WebServiceWorkerRequest webRequest; request->populateWebServiceWorkerRequest(webRequest); - checkCacheQueryOptions(options, scriptState->executionContext()); + checkCacheQueryOptions(options, scriptState->getExecutionContext()); ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); const ScriptPromise promise = resolver->promise(); @@ -507,7 +507,7 @@ ScriptPromise Cache::matchAllImpl(ScriptState* scriptState, const Request* reque { WebServiceWorkerRequest webRequest; request->populateWebServiceWorkerRequest(webRequest); - checkCacheQueryOptions(options, scriptState->executionContext()); + checkCacheQueryOptions(options, scriptState->getExecutionContext()); ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); const ScriptPromise promise = resolver->promise(); @@ -542,7 +542,7 @@ ScriptPromise Cache::deleteImpl(ScriptState* scriptState, const Request* request WebVector<WebServiceWorkerCache::BatchOperation> batchOperations(size_t(1)); batchOperations[0].operationType = WebServiceWorkerCache::OperationTypeDelete; request->populateWebServiceWorkerRequest(batchOperations[0].request); - checkCacheQueryOptions(options, scriptState->executionContext()); + checkCacheQueryOptions(options, scriptState->getExecutionContext()); batchOperations[0].matchParams = toWebQueryParams(options); ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); @@ -584,7 +584,7 @@ ScriptPromise Cache::putImpl(ScriptState* scriptState, const HeapVector<Member<R // If the response has body, read the all data and create // the blob handle and dispatch the put batch asynchronously. FetchDataLoader* loader = FetchDataLoader::createLoaderAsBlobHandle(responses[i]->internalMIMEType()); - buffer->startLoading(scriptState->executionContext(), loader, new BlobHandleCallbackForPut(i, barrierCallback, requests[i], responses[i])); + buffer->startLoading(scriptState->getExecutionContext(), loader, new BlobHandleCallbackForPut(i, barrierCallback, requests[i], responses[i])); continue; } @@ -610,7 +610,7 @@ ScriptPromise Cache::keysImpl(ScriptState* scriptState, const Request* request, { WebServiceWorkerRequest webRequest; request->populateWebServiceWorkerRequest(webRequest); - checkCacheQueryOptions(options, scriptState->executionContext()); + checkCacheQueryOptions(options, scriptState->getExecutionContext()); ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); const ScriptPromise promise = resolver->promise(); diff --git a/third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp b/third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp index dadae07..c339ad1 100644 --- a/third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp +++ b/third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp @@ -27,7 +27,7 @@ DOMException* createNoImplementationException() bool commonChecks(ScriptState* scriptState, ExceptionState& exceptionState) { - ExecutionContext* executionContext = scriptState->executionContext(); + ExecutionContext* executionContext = scriptState->getExecutionContext(); // FIXME: May be null due to worker termination: http://crbug.com/413518. if (!executionContext) return false; @@ -62,7 +62,7 @@ public: void onSuccess() override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->resolve(true); m_resolver.clear(); @@ -70,7 +70,7 @@ public: void onError(WebServiceWorkerCacheError reason) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; if (reason == WebServiceWorkerCacheErrorNotFound) m_resolver->resolve(false); @@ -93,7 +93,7 @@ public: void onSuccess(WebPassOwnPtr<WebServiceWorkerCache> webCache) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; Cache* cache = Cache::create(m_cacheStorage->m_scopedFetcher, webCache.release()); m_cacheStorage->m_nameToCacheMap.set(m_cacheName, cache); @@ -103,7 +103,7 @@ public: void onError(WebServiceWorkerCacheError reason) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; if (reason == WebServiceWorkerCacheErrorNotFound) m_resolver->resolve(); @@ -127,15 +127,15 @@ public: void onSuccess(const WebServiceWorkerResponse& webResponse) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; - m_resolver->resolve(Response::create(m_resolver->scriptState()->executionContext(), webResponse)); + m_resolver->resolve(Response::create(m_resolver->getScriptState()->getExecutionContext(), webResponse)); m_resolver.clear(); } void onError(WebServiceWorkerCacheError reason) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; if (reason == WebServiceWorkerCacheErrorNotFound) m_resolver->resolve(); @@ -160,7 +160,7 @@ public: void onSuccess() override { m_cacheStorage->m_nameToCacheMap.remove(m_cacheName); - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->resolve(true); m_resolver.clear(); @@ -168,7 +168,7 @@ public: void onError(WebServiceWorkerCacheError reason) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; if (reason == WebServiceWorkerCacheErrorNotFound) m_resolver->resolve(false); @@ -193,7 +193,7 @@ public: void onSuccess(const WebVector<WebString>& keys) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; Vector<String> wtfKeys; for (size_t i = 0; i < keys.size(); ++i) @@ -204,7 +204,7 @@ public: void onError(WebServiceWorkerCacheError reason) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->reject(CacheStorageError::createException(reason)); m_resolver.clear(); @@ -312,7 +312,7 @@ ScriptPromise CacheStorage::matchImpl(ScriptState* scriptState, const Request* r { WebServiceWorkerRequest webRequest; request->populateWebServiceWorkerRequest(webRequest); - checkCacheQueryOptions(options, scriptState->executionContext()); + checkCacheQueryOptions(options, scriptState->getExecutionContext()); ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); const ScriptPromise promise = resolver->promise(); diff --git a/third_party/WebKit/Source/modules/cachestorage/CacheTest.cpp b/third_party/WebKit/Source/modules/cachestorage/CacheTest.cpp index 1c4030c..fcd5750 100644 --- a/third_party/WebKit/Source/modules/cachestorage/CacheTest.cpp +++ b/third_party/WebKit/Source/modules/cachestorage/CacheTest.cpp @@ -231,15 +231,15 @@ public: return Cache::create(fetcher->weakPtr(), adoptPtr(webCache)); } - ScriptState* scriptState() { return ScriptState::forMainWorld(m_page->document().frame()); } - ExecutionContext* executionContext() { return scriptState()->executionContext(); } - v8::Isolate* isolate() { return scriptState()->isolate(); } - v8::Local<v8::Context> context() { return scriptState()->context(); } + ScriptState* getScriptState() { return ScriptState::forMainWorld(m_page->document().frame()); } + ExecutionContext* getExecutionContext() { return getScriptState()->getExecutionContext(); } + v8::Isolate* isolate() { return getScriptState()->isolate(); } + v8::Local<v8::Context> context() { return getScriptState()->context(); } Request* newRequestFromUrl(const String& url) { TrackExceptionState exceptionState; - Request* request = Request::create(scriptState(), url, exceptionState); + Request* request = Request::create(getScriptState(), url, exceptionState); EXPECT_FALSE(exceptionState.hadException()); return exceptionState.hadException() ? 0 : request; } @@ -248,7 +248,7 @@ public: ScriptValue getRejectValue(ScriptPromise& promise) { ScriptValue onReject; - promise.then(UnreachableFunction::create(scriptState()), TestFunction::create(scriptState(), &onReject)); + promise.then(UnreachableFunction::create(getScriptState()), TestFunction::create(getScriptState(), &onReject)); v8::MicrotasksScope::PerformCheckpoint(isolate()); return onReject; } @@ -262,7 +262,7 @@ public: ScriptValue getResolveValue(ScriptPromise& promise) { ScriptValue onResolve; - promise.then(TestFunction::create(scriptState(), &onResolve), UnreachableFunction::create(scriptState())); + promise.then(TestFunction::create(getScriptState(), &onResolve), UnreachableFunction::create(getScriptState())); v8::MicrotasksScope::PerformCheckpoint(isolate()); return onResolve; } @@ -342,7 +342,7 @@ RequestInfo requestToRequestInfo(Request* value) TEST_F(CacheStorageTest, Basics) { - ScriptState::Scope scope(scriptState()); + ScriptState::Scope scope(getScriptState()); OwnPtrWillBeRawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create(); ErrorWebCacheForTests* testCache; Cache* cache = createCache(fetcher.get(), testCache = new NotImplementedErrorCache()); @@ -351,16 +351,16 @@ TEST_F(CacheStorageTest, Basics) const String url = "http://www.cachetest.org/"; CacheQueryOptions options; - ScriptPromise matchPromise = cache->match(scriptState(), stringToRequestInfo(url), options, exceptionState()); + ScriptPromise matchPromise = cache->match(getScriptState(), stringToRequestInfo(url), options, exceptionState()); EXPECT_EQ(kNotImplementedString, getRejectString(matchPromise)); cache = createCache(fetcher.get(), testCache = new ErrorWebCacheForTests(WebServiceWorkerCacheErrorNotFound)); - matchPromise = cache->match(scriptState(), stringToRequestInfo(url), options, exceptionState()); + matchPromise = cache->match(getScriptState(), stringToRequestInfo(url), options, exceptionState()); ScriptValue scriptValue = getResolveValue(matchPromise); EXPECT_TRUE(scriptValue.isUndefined()); cache = createCache(fetcher.get(), testCache = new ErrorWebCacheForTests(WebServiceWorkerCacheErrorExists)); - matchPromise = cache->match(scriptState(), stringToRequestInfo(url), options, exceptionState()); + matchPromise = cache->match(getScriptState(), stringToRequestInfo(url), options, exceptionState()); EXPECT_EQ("InvalidAccessError: Entry already exists.", getRejectString(matchPromise)); } @@ -368,7 +368,7 @@ TEST_F(CacheStorageTest, Basics) // which are tested later. TEST_F(CacheStorageTest, BasicArguments) { - ScriptState::Scope scope(scriptState()); + ScriptState::Scope scope(getScriptState()); OwnPtrWillBeRawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create(); ErrorWebCacheForTests* testCache; Cache* cache = createCache(fetcher.get(), testCache = new NotImplementedErrorCache()); @@ -388,35 +388,35 @@ TEST_F(CacheStorageTest, BasicArguments) Request* request = newRequestFromUrl(url); ASSERT(request); - ScriptPromise matchResult = cache->match(scriptState(), requestToRequestInfo(request), options, exceptionState()); + ScriptPromise matchResult = cache->match(getScriptState(), requestToRequestInfo(request), options, exceptionState()); EXPECT_EQ("dispatchMatch", testCache->getAndClearLastErrorWebCacheMethodCalled()); EXPECT_EQ(kNotImplementedString, getRejectString(matchResult)); - ScriptPromise stringMatchResult = cache->match(scriptState(), stringToRequestInfo(url), options, exceptionState()); + ScriptPromise stringMatchResult = cache->match(getScriptState(), stringToRequestInfo(url), options, exceptionState()); EXPECT_EQ("dispatchMatch", testCache->getAndClearLastErrorWebCacheMethodCalled()); EXPECT_EQ(kNotImplementedString, getRejectString(stringMatchResult)); request = newRequestFromUrl(url); ASSERT(request); - ScriptPromise matchAllResult = cache->matchAll(scriptState(), requestToRequestInfo(request), options, exceptionState()); + ScriptPromise matchAllResult = cache->matchAll(getScriptState(), requestToRequestInfo(request), options, exceptionState()); EXPECT_EQ("dispatchMatchAll", testCache->getAndClearLastErrorWebCacheMethodCalled()); EXPECT_EQ(kNotImplementedString, getRejectString(matchAllResult)); - ScriptPromise stringMatchAllResult = cache->matchAll(scriptState(), stringToRequestInfo(url), options, exceptionState()); + ScriptPromise stringMatchAllResult = cache->matchAll(getScriptState(), stringToRequestInfo(url), options, exceptionState()); EXPECT_EQ("dispatchMatchAll", testCache->getAndClearLastErrorWebCacheMethodCalled()); EXPECT_EQ(kNotImplementedString, getRejectString(stringMatchAllResult)); - ScriptPromise keysResult1 = cache->keys(scriptState(), exceptionState()); + ScriptPromise keysResult1 = cache->keys(getScriptState(), exceptionState()); EXPECT_EQ("dispatchKeys", testCache->getAndClearLastErrorWebCacheMethodCalled()); EXPECT_EQ(kNotImplementedString, getRejectString(keysResult1)); request = newRequestFromUrl(url); ASSERT(request); - ScriptPromise keysResult2 = cache->keys(scriptState(), requestToRequestInfo(request), options, exceptionState()); + ScriptPromise keysResult2 = cache->keys(getScriptState(), requestToRequestInfo(request), options, exceptionState()); EXPECT_EQ("dispatchKeys", testCache->getAndClearLastErrorWebCacheMethodCalled()); EXPECT_EQ(kNotImplementedString, getRejectString(keysResult2)); - ScriptPromise stringKeysResult2 = cache->keys(scriptState(), stringToRequestInfo(url), options, exceptionState()); + ScriptPromise stringKeysResult2 = cache->keys(getScriptState(), stringToRequestInfo(url), options, exceptionState()); EXPECT_EQ("dispatchKeys", testCache->getAndClearLastErrorWebCacheMethodCalled()); EXPECT_EQ(kNotImplementedString, getRejectString(stringKeysResult2)); } @@ -424,7 +424,7 @@ TEST_F(CacheStorageTest, BasicArguments) // Tests that arguments are faithfully passed to API calls that degrade to batch operations. TEST_F(CacheStorageTest, BatchOperationArguments) { - ScriptState::Scope scope(scriptState()); + ScriptState::Scope scope(getScriptState()); OwnPtrWillBeRawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create(); ErrorWebCacheForTests* testCache; Cache* cache = createCache(fetcher.get(), testCache = new NotImplementedErrorCache()); @@ -443,7 +443,7 @@ TEST_F(CacheStorageTest, BatchOperationArguments) WebServiceWorkerResponse webResponse; webResponse.setURL(KURL(ParsedURLString, url)); - Response* response = Response::create(executionContext(), webResponse); + Response* response = Response::create(getExecutionContext(), webResponse); WebVector<WebServiceWorkerCache::BatchOperation> expectedDeleteOperations(size_t(1)); { @@ -455,11 +455,11 @@ TEST_F(CacheStorageTest, BatchOperationArguments) } testCache->setExpectedBatchOperations(&expectedDeleteOperations); - ScriptPromise deleteResult = cache->deleteFunction(scriptState(), requestToRequestInfo(request), options, exceptionState()); + ScriptPromise deleteResult = cache->deleteFunction(getScriptState(), requestToRequestInfo(request), options, exceptionState()); EXPECT_EQ("dispatchBatch", testCache->getAndClearLastErrorWebCacheMethodCalled()); EXPECT_EQ(kNotImplementedString, getRejectString(deleteResult)); - ScriptPromise stringDeleteResult = cache->deleteFunction(scriptState(), stringToRequestInfo(url), options, exceptionState()); + ScriptPromise stringDeleteResult = cache->deleteFunction(getScriptState(), stringToRequestInfo(url), options, exceptionState()); EXPECT_EQ("dispatchBatch", testCache->getAndClearLastErrorWebCacheMethodCalled()); EXPECT_EQ(kNotImplementedString, getRejectString(stringDeleteResult)); @@ -475,11 +475,11 @@ TEST_F(CacheStorageTest, BatchOperationArguments) request = newRequestFromUrl(url); ASSERT(request); - ScriptPromise putResult = cache->put(scriptState(), requestToRequestInfo(request), response->clone(exceptionState()), exceptionState()); + ScriptPromise putResult = cache->put(getScriptState(), requestToRequestInfo(request), response->clone(exceptionState()), exceptionState()); EXPECT_EQ("dispatchBatch", testCache->getAndClearLastErrorWebCacheMethodCalled()); EXPECT_EQ(kNotImplementedString, getRejectString(putResult)); - ScriptPromise stringPutResult = cache->put(scriptState(), stringToRequestInfo(url), response, exceptionState()); + ScriptPromise stringPutResult = cache->put(getScriptState(), stringToRequestInfo(url), response, exceptionState()); EXPECT_EQ("dispatchBatch", testCache->getAndClearLastErrorWebCacheMethodCalled()); EXPECT_EQ(kNotImplementedString, getRejectString(stringPutResult)); @@ -504,7 +504,7 @@ private: TEST_F(CacheStorageTest, MatchResponseTest) { - ScriptState::Scope scope(scriptState()); + ScriptState::Scope scope(getScriptState()); OwnPtrWillBeRawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create(); const String requestUrl = "http://request.url/"; const String responseUrl = "http://match.response.test/"; @@ -516,7 +516,7 @@ TEST_F(CacheStorageTest, MatchResponseTest) Cache* cache = createCache(fetcher.get(), new MatchTestCache(webResponse)); CacheQueryOptions options; - ScriptPromise result = cache->match(scriptState(), stringToRequestInfo(requestUrl), options, exceptionState()); + ScriptPromise result = cache->match(getScriptState(), stringToRequestInfo(requestUrl), options, exceptionState()); ScriptValue scriptValue = getResolveValue(result); Response* response = V8Response::toImplWithTypeCheck(isolate(), scriptValue.v8Value()); ASSERT_TRUE(response); @@ -540,7 +540,7 @@ private: TEST_F(CacheStorageTest, KeysResponseTest) { - ScriptState::Scope scope(scriptState()); + ScriptState::Scope scope(getScriptState()); OwnPtrWillBeRawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create(); const String url1 = "http://first.request/"; const String url2 = "http://second.request/"; @@ -555,7 +555,7 @@ TEST_F(CacheStorageTest, KeysResponseTest) Cache* cache = createCache(fetcher.get(), new KeysTestCache(webRequests)); - ScriptPromise result = cache->keys(scriptState(), exceptionState()); + ScriptPromise result = cache->keys(getScriptState(), exceptionState()); ScriptValue scriptValue = getResolveValue(result); Vector<v8::Local<v8::Value>> requests = toImplArray<Vector<v8::Local<v8::Value>>>(scriptValue.v8Value(), 0, isolate(), exceptionState()); @@ -591,7 +591,7 @@ private: TEST_F(CacheStorageTest, MatchAllAndBatchResponseTest) { - ScriptState::Scope scope(scriptState()); + ScriptState::Scope scope(getScriptState()); OwnPtrWillBeRawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create(); const String url1 = "http://first.response/"; const String url2 = "http://second.response/"; @@ -609,7 +609,7 @@ TEST_F(CacheStorageTest, MatchAllAndBatchResponseTest) Cache* cache = createCache(fetcher.get(), new MatchAllAndBatchTestCache(webResponses)); CacheQueryOptions options; - ScriptPromise result = cache->matchAll(scriptState(), stringToRequestInfo("http://some.url/"), options, exceptionState()); + ScriptPromise result = cache->matchAll(getScriptState(), stringToRequestInfo("http://some.url/"), options, exceptionState()); ScriptValue scriptValue = getResolveValue(result); Vector<v8::Local<v8::Value>> responses = toImplArray<Vector<v8::Local<v8::Value>>>(scriptValue.v8Value(), 0, isolate(), exceptionState()); @@ -621,7 +621,7 @@ TEST_F(CacheStorageTest, MatchAllAndBatchResponseTest) EXPECT_EQ(expectedUrls[i], response->url()); } - result = cache->deleteFunction(scriptState(), stringToRequestInfo("http://some.url/"), options, exceptionState()); + result = cache->deleteFunction(getScriptState(), stringToRequestInfo("http://some.url/"), options, exceptionState()); scriptValue = getResolveValue(result); EXPECT_TRUE(scriptValue.v8Value()->IsBoolean()); EXPECT_EQ(true, scriptValue.v8Value().As<v8::Boolean>()->Value()); @@ -629,7 +629,7 @@ TEST_F(CacheStorageTest, MatchAllAndBatchResponseTest) TEST_F(CacheStorageTest, Add) { - ScriptState::Scope scope(scriptState()); + ScriptState::Scope scope(getScriptState()); OwnPtrWillBeRawPtr<ScopedFetcherForTests> fetcher = ScopedFetcherForTests::create(); const String url = "http://www.cacheadd.test/"; const String contentType = "text/plain"; @@ -641,7 +641,7 @@ TEST_F(CacheStorageTest, Add) fetcher->setExpectedFetchUrl(&url); Request* request = newRequestFromUrl(url); - Response* response = Response::create(executionContext(), FetchFormDataConsumerHandle::create(content), contentType, ResponseInit(), exceptionState()); + Response* response = Response::create(getExecutionContext(), FetchFormDataConsumerHandle::create(content), contentType, ResponseInit(), exceptionState()); fetcher->setResponse(response); WebVector<WebServiceWorkerCache::BatchOperation> expectedPutOperations(size_t(1)); @@ -654,7 +654,7 @@ TEST_F(CacheStorageTest, Add) } testCache->setExpectedBatchOperations(&expectedPutOperations); - ScriptPromise addResult = cache->add(scriptState(), requestToRequestInfo(request), exceptionState()); + ScriptPromise addResult = cache->add(getScriptState(), requestToRequestInfo(request), exceptionState()); EXPECT_EQ(kNotImplementedString, getRejectString(addResult)); EXPECT_EQ(1, fetcher->fetchCount()); diff --git a/third_party/WebKit/Source/modules/cachestorage/GlobalCacheStorage.cpp b/third_party/WebKit/Source/modules/cachestorage/GlobalCacheStorage.cpp index deb839b..91b1779 100644 --- a/third_party/WebKit/Source/modules/cachestorage/GlobalCacheStorage.cpp +++ b/third_party/WebKit/Source/modules/cachestorage/GlobalCacheStorage.cpp @@ -40,8 +40,8 @@ public: CacheStorage* caches(T& fetchingScope, ExceptionState& exceptionState) { - ExecutionContext* context = fetchingScope.executionContext(); - if (!context->securityOrigin()->canAccessCacheStorage()) { + ExecutionContext* context = fetchingScope.getExecutionContext(); + if (!context->getSecurityOrigin()->canAccessCacheStorage()) { if (context->securityContext().isSandboxed(SandboxOrigin)) exceptionState.throwSecurityError("Cache storage is disabled because the context is sandboxed and lacks the 'allow-same-origin' flag."); else if (context->url().protocolIs("data")) @@ -52,7 +52,7 @@ public: } if (!m_caches) { - m_caches = CacheStorage::create(GlobalFetch::ScopedFetcher::from(fetchingScope), Platform::current()->cacheStorage(WebSecurityOrigin(context->securityOrigin()))); + m_caches = CacheStorage::create(GlobalFetch::ScopedFetcher::from(fetchingScope), Platform::current()->cacheStorage(WebSecurityOrigin(context->getSecurityOrigin()))); } return m_caches; } @@ -79,12 +79,12 @@ private: CacheStorage* GlobalCacheStorage::caches(DOMWindow& window, ExceptionState& exceptionState) { - return GlobalCacheStorageImpl<LocalDOMWindow>::from(toLocalDOMWindow(window), window.executionContext()).caches(toLocalDOMWindow(window), exceptionState); + return GlobalCacheStorageImpl<LocalDOMWindow>::from(toLocalDOMWindow(window), window.getExecutionContext()).caches(toLocalDOMWindow(window), exceptionState); } CacheStorage* GlobalCacheStorage::caches(WorkerGlobalScope& worker, ExceptionState& exceptionState) { - return GlobalCacheStorageImpl<WorkerGlobalScope>::from(worker, worker.executionContext()).caches(worker, exceptionState); + return GlobalCacheStorageImpl<WorkerGlobalScope>::from(worker, worker.getExecutionContext()).caches(worker, exceptionState); } } // namespace blink diff --git a/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp index dd9b9ed..65da616 100644 --- a/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp +++ b/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp @@ -94,11 +94,11 @@ void BaseRenderingContext2D::restore() static inline void convertCanvasStyleToUnionType(CanvasStyle* style, StringOrCanvasGradientOrCanvasPattern& returnValue) { - if (CanvasGradient* gradient = style->canvasGradient()) { + if (CanvasGradient* gradient = style->getCanvasGradient()) { returnValue.setCanvasGradient(gradient); return; } - if (CanvasPattern* pattern = style->canvasPattern()) { + if (CanvasPattern* pattern = style->getCanvasPattern()) { returnValue.setCanvasPattern(pattern); return; } @@ -176,7 +176,7 @@ void BaseRenderingContext2D::setFillStyle(const StringOrCanvasGradientOrCanvasPa if (originClean() && !canvasPattern->originClean()) setOriginTainted(); - if (canvasPattern->pattern()->isTextureBacked()) + if (canvasPattern->getPattern()->isTextureBacked()) disableDeferral(DisableDeferralReasonUsingTextureBackedPattern); canvasStyle = CanvasStyle::createFromPattern(canvasPattern); } diff --git a/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h b/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h index e9e0b78..bca2270 100644 --- a/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h +++ b/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.h @@ -215,8 +215,8 @@ bool BaseRenderingContext2D::draw(const DrawFunc& drawFunc, const ContainsFunc& // If gradient size is zero, then paint nothing. CanvasStyle* style = state().style(paintType); if (style) { - CanvasGradient* gradient = style->canvasGradient(); - if (gradient && gradient->gradient()->isZeroSize()) + CanvasGradient* gradient = style->getCanvasGradient(); + if (gradient && gradient->getGradient()->isZeroSize()) return false; } diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasGradient.h b/third_party/WebKit/Source/modules/canvas2d/CanvasGradient.h index de6503c..be7dbdd 100644 --- a/third_party/WebKit/Source/modules/canvas2d/CanvasGradient.h +++ b/third_party/WebKit/Source/modules/canvas2d/CanvasGradient.h @@ -51,7 +51,7 @@ public: return new CanvasGradient(p0, r0, p1, r1); } - Gradient* gradient() const { return m_gradient.get(); } + Gradient* getGradient() const { return m_gradient.get(); } void addColorStop(float value, const String& color, ExceptionState&); diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasPattern.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasPattern.cpp index 273d4e6..58ce084 100644 --- a/third_party/WebKit/Source/modules/canvas2d/CanvasPattern.cpp +++ b/third_party/WebKit/Source/modules/canvas2d/CanvasPattern.cpp @@ -58,7 +58,7 @@ CanvasPattern::CanvasPattern(PassRefPtr<Image> image, Pattern::RepeatMode repeat void CanvasPattern::setTransform(SVGMatrixTearOff* transform) { - pattern()->setPatternSpaceTransform(transform ? transform->value() : AffineTransform(1, 0, 0, 1, 0, 0)); + getPattern()->setPatternSpaceTransform(transform ? transform->value() : AffineTransform(1, 0, 0, 1, 0, 0)); } } // namespace blink diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasPattern.h b/third_party/WebKit/Source/modules/canvas2d/CanvasPattern.h index ce7dc5bfa..b782f58 100644 --- a/third_party/WebKit/Source/modules/canvas2d/CanvasPattern.h +++ b/third_party/WebKit/Source/modules/canvas2d/CanvasPattern.h @@ -48,7 +48,7 @@ public: return new CanvasPattern(image, repeat, originClean); } - Pattern* pattern() const { return m_pattern.get(); } + Pattern* getPattern() const { return m_pattern.get(); } bool originClean() const { return m_originClean; } diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasStyle.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasStyle.cpp index 5b75d75..ac378f1 100644 --- a/third_party/WebKit/Source/modules/canvas2d/CanvasStyle.cpp +++ b/third_party/WebKit/Source/modules/canvas2d/CanvasStyle.cpp @@ -116,10 +116,10 @@ void CanvasStyle::applyToPaint(SkPaint& paint) const paint.setShader(nullptr); break; case Gradient: - canvasGradient()->gradient()->applyToPaint(paint); + getCanvasGradient()->getGradient()->applyToPaint(paint); break; case ImagePattern: - canvasPattern()->pattern()->applyToPaint(paint); + getCanvasPattern()->getPattern()->applyToPaint(paint); break; default: ASSERT_NOT_REACHED(); diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasStyle.h b/third_party/WebKit/Source/modules/canvas2d/CanvasStyle.h index 742e270..02923de 100644 --- a/third_party/WebKit/Source/modules/canvas2d/CanvasStyle.h +++ b/third_party/WebKit/Source/modules/canvas2d/CanvasStyle.h @@ -49,8 +49,8 @@ public: static CanvasStyle* createFromPattern(CanvasPattern*); String color() const { ASSERT(m_type == ColorRGBA); return Color(m_rgba).serialized(); } - CanvasGradient* canvasGradient() const { return m_gradient.get(); } - CanvasPattern* canvasPattern() const { return m_pattern; } + CanvasGradient* getCanvasGradient() const { return m_gradient.get(); } + CanvasPattern* getCanvasPattern() const { return m_pattern; } void applyToPaint(SkPaint&) const; RGBA32 paintColor() const; diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorker.cpp b/third_party/WebKit/Source/modules/compositorworker/CompositorWorker.cpp index a348c19..8a358fd 100644 --- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorker.cpp +++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorker.cpp @@ -45,7 +45,7 @@ const AtomicString& CompositorWorker::interfaceName() const WorkerGlobalScopeProxy* CompositorWorker::createWorkerGlobalScopeProxy(ExecutionContext* worker) { - ASSERT(executionContext()->isDocument()); + ASSERT(getExecutionContext()->isDocument()); return new CompositorWorkerMessagingProxy(this); } diff --git a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp index 7f05290..e3b27ed 100644 --- a/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp +++ b/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp @@ -86,7 +86,7 @@ public: void workerThreadTerminated() override {} void willDestroyWorkerGlobalScope() override {} - ExecutionContext* executionContext() override { return m_executionContext.get(); } + ExecutionContext* getExecutionContext() override { return m_executionContext.get(); } private: TestCompositorWorkerObjectProxy(ExecutionContext* context) diff --git a/third_party/WebKit/Source/modules/credentialmanager/Credential.h b/third_party/WebKit/Source/modules/credentialmanager/Credential.h index 71fa55d..1baa1d1 100644 --- a/third_party/WebKit/Source/modules/credentialmanager/Credential.h +++ b/third_party/WebKit/Source/modules/credentialmanager/Credential.h @@ -27,7 +27,7 @@ public: DECLARE_VIRTUAL_TRACE(); - PlatformCredential* platformCredential() const { return m_platformCredential; } + PlatformCredential* getPlatformCredential() const { return m_platformCredential; } protected: Credential(PlatformCredential*); diff --git a/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp b/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp index bf0330a..b5f8511 100644 --- a/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp +++ b/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp @@ -102,14 +102,14 @@ CredentialsContainer::CredentialsContainer() static bool checkBoilerplate(ScriptPromiseResolver* resolver) { - CredentialManagerClient* client = CredentialManagerClient::from(resolver->scriptState()->executionContext()); + CredentialManagerClient* client = CredentialManagerClient::from(resolver->getScriptState()->getExecutionContext()); if (!client) { resolver->reject(DOMException::create(InvalidStateError, "Could not establish connection to the credential manager.")); return false; } String errorMessage; - if (!resolver->scriptState()->executionContext()->isSecureContext(errorMessage)) { + if (!resolver->getScriptState()->getExecutionContext()->isSecureContext(errorMessage)) { resolver->reject(DOMException::create(SecurityError, errorMessage)); return false; } @@ -139,9 +139,9 @@ ScriptPromise CredentialsContainer::get(ScriptState* scriptState, const Credenti } } - UseCounter::count(scriptState->executionContext(), options.unmediated() ? UseCounter::CredentialManagerGetWithoutUI : UseCounter::CredentialManagerGetWithUI); + UseCounter::count(scriptState->getExecutionContext(), options.unmediated() ? UseCounter::CredentialManagerGetWithoutUI : UseCounter::CredentialManagerGetWithUI); - CredentialManagerClient::from(scriptState->executionContext())->dispatchGet(options.unmediated(), options.password(), providers, new RequestCallbacks(resolver)); + CredentialManagerClient::from(scriptState->getExecutionContext())->dispatchGet(options.unmediated(), options.password(), providers, new RequestCallbacks(resolver)); return promise; } @@ -152,7 +152,7 @@ ScriptPromise CredentialsContainer::store(ScriptState* scriptState, Credential* if (!checkBoilerplate(resolver)) return promise; - CredentialManagerClient::from(scriptState->executionContext())->dispatchStore(WebCredential::create(credential->platformCredential()), new NotificationCallbacks(resolver)); + CredentialManagerClient::from(scriptState->getExecutionContext())->dispatchStore(WebCredential::create(credential->getPlatformCredential()), new NotificationCallbacks(resolver)); return promise; } @@ -163,7 +163,7 @@ ScriptPromise CredentialsContainer::requireUserMediation(ScriptState* scriptStat if (!checkBoilerplate(resolver)) return promise; - CredentialManagerClient::from(scriptState->executionContext())->dispatchRequireUserMediation(new NotificationCallbacks(resolver)); + CredentialManagerClient::from(scriptState->getExecutionContext())->dispatchRequireUserMediation(new NotificationCallbacks(resolver)); return promise; } diff --git a/third_party/WebKit/Source/modules/credentialmanager/FederatedCredential.cpp b/third_party/WebKit/Source/modules/credentialmanager/FederatedCredential.cpp index 0e14546..50347a1 100644 --- a/third_party/WebKit/Source/modules/credentialmanager/FederatedCredential.cpp +++ b/third_party/WebKit/Source/modules/credentialmanager/FederatedCredential.cpp @@ -36,7 +36,7 @@ FederatedCredential* FederatedCredential::create(const FederatedCredentialData& } FederatedCredential::FederatedCredential(WebFederatedCredential* webFederatedCredential) - : Credential(webFederatedCredential->platformCredential()) + : Credential(webFederatedCredential->getPlatformCredential()) { } diff --git a/third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp b/third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp index e174b50..101706d 100644 --- a/third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp +++ b/third_party/WebKit/Source/modules/credentialmanager/PasswordCredential.cpp @@ -42,7 +42,7 @@ PasswordCredential* PasswordCredential::create(const PasswordCredentialData& dat } PasswordCredential::PasswordCredential(WebPasswordCredential* webPasswordCredential) - : Credential(webPasswordCredential->platformCredential()) + : Credential(webPasswordCredential->getPlatformCredential()) , m_idName("username") , m_passwordName("password") { diff --git a/third_party/WebKit/Source/modules/crypto/CryptoKey.cpp b/third_party/WebKit/Source/modules/crypto/CryptoKey.cpp index 1455c5c..83d07c2 100644 --- a/third_party/WebKit/Source/modules/crypto/CryptoKey.cpp +++ b/third_party/WebKit/Source/modules/crypto/CryptoKey.cpp @@ -119,7 +119,7 @@ public: { ASSERT(algorithm.paramsType() == WebCryptoAlgorithmParamsTypeNone); - V8ObjectBuilder algorithmValue(m_builder.scriptState()); + V8ObjectBuilder algorithmValue(m_builder.getScriptState()); algorithmValue.addString("name", WebCryptoAlgorithm::lookupAlgorithmInfo(algorithm.id())->name); m_builder.add(propertyName, algorithmValue); } diff --git a/third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp b/third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp index 87f1e93..ff04f11 100644 --- a/third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp +++ b/third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp @@ -53,11 +53,11 @@ namespace blink { static void rejectWithTypeError(const String& errorDetails, ScriptPromiseResolver* resolver) { // Duplicate some of the checks done by ScriptPromiseResolver. - if (!resolver->executionContext() || resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!resolver->getExecutionContext() || resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; - ScriptState::Scope scope(resolver->scriptState()); - v8::Isolate* isolate = resolver->scriptState()->isolate(); + ScriptState::Scope scope(resolver->getScriptState()); + v8::Isolate* isolate = resolver->getScriptState()->isolate(); resolver->reject(v8::Exception::TypeError(v8String(isolate, errorDetails))); } @@ -134,7 +134,7 @@ CryptoResultImpl::CryptoResultImpl(ScriptState* scriptState) , m_cancel(ResultCancel::create()) { // Sync cancellation state. - if (scriptState->executionContext()->activeDOMObjectsAreStopped()) + if (scriptState->getExecutionContext()->activeDOMObjectsAreStopped()) m_cancel->cancel(); } @@ -189,7 +189,7 @@ void CryptoResultImpl::completeWithJson(const char* utf8Data, unsigned length) if (!m_resolver) return; - ScriptState* scriptState = m_resolver->scriptState(); + ScriptState* scriptState = m_resolver->getScriptState(); ScriptState::Scope scope(scriptState); v8::Local<v8::String> jsonString = v8AtomicString(scriptState->isolate(), utf8Data, length); @@ -226,7 +226,7 @@ void CryptoResultImpl::completeWithKeyPair(const WebCryptoKey& publicKey, const if (!m_resolver) return; - ScriptState* scriptState = m_resolver->scriptState(); + ScriptState* scriptState = m_resolver->getScriptState(); ScriptState::Scope scope(scriptState); V8ObjectBuilder keyPair(scriptState); diff --git a/third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp b/third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp index 86185b5..33daf93 100644 --- a/third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp +++ b/third_party/WebKit/Source/modules/crypto/SubtleCrypto.cpp @@ -55,7 +55,7 @@ static bool parseAlgorithm(const AlgorithmIdentifier& raw, WebCryptoOperation op static bool canAccessWebCrypto(ScriptState* scriptState, CryptoResult* result) { String errorMessage; - if (!scriptState->executionContext()->isSecureContext(errorMessage, ExecutionContext::WebCryptoSecureContextCheck)) { + if (!scriptState->getExecutionContext()->isSecureContext(errorMessage, ExecutionContext::WebCryptoSecureContextCheck)) { result->completeWithError(WebCryptoErrorTypeNotSupported, errorMessage); return false; } @@ -133,7 +133,7 @@ ScriptPromise SubtleCrypto::encrypt(ScriptState* scriptState, const AlgorithmIde if (!key->canBeUsedForAlgorithm(algorithm, WebCryptoKeyUsageEncrypt, result)) return promise; - histogramAlgorithmAndKey(scriptState->executionContext(), algorithm, key->key()); + histogramAlgorithmAndKey(scriptState->getExecutionContext(), algorithm, key->key()); Platform::current()->crypto()->encrypt(algorithm, key->key(), data.bytes(), data.byteLength(), result->result()); return promise; } @@ -153,7 +153,7 @@ ScriptPromise SubtleCrypto::decrypt(ScriptState* scriptState, const AlgorithmIde if (!key->canBeUsedForAlgorithm(algorithm, WebCryptoKeyUsageDecrypt, result)) return promise; - histogramAlgorithmAndKey(scriptState->executionContext(), algorithm, key->key()); + histogramAlgorithmAndKey(scriptState->getExecutionContext(), algorithm, key->key()); Platform::current()->crypto()->decrypt(algorithm, key->key(), data.bytes(), data.byteLength(), result->result()); return promise; } @@ -173,7 +173,7 @@ ScriptPromise SubtleCrypto::sign(ScriptState* scriptState, const AlgorithmIdenti if (!key->canBeUsedForAlgorithm(algorithm, WebCryptoKeyUsageSign, result)) return promise; - histogramAlgorithmAndKey(scriptState->executionContext(), algorithm, key->key()); + histogramAlgorithmAndKey(scriptState->getExecutionContext(), algorithm, key->key()); Platform::current()->crypto()->sign(algorithm, key->key(), data.bytes(), data.byteLength(), result->result()); return promise; } @@ -193,7 +193,7 @@ ScriptPromise SubtleCrypto::verifySignature(ScriptState* scriptState, const Algo if (!key->canBeUsedForAlgorithm(algorithm, WebCryptoKeyUsageVerify, result)) return promise; - histogramAlgorithmAndKey(scriptState->executionContext(), algorithm, key->key()); + histogramAlgorithmAndKey(scriptState->getExecutionContext(), algorithm, key->key()); Platform::current()->crypto()->verifySignature(algorithm, key->key(), signature.bytes(), signature.byteLength(), data.bytes(), data.byteLength(), result->result()); return promise; } @@ -210,7 +210,7 @@ ScriptPromise SubtleCrypto::digest(ScriptState* scriptState, const AlgorithmIden if (!parseAlgorithm(rawAlgorithm, WebCryptoOperationDigest, algorithm, result)) return promise; - histogramAlgorithm(scriptState->executionContext(), algorithm); + histogramAlgorithm(scriptState->getExecutionContext(), algorithm); Platform::current()->crypto()->digest(algorithm, data.bytes(), data.byteLength(), result->result()); return promise; } @@ -231,7 +231,7 @@ ScriptPromise SubtleCrypto::generateKey(ScriptState* scriptState, const Algorith if (!parseAlgorithm(rawAlgorithm, WebCryptoOperationGenerateKey, algorithm, result)) return promise; - histogramAlgorithm(scriptState->executionContext(), algorithm); + histogramAlgorithm(scriptState->getExecutionContext(), algorithm); Platform::current()->crypto()->generateKey(algorithm, extractable, keyUsages, result->result()); return promise; } @@ -282,7 +282,7 @@ ScriptPromise SubtleCrypto::importKey(ScriptState* scriptState, const String& ra ptr = reinterpret_cast<const unsigned char*>(jsonUtf8.data()); len = jsonUtf8.length(); } - histogramAlgorithm(scriptState->executionContext(), algorithm); + histogramAlgorithm(scriptState->getExecutionContext(), algorithm); Platform::current()->crypto()->importKey(format, ptr, len, algorithm, extractable, keyUsages, result->result()); return promise; } @@ -304,7 +304,7 @@ ScriptPromise SubtleCrypto::exportKey(ScriptState* scriptState, const String& ra return promise; } - histogramKey(scriptState->executionContext(), key->key()); + histogramKey(scriptState->getExecutionContext(), key->key()); Platform::current()->crypto()->exportKey(format, key->key(), result->result()); return promise; } @@ -333,8 +333,8 @@ ScriptPromise SubtleCrypto::wrapKey(ScriptState* scriptState, const String& rawF if (!wrappingKey->canBeUsedForAlgorithm(wrapAlgorithm, WebCryptoKeyUsageWrapKey, result)) return promise; - histogramAlgorithmAndKey(scriptState->executionContext(), wrapAlgorithm, wrappingKey->key()); - histogramKey(scriptState->executionContext(), key->key()); + histogramAlgorithmAndKey(scriptState->getExecutionContext(), wrapAlgorithm, wrappingKey->key()); + histogramKey(scriptState->getExecutionContext(), key->key()); Platform::current()->crypto()->wrapKey(format, key->key(), wrappingKey->key(), wrapAlgorithm, result->result()); return promise; } @@ -366,8 +366,8 @@ ScriptPromise SubtleCrypto::unwrapKey(ScriptState* scriptState, const String& ra if (!unwrappingKey->canBeUsedForAlgorithm(unwrapAlgorithm, WebCryptoKeyUsageUnwrapKey, result)) return promise; - histogramAlgorithmAndKey(scriptState->executionContext(), unwrapAlgorithm, unwrappingKey->key()); - histogramAlgorithm(scriptState->executionContext(), unwrappedKeyAlgorithm); + histogramAlgorithmAndKey(scriptState->getExecutionContext(), unwrapAlgorithm, unwrappingKey->key()); + histogramAlgorithm(scriptState->getExecutionContext(), unwrappedKeyAlgorithm); Platform::current()->crypto()->unwrapKey(format, wrappedKey.bytes(), wrappedKey.byteLength(), unwrappingKey->key(), unwrapAlgorithm, unwrappedKeyAlgorithm, extractable, keyUsages, result->result()); return promise; } @@ -387,7 +387,7 @@ ScriptPromise SubtleCrypto::deriveBits(ScriptState* scriptState, const Algorithm if (!baseKey->canBeUsedForAlgorithm(algorithm, WebCryptoKeyUsageDeriveBits, result)) return promise; - histogramAlgorithmAndKey(scriptState->executionContext(), algorithm, baseKey->key()); + histogramAlgorithmAndKey(scriptState->getExecutionContext(), algorithm, baseKey->key()); Platform::current()->crypto()->deriveBits(algorithm, baseKey->key(), lengthBits, result->result()); return promise; } @@ -419,8 +419,8 @@ ScriptPromise SubtleCrypto::deriveKey(ScriptState* scriptState, const AlgorithmI if (!parseAlgorithm(rawDerivedKeyType, WebCryptoOperationGetKeyLength, keyLengthAlgorithm, result)) return promise; - histogramAlgorithmAndKey(scriptState->executionContext(), algorithm, baseKey->key()); - histogramAlgorithm(scriptState->executionContext(), importAlgorithm); + histogramAlgorithmAndKey(scriptState->getExecutionContext(), algorithm, baseKey->key()); + histogramAlgorithm(scriptState->getExecutionContext(), importAlgorithm); Platform::current()->crypto()->deriveKey(algorithm, baseKey->key(), importAlgorithm, keyLengthAlgorithm, extractable, keyUsages, result->result()); return promise; } diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.cpp b/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.cpp index e4a79b6..ae0b3ae 100644 --- a/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.cpp +++ b/third_party/WebKit/Source/modules/device_orientation/DeviceMotionController.cpp @@ -90,7 +90,7 @@ PassRefPtrWillBeRawPtr<Event> DeviceMotionController::lastEvent() const bool DeviceMotionController::isNullEvent(Event* event) const { DeviceMotionEvent* motionEvent = toDeviceMotionEvent(event); - return !motionEvent->deviceMotionData()->canProvideEventData(); + return !motionEvent->getDeviceMotionData()->canProvideEventData(); } const AtomicString& DeviceMotionController::eventTypeName() const diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceMotionData.h b/third_party/WebKit/Source/modules/device_orientation/DeviceMotionData.h index 2055cb9..86d686e 100644 --- a/third_party/WebKit/Source/modules/device_orientation/DeviceMotionData.h +++ b/third_party/WebKit/Source/modules/device_orientation/DeviceMotionData.h @@ -95,9 +95,9 @@ public: static DeviceMotionData* create(const WebDeviceMotionData&); DECLARE_TRACE(); - Acceleration* acceleration() const { return m_acceleration.get(); } - Acceleration* accelerationIncludingGravity() const { return m_accelerationIncludingGravity.get(); } - RotationRate* rotationRate() const { return m_rotationRate.get(); } + Acceleration* getAcceleration() const { return m_acceleration.get(); } + Acceleration* getAccelerationIncludingGravity() const { return m_accelerationIncludingGravity.get(); } + RotationRate* getRotationRate() const { return m_rotationRate.get(); } bool canProvideInterval() const { return m_canProvideInterval; } double interval() const { return m_interval; } diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.cpp b/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.cpp index 3c5a7c3..1c2112d 100644 --- a/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.cpp +++ b/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.cpp @@ -61,33 +61,33 @@ void DeviceMotionEvent::initDeviceMotionEvent(const AtomicString& type, bool bub DeviceAcceleration* DeviceMotionEvent::acceleration() { - if (!m_deviceMotionData->acceleration()) + if (!m_deviceMotionData->getAcceleration()) return nullptr; if (!m_acceleration) - m_acceleration = DeviceAcceleration::create(m_deviceMotionData->acceleration()); + m_acceleration = DeviceAcceleration::create(m_deviceMotionData->getAcceleration()); return m_acceleration.get(); } DeviceAcceleration* DeviceMotionEvent::accelerationIncludingGravity() { - if (!m_deviceMotionData->accelerationIncludingGravity()) + if (!m_deviceMotionData->getAccelerationIncludingGravity()) return nullptr; if (!m_accelerationIncludingGravity) - m_accelerationIncludingGravity = DeviceAcceleration::create(m_deviceMotionData->accelerationIncludingGravity()); + m_accelerationIncludingGravity = DeviceAcceleration::create(m_deviceMotionData->getAccelerationIncludingGravity()); return m_accelerationIncludingGravity.get(); } DeviceRotationRate* DeviceMotionEvent::rotationRate() { - if (!m_deviceMotionData->rotationRate()) + if (!m_deviceMotionData->getRotationRate()) return nullptr; if (!m_rotationRate) - m_rotationRate = DeviceRotationRate::create(m_deviceMotionData->rotationRate()); + m_rotationRate = DeviceRotationRate::create(m_deviceMotionData->getRotationRate()); return m_rotationRate.get(); } diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.h b/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.h index 7e06710..a613c60 100644 --- a/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.h +++ b/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.h @@ -50,7 +50,7 @@ public: void initDeviceMotionEvent(const AtomicString& type, bool bubbles, bool cancelable, DeviceMotionData*); - DeviceMotionData* deviceMotionData() const { return m_deviceMotionData.get(); } + DeviceMotionData* getDeviceMotionData() const { return m_deviceMotionData.get(); } DeviceAcceleration* acceleration(); DeviceAcceleration* accelerationIncludingGravity(); diff --git a/third_party/WebKit/Source/modules/encryptedmedia/ContentDecryptionModuleResultPromise.cpp b/third_party/WebKit/Source/modules/encryptedmedia/ContentDecryptionModuleResultPromise.cpp index 2bdab5a..931af86 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/ContentDecryptionModuleResultPromise.cpp +++ b/third_party/WebKit/Source/modules/encryptedmedia/ContentDecryptionModuleResultPromise.cpp @@ -89,9 +89,9 @@ void ContentDecryptionModuleResultPromise::reject(ExceptionCode code, const Stri m_resolver.clear(); } -ExecutionContext* ContentDecryptionModuleResultPromise::executionContext() const +ExecutionContext* ContentDecryptionModuleResultPromise::getExecutionContext() const { - return m_resolver->executionContext(); + return m_resolver->getExecutionContext(); } DEFINE_TRACE(ContentDecryptionModuleResultPromise) diff --git a/third_party/WebKit/Source/modules/encryptedmedia/ContentDecryptionModuleResultPromise.h b/third_party/WebKit/Source/modules/encryptedmedia/ContentDecryptionModuleResultPromise.h index 0ae6889..62d995d 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/ContentDecryptionModuleResultPromise.h +++ b/third_party/WebKit/Source/modules/encryptedmedia/ContentDecryptionModuleResultPromise.h @@ -48,7 +48,7 @@ protected: // Rejects the promise with a DOMException. void reject(ExceptionCode, const String& errorMessage); - ExecutionContext* executionContext() const; + ExecutionContext* getExecutionContext() const; private: Member<ScriptPromiseResolver> m_resolver; diff --git a/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp b/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp index fc54817..8b00cf7 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp +++ b/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp @@ -357,7 +357,7 @@ void HTMLMediaElementEncryptedMedia::encrypted(WebEncryptedMediaInitDataType ini WTF_LOG(Media, "HTMLMediaElementEncryptedMedia::encrypted"); RefPtrWillBeRawPtr<Event> event; - if (m_mediaElement->isMediaDataCORSSameOrigin(m_mediaElement->executionContext()->securityOrigin())) { + if (m_mediaElement->isMediaDataCORSSameOrigin(m_mediaElement->getExecutionContext()->getSecurityOrigin())) { event = createEncryptedEvent(initDataType, initData, initDataLength); } else { // Current page is not allowed to see content from the media file, diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp index f58d99d..1b69010 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp +++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp @@ -308,7 +308,7 @@ MediaKeySession* MediaKeySession::create(ScriptState* scriptState, MediaKeys* me } MediaKeySession::MediaKeySession(ScriptState* scriptState, MediaKeys* mediaKeys, WebEncryptedMediaSessionType sessionType) - : ActiveDOMObject(scriptState->executionContext()) + : ActiveDOMObject(scriptState->getExecutionContext()) , m_asyncEventQueue(GenericEventQueue::create(this)) , m_mediaKeys(mediaKeys) , m_sessionType(sessionType) @@ -317,7 +317,7 @@ MediaKeySession::MediaKeySession(ScriptState* scriptState, MediaKeys* mediaKeys, , m_isUninitialized(true) , m_isCallable(false) , m_isClosed(false) - , m_closedPromise(new ClosedPromise(scriptState->executionContext(), this, ClosedPromise::Closed)) + , m_closedPromise(new ClosedPromise(scriptState->getExecutionContext(), this, ClosedPromise::Closed)) , m_actionTimer(this, &MediaKeySession::actionTimerFired) { WTF_LOG(Media, "MediaKeySession(%p)::MediaKeySession", this); @@ -489,7 +489,7 @@ ScriptPromise MediaKeySession::load(ScriptState* scriptState, const String& sess // FIXME: Implement this (http://crbug.com/448922). // 6. Let origin be the origin of this object's Document. - // (Available as executionContext()->securityOrigin() anytime.) + // (Available as getExecutionContext()->getSecurityOrigin() anytime.) // 7. Let promise be a new promise. LoadSessionResultPromise* result = new LoadSessionResultPromise(scriptState, this); @@ -885,9 +885,9 @@ const AtomicString& MediaKeySession::interfaceName() const return EventTargetNames::MediaKeySession; } -ExecutionContext* MediaKeySession::executionContext() const +ExecutionContext* MediaKeySession::getExecutionContext() const { - return ActiveDOMObject::executionContext(); + return ActiveDOMObject::getExecutionContext(); } bool MediaKeySession::hasPendingActivity() const diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.h b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.h index be4a635..61e5e92 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.h +++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.h @@ -83,7 +83,7 @@ public: // EventTarget const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; // ActiveDOMObject bool hasPendingActivity() const override; diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySystemAccess.cpp b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySystemAccess.cpp index 1803cc0..e319ba3 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySystemAccess.cpp +++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySystemAccess.cpp @@ -49,7 +49,7 @@ public: { // NOTE: Continued from step 2.8 of createMediaKeys(). // 2.9. Let media keys be a new MediaKeys object. - MediaKeys* mediaKeys = MediaKeys::create(executionContext(), m_supportedSessionTypes, adoptPtr(cdm)); + MediaKeys* mediaKeys = MediaKeys::create(getExecutionContext(), m_supportedSessionTypes, adoptPtr(cdm)); // 2.10. Resolve promise with media keys. resolve(mediaKeys); diff --git a/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp b/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp index a18e025..fbeffbb 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp +++ b/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp @@ -91,7 +91,7 @@ public: // EncryptedMediaRequest implementation. WebString keySystem() const override { return m_keySystem; } const WebVector<WebMediaKeySystemConfiguration>& supportedConfigurations() const override { return m_supportedConfigurations; } - SecurityOrigin* securityOrigin() const override { return m_resolver->executionContext()->securityOrigin(); } + SecurityOrigin* getSecurityOrigin() const override { return m_resolver->getExecutionContext()->getSecurityOrigin(); } void requestSucceeded(WebContentDecryptionModuleAccess*) override; void requestNotSupported(const WebString& errorMessage) override; @@ -196,7 +196,7 @@ void MediaKeySystemAccessInitializer::checkVideoCapabilityRobustness() const } if (hasEmptyRobustness) { - m_resolver->executionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, + m_resolver->getExecutionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, "It is recommended that a robustness level be specified. Not specifying the robustness level could " "result in unexpected behavior in the future, potentially including failure to play.")); } @@ -230,7 +230,7 @@ ScriptPromise NavigatorRequestMediaKeySystemAccess::requestMediaKeySystemAccess( } // 3-4. 'May Document use powerful features?' check. - ExecutionContext* executionContext = scriptState->executionContext(); + ExecutionContext* executionContext = scriptState->getExecutionContext(); String errorMessage; if (executionContext->isSecureContext(errorMessage)) { UseCounter::count(executionContext, UseCounter::EncryptedMediaSecureOrigin); diff --git a/third_party/WebKit/Source/modules/fetch/Body.cpp b/third_party/WebKit/Source/modules/fetch/Body.cpp index c2e070e..10b74df 100644 --- a/third_party/WebKit/Source/modules/fetch/Body.cpp +++ b/third_party/WebKit/Source/modules/fetch/Body.cpp @@ -31,8 +31,8 @@ public: ScriptPromiseResolver* resolver() { return m_resolver; } void didFetchDataLoadFailed() override { - ScriptState::Scope scope(resolver()->scriptState()); - m_resolver->reject(V8ThrowException::createTypeError(resolver()->scriptState()->isolate(), "Failed to fetch")); + ScriptState::Scope scope(resolver()->getScriptState()); + m_resolver->reject(V8ThrowException::createTypeError(resolver()->getScriptState()->isolate(), "Failed to fetch")); } DEFINE_INLINE_TRACE() @@ -85,10 +85,10 @@ public: void didFetchDataLoadedString(const String& string) override { - if (!resolver()->executionContext() || resolver()->executionContext()->activeDOMObjectsAreStopped()) + if (!resolver()->getExecutionContext() || resolver()->getExecutionContext()->activeDOMObjectsAreStopped()) return; - ScriptState::Scope scope(resolver()->scriptState()); - v8::Isolate* isolate = resolver()->scriptState()->isolate(); + ScriptState::Scope scope(resolver()->getScriptState()); + v8::Isolate* isolate = resolver()->getScriptState()->isolate(); v8::Local<v8::String> inputString = v8String(isolate, string); v8::TryCatch trycatch(isolate); v8::Local<v8::Value> parsed; @@ -113,13 +113,13 @@ ScriptPromise Body::arrayBuffer(ScriptState* scriptState) // first check the ExecutionContext and return immediately if it's already // gone (which means that the V8::TerminateExecution() signal has been sent // to this worker thread). - if (!scriptState->executionContext()) + if (!scriptState->getExecutionContext()) return ScriptPromise(); ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); promise = resolver->promise(); if (bodyBuffer()) { - bodyBuffer()->startLoading(scriptState->executionContext(), FetchDataLoader::createLoaderAsArrayBuffer(), new BodyArrayBufferConsumer(resolver)); + bodyBuffer()->startLoading(scriptState->getExecutionContext(), FetchDataLoader::createLoaderAsArrayBuffer(), new BodyArrayBufferConsumer(resolver)); } else { resolver->resolve(DOMArrayBuffer::create(0u, 1)); } @@ -133,13 +133,13 @@ ScriptPromise Body::blob(ScriptState* scriptState) return promise; // See above comment. - if (!scriptState->executionContext()) + if (!scriptState->getExecutionContext()) return ScriptPromise(); ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); promise = resolver->promise(); if (bodyBuffer()) { - bodyBuffer()->startLoading(scriptState->executionContext(), FetchDataLoader::createLoaderAsBlobHandle(mimeType()), new BodyBlobConsumer(resolver)); + bodyBuffer()->startLoading(scriptState->getExecutionContext(), FetchDataLoader::createLoaderAsBlobHandle(mimeType()), new BodyBlobConsumer(resolver)); } else { OwnPtr<BlobData> blobData = BlobData::create(); blobData->setContentType(mimeType()); @@ -156,13 +156,13 @@ ScriptPromise Body::json(ScriptState* scriptState) return promise; // See above comment. - if (!scriptState->executionContext()) + if (!scriptState->getExecutionContext()) return ScriptPromise(); ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); promise = resolver->promise(); if (bodyBuffer()) { - bodyBuffer()->startLoading(scriptState->executionContext(), FetchDataLoader::createLoaderAsString(), new BodyJsonConsumer(resolver)); + bodyBuffer()->startLoading(scriptState->getExecutionContext(), FetchDataLoader::createLoaderAsString(), new BodyJsonConsumer(resolver)); } else { resolver->reject(V8ThrowException::createSyntaxError(scriptState->isolate(), "Unexpected end of input")); } @@ -176,13 +176,13 @@ ScriptPromise Body::text(ScriptState* scriptState) return promise; // See above comment. - if (!scriptState->executionContext()) + if (!scriptState->getExecutionContext()) return ScriptPromise(); ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); promise = resolver->promise(); if (bodyBuffer()) { - bodyBuffer()->startLoading(scriptState->executionContext(), FetchDataLoader::createLoaderAsString(), new BodyTextConsumer(resolver)); + bodyBuffer()->startLoading(scriptState->getExecutionContext(), FetchDataLoader::createLoaderAsString(), new BodyTextConsumer(resolver)); } else { resolver->resolve(String()); } @@ -196,7 +196,7 @@ ReadableByteStream* Body::body() ReadableByteStream* Body::bodyWithUseCounter() { - UseCounter::count(executionContext(), UseCounter::FetchBodyStream); + UseCounter::count(getExecutionContext(), UseCounter::FetchBodyStream); return body(); } @@ -212,7 +212,7 @@ bool Body::isBodyLocked() bool Body::hasPendingActivity() const { - if (executionContext()->activeDOMObjectsAreStopped()) + if (getExecutionContext()->activeDOMObjectsAreStopped()) return false; if (!bodyBuffer()) return false; diff --git a/third_party/WebKit/Source/modules/fetch/BodyStreamBufferTest.cpp b/third_party/WebKit/Source/modules/fetch/BodyStreamBufferTest.cpp index d50a7c44..c46d7b1 100644 --- a/third_party/WebKit/Source/modules/fetch/BodyStreamBufferTest.cpp +++ b/third_party/WebKit/Source/modules/fetch/BodyStreamBufferTest.cpp @@ -32,8 +32,8 @@ public: ~BodyStreamBufferTest() override {} protected: - ScriptState* scriptState() { return ScriptState::forMainWorld(m_page->document().frame()); } - ExecutionContext* executionContext() { return &m_page->document(); } + ScriptState* getScriptState() { return ScriptState::forMainWorld(m_page->document().frame()); } + ExecutionContext* getExecutionContext() { return &m_page->document(); } OwnPtr<DummyPageHolder> m_page; }; @@ -49,7 +49,7 @@ TEST_F(BodyStreamBufferTest, ReleaseHandle) EXPECT_FALSE(buffer->stream()->isDisturbed()); EXPECT_EQ(ReadableStream::Readable, buffer->stream()->stateInternal()); - OwnPtr<FetchDataConsumerHandle> handle2 = buffer->releaseHandle(executionContext()); + OwnPtr<FetchDataConsumerHandle> handle2 = buffer->releaseHandle(getExecutionContext()); ASSERT_EQ(rawHandle, handle2.get()); EXPECT_TRUE(buffer->stream()->isLocked()); @@ -72,7 +72,7 @@ TEST_F(BodyStreamBufferTest, LoadBodyStreamBufferAsArrayBuffer) handle->add(Command(Command::Data, "hello")); handle->add(Command(Command::Done)); BodyStreamBuffer* buffer = new BodyStreamBuffer(createFetchDataConsumerHandleFromWebHandle(handle.release())); - buffer->startLoading(executionContext(), FetchDataLoader::createLoaderAsArrayBuffer(), client); + buffer->startLoading(getExecutionContext(), FetchDataLoader::createLoaderAsArrayBuffer(), client); EXPECT_TRUE(buffer->stream()->isLocked()); EXPECT_TRUE(buffer->stream()->isDisturbed()); @@ -104,7 +104,7 @@ TEST_F(BodyStreamBufferTest, LoadBodyStreamBufferAsBlob) handle->add(Command(Command::Data, "hello")); handle->add(Command(Command::Done)); BodyStreamBuffer* buffer = new BodyStreamBuffer(createFetchDataConsumerHandleFromWebHandle(handle.release())); - buffer->startLoading(executionContext(), FetchDataLoader::createLoaderAsBlobHandle("text/plain"), client); + buffer->startLoading(getExecutionContext(), FetchDataLoader::createLoaderAsBlobHandle("text/plain"), client); EXPECT_TRUE(buffer->stream()->isLocked()); EXPECT_TRUE(buffer->stream()->isDisturbed()); @@ -134,7 +134,7 @@ TEST_F(BodyStreamBufferTest, LoadBodyStreamBufferAsString) handle->add(Command(Command::Data, "hello")); handle->add(Command(Command::Done)); BodyStreamBuffer* buffer = new BodyStreamBuffer(createFetchDataConsumerHandleFromWebHandle(handle.release())); - buffer->startLoading(executionContext(), FetchDataLoader::createLoaderAsString(), client); + buffer->startLoading(getExecutionContext(), FetchDataLoader::createLoaderAsString(), client); EXPECT_TRUE(buffer->stream()->isLocked()); EXPECT_TRUE(buffer->stream()->isDisturbed()); @@ -160,7 +160,7 @@ TEST_F(BodyStreamBufferTest, ReleaseClosedHandle) EXPECT_FALSE(buffer->stream()->isLocked()); EXPECT_FALSE(buffer->stream()->isDisturbed()); EXPECT_FALSE(buffer->hasPendingActivity()); - OwnPtr<FetchDataConsumerHandle> handle = buffer->releaseHandle(executionContext()); + OwnPtr<FetchDataConsumerHandle> handle = buffer->releaseHandle(getExecutionContext()); EXPECT_TRUE(handle); EXPECT_TRUE(buffer->stream()->isLocked()); @@ -188,7 +188,7 @@ TEST_F(BodyStreamBufferTest, LoadClosedHandle) EXPECT_FALSE(buffer->stream()->isDisturbed()); EXPECT_FALSE(buffer->hasPendingActivity()); - buffer->startLoading(executionContext(), FetchDataLoader::createLoaderAsString(), client); + buffer->startLoading(getExecutionContext(), FetchDataLoader::createLoaderAsString(), client); EXPECT_TRUE(buffer->stream()->isLocked()); EXPECT_TRUE(buffer->stream()->isDisturbed()); EXPECT_TRUE(buffer->hasPendingActivity()); @@ -213,7 +213,7 @@ TEST_F(BodyStreamBufferTest, ReleaseErroredHandle) EXPECT_FALSE(buffer->stream()->isLocked()); EXPECT_FALSE(buffer->stream()->isDisturbed()); EXPECT_FALSE(buffer->hasPendingActivity()); - OwnPtr<FetchDataConsumerHandle> handle = buffer->releaseHandle(executionContext()); + OwnPtr<FetchDataConsumerHandle> handle = buffer->releaseHandle(getExecutionContext()); EXPECT_TRUE(handle); EXPECT_TRUE(buffer->stream()->isLocked()); EXPECT_TRUE(buffer->stream()->isDisturbed()); @@ -239,7 +239,7 @@ TEST_F(BodyStreamBufferTest, LoadErroredHandle) EXPECT_FALSE(buffer->stream()->isLocked()); EXPECT_FALSE(buffer->stream()->isDisturbed()); EXPECT_FALSE(buffer->hasPendingActivity()); - buffer->startLoading(executionContext(), FetchDataLoader::createLoaderAsString(), client); + buffer->startLoading(getExecutionContext(), FetchDataLoader::createLoaderAsString(), client); EXPECT_TRUE(buffer->stream()->isLocked()); EXPECT_TRUE(buffer->stream()->isDisturbed()); EXPECT_TRUE(buffer->hasPendingActivity()); @@ -267,7 +267,7 @@ TEST_F(BodyStreamBufferTest, LoaderShouldBeKeptAliveByBodyStreamBuffer) handle->add(Command(Command::Data, "hello")); handle->add(Command(Command::Done)); Persistent<BodyStreamBuffer> buffer = new BodyStreamBuffer(createFetchDataConsumerHandleFromWebHandle(handle.release())); - buffer->startLoading(executionContext(), FetchDataLoader::createLoaderAsString(), client); + buffer->startLoading(getExecutionContext(), FetchDataLoader::createLoaderAsString(), client); Heap::collectAllGarbage(); checkpoint.Call(1); @@ -290,7 +290,7 @@ public: TEST_F(BodyStreamBufferTest, SourceHandleAndReaderShouldBeDestructedWhenCanceled) { - ScriptState::Scope scope(scriptState()); + ScriptState::Scope scope(getScriptState()); using MockHandle = MockFetchDataConsumerHandleWithMockDestructor; using MockReader = DataConsumerHandleTestUtil::MockFetchDataConsumerReader; OwnPtr<MockHandle> handle = MockHandle::create(); @@ -310,8 +310,8 @@ TEST_F(BodyStreamBufferTest, SourceHandleAndReaderShouldBeDestructedWhenCanceled BodyStreamBuffer* buffer = new BodyStreamBuffer(handle.release()); checkpoint.Call(1); - ScriptValue reason(scriptState(), v8String(scriptState()->isolate(), "reason")); - buffer->cancelSource(scriptState(), reason); + ScriptValue reason(getScriptState(), v8String(getScriptState()->isolate(), "reason")); + buffer->cancelSource(getScriptState(), reason); checkpoint.Call(2); } diff --git a/third_party/WebKit/Source/modules/fetch/CrossThreadHolder.h b/third_party/WebKit/Source/modules/fetch/CrossThreadHolder.h index 125a959..ef7fe14 100644 --- a/third_party/WebKit/Source/modules/fetch/CrossThreadHolder.h +++ b/third_party/WebKit/Source/modules/fetch/CrossThreadHolder.h @@ -53,7 +53,7 @@ public: // The bridge has already disappeared. return; } - m_bridge->executionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&Bridge::runTask, m_bridge.get(), task)); + m_bridge->getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&Bridge::runTask, m_bridge.get(), task)); } ~CrossThreadHolder() @@ -121,16 +121,16 @@ private: void runTask(PassOwnPtr<WTF::Function<void(T*, ExecutionContext*), WTF::CrossThreadAffinity>> task) { - ASSERT(executionContext()->isContextThread()); + ASSERT(getExecutionContext()->isContextThread()); if (m_obj) - (*task)(m_obj.get(), executionContext()); + (*task)(m_obj.get(), getExecutionContext()); } private: // ActiveDOMObject void stop() override { - ASSERT(executionContext()->isContextThread()); + ASSERT(getExecutionContext()->isContextThread()); { MutexLocker locker(m_mutex->mutex()); if (m_holder) diff --git a/third_party/WebKit/Source/modules/fetch/DataConsumerHandleTestUtil.h b/third_party/WebKit/Source/modules/fetch/DataConsumerHandleTestUtil.h index cbfaafe..745fba0 100644 --- a/third_party/WebKit/Source/modules/fetch/DataConsumerHandleTestUtil.h +++ b/third_party/WebKit/Source/modules/fetch/DataConsumerHandleTestUtil.h @@ -61,8 +61,8 @@ public: ~Thread(); WebThreadSupportingGC* thread() { return m_thread.get(); } - ExecutionContext* executionContext() { return m_executionContext.get(); } - ScriptState* scriptState() { return m_scriptState.get(); } + ExecutionContext* getExecutionContext() { return m_executionContext.get(); } + ScriptState* getScriptState() { return m_scriptState.get(); } v8::Isolate* isolate() { return m_isolateHolder->isolate(); } private: @@ -428,7 +428,7 @@ public: OwnPtr<WaitableEvent> m_detached; }; - Context* context() { return m_context.get(); } + Context* getContext() { return m_context.get(); } private: class ReaderImpl; diff --git a/third_party/WebKit/Source/modules/fetch/DataConsumerTeeTest.cpp b/third_party/WebKit/Source/modules/fetch/DataConsumerTeeTest.cpp index e80ffd7..f60c4a5 100644 --- a/third_party/WebKit/Source/modules/fetch/DataConsumerTeeTest.cpp +++ b/third_party/WebKit/Source/modules/fetch/DataConsumerTeeTest.cpp @@ -61,12 +61,12 @@ public: m_waitableEvent->wait(); } - Thread* thread() { return m_thread.get(); } + Thread* getThread() { return m_thread.get(); } private: void runInternal(PassOwnPtr<Handle> src, OwnPtr<Handle>* dest1, OwnPtr<Handle>* dest2) { - DataConsumerTee::create(m_thread->executionContext(), src, dest1, dest2); + DataConsumerTee::create(m_thread->getExecutionContext(), src, dest1, dest2); m_waitableEvent->signal(); } @@ -190,7 +190,7 @@ TEST(DataConsumerTeeTest, Error) void postStop(Thread* thread) { - thread->executionContext()->stopActiveDOMObjects(); + thread->getExecutionContext()->stopActiveDOMObjects(); } TEST(DataConsumerTeeTest, StopSource) @@ -212,7 +212,7 @@ TEST(DataConsumerTeeTest, StopSource) // We can pass a raw pointer because the subsequent |wait| calls ensure // t->thread() is alive. - t->thread()->thread()->postTask(BLINK_FROM_HERE, threadSafeBind(postStop, AllowCrossThreadAccess(t->thread()))); + t->getThread()->thread()->postTask(BLINK_FROM_HERE, threadSafeBind(postStop, AllowCrossThreadAccess(t->getThread()))); OwnPtr<HandleReadResult> res1 = r1.wait(); OwnPtr<HandleReadResult> res2 = r2.wait(); @@ -304,7 +304,7 @@ TEST(DataConsumerTeeTest, DetachOneDestination) TEST(DataConsumerTeeTest, DetachBothDestinationsShouldStopSourceReader) { OwnPtr<Handle> src(Handle::create()); - RefPtr<Handle::Context> context(src->context()); + RefPtr<Handle::Context> context(src->getContext()); OwnPtr<WebDataConsumerHandle> dest1, dest2; src->add(Command(Command::Data, "hello, ")); diff --git a/third_party/WebKit/Source/modules/fetch/FetchBlobDataConsumerHandle.cpp b/third_party/WebKit/Source/modules/fetch/FetchBlobDataConsumerHandle.cpp index 156ebe3..e1eac62 100644 --- a/third_party/WebKit/Source/modules/fetch/FetchBlobDataConsumerHandle.cpp +++ b/third_party/WebKit/Source/modules/fetch/FetchBlobDataConsumerHandle.cpp @@ -83,12 +83,12 @@ public: ASSERT(executionContext->isContextThread()); ASSERT(!m_loader); - KURL url = BlobURL::createPublicURL(executionContext->securityOrigin()); + KURL url = BlobURL::createPublicURL(executionContext->getSecurityOrigin()); if (url.isEmpty()) { m_updater->update(createUnexpectedErrorDataConsumerHandle()); return; } - BlobRegistry::registerPublicBlobURL(executionContext->securityOrigin(), url, m_blobDataHandle); + BlobRegistry::registerPublicBlobURL(executionContext->getSecurityOrigin(), url, m_blobDataHandle); m_loader = createLoader(executionContext, this); ASSERT(m_loader); diff --git a/third_party/WebKit/Source/modules/fetch/FetchFormDataConsumerHandleTest.cpp b/third_party/WebKit/Source/modules/fetch/FetchFormDataConsumerHandleTest.cpp index b1e595a..208d70f4 100644 --- a/third_party/WebKit/Source/modules/fetch/FetchFormDataConsumerHandleTest.cpp +++ b/third_party/WebKit/Source/modules/fetch/FetchFormDataConsumerHandleTest.cpp @@ -77,7 +77,7 @@ public: FetchFormDataConsumerHandleTest() : m_page(DummyPageHolder::create(IntSize(1, 1))) {} protected: - Document* document() { return &m_page->document(); } + Document* getDocument() { return &m_page->document(); } OwnPtr<DummyPageHolder> m_page; }; @@ -190,7 +190,7 @@ TEST_F(FetchFormDataConsumerHandleTest, ReadFromSimplFormData) data->appendData("foo", 3); data->appendData("hoge", 4); - OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::create(document(), data); + OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::create(getDocument(), data); HandleReaderRunner<HandleReader> runner(handle.release()); testing::runPendingTasks(); OwnPtr<HandleReadResult> r = runner.wait(); @@ -204,7 +204,7 @@ TEST_F(FetchFormDataConsumerHandleTest, ReadFromComplexFormData) OwnPtr<ReplayingHandle> src = ReplayingHandle::create(); src->add(Command(Command::Data, "bar")); src->add(Command(Command::Done)); - OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::createForTest(document(), data, new LoaderFactory(src.release())); + OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::createForTest(getDocument(), data, new LoaderFactory(src.release())); char c; size_t readSize; EXPECT_EQ(kShouldWait, handle->obtainReader(nullptr)->read(&c, 1, kNone, &readSize)); @@ -222,7 +222,7 @@ TEST_F(FetchFormDataConsumerHandleTest, TwoPhaseReadFromComplexFormData) OwnPtr<ReplayingHandle> src = ReplayingHandle::create(); src->add(Command(Command::Data, "bar")); src->add(Command(Command::Done)); - OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::createForTest(document(), data, new LoaderFactory(src.release())); + OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::createForTest(getDocument(), data, new LoaderFactory(src.release())); char c; size_t readSize; EXPECT_EQ(kShouldWait, handle->obtainReader(nullptr)->read(&c, 1, kNone, &readSize)); @@ -271,7 +271,7 @@ TEST_F(FetchFormDataConsumerHandleTest, DrainAsBlobDataHandleFromSimpleFormData) data->append("name2", "value2"); RefPtr<EncodedFormData> inputFormData = data->encodeMultiPartFormData(); - OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::create(document(), inputFormData); + OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::create(getDocument(), inputFormData); OwnPtr<FetchDataConsumerHandle::Reader> reader = handle->obtainReader(nullptr); RefPtr<BlobDataHandle> blobDataHandle = reader->drainAsBlobDataHandle(); ASSERT_TRUE(blobDataHandle); @@ -288,7 +288,7 @@ TEST_F(FetchFormDataConsumerHandleTest, DrainAsBlobDataHandleFromComplexFormData { RefPtr<EncodedFormData> inputFormData = complexFormData(); - OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::create(document(), inputFormData); + OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::create(getDocument(), inputFormData); OwnPtr<FetchDataConsumerHandle::Reader> reader = handle->obtainReader(nullptr); RefPtr<BlobDataHandle> blobDataHandle = reader->drainAsBlobDataHandle(); ASSERT_TRUE(blobDataHandle); @@ -331,7 +331,7 @@ TEST_F(FetchFormDataConsumerHandleTest, DrainAsFormDataFromSimpleFormData) data->append("name2", "value2"); RefPtr<EncodedFormData> inputFormData = data->encodeMultiPartFormData(); - OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::create(document(), inputFormData); + OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::create(getDocument(), inputFormData); OwnPtr<FetchDataConsumerHandle::Reader> reader = handle->obtainReader(nullptr); RefPtr<EncodedFormData> outputFormData = reader->drainAsFormData(); ASSERT_TRUE(outputFormData); @@ -344,7 +344,7 @@ TEST_F(FetchFormDataConsumerHandleTest, DrainAsFormDataFromComplexFormData) { RefPtr<EncodedFormData> inputFormData = complexFormData(); - OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::create(document(), inputFormData); + OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::create(getDocument(), inputFormData); OwnPtr<FetchDataConsumerHandle::Reader> reader = handle->obtainReader(nullptr); RefPtr<EncodedFormData> outputFormData = reader->drainAsFormData(); ASSERT_TRUE(outputFormData); @@ -396,7 +396,7 @@ TEST_F(FetchFormDataConsumerHandleTest, ZeroByteReadDoesNotAffectDrainingForComp OwnPtr<ReplayingHandle> src = ReplayingHandle::create(); src->add(Command(Command::Data, "bar")); src->add(Command(Command::Done)); - OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::createForTest(document(), complexFormData(), new LoaderFactory(src.release())); + OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::createForTest(getDocument(), complexFormData(), new LoaderFactory(src.release())); OwnPtr<FetchDataConsumerHandle::Reader> reader = handle->obtainReader(nullptr); size_t readSize; EXPECT_EQ(kShouldWait, reader->read(nullptr, 0, kNone, &readSize)); @@ -413,7 +413,7 @@ TEST_F(FetchFormDataConsumerHandleTest, OneByteReadAffectsDrainingForComplexForm OwnPtr<ReplayingHandle> src = ReplayingHandle::create(); src->add(Command(Command::Data, "bar")); src->add(Command(Command::Done)); - OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::createForTest(document(), complexFormData(), new LoaderFactory(src.release())); + OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::createForTest(getDocument(), complexFormData(), new LoaderFactory(src.release())); OwnPtr<FetchDataConsumerHandle::Reader> reader = handle->obtainReader(nullptr); char c; size_t readSize; @@ -431,7 +431,7 @@ TEST_F(FetchFormDataConsumerHandleTest, BeginReadAffectsDrainingForComplexFormDa src->add(Command(Command::Data, "bar")); src->add(Command(Command::Done)); const void* buffer = nullptr; - OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::createForTest(document(), complexFormData(), new LoaderFactory(src.release())); + OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::createForTest(getDocument(), complexFormData(), new LoaderFactory(src.release())); OwnPtr<FetchDataConsumerHandle::Reader> reader = handle->obtainReader(nullptr); size_t available; EXPECT_EQ(kShouldWait, reader->beginRead(&buffer, kNone, &available)); diff --git a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp index 6983e91..b7a7331 100644 --- a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp +++ b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp @@ -339,7 +339,7 @@ void FetchManager::Loader::didReceiveResponse(unsigned long, const ResourceRespo } } - Response* r = Response::create(m_resolver->executionContext(), taintedResponse); + Response* r = Response::create(m_resolver->getExecutionContext(), taintedResponse); if (response.url().protocolIsData()) { // An "Access-Control-Allow-Origin" header is added for data: URLs // but no headers except for "Content-Type" should exist, @@ -689,9 +689,9 @@ void FetchManager::Loader::failed(const String& message) if (!message.isEmpty()) m_executionContext->addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, message)); if (m_resolver) { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; - ScriptState* state = m_resolver->scriptState(); + ScriptState* state = m_resolver->getScriptState(); ScriptState::Scope scope(state); m_resolver->reject(V8ThrowException::createTypeError(state->isolate(), "Failed to fetch")); } @@ -727,7 +727,7 @@ ScriptPromise FetchManager::fetch(ScriptState* scriptState, FetchRequestData* re request->setContext(WebURLRequest::RequestContextFetch); - Loader* loader = Loader::create(executionContext(), this, resolver, request, scriptState->world().isIsolatedWorld()); + Loader* loader = Loader::create(getExecutionContext(), this, resolver, request, scriptState->world().isIsolatedWorld()); m_loaders.add(loader); loader->start(); return promise; diff --git a/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp b/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp index 2b988fd..323b05d 100644 --- a/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp +++ b/third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp @@ -82,12 +82,12 @@ GlobalFetch::ScopedFetcher::~ScopedFetcher() WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher> GlobalFetch::ScopedFetcher::from(DOMWindow& window) { - return GlobalFetchImpl<LocalDOMWindow>::from(toLocalDOMWindow(window), window.executionContext()); + return GlobalFetchImpl<LocalDOMWindow>::from(toLocalDOMWindow(window), window.getExecutionContext()); } WeakPtrWillBeRawPtr<GlobalFetch::ScopedFetcher> GlobalFetch::ScopedFetcher::from(WorkerGlobalScope& worker) { - return GlobalFetchImpl<WorkerGlobalScope>::from(worker, worker.executionContext()); + return GlobalFetchImpl<WorkerGlobalScope>::from(worker, worker.getExecutionContext()); } DEFINE_TRACE(GlobalFetch::ScopedFetcher) @@ -96,14 +96,14 @@ DEFINE_TRACE(GlobalFetch::ScopedFetcher) ScriptPromise GlobalFetch::fetch(ScriptState* scriptState, DOMWindow& window, const RequestInfo& input, const Dictionary& init, ExceptionState& exceptionState) { - UseCounter::count(window.executionContext(), UseCounter::Fetch); + UseCounter::count(window.getExecutionContext(), UseCounter::Fetch); return ScopedFetcher::from(window)->fetch(scriptState, input, init, exceptionState); } ScriptPromise GlobalFetch::fetch(ScriptState* scriptState, WorkerGlobalScope& worker, const RequestInfo& input, const Dictionary& init, ExceptionState& exceptionState) { // Note that UseCounter doesn't work with SharedWorker or ServiceWorker. - UseCounter::count(worker.executionContext(), UseCounter::Fetch); + UseCounter::count(worker.getExecutionContext(), UseCounter::Fetch); return ScopedFetcher::from(worker)->fetch(scriptState, input, init, exceptionState); } diff --git a/third_party/WebKit/Source/modules/fetch/ReadableStreamDataConsumerHandle.cpp b/third_party/WebKit/Source/modules/fetch/ReadableStreamDataConsumerHandle.cpp index a8da59e..f15d54a 100644 --- a/third_party/WebKit/Source/modules/fetch/ReadableStreamDataConsumerHandle.cpp +++ b/third_party/WebKit/Source/modules/fetch/ReadableStreamDataConsumerHandle.cpp @@ -50,7 +50,7 @@ public: bool done; v8::Local<v8::Value> item = v.v8Value(); ASSERT(item->IsObject()); - v8::Local<v8::Value> value = v8CallOrCrash(v8UnpackIteratorResult(v.scriptState(), item.As<v8::Object>(), &done)); + v8::Local<v8::Value> value = v8CallOrCrash(v8UnpackIteratorResult(v.getScriptState(), item.As<v8::Object>(), &done)); if (done) { readingContext->onReadDone(); return v; diff --git a/third_party/WebKit/Source/modules/fetch/ReadableStreamDataConsumerHandleTest.cpp b/third_party/WebKit/Source/modules/fetch/ReadableStreamDataConsumerHandleTest.cpp index fba225c..00c3fa6 100644 --- a/third_party/WebKit/Source/modules/fetch/ReadableStreamDataConsumerHandleTest.cpp +++ b/third_party/WebKit/Source/modules/fetch/ReadableStreamDataConsumerHandleTest.cpp @@ -53,8 +53,8 @@ public: { } - ScriptState* scriptState() { return ScriptState::forMainWorld(m_page->document().frame()); } - v8::Isolate* isolate() { return scriptState()->isolate(); } + ScriptState* getScriptState() { return ScriptState::forMainWorld(m_page->document().frame()); } + v8::Isolate* isolate() { return getScriptState()->isolate(); } v8::MaybeLocal<v8::Value> eval(const char* s) { @@ -65,11 +65,11 @@ public: ADD_FAILURE(); return v8::MaybeLocal<v8::Value>(); } - if (!v8Call(v8::Script::Compile(scriptState()->context(), source), script)) { + if (!v8Call(v8::Script::Compile(getScriptState()->context(), source), script)) { ADD_FAILURE() << "Compilation fails"; return v8::MaybeLocal<v8::Value>(); } - return script->Run(scriptState()->context()); + return script->Run(getScriptState()->context()); } v8::MaybeLocal<v8::Value> evalWithPrintingError(const char* s) { @@ -85,10 +85,10 @@ public: PassOwnPtr<ReadableStreamDataConsumerHandle> createHandle(ScriptValue stream) { NonThrowableExceptionState es; - ScriptValue reader = ReadableStreamOperations::getReader(scriptState(), stream, es); + ScriptValue reader = ReadableStreamOperations::getReader(getScriptState(), stream, es); ASSERT(!reader.isEmpty()); ASSERT(reader.v8Value()->IsObject()); - return ReadableStreamDataConsumerHandle::create(scriptState(), reader); + return ReadableStreamDataConsumerHandle::create(getScriptState(), reader); } void gc() { V8GCController::collectAllGarbageForTesting(isolate()); } @@ -99,8 +99,8 @@ private: TEST_F(ReadableStreamDataConsumerHandleTest, Create) { - ScriptState::Scope scope(scriptState()); - ScriptValue stream(scriptState(), evalWithPrintingError("new ReadableStream")); + ScriptState::Scope scope(getScriptState()); + ScriptValue stream(getScriptState(), evalWithPrintingError("new ReadableStream")); ASSERT_FALSE(stream.isEmpty()); OwnPtr<ReadableStreamDataConsumerHandle> handle = createHandle(stream); ASSERT_TRUE(handle); @@ -121,8 +121,8 @@ TEST_F(ReadableStreamDataConsumerHandleTest, Create) TEST_F(ReadableStreamDataConsumerHandleTest, EmptyStream) { - ScriptState::Scope scope(scriptState()); - ScriptValue stream(scriptState(), evalWithPrintingError( + ScriptState::Scope scope(getScriptState()); + ScriptValue stream(getScriptState(), evalWithPrintingError( "new ReadableStream({start: c => c.close()})")); ASSERT_FALSE(stream.isEmpty()); OwnPtr<ReadableStreamDataConsumerHandle> handle = createHandle(stream); @@ -152,8 +152,8 @@ TEST_F(ReadableStreamDataConsumerHandleTest, EmptyStream) TEST_F(ReadableStreamDataConsumerHandleTest, ErroredStream) { - ScriptState::Scope scope(scriptState()); - ScriptValue stream(scriptState(), evalWithPrintingError( + ScriptState::Scope scope(getScriptState()); + ScriptValue stream(getScriptState(), evalWithPrintingError( "new ReadableStream({start: c => c.error()})")); ASSERT_FALSE(stream.isEmpty()); OwnPtr<ReadableStreamDataConsumerHandle> handle = createHandle(stream); @@ -183,8 +183,8 @@ TEST_F(ReadableStreamDataConsumerHandleTest, ErroredStream) TEST_F(ReadableStreamDataConsumerHandleTest, Read) { - ScriptState::Scope scope(scriptState()); - ScriptValue stream(scriptState(), evalWithPrintingError( + ScriptState::Scope scope(getScriptState()); + ScriptValue stream(getScriptState(), evalWithPrintingError( "var controller;" "var stream = new ReadableStream({start: c => controller = c});" "controller.enqueue(new Uint8Array());" @@ -251,8 +251,8 @@ TEST_F(ReadableStreamDataConsumerHandleTest, Read) TEST_F(ReadableStreamDataConsumerHandleTest, TwoPhaseRead) { - ScriptState::Scope scope(scriptState()); - ScriptValue stream(scriptState(), evalWithPrintingError( + ScriptState::Scope scope(getScriptState()); + ScriptValue stream(getScriptState(), evalWithPrintingError( "var controller;" "var stream = new ReadableStream({start: c => controller = c});" "controller.enqueue(new Uint8Array());" @@ -330,8 +330,8 @@ TEST_F(ReadableStreamDataConsumerHandleTest, TwoPhaseRead) TEST_F(ReadableStreamDataConsumerHandleTest, EnqueueUndefined) { - ScriptState::Scope scope(scriptState()); - ScriptValue stream(scriptState(), evalWithPrintingError( + ScriptState::Scope scope(getScriptState()); + ScriptValue stream(getScriptState(), evalWithPrintingError( "var controller;" "var stream = new ReadableStream({start: c => controller = c});" "controller.enqueue(undefined);" @@ -365,8 +365,8 @@ TEST_F(ReadableStreamDataConsumerHandleTest, EnqueueUndefined) TEST_F(ReadableStreamDataConsumerHandleTest, EnqueueNull) { - ScriptState::Scope scope(scriptState()); - ScriptValue stream(scriptState(), evalWithPrintingError( + ScriptState::Scope scope(getScriptState()); + ScriptValue stream(getScriptState(), evalWithPrintingError( "var controller;" "var stream = new ReadableStream({start: c => controller = c});" "controller.enqueue(null);" @@ -400,8 +400,8 @@ TEST_F(ReadableStreamDataConsumerHandleTest, EnqueueNull) TEST_F(ReadableStreamDataConsumerHandleTest, EnqueueString) { - ScriptState::Scope scope(scriptState()); - ScriptValue stream(scriptState(), evalWithPrintingError( + ScriptState::Scope scope(getScriptState()); + ScriptValue stream(getScriptState(), evalWithPrintingError( "var controller;" "var stream = new ReadableStream({start: c => controller = c});" "controller.enqueue('hello');" @@ -450,8 +450,8 @@ TEST_F(ReadableStreamDataConsumerHandleTest, StreamReaderShouldBeWeak) { // We need this scope to collect local handles. - ScriptState::Scope scope(scriptState()); - stream = ScriptValue(scriptState(), evalWithPrintingError("new ReadableStream()")); + ScriptState::Scope scope(getScriptState()); + stream = ScriptValue(getScriptState(), evalWithPrintingError("new ReadableStream()")); ASSERT_FALSE(stream.isEmpty()); OwnPtr<ReadableStreamDataConsumerHandle> handle = createHandle(stream); ASSERT_TRUE(handle); @@ -492,8 +492,8 @@ TEST_F(ReadableStreamDataConsumerHandleTest, StreamReaderShouldBeWeakWhenReading { // We need this scope to collect local handles. - ScriptState::Scope scope(scriptState()); - stream = ScriptValue(scriptState(), evalWithPrintingError("new ReadableStream()")); + ScriptState::Scope scope(getScriptState()); + stream = ScriptValue(getScriptState(), evalWithPrintingError("new ReadableStream()")); ASSERT_FALSE(stream.isEmpty()); OwnPtr<ReadableStreamDataConsumerHandle> handle = createHandle(stream); ASSERT_TRUE(handle); diff --git a/third_party/WebKit/Source/modules/fetch/Request.cpp b/third_party/WebKit/Source/modules/fetch/Request.cpp index a10f71d..1bbbb2c 100644 --- a/third_party/WebKit/Source/modules/fetch/Request.cpp +++ b/third_party/WebKit/Source/modules/fetch/Request.cpp @@ -36,7 +36,7 @@ FetchRequestData* createCopyOfFetchRequestDataForFetch(ScriptState* scriptState, if (world.isIsolatedWorld()) request->setOrigin(world.isolatedWorldSecurityOrigin()); else - request->setOrigin(scriptState->executionContext()->securityOrigin()); + request->setOrigin(scriptState->getExecutionContext()->getSecurityOrigin()); // FIXME: Set ForceOriginHeaderFlag. request->setSameOriginDataURLFlag(true); request->setReferrer(original->referrer()); @@ -64,7 +64,7 @@ Request* Request::createRequestWithRequestOrString(ScriptState* scriptState, Req // "Let |request| be |input|'s request, if |input| is a Request object, // and a new request otherwise." - RefPtr<SecurityOrigin> origin = scriptState->executionContext()->securityOrigin(); + RefPtr<SecurityOrigin> origin = scriptState->getExecutionContext()->getSecurityOrigin(); // TODO(yhirano): Implement the following steps: // - "Let |window| be client." @@ -95,7 +95,7 @@ Request* Request::createRequestWithRequestOrString(ScriptState* scriptState, Req // "If |input| is a string, run these substeps:" if (!inputRequest) { // "Let |parsedURL| be the result of parsing |input| with |baseURL|." - KURL parsedURL = scriptState->executionContext()->completeURL(inputString); + KURL parsedURL = scriptState->getExecutionContext()->completeURL(inputString); // "If |parsedURL| is failure, throw a TypeError." if (!parsedURL.isValid()) { exceptionState.throwTypeError("Failed to parse URL from " + inputString); @@ -159,7 +159,7 @@ Request* Request::createRequestWithRequestOrString(ScriptState* scriptState, Req } else { // "Let |parsedReferrer| be the result of parsing |referrer| with // |baseURL|." - KURL parsedReferrer = scriptState->executionContext()->completeURL(init.referrer.referrer); + KURL parsedReferrer = scriptState->getExecutionContext()->completeURL(init.referrer.referrer); if (!parsedReferrer.isValid()) { // "If |parsedReferrer| is failure, throw a TypeError." exceptionState.throwTypeError("Referrer '" + init.referrer.referrer + "' is not a valid URL."); @@ -259,7 +259,7 @@ Request* Request::createRequestWithRequestOrString(ScriptState* scriptState, Req } // "Let |r| be a new Request object associated with |request| and a new // Headers object whose guard is "request"." - Request* r = Request::create(scriptState->executionContext(), request); + Request* r = Request::create(scriptState->getExecutionContext(), request); // Perform the following steps: // - "Let |headers| be a copy of |r|'s Headers object." // - "If |init|'s headers member is present, set |headers| to |init|'s @@ -269,7 +269,7 @@ Request* Request::createRequestWithRequestOrString(ScriptState* scriptState, Req // is present. Headers* headers = nullptr; if (!init.headers && init.headersDictionary.isUndefinedOrNull()) { - headers = r->headers()->clone(); + headers = r->getHeaders()->clone(); } // "Empty |r|'s request's header list." r->m_request->headerList()->clearList(); @@ -288,17 +288,17 @@ Request* Request::createRequestWithRequestOrString(ScriptState* scriptState, Req return nullptr; } // "Set |r|'s Headers object's guard to "request-no-cors"." - r->headers()->setGuard(Headers::RequestNoCORSGuard); + r->getHeaders()->setGuard(Headers::RequestNoCORSGuard); } // "Fill |r|'s Headers object with |headers|. Rethrow any exceptions." if (init.headers) { ASSERT(init.headersDictionary.isUndefinedOrNull()); - r->headers()->fillWith(init.headers.get(), exceptionState); + r->getHeaders()->fillWith(init.headers.get(), exceptionState); } else if (!init.headersDictionary.isUndefinedOrNull()) { - r->headers()->fillWith(init.headersDictionary, exceptionState); + r->getHeaders()->fillWith(init.headersDictionary, exceptionState); } else { ASSERT(headers); - r->headers()->fillWith(headers, exceptionState); + r->getHeaders()->fillWith(headers, exceptionState); } if (exceptionState.hadException()) return nullptr; @@ -323,8 +323,8 @@ Request* Request::createRequestWithRequestOrString(ScriptState* scriptState, Req // `Content-Type`/|Content-Type| to |r|'s Headers object. Rethrow any // exception." temporaryBody = new BodyStreamBuffer(init.body.release()); - if (!init.contentType.isEmpty() && !r->headers()->has(HTTPNames::Content_Type, exceptionState)) { - r->headers()->append(HTTPNames::Content_Type, init.contentType, exceptionState); + if (!init.contentType.isEmpty() && !r->getHeaders()->has(HTTPNames::Content_Type, exceptionState)) { + r->getHeaders()->append(HTTPNames::Content_Type, init.contentType, exceptionState); } if (exceptionState.hadException()) return nullptr; @@ -382,7 +382,7 @@ Request* Request::create(ScriptState* scriptState, const String& input, Exceptio Request* Request::create(ScriptState* scriptState, const String& input, const Dictionary& init, ExceptionState& exceptionState) { - RequestInit requestInit(scriptState->executionContext(), init, exceptionState); + RequestInit requestInit(scriptState->getExecutionContext(), init, exceptionState); return createRequestWithRequestOrString(scriptState, nullptr, input, requestInit, exceptionState); } @@ -393,7 +393,7 @@ Request* Request::create(ScriptState* scriptState, Request* input, ExceptionStat Request* Request::create(ScriptState* scriptState, Request* input, const Dictionary& init, ExceptionState& exceptionState) { - RequestInit requestInit(scriptState->executionContext(), init, exceptionState); + RequestInit requestInit(scriptState->getExecutionContext(), init, exceptionState); return createRequestWithRequestOrString(scriptState, input, String(), requestInit, exceptionState); } @@ -592,16 +592,16 @@ Request* Request::clone(ExceptionState& exceptionState) return nullptr; } - FetchRequestData* request = m_request->clone(executionContext()); + FetchRequestData* request = m_request->clone(getExecutionContext()); Headers* headers = Headers::create(request->headerList()); headers->setGuard(m_headers->getGuard()); - return new Request(executionContext(), request, headers); + return new Request(getExecutionContext(), request, headers); } FetchRequestData* Request::passRequestData() { ASSERT(!bodyUsed()); - return m_request->pass(executionContext()); + return m_request->pass(getExecutionContext()); } bool Request::hasBody() const diff --git a/third_party/WebKit/Source/modules/fetch/Request.h b/third_party/WebKit/Source/modules/fetch/Request.h index d04d30d..847b3e3 100644 --- a/third_party/WebKit/Source/modules/fetch/Request.h +++ b/third_party/WebKit/Source/modules/fetch/Request.h @@ -44,7 +44,7 @@ public: // From Request.idl: String method() const; KURL url() const; - Headers* headers() const { return m_headers; } + Headers* getHeaders() const { return m_headers; } String context() const; String referrer() const; String mode() const; diff --git a/third_party/WebKit/Source/modules/fetch/Request.idl b/third_party/WebKit/Source/modules/fetch/Request.idl index 7fe8fed..6bc29fd 100644 --- a/third_party/WebKit/Source/modules/fetch/Request.idl +++ b/third_party/WebKit/Source/modules/fetch/Request.idl @@ -27,7 +27,7 @@ enum RequestRedirect { "follow", "error", "manual" }; ] interface Request { readonly attribute ByteString method; readonly attribute USVString url; - readonly attribute Headers headers; + [ImplementedAs=getHeaders] readonly attribute Headers headers; readonly attribute DOMString referrer; readonly attribute RequestMode mode; readonly attribute RequestCredentials credentials; diff --git a/third_party/WebKit/Source/modules/fetch/RequestTest.cpp b/third_party/WebKit/Source/modules/fetch/RequestTest.cpp index 58cfab7..cd1d578 100644 --- a/third_party/WebKit/Source/modules/fetch/RequestTest.cpp +++ b/third_party/WebKit/Source/modules/fetch/RequestTest.cpp @@ -23,8 +23,8 @@ public: ServiceWorkerRequestTest() : m_page(DummyPageHolder::create(IntSize(1, 1))) { } - ScriptState* scriptState() { return ScriptState::forMainWorld(m_page->document().frame()); } - ExecutionContext* executionContext() { return scriptState()->executionContext(); } + ScriptState* getScriptState() { return ScriptState::forMainWorld(m_page->document().frame()); } + ExecutionContext* getExecutionContext() { return getScriptState()->getExecutionContext(); } private: OwnPtr<DummyPageHolder> m_page; @@ -35,7 +35,7 @@ TEST_F(ServiceWorkerRequestTest, FromString) TrackExceptionState exceptionState; KURL url(ParsedURLString, "http://www.example.com/"); - Request* request = Request::create(scriptState(), url, exceptionState); + Request* request = Request::create(getScriptState(), url, exceptionState); ASSERT_FALSE(exceptionState.hadException()); ASSERT(request); EXPECT_EQ(url, request->url()); @@ -46,10 +46,10 @@ TEST_F(ServiceWorkerRequestTest, FromRequest) TrackExceptionState exceptionState; KURL url(ParsedURLString, "http://www.example.com/"); - Request* request1 = Request::create(scriptState(), url, exceptionState); + Request* request1 = Request::create(getScriptState(), url, exceptionState); ASSERT(request1); - Request* request2 = Request::create(scriptState(), request1, exceptionState); + Request* request2 = Request::create(getScriptState(), request1, exceptionState); ASSERT_FALSE(exceptionState.hadException()); ASSERT(request2); EXPECT_EQ(url, request2->url()); @@ -78,7 +78,7 @@ TEST_F(ServiceWorkerRequestTest, FromAndToWebRequest) webRequest.setHeader(WebString::fromUTF8(headers[i].key), WebString::fromUTF8(headers[i].value)); webRequest.setReferrer(referrer, referrerPolicy); - Request* request = Request::create(executionContext(), webRequest); + Request* request = Request::create(getExecutionContext(), webRequest); ASSERT(request); EXPECT_EQ(url, request->url()); EXPECT_EQ(method, request->method()); @@ -86,7 +86,7 @@ TEST_F(ServiceWorkerRequestTest, FromAndToWebRequest) EXPECT_EQ(referrer, request->referrer()); EXPECT_EQ("navigate", request->mode()); - Headers* requestHeaders = request->headers(); + Headers* requestHeaders = request->getHeaders(); WTF::HashMap<String, String> headersMap; for (int i = 0; headers[i].key; ++i) @@ -114,7 +114,7 @@ TEST_F(ServiceWorkerRequestTest, ToWebRequestStripsURLFragment) TrackExceptionState exceptionState; String urlWithoutFragment = "http://www.example.com/"; String url = urlWithoutFragment + "#fragment"; - Request* request = Request::create(scriptState(), url, exceptionState); + Request* request = Request::create(getScriptState(), url, exceptionState); ASSERT(request); WebServiceWorkerRequest webRequest; diff --git a/third_party/WebKit/Source/modules/fetch/Response.cpp b/third_party/WebKit/Source/modules/fetch/Response.cpp index 60220e0..75a1234 100644 --- a/third_party/WebKit/Source/modules/fetch/Response.cpp +++ b/third_party/WebKit/Source/modules/fetch/Response.cpp @@ -108,7 +108,7 @@ bool isValidReasonPhrase(const String& statusText) Response* Response::create(ScriptState* scriptState, ExceptionState& exceptionState) { - return create(scriptState->executionContext(), nullptr, String(), ResponseInit(), exceptionState); + return create(scriptState->getExecutionContext(), nullptr, String(), ResponseInit(), exceptionState); } Response* Response::create(ScriptState* scriptState, ScriptValue bodyValue, const Dictionary& init, ExceptionState& exceptionState) @@ -116,7 +116,7 @@ Response* Response::create(ScriptState* scriptState, ScriptValue bodyValue, cons v8::Local<v8::Value> body = bodyValue.v8Value(); ScriptValue reader; v8::Isolate* isolate = scriptState->isolate(); - ExecutionContext* executionContext = scriptState->executionContext(); + ExecutionContext* executionContext = scriptState->getExecutionContext(); OwnPtr<FetchDataConsumerHandle> bodyHandle; String contentType; @@ -353,15 +353,15 @@ Response* Response::clone(ExceptionState& exceptionState) return nullptr; } - FetchResponseData* response = m_response->clone(executionContext()); + FetchResponseData* response = m_response->clone(getExecutionContext()); Headers* headers = Headers::create(response->headerList()); headers->setGuard(m_headers->getGuard()); - return new Response(executionContext(), response, headers); + return new Response(getExecutionContext(), response, headers); } bool Response::hasPendingActivity() const { - if (!executionContext() || executionContext()->activeDOMObjectsAreStopped()) + if (!getExecutionContext() || getExecutionContext()->activeDOMObjectsAreStopped()) return false; if (!internalBodyBuffer()) return false; diff --git a/third_party/WebKit/Source/modules/fetch/ResponseTest.cpp b/third_party/WebKit/Source/modules/fetch/ResponseTest.cpp index 37cdd7c..d8ee7ef 100644 --- a/third_party/WebKit/Source/modules/fetch/ResponseTest.cpp +++ b/third_party/WebKit/Source/modules/fetch/ResponseTest.cpp @@ -47,8 +47,8 @@ public: ServiceWorkerResponseTest() : m_page(DummyPageHolder::create(IntSize(1, 1))) { } - ScriptState* scriptState() { return ScriptState::forMainWorld(m_page->document().frame()); } - ExecutionContext* executionContext() { return scriptState()->executionContext(); } + ScriptState* getScriptState() { return ScriptState::forMainWorld(m_page->document().frame()); } + ExecutionContext* getExecutionContext() { return getScriptState()->getExecutionContext(); } private: OwnPtr<DummyPageHolder> m_page; @@ -62,7 +62,7 @@ TEST_F(ServiceWorkerResponseTest, FromFetchResponseData) FetchResponseData* fetchResponseData = FetchResponseData::create(); fetchResponseData->setURL(url); - Response* response = Response::create(executionContext(), fetchResponseData); + Response* response = Response::create(getExecutionContext(), fetchResponseData); ASSERT(response); EXPECT_EQ(url, response->url()); } @@ -70,7 +70,7 @@ TEST_F(ServiceWorkerResponseTest, FromFetchResponseData) TEST_F(ServiceWorkerResponseTest, FromWebServiceWorkerResponse) { OwnPtr<WebServiceWorkerResponse> webResponse = createTestWebServiceWorkerResponse(); - Response* response = Response::create(executionContext(), *webResponse); + Response* response = Response::create(getExecutionContext(), *webResponse); ASSERT(response); EXPECT_EQ(webResponse->url(), response->url()); EXPECT_EQ(webResponse->status(), response->status()); @@ -92,7 +92,7 @@ TEST_F(ServiceWorkerResponseTest, FromWebServiceWorkerResponseDefault) { OwnPtr<WebServiceWorkerResponse> webResponse = createTestWebServiceWorkerResponse(); webResponse->setResponseType(WebServiceWorkerResponseTypeDefault); - Response* response = Response::create(executionContext(), *webResponse); + Response* response = Response::create(getExecutionContext(), *webResponse); Headers* responseHeaders = response->headers(); TrackExceptionState exceptionState; @@ -106,7 +106,7 @@ TEST_F(ServiceWorkerResponseTest, FromWebServiceWorkerResponseBasic) { OwnPtr<WebServiceWorkerResponse> webResponse = createTestWebServiceWorkerResponse(); webResponse->setResponseType(WebServiceWorkerResponseTypeBasic); - Response* response = Response::create(executionContext(), *webResponse); + Response* response = Response::create(getExecutionContext(), *webResponse); Headers* responseHeaders = response->headers(); TrackExceptionState exceptionState; @@ -120,7 +120,7 @@ TEST_F(ServiceWorkerResponseTest, FromWebServiceWorkerResponseCORS) { OwnPtr<WebServiceWorkerResponse> webResponse = createTestWebServiceWorkerResponse(); webResponse->setResponseType(WebServiceWorkerResponseTypeCORS); - Response* response = Response::create(executionContext(), *webResponse); + Response* response = Response::create(getExecutionContext(), *webResponse); Headers* responseHeaders = response->headers(); TrackExceptionState exceptionState; @@ -134,7 +134,7 @@ TEST_F(ServiceWorkerResponseTest, FromWebServiceWorkerResponseOpaque) { OwnPtr<WebServiceWorkerResponse> webResponse = createTestWebServiceWorkerResponse(); webResponse->setResponseType(WebServiceWorkerResponseTypeOpaque); - Response* response = Response::create(executionContext(), *webResponse); + Response* response = Response::create(getExecutionContext(), *webResponse); Headers* responseHeaders = response->headers(); TrackExceptionState exceptionState; @@ -180,8 +180,8 @@ void checkResponseStream(Response* response, bool checkResponseBodyStreamBuffer) EXPECT_CALL(*client1, didFetchDataLoadedString(String("Hello, world"))); EXPECT_CALL(*client2, didFetchDataLoadedString(String("Hello, world"))); - response->internalBodyBuffer()->startLoading(response->executionContext(), FetchDataLoader::createLoaderAsString(), client1); - clonedResponse->internalBodyBuffer()->startLoading(response->executionContext(), FetchDataLoader::createLoaderAsString(), client2); + response->internalBodyBuffer()->startLoading(response->getExecutionContext(), FetchDataLoader::createLoaderAsString(), client1); + clonedResponse->internalBodyBuffer()->startLoading(response->getExecutionContext(), FetchDataLoader::createLoaderAsString(), client2); blink::testing::runPendingTasks(); } @@ -200,7 +200,7 @@ TEST_F(ServiceWorkerResponseTest, BodyStreamBufferCloneDefault) BodyStreamBuffer* buffer = createHelloWorldBuffer(); FetchResponseData* fetchResponseData = FetchResponseData::createWithBuffer(buffer); fetchResponseData->setURL(KURL(ParsedURLString, "http://www.response.com")); - Response* response = Response::create(executionContext(), fetchResponseData); + Response* response = Response::create(getExecutionContext(), fetchResponseData); EXPECT_EQ(response->internalBodyBuffer(), buffer); checkResponseStream(response, true); } @@ -211,7 +211,7 @@ TEST_F(ServiceWorkerResponseTest, BodyStreamBufferCloneBasic) FetchResponseData* fetchResponseData = FetchResponseData::createWithBuffer(buffer); fetchResponseData->setURL(KURL(ParsedURLString, "http://www.response.com")); fetchResponseData = fetchResponseData->createBasicFilteredResponse(); - Response* response = Response::create(executionContext(), fetchResponseData); + Response* response = Response::create(getExecutionContext(), fetchResponseData); EXPECT_EQ(response->internalBodyBuffer(), buffer); checkResponseStream(response, true); } @@ -222,7 +222,7 @@ TEST_F(ServiceWorkerResponseTest, BodyStreamBufferCloneCORS) FetchResponseData* fetchResponseData = FetchResponseData::createWithBuffer(buffer); fetchResponseData->setURL(KURL(ParsedURLString, "http://www.response.com")); fetchResponseData = fetchResponseData->createCORSFilteredResponse(); - Response* response = Response::create(executionContext(), fetchResponseData); + Response* response = Response::create(getExecutionContext(), fetchResponseData); EXPECT_EQ(response->internalBodyBuffer(), buffer); checkResponseStream(response, true); } @@ -233,7 +233,7 @@ TEST_F(ServiceWorkerResponseTest, BodyStreamBufferCloneOpaque) FetchResponseData* fetchResponseData = FetchResponseData::createWithBuffer(buffer); fetchResponseData->setURL(KURL(ParsedURLString, "http://www.response.com")); fetchResponseData = fetchResponseData->createOpaqueFilteredResponse(); - Response* response = Response::create(executionContext(), fetchResponseData); + Response* response = Response::create(getExecutionContext(), fetchResponseData); EXPECT_EQ(response->internalBodyBuffer(), buffer); checkResponseStream(response, false); } @@ -243,7 +243,7 @@ TEST_F(ServiceWorkerResponseTest, BodyStreamBufferCloneError) BodyStreamBuffer* buffer = new BodyStreamBuffer(createFetchDataConsumerHandleFromWebHandle(createUnexpectedErrorDataConsumerHandle())); FetchResponseData* fetchResponseData = FetchResponseData::createWithBuffer(buffer); fetchResponseData->setURL(KURL(ParsedURLString, "http://www.response.com")); - Response* response = Response::create(executionContext(), fetchResponseData); + Response* response = Response::create(getExecutionContext(), fetchResponseData); TrackExceptionState exceptionState; Response* clonedResponse = response->clone(exceptionState); EXPECT_FALSE(exceptionState.hadException()); @@ -253,8 +253,8 @@ TEST_F(ServiceWorkerResponseTest, BodyStreamBufferCloneError) EXPECT_CALL(*client1, didFetchDataLoadFailed()); EXPECT_CALL(*client2, didFetchDataLoadFailed()); - response->internalBodyBuffer()->startLoading(response->executionContext(), FetchDataLoader::createLoaderAsString(), client1); - clonedResponse->internalBodyBuffer()->startLoading(response->executionContext(), FetchDataLoader::createLoaderAsString(), client2); + response->internalBodyBuffer()->startLoading(response->getExecutionContext(), FetchDataLoader::createLoaderAsString(), client1); + clonedResponse->internalBodyBuffer()->startLoading(response->getExecutionContext(), FetchDataLoader::createLoaderAsString(), client2); blink::testing::runPendingTasks(); } diff --git a/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.cpp b/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.cpp index ac7affd..30b4526 100644 --- a/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.cpp +++ b/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.cpp @@ -65,7 +65,7 @@ DOMFileSystem* DOMFileSystem::createIsolatedFileSystem(ExecutionContext* context return 0; StringBuilder filesystemName; - filesystemName.append(createDatabaseIdentifierFromSecurityOrigin(context->securityOrigin())); + filesystemName.append(createDatabaseIdentifierFromSecurityOrigin(context->getSecurityOrigin())); filesystemName.appendLiteral(":Isolated_"); filesystemName.append(filesystemId); @@ -73,7 +73,7 @@ DOMFileSystem* DOMFileSystem::createIsolatedFileSystem(ExecutionContext* context // is to be validated each time the request is being handled. StringBuilder rootURL; rootURL.appendLiteral("filesystem:"); - rootURL.append(context->securityOrigin()->toString()); + rootURL.append(context->getSecurityOrigin()->toString()); rootURL.append('/'); rootURL.append(isolatedPathPrefix); rootURL.append('/'); @@ -156,7 +156,7 @@ void DOMFileSystem::createWriter(const FileEntry* fileEntry, FileWriterCallback* return; } - FileWriter* fileWriter = FileWriter::create(executionContext()); + FileWriter* fileWriter = FileWriter::create(getExecutionContext()); FileWriterBaseCallback* conversionCallback = ConvertToFileWriterCallback::create(successCallback); OwnPtr<AsyncFileSystemCallbacks> callbacks = FileWriterBaseCallbacks::create(fileWriter, conversionCallback, errorCallback, m_context); fileSystem()->createFileWriter(createFileSystemURL(fileEntry), fileWriter, callbacks.release()); diff --git a/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.h b/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.h index c7bee31..fe3072f 100644 --- a/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.h +++ b/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.h @@ -90,13 +90,13 @@ public: template <typename CB, typename CBArg> void scheduleCallback(CB* callback, CBArg* callbackArg) { - scheduleCallback(executionContext(), callback, callbackArg); + scheduleCallback(getExecutionContext(), callback, callbackArg); } template <typename CB, typename CBArg> void scheduleCallback(CB* callback, const CBArg& callbackArg) { - scheduleCallback(executionContext(), callback, callbackArg); + scheduleCallback(getExecutionContext(), callback, callbackArg); } DECLARE_VIRTUAL_TRACE(); diff --git a/third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.cpp b/third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.cpp index 495e1a9..e6dcaa4 100644 --- a/third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.cpp +++ b/third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.cpp @@ -85,9 +85,9 @@ WebFileSystem* DOMFileSystemBase::fileSystem() const return platform->fileSystem(); } -SecurityOrigin* DOMFileSystemBase::securityOrigin() const +SecurityOrigin* DOMFileSystemBase::getSecurityOrigin() const { - return m_context->securityOrigin(); + return m_context->getSecurityOrigin(); } bool DOMFileSystemBase::isValidType(FileSystemType type) @@ -146,7 +146,7 @@ KURL DOMFileSystemBase::createFileSystemURL(const String& fullPath) const // For external filesystem originString could be different from what we have in m_filesystemRootURL. StringBuilder result; result.appendLiteral("filesystem:"); - result.append(securityOrigin()->toString()); + result.append(getSecurityOrigin()->toString()); result.append('/'); result.append(externalPathPrefix); result.append(m_filesystemRootURL.path()); diff --git a/third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.h b/third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.h index 8eadb00..5fa5680 100644 --- a/third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.h +++ b/third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.h @@ -87,7 +87,7 @@ public: FileSystemType type() const { return m_type; } KURL rootURL() const { return m_filesystemRootURL; } WebFileSystem* fileSystem() const; - SecurityOrigin* securityOrigin() const; + SecurityOrigin* getSecurityOrigin() const; // The clonable flag is used in the structured clone algorithm to test // whether the FileSystem API object is permitted to be cloned. It defaults diff --git a/third_party/WebKit/Source/modules/filesystem/DOMWindowFileSystem.cpp b/third_party/WebKit/Source/modules/filesystem/DOMWindowFileSystem.cpp index 37fabb2..3a49a41 100644 --- a/third_party/WebKit/Source/modules/filesystem/DOMWindowFileSystem.cpp +++ b/third_party/WebKit/Source/modules/filesystem/DOMWindowFileSystem.cpp @@ -51,10 +51,10 @@ void DOMWindowFileSystem::webkitRequestFileSystem(DOMWindow& windowArg, int type if (!document) return; - if (SchemeRegistry::schemeShouldBypassContentSecurityPolicy(document->securityOrigin()->protocol())) + if (SchemeRegistry::schemeShouldBypassContentSecurityPolicy(document->getSecurityOrigin()->protocol())) UseCounter::count(document, UseCounter::RequestFileSystemNonWebbyOrigin); - if (!document->securityOrigin()->canAccessFileSystem()) { + if (!document->getSecurityOrigin()->canAccessFileSystem()) { DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(FileError::SECURITY_ERR)); return; } @@ -78,7 +78,7 @@ void DOMWindowFileSystem::webkitResolveLocalFileSystemURL(DOMWindow& windowArg, if (!document) return; - SecurityOrigin* securityOrigin = document->securityOrigin(); + SecurityOrigin* securityOrigin = document->getSecurityOrigin(); KURL completedURL = document->completeURL(url); if (!securityOrigin->canAccessFileSystem() || !securityOrigin->canRequest(completedURL)) { DOMFileSystem::scheduleCallback(document, errorCallback, FileError::create(FileError::SECURITY_ERR)); diff --git a/third_party/WebKit/Source/modules/filesystem/DirectoryEntrySync.cpp b/third_party/WebKit/Source/modules/filesystem/DirectoryEntrySync.cpp index fd291be..0662d63 100644 --- a/third_party/WebKit/Source/modules/filesystem/DirectoryEntrySync.cpp +++ b/third_party/WebKit/Source/modules/filesystem/DirectoryEntrySync.cpp @@ -53,21 +53,21 @@ DirectoryReaderSync* DirectoryEntrySync::createReader() FileEntrySync* DirectoryEntrySync::getFile(const String& path, const FileSystemFlags& options, ExceptionState& exceptionState) { EntrySyncCallbackHelper* helper = EntrySyncCallbackHelper::create(); - m_fileSystem->getFile(this, path, options, helper->successCallback(), helper->errorCallback(), DOMFileSystemBase::Synchronous); + m_fileSystem->getFile(this, path, options, helper->getSuccessCallback(), helper->getErrorCallback(), DOMFileSystemBase::Synchronous); return static_cast<FileEntrySync*>(helper->getResult(exceptionState)); } DirectoryEntrySync* DirectoryEntrySync::getDirectory(const String& path, const FileSystemFlags& options, ExceptionState& exceptionState) { EntrySyncCallbackHelper* helper = EntrySyncCallbackHelper::create(); - m_fileSystem->getDirectory(this, path, options, helper->successCallback(), helper->errorCallback(), DOMFileSystemBase::Synchronous); + m_fileSystem->getDirectory(this, path, options, helper->getSuccessCallback(), helper->getErrorCallback(), DOMFileSystemBase::Synchronous); return static_cast<DirectoryEntrySync*>(helper->getResult(exceptionState)); } void DirectoryEntrySync::removeRecursively(ExceptionState& exceptionState) { VoidSyncCallbackHelper* helper = VoidSyncCallbackHelper::create(); - m_fileSystem->removeRecursively(this, helper->successCallback(), helper->errorCallback(), DOMFileSystemBase::Synchronous); + m_fileSystem->removeRecursively(this, helper->getSuccessCallback(), helper->getErrorCallback(), DOMFileSystemBase::Synchronous); helper->getResult(exceptionState); } diff --git a/third_party/WebKit/Source/modules/filesystem/EntrySync.cpp b/third_party/WebKit/Source/modules/filesystem/EntrySync.cpp index 674ac3d..edbddc5 100644 --- a/third_party/WebKit/Source/modules/filesystem/EntrySync.cpp +++ b/third_party/WebKit/Source/modules/filesystem/EntrySync.cpp @@ -52,28 +52,28 @@ EntrySync* EntrySync::create(EntryBase* entry) Metadata* EntrySync::getMetadata(ExceptionState& exceptionState) { MetadataSyncCallbackHelper* helper = MetadataSyncCallbackHelper::create(); - m_fileSystem->getMetadata(this, helper->successCallback(), helper->errorCallback(), DOMFileSystemBase::Synchronous); + m_fileSystem->getMetadata(this, helper->getSuccessCallback(), helper->getErrorCallback(), DOMFileSystemBase::Synchronous); return helper->getResult(exceptionState); } EntrySync* EntrySync::moveTo(DirectoryEntrySync* parent, const String& name, ExceptionState& exceptionState) const { EntrySyncCallbackHelper* helper = EntrySyncCallbackHelper::create(); - m_fileSystem->move(this, parent, name, helper->successCallback(), helper->errorCallback(), DOMFileSystemBase::Synchronous); + m_fileSystem->move(this, parent, name, helper->getSuccessCallback(), helper->getErrorCallback(), DOMFileSystemBase::Synchronous); return helper->getResult(exceptionState); } EntrySync* EntrySync::copyTo(DirectoryEntrySync* parent, const String& name, ExceptionState& exceptionState) const { EntrySyncCallbackHelper* helper = EntrySyncCallbackHelper::create(); - m_fileSystem->copy(this, parent, name, helper->successCallback(), helper->errorCallback(), DOMFileSystemBase::Synchronous); + m_fileSystem->copy(this, parent, name, helper->getSuccessCallback(), helper->getErrorCallback(), DOMFileSystemBase::Synchronous); return helper->getResult(exceptionState); } void EntrySync::remove(ExceptionState& exceptionState) const { VoidSyncCallbackHelper* helper = VoidSyncCallbackHelper::create(); - m_fileSystem->remove(this, helper->successCallback(), helper->errorCallback(), DOMFileSystemBase::Synchronous); + m_fileSystem->remove(this, helper->getSuccessCallback(), helper->getErrorCallback(), DOMFileSystemBase::Synchronous); helper->getResult(exceptionState); } diff --git a/third_party/WebKit/Source/modules/filesystem/FileWriter.cpp b/third_party/WebKit/Source/modules/filesystem/FileWriter.cpp index e8be4a3..7b96f2c 100644 --- a/third_party/WebKit/Source/modules/filesystem/FileWriter.cpp +++ b/third_party/WebKit/Source/modules/filesystem/FileWriter.cpp @@ -249,7 +249,7 @@ void FileWriter::completeAbort() void FileWriter::doOperation(Operation operation) { - m_asyncOperationId = InspectorInstrumentation::traceAsyncOperationStarting(executionContext(), "FileWriter", m_asyncOperationId); + m_asyncOperationId = InspectorInstrumentation::traceAsyncOperationStarting(getExecutionContext(), "FileWriter", m_asyncOperationId); switch (operation) { case OperationWrite: ASSERT(m_operationInProgress == OperationNone); @@ -298,13 +298,13 @@ void FileWriter::signalCompletion(FileError::ErrorCode code) fireEvent(EventTypeNames::write); fireEvent(EventTypeNames::writeend); - InspectorInstrumentation::traceAsyncOperationCompleted(executionContext(), m_asyncOperationId); + InspectorInstrumentation::traceAsyncOperationCompleted(getExecutionContext(), m_asyncOperationId); m_asyncOperationId = 0; } void FileWriter::fireEvent(const AtomicString& type) { - InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(executionContext(), m_asyncOperationId); + InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(getExecutionContext(), m_asyncOperationId); ++m_recursionDepth; dispatchEvent(ProgressEvent::create(type, true, m_bytesWritten, m_bytesToWrite)); --m_recursionDepth; diff --git a/third_party/WebKit/Source/modules/filesystem/FileWriter.h b/third_party/WebKit/Source/modules/filesystem/FileWriter.h index f59e2f6..a2653a1 100644 --- a/third_party/WebKit/Source/modules/filesystem/FileWriter.h +++ b/third_party/WebKit/Source/modules/filesystem/FileWriter.h @@ -86,7 +86,7 @@ public: // EventTarget const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override { return ActiveDOMObject::executionContext(); } + ExecutionContext* getExecutionContext() const override { return ActiveDOMObject::getExecutionContext(); } DEFINE_ATTRIBUTE_EVENT_LISTENER(writestart); DEFINE_ATTRIBUTE_EVENT_LISTENER(progress); diff --git a/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.cpp b/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.cpp index 6e4cb88..3a5a7b7 100644 --- a/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.cpp +++ b/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.cpp @@ -162,7 +162,7 @@ void LocalFileSystem::fileSystemAllowedInternal( return; } - KURL storagePartition = KURL(KURL(), context->securityOrigin()->toString()); + KURL storagePartition = KURL(KURL(), context->getSecurityOrigin()->toString()); fileSystem()->openFileSystem(storagePartition, static_cast<WebFileSystemType>(type), callbacks->release()); } @@ -187,7 +187,7 @@ void LocalFileSystem::deleteFileSystemInternal( fileSystemNotAvailable(context, callbacks); return; } - KURL storagePartition = KURL(KURL(), context->securityOrigin()->toString()); + KURL storagePartition = KURL(KURL(), context->getSecurityOrigin()->toString()); fileSystem()->deleteFileSystem(storagePartition, static_cast<WebFileSystemType>(type), callbacks->release()); } diff --git a/third_party/WebKit/Source/modules/filesystem/SyncCallbackHelper.h b/third_party/WebKit/Source/modules/filesystem/SyncCallbackHelper.h index a954d2a..4d8ec6d 100644 --- a/third_party/WebKit/Source/modules/filesystem/SyncCallbackHelper.h +++ b/third_party/WebKit/Source/modules/filesystem/SyncCallbackHelper.h @@ -82,8 +82,8 @@ public: return m_result; } - SuccessCallback* successCallback() { return SuccessCallbackImpl::create(this); } - ErrorCallback* errorCallback() { return ErrorCallbackImpl::create(this); } + SuccessCallback* getSuccessCallback() { return SuccessCallbackImpl::create(this); } + ErrorCallback* getErrorCallback() { return ErrorCallbackImpl::create(this); } DEFINE_INLINE_TRACE() { diff --git a/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.cpp b/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.cpp index caa7b4c..50fcd54 100644 --- a/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.cpp +++ b/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.cpp @@ -46,8 +46,8 @@ namespace blink { void WorkerGlobalScopeFileSystem::webkitRequestFileSystem(WorkerGlobalScope& worker, int type, long long size, FileSystemCallback* successCallback, ErrorCallback* errorCallback) { - ExecutionContext* secureContext = worker.executionContext(); - if (!secureContext->securityOrigin()->canAccessFileSystem()) { + ExecutionContext* secureContext = worker.getExecutionContext(); + if (!secureContext->getSecurityOrigin()->canAccessFileSystem()) { DOMFileSystem::scheduleCallback(&worker, errorCallback, FileError::create(FileError::SECURITY_ERR)); return; } @@ -63,8 +63,8 @@ void WorkerGlobalScopeFileSystem::webkitRequestFileSystem(WorkerGlobalScope& wor DOMFileSystemSync* WorkerGlobalScopeFileSystem::webkitRequestFileSystemSync(WorkerGlobalScope& worker, int type, long long size, ExceptionState& exceptionState) { - ExecutionContext* secureContext = worker.executionContext(); - if (!secureContext->securityOrigin()->canAccessFileSystem()) { + ExecutionContext* secureContext = worker.getExecutionContext(); + if (!secureContext->getSecurityOrigin()->canAccessFileSystem()) { exceptionState.throwSecurityError(FileError::securityErrorMessage); return 0; } @@ -76,7 +76,7 @@ DOMFileSystemSync* WorkerGlobalScopeFileSystem::webkitRequestFileSystemSync(Work } FileSystemSyncCallbackHelper* helper = FileSystemSyncCallbackHelper::create(); - OwnPtr<AsyncFileSystemCallbacks> callbacks = FileSystemCallbacks::create(helper->successCallback(), helper->errorCallback(), &worker, fileSystemType); + OwnPtr<AsyncFileSystemCallbacks> callbacks = FileSystemCallbacks::create(helper->getSuccessCallback(), helper->getErrorCallback(), &worker, fileSystemType); callbacks->setShouldBlockUntilCompletion(true); LocalFileSystem::from(worker)->requestFileSystem(&worker, fileSystemType, size, callbacks.release()); @@ -86,8 +86,8 @@ DOMFileSystemSync* WorkerGlobalScopeFileSystem::webkitRequestFileSystemSync(Work void WorkerGlobalScopeFileSystem::webkitResolveLocalFileSystemURL(WorkerGlobalScope& worker, const String& url, EntryCallback* successCallback, ErrorCallback* errorCallback) { KURL completedURL = worker.completeURL(url); - ExecutionContext* secureContext = worker.executionContext(); - if (!secureContext->securityOrigin()->canAccessFileSystem() || !secureContext->securityOrigin()->canRequest(completedURL)) { + ExecutionContext* secureContext = worker.getExecutionContext(); + if (!secureContext->getSecurityOrigin()->canAccessFileSystem() || !secureContext->getSecurityOrigin()->canRequest(completedURL)) { DOMFileSystem::scheduleCallback(&worker, errorCallback, FileError::create(FileError::SECURITY_ERR)); return; } @@ -103,8 +103,8 @@ void WorkerGlobalScopeFileSystem::webkitResolveLocalFileSystemURL(WorkerGlobalSc EntrySync* WorkerGlobalScopeFileSystem::webkitResolveLocalFileSystemSyncURL(WorkerGlobalScope& worker, const String& url, ExceptionState& exceptionState) { KURL completedURL = worker.completeURL(url); - ExecutionContext* secureContext = worker.executionContext(); - if (!secureContext->securityOrigin()->canAccessFileSystem() || !secureContext->securityOrigin()->canRequest(completedURL)) { + ExecutionContext* secureContext = worker.getExecutionContext(); + if (!secureContext->getSecurityOrigin()->canAccessFileSystem() || !secureContext->getSecurityOrigin()->canRequest(completedURL)) { exceptionState.throwSecurityError(FileError::securityErrorMessage); return 0; } @@ -115,7 +115,7 @@ EntrySync* WorkerGlobalScopeFileSystem::webkitResolveLocalFileSystemSyncURL(Work } EntrySyncCallbackHelper* resolveURLHelper = EntrySyncCallbackHelper::create(); - OwnPtr<AsyncFileSystemCallbacks> callbacks = ResolveURICallbacks::create(resolveURLHelper->successCallback(), resolveURLHelper->errorCallback(), &worker); + OwnPtr<AsyncFileSystemCallbacks> callbacks = ResolveURICallbacks::create(resolveURLHelper->getSuccessCallback(), resolveURLHelper->getErrorCallback(), &worker); callbacks->setShouldBlockUntilCompletion(true); LocalFileSystem::from(worker)->resolveURL(&worker, completedURL, callbacks.release()); diff --git a/third_party/WebKit/Source/modules/gamepad/GamepadEvent.h b/third_party/WebKit/Source/modules/gamepad/GamepadEvent.h index b1a1a5d..b12e555 100644 --- a/third_party/WebKit/Source/modules/gamepad/GamepadEvent.h +++ b/third_party/WebKit/Source/modules/gamepad/GamepadEvent.h @@ -28,7 +28,7 @@ public: } ~GamepadEvent() override; - Gamepad* gamepad() const { return m_gamepad.get(); } + Gamepad* getGamepad() const { return m_gamepad.get(); } const AtomicString& interfaceName() const override; diff --git a/third_party/WebKit/Source/modules/gamepad/GamepadEvent.idl b/third_party/WebKit/Source/modules/gamepad/GamepadEvent.idl index 86c0b2a..0f5f910 100644 --- a/third_party/WebKit/Source/modules/gamepad/GamepadEvent.idl +++ b/third_party/WebKit/Source/modules/gamepad/GamepadEvent.idl @@ -7,5 +7,5 @@ [ Constructor(DOMString type, optional GamepadEventInit eventInitDict), ] interface GamepadEvent : Event { - readonly attribute Gamepad gamepad; + [ImplementedAs=getGamepad] readonly attribute Gamepad gamepad; }; diff --git a/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp b/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp index 634e878..19d50a7 100644 --- a/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp +++ b/third_party/WebKit/Source/modules/geolocation/Geolocation.cpp @@ -112,7 +112,7 @@ DEFINE_TRACE(Geolocation) Document* Geolocation::document() const { - return toDocument(executionContext()); + return toDocument(getExecutionContext()); } LocalFrame* Geolocation::frame() const @@ -187,7 +187,7 @@ int Geolocation::watchPosition(PositionCallback* successCallback, PositionErrorC int watchID; // Keep asking for the next id until we're given one that we don't already have. do { - watchID = executionContext()->circularSequentialID(); + watchID = getExecutionContext()->circularSequentialID(); } while (!m_watchers.add(watchID, notifier)); return watchID; } @@ -196,7 +196,7 @@ void Geolocation::startRequest(GeoNotifier *notifier) { recordOriginTypeAccess(); String errorMessage; - if (!frame()->settings()->allowGeolocationOnInsecureOrigins() && !executionContext()->isSecureContext(errorMessage)) { + if (!frame()->settings()->allowGeolocationOnInsecureOrigins() && !getExecutionContext()->isSecureContext(errorMessage)) { notifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, errorMessage)); return; } diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp index cdac175..4dba150 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.cpp @@ -345,10 +345,10 @@ void IDBDatabase::closeConnection() m_backend.clear(); } - if (m_contextStopped || !executionContext()) + if (m_contextStopped || !getExecutionContext()) return; - EventQueue* eventQueue = executionContext()->eventQueue(); + EventQueue* eventQueue = getExecutionContext()->getEventQueue(); // Remove any pending versionchange events scheduled to fire on this // connection. They would have been scheduled by the backend when another // connection attempted an upgrade, but the frontend connection is being @@ -362,7 +362,7 @@ void IDBDatabase::closeConnection() void IDBDatabase::onVersionChange(int64_t oldVersion, int64_t newVersion) { IDB_TRACE("IDBDatabase::onVersionChange"); - if (m_contextStopped || !executionContext()) + if (m_contextStopped || !getExecutionContext()) return; if (m_closePending) { @@ -380,8 +380,8 @@ void IDBDatabase::onVersionChange(int64_t oldVersion, int64_t newVersion) void IDBDatabase::enqueueEvent(PassRefPtrWillBeRawPtr<Event> event) { ASSERT(!m_contextStopped); - ASSERT(executionContext()); - EventQueue* eventQueue = executionContext()->eventQueue(); + ASSERT(getExecutionContext()); + EventQueue* eventQueue = getExecutionContext()->getEventQueue(); event->setTarget(this); eventQueue->enqueueEvent(event.get()); m_enqueuedEvents.append(event); @@ -390,7 +390,7 @@ void IDBDatabase::enqueueEvent(PassRefPtrWillBeRawPtr<Event> event) DispatchEventResult IDBDatabase::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event) { IDB_TRACE("IDBDatabase::dispatchEvent"); - if (m_contextStopped || !executionContext()) + if (m_contextStopped || !getExecutionContext()) return DispatchEventResult::CanceledBeforeDispatch; ASSERT(event->type() == EventTypeNames::versionchange || event->type() == EventTypeNames::close); for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { @@ -440,9 +440,9 @@ const AtomicString& IDBDatabase::interfaceName() const return EventTargetNames::IDBDatabase; } -ExecutionContext* IDBDatabase::executionContext() const +ExecutionContext* IDBDatabase::getExecutionContext() const { - return ActiveDOMObject::executionContext(); + return ActiveDOMObject::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 68ea08d..2f81278 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.h +++ b/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.h @@ -96,7 +96,7 @@ public: // EventTarget const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; bool isClosePending() const { return m_closePending; } void forceClose(); diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp index 7707991..75e0235 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp @@ -73,21 +73,21 @@ static bool isContextValid(ExecutionContext* context) IDBRequest* IDBFactory::getDatabaseNames(ScriptState* scriptState, ExceptionState& exceptionState) { IDB_TRACE("IDBFactory::getDatabaseNames"); - if (!isContextValid(scriptState->executionContext())) + if (!isContextValid(scriptState->getExecutionContext())) return nullptr; - if (!scriptState->executionContext()->securityOrigin()->canAccessDatabase()) { + if (!scriptState->getExecutionContext()->getSecurityOrigin()->canAccessDatabase()) { exceptionState.throwSecurityError("access to the Indexed Database API is denied in this context."); return nullptr; } IDBRequest* request = IDBRequest::create(scriptState, IDBAny::createNull(), nullptr); - if (!m_permissionClient->allowIndexedDB(scriptState->executionContext(), "Database Listing")) { + if (!m_permissionClient->allowIndexedDB(scriptState->getExecutionContext(), "Database Listing")) { request->onError(DOMException::create(UnknownError, permissionDeniedErrorMessage)); return request; } - Platform::current()->idbFactory()->getDatabaseNames(WebIDBCallbacksImpl::create(request).leakPtr(), WebSecurityOrigin(scriptState->executionContext()->securityOrigin())); + Platform::current()->idbFactory()->getDatabaseNames(WebIDBCallbacksImpl::create(request).leakPtr(), WebSecurityOrigin(scriptState->getExecutionContext()->getSecurityOrigin())); return request; } @@ -105,9 +105,9 @@ IDBOpenDBRequest* IDBFactory::openInternal(ScriptState* scriptState, const Strin { IDBDatabase::recordApiCallsHistogram(IDBOpenCall); ASSERT(version >= 1 || version == IDBDatabaseMetadata::NoVersion); - if (!isContextValid(scriptState->executionContext())) + if (!isContextValid(scriptState->getExecutionContext())) return nullptr; - if (!scriptState->executionContext()->securityOrigin()->canAccessDatabase()) { + if (!scriptState->getExecutionContext()->getSecurityOrigin()->canAccessDatabase()) { exceptionState.throwSecurityError("access to the Indexed Database API is denied in this context."); return nullptr; } @@ -116,12 +116,12 @@ IDBOpenDBRequest* IDBFactory::openInternal(ScriptState* scriptState, const Strin int64_t transactionId = IDBDatabase::nextTransactionId(); IDBOpenDBRequest* request = IDBOpenDBRequest::create(scriptState, databaseCallbacks, transactionId, version); - if (!m_permissionClient->allowIndexedDB(scriptState->executionContext(), name)) { + if (!m_permissionClient->allowIndexedDB(scriptState->getExecutionContext(), name)) { request->onError(DOMException::create(UnknownError, permissionDeniedErrorMessage)); return request; } - Platform::current()->idbFactory()->open(name, version, transactionId, WebIDBCallbacksImpl::create(request).leakPtr(), WebIDBDatabaseCallbacksImpl::create(databaseCallbacks).leakPtr(), WebSecurityOrigin(scriptState->executionContext()->securityOrigin())); + Platform::current()->idbFactory()->open(name, version, transactionId, WebIDBCallbacksImpl::create(request).leakPtr(), WebIDBDatabaseCallbacksImpl::create(databaseCallbacks).leakPtr(), WebSecurityOrigin(scriptState->getExecutionContext()->getSecurityOrigin())); return request; } @@ -135,21 +135,21 @@ IDBOpenDBRequest* IDBFactory::deleteDatabase(ScriptState* scriptState, const Str { IDB_TRACE("IDBFactory::deleteDatabase"); IDBDatabase::recordApiCallsHistogram(IDBDeleteDatabaseCall); - if (!isContextValid(scriptState->executionContext())) + if (!isContextValid(scriptState->getExecutionContext())) return nullptr; - if (!scriptState->executionContext()->securityOrigin()->canAccessDatabase()) { + if (!scriptState->getExecutionContext()->getSecurityOrigin()->canAccessDatabase()) { exceptionState.throwSecurityError("access to the Indexed Database API is denied in this context."); return nullptr; } IDBOpenDBRequest* request = IDBOpenDBRequest::create(scriptState, nullptr, 0, IDBDatabaseMetadata::DefaultVersion); - if (!m_permissionClient->allowIndexedDB(scriptState->executionContext(), name)) { + if (!m_permissionClient->allowIndexedDB(scriptState->getExecutionContext(), name)) { request->onError(DOMException::create(UnknownError, permissionDeniedErrorMessage)); return request; } - Platform::current()->idbFactory()->deleteDatabase(name, WebIDBCallbacksImpl::create(request).leakPtr(), WebSecurityOrigin(scriptState->executionContext()->securityOrigin())); + Platform::current()->idbFactory()->deleteDatabase(name, WebIDBCallbacksImpl::create(request).leakPtr(), WebSecurityOrigin(scriptState->getExecutionContext()->getSecurityOrigin())); return request; } diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBIndex.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBIndex.cpp index 0170a98..b7340d4 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBIndex.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBIndex.cpp @@ -85,7 +85,7 @@ IDBRequest* IDBIndex::openCursor(ScriptState* scriptState, const ScriptValue& ra return nullptr; } WebIDBCursorDirection direction = IDBCursor::stringToDirection(directionString); - IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->executionContext(), range, exceptionState); + IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->getExecutionContext(), range, exceptionState); if (exceptionState.hadException()) return nullptr; @@ -121,7 +121,7 @@ IDBRequest* IDBIndex::count(ScriptState* scriptState, const ScriptValue& range, return nullptr; } - IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->executionContext(), range, exceptionState); + IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->getExecutionContext(), range, exceptionState); if (exceptionState.hadException()) return nullptr; @@ -151,7 +151,7 @@ IDBRequest* IDBIndex::openKeyCursor(ScriptState* scriptState, const ScriptValue& return nullptr; } WebIDBCursorDirection direction = IDBCursor::stringToDirection(directionString); - IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->executionContext(), range, exceptionState); + IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->getExecutionContext(), range, exceptionState); if (exceptionState.hadException()) return nullptr; if (!backendDB()) { @@ -214,7 +214,7 @@ IDBRequest* IDBIndex::getInternal(ScriptState* scriptState, const ScriptValue& k return nullptr; } - IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->executionContext(), key, exceptionState); + IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->getExecutionContext(), key, exceptionState); if (exceptionState.hadException()) return nullptr; if (!keyRange) { @@ -249,7 +249,7 @@ IDBRequest* IDBIndex::getAllInternal(ScriptState* scriptState, const ScriptValue return nullptr; } - IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->executionContext(), range, exceptionState); + IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->getExecutionContext(), range, exceptionState); if (exceptionState.hadException()) return nullptr; if (!backendDB()) { diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp index a367c5b..175b888 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp @@ -99,7 +99,7 @@ IDBRequest* IDBObjectStore::get(ScriptState* scriptState, const ScriptValue& key exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::transactionInactiveErrorMessage); return nullptr; } - IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->executionContext(), key, exceptionState); + IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->getExecutionContext(), key, exceptionState); if (exceptionState.hadException()) return nullptr; if (!keyRange) { @@ -139,7 +139,7 @@ IDBRequest* IDBObjectStore::getAll(ScriptState* scriptState, const ScriptValue& exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::transactionInactiveErrorMessage); return nullptr; } - IDBKeyRange* range = IDBKeyRange::fromScriptValue(scriptState->executionContext(), keyRange, exceptionState); + IDBKeyRange* range = IDBKeyRange::fromScriptValue(scriptState->getExecutionContext(), keyRange, exceptionState); if (exceptionState.hadException()) return nullptr; if (!backendDB()) { @@ -175,7 +175,7 @@ IDBRequest* IDBObjectStore::getAllKeys(ScriptState* scriptState, const ScriptVal exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::transactionInactiveErrorMessage); return nullptr; } - IDBKeyRange* range = IDBKeyRange::fromScriptValue(scriptState->executionContext(), keyRange, exceptionState); + IDBKeyRange* range = IDBKeyRange::fromScriptValue(scriptState->getExecutionContext(), keyRange, exceptionState); if (exceptionState.hadException()) return nullptr; if (!backendDB()) { @@ -361,7 +361,7 @@ IDBRequest* IDBObjectStore::deleteFunction(ScriptState* scriptState, const Scrip return nullptr; } - IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->executionContext(), key, exceptionState); + IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->getExecutionContext(), key, exceptionState); if (exceptionState.hadException()) return nullptr; if (!keyRange) { @@ -444,7 +444,7 @@ private: void handleEvent(ExecutionContext* executionContext, Event* event) override { - ASSERT(m_scriptState->executionContext() == executionContext); + ASSERT(m_scriptState->getExecutionContext() == executionContext); ASSERT(event->type() == EventTypeNames::success); EventTarget* target = event->target(); IDBRequest* request = static_cast<IDBRequest*>(target); @@ -644,7 +644,7 @@ IDBRequest* IDBObjectStore::openCursor(ScriptState* scriptState, const ScriptVal } WebIDBCursorDirection direction = IDBCursor::stringToDirection(directionString); - IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->executionContext(), range, exceptionState); + IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->getExecutionContext(), range, exceptionState); if (exceptionState.hadException()) return nullptr; @@ -682,7 +682,7 @@ IDBRequest* IDBObjectStore::openKeyCursor(ScriptState* scriptState, const Script } WebIDBCursorDirection direction = IDBCursor::stringToDirection(directionString); - IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->executionContext(), range, exceptionState); + IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->getExecutionContext(), range, exceptionState); if (exceptionState.hadException()) return nullptr; @@ -714,7 +714,7 @@ IDBRequest* IDBObjectStore::count(ScriptState* scriptState, const ScriptValue& r return nullptr; } - IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->executionContext(), range, exceptionState); + IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->getExecutionContext(), range, exceptionState); if (exceptionState.hadException()) return nullptr; diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.cpp index a0e5869..d7569ae 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.cpp @@ -81,7 +81,7 @@ void IDBOpenDBRequest::onBlocked(int64_t oldVersion) void IDBOpenDBRequest::onUpgradeNeeded(int64_t oldVersion, PassOwnPtr<WebIDBDatabase> backend, const IDBDatabaseMetadata& metadata, WebIDBDataLoss dataLoss, String dataLossMessage) { IDB_TRACE("IDBOpenDBRequest::onUpgradeNeeded()"); - if (m_contextStopped || !executionContext()) { + if (m_contextStopped || !getExecutionContext()) { OwnPtr<WebIDBDatabase> db = backend; db->abort(m_transactionId); db->close(); @@ -92,7 +92,7 @@ void IDBOpenDBRequest::onUpgradeNeeded(int64_t oldVersion, PassOwnPtr<WebIDBData ASSERT(m_databaseCallbacks); - IDBDatabase* idbDatabase = IDBDatabase::create(executionContext(), backend, m_databaseCallbacks.release()); + IDBDatabase* idbDatabase = IDBDatabase::create(getExecutionContext(), backend, m_databaseCallbacks.release()); idbDatabase->setMetadata(metadata); if (oldVersion == IDBDatabaseMetadata::NoVersion) { @@ -102,7 +102,7 @@ void IDBOpenDBRequest::onUpgradeNeeded(int64_t oldVersion, PassOwnPtr<WebIDBData IDBDatabaseMetadata oldMetadata(metadata); oldMetadata.version = oldVersion; - m_transaction = IDBTransaction::create(scriptState(), m_transactionId, idbDatabase, this, oldMetadata); + m_transaction = IDBTransaction::create(getScriptState(), m_transactionId, idbDatabase, this, oldMetadata); setResult(IDBAny::create(idbDatabase)); if (m_version == IDBDatabaseMetadata::NoVersion) @@ -113,7 +113,7 @@ void IDBOpenDBRequest::onUpgradeNeeded(int64_t oldVersion, PassOwnPtr<WebIDBData void IDBOpenDBRequest::onSuccess(PassOwnPtr<WebIDBDatabase> backend, const IDBDatabaseMetadata& metadata) { IDB_TRACE("IDBOpenDBRequest::onSuccess()"); - if (m_contextStopped || !executionContext()) { + if (m_contextStopped || !getExecutionContext()) { OwnPtr<WebIDBDatabase> db = backend; if (db) db->close(); @@ -132,7 +132,7 @@ void IDBOpenDBRequest::onSuccess(PassOwnPtr<WebIDBDatabase> backend, const IDBDa } else { ASSERT(backend.get()); ASSERT(m_databaseCallbacks); - idbDatabase = IDBDatabase::create(executionContext(), backend, m_databaseCallbacks.release()); + idbDatabase = IDBDatabase::create(getExecutionContext(), backend, m_databaseCallbacks.release()); setResult(IDBAny::create(idbDatabase)); } idbDatabase->setMetadata(metadata); @@ -154,7 +154,7 @@ void IDBOpenDBRequest::onSuccess(int64_t oldVersion) bool IDBOpenDBRequest::shouldEnqueueEvent() const { - if (m_contextStopped || !executionContext()) + if (m_contextStopped || !getExecutionContext()) return false; ASSERT(m_readyState == PENDING || m_readyState == DONE); if (m_requestAborted) diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp index 94116b6..fbf20c9 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp @@ -60,7 +60,7 @@ IDBRequest* IDBRequest::create(ScriptState* scriptState, IDBAny* source, IDBTran } IDBRequest::IDBRequest(ScriptState* scriptState, IDBAny* source, IDBTransaction* transaction) - : ActiveDOMObject(scriptState->executionContext()) + : ActiveDOMObject(scriptState->getExecutionContext()) , m_transaction(transaction) , m_scriptState(scriptState) , m_source(source) @@ -69,7 +69,7 @@ IDBRequest::IDBRequest(ScriptState* scriptState, IDBAny* source, IDBTransaction* IDBRequest::~IDBRequest() { - ASSERT(m_readyState == DONE || m_readyState == EarlyDeath || !executionContext()); + ASSERT(m_readyState == DONE || m_readyState == EarlyDeath || !getExecutionContext()); } DEFINE_TRACE(IDBRequest) @@ -92,7 +92,7 @@ ScriptValue IDBRequest::result(ExceptionState& exceptionState) exceptionState.throwDOMException(InvalidStateError, IDBDatabase::requestNotFinishedErrorMessage); return ScriptValue(); } - if (m_contextStopped || !executionContext()) + if (m_contextStopped || !getExecutionContext()) return ScriptValue(); m_resultDirty = false; ScriptValue value = ScriptValue::from(m_scriptState.get(), m_result); @@ -110,7 +110,7 @@ DOMException* IDBRequest::error(ExceptionState& exceptionState) const ScriptValue IDBRequest::source() const { - if (m_contextStopped || !executionContext()) + if (m_contextStopped || !getExecutionContext()) return ScriptValue(); return ScriptValue::from(m_scriptState.get(), m_source); @@ -129,13 +129,13 @@ const String& IDBRequest::readyState() const void IDBRequest::abort() { ASSERT(!m_requestAborted); - if (m_contextStopped || !executionContext()) + if (m_contextStopped || !getExecutionContext()) return; ASSERT(m_readyState == PENDING || m_readyState == DONE); if (m_readyState == DONE) return; - EventQueue* eventQueue = executionContext()->eventQueue(); + EventQueue* eventQueue = getExecutionContext()->getEventQueue(); for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { bool removed = eventQueue->cancelEvent(m_enqueuedEvents[i].get()); ASSERT_UNUSED(removed, removed); @@ -159,7 +159,7 @@ void IDBRequest::setCursorDetails(IndexedDB::CursorType cursorType, WebIDBCursor void IDBRequest::setPendingCursor(IDBCursor* cursor) { ASSERT(m_readyState == DONE); - ASSERT(executionContext()); + ASSERT(getExecutionContext()); ASSERT(m_transaction); ASSERT(!m_pendingCursor); ASSERT(cursor == getResultCursor()); @@ -211,7 +211,7 @@ void IDBRequest::ackReceivedBlobs(const Vector<RefPtr<IDBValue>>& values) bool IDBRequest::shouldEnqueueEvent() const { - if (m_contextStopped || !executionContext()) + if (m_contextStopped || !getExecutionContext()) return false; ASSERT(m_readyState == PENDING || m_readyState == DONE); if (m_requestAborted) @@ -405,15 +405,15 @@ const AtomicString& IDBRequest::interfaceName() const return EventTargetNames::IDBRequest; } -ExecutionContext* IDBRequest::executionContext() const +ExecutionContext* IDBRequest::getExecutionContext() const { - return ActiveDOMObject::executionContext(); + return ActiveDOMObject::getExecutionContext(); } DispatchEventResult IDBRequest::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event) { IDB_TRACE("IDBRequest::dispatchEvent"); - if (m_contextStopped || !executionContext()) + if (m_contextStopped || !getExecutionContext()) return DispatchEventResult::CanceledBeforeDispatch; ASSERT(m_readyState == PENDING); ASSERT(m_hasPendingActivity); @@ -500,7 +500,7 @@ void IDBRequest::transactionDidFinishAndDispatch() ASSERT(m_transaction->isVersionChange()); ASSERT(m_didFireUpgradeNeededEvent); ASSERT(m_readyState == DONE); - ASSERT(executionContext()); + ASSERT(getExecutionContext()); m_transaction.clear(); if (m_contextStopped) @@ -513,12 +513,12 @@ void IDBRequest::enqueueEvent(PassRefPtrWillBeRawPtr<Event> event) { ASSERT(m_readyState == PENDING || m_readyState == DONE); - if (m_contextStopped || !executionContext()) + if (m_contextStopped || !getExecutionContext()) return; ASSERT_WITH_MESSAGE(m_readyState == PENDING || m_didFireUpgradeNeededEvent, "When queueing event %s, m_readyState was %d", event->type().utf8().data(), m_readyState); - EventQueue* eventQueue = executionContext()->eventQueue(); + EventQueue* eventQueue = getExecutionContext()->getEventQueue(); event->setTarget(this); // Keep track of enqueued events in case we need to abort prior to dispatch, diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.h b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.h index c294a66..d5b3134 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.h +++ b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.h @@ -65,7 +65,7 @@ public: ~IDBRequest() override; DECLARE_VIRTUAL_TRACE(); - ScriptState* scriptState() { return m_scriptState.get(); } + ScriptState* getScriptState() { return m_scriptState.get(); } ScriptValue result(ExceptionState&); DOMException* error(ExceptionState&) const; ScriptValue source() const; @@ -115,7 +115,7 @@ public: // EventTarget const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const final; + ExecutionContext* getExecutionContext() const final; void uncaughtExceptionInEventHandler() final; // Called by a version change transaction that has finished to set this diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp index 66ab399..97f8da1 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBRequestTest.cpp @@ -59,18 +59,18 @@ public: void SetUp() override { m_executionContext = adoptRefWillBeNoop(new NullExecutionContext()); - m_scope.scriptState()->setExecutionContext(m_executionContext.get()); + m_scope.getScriptState()->setExecutionContext(m_executionContext.get()); } void TearDown() override { m_executionContext->notifyContextDestroyed(); - m_scope.scriptState()->setExecutionContext(nullptr); + m_scope.getScriptState()->setExecutionContext(nullptr); } v8::Isolate* isolate() const { return m_scope.isolate(); } - ScriptState* scriptState() const { return m_scope.scriptState(); } - ExecutionContext* executionContext() const { return m_scope.scriptState()->executionContext(); } + ScriptState* getScriptState() const { return m_scope.getScriptState(); } + ExecutionContext* getExecutionContext() const { return m_scope.getScriptState()->getExecutionContext(); } private: V8TestingScope m_scope; @@ -80,9 +80,9 @@ private: TEST_F(IDBRequestTest, EventsAfterStopping) { IDBTransaction* transaction = nullptr; - IDBRequest* request = IDBRequest::create(scriptState(), IDBAny::createUndefined(), transaction); + IDBRequest* request = IDBRequest::create(getScriptState(), IDBAny::createUndefined(), transaction); EXPECT_EQ(request->readyState(), "pending"); - executionContext()->stopActiveDOMObjects(); + getExecutionContext()->stopActiveDOMObjects(); // Ensure none of the following raise assertions in stopped state: request->onError(DOMException::create(AbortError, "Description goes here.")); @@ -98,7 +98,7 @@ TEST_F(IDBRequestTest, EventsAfterStopping) TEST_F(IDBRequestTest, AbortErrorAfterAbort) { IDBTransaction* transaction = nullptr; - IDBRequest* request = IDBRequest::create(scriptState(), IDBAny::createUndefined(), transaction); + IDBRequest* request = IDBRequest::create(getScriptState(), IDBAny::createUndefined(), transaction); EXPECT_EQ(request->readyState(), "pending"); // Simulate the IDBTransaction having received onAbort from back end and aborting the request: @@ -110,7 +110,7 @@ TEST_F(IDBRequestTest, AbortErrorAfterAbort) // Stop the request lest it be GCed and its destructor // finds the object in a pending state (and asserts.) - executionContext()->stopActiveDOMObjects(); + getExecutionContext()->stopActiveDOMObjects(); } TEST_F(IDBRequestTest, ConnectionsAfterStopping) @@ -127,10 +127,10 @@ TEST_F(IDBRequestTest, ConnectionsAfterStopping) .Times(1); EXPECT_CALL(*backend, close()) .Times(1); - IDBOpenDBRequest* request = IDBOpenDBRequest::create(scriptState(), callbacks, transactionId, version); + IDBOpenDBRequest* request = IDBOpenDBRequest::create(getScriptState(), callbacks, transactionId, version); EXPECT_EQ(request->readyState(), "pending"); - executionContext()->stopActiveDOMObjects(); + getExecutionContext()->stopActiveDOMObjects(); request->onUpgradeNeeded(oldVersion, backend.release(), metadata, WebIDBDataLossNone, String()); } @@ -138,10 +138,10 @@ TEST_F(IDBRequestTest, ConnectionsAfterStopping) OwnPtr<MockWebIDBDatabase> backend = MockWebIDBDatabase::create(); EXPECT_CALL(*backend, close()) .Times(1); - IDBOpenDBRequest* request = IDBOpenDBRequest::create(scriptState(), callbacks, transactionId, version); + IDBOpenDBRequest* request = IDBOpenDBRequest::create(getScriptState(), callbacks, transactionId, version); EXPECT_EQ(request->readyState(), "pending"); - executionContext()->stopActiveDOMObjects(); + getExecutionContext()->stopActiveDOMObjects(); request->onSuccess(backend.release(), metadata); } } diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp index c9d648a..85babfb 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp @@ -84,7 +84,7 @@ private: } // namespace IDBTransaction::IDBTransaction(ScriptState* scriptState, int64_t id, const HashSet<String>& objectStoreNames, WebIDBTransactionMode mode, IDBDatabase* db, IDBOpenDBRequest* openDBRequest, const IDBDatabaseMetadata& previousMetadata) - : ActiveDOMObject(scriptState->executionContext()) + : ActiveDOMObject(scriptState->getExecutionContext()) , m_id(id) , m_database(db) , m_objectStoreNames(objectStoreNames) @@ -339,21 +339,21 @@ const AtomicString& IDBTransaction::interfaceName() const return EventTargetNames::IDBTransaction; } -ExecutionContext* IDBTransaction::executionContext() const +ExecutionContext* IDBTransaction::getExecutionContext() const { - return ActiveDOMObject::executionContext(); + return ActiveDOMObject::getExecutionContext(); } DispatchEventResult IDBTransaction::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event) { IDB_TRACE("IDBTransaction::dispatchEvent"); - if (m_contextStopped || !executionContext()) { + if (m_contextStopped || !getExecutionContext()) { m_state = Finished; return DispatchEventResult::CanceledBeforeDispatch; } ASSERT(m_state != Finished); ASSERT(m_hasPendingActivity); - ASSERT(executionContext()); + ASSERT(getExecutionContext()); ASSERT(event->target() == this); m_state = Finished; @@ -395,10 +395,10 @@ void IDBTransaction::stop() void IDBTransaction::enqueueEvent(PassRefPtrWillBeRawPtr<Event> event) { ASSERT_WITH_MESSAGE(m_state != Finished, "A finished transaction tried to enqueue an event of type %s.", event->type().utf8().data()); - if (m_contextStopped || !executionContext()) + if (m_contextStopped || !getExecutionContext()) return; - EventQueue* eventQueue = executionContext()->eventQueue(); + EventQueue* eventQueue = getExecutionContext()->getEventQueue(); event->setTarget(this); eventQueue->enqueueEvent(event); } diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h index d733d22..5a0cda5 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h +++ b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h @@ -96,7 +96,7 @@ public: // EventTarget const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; // ActiveDOMObject bool hasPendingActivity() const override; diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBTransactionTest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBTransactionTest.cpp index fa4850f..4bafd6a 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBTransactionTest.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBTransactionTest.cpp @@ -54,18 +54,18 @@ public: void SetUp() override { m_executionContext = Document::create(); - m_scope.scriptState()->setExecutionContext(m_executionContext.get()); + m_scope.getScriptState()->setExecutionContext(m_executionContext.get()); } void TearDown() override { m_executionContext->notifyContextDestroyed(); - m_scope.scriptState()->setExecutionContext(nullptr); + m_scope.getScriptState()->setExecutionContext(nullptr); } v8::Isolate* isolate() const { return m_scope.isolate(); } - ScriptState* scriptState() const { return m_scope.scriptState(); } - ExecutionContext* executionContext() { return m_scope.scriptState()->executionContext(); } + ScriptState* getScriptState() const { return m_scope.getScriptState(); } + ExecutionContext* getExecutionContext() { return m_scope.getScriptState()->getExecutionContext(); } void deactivateNewTransactions() { @@ -93,18 +93,18 @@ TEST_F(IDBTransactionTest, EnsureLifetime) OwnPtr<MockWebIDBDatabase> backend = MockWebIDBDatabase::create(); EXPECT_CALL(*backend, close()) .Times(1); - Persistent<IDBDatabase> db = IDBDatabase::create(executionContext(), backend.release(), FakeIDBDatabaseCallbacks::create()); + Persistent<IDBDatabase> db = IDBDatabase::create(getExecutionContext(), backend.release(), FakeIDBDatabaseCallbacks::create()); const int64_t transactionId = 1234; const HashSet<String> transactionScope = HashSet<String>(); - Persistent<IDBTransaction> transaction = IDBTransaction::create(scriptState(), transactionId, transactionScope, WebIDBTransactionModeReadOnly, db.get()); + Persistent<IDBTransaction> transaction = IDBTransaction::create(getScriptState(), transactionId, transactionScope, WebIDBTransactionModeReadOnly, db.get()); PersistentHeapHashSet<WeakMember<IDBTransaction>> set; set.add(transaction); Heap::collectAllGarbage(); EXPECT_EQ(1u, set.size()); - Persistent<IDBRequest> request = IDBRequest::create(scriptState(), IDBAny::createUndefined(), transaction.get()); + Persistent<IDBRequest> request = IDBRequest::create(getScriptState(), IDBAny::createUndefined(), transaction.get()); deactivateNewTransactions(); Heap::collectAllGarbage(); @@ -112,7 +112,7 @@ TEST_F(IDBTransactionTest, EnsureLifetime) // This will generate an abort() call to the back end which is dropped by the fake proxy, // so an explicit onAbort call is made. - executionContext()->stopActiveDOMObjects(); + getExecutionContext()->stopActiveDOMObjects(); transaction->onAbort(DOMException::create(AbortError, "Aborted")); transaction.clear(); @@ -129,10 +129,10 @@ TEST_F(IDBTransactionTest, TransactionFinish) .Times(1); EXPECT_CALL(*backend, close()) .Times(1); - Persistent<IDBDatabase> db = IDBDatabase::create(executionContext(), backend.release(), FakeIDBDatabaseCallbacks::create()); + Persistent<IDBDatabase> db = IDBDatabase::create(getExecutionContext(), backend.release(), FakeIDBDatabaseCallbacks::create()); const HashSet<String> transactionScope = HashSet<String>(); - Persistent<IDBTransaction> transaction = IDBTransaction::create(scriptState(), transactionId, transactionScope, WebIDBTransactionModeReadOnly, db.get()); + Persistent<IDBTransaction> transaction = IDBTransaction::create(getScriptState(), transactionId, transactionScope, WebIDBTransactionModeReadOnly, db.get()); PersistentHeapHashSet<WeakMember<IDBTransaction>> set; set.add(transaction); @@ -150,7 +150,7 @@ TEST_F(IDBTransactionTest, TransactionFinish) EXPECT_EQ(1u, set.size()); // Stop the context, so events don't get queued (which would keep the transaction alive). - executionContext()->stopActiveDOMObjects(); + getExecutionContext()->stopActiveDOMObjects(); // Fire an abort to make sure this doesn't free the transaction during use. The test // will not fail if it is, but ASAN would notice the error. diff --git a/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp b/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp index 3ef9298..77a0354 100644 --- a/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp @@ -142,9 +142,9 @@ public: virtual ~ExecutableWithDatabase() { } void start(IDBFactory*, SecurityOrigin*, const String& databaseName); virtual void execute(IDBDatabase*) = 0; - virtual RequestCallback* requestCallback() = 0; - ExecutionContext* context() const { return m_scriptState->executionContext(); } - ScriptState* scriptState() const { return m_scriptState.get(); } + virtual RequestCallback* getRequestCallback() = 0; + ExecutionContext* context() const { return m_scriptState->getExecutionContext(); } + ScriptState* getScriptState() const { return m_scriptState.get(); } private: RefPtr<ScriptState> m_scriptState; }; @@ -166,20 +166,20 @@ public: void handleEvent(ExecutionContext* context, Event* event) override { if (event->type() != EventTypeNames::success) { - m_executableWithDatabase->requestCallback()->sendFailure("Unexpected event type."); + m_executableWithDatabase->getRequestCallback()->sendFailure("Unexpected event type."); return; } IDBOpenDBRequest* idbOpenDBRequest = static_cast<IDBOpenDBRequest*>(event->target()); IDBAny* requestResult = idbOpenDBRequest->resultAsAny(); if (requestResult->getType() != IDBAny::IDBDatabaseType) { - m_executableWithDatabase->requestCallback()->sendFailure("Unexpected result type."); + m_executableWithDatabase->getRequestCallback()->sendFailure("Unexpected result type."); return; } IDBDatabase* idbDatabase = requestResult->idbDatabase(); m_executableWithDatabase->execute(idbDatabase); - V8PerIsolateData::from(m_executableWithDatabase->scriptState()->isolate())->runEndOfScopeTasks(); + V8PerIsolateData::from(m_executableWithDatabase->getScriptState()->isolate())->runEndOfScopeTasks(); idbDatabase->close(); } @@ -207,7 +207,7 @@ public: void handleEvent(ExecutionContext* context, Event* event) override { if (event->type() != EventTypeNames::upgradeneeded) { - m_executableWithDatabase->requestCallback()->sendFailure("Unexpected event type."); + m_executableWithDatabase->getRequestCallback()->sendFailure("Unexpected event type."); return; } @@ -217,7 +217,7 @@ public: IDBOpenDBRequest* idbOpenDBRequest = static_cast<IDBOpenDBRequest*>(event->target()); NonThrowableExceptionState exceptionState; idbOpenDBRequest->transaction()->abort(exceptionState); - m_executableWithDatabase->requestCallback()->sendFailure("Aborted upgrade."); + m_executableWithDatabase->getRequestCallback()->sendFailure("Aborted upgrade."); } private: @@ -232,9 +232,9 @@ void ExecutableWithDatabase::start(IDBFactory* idbFactory, SecurityOrigin*, cons RefPtrWillBeRawPtr<OpenDatabaseCallback> openCallback = OpenDatabaseCallback::create(this); RefPtrWillBeRawPtr<UpgradeDatabaseCallback> upgradeCallback = UpgradeDatabaseCallback::create(this); TrackExceptionState exceptionState; - IDBOpenDBRequest* idbOpenDBRequest = idbFactory->open(scriptState(), databaseName, exceptionState); + IDBOpenDBRequest* idbOpenDBRequest = idbFactory->open(getScriptState(), databaseName, exceptionState); if (exceptionState.hadException()) { - requestCallback()->sendFailure("Could not open database."); + getRequestCallback()->sendFailure("Could not open database."); return; } idbOpenDBRequest->addEventListener(EventTypeNames::upgradeneeded, upgradeCallback, false); @@ -342,7 +342,7 @@ public: m_requestCallback->sendSuccess(result.release()); } - RequestCallback* requestCallback() override { return m_requestCallback.get(); } + RequestCallback* getRequestCallback() override { return m_requestCallback.get(); } private: DatabaseLoader(ScriptState* scriptState, PassOwnPtr<RequestDatabaseCallback> requestCallback) : ExecutableWithDatabase(scriptState) @@ -461,7 +461,7 @@ public: return; } - Document* document = toDocument(m_scriptState->executionContext()); + Document* document = toDocument(m_scriptState->getExecutionContext()); if (!document) return; // FIXME: There are no tests for this error showing when a recursive @@ -521,7 +521,7 @@ public: void execute(IDBDatabase* idbDatabase) override { - IDBTransaction* idbTransaction = transactionForDatabase(scriptState(), idbDatabase, m_objectStoreName); + IDBTransaction* idbTransaction = transactionForDatabase(getScriptState(), idbDatabase, m_objectStoreName); if (!idbTransaction) { m_requestCallback->sendFailure("Could not get transaction"); return; @@ -540,15 +540,15 @@ public: return; } - idbRequest = idbIndex->openCursor(scriptState(), m_idbKeyRange.get(), WebIDBCursorDirectionNext); + idbRequest = idbIndex->openCursor(getScriptState(), m_idbKeyRange.get(), WebIDBCursorDirectionNext); } else { - idbRequest = idbObjectStore->openCursor(scriptState(), m_idbKeyRange.get(), WebIDBCursorDirectionNext); + idbRequest = idbObjectStore->openCursor(getScriptState(), m_idbKeyRange.get(), WebIDBCursorDirectionNext); } - RefPtrWillBeRawPtr<OpenCursorCallback> openCursorCallback = OpenCursorCallback::create(scriptState(), m_requestCallback.release(), m_skipCount, m_pageSize); + RefPtrWillBeRawPtr<OpenCursorCallback> openCursorCallback = OpenCursorCallback::create(getScriptState(), m_requestCallback.release(), m_skipCount, m_pageSize); idbRequest->addEventListener(EventTypeNames::success, openCursorCallback, false); } - RequestCallback* requestCallback() override { return m_requestCallback.get(); } + RequestCallback* getRequestCallback() override { return m_requestCallback.get(); } DataLoader(ScriptState* scriptState, PassOwnPtr<RequestDataCallback> requestCallback, const String& objectStoreName, const String& indexName, IDBKeyRange* idbKeyRange, int skipCount, unsigned pageSize) : ExecutableWithDatabase(scriptState) , m_requestCallback(requestCallback) @@ -649,7 +649,7 @@ void InspectorIndexedDBAgent::requestDatabaseNames(ErrorString* errorString, con requestCallback->sendFailure("Could not obtain database names."); return; } - idbRequest->addEventListener(EventTypeNames::success, GetDatabaseNamesCallback::create(requestCallback, document->securityOrigin()->toRawString()), false); + idbRequest->addEventListener(EventTypeNames::success, GetDatabaseNamesCallback::create(requestCallback, document->getSecurityOrigin()->toRawString()), false); } void InspectorIndexedDBAgent::requestDatabase(ErrorString* errorString, const String& securityOrigin, const String& databaseName, PassOwnPtr<RequestDatabaseCallback> requestCallback) @@ -667,7 +667,7 @@ void InspectorIndexedDBAgent::requestDatabase(ErrorString* errorString, const St return; ScriptState::Scope scope(scriptState); RefPtr<DatabaseLoader> databaseLoader = DatabaseLoader::create(scriptState, requestCallback); - databaseLoader->start(idbFactory, document->securityOrigin(), databaseName); + databaseLoader->start(idbFactory, document->getSecurityOrigin(), databaseName); } void InspectorIndexedDBAgent::requestData(ErrorString* errorString, @@ -699,7 +699,7 @@ void InspectorIndexedDBAgent::requestData(ErrorString* errorString, return; ScriptState::Scope scope(scriptState); RefPtr<DataLoader> dataLoader = DataLoader::create(scriptState, requestCallback, objectStoreName, indexName, idbKeyRange, skipCount, pageSize); - dataLoader->start(idbFactory, document->securityOrigin(), databaseName); + dataLoader->start(idbFactory, document->getSecurityOrigin(), databaseName); } class ClearObjectStoreListener final : public EventListener { @@ -759,7 +759,7 @@ public: void execute(IDBDatabase* idbDatabase) override { - IDBTransaction* idbTransaction = transactionForDatabase(scriptState(), idbDatabase, m_objectStoreName, IndexedDBNames::readwrite); + IDBTransaction* idbTransaction = transactionForDatabase(getScriptState(), idbDatabase, m_objectStoreName, IndexedDBNames::readwrite); if (!idbTransaction) { m_requestCallback->sendFailure("Could not get transaction"); return; @@ -771,7 +771,7 @@ public: } TrackExceptionState exceptionState; - idbObjectStore->clear(scriptState(), exceptionState); + idbObjectStore->clear(getScriptState(), exceptionState); ASSERT(!exceptionState.hadException()); if (exceptionState.hadException()) { ExceptionCode ec = exceptionState.code(); @@ -781,7 +781,7 @@ public: idbTransaction->addEventListener(EventTypeNames::complete, ClearObjectStoreListener::create(m_requestCallback.release()), false); } - RequestCallback* requestCallback() override { return m_requestCallback.get(); } + RequestCallback* getRequestCallback() override { return m_requestCallback.get(); } private: const String m_objectStoreName; OwnPtr<ClearObjectStoreCallback> m_requestCallback; @@ -802,7 +802,7 @@ void InspectorIndexedDBAgent::clearObjectStore(ErrorString* errorString, const S return; ScriptState::Scope scope(scriptState); RefPtr<ClearObjectStore> clearObjectStore = ClearObjectStore::create(scriptState, objectStoreName, requestCallback); - clearObjectStore->start(idbFactory, document->securityOrigin(), databaseName); + clearObjectStore->start(idbFactory, document->getSecurityOrigin(), databaseName); } DEFINE_TRACE(InspectorIndexedDBAgent) diff --git a/third_party/WebKit/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp b/third_party/WebKit/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp index 3d81c64..a7aeccf 100644 --- a/third_party/WebKit/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp @@ -60,17 +60,17 @@ PassOwnPtr<WebIDBCallbacksImpl> WebIDBCallbacksImpl::create(IDBRequest* request) WebIDBCallbacksImpl::WebIDBCallbacksImpl(IDBRequest* request) : m_request(request) { - m_asyncOperationId = InspectorInstrumentation::traceAsyncOperationStarting(m_request->executionContext(), "IndexedDB"); + m_asyncOperationId = InspectorInstrumentation::traceAsyncOperationStarting(m_request->getExecutionContext(), "IndexedDB"); } WebIDBCallbacksImpl::~WebIDBCallbacksImpl() { - InspectorInstrumentation::traceAsyncOperationCompleted(m_request->executionContext(), m_asyncOperationId); + InspectorInstrumentation::traceAsyncOperationCompleted(m_request->getExecutionContext(), m_asyncOperationId); } void WebIDBCallbacksImpl::onError(const WebIDBDatabaseError& error) { - InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId); + InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId); m_request->onError(DOMException::create(error.code(), error.message())); InspectorInstrumentation::traceAsyncCallbackCompleted(cookie); } @@ -80,42 +80,42 @@ void WebIDBCallbacksImpl::onSuccess(const WebVector<WebString>& webStringList) Vector<String> stringList; for (size_t i = 0; i < webStringList.size(); ++i) stringList.append(webStringList[i]); - InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId); + InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId); m_request->onSuccess(stringList); InspectorInstrumentation::traceAsyncCallbackCompleted(cookie); } void WebIDBCallbacksImpl::onSuccess(WebIDBCursor* cursor, const WebIDBKey& key, const WebIDBKey& primaryKey, const WebIDBValue& value) { - InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId); + InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId); m_request->onSuccess(adoptPtr(cursor), key, primaryKey, IDBValue::create(value)); InspectorInstrumentation::traceAsyncCallbackCompleted(cookie); } void WebIDBCallbacksImpl::onSuccess(WebIDBDatabase* backend, const WebIDBMetadata& metadata) { - InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId); + InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId); m_request->onSuccess(adoptPtr(backend), IDBDatabaseMetadata(metadata)); InspectorInstrumentation::traceAsyncCallbackCompleted(cookie); } void WebIDBCallbacksImpl::onSuccess(const WebIDBKey& key) { - InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId); + InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId); m_request->onSuccess(key); InspectorInstrumentation::traceAsyncCallbackCompleted(cookie); } void WebIDBCallbacksImpl::onSuccess(const WebIDBValue& value) { - InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId); + InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId); m_request->onSuccess(IDBValue::create(value)); InspectorInstrumentation::traceAsyncCallbackCompleted(cookie); } void WebIDBCallbacksImpl::onSuccess(const WebVector<WebIDBValue>& values) { - InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId); + InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId); Vector<RefPtr<IDBValue>> idbValues(values.size()); for (size_t i = 0; i < values.size(); ++i) idbValues[i] = IDBValue::create(values[i]); @@ -125,35 +125,35 @@ void WebIDBCallbacksImpl::onSuccess(const WebVector<WebIDBValue>& values) void WebIDBCallbacksImpl::onSuccess(long long value) { - InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId); + InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId); m_request->onSuccess(value); InspectorInstrumentation::traceAsyncCallbackCompleted(cookie); } void WebIDBCallbacksImpl::onSuccess() { - InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId); + InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId); m_request->onSuccess(); InspectorInstrumentation::traceAsyncCallbackCompleted(cookie); } void WebIDBCallbacksImpl::onSuccess(const WebIDBKey& key, const WebIDBKey& primaryKey, const WebIDBValue& value) { - InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId); + InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId); m_request->onSuccess(key, primaryKey, IDBValue::create(value)); InspectorInstrumentation::traceAsyncCallbackCompleted(cookie); } void WebIDBCallbacksImpl::onBlocked(long long oldVersion) { - InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId); + InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId); m_request->onBlocked(oldVersion); InspectorInstrumentation::traceAsyncCallbackCompleted(cookie); } void WebIDBCallbacksImpl::onUpgradeNeeded(long long oldVersion, WebIDBDatabase* database, const WebIDBMetadata& metadata, unsigned short dataLoss, WebString dataLossMessage) { - InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId); + InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId); m_request->onUpgradeNeeded(oldVersion, adoptPtr(database), IDBDatabaseMetadata(metadata), static_cast<WebIDBDataLoss>(dataLoss), dataLossMessage); InspectorInstrumentation::traceAsyncCallbackCompleted(cookie); } diff --git a/third_party/WebKit/Source/modules/installedapp/NavigatorInstalledApp.cpp b/third_party/WebKit/Source/modules/installedapp/NavigatorInstalledApp.cpp index 06b88f5..af1db4a 100644 --- a/third_party/WebKit/Source/modules/installedapp/NavigatorInstalledApp.cpp +++ b/third_party/WebKit/Source/modules/installedapp/NavigatorInstalledApp.cpp @@ -79,7 +79,7 @@ ScriptPromise NavigatorInstalledApp::getInstalledRelatedApps(ScriptState* script } controller()->getInstalledApps( - WebSecurityOrigin(scriptState->executionContext()->securityOrigin()), + WebSecurityOrigin(scriptState->getExecutionContext()->getSecurityOrigin()), adoptWebPtr(new CallbackPromiseAdapter<RelatedAppArray, void>(resolver))); return promise; } diff --git a/third_party/WebKit/Source/modules/mediacapturefromelement/CanvasCaptureMediaStreamTrack.cpp b/third_party/WebKit/Source/modules/mediacapturefromelement/CanvasCaptureMediaStreamTrack.cpp index 90b852d..d36b2c2 100644 --- a/third_party/WebKit/Source/modules/mediacapturefromelement/CanvasCaptureMediaStreamTrack.cpp +++ b/third_party/WebKit/Source/modules/mediacapturefromelement/CanvasCaptureMediaStreamTrack.cpp @@ -49,7 +49,7 @@ DEFINE_TRACE(CanvasCaptureMediaStreamTrack) } CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack(const CanvasCaptureMediaStreamTrack& track, MediaStreamComponent* component) - :MediaStreamTrack(track.m_canvasElement->executionContext(), component) + :MediaStreamTrack(track.m_canvasElement->getExecutionContext(), component) , m_canvasElement(track.m_canvasElement) , m_drawListener(track.m_drawListener) { @@ -58,7 +58,7 @@ CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack(const CanvasCapture } CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack(MediaStreamComponent* component, PassRefPtrWillBeRawPtr<HTMLCanvasElement> element, const PassOwnPtr<WebCanvasCaptureHandler> handler) - : MediaStreamTrack(element->executionContext(), component) + : MediaStreamTrack(element->getExecutionContext(), component) , m_canvasElement(element) { suspendIfNeeded(); @@ -67,7 +67,7 @@ CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack(MediaStreamComponen } CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack(MediaStreamComponent* component, PassRefPtrWillBeRawPtr<HTMLCanvasElement> element, const PassOwnPtr<WebCanvasCaptureHandler> handler, double frameRate) - : MediaStreamTrack(element->executionContext(), component) + : MediaStreamTrack(element->getExecutionContext(), component) , m_canvasElement(element) { suspendIfNeeded(); diff --git a/third_party/WebKit/Source/modules/mediacapturefromelement/HTMLCanvasElementCapture.cpp b/third_party/WebKit/Source/modules/mediacapturefromelement/HTMLCanvasElementCapture.cpp index 9bd941b..18550f3 100644 --- a/third_party/WebKit/Source/modules/mediacapturefromelement/HTMLCanvasElementCapture.cpp +++ b/third_party/WebKit/Source/modules/mediacapturefromelement/HTMLCanvasElementCapture.cpp @@ -64,7 +64,7 @@ MediaStream* HTMLCanvasElementCapture::captureStream(HTMLCanvasElement& element, MediaStreamTrackVector tracks; tracks.append(canvasTrack); - return MediaStream::create(element.executionContext(), tracks); + return MediaStream::create(element.getExecutionContext(), tracks); } } // namespace blink diff --git a/third_party/WebKit/Source/modules/mediacapturefromelement/HTMLMediaElementCapture.cpp b/third_party/WebKit/Source/modules/mediacapturefromelement/HTMLMediaElementCapture.cpp index 872c28a..5dcc08f 100644 --- a/third_party/WebKit/Source/modules/mediacapturefromelement/HTMLMediaElementCapture.cpp +++ b/third_party/WebKit/Source/modules/mediacapturefromelement/HTMLMediaElementCapture.cpp @@ -35,7 +35,7 @@ MediaStream* HTMLMediaElementCapture::captureStream(HTMLMediaElement& element, E // If |element| is actually playing a MediaStream, just clone it. if (HTMLMediaElement::isMediaStreamURL(element.currentSrc().getString())) { - return MediaStream::create(element.executionContext(), MediaStreamRegistry::registry().lookupMediaStreamDescriptor(element.currentSrc().getString())); + return MediaStream::create(element.getExecutionContext(), MediaStreamRegistry::registry().lookupMediaStreamDescriptor(element.currentSrc().getString())); } // TODO(mcasas): Only <video> tags are supported at the moment. @@ -49,7 +49,7 @@ MediaStream* HTMLMediaElementCapture::captureStream(HTMLMediaElement& element, E MediaStreamCenter::instance().didCreateMediaStream(webStream); Platform::current()->createHTMLVideoElementCapturer(&webStream, element.webMediaPlayer()); - return MediaStream::create(element.executionContext(), webStream); + return MediaStream::create(element.getExecutionContext(), webStream); } } // namespace blink diff --git a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp index cf0cf97..c35c3a4 100644 --- a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp +++ b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp @@ -258,9 +258,9 @@ const AtomicString& MediaRecorder::interfaceName() const return EventTargetNames::MediaRecorder; } -ExecutionContext* MediaRecorder::executionContext() const +ExecutionContext* MediaRecorder::getExecutionContext() const { - return ActiveDOMObject::executionContext(); + return ActiveDOMObject::getExecutionContext(); } void MediaRecorder::suspend() diff --git a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.h b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.h index c05c3cf..ce1e316 100644 --- a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.h +++ b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.h @@ -66,7 +66,7 @@ public: // EventTarget const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; // ActiveDOMObject void suspend() override; diff --git a/third_party/WebKit/Source/modules/mediasession/MediaSession.h b/third_party/WebKit/Source/modules/mediasession/MediaSession.h index 1ec2837..8501a3bd4 100644 --- a/third_party/WebKit/Source/modules/mediasession/MediaSession.h +++ b/third_party/WebKit/Source/modules/mediasession/MediaSession.h @@ -24,7 +24,7 @@ class MODULES_EXPORT MediaSession final public: static MediaSession* create(ExecutionContext*, ExceptionState&); - WebMediaSession* webMediaSession() { return m_webMediaSession.get(); } + WebMediaSession* getWebMediaSession() { return m_webMediaSession.get(); } ScriptPromise activate(ScriptState*); ScriptPromise deactivate(ScriptState*); diff --git a/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp b/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp index 6db9457..95e0a34 100644 --- a/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp +++ b/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp @@ -97,8 +97,8 @@ MediaSource::MediaSource(ExecutionContext* context) , m_readyState(closedKeyword()) , m_asyncEventQueue(GenericEventQueue::create(this)) , m_attachedElement(nullptr) - , m_sourceBuffers(SourceBufferList::create(executionContext(), m_asyncEventQueue.get())) - , m_activeSourceBuffers(SourceBufferList::create(executionContext(), m_asyncEventQueue.get())) + , m_sourceBuffers(SourceBufferList::create(getExecutionContext(), m_asyncEventQueue.get())) + , m_activeSourceBuffers(SourceBufferList::create(getExecutionContext(), m_asyncEventQueue.get())) , m_isAddedToRegistry(false) { WTF_LOG(Media, "MediaSource::MediaSource %p", this); @@ -270,9 +270,9 @@ const AtomicString& MediaSource::interfaceName() const return EventTargetNames::MediaSource; } -ExecutionContext* MediaSource::executionContext() const +ExecutionContext* MediaSource::getExecutionContext() const { - return ActiveDOMObject::executionContext(); + return ActiveDOMObject::getExecutionContext(); } DEFINE_TRACE(MediaSource) diff --git a/third_party/WebKit/Source/modules/mediasource/MediaSource.h b/third_party/WebKit/Source/modules/mediasource/MediaSource.h index 57484e8..5f06eca 100644 --- a/third_party/WebKit/Source/modules/mediasource/MediaSource.h +++ b/third_party/WebKit/Source/modules/mediasource/MediaSource.h @@ -90,7 +90,7 @@ public: // EventTarget interface const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; // ActiveDOMObject interface bool hasPendingActivity() const override; diff --git a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp index 9e48afb..6825504 100644 --- a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp +++ b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp @@ -99,7 +99,7 @@ SourceBuffer* SourceBuffer::create(PassOwnPtr<WebSourceBuffer> webSourceBuffer, } SourceBuffer::SourceBuffer(PassOwnPtr<WebSourceBuffer> webSourceBuffer, MediaSource* source, GenericEventQueue* asyncEventQueue) - : ActiveDOMObject(source->executionContext()) + : ActiveDOMObject(source->getExecutionContext()) , m_webSourceBuffer(webSourceBuffer) , m_source(source) , m_trackDefaults(TrackDefaultList::create()) @@ -520,9 +520,9 @@ void SourceBuffer::stop() m_appendStreamAsyncPartRunner->stop(); } -ExecutionContext* SourceBuffer::executionContext() const +ExecutionContext* SourceBuffer::getExecutionContext() const { - return ActiveDOMObject::executionContext(); + return ActiveDOMObject::getExecutionContext(); } const AtomicString& SourceBuffer::interfaceName() const @@ -758,7 +758,7 @@ void SourceBuffer::appendStreamAsyncPart() // Steps 3-11 are handled by m_loader. // Note: Passing 0 here signals that maxSize was not set. (i.e. Read all the data in the stream). - m_loader->start(executionContext(), *m_stream, m_streamMaxSizeValid ? m_streamMaxSize : 0); + m_loader->start(getExecutionContext(), *m_stream, m_streamMaxSizeValid ? m_streamMaxSize : 0); } void SourceBuffer::appendStreamDone(bool success) diff --git a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.h b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.h index 6bc95ea..ba9512fd 100644 --- a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.h +++ b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.h @@ -98,7 +98,7 @@ public: void stop() override; // EventTarget interface - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; const AtomicString& interfaceName() const override; // WebSourceBufferClient interface diff --git a/third_party/WebKit/Source/modules/mediasource/SourceBufferList.cpp b/third_party/WebKit/Source/modules/mediasource/SourceBufferList.cpp index 7dccfbb..345f043 100644 --- a/third_party/WebKit/Source/modules/mediasource/SourceBufferList.cpp +++ b/third_party/WebKit/Source/modules/mediasource/SourceBufferList.cpp @@ -92,7 +92,7 @@ const AtomicString& SourceBufferList::interfaceName() const return EventTargetNames::SourceBufferList; } -ExecutionContext* SourceBufferList::executionContext() const +ExecutionContext* SourceBufferList::getExecutionContext() const { return m_executionContext; } diff --git a/third_party/WebKit/Source/modules/mediasource/SourceBufferList.h b/third_party/WebKit/Source/modules/mediasource/SourceBufferList.h index 44685e3..a761ae6 100644 --- a/third_party/WebKit/Source/modules/mediasource/SourceBufferList.h +++ b/third_party/WebKit/Source/modules/mediasource/SourceBufferList.h @@ -61,7 +61,7 @@ public: // EventTarget interface const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; DECLARE_VIRTUAL_TRACE(); diff --git a/third_party/WebKit/Source/modules/mediastream/MediaDevices.cpp b/third_party/WebKit/Source/modules/mediastream/MediaDevices.cpp index 20320d3..556ec89 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaDevices.cpp +++ b/third_party/WebKit/Source/modules/mediastream/MediaDevices.cpp @@ -22,7 +22,7 @@ namespace blink { ScriptPromise MediaDevices::enumerateDevices(ScriptState* scriptState) { - Document* document = toDocument(scriptState->executionContext()); + Document* document = toDocument(scriptState->getExecutionContext()); UserMediaController* userMedia = UserMediaController::from(document->frame()); if (!userMedia) return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(NotSupportedError, "No media device controller available; is this a detached window?")); @@ -94,7 +94,7 @@ ScriptPromise MediaDevices::getUserMedia(ScriptState* scriptState, const MediaSt NavigatorUserMediaSuccessCallback* successCallback = new PromiseSuccessCallback(resolver); NavigatorUserMediaErrorCallback* errorCallback = new PromiseErrorCallback(resolver); - Document* document = toDocument(scriptState->executionContext()); + Document* document = toDocument(scriptState->getExecutionContext()); UserMediaController* userMedia = UserMediaController::from(document->frame()); if (!userMedia) return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(NotSupportedError, "No media device controller available; is this a detached window?")); diff --git a/third_party/WebKit/Source/modules/mediastream/MediaDevicesRequest.cpp b/third_party/WebKit/Source/modules/mediastream/MediaDevicesRequest.cpp index 112d493..20b61f0 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaDevicesRequest.cpp +++ b/third_party/WebKit/Source/modules/mediastream/MediaDevicesRequest.cpp @@ -42,7 +42,7 @@ MediaDevicesRequest* MediaDevicesRequest::create(ScriptState* state, UserMediaCo } MediaDevicesRequest::MediaDevicesRequest(ScriptState* state, UserMediaController* controller) - : ActiveDOMObject(state->executionContext()) + : ActiveDOMObject(state->getExecutionContext()) , m_controller(controller) , m_resolver(ScriptPromiseResolver::create(state)) { @@ -54,7 +54,7 @@ MediaDevicesRequest::~MediaDevicesRequest() Document* MediaDevicesRequest::ownerDocument() { - if (ExecutionContext* context = executionContext()) { + if (ExecutionContext* context = getExecutionContext()) { return toDocument(context); } @@ -71,7 +71,7 @@ ScriptPromise MediaDevicesRequest::start() void MediaDevicesRequest::succeed(const MediaDeviceInfoVector& mediaDevices) { - if (!executionContext() || !m_resolver) + if (!getExecutionContext() || !m_resolver) return; m_resolver->resolve(mediaDevices); diff --git a/third_party/WebKit/Source/modules/mediastream/MediaStream.cpp b/third_party/WebKit/Source/modules/mediastream/MediaStream.cpp index c5cafe3..4ba6007 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaStream.cpp +++ b/third_party/WebKit/Source/modules/mediastream/MediaStream.cpp @@ -312,9 +312,9 @@ const AtomicString& MediaStream::interfaceName() const return EventTargetNames::MediaStream; } -ExecutionContext* MediaStream::executionContext() const +ExecutionContext* MediaStream::getExecutionContext() const { - return ContextLifecycleObserver::executionContext(); + return ContextLifecycleObserver::getExecutionContext(); } void MediaStream::addRemoteTrack(MediaStreamComponent* component) @@ -323,7 +323,7 @@ void MediaStream::addRemoteTrack(MediaStreamComponent* component) if (m_stopped) return; - MediaStreamTrack* track = MediaStreamTrack::create(executionContext(), component); + MediaStreamTrack* track = MediaStreamTrack::create(getExecutionContext(), component); switch (component->source()->type()) { case MediaStreamSource::TypeAudio: m_audioTracks.append(track); diff --git a/third_party/WebKit/Source/modules/mediastream/MediaStream.h b/third_party/WebKit/Source/modules/mediastream/MediaStream.h index 3cd33db..8891156 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaStream.h +++ b/third_party/WebKit/Source/modules/mediastream/MediaStream.h @@ -81,7 +81,7 @@ public: // EventTarget const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; // URLRegistrable URLRegistry& registry() const override; diff --git a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp index 24c33c5..6367a92 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp +++ b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.cpp @@ -252,9 +252,9 @@ const AtomicString& MediaStreamTrack::interfaceName() const return EventTargetNames::MediaStreamTrack; } -ExecutionContext* MediaStreamTrack::executionContext() const +ExecutionContext* MediaStreamTrack::getExecutionContext() const { - return ActiveDOMObject::executionContext(); + return ActiveDOMObject::getExecutionContext(); } DEFINE_TRACE(MediaStreamTrack) diff --git a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.h b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.h index 90fec99..27f98e8 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.h +++ b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.h @@ -81,7 +81,7 @@ public: // EventTarget const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; // ActiveDOMObject bool hasPendingActivity() const override; diff --git a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesRequestImpl.cpp b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesRequestImpl.cpp index 9778d55..da49698 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesRequestImpl.cpp +++ b/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesRequestImpl.cpp @@ -53,7 +53,7 @@ MediaStreamTrackSourcesRequestImpl::~MediaStreamTrackSourcesRequestImpl() String MediaStreamTrackSourcesRequestImpl::origin() { - return m_executionContext->securityOrigin()->toString(); + return m_executionContext->getSecurityOrigin()->toString(); } void MediaStreamTrackSourcesRequestImpl::requestSucceeded(const WebVector<WebSourceInfo>& webSourceInfos) diff --git a/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.cpp b/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.cpp index a45f886..62375b7 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.cpp +++ b/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.cpp @@ -131,9 +131,9 @@ const AtomicString& RTCDTMFSender::interfaceName() const return EventTargetNames::RTCDTMFSender; } -ExecutionContext* RTCDTMFSender::executionContext() const +ExecutionContext* RTCDTMFSender::getExecutionContext() const { - return ActiveDOMObject::executionContext(); + return ActiveDOMObject::getExecutionContext(); } void RTCDTMFSender::stop() diff --git a/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.h b/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.h index d47014a..9e5f5b9 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.h +++ b/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.h @@ -63,7 +63,7 @@ public: // EventTarget const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; // ActiveDOMObject void stop() override; diff --git a/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp b/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp index ad474ad..59bf416 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp +++ b/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp @@ -289,7 +289,7 @@ const AtomicString& RTCDataChannel::interfaceName() const return EventTargetNames::RTCDataChannel; } -ExecutionContext* RTCDataChannel::executionContext() const +ExecutionContext* RTCDataChannel::getExecutionContext() const { return m_executionContext; } diff --git a/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.h b/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.h index d17bcf5..dcc9f04 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.h +++ b/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.h @@ -91,7 +91,7 @@ public: // EventTarget const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; // Oilpan: need to eagerly finalize m_handler EAGERLY_FINALIZE(); diff --git a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp index 8ddc31d..7091872 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp +++ b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp @@ -402,7 +402,7 @@ RTCPeerConnection::RTCPeerConnection(ExecutionContext* context, RTCConfiguration , m_stopped(false) , m_closed(false) { - Document* document = toDocument(executionContext()); + Document* document = toDocument(getExecutionContext()); // If we fail, set |m_closed| and |m_stopped| to true, to avoid hitting the assert in the destructor. @@ -454,7 +454,7 @@ void RTCPeerConnection::createOffer(ExecutionContext* context, RTCSessionDescrip if (exceptionState.hadException()) return; - RTCSessionDescriptionRequest* request = RTCSessionDescriptionRequestImpl::create(executionContext(), this, successCallback, errorCallback); + RTCSessionDescriptionRequest* request = RTCSessionDescriptionRequestImpl::create(getExecutionContext(), this, successCallback, errorCallback); if (offerOptions) { if (offerOptions->offerToReceiveAudio() != -1 || offerOptions->offerToReceiveVideo() != -1) @@ -504,7 +504,7 @@ void RTCPeerConnection::createAnswer(ExecutionContext* context, RTCSessionDescri return; } - RTCSessionDescriptionRequest* request = RTCSessionDescriptionRequestImpl::create(executionContext(), this, successCallback, errorCallback); + RTCSessionDescriptionRequest* request = RTCSessionDescriptionRequestImpl::create(getExecutionContext(), this, successCallback, errorCallback); m_peerHandler->createAnswer(request, constraints); } @@ -522,7 +522,7 @@ ScriptPromise RTCPeerConnection::setLocalDescription(ScriptState* scriptState, c ScriptPromise RTCPeerConnection::setLocalDescription(ScriptState* scriptState, RTCSessionDescription* sessionDescription, VoidCallback* successCallback, RTCPeerConnectionErrorCallback* errorCallback) { - ExecutionContext* context = scriptState->executionContext(); + ExecutionContext* context = scriptState->getExecutionContext(); if (successCallback && errorCallback) { UseCounter::count(context, UseCounter::RTCPeerConnectionSetLocalDescriptionLegacyCompliant); } else { @@ -537,7 +537,7 @@ ScriptPromise RTCPeerConnection::setLocalDescription(ScriptState* scriptState, R ASSERT(sessionDescription); - RTCVoidRequest* request = RTCVoidRequestImpl::create(executionContext(), this, successCallback, errorCallback); + RTCVoidRequest* request = RTCVoidRequestImpl::create(getExecutionContext(), this, successCallback, errorCallback); m_peerHandler->setLocalDescription(request, sessionDescription->webSessionDescription()); return ScriptPromise::cast(scriptState, v8::Undefined(scriptState->isolate())); } @@ -565,7 +565,7 @@ ScriptPromise RTCPeerConnection::setRemoteDescription(ScriptState* scriptState, ScriptPromise RTCPeerConnection::setRemoteDescription(ScriptState* scriptState, RTCSessionDescription* sessionDescription, VoidCallback* successCallback, RTCPeerConnectionErrorCallback* errorCallback) { - ExecutionContext* context = scriptState->executionContext(); + ExecutionContext* context = scriptState->getExecutionContext(); if (successCallback && errorCallback) { UseCounter::count(context, UseCounter::RTCPeerConnectionSetRemoteDescriptionLegacyCompliant); } else { @@ -580,7 +580,7 @@ ScriptPromise RTCPeerConnection::setRemoteDescription(ScriptState* scriptState, ASSERT(sessionDescription); - RTCVoidRequest* request = RTCVoidRequestImpl::create(executionContext(), this, successCallback, errorCallback); + RTCVoidRequest* request = RTCVoidRequestImpl::create(getExecutionContext(), this, successCallback, errorCallback); m_peerHandler->setRemoteDescription(request, sessionDescription->webSessionDescription()); return ScriptPromise::cast(scriptState, v8::Undefined(scriptState->isolate())); } @@ -677,8 +677,8 @@ ScriptPromise RTCPeerConnection::generateCertificate(ScriptState* scriptState, c // The observer will manage its own destruction as well as the resolver's destruction. certificateGenerator->generateCertificate( keyParams.get(), - toDocument(scriptState->executionContext())->url(), - toDocument(scriptState->executionContext())->firstPartyForCookies(), + toDocument(scriptState->getExecutionContext())->url(), + toDocument(scriptState->getExecutionContext())->firstPartyForCookies(), certificateObserver); return promise; @@ -712,7 +712,7 @@ ScriptPromise RTCPeerConnection::addIceCandidate(ScriptState* scriptState, RTCIc if (callErrorCallbackIfSignalingStateClosed(m_signalingState, errorCallback)) return ScriptPromise::cast(scriptState, v8::Undefined(scriptState->isolate())); - RTCVoidRequest* request = RTCVoidRequestImpl::create(executionContext(), this, successCallback, errorCallback); + RTCVoidRequest* request = RTCVoidRequestImpl::create(getExecutionContext(), this, successCallback, errorCallback); bool implemented = m_peerHandler->addICECandidate(request, iceCandidate->webCandidate()); if (!implemented) asyncCallErrorCallback(errorCallback, DOMException::create(OperationError, "This operation could not be completed.")); @@ -853,7 +853,7 @@ MediaStream* RTCPeerConnection::getStreamById(const String& streamId) void RTCPeerConnection::getStats(ExecutionContext* context, RTCStatsCallback* successCallback, MediaStreamTrack* selector) { UseCounter::count(context, UseCounter::RTCPeerConnectionGetStatsLegacyNonCompliant); - RTCStatsRequest* statsRequest = RTCStatsRequestImpl::create(executionContext(), this, successCallback, selector); + RTCStatsRequest* statsRequest = RTCStatsRequestImpl::create(getExecutionContext(), this, successCallback, selector); // FIXME: Add passing selector as part of the statsRequest. m_peerHandler->getStats(statsRequest); } @@ -879,7 +879,7 @@ RTCDataChannel* RTCPeerConnection::createDataChannel(String label, const Diction DictionaryHelper::get(options, "protocol", protocolString); init.protocol = protocolString; - RTCDataChannel* channel = RTCDataChannel::create(executionContext(), m_peerHandler.get(), label, init, exceptionState); + RTCDataChannel* channel = RTCDataChannel::create(getExecutionContext(), m_peerHandler.get(), label, init, exceptionState); if (exceptionState.hadException()) return nullptr; RTCDataChannel::ReadyState handlerState = channel->getHandlerState(); @@ -911,7 +911,7 @@ RTCDTMFSender* RTCPeerConnection::createDTMFSender(MediaStreamTrack* track, Exce return nullptr; } - RTCDTMFSender* dtmfSender = RTCDTMFSender::create(executionContext(), m_peerHandler.get(), track, exceptionState); + RTCDTMFSender* dtmfSender = RTCDTMFSender::create(getExecutionContext(), m_peerHandler.get(), track, exceptionState); if (exceptionState.hadException()) return nullptr; return dtmfSender; @@ -934,7 +934,7 @@ void RTCPeerConnection::negotiationNeeded() void RTCPeerConnection::didGenerateICECandidate(const WebRTCICECandidate& webCandidate) { ASSERT(!m_closed); - ASSERT(executionContext()->isContextThread()); + ASSERT(getExecutionContext()->isContextThread()); if (webCandidate.isNull()) scheduleDispatchEvent(RTCIceCandidateEvent::create(false, false, nullptr)); else { @@ -946,33 +946,33 @@ void RTCPeerConnection::didGenerateICECandidate(const WebRTCICECandidate& webCan void RTCPeerConnection::didChangeSignalingState(SignalingState newState) { ASSERT(!m_closed); - ASSERT(executionContext()->isContextThread()); + ASSERT(getExecutionContext()->isContextThread()); changeSignalingState(newState); } void RTCPeerConnection::didChangeICEGatheringState(ICEGatheringState newState) { ASSERT(!m_closed); - ASSERT(executionContext()->isContextThread()); + ASSERT(getExecutionContext()->isContextThread()); changeIceGatheringState(newState); } void RTCPeerConnection::didChangeICEConnectionState(ICEConnectionState newState) { ASSERT(!m_closed); - ASSERT(executionContext()->isContextThread()); + ASSERT(getExecutionContext()->isContextThread()); changeIceConnectionState(newState); } void RTCPeerConnection::didAddRemoteStream(const WebMediaStream& remoteStream) { ASSERT(!m_closed); - ASSERT(executionContext()->isContextThread()); + ASSERT(getExecutionContext()->isContextThread()); if (m_signalingState == SignalingStateClosed) return; - MediaStream* stream = MediaStream::create(executionContext(), remoteStream); + MediaStream* stream = MediaStream::create(getExecutionContext(), remoteStream); m_remoteStreams.append(stream); scheduleDispatchEvent(MediaStreamEvent::create(EventTypeNames::addstream, false, false, stream)); @@ -981,7 +981,7 @@ void RTCPeerConnection::didAddRemoteStream(const WebMediaStream& remoteStream) void RTCPeerConnection::didRemoveRemoteStream(const WebMediaStream& remoteStream) { ASSERT(!m_closed); - ASSERT(executionContext()->isContextThread()); + ASSERT(getExecutionContext()->isContextThread()); MediaStreamDescriptor* streamDescriptor = remoteStream; ASSERT(streamDescriptor->client()); @@ -1002,12 +1002,12 @@ void RTCPeerConnection::didRemoveRemoteStream(const WebMediaStream& remoteStream void RTCPeerConnection::didAddRemoteDataChannel(WebRTCDataChannelHandler* handler) { ASSERT(!m_closed); - ASSERT(executionContext()->isContextThread()); + ASSERT(getExecutionContext()->isContextThread()); if (m_signalingState == SignalingStateClosed) return; - RTCDataChannel* channel = RTCDataChannel::create(executionContext(), adoptPtr(handler)); + RTCDataChannel* channel = RTCDataChannel::create(getExecutionContext(), adoptPtr(handler)); scheduleDispatchEvent(RTCDataChannelEvent::create(EventTypeNames::datachannel, false, false, channel)); } @@ -1027,9 +1027,9 @@ const AtomicString& RTCPeerConnection::interfaceName() const return EventTargetNames::RTCPeerConnection; } -ExecutionContext* RTCPeerConnection::executionContext() const +ExecutionContext* RTCPeerConnection::getExecutionContext() const { - return ActiveDOMObject::executionContext(); + return ActiveDOMObject::getExecutionContext(); } void RTCPeerConnection::suspend() diff --git a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.h b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.h index 4845b6d..4e3e164 100644 --- a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.h +++ b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.h @@ -141,7 +141,7 @@ public: // EventTarget const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; // ActiveDOMObject void suspend() override; diff --git a/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.cpp b/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.cpp index c8172ef..947757e 100644 --- a/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.cpp +++ b/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.cpp @@ -140,7 +140,7 @@ bool UserMediaRequest::isSecureContextUse(String& errorMessage) Document* UserMediaRequest::ownerDocument() { - if (ExecutionContext* context = executionContext()) { + if (ExecutionContext* context = getExecutionContext()) { return toDocument(context); } @@ -155,10 +155,10 @@ void UserMediaRequest::start() void UserMediaRequest::succeed(MediaStreamDescriptor* streamDescriptor) { - if (!executionContext()) + if (!getExecutionContext()) return; - RefPtrWillBeRawPtr<MediaStream> stream = MediaStream::create(executionContext(), streamDescriptor); + RefPtrWillBeRawPtr<MediaStream> stream = MediaStream::create(getExecutionContext(), streamDescriptor); MediaStreamTrackVector audioTracks = stream->getAudioTracks(); for (MediaStreamTrackVector::iterator iter = audioTracks.begin(); iter != audioTracks.end(); ++iter) { @@ -175,7 +175,7 @@ void UserMediaRequest::succeed(MediaStreamDescriptor* streamDescriptor) void UserMediaRequest::failPermissionDenied(const String& message) { - if (!executionContext()) + if (!getExecutionContext()) return; m_errorCallback->handleEvent(NavigatorUserMediaError::create(NavigatorUserMediaError::NamePermissionDenied, message, String())); } @@ -183,7 +183,7 @@ void UserMediaRequest::failPermissionDenied(const String& message) void UserMediaRequest::failConstraint(const String& constraintName, const String& message) { ASSERT(!constraintName.isEmpty()); - if (!executionContext()) + if (!getExecutionContext()) return; m_errorCallback->handleEvent(NavigatorUserMediaError::create(NavigatorUserMediaError::NameConstraintNotSatisfied, message, constraintName)); } @@ -191,7 +191,7 @@ void UserMediaRequest::failConstraint(const String& constraintName, const String void UserMediaRequest::failUASpecific(const String& name, const String& message, const String& constraintName) { ASSERT(!name.isEmpty()); - if (!executionContext()) + if (!getExecutionContext()) return; m_errorCallback->handleEvent(NavigatorUserMediaError::create(name, message, constraintName)); } diff --git a/third_party/WebKit/Source/modules/navigatorconnect/AcceptConnectionObserver.cpp b/third_party/WebKit/Source/modules/navigatorconnect/AcceptConnectionObserver.cpp index 0a39eb0..f0b4d01 100644 --- a/third_party/WebKit/Source/modules/navigatorconnect/AcceptConnectionObserver.cpp +++ b/third_party/WebKit/Source/modules/navigatorconnect/AcceptConnectionObserver.cpp @@ -76,7 +76,7 @@ void AcceptConnectionObserver::contextDestroyed() void AcceptConnectionObserver::didDispatchEvent() { - ASSERT(executionContext()); + ASSERT(getExecutionContext()); if (m_state != Initial) return; responseWasRejected(); @@ -99,7 +99,7 @@ ScriptPromise AcceptConnectionObserver::respondWith(ScriptState* scriptState, Sc void AcceptConnectionObserver::responseWasRejected() { - ASSERT(executionContext()); + ASSERT(getExecutionContext()); if (m_resolver) m_resolver->reject(DOMException::create(AbortError)); m_callbacks->onError(); @@ -108,9 +108,9 @@ void AcceptConnectionObserver::responseWasRejected() void AcceptConnectionObserver::responseWasResolved(const ScriptValue& value) { - ASSERT(executionContext()); + ASSERT(getExecutionContext()); - ScriptState* scriptState = m_resolver->scriptState(); + ScriptState* scriptState = m_resolver->getScriptState(); ExceptionState exceptionState(ExceptionState::UnknownContext, nullptr, nullptr, scriptState->context()->Global(), scriptState->isolate()); ServicePortConnectResponse response = ScriptValue::to<ServicePortConnectResponse>(scriptState->isolate(), value, exceptionState); if (exceptionState.hadException()) { @@ -145,7 +145,7 @@ void AcceptConnectionObserver::responseWasResolved(const ScriptValue& value) } AcceptConnectionObserver::AcceptConnectionObserver(ServicePortCollection* collection, PassOwnPtr<WebServicePortConnectEventCallbacks> callbacks, WebServicePortID portID, const KURL& targetURL) - : ContextLifecycleObserver(collection->executionContext()) + : ContextLifecycleObserver(collection->getExecutionContext()) , m_callbacks(callbacks) , m_collection(collection) , m_portID(portID) diff --git a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortCollection.cpp b/third_party/WebKit/Source/modules/navigatorconnect/ServicePortCollection.cpp index 5f45945..6b80be9 100644 --- a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortCollection.cpp +++ b/third_party/WebKit/Source/modules/navigatorconnect/ServicePortCollection.cpp @@ -35,7 +35,7 @@ public: void onSuccess(WebServicePortID portId) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) { + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) { return; } WebServicePort webPort; @@ -51,7 +51,7 @@ public: void onError() override { // TODO(mek): Pass actual error code back. - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) { + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) { return; } m_resolver->reject(DOMException::create(AbortError)); @@ -103,10 +103,10 @@ ScriptPromise ServicePortCollection::connect(ScriptState* scriptState, const Str } ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); ScriptPromise promise = resolver->promise(); - KURL targetUrl = scriptState->executionContext()->completeURL(url); + KURL targetUrl = scriptState->getExecutionContext()->completeURL(url); m_provider->connect( targetUrl, - scriptState->executionContext()->securityOrigin()->toString(), + scriptState->getExecutionContext()->getSecurityOrigin()->toString(), new ConnectCallbacks(resolver, this, targetUrl, options.name(), portData ? portData->toWireString() : String())); return promise; } @@ -126,9 +126,9 @@ const AtomicString& ServicePortCollection::interfaceName() const return EventTargetNames::ServicePortCollection; } -ExecutionContext* ServicePortCollection::executionContext() const +ExecutionContext* ServicePortCollection::getExecutionContext() const { - return ContextLifecycleObserver::executionContext(); + return ContextLifecycleObserver::getExecutionContext(); } void ServicePortCollection::postMessage(WebServicePortID portId, const WebString& messageString, const WebMessagePortChannelArray& webChannels) @@ -141,7 +141,7 @@ void ServicePortCollection::postMessage(WebServicePortID portId, const WebString } RefPtr<SerializedScriptValue> message = SerializedScriptValueFactory::instance().createFromWire(messageString); - MessagePortArray* ports = MessagePort::entanglePorts(*executionContext(), channels.release()); + MessagePortArray* ports = MessagePort::entanglePorts(*getExecutionContext(), channels.release()); RefPtrWillBeRawPtr<Event> evt = MessageEvent::create(ports, message.release()); // TODO(mek): Lookup ServicePort and set events source attribute. dispatchEvent(evt.release()); diff --git a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortCollection.h b/third_party/WebKit/Source/modules/navigatorconnect/ServicePortCollection.h index e8aa5c7..5107bec 100644 --- a/third_party/WebKit/Source/modules/navigatorconnect/ServicePortCollection.h +++ b/third_party/WebKit/Source/modules/navigatorconnect/ServicePortCollection.h @@ -53,7 +53,7 @@ public: // EventTarget overrides. const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; // WebServicePortProviderClient overrides. void postMessage(WebServicePortID, const WebString&, const WebMessagePortChannelArray&) override; diff --git a/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp b/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp index 6befb67..c18aade 100644 --- a/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp +++ b/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp @@ -92,7 +92,7 @@ static bool verifyCustomHandlerURL(const Document& document, const String& url, // The specification says that the API throws SecurityError exception if the // URL's origin differs from the document's origin. - if (!document.securityOrigin()->canRequest(kurl)) { + if (!document.getSecurityOrigin()->canRequest(kurl)) { exceptionState.throwSecurityError("Can only register custom handler in the document's origin."); return false; } diff --git a/third_party/WebKit/Source/modules/netinfo/NavigatorNetworkInformation.cpp b/third_party/WebKit/Source/modules/netinfo/NavigatorNetworkInformation.cpp index add4dbd..f3505af 100644 --- a/third_party/WebKit/Source/modules/netinfo/NavigatorNetworkInformation.cpp +++ b/third_party/WebKit/Source/modules/netinfo/NavigatorNetworkInformation.cpp @@ -49,7 +49,7 @@ NetworkInformation* NavigatorNetworkInformation::connection() { if (!m_connection && frame()) { ASSERT(frame()->domWindow()); - m_connection = NetworkInformation::create(frame()->domWindow()->executionContext()); + m_connection = NetworkInformation::create(frame()->domWindow()->getExecutionContext()); } return m_connection.get(); } diff --git a/third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp b/third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp index 1fc9a0d..0e661db 100644 --- a/third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp +++ b/third_party/WebKit/Source/modules/netinfo/NetworkInformation.cpp @@ -78,7 +78,7 @@ double NetworkInformation::downlinkMax() const void NetworkInformation::connectionChange(WebConnectionType type, double downlinkMaxMbps) { - ASSERT(executionContext()->isContextThread()); + ASSERT(getExecutionContext()->isContextThread()); // This can happen if the observer removes and then adds itself again // during notification. @@ -98,9 +98,9 @@ const AtomicString& NetworkInformation::interfaceName() const return EventTargetNames::NetworkInformation; } -ExecutionContext* NetworkInformation::executionContext() const +ExecutionContext* NetworkInformation::getExecutionContext() const { - return ActiveDOMObject::executionContext(); + return ActiveDOMObject::getExecutionContext(); } bool NetworkInformation::addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener> listener, const EventListenerOptions& options) @@ -145,7 +145,7 @@ void NetworkInformation::startObserving() { if (!m_observing && !m_contextStopped) { m_type = networkStateNotifier().connectionType(); - networkStateNotifier().addObserver(this, executionContext()); + networkStateNotifier().addObserver(this, getExecutionContext()); m_observing = true; } } @@ -153,7 +153,7 @@ void NetworkInformation::startObserving() void NetworkInformation::stopObserving() { if (m_observing) { - networkStateNotifier().removeObserver(this, executionContext()); + networkStateNotifier().removeObserver(this, getExecutionContext()); m_observing = false; } } diff --git a/third_party/WebKit/Source/modules/netinfo/NetworkInformation.h b/third_party/WebKit/Source/modules/netinfo/NetworkInformation.h index d453153..0090c5e 100644 --- a/third_party/WebKit/Source/modules/netinfo/NetworkInformation.h +++ b/third_party/WebKit/Source/modules/netinfo/NetworkInformation.h @@ -33,7 +33,7 @@ public: // EventTarget overrides. const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; void removeAllEventListeners() override; // ActiveDOMObject overrides. diff --git a/third_party/WebKit/Source/modules/notifications/Notification.cpp b/third_party/WebKit/Source/modules/notifications/Notification.cpp index 40a8d9b..d03052b 100644 --- a/third_party/WebKit/Source/modules/notifications/Notification.cpp +++ b/third_party/WebKit/Source/modules/notifications/Notification.cpp @@ -140,12 +140,12 @@ void Notification::scheduleShow() void Notification::show() { ASSERT(m_state == NotificationStateIdle); - if (Notification::checkPermission(executionContext()) != WebNotificationPermissionAllowed) { + if (Notification::checkPermission(getExecutionContext()) != WebNotificationPermissionAllowed) { dispatchErrorEvent(); return; } - SecurityOrigin* origin = executionContext()->securityOrigin(); + SecurityOrigin* origin = getExecutionContext()->getSecurityOrigin(); ASSERT(origin); notificationManager()->show(WebSecurityOrigin(origin), m_data, this); @@ -160,14 +160,14 @@ void Notification::close() if (m_persistentId == kInvalidPersistentId) { // Fire the close event asynchronously. - executionContext()->postTask(BLINK_FROM_HERE, createSameThreadTask(&Notification::dispatchCloseEvent, this)); + getExecutionContext()->postTask(BLINK_FROM_HERE, createSameThreadTask(&Notification::dispatchCloseEvent, this)); m_state = NotificationStateClosing; notificationManager()->close(this); } else { m_state = NotificationStateClosed; - SecurityOrigin* origin = executionContext()->securityOrigin(); + SecurityOrigin* origin = getExecutionContext()->getSecurityOrigin(); ASSERT(origin); notificationManager()->closePersistent(WebSecurityOrigin(origin), m_persistentId); @@ -182,7 +182,7 @@ void Notification::dispatchShowEvent() void Notification::dispatchClickEvent() { UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); - ScopedWindowFocusAllowedIndicator windowFocusAllowed(executionContext()); + ScopedWindowFocusAllowedIndicator windowFocusAllowed(getExecutionContext()); dispatchEvent(Event::create(EventTypeNames::click)); } @@ -326,7 +326,7 @@ String Notification::permission(ExecutionContext* context) WebNotificationPermission Notification::checkPermission(ExecutionContext* context) { - SecurityOrigin* origin = context->securityOrigin(); + SecurityOrigin* origin = context->getSecurityOrigin(); ASSERT(origin); return notificationManager()->checkPermission(WebSecurityOrigin(origin)); @@ -334,7 +334,7 @@ WebNotificationPermission Notification::checkPermission(ExecutionContext* contex ScriptPromise Notification::requestPermission(ScriptState* scriptState, NotificationPermissionCallback* deprecatedCallback) { - ExecutionContext* context = scriptState->executionContext(); + ExecutionContext* context = scriptState->getExecutionContext(); if (NotificationPermissionClient* permissionClient = NotificationPermissionClient::from(context)) return permissionClient->requestPermission(scriptState, deprecatedCallback); @@ -354,7 +354,7 @@ size_t Notification::maxActions() DispatchEventResult Notification::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event) { - ASSERT(executionContext()->isContextThread()); + ASSERT(getExecutionContext()->isContextThread()); return EventTarget::dispatchEventInternal(event); } diff --git a/third_party/WebKit/Source/modules/notifications/Notification.h b/third_party/WebKit/Source/modules/notifications/Notification.h index ee7db54..065e3b9 100644 --- a/third_party/WebKit/Source/modules/notifications/Notification.h +++ b/third_party/WebKit/Source/modules/notifications/Notification.h @@ -107,7 +107,7 @@ public: static size_t maxActions(); // EventTarget interface. - ExecutionContext* executionContext() const final { return ActiveDOMObject::executionContext(); } + ExecutionContext* getExecutionContext() const final { return ActiveDOMObject::getExecutionContext(); } const AtomicString& interfaceName() const override; // ActiveDOMObject interface. diff --git a/third_party/WebKit/Source/modules/notifications/NotificationDataTest.cpp b/third_party/WebKit/Source/modules/notifications/NotificationDataTest.cpp index ac3ca7c..d091b7e 100644 --- a/third_party/WebKit/Source/modules/notifications/NotificationDataTest.cpp +++ b/third_party/WebKit/Source/modules/notifications/NotificationDataTest.cpp @@ -46,7 +46,7 @@ public: m_executionContext = adoptRefWillBeNoop(new NullExecutionContext()); } - ExecutionContext* executionContext() { return m_executionContext.get(); } + ExecutionContext* getExecutionContext() { return m_executionContext.get(); } private: RefPtrWillBePersistent<ExecutionContext> m_executionContext; @@ -87,7 +87,7 @@ TEST_F(NotificationDataTest, ReflectProperties) // TODO(peter): Test |options.data| and |notificationData.data|. TrackExceptionState exceptionState; - WebNotificationData notificationData = createWebNotificationData(executionContext(), kNotificationTitle, options, exceptionState); + WebNotificationData notificationData = createWebNotificationData(getExecutionContext(), kNotificationTitle, options, exceptionState); ASSERT_FALSE(exceptionState.hadException()); EXPECT_EQ(kNotificationTitle, notificationData.title); @@ -128,7 +128,7 @@ TEST_F(NotificationDataTest, SilentNotificationWithVibration) options.setSilent(true); TrackExceptionState exceptionState; - WebNotificationData notificationData = createWebNotificationData(executionContext(), kNotificationTitle, options, exceptionState); + WebNotificationData notificationData = createWebNotificationData(getExecutionContext(), kNotificationTitle, options, exceptionState); ASSERT_TRUE(exceptionState.hadException()); EXPECT_EQ("Silent notifications must not specify vibration patterns.", exceptionState.message()); @@ -141,7 +141,7 @@ TEST_F(NotificationDataTest, RenotifyWithEmptyTag) options.setRenotify(true); TrackExceptionState exceptionState; - WebNotificationData notificationData = createWebNotificationData(executionContext(), kNotificationTitle, options, exceptionState); + WebNotificationData notificationData = createWebNotificationData(getExecutionContext(), kNotificationTitle, options, exceptionState); ASSERT_TRUE(exceptionState.hadException()); EXPECT_EQ("Notifications which set the renotify flag must specify a non-empty tag.", exceptionState.message()); @@ -163,7 +163,7 @@ TEST_F(NotificationDataTest, InvalidIconUrls) options.setActions(actions); TrackExceptionState exceptionState; - WebNotificationData notificationData = createWebNotificationData(executionContext(), kNotificationTitle, options, exceptionState); + WebNotificationData notificationData = createWebNotificationData(getExecutionContext(), kNotificationTitle, options, exceptionState); ASSERT_FALSE(exceptionState.hadException()); EXPECT_TRUE(notificationData.icon.isEmpty()); @@ -184,7 +184,7 @@ TEST_F(NotificationDataTest, VibrationNormalization) options.setVibrate(vibrationSequence); TrackExceptionState exceptionState; - WebNotificationData notificationData = createWebNotificationData(executionContext(), kNotificationTitle, options, exceptionState); + WebNotificationData notificationData = createWebNotificationData(getExecutionContext(), kNotificationTitle, options, exceptionState); EXPECT_FALSE(exceptionState.hadException()); Vector<int> normalizedPattern; @@ -201,7 +201,7 @@ TEST_F(NotificationDataTest, DefaultTimestampValue) NotificationOptions options; TrackExceptionState exceptionState; - WebNotificationData notificationData = createWebNotificationData(executionContext(), kNotificationTitle, options, exceptionState); + WebNotificationData notificationData = createWebNotificationData(getExecutionContext(), kNotificationTitle, options, exceptionState); EXPECT_FALSE(exceptionState.hadException()); // The timestamp should be set to the current time since the epoch if it wasn't supplied by the developer. @@ -224,7 +224,7 @@ TEST_F(NotificationDataTest, DirectionValues) options.setDir(direction); TrackExceptionState exceptionState; - WebNotificationData notificationData = createWebNotificationData(executionContext(), kNotificationTitle, options, exceptionState); + WebNotificationData notificationData = createWebNotificationData(getExecutionContext(), kNotificationTitle, options, exceptionState); ASSERT_FALSE(exceptionState.hadException()); EXPECT_EQ(mappings.get(direction), notificationData.direction); @@ -246,7 +246,7 @@ TEST_F(NotificationDataTest, MaximumActionCount) options.setActions(actions); TrackExceptionState exceptionState; - WebNotificationData notificationData = createWebNotificationData(executionContext(), kNotificationTitle, options, exceptionState); + WebNotificationData notificationData = createWebNotificationData(getExecutionContext(), kNotificationTitle, options, exceptionState); ASSERT_FALSE(exceptionState.hadException()); // The stored actions will be capped to |maxActions| entries. diff --git a/third_party/WebKit/Source/modules/notifications/NotificationEvent.h b/third_party/WebKit/Source/modules/notifications/NotificationEvent.h index dfa1cf8..e2cfb7b 100644 --- a/third_party/WebKit/Source/modules/notifications/NotificationEvent.h +++ b/third_party/WebKit/Source/modules/notifications/NotificationEvent.h @@ -33,7 +33,7 @@ public: ~NotificationEvent() override; - Notification* notification() const { return m_notification.get(); } + Notification* getNotification() const { return m_notification.get(); } String action() const { return m_action; } const AtomicString& interfaceName() const override; diff --git a/third_party/WebKit/Source/modules/notifications/NotificationEvent.idl b/third_party/WebKit/Source/modules/notifications/NotificationEvent.idl index 4261777..1e102df 100644 --- a/third_party/WebKit/Source/modules/notifications/NotificationEvent.idl +++ b/third_party/WebKit/Source/modules/notifications/NotificationEvent.idl @@ -9,6 +9,6 @@ Exposed=ServiceWorker, RuntimeEnabled=Notifications, ] interface NotificationEvent : ExtendableEvent { - readonly attribute Notification notification; + [ImplementedAs=getNotification] readonly attribute Notification notification; readonly attribute DOMString action; }; diff --git a/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp b/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp index a00f19d..db1353d 100644 --- a/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp +++ b/third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp @@ -32,7 +32,7 @@ public: { HeapVector<Member<Notification>> notifications; for (const WebPersistentNotificationInfo& notificationInfo : notificationInfos) - notifications.append(Notification::create(resolver->executionContext(), notificationInfo.persistentId, notificationInfo.data, true /* showing */)); + notifications.append(Notification::create(resolver->getExecutionContext(), notificationInfo.persistentId, notificationInfo.data, true /* showing */)); return notifications; } @@ -45,7 +45,7 @@ private: ScriptPromise ServiceWorkerRegistrationNotifications::showNotification(ScriptState* scriptState, ServiceWorkerRegistration& serviceWorkerRegistration, const String& title, const NotificationOptions& options, ExceptionState& exceptionState) { - ExecutionContext* executionContext = scriptState->executionContext(); + ExecutionContext* executionContext = scriptState->getExecutionContext(); // If context object's active worker is null, reject promise with a TypeError exception. if (!serviceWorkerRegistration.active()) @@ -69,7 +69,7 @@ ScriptPromise ServiceWorkerRegistrationNotifications::showNotification(ScriptSta WebNotificationShowCallbacks* callbacks = new CallbackPromiseAdapter<void, void>(resolver); - SecurityOrigin* origin = executionContext->securityOrigin(); + SecurityOrigin* origin = executionContext->getSecurityOrigin(); WebNotificationManager* notificationManager = Platform::current()->notificationManager(); ASSERT(notificationManager); diff --git a/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp index 1a00c5b..df10393 100644 --- a/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp +++ b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvas.cpp @@ -45,7 +45,7 @@ OffscreenCanvasRenderingContext2D* OffscreenCanvas::getContext(const String& id, return nullptr; if (m_context) { - if (m_context->contextType() != contextType) { + if (m_context->getContextType() != contextType) { factory->onError(this, "OffscreenCanvas has an existing context of a different type"); return nullptr; } @@ -81,7 +81,7 @@ OffscreenCanvasRenderingContextFactory* OffscreenCanvas::getRenderingContextFact void OffscreenCanvas::registerRenderingContextFactory(PassOwnPtr<OffscreenCanvasRenderingContextFactory> renderingContextFactory) { - OffscreenCanvasRenderingContext::ContextType type = renderingContextFactory->contextType(); + OffscreenCanvasRenderingContext::ContextType type = renderingContextFactory->getContextType(); ASSERT(type < OffscreenCanvasRenderingContext::ContextTypeCount); ASSERT(!renderingContextFactories()[type]); renderingContextFactories()[type] = renderingContextFactory; diff --git a/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasRenderingContext.h b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasRenderingContext.h index b47aa08..341baa7 100644 --- a/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasRenderingContext.h +++ b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasRenderingContext.h @@ -22,8 +22,8 @@ public: }; static ContextType contextTypeFromId(const String& id); - OffscreenCanvas* offscreenCanvas() const { return m_offscreenCanvas; } - virtual ContextType contextType() const = 0; + OffscreenCanvas* getOffscreenCanvas() const { return m_offscreenCanvas; } + virtual ContextType getContextType() const = 0; virtual bool is2d() const { return false; } diff --git a/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasRenderingContextFactory.h b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasRenderingContextFactory.h index 9892cc7..3dd3498 100644 --- a/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasRenderingContextFactory.h +++ b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasRenderingContextFactory.h @@ -22,7 +22,7 @@ public: virtual ~OffscreenCanvasRenderingContextFactory() { } virtual OffscreenCanvasRenderingContext* create(OffscreenCanvas*, const CanvasContextCreationAttributes&) = 0; - virtual OffscreenCanvasRenderingContext::ContextType contextType() const = 0; + virtual OffscreenCanvasRenderingContext::ContextType getContextType() const = 0; virtual void onError(OffscreenCanvas*, const String& error) = 0; }; diff --git a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp index 3349165..769e0a2 100644 --- a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp +++ b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp @@ -48,12 +48,12 @@ bool OffscreenCanvasRenderingContext2D::wouldTaintOrigin(CanvasImageSource* sour int OffscreenCanvasRenderingContext2D::width() const { - return offscreenCanvas()->height(); + return getOffscreenCanvas()->height(); } int OffscreenCanvasRenderingContext2D::height() const { - return offscreenCanvas()->width(); + return getOffscreenCanvas()->width(); } bool OffscreenCanvasRenderingContext2D::hasImageBuffer() const diff --git a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h index 1401fbc..defa199 100644 --- a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h +++ b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h @@ -26,7 +26,7 @@ public: return new OffscreenCanvasRenderingContext2D(canvas, attrs); } - OffscreenCanvasRenderingContext::ContextType contextType() const override + OffscreenCanvasRenderingContext::ContextType getContextType() const override { return OffscreenCanvasRenderingContext::Context2d; } @@ -36,7 +36,7 @@ public: // OffscreenCanvasRenderingContext implementation ~OffscreenCanvasRenderingContext2D() override; - ContextType contextType() const override { return Context2d; } + ContextType getContextType() const override { return Context2d; } bool is2d() const override { return true; } // BaseRenderingContext2D implementation diff --git a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.idl b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.idl index 5c33a57..88cee00 100644 --- a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.idl +++ b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.idl @@ -10,7 +10,7 @@ RuntimeEnabled=ExperimentalCanvasFeatures, ] interface OffscreenCanvasRenderingContext2D { // back-reference to the canvas - readonly attribute OffscreenCanvas offscreenCanvas; + [ImplementedAs=getOffscreenCanvas] readonly attribute OffscreenCanvas offscreenCanvas; }; OffscreenCanvasRenderingContext2D implements CanvasPathMethods; diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp index d4a1c5f..fe3ab46 100644 --- a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp +++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp @@ -50,9 +50,9 @@ const AtomicString& PaymentRequest::interfaceName() const return EventTargetNames::PaymentRequest; } -ExecutionContext* PaymentRequest::executionContext() const +ExecutionContext* PaymentRequest::getExecutionContext() const { - return m_scriptState->executionContext(); + return m_scriptState->getExecutionContext(); } DEFINE_TRACE(PaymentRequest) diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequest.h b/third_party/WebKit/Source/modules/payments/PaymentRequest.h index 8f92cca..2e07114 100644 --- a/third_party/WebKit/Source/modules/payments/PaymentRequest.h +++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.h @@ -38,7 +38,7 @@ public: ScriptPromise show(ScriptState*); void abort(); - ShippingAddress* shippingAddress() const { return m_shippingAddress.get(); } + ShippingAddress* getShippingAddress() const { return m_shippingAddress.get(); } const String& shippingOption() const { return m_shippingOption; } DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingaddresschange); @@ -46,7 +46,7 @@ public: // EventTargetWithInlineData: const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; DECLARE_TRACE(); diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequest.idl b/third_party/WebKit/Source/modules/payments/PaymentRequest.idl index e586791..6c32414 100644 --- a/third_party/WebKit/Source/modules/payments/PaymentRequest.idl +++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.idl @@ -15,7 +15,7 @@ [CallWith=ScriptState] Promise<PaymentResponse> show(); void abort(); - readonly attribute ShippingAddress? shippingAddress; + [ImplementedAs=getShippingAddress] readonly attribute ShippingAddress? shippingAddress; readonly attribute DOMString? shippingOption; attribute EventHandler onshippingaddresschange; diff --git a/third_party/WebKit/Source/modules/permissions/PermissionCallback.cpp b/third_party/WebKit/Source/modules/permissions/PermissionCallback.cpp index 97ee496..0ea00dd 100644 --- a/third_party/WebKit/Source/modules/permissions/PermissionCallback.cpp +++ b/third_party/WebKit/Source/modules/permissions/PermissionCallback.cpp @@ -22,7 +22,7 @@ PermissionCallback::~PermissionCallback() void PermissionCallback::onSuccess(WebPermissionStatus permissionStatus) { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) { + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) { return; } m_resolver->resolve(PermissionStatus::take(m_resolver.get(), permissionStatus, m_permissionType)); @@ -30,7 +30,7 @@ void PermissionCallback::onSuccess(WebPermissionStatus permissionStatus) void PermissionCallback::onError() { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) { + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) { return; } m_resolver->reject(); diff --git a/third_party/WebKit/Source/modules/permissions/PermissionStatus.cpp b/third_party/WebKit/Source/modules/permissions/PermissionStatus.cpp index b2b14b6..fcc5159 100644 --- a/third_party/WebKit/Source/modules/permissions/PermissionStatus.cpp +++ b/third_party/WebKit/Source/modules/permissions/PermissionStatus.cpp @@ -18,7 +18,7 @@ namespace blink { // static PermissionStatus* PermissionStatus::take(ScriptPromiseResolver* resolver, WebPermissionStatus status, WebPermissionType type) { - return PermissionStatus::createAndListen(resolver->executionContext(), status, type); + return PermissionStatus::createAndListen(resolver->getExecutionContext(), status, type); } PermissionStatus* PermissionStatus::createAndListen(ExecutionContext* executionContext, WebPermissionStatus status, WebPermissionType type) @@ -47,9 +47,9 @@ const AtomicString& PermissionStatus::interfaceName() const return EventTargetNames::PermissionStatus; } -ExecutionContext* PermissionStatus::executionContext() const +ExecutionContext* PermissionStatus::getExecutionContext() const { - return ActiveDOMObject::executionContext(); + return ActiveDOMObject::getExecutionContext(); } void PermissionStatus::permissionChanged(WebPermissionType type, WebPermissionStatus status) @@ -86,11 +86,11 @@ void PermissionStatus::startListening() { ASSERT(!m_listening); - WebPermissionClient* client = Permissions::getClient(executionContext()); + WebPermissionClient* client = Permissions::getClient(getExecutionContext()); if (!client) return; m_listening = true; - client->startListening(m_type, KURL(KURL(), executionContext()->securityOrigin()->toString()), this); + client->startListening(m_type, KURL(KURL(), getExecutionContext()->getSecurityOrigin()->toString()), this); } void PermissionStatus::stopListening() @@ -98,10 +98,10 @@ void PermissionStatus::stopListening() if (!m_listening) return; - ASSERT(executionContext()); + ASSERT(getExecutionContext()); m_listening = false; - WebPermissionClient* client = Permissions::getClient(executionContext()); + WebPermissionClient* client = Permissions::getClient(getExecutionContext()); if (!client) return; client->stopListening(this); diff --git a/third_party/WebKit/Source/modules/permissions/PermissionStatus.h b/third_party/WebKit/Source/modules/permissions/PermissionStatus.h index 0b1051c..ba88e2f 100644 --- a/third_party/WebKit/Source/modules/permissions/PermissionStatus.h +++ b/third_party/WebKit/Source/modules/permissions/PermissionStatus.h @@ -36,7 +36,7 @@ public: // EventTarget implementation. const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; // WebPermissionObserver implementation. void permissionChanged(WebPermissionType, WebPermissionStatus) override; diff --git a/third_party/WebKit/Source/modules/permissions/Permissions.cpp b/third_party/WebKit/Source/modules/permissions/Permissions.cpp index d46439c4..24a27ac 100644 --- a/third_party/WebKit/Source/modules/permissions/Permissions.cpp +++ b/third_party/WebKit/Source/modules/permissions/Permissions.cpp @@ -102,7 +102,7 @@ WebPermissionClient* Permissions::getClient(ExecutionContext* executionContext) ScriptPromise Permissions::query(ScriptState* scriptState, const Dictionary& rawPermission) { - WebPermissionClient* client = getClient(scriptState->executionContext()); + WebPermissionClient* client = getClient(scriptState->getExecutionContext()); if (!client) return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(InvalidStateError, "In its current state, the global scope can't query permissions.")); @@ -118,13 +118,13 @@ ScriptPromise Permissions::query(ScriptState* scriptState, const Dictionary& raw // meaningful value because most APIs are broken on file scheme and no // permission prompt will be shown even if the returned permission will most // likely be "prompt". - client->queryPermission(type.get(), KURL(KURL(), scriptState->executionContext()->securityOrigin()->toString()), new PermissionCallback(resolver, type.get())); + client->queryPermission(type.get(), KURL(KURL(), scriptState->getExecutionContext()->getSecurityOrigin()->toString()), new PermissionCallback(resolver, type.get())); return promise; } ScriptPromise Permissions::request(ScriptState* scriptState, const Dictionary& rawPermission) { - WebPermissionClient* client = getClient(scriptState->executionContext()); + WebPermissionClient* client = getClient(scriptState->getExecutionContext()); if (!client) return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(InvalidStateError, "In its current state, the global scope can't request permissions.")); @@ -136,13 +136,13 @@ ScriptPromise Permissions::request(ScriptState* scriptState, const Dictionary& r ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); ScriptPromise promise = resolver->promise(); - client->requestPermission(type.get(), KURL(KURL(), scriptState->executionContext()->securityOrigin()->toString()), new PermissionCallback(resolver, type.get())); + client->requestPermission(type.get(), KURL(KURL(), scriptState->getExecutionContext()->getSecurityOrigin()->toString()), new PermissionCallback(resolver, type.get())); return promise; } ScriptPromise Permissions::revoke(ScriptState* scriptState, const Dictionary& rawPermission) { - WebPermissionClient* client = getClient(scriptState->executionContext()); + WebPermissionClient* client = getClient(scriptState->getExecutionContext()); if (!client) return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(InvalidStateError, "In its current state, the global scope can't revoke permissions.")); @@ -154,13 +154,13 @@ ScriptPromise Permissions::revoke(ScriptState* scriptState, const Dictionary& ra ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); ScriptPromise promise = resolver->promise(); - client->revokePermission(type.get(), KURL(KURL(), scriptState->executionContext()->securityOrigin()->toString()), new PermissionCallback(resolver, type.get())); + client->revokePermission(type.get(), KURL(KURL(), scriptState->getExecutionContext()->getSecurityOrigin()->toString()), new PermissionCallback(resolver, type.get())); return promise; } ScriptPromise Permissions::requestAll(ScriptState* scriptState, const Vector<Dictionary>& rawPermissions) { - WebPermissionClient* client = getClient(scriptState->executionContext()); + WebPermissionClient* client = getClient(scriptState->getExecutionContext()); if (!client) return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(InvalidStateError, "In its current state, the global scope can't request permissions.")); @@ -191,7 +191,7 @@ ScriptPromise Permissions::requestAll(ScriptState* scriptState, const Vector<Dic ScriptPromise promise = resolver->promise(); WebVector<WebPermissionType> internalWebPermissions = *internalPermissions; - client->requestPermissions(internalWebPermissions, KURL(KURL(), scriptState->executionContext()->securityOrigin()->toString()), + client->requestPermissions(internalWebPermissions, KURL(KURL(), scriptState->getExecutionContext()->getSecurityOrigin()->toString()), new PermissionsCallback(resolver, internalPermissions.release(), callerIndexToInternalIndex.release())); return promise; } diff --git a/third_party/WebKit/Source/modules/permissions/PermissionsCallback.cpp b/third_party/WebKit/Source/modules/permissions/PermissionsCallback.cpp index 847f4e2..7d967ab 100644 --- a/third_party/WebKit/Source/modules/permissions/PermissionsCallback.cpp +++ b/third_party/WebKit/Source/modules/permissions/PermissionsCallback.cpp @@ -19,7 +19,7 @@ PermissionsCallback::PermissionsCallback(ScriptPromiseResolver* resolver, PassOw void PermissionsCallback::onSuccess(WebPassOwnPtr<WebVector<WebPermissionStatus>> permissionStatus) { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; OwnPtr<WebVector<WebPermissionStatus>> statusPtr = permissionStatus.release(); @@ -30,14 +30,14 @@ void PermissionsCallback::onSuccess(WebPassOwnPtr<WebVector<WebPermissionStatus> // using the internal index obtained. for (size_t i = 0; i < m_callerIndexToInternalIndex->size(); ++i) { int internalIndex = m_callerIndexToInternalIndex->operator[](i); - result[i] = PermissionStatus::createAndListen(m_resolver->executionContext(), statusPtr->operator[](internalIndex), m_internalPermissions->operator[](internalIndex)); + result[i] = PermissionStatus::createAndListen(m_resolver->getExecutionContext(), statusPtr->operator[](internalIndex), m_internalPermissions->operator[](internalIndex)); } m_resolver->resolve(result); } void PermissionsCallback::onError() { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->reject(); } diff --git a/third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp b/third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp index 50ebc37..04f81fe 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp +++ b/third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp @@ -33,7 +33,7 @@ WebPresentationClient* presentationClient(ExecutionContext* executionContext) // static PresentationAvailability* PresentationAvailability::take(ScriptPromiseResolver* resolver, const KURL& url, bool value) { - PresentationAvailability* presentationAvailability = new PresentationAvailability(resolver->executionContext(), url, value); + PresentationAvailability* presentationAvailability = new PresentationAvailability(resolver->getExecutionContext(), url, value); presentationAvailability->suspendIfNeeded(); presentationAvailability->updateListening(); return presentationAvailability; @@ -58,15 +58,15 @@ const AtomicString& PresentationAvailability::interfaceName() const return EventTargetNames::PresentationAvailability; } -ExecutionContext* PresentationAvailability::executionContext() const +ExecutionContext* PresentationAvailability::getExecutionContext() const { - return ActiveDOMObject::executionContext(); + return ActiveDOMObject::getExecutionContext(); } bool PresentationAvailability::addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener> listener, const EventListenerOptions& options) { if (eventType == EventTypeNames::change) - UseCounter::count(executionContext(), UseCounter::PresentationAvailabilityChangeEventListener); + UseCounter::count(getExecutionContext(), UseCounter::PresentationAvailabilityChangeEventListener); return EventTarget::addEventListenerInternal(eventType, listener, options); } @@ -115,11 +115,11 @@ void PresentationAvailability::setState(State state) void PresentationAvailability::updateListening() { - WebPresentationClient* client = presentationClient(executionContext()); + WebPresentationClient* client = presentationClient(getExecutionContext()); if (!client) return; - if (m_state == State::Active && (toDocument(executionContext())->pageVisibilityState() == PageVisibilityStateVisible)) + if (m_state == State::Active && (toDocument(getExecutionContext())->pageVisibilityState() == PageVisibilityStateVisible)) client->startListening(this); else client->stopListening(this); diff --git a/third_party/WebKit/Source/modules/presentation/PresentationAvailability.h b/third_party/WebKit/Source/modules/presentation/PresentationAvailability.h index ecc3f52..06e454e 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationAvailability.h +++ b/third_party/WebKit/Source/modules/presentation/PresentationAvailability.h @@ -36,7 +36,7 @@ public: // EventTarget implementation. const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; // WebPresentationAvailabilityObserver implementation. void availabilityChanged(bool) override; diff --git a/third_party/WebKit/Source/modules/presentation/PresentationAvailabilityCallbacks.cpp b/third_party/WebKit/Source/modules/presentation/PresentationAvailabilityCallbacks.cpp index c1e69eb..1b631ea 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationAvailabilityCallbacks.cpp +++ b/third_party/WebKit/Source/modules/presentation/PresentationAvailabilityCallbacks.cpp @@ -25,14 +25,14 @@ PresentationAvailabilityCallbacks::~PresentationAvailabilityCallbacks() void PresentationAvailabilityCallbacks::onSuccess(bool value) { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->resolve(PresentationAvailability::take(m_resolver.get(), m_url, value)); } void PresentationAvailabilityCallbacks::onError(const WebPresentationError& error) { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->reject(PresentationError::take(m_resolver.get(), error)); } diff --git a/third_party/WebKit/Source/modules/presentation/PresentationAvailabilityTest.cpp b/third_party/WebKit/Source/modules/presentation/PresentationAvailabilityTest.cpp index 545a140..664b623 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationAvailabilityTest.cpp +++ b/third_party/WebKit/Source/modules/presentation/PresentationAvailabilityTest.cpp @@ -27,12 +27,12 @@ public: void SetUp() override { - m_scope.scriptState()->setExecutionContext(&m_page->document()); + m_scope.getScriptState()->setExecutionContext(&m_page->document()); } Page& page() { return m_page->page(); } LocalFrame& frame() { return m_page->frame(); } - ScriptState* scriptState() { return m_scope.scriptState(); } + ScriptState* getScriptState() { return m_scope.getScriptState(); } private: V8TestingScope m_scope; @@ -42,7 +42,7 @@ private: TEST_F(PresentationAvailabilityTest, NoPageVisibilityChangeAfterDetach) { const KURL url = URLTestHelpers::toKURL("https://example.com"); - Persistent<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState()); + Persistent<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(getScriptState()); Persistent<PresentationAvailability> availability = PresentationAvailability::take(resolver, url, false); // These two calls should not crash. diff --git a/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp b/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp index 716c872..9c1ee10 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp +++ b/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp @@ -94,7 +94,7 @@ public: : m_PresentationConnection(PresentationConnection) , m_loader(FileReaderLoader::ReadAsArrayBuffer, this) { - m_loader.start(m_PresentationConnection->executionContext(), blobDataHandle); + m_loader.start(m_PresentationConnection->getExecutionContext(), blobDataHandle); } ~BlobLoader() override { } @@ -145,9 +145,9 @@ PresentationConnection* PresentationConnection::take(ScriptPromiseResolver* reso ASSERT(resolver); ASSERT(client); ASSERT(request); - ASSERT(resolver->executionContext()->isDocument()); + ASSERT(resolver->getExecutionContext()->isDocument()); - Document* document = toDocument(resolver->executionContext()); + Document* document = toDocument(resolver->getExecutionContext()); if (!document->frame()) return nullptr; @@ -176,7 +176,7 @@ const AtomicString& PresentationConnection::interfaceName() const return EventTargetNames::PresentationConnection; } -ExecutionContext* PresentationConnection::executionContext() const +ExecutionContext* PresentationConnection::getExecutionContext() const { if (!frame()) return nullptr; @@ -186,15 +186,15 @@ ExecutionContext* PresentationConnection::executionContext() const bool PresentationConnection::addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener> listener, const EventListenerOptions& options) { if (eventType == EventTypeNames::statechange) - Deprecation::countDeprecation(executionContext(), UseCounter::PresentationConnectionStateChangeEventListener); + Deprecation::countDeprecation(getExecutionContext(), UseCounter::PresentationConnectionStateChangeEventListener); else if (eventType == EventTypeNames::connect) - UseCounter::count(executionContext(), UseCounter::PresentationConnectionConnectEventListener); + UseCounter::count(getExecutionContext(), UseCounter::PresentationConnectionConnectEventListener); else if (eventType == EventTypeNames::close) - UseCounter::count(executionContext(), UseCounter::PresentationConnectionCloseEventListener); + UseCounter::count(getExecutionContext(), UseCounter::PresentationConnectionCloseEventListener); else if (eventType == EventTypeNames::terminate) - UseCounter::count(executionContext(), UseCounter::PresentationConnectionTerminateEventListener); + UseCounter::count(getExecutionContext(), UseCounter::PresentationConnectionTerminateEventListener); else if (eventType == EventTypeNames::message) - UseCounter::count(executionContext(), UseCounter::PresentationConnectionMessageEventListener); + UseCounter::count(getExecutionContext(), UseCounter::PresentationConnectionMessageEventListener); return EventTarget::addEventListenerInternal(eventType, listener, options); } @@ -258,12 +258,12 @@ bool PresentationConnection::canSendMessage(ExceptionState& exceptionState) } // The connection can send a message if there is a client available. - return !!presentationClient(executionContext()); + return !!presentationClient(getExecutionContext()); } void PresentationConnection::handleMessageQueue() { - WebPresentationClient* client = presentationClient(executionContext()); + WebPresentationClient* client = presentationClient(getExecutionContext()); if (!client) return; @@ -344,7 +344,7 @@ void PresentationConnection::close() { if (m_state != WebPresentationConnectionState::Connected) return; - WebPresentationClient* client = presentationClient(executionContext()); + WebPresentationClient* client = presentationClient(getExecutionContext()); if (client) client->closeSession(m_url, m_id); @@ -355,7 +355,7 @@ void PresentationConnection::terminate() { if (m_state != WebPresentationConnectionState::Connected) return; - WebPresentationClient* client = presentationClient(executionContext()); + WebPresentationClient* client = presentationClient(getExecutionContext()); if (client) client->terminateSession(m_url, m_id); @@ -402,7 +402,7 @@ void PresentationConnection::didFinishLoadingBlob(PassRefPtr<DOMArrayBuffer> buf ASSERT(!m_messages.isEmpty() && m_messages.first()->type == MessageTypeBlob); ASSERT(buffer && buffer->buffer()); // Send the loaded blob immediately here and continue processing the queue. - WebPresentationClient* client = presentationClient(executionContext()); + WebPresentationClient* client = presentationClient(getExecutionContext()); if (client) client->sendBlobData(m_url, m_id, static_cast<const uint8_t*>(buffer->data()), buffer->byteLength()); diff --git a/third_party/WebKit/Source/modules/presentation/PresentationConnection.h b/third_party/WebKit/Source/modules/presentation/PresentationConnection.h index 0bcf82c..eb0f0c0 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationConnection.h +++ b/third_party/WebKit/Source/modules/presentation/PresentationConnection.h @@ -41,7 +41,7 @@ public: // EventTarget implementation. const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; DECLARE_VIRTUAL_TRACE(); diff --git a/third_party/WebKit/Source/modules/presentation/PresentationConnectionCallbacks.cpp b/third_party/WebKit/Source/modules/presentation/PresentationConnectionCallbacks.cpp index 241a90a..ee05de9 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationConnectionCallbacks.cpp +++ b/third_party/WebKit/Source/modules/presentation/PresentationConnectionCallbacks.cpp @@ -25,14 +25,14 @@ void PresentationConnectionCallbacks::onSuccess(WebPassOwnPtr<WebPresentationCon { OwnPtr<WebPresentationConnectionClient> result(PresentationConnectionClient.release()); - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->resolve(PresentationConnection::take(m_resolver.get(), result.release(), m_request)); } void PresentationConnectionCallbacks::onError(const WebPresentationError& error) { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->reject(PresentationError::take(m_resolver.get(), error)); } diff --git a/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp b/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp index 8087825..9d2bf95 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp +++ b/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp @@ -22,7 +22,7 @@ const AtomicString& PresentationReceiver::interfaceName() const return EventTargetNames::PresentationReceiver; } -ExecutionContext* PresentationReceiver::executionContext() const +ExecutionContext* PresentationReceiver::getExecutionContext() const { return frame() ? frame()->document() : nullptr; } diff --git a/third_party/WebKit/Source/modules/presentation/PresentationReceiver.h b/third_party/WebKit/Source/modules/presentation/PresentationReceiver.h index 412f222..52055f1 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationReceiver.h +++ b/third_party/WebKit/Source/modules/presentation/PresentationReceiver.h @@ -27,7 +27,7 @@ public: // EventTarget implementation. const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; ScriptPromise getConnection(ScriptState*); ScriptPromise getConnections(ScriptState*); diff --git a/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp b/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp index 381ce7a..66f1cce 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp +++ b/third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp @@ -66,22 +66,22 @@ const AtomicString& PresentationRequest::interfaceName() const return EventTargetNames::PresentationRequest; } -ExecutionContext* PresentationRequest::executionContext() const +ExecutionContext* PresentationRequest::getExecutionContext() const { - return ActiveDOMObject::executionContext(); + return ActiveDOMObject::getExecutionContext(); } bool PresentationRequest::addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener> listener, const EventListenerOptions& options) { if (eventType == EventTypeNames::connectionavailable) - UseCounter::count(executionContext(), UseCounter::PresentationRequestConnectionAvailableEventListener); + UseCounter::count(getExecutionContext(), UseCounter::PresentationRequestConnectionAvailableEventListener); return EventTarget::addEventListenerInternal(eventType, listener, options); } bool PresentationRequest::hasPendingActivity() const { - if (!executionContext() || executionContext()->activeDOMObjectsAreStopped()) + if (!getExecutionContext() || getExecutionContext()->activeDOMObjectsAreStopped()) return false; // Prevents garbage collecting of this object when not hold by another @@ -94,7 +94,7 @@ ScriptPromise PresentationRequest::start(ScriptState* scriptState) ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); ScriptPromise promise = resolver->promise(); - Settings* contextSettings = settings(executionContext()); + Settings* contextSettings = settings(getExecutionContext()); bool isUserGestureRequired = !contextSettings || contextSettings->presentationRequiresUserGesture(); if (isUserGestureRequired && !UserGestureIndicator::processingUserGesture()) { @@ -102,7 +102,7 @@ ScriptPromise PresentationRequest::start(ScriptState* scriptState) return promise; } - WebPresentationClient* client = presentationClient(executionContext()); + WebPresentationClient* client = presentationClient(getExecutionContext()); if (!client) { resolver->reject(DOMException::create(InvalidStateError, "The PresentationRequest is no longer associated to a frame.")); return promise; @@ -117,7 +117,7 @@ ScriptPromise PresentationRequest::reconnect(ScriptState* scriptState, const Str ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); ScriptPromise promise = resolver->promise(); - WebPresentationClient* client = presentationClient(executionContext()); + WebPresentationClient* client = presentationClient(getExecutionContext()); if (!client) { resolver->reject(DOMException::create(InvalidStateError, "The PresentationRequest is no longer associated to a frame.")); return promise; @@ -132,7 +132,7 @@ ScriptPromise PresentationRequest::getAvailability(ScriptState* scriptState) ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); ScriptPromise promise = resolver->promise(); - WebPresentationClient* client = presentationClient(executionContext()); + WebPresentationClient* client = presentationClient(getExecutionContext()); if (!client) { resolver->reject(DOMException::create(InvalidStateError, "The object is no longer associated to a frame.")); return promise; diff --git a/third_party/WebKit/Source/modules/presentation/PresentationRequest.h b/third_party/WebKit/Source/modules/presentation/PresentationRequest.h index 84cdb97..8e355b7 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationRequest.h +++ b/third_party/WebKit/Source/modules/presentation/PresentationRequest.h @@ -29,7 +29,7 @@ public: // EventTarget implementation. const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; // ActiveDOMObject implementation. bool hasPendingActivity() const; diff --git a/third_party/WebKit/Source/modules/push_messaging/PushManager.cpp b/third_party/WebKit/Source/modules/push_messaging/PushManager.cpp index 0f5a2ff..3233758 100644 --- a/third_party/WebKit/Source/modules/push_messaging/PushManager.cpp +++ b/third_party/WebKit/Source/modules/push_messaging/PushManager.cpp @@ -60,8 +60,8 @@ ScriptPromise PushManager::subscribe(ScriptState* scriptState, const PushSubscri // The document context is the only reasonable context from which to ask the user for permission // to use the Push API. The embedder should persist the permission so that later calls in // different contexts can succeed. - if (scriptState->executionContext()->isDocument()) { - Document* document = toDocument(scriptState->executionContext()); + if (scriptState->getExecutionContext()->isDocument()) { + Document* document = toDocument(scriptState->getExecutionContext()); if (!document->domWindow() || !document->frame()) return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(InvalidStateError, "Document is detached from window.")); PushController::clientFrom(document->frame()).subscribe(m_registration->webRegistration(), toWebPushSubscriptionOptions(options), new PushSubscriptionCallbacks(resolver, m_registration)); @@ -83,8 +83,8 @@ ScriptPromise PushManager::getSubscription(ScriptState* scriptState) ScriptPromise PushManager::permissionState(ScriptState* scriptState, const PushSubscriptionOptions& options) { - if (scriptState->executionContext()->isDocument()) { - Document* document = toDocument(scriptState->executionContext()); + if (scriptState->getExecutionContext()->isDocument()) { + Document* document = toDocument(scriptState->getExecutionContext()); if (!document->domWindow() || !document->frame()) return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(InvalidStateError, "Document is detached from window.")); } diff --git a/third_party/WebKit/Source/modules/push_messaging/PushPermissionStatusCallbacks.cpp b/third_party/WebKit/Source/modules/push_messaging/PushPermissionStatusCallbacks.cpp index 455c690..20d6a68 100644 --- a/third_party/WebKit/Source/modules/push_messaging/PushPermissionStatusCallbacks.cpp +++ b/third_party/WebKit/Source/modules/push_messaging/PushPermissionStatusCallbacks.cpp @@ -26,7 +26,7 @@ void PushPermissionStatusCallbacks::onSuccess(WebPushPermissionStatus status) void PushPermissionStatusCallbacks::onError(const WebPushError& error) { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->reject(PushError::take(m_resolver.get(), error)); } diff --git a/third_party/WebKit/Source/modules/push_messaging/PushSubscriptionCallbacks.cpp b/third_party/WebKit/Source/modules/push_messaging/PushSubscriptionCallbacks.cpp index c854bee..b36197e 100644 --- a/third_party/WebKit/Source/modules/push_messaging/PushSubscriptionCallbacks.cpp +++ b/third_party/WebKit/Source/modules/push_messaging/PushSubscriptionCallbacks.cpp @@ -26,7 +26,7 @@ PushSubscriptionCallbacks::~PushSubscriptionCallbacks() void PushSubscriptionCallbacks::onSuccess(WebPassOwnPtr<WebPushSubscription> webPushSubscription) { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->resolve(PushSubscription::take(m_resolver.get(), webPushSubscription.release(), m_serviceWorkerRegistration)); @@ -34,7 +34,7 @@ void PushSubscriptionCallbacks::onSuccess(WebPassOwnPtr<WebPushSubscription> web void PushSubscriptionCallbacks::onError(const WebPushError& error) { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->reject(PushError::take(m_resolver.get(), error)); } diff --git a/third_party/WebKit/Source/modules/quota/DeprecatedStorageQuota.cpp b/third_party/WebKit/Source/modules/quota/DeprecatedStorageQuota.cpp index 7756a73..3d4024a 100644 --- a/third_party/WebKit/Source/modules/quota/DeprecatedStorageQuota.cpp +++ b/third_party/WebKit/Source/modules/quota/DeprecatedStorageQuota.cpp @@ -62,7 +62,7 @@ void DeprecatedStorageQuota::queryUsageAndQuota(ExecutionContext* executionConte return; } - SecurityOrigin* securityOrigin = executionContext->securityOrigin(); + SecurityOrigin* securityOrigin = executionContext->getSecurityOrigin(); if (securityOrigin->isUnique()) { executionContext->postTask(BLINK_FROM_HERE, StorageErrorCallback::createSameThreadTask(errorCallback, NotSupportedError)); return; diff --git a/third_party/WebKit/Source/modules/quota/StorageManager.cpp b/third_party/WebKit/Source/modules/quota/StorageManager.cpp index dd7cf49..d35efdf 100644 --- a/third_party/WebKit/Source/modules/quota/StorageManager.cpp +++ b/third_party/WebKit/Source/modules/quota/StorageManager.cpp @@ -75,8 +75,8 @@ ScriptPromise StorageManager::requestPersistent(ScriptState* scriptState) { ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); ScriptPromise promise = resolver->promise(); - ExecutionContext* executionContext = scriptState->executionContext(); - SecurityOrigin* securityOrigin = executionContext->securityOrigin(); + ExecutionContext* executionContext = scriptState->getExecutionContext(); + SecurityOrigin* securityOrigin = executionContext->getSecurityOrigin(); // TODO(dgrogan): Is the isUnique() check covered by the later // isSecureContext() check? If so, maybe remove it. Write a test if it // stays. @@ -95,7 +95,7 @@ ScriptPromise StorageManager::requestPersistent(ScriptState* scriptState) resolver->reject(DOMException::create(InvalidStateError, "In its current state, the global scope can't request permissions.")); return promise; } - permissionClient->requestPermission(WebPermissionTypeDurableStorage, KURL(KURL(), scriptState->executionContext()->securityOrigin()->toString()), new DurableStorageRequestCallbacks(resolver)); + permissionClient->requestPermission(WebPermissionTypeDurableStorage, KURL(KURL(), scriptState->getExecutionContext()->getSecurityOrigin()->toString()), new DurableStorageRequestCallbacks(resolver)); return promise; } @@ -104,12 +104,12 @@ ScriptPromise StorageManager::persistentPermission(ScriptState* scriptState) { ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); ScriptPromise promise = resolver->promise(); - WebPermissionClient* permissionClient = Permissions::getClient(scriptState->executionContext()); + WebPermissionClient* permissionClient = Permissions::getClient(scriptState->getExecutionContext()); if (!permissionClient) { resolver->reject(DOMException::create(InvalidStateError, "In its current state, the global scope can't query permissions.")); return promise; } - permissionClient->queryPermission(WebPermissionTypeDurableStorage, KURL(KURL(), scriptState->executionContext()->securityOrigin()->toString()), new DurableStorageQueryCallbacks(resolver)); + permissionClient->queryPermission(WebPermissionTypeDurableStorage, KURL(KURL(), scriptState->getExecutionContext()->getSecurityOrigin()->toString()), new DurableStorageQueryCallbacks(resolver)); return promise; } diff --git a/third_party/WebKit/Source/modules/quota/StorageQuota.cpp b/third_party/WebKit/Source/modules/quota/StorageQuota.cpp index 9ec34fe..3a92298 100644 --- a/third_party/WebKit/Source/modules/quota/StorageQuota.cpp +++ b/third_party/WebKit/Source/modules/quota/StorageQuota.cpp @@ -86,7 +86,7 @@ ScriptPromise StorageQuota::queryInfo(ScriptState* scriptState, String type) ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); ScriptPromise promise = resolver->promise(); - SecurityOrigin* securityOrigin = scriptState->executionContext()->securityOrigin(); + SecurityOrigin* securityOrigin = scriptState->getExecutionContext()->getSecurityOrigin(); if (securityOrigin->isUnique()) { resolver->reject(DOMError::create(NotSupportedError)); return promise; @@ -100,7 +100,7 @@ ScriptPromise StorageQuota::queryInfo(ScriptState* scriptState, String type) ScriptPromise StorageQuota::requestPersistentQuota(ScriptState* scriptState, unsigned long long newQuota) { - StorageQuotaClient* client = StorageQuotaClient::from(scriptState->executionContext()); + StorageQuotaClient* client = StorageQuotaClient::from(scriptState->getExecutionContext()); if (!client) { ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); ScriptPromise promise = resolver->promise(); diff --git a/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientation.cpp b/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientation.cpp index e0afb08..616b951 100644 --- a/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientation.cpp +++ b/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientation.cpp @@ -123,7 +123,7 @@ const WTF::AtomicString& ScreenOrientation::interfaceName() const return EventTargetNames::ScreenOrientation; } -ExecutionContext* ScreenOrientation::executionContext() const +ExecutionContext* ScreenOrientation::getExecutionContext() const { if (!m_frame) return 0; diff --git a/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientation.h b/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientation.h index a813e36..fa48114 100644 --- a/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientation.h +++ b/third_party/WebKit/Source/modules/screen_orientation/ScreenOrientation.h @@ -34,7 +34,7 @@ public: // EventTarget implementation. const WTF::AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; String type() const; unsigned short angle() const; diff --git a/third_party/WebKit/Source/modules/serviceworkers/InstallEvent.cpp b/third_party/WebKit/Source/modules/serviceworkers/InstallEvent.cpp index 84715af..43feeee 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/InstallEvent.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/InstallEvent.cpp @@ -63,7 +63,7 @@ void InstallEvent::registerForeignFetch(ExecutionContext* executionContext, cons ServiceWorkerGlobalScopeClient* client = ServiceWorkerGlobalScopeClient::from(executionContext); String scopePath = static_cast<KURL>(client->scope()).path(); - RefPtr<SecurityOrigin> origin = executionContext->securityOrigin(); + RefPtr<SecurityOrigin> origin = executionContext->getSecurityOrigin(); if (!options.hasScopes() || options.scopes().isEmpty()) { exceptionState.throwTypeError("At least one scope is required"); diff --git a/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.cpp b/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.cpp index 7bb33cc..8602f43 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.cpp @@ -35,7 +35,7 @@ NavigatorServiceWorker& NavigatorServiceWorker::from(Navigator& navigator) if (!supplement) { supplement = new NavigatorServiceWorker(navigator); provideTo(navigator, supplementName(), supplement); - if (navigator.frame() && navigator.frame()->securityContext()->securityOrigin()->canAccessServiceWorkers()) { + if (navigator.frame() && navigator.frame()->securityContext()->getSecurityOrigin()->canAccessServiceWorkers()) { // Initialize ServiceWorkerContainer too. supplement->serviceWorker(ASSERT_NO_EXCEPTION); } @@ -55,13 +55,13 @@ const char* NavigatorServiceWorker::supplementName() ServiceWorkerContainer* NavigatorServiceWorker::serviceWorker(ExecutionContext* executionContext, Navigator& navigator, ExceptionState& exceptionState) { - ASSERT(!navigator.frame() || executionContext->securityOrigin()->canAccessCheckSuborigins(navigator.frame()->securityContext()->securityOrigin())); + ASSERT(!navigator.frame() || executionContext->getSecurityOrigin()->canAccessCheckSuborigins(navigator.frame()->securityContext()->getSecurityOrigin())); return NavigatorServiceWorker::from(navigator).serviceWorker(exceptionState); } ServiceWorkerContainer* NavigatorServiceWorker::serviceWorker(ExceptionState& exceptionState) { - if (frame() && !frame()->securityContext()->securityOrigin()->canAccessServiceWorkers()) { + if (frame() && !frame()->securityContext()->getSecurityOrigin()->canAccessServiceWorkers()) { if (frame()->securityContext()->isSandboxed(SandboxOrigin)) exceptionState.throwSecurityError("Service worker is disabled because the context is sandboxed and lacks the 'allow-same-origin' flag."); else @@ -70,7 +70,7 @@ ServiceWorkerContainer* NavigatorServiceWorker::serviceWorker(ExceptionState& ex } if (!m_serviceWorker && frame()) { ASSERT(frame()->domWindow()); - m_serviceWorker = ServiceWorkerContainer::create(frame()->domWindow()->executionContext()); + m_serviceWorker = ServiceWorkerContainer::create(frame()->domWindow()->getExecutionContext()); } return m_serviceWorker.get(); } diff --git a/third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.cpp b/third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.cpp index 7d90aee..5c3f91d 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.cpp @@ -122,7 +122,7 @@ private: ASSERT(m_resolveType == Fulfilled || m_resolveType == Rejected); if (m_resolveType == Rejected) { m_observer->responseWasRejected(WebServiceWorkerResponseErrorPromiseRejected); - value = ScriptPromise::reject(value.scriptState(), value).getScriptValue(); + value = ScriptPromise::reject(value.getScriptState(), value).getScriptValue(); } else { m_observer->responseWasFulfilled(value); } @@ -147,7 +147,7 @@ void RespondWithObserver::contextDestroyed() void RespondWithObserver::didDispatchEvent(DispatchEventResult dispatchResult) { - ASSERT(executionContext()); + ASSERT(getExecutionContext()); if (m_state != Initial) return; @@ -156,7 +156,7 @@ void RespondWithObserver::didDispatchEvent(DispatchEventResult dispatchResult) return; } - ServiceWorkerGlobalScopeClient::from(executionContext())->didHandleFetchEvent(m_eventID); + ServiceWorkerGlobalScopeClient::from(getExecutionContext())->didHandleFetchEvent(m_eventID); m_state = Done; } @@ -175,25 +175,25 @@ void RespondWithObserver::respondWith(ScriptState* scriptState, ScriptPromise sc void RespondWithObserver::responseWasRejected(WebServiceWorkerResponseError error) { - ASSERT(executionContext()); - executionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, getMessageForResponseError(error, m_requestURL))); + ASSERT(getExecutionContext()); + getExecutionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, getMessageForResponseError(error, m_requestURL))); // The default value of WebServiceWorkerResponse's status is 0, which maps // to a network error. WebServiceWorkerResponse webResponse; webResponse.setError(error); - ServiceWorkerGlobalScopeClient::from(executionContext())->didHandleFetchEvent(m_eventID, webResponse); + ServiceWorkerGlobalScopeClient::from(getExecutionContext())->didHandleFetchEvent(m_eventID, webResponse); m_state = Done; } void RespondWithObserver::responseWasFulfilled(const ScriptValue& value) { - ASSERT(executionContext()); - if (!V8Response::hasInstance(value.v8Value(), toIsolate(executionContext()))) { + ASSERT(getExecutionContext()); + if (!V8Response::hasInstance(value.v8Value(), toIsolate(getExecutionContext()))) { responseWasRejected(WebServiceWorkerResponseErrorNoV8Instance); return; } - Response* response = V8Response::toImplWithTypeCheck(toIsolate(executionContext()), value.v8Value()); + Response* response = V8Response::toImplWithTypeCheck(toIsolate(getExecutionContext()), value.v8Value()); // "If one of the following conditions is true, return a network error: // - |response|'s type is |error|. // - |request|'s mode is not |no-cors| and response's type is |opaque|. @@ -241,12 +241,12 @@ void RespondWithObserver::responseWasFulfilled(const ScriptValue& value) if (blobDataHandle) { webResponse.setBlobDataHandle(blobDataHandle); } else { - Stream* outStream = Stream::create(executionContext(), ""); + Stream* outStream = Stream::create(getExecutionContext(), ""); webResponse.setStreamURL(outStream->url()); - buffer->startLoading(executionContext(), FetchDataLoader::createLoaderAsStream(outStream), new NoopLoaderClient); + buffer->startLoading(getExecutionContext(), FetchDataLoader::createLoaderAsStream(outStream), new NoopLoaderClient); } } - ServiceWorkerGlobalScopeClient::from(executionContext())->didHandleFetchEvent(m_eventID, webResponse); + ServiceWorkerGlobalScopeClient::from(getExecutionContext())->didHandleFetchEvent(m_eventID, webResponse); m_state = Done; } diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.cpp index 9ad3c6a..8504743 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.cpp @@ -130,7 +130,7 @@ ServiceWorker* ServiceWorker::getOrCreate(ExecutionContext* executionContext, Pa ServiceWorker* existingWorker = static_cast<ServiceWorker*>(handle->serviceWorker()->proxy()); if (existingWorker) { - ASSERT(existingWorker->executionContext() == executionContext); + ASSERT(existingWorker->getExecutionContext() == executionContext); return existingWorker; } diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp index 63a5149..0e458cc 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp @@ -69,7 +69,7 @@ public: void onSuccess(WebPassOwnPtr<WebServiceWorkerClientInfo> webClient) override { OwnPtr<WebServiceWorkerClientInfo> client = webClient.release(); - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; if (!client) { // Resolve the promise with undefined. @@ -81,7 +81,7 @@ public: void onError(const WebServiceWorkerError& error) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->reject(ServiceWorkerError::take(m_resolver.get(), error)); } @@ -104,7 +104,7 @@ ServiceWorkerClients::ServiceWorkerClients() ScriptPromise ServiceWorkerClients::get(ScriptState* scriptState, const String& id) { - ExecutionContext* executionContext = scriptState->executionContext(); + ExecutionContext* executionContext = scriptState->getExecutionContext(); // TODO(jungkees): May be null due to worker termination: http://crbug.com/413518. if (!executionContext) return ScriptPromise(); @@ -118,7 +118,7 @@ ScriptPromise ServiceWorkerClients::get(ScriptState* scriptState, const String& ScriptPromise ServiceWorkerClients::matchAll(ScriptState* scriptState, const ClientQueryOptions& options) { - ExecutionContext* executionContext = scriptState->executionContext(); + ExecutionContext* executionContext = scriptState->getExecutionContext(); // FIXME: May be null due to worker termination: http://crbug.com/413518. if (!executionContext) return ScriptPromise(); @@ -135,7 +135,7 @@ ScriptPromise ServiceWorkerClients::matchAll(ScriptState* scriptState, const Cli ScriptPromise ServiceWorkerClients::claim(ScriptState* scriptState) { - ExecutionContext* executionContext = scriptState->executionContext(); + ExecutionContext* executionContext = scriptState->getExecutionContext(); // FIXME: May be null due to worker termination: http://crbug.com/413518. if (!executionContext) @@ -153,7 +153,7 @@ ScriptPromise ServiceWorkerClients::openWindow(ScriptState* scriptState, const S { ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); ScriptPromise promise = resolver->promise(); - ExecutionContext* context = scriptState->executionContext(); + ExecutionContext* context = scriptState->getExecutionContext(); KURL parsedUrl = KURL(toWorkerGlobalScope(context)->location()->url(), url); if (!parsedUrl.isValid()) { @@ -161,7 +161,7 @@ ScriptPromise ServiceWorkerClients::openWindow(ScriptState* scriptState, const S return promise; } - if (!context->securityOrigin()->canDisplay(parsedUrl)) { + if (!context->getSecurityOrigin()->canDisplay(parsedUrl)) { resolver->reject(V8ThrowException::createTypeError(scriptState->isolate(), "'" + parsedUrl.elidedString() + "' cannot be opened.")); return promise; } diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp index 9b51861..8603e87 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.cpp @@ -66,14 +66,14 @@ public: void onSuccess(WebPassOwnPtr<WebServiceWorkerRegistration::Handle> handle) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; - m_resolver->resolve(ServiceWorkerRegistration::getOrCreate(m_resolver->executionContext(), handle.release())); + m_resolver->resolve(ServiceWorkerRegistration::getOrCreate(m_resolver->getExecutionContext(), handle.release())); } void onError(const WebServiceWorkerError& error) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->reject(ServiceWorkerError::take(m_resolver.get(), error)); } @@ -92,19 +92,19 @@ public: void onSuccess(WebPassOwnPtr<WebServiceWorkerRegistration::Handle> webPassHandle) override { OwnPtr<WebServiceWorkerRegistration::Handle> handle = webPassHandle.release(); - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; if (!handle) { // Resolve the promise with undefined. m_resolver->resolve(); return; } - m_resolver->resolve(ServiceWorkerRegistration::getOrCreate(m_resolver->executionContext(), handle.release())); + m_resolver->resolve(ServiceWorkerRegistration::getOrCreate(m_resolver->getExecutionContext(), handle.release())); } void onError(const WebServiceWorkerError& error) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->reject(ServiceWorkerError::take(m_resolver.get(), error)); } @@ -128,14 +128,14 @@ public: handles.append(adoptPtr(handle)); } - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->resolve(ServiceWorkerRegistrationArray::take(m_resolver.get(), &handles)); } void onError(const WebServiceWorkerError& error) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->reject(ServiceWorkerError::take(m_resolver.get(), error)); } @@ -155,8 +155,8 @@ public: { ASSERT(m_ready->getState() == ReadyProperty::Pending); - if (m_ready->executionContext() && !m_ready->executionContext()->activeDOMObjectsAreStopped()) - m_ready->resolve(ServiceWorkerRegistration::getOrCreate(m_ready->executionContext(), handle.release())); + if (m_ready->getExecutionContext() && !m_ready->getExecutionContext()->activeDOMObjectsAreStopped()) + m_ready->resolve(ServiceWorkerRegistration::getOrCreate(m_ready->getExecutionContext(), handle.release())); } private: @@ -200,12 +200,12 @@ ScriptPromise ServiceWorkerContainer::registerServiceWorker(ScriptState* scriptS return promise; } - ExecutionContext* executionContext = scriptState->executionContext(); + ExecutionContext* executionContext = scriptState->getExecutionContext(); // FIXME: May be null due to worker termination: http://crbug.com/413518. if (!executionContext) return ScriptPromise(); - RefPtr<SecurityOrigin> documentOrigin = executionContext->securityOrigin(); + RefPtr<SecurityOrigin> documentOrigin = executionContext->getSecurityOrigin(); String errorMessage; // Restrict to secure origins: https://w3c.github.io/webappsec/specs/powerfulfeatures/#settings-privileged if (!executionContext->isSecureContext(errorMessage)) { @@ -269,12 +269,12 @@ ScriptPromise ServiceWorkerContainer::getRegistration(ScriptState* scriptState, return promise; } - ExecutionContext* executionContext = scriptState->executionContext(); + ExecutionContext* executionContext = scriptState->getExecutionContext(); // FIXME: May be null due to worker termination: http://crbug.com/413518. if (!executionContext) return ScriptPromise(); - RefPtr<SecurityOrigin> documentOrigin = executionContext->securityOrigin(); + RefPtr<SecurityOrigin> documentOrigin = executionContext->getSecurityOrigin(); String errorMessage; if (!executionContext->isSecureContext(errorMessage)) { resolver->reject(DOMException::create(SecurityError, errorMessage)); @@ -309,8 +309,8 @@ ScriptPromise ServiceWorkerContainer::getRegistrations(ScriptState* scriptState) return promise; } - ExecutionContext* executionContext = scriptState->executionContext(); - RefPtr<SecurityOrigin> documentOrigin = executionContext->securityOrigin(); + ExecutionContext* executionContext = scriptState->getExecutionContext(); + RefPtr<SecurityOrigin> documentOrigin = executionContext->getSecurityOrigin(); String errorMessage; if (!executionContext->isSecureContext(errorMessage)) { resolver->reject(DOMException::create(SecurityError, errorMessage)); @@ -330,12 +330,12 @@ ScriptPromise ServiceWorkerContainer::getRegistrations(ScriptState* scriptState) ServiceWorkerContainer::ReadyProperty* ServiceWorkerContainer::createReadyProperty() { - return new ReadyProperty(executionContext(), this, ReadyProperty::Ready); + return new ReadyProperty(getExecutionContext(), this, ReadyProperty::Ready); } ScriptPromise ServiceWorkerContainer::ready(ScriptState* callerState) { - if (!executionContext()) + if (!getExecutionContext()) return ScriptPromise(); if (!callerState->world().isMainWorld()) { @@ -355,24 +355,24 @@ ScriptPromise ServiceWorkerContainer::ready(ScriptState* callerState) void ServiceWorkerContainer::setController(WebPassOwnPtr<WebServiceWorker::Handle> handle, bool shouldNotifyControllerChange) { - if (!executionContext()) + if (!getExecutionContext()) return; - m_controller = ServiceWorker::from(executionContext(), handle.release()); + m_controller = ServiceWorker::from(getExecutionContext(), handle.release()); if (m_controller) - UseCounter::count(executionContext(), UseCounter::ServiceWorkerControlledPage); + UseCounter::count(getExecutionContext(), UseCounter::ServiceWorkerControlledPage); if (shouldNotifyControllerChange) dispatchEvent(Event::create(EventTypeNames::controllerchange)); } void ServiceWorkerContainer::dispatchMessageEvent(WebPassOwnPtr<WebServiceWorker::Handle> handle, const WebString& message, const WebMessagePortChannelArray& webChannels) { - if (!executionContext() || !executionContext()->executingWindow()) + if (!getExecutionContext() || !getExecutionContext()->executingWindow()) return; - MessagePortArray* ports = MessagePort::toMessagePortArray(executionContext(), webChannels); + MessagePortArray* ports = MessagePort::toMessagePortArray(getExecutionContext(), webChannels); RefPtr<SerializedScriptValue> value = SerializedScriptValueFactory::instance().createFromWire(message); - ServiceWorker* source = ServiceWorker::from(executionContext(), handle.release()); - dispatchEvent(ServiceWorkerMessageEvent::create(ports, value, source, executionContext()->securityOrigin()->toString())); + ServiceWorker* source = ServiceWorker::from(getExecutionContext(), handle.release()); + dispatchEvent(ServiceWorkerMessageEvent::create(ports, value, source, getExecutionContext()->getSecurityOrigin()->toString())); } const AtomicString& ServiceWorkerContainer::interfaceName() const diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.h b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.h index 7430d2c..6365407 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.h +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainer.h @@ -79,7 +79,7 @@ public: void dispatchMessageEvent(WebPassOwnPtr<WebServiceWorker::Handle>, const WebString& message, const WebMessagePortChannelArray&) override; // EventTarget overrides. - ExecutionContext* executionContext() const override { return ContextLifecycleObserver::executionContext(); } + ExecutionContext* getExecutionContext() const override { return ContextLifecycleObserver::getExecutionContext(); } const AtomicString& interfaceName() const override; DEFINE_ATTRIBUTE_EVENT_LISTENER(controllerchange); diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp index cb4e2da..a2409dd 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContainerTest.cpp @@ -158,9 +158,9 @@ protected: V8GCController::collectAllGarbageForTesting(isolate()); } - ExecutionContext* executionContext() { return &(m_page->document()); } + ExecutionContext* getExecutionContext() { return &(m_page->document()); } v8::Isolate* isolate() { return v8::Isolate::GetCurrent(); } - ScriptState* scriptState() { return ScriptState::forMainWorld(m_page->document().frame()); } + ScriptState* getScriptState() { return ScriptState::forMainWorld(m_page->document().frame()); } void provide(PassOwnPtr<WebServiceWorkerProvider> provider) { @@ -182,12 +182,12 @@ protected: // the provider. provide(adoptPtr(new NotReachedWebServiceWorkerProvider())); - ServiceWorkerContainer* container = ServiceWorkerContainer::create(executionContext()); - ScriptState::Scope scriptScope(scriptState()); + ServiceWorkerContainer* container = ServiceWorkerContainer::create(getExecutionContext()); + ScriptState::Scope scriptScope(getScriptState()); RegistrationOptions options; options.setScope(scope); - ScriptPromise promise = container->registerServiceWorker(scriptState(), scriptURL, options); - expectRejected(scriptState(), promise, valueTest); + ScriptPromise promise = container->registerServiceWorker(getScriptState(), scriptURL, options); + expectRejected(getScriptState(), promise, valueTest); container->willBeDetachedFromFrame(); } @@ -196,10 +196,10 @@ protected: { provide(adoptPtr(new NotReachedWebServiceWorkerProvider())); - ServiceWorkerContainer* container = ServiceWorkerContainer::create(executionContext()); - ScriptState::Scope scriptScope(scriptState()); - ScriptPromise promise = container->getRegistration(scriptState(), documentURL); - expectRejected(scriptState(), promise, valueTest); + ServiceWorkerContainer* container = ServiceWorkerContainer::create(getExecutionContext()); + ScriptState::Scope scriptScope(getScriptState()); + ScriptPromise promise = container->getRegistration(getScriptState(), documentURL); + expectRejected(getScriptState(), promise, valueTest); container->willBeDetachedFromFrame(); } @@ -325,14 +325,14 @@ TEST_F(ServiceWorkerContainerTest, RegisterUnregister_NonHttpsSecureOriginDelega StubWebServiceWorkerProvider stubProvider; provide(stubProvider.provider()); - ServiceWorkerContainer* container = ServiceWorkerContainer::create(executionContext()); + ServiceWorkerContainer* container = ServiceWorkerContainer::create(getExecutionContext()); // register { - ScriptState::Scope scriptScope(scriptState()); + ScriptState::Scope scriptScope(getScriptState()); RegistrationOptions options; options.setScope("y/"); - container->registerServiceWorker(scriptState(), "/x/y/worker.js", options); + container->registerServiceWorker(getScriptState(), "/x/y/worker.js", options); EXPECT_EQ(1ul, stubProvider.registerCallCount()); EXPECT_EQ(WebURL(KURL(KURL(), "http://localhost/x/y/")), stubProvider.registerScope()); @@ -349,11 +349,11 @@ TEST_F(ServiceWorkerContainerTest, GetRegistration_OmittedDocumentURLDefaultsToP StubWebServiceWorkerProvider stubProvider; provide(stubProvider.provider()); - ServiceWorkerContainer* container = ServiceWorkerContainer::create(executionContext()); + ServiceWorkerContainer* container = ServiceWorkerContainer::create(getExecutionContext()); { - ScriptState::Scope scriptScope(scriptState()); - container->getRegistration(scriptState(), ""); + ScriptState::Scope scriptScope(getScriptState()); + container->getRegistration(getScriptState(), ""); EXPECT_EQ(1ul, stubProvider.getRegistrationCallCount()); EXPECT_EQ(WebURL(KURL(KURL(), "http://localhost/x/index.html")), stubProvider.getRegistrationURL()); } diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp index 595f827..a0cecf2 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp @@ -130,7 +130,7 @@ void ServiceWorkerGlobalScope::close(ExceptionState& exceptionState) ScriptPromise ServiceWorkerGlobalScope::skipWaiting(ScriptState* scriptState) { - ExecutionContext* executionContext = scriptState->executionContext(); + ExecutionContext* executionContext = scriptState->getExecutionContext(); // FIXME: short-term fix, see details at: https://codereview.chromium.org/535193002/. if (!executionContext) return ScriptPromise(); @@ -144,9 +144,9 @@ ScriptPromise ServiceWorkerGlobalScope::skipWaiting(ScriptState* scriptState) void ServiceWorkerGlobalScope::setRegistration(WebPassOwnPtr<WebServiceWorkerRegistration::Handle> handle) { - if (!executionContext()) + if (!getExecutionContext()) return; - m_registration = ServiceWorkerRegistration::getOrCreate(executionContext(), handle.release()); + m_registration = ServiceWorkerRegistration::getOrCreate(getExecutionContext(), handle.release()); } bool ServiceWorkerGlobalScope::addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillBeRawPtr<EventListener> listener, const EventListenerOptions& options) @@ -203,7 +203,7 @@ void ServiceWorkerGlobalScope::importScripts(const Vector<String>& urls, Excepti // and get added to and retrieved from the ServiceWorker's script cache. // FIXME: Revisit in light of the solution to crbug/388375. for (Vector<String>::const_iterator it = urls.begin(); it != urls.end(); ++it) - executionContext()->removeURLFromMemoryCache(completeURL(*it)); + getExecutionContext()->removeURLFromMemoryCache(completeURL(*it)); WorkerGlobalScope::importScripts(urls, exceptionState); } diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp index 7d7dbb4..0f23f8f 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp @@ -30,23 +30,23 @@ void ServiceWorkerRegistration::dispatchUpdateFoundEvent() void ServiceWorkerRegistration::setInstalling(WebPassOwnPtr<WebServiceWorker::Handle> handle) { - if (!executionContext()) + if (!getExecutionContext()) return; - m_installing = ServiceWorker::from(executionContext(), handle.release()); + m_installing = ServiceWorker::from(getExecutionContext(), handle.release()); } void ServiceWorkerRegistration::setWaiting(WebPassOwnPtr<WebServiceWorker::Handle> handle) { - if (!executionContext()) + if (!getExecutionContext()) return; - m_waiting = ServiceWorker::from(executionContext(), handle.release()); + m_waiting = ServiceWorker::from(getExecutionContext(), handle.release()); } void ServiceWorkerRegistration::setActive(WebPassOwnPtr<WebServiceWorker::Handle> handle) { - if (!executionContext()) + if (!getExecutionContext()) return; - m_active = ServiceWorker::from(executionContext(), handle.release()); + m_active = ServiceWorker::from(getExecutionContext(), handle.release()); } ServiceWorkerRegistration* ServiceWorkerRegistration::getOrCreate(ExecutionContext* executionContext, PassOwnPtr<WebServiceWorkerRegistration::Handle> handle) @@ -55,7 +55,7 @@ ServiceWorkerRegistration* ServiceWorkerRegistration::getOrCreate(ExecutionConte ServiceWorkerRegistration* existingRegistration = static_cast<ServiceWorkerRegistration*>(handle->registration()->proxy()); if (existingRegistration) { - ASSERT(existingRegistration->executionContext() == executionContext); + ASSERT(existingRegistration->getExecutionContext() == executionContext); return existingRegistration; } diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.h b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.h index 3325a8d..b28a3c2 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.h +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.h @@ -38,7 +38,7 @@ class ServiceWorkerRegistration final public: // EventTarget overrides. const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override { return ActiveDOMObject::executionContext(); } + ExecutionContext* getExecutionContext() const override { return ActiveDOMObject::getExecutionContext(); } // WebServiceWorkerRegistrationProxy overrides. void dispatchUpdateFoundEvent() override; @@ -94,7 +94,7 @@ public: { HeapVector<Member<ServiceWorkerRegistration>> registrations; for (auto& registration : *webServiceWorkerRegistrations) - registrations.append(ServiceWorkerRegistration::getOrCreate(resolver->executionContext(), registration.release())); + registrations.append(ServiceWorkerRegistration::getOrCreate(resolver->getExecutionContext(), registration.release())); return registrations; } }; diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp index e4de294..3bf05a0 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp @@ -50,13 +50,13 @@ ScriptPromise ServiceWorkerWindowClient::focus(ScriptState* scriptState) ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); ScriptPromise promise = resolver->promise(); - if (!scriptState->executionContext()->isWindowInteractionAllowed()) { + if (!scriptState->getExecutionContext()->isWindowInteractionAllowed()) { resolver->reject(DOMException::create(InvalidAccessError, "Not allowed to focus a window.")); return promise; } - scriptState->executionContext()->consumeWindowInteraction(); + scriptState->getExecutionContext()->consumeWindowInteraction(); - ServiceWorkerGlobalScopeClient::from(scriptState->executionContext())->focus(uuid(), new CallbackPromiseAdapter<ServiceWorkerWindowClient, ServiceWorkerError>(resolver)); + ServiceWorkerGlobalScopeClient::from(scriptState->getExecutionContext())->focus(uuid(), new CallbackPromiseAdapter<ServiceWorkerWindowClient, ServiceWorkerError>(resolver)); return promise; } @@ -64,14 +64,14 @@ ScriptPromise ServiceWorkerWindowClient::navigate(ScriptState* scriptState, cons { ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); ScriptPromise promise = resolver->promise(); - ExecutionContext* context = scriptState->executionContext(); + ExecutionContext* context = scriptState->getExecutionContext(); KURL parsedUrl = KURL(toWorkerGlobalScope(context)->location()->url(), url); if (!parsedUrl.isValid() || parsedUrl.protocolIsAbout()) { resolver->reject(V8ThrowException::createTypeError(scriptState->isolate(), "'" + url + "' is not a valid URL.")); return promise; } - if (!context->securityOrigin()->canDisplay(parsedUrl)) { + if (!context->getSecurityOrigin()->canDisplay(parsedUrl)) { resolver->reject(V8ThrowException::createTypeError(scriptState->isolate(), "'" + parsedUrl.elidedString() + "' cannot navigate.")); return promise; } diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClientCallback.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClientCallback.cpp index f773917..f6387fc 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClientCallback.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerWindowClientCallback.cpp @@ -13,19 +13,19 @@ namespace blink { void NavigateClientCallback::onSuccess(WebPassOwnPtr<WebServiceWorkerClientInfo> clientInfo) { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->resolve(ServiceWorkerWindowClient::take(m_resolver.get(), clientInfo.release())); } void NavigateClientCallback::onError(const WebServiceWorkerError& error) { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; if (error.errorType == WebServiceWorkerError::ErrorTypeNavigation) { - ScriptState::Scope scope(m_resolver->scriptState()); - m_resolver->reject(V8ThrowException::createTypeError(m_resolver->scriptState()->isolate(), error.message)); + ScriptState::Scope scope(m_resolver->getScriptState()); + m_resolver->reject(V8ThrowException::createTypeError(m_resolver->getScriptState()->isolate(), error.message)); return; } diff --git a/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.cpp b/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.cpp index 53c60d2..4da54ff 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.cpp @@ -69,7 +69,7 @@ private: ASSERT(m_resolveType == Fulfilled || m_resolveType == Rejected); if (m_resolveType == Rejected) { m_observer->reportError(value); - value = ScriptPromise::reject(value.scriptState(), value).getScriptValue(); + value = ScriptPromise::reject(value.getScriptState(), value).getScriptValue(); } m_observer->decrementPendingActivity(); m_observer = nullptr; @@ -93,7 +93,7 @@ void WaitUntilObserver::willDispatchEvent() // waitUntil() isn't called, that means between willDispatchEvent() and // didDispatchEvent(). if (m_type == NotificationClick) - executionContext()->allowWindowInteraction(); + getExecutionContext()->allowWindowInteraction(); incrementPendingActivity(); } @@ -113,7 +113,7 @@ void WaitUntilObserver::waitUntil(ScriptState* scriptState, ScriptPromise script return; } - if (!executionContext()) + if (!getExecutionContext()) return; // When handling a notificationclick event, we want to allow one window to @@ -157,10 +157,10 @@ void WaitUntilObserver::incrementPendingActivity() void WaitUntilObserver::decrementPendingActivity() { ASSERT(m_pendingActivity > 0); - if (!executionContext() || (!m_hasError && --m_pendingActivity)) + if (!getExecutionContext() || (!m_hasError && --m_pendingActivity)) return; - ServiceWorkerGlobalScopeClient* client = ServiceWorkerGlobalScopeClient::from(executionContext()); + ServiceWorkerGlobalScopeClient* client = ServiceWorkerGlobalScopeClient::from(getExecutionContext()); WebServiceWorkerEventResult result = m_hasError ? WebServiceWorkerEventResultRejected : WebServiceWorkerEventResultCompleted; switch (m_type) { case Activate: @@ -192,9 +192,9 @@ void WaitUntilObserver::decrementPendingActivity() void WaitUntilObserver::consumeWindowInteraction(Timer<WaitUntilObserver>*) { - if (!executionContext()) + if (!getExecutionContext()) return; - executionContext()->consumeWindowInteraction(); + getExecutionContext()->consumeWindowInteraction(); } DEFINE_TRACE(WaitUntilObserver) diff --git a/third_party/WebKit/Source/modules/speech/DOMWindowSpeechSynthesis.cpp b/third_party/WebKit/Source/modules/speech/DOMWindowSpeechSynthesis.cpp index 0fe2b96..a3d2118 100644 --- a/third_party/WebKit/Source/modules/speech/DOMWindowSpeechSynthesis.cpp +++ b/third_party/WebKit/Source/modules/speech/DOMWindowSpeechSynthesis.cpp @@ -68,7 +68,7 @@ SpeechSynthesis* DOMWindowSpeechSynthesis::speechSynthesis(DOMWindow& window) SpeechSynthesis* DOMWindowSpeechSynthesis::speechSynthesis() { if (!m_speechSynthesis && frame()) - m_speechSynthesis = SpeechSynthesis::create(frame()->domWindow()->executionContext()); + m_speechSynthesis = SpeechSynthesis::create(frame()->domWindow()->getExecutionContext()); return m_speechSynthesis; } diff --git a/third_party/WebKit/Source/modules/speech/SpeechRecognition.cpp b/third_party/WebKit/Source/modules/speech/SpeechRecognition.cpp index 8bc405d..90b0c97 100644 --- a/third_party/WebKit/Source/modules/speech/SpeechRecognition.cpp +++ b/third_party/WebKit/Source/modules/speech/SpeechRecognition.cpp @@ -156,9 +156,9 @@ const AtomicString& SpeechRecognition::interfaceName() const return EventTargetNames::SpeechRecognition; } -ExecutionContext* SpeechRecognition::executionContext() const +ExecutionContext* SpeechRecognition::getExecutionContext() const { - return ActiveDOMObject::executionContext(); + return ActiveDOMObject::getExecutionContext(); } void SpeechRecognition::stop() diff --git a/third_party/WebKit/Source/modules/speech/SpeechRecognition.h b/third_party/WebKit/Source/modules/speech/SpeechRecognition.h index 6321aa6..a216bbf 100644 --- a/third_party/WebKit/Source/modules/speech/SpeechRecognition.h +++ b/third_party/WebKit/Source/modules/speech/SpeechRecognition.h @@ -88,7 +88,7 @@ public: // EventTarget. const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; // ActiveDOMObject. bool hasPendingActivity() const override; diff --git a/third_party/WebKit/Source/modules/speech/SpeechSynthesis.cpp b/third_party/WebKit/Source/modules/speech/SpeechSynthesis.cpp index bb2de9a..5831f43 100644 --- a/third_party/WebKit/Source/modules/speech/SpeechSynthesis.cpp +++ b/third_party/WebKit/Source/modules/speech/SpeechSynthesis.cpp @@ -49,15 +49,15 @@ void SpeechSynthesis::setPlatformSynthesizer(PlatformSpeechSynthesizer* synthesi m_platformSpeechSynthesizer = synthesizer; } -ExecutionContext* SpeechSynthesis::executionContext() const +ExecutionContext* SpeechSynthesis::getExecutionContext() const { - return ContextLifecycleObserver::executionContext(); + return ContextLifecycleObserver::getExecutionContext(); } void SpeechSynthesis::voicesDidChange() { m_voiceList.clear(); - if (executionContext() && !executionContext()->activeDOMObjectsAreStopped()) + if (getExecutionContext() && !getExecutionContext()->activeDOMObjectsAreStopped()) dispatchEvent(Event::create(EventTypeNames::voiceschanged)); } @@ -139,7 +139,7 @@ void SpeechSynthesis::resume() void SpeechSynthesis::fireEvent(const AtomicString& type, SpeechSynthesisUtterance* utterance, unsigned long charIndex, const String& name) { - if (executionContext() && !executionContext()->activeDOMObjectsAreStopped()) + if (getExecutionContext() && !getExecutionContext()->activeDOMObjectsAreStopped()) utterance->dispatchEvent(SpeechSynthesisEvent::create(type, utterance, charIndex, (currentTime() - utterance->startTime()), name)); } diff --git a/third_party/WebKit/Source/modules/speech/SpeechSynthesis.h b/third_party/WebKit/Source/modules/speech/SpeechSynthesis.h index 50284c4..49e2b5f 100644 --- a/third_party/WebKit/Source/modules/speech/SpeechSynthesis.h +++ b/third_party/WebKit/Source/modules/speech/SpeechSynthesis.h @@ -62,7 +62,7 @@ public: DEFINE_ATTRIBUTE_EVENT_LISTENER(voiceschanged); - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; DECLARE_VIRTUAL_TRACE(); diff --git a/third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.cpp b/third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.cpp index 21cd0e2..5809759 100644 --- a/third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.cpp +++ b/third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.cpp @@ -43,9 +43,9 @@ SpeechSynthesisUtterance::~SpeechSynthesisUtterance() { } -ExecutionContext* SpeechSynthesisUtterance::executionContext() const +ExecutionContext* SpeechSynthesisUtterance::getExecutionContext() const { - return ContextLifecycleObserver::executionContext(); + return ContextLifecycleObserver::getExecutionContext(); } const AtomicString& SpeechSynthesisUtterance::interfaceName() const diff --git a/third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.h b/third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.h index b040fdd..2df34c8 100644 --- a/third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.h +++ b/third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.h @@ -72,7 +72,7 @@ public: DEFINE_ATTRIBUTE_EVENT_LISTENER(mark); DEFINE_ATTRIBUTE_EVENT_LISTENER(boundary); - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; PlatformSpeechSynthesisUtterance* platformUtterance() const { return m_platformUtterance; } diff --git a/third_party/WebKit/Source/modules/storage/DOMWindowStorage.cpp b/third_party/WebKit/Source/modules/storage/DOMWindowStorage.cpp index f197df5..878a11e 100644 --- a/third_party/WebKit/Source/modules/storage/DOMWindowStorage.cpp +++ b/third_party/WebKit/Source/modules/storage/DOMWindowStorage.cpp @@ -73,7 +73,7 @@ Storage* DOMWindowStorage::sessionStorage(ExceptionState& exceptionState) const return nullptr; String accessDeniedMessage = "Access is denied for this document."; - if (!document->securityOrigin()->canAccessLocalStorage()) { + if (!document->getSecurityOrigin()->canAccessLocalStorage()) { if (document->isSandboxed(SandboxOrigin)) exceptionState.throwSecurityError("The document is sandboxed and lacks the 'allow-same-origin' flag."); else if (document->url().protocolIs("data")) @@ -95,7 +95,7 @@ Storage* DOMWindowStorage::sessionStorage(ExceptionState& exceptionState) const if (!page) return nullptr; - StorageArea* storageArea = StorageNamespaceController::from(page)->sessionStorage()->storageArea(document->securityOrigin()); + StorageArea* storageArea = StorageNamespaceController::from(page)->sessionStorage()->storageArea(document->getSecurityOrigin()); if (!storageArea->canAccessStorage(m_window->frame())) { exceptionState.throwSecurityError(accessDeniedMessage); return nullptr; @@ -113,7 +113,7 @@ Storage* DOMWindowStorage::localStorage(ExceptionState& exceptionState) const if (!document) return nullptr; String accessDeniedMessage = "Access is denied for this document."; - if (!document->securityOrigin()->canAccessLocalStorage()) { + if (!document->getSecurityOrigin()->canAccessLocalStorage()) { if (document->isSandboxed(SandboxOrigin)) exceptionState.throwSecurityError("The document is sandboxed and lacks the 'allow-same-origin' flag."); else if (document->url().protocolIs("data")) @@ -133,7 +133,7 @@ Storage* DOMWindowStorage::localStorage(ExceptionState& exceptionState) const FrameHost* host = document->frameHost(); if (!host || !host->settings().localStorageEnabled()) return nullptr; - StorageArea* storageArea = StorageNamespace::localStorageArea(document->securityOrigin()); + StorageArea* storageArea = StorageNamespace::localStorageArea(document->getSecurityOrigin()); if (!storageArea->canAccessStorage(m_window->frame())) { exceptionState.throwSecurityError(accessDeniedMessage); return nullptr; diff --git a/third_party/WebKit/Source/modules/storage/InspectorDOMStorageAgent.cpp b/third_party/WebKit/Source/modules/storage/InspectorDOMStorageAgent.cpp index 6742f98..fb02193 100644 --- a/third_party/WebKit/Source/modules/storage/InspectorDOMStorageAgent.cpp +++ b/third_party/WebKit/Source/modules/storage/InspectorDOMStorageAgent.cpp @@ -209,14 +209,14 @@ StorageArea* InspectorDOMStorageAgent::findStorageArea(ErrorString* errorString, targetFrame = frame; if (isLocalStorage) - return StorageNamespace::localStorageArea(frame->document()->securityOrigin()); + return StorageNamespace::localStorageArea(frame->document()->getSecurityOrigin()); StorageNamespace* sessionStorage = StorageNamespaceController::from(m_page)->sessionStorage(); if (!sessionStorage) { if (errorString) *errorString = "SessionStorage is not supported"; return nullptr; } - return sessionStorage->storageArea(frame->document()->securityOrigin()); + return sessionStorage->storageArea(frame->document()->getSecurityOrigin()); } } // namespace blink diff --git a/third_party/WebKit/Source/modules/storage/StorageArea.cpp b/third_party/WebKit/Source/modules/storage/StorageArea.cpp index 3cd8235..c92f402 100644 --- a/third_party/WebKit/Source/modules/storage/StorageArea.cpp +++ b/third_party/WebKit/Source/modules/storage/StorageArea.cpp @@ -147,7 +147,7 @@ bool StorageArea::canAccessStorage(LocalFrame* frame) StorageNamespaceController* controller = StorageNamespaceController::from(frame->page()); if (!controller) return false; - bool result = controller->storageClient()->canAccessStorage(frame, m_storageType); + bool result = controller->getStorageClient()->canAccessStorage(frame, m_storageType); // Move attention to the new LocalFrame. LocalFrameLifecycleObserver::setContext(frame); m_canAccessStorageCachedResult = result; @@ -165,7 +165,7 @@ void StorageArea::dispatchLocalStorageEvent(const String& key, const String& old LocalFrame* localFrame = toLocalFrame(frame); LocalDOMWindow* localWindow = localFrame->localDOMWindow(); Storage* storage = DOMWindowStorage::from(*localWindow).optionalLocalStorage(); - if (storage && localFrame->document()->securityOrigin()->canAccess(securityOrigin) && !isEventSource(storage, sourceAreaInstance)) + if (storage && localFrame->document()->getSecurityOrigin()->canAccess(securityOrigin) && !isEventSource(storage, sourceAreaInstance)) localFrame->localDOMWindow()->enqueueWindowEvent(StorageEvent::create(EventTypeNames::storage, key, oldValue, newValue, pageURL, storage)); } if (InspectorDOMStorageAgent* agent = StorageNamespaceController::from(page)->inspectorAgent()) @@ -198,7 +198,7 @@ void StorageArea::dispatchSessionStorageEvent(const String& key, const String& o LocalFrame* localFrame = toLocalFrame(frame); LocalDOMWindow* localWindow = localFrame->localDOMWindow(); Storage* storage = DOMWindowStorage::from(*localWindow).optionalSessionStorage(); - if (storage && localFrame->document()->securityOrigin()->canAccess(securityOrigin) && !isEventSource(storage, sourceAreaInstance)) + if (storage && localFrame->document()->getSecurityOrigin()->canAccess(securityOrigin) && !isEventSource(storage, sourceAreaInstance)) localFrame->localDOMWindow()->enqueueWindowEvent(StorageEvent::create(EventTypeNames::storage, key, oldValue, newValue, pageURL, storage)); } if (InspectorDOMStorageAgent* agent = StorageNamespaceController::from(page)->inspectorAgent()) diff --git a/third_party/WebKit/Source/modules/storage/StorageNamespaceController.h b/third_party/WebKit/Source/modules/storage/StorageNamespaceController.h index 849bcb6..93dd6cb 100644 --- a/third_party/WebKit/Source/modules/storage/StorageNamespaceController.h +++ b/third_party/WebKit/Source/modules/storage/StorageNamespaceController.h @@ -21,7 +21,7 @@ class MODULES_EXPORT StorageNamespaceController final : public NoBaseWillBeGarba USING_FAST_MALLOC_WILL_BE_REMOVED(StorageNamespaceController); public: StorageNamespace* sessionStorage(bool optionalCreate = true); - StorageClient* storageClient() { return m_client; } + StorageClient* getStorageClient() { return m_client; } ~StorageNamespaceController(); static void provideStorageNamespaceTo(Page&, StorageClient*); diff --git a/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.cpp index 4762dad..77e33cf 100644 --- a/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.cpp @@ -746,8 +746,8 @@ void AbstractAudioContext::setContextState(AudioContextState newState) m_contextState = newState; // Notify context that state changed - if (executionContext()) - executionContext()->postTask(BLINK_FROM_HERE, createSameThreadTask(&AbstractAudioContext::notifyStateChange, this)); + if (getExecutionContext()) + getExecutionContext()->postTask(BLINK_FROM_HERE, createSameThreadTask(&AbstractAudioContext::notifyStateChange, this)); } void AbstractAudioContext::notifyStateChange() @@ -904,9 +904,9 @@ const AtomicString& AbstractAudioContext::interfaceName() const return EventTargetNames::AudioContext; } -ExecutionContext* AbstractAudioContext::executionContext() const +ExecutionContext* AbstractAudioContext::getExecutionContext() const { - return ActiveDOMObject::executionContext(); + return ActiveDOMObject::getExecutionContext(); } void AbstractAudioContext::startRendering() @@ -944,10 +944,10 @@ DEFINE_TRACE(AbstractAudioContext) ActiveDOMObject::trace(visitor); } -SecurityOrigin* AbstractAudioContext::securityOrigin() const +SecurityOrigin* AbstractAudioContext::getSecurityOrigin() const { - if (executionContext()) - return executionContext()->securityOrigin(); + if (getExecutionContext()) + return getExecutionContext()->getSecurityOrigin(); return nullptr; } diff --git a/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h b/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h index 8ca7f63..ee3a493 100644 --- a/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h +++ b/third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h @@ -237,7 +237,7 @@ public: // EventTarget const AtomicString& interfaceName() const final; - ExecutionContext* executionContext() const final; + ExecutionContext* getExecutionContext() const final; DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); @@ -250,7 +250,7 @@ public: virtual bool isContextClosed() const { return m_isCleared; } // Get the security origin for this audio context. - SecurityOrigin* securityOrigin() const; + SecurityOrigin* getSecurityOrigin() const; // Get the PeriodicWave for the specified oscillator type. The table is initialized internally // if necessary. diff --git a/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp b/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp index ef366e8..a4c84b5 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioNode.cpp @@ -926,9 +926,9 @@ const AtomicString& AudioNode::interfaceName() const return EventTargetNames::AudioNode; } -ExecutionContext* AudioNode::executionContext() const +ExecutionContext* AudioNode::getExecutionContext() const { - return context()->executionContext(); + return context()->getExecutionContext(); } void AudioNode::didAddOutput(unsigned numberOfOutputs) diff --git a/third_party/WebKit/Source/modules/webaudio/AudioNode.h b/third_party/WebKit/Source/modules/webaudio/AudioNode.h index 7f0d35e..ee6aff5 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioNode.h +++ b/third_party/WebKit/Source/modules/webaudio/AudioNode.h @@ -303,7 +303,7 @@ public: // EventTarget const AtomicString& interfaceName() const final; - ExecutionContext* executionContext() const final; + ExecutionContext* getExecutionContext() const final; // Called inside AudioHandler constructors. void didAddOutput(unsigned numberOfOutputs); diff --git a/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp b/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp index 460eded..fc79f6e 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioScheduledSourceNode.cpp @@ -209,8 +209,8 @@ void AudioScheduledSourceHandler::finish() { finishWithoutOnEnded(); - if (context()->executionContext()) { - context()->executionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&AudioScheduledSourceHandler::notifyEnded, PassRefPtr<AudioScheduledSourceHandler>(this))); + if (context()->getExecutionContext()) { + context()->getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&AudioScheduledSourceHandler::notifyEnded, PassRefPtr<AudioScheduledSourceHandler>(this))); } } diff --git a/third_party/WebKit/Source/modules/webaudio/BiquadDSPKernel.cpp b/third_party/WebKit/Source/modules/webaudio/BiquadDSPKernel.cpp index e75a3ae..15f24e6 100644 --- a/third_party/WebKit/Source/modules/webaudio/BiquadDSPKernel.cpp +++ b/third_party/WebKit/Source/modules/webaudio/BiquadDSPKernel.cpp @@ -38,7 +38,7 @@ static const double MaxBiquadDelayTime = 0.2; void BiquadDSPKernel::updateCoefficientsIfNecessary(int framesToProcess) { - if (biquadProcessor()->filterCoefficientsDirty()) { + if (getBiquadProcessor()->filterCoefficientsDirty()) { float cutoffFrequency[AudioUtilities::kRenderQuantumFrames]; float Q[AudioUtilities::kRenderQuantumFrames]; float gain[AudioUtilities::kRenderQuantumFrames]; @@ -47,17 +47,17 @@ void BiquadDSPKernel::updateCoefficientsIfNecessary(int framesToProcess) RELEASE_ASSERT_WITH_SECURITY_IMPLICATION( static_cast<unsigned>(framesToProcess) <= AudioUtilities::kRenderQuantumFrames); - if (biquadProcessor()->hasSampleAccurateValues()) { - biquadProcessor()->parameter1().calculateSampleAccurateValues(cutoffFrequency, framesToProcess); - biquadProcessor()->parameter2().calculateSampleAccurateValues(Q, framesToProcess); - biquadProcessor()->parameter3().calculateSampleAccurateValues(gain, framesToProcess); - biquadProcessor()->parameter4().calculateSampleAccurateValues(detune, framesToProcess); + if (getBiquadProcessor()->hasSampleAccurateValues()) { + getBiquadProcessor()->parameter1().calculateSampleAccurateValues(cutoffFrequency, framesToProcess); + getBiquadProcessor()->parameter2().calculateSampleAccurateValues(Q, framesToProcess); + getBiquadProcessor()->parameter3().calculateSampleAccurateValues(gain, framesToProcess); + getBiquadProcessor()->parameter4().calculateSampleAccurateValues(detune, framesToProcess); updateCoefficients(framesToProcess, cutoffFrequency, Q, gain, detune); } else { - cutoffFrequency[0] = biquadProcessor()->parameter1().smoothedValue(); - Q[0] = biquadProcessor()->parameter2().smoothedValue(); - gain[0] = biquadProcessor()->parameter3().smoothedValue(); - detune[0] = biquadProcessor()->parameter4().smoothedValue(); + cutoffFrequency[0] = getBiquadProcessor()->parameter1().smoothedValue(); + Q[0] = getBiquadProcessor()->parameter2().smoothedValue(); + gain[0] = getBiquadProcessor()->parameter3().smoothedValue(); + detune[0] = getBiquadProcessor()->parameter4().smoothedValue(); updateCoefficients(1, cutoffFrequency, Q, gain, detune); } } @@ -78,7 +78,7 @@ void BiquadDSPKernel::updateCoefficients(int numberOfFrames, const float* cutoff normalizedFrequency *= pow(2, detune[k] / 1200); // Configure the biquad with the new filter parameters for the appropriate type of filter. - switch (biquadProcessor()->type()) { + switch (getBiquadProcessor()->type()) { case BiquadProcessor::LowPass: m_biquad.setLowpassParams(k, normalizedFrequency, Q[k]); break; @@ -118,7 +118,7 @@ void BiquadDSPKernel::process(const float* source, float* destination, size_t fr { ASSERT(source); ASSERT(destination); - ASSERT(biquadProcessor()); + ASSERT(getBiquadProcessor()); // Recompute filter coefficients if any of the parameters have changed. // FIXME: as an optimization, implement a way that a Biquad object can simply copy its internal filter coefficients from another Biquad object. @@ -172,10 +172,10 @@ void BiquadDSPKernel::getFrequencyResponse(int nFrequencies, const float* freque // FIXME: Simplify this: crbug.com/390266 MutexLocker processLocker(m_processLock); - cutoffFrequency = biquadProcessor()->parameter1().value(); - Q = biquadProcessor()->parameter2().value(); - gain = biquadProcessor()->parameter3().value(); - detune = biquadProcessor()->parameter4().value(); + cutoffFrequency = getBiquadProcessor()->parameter1().value(); + Q = getBiquadProcessor()->parameter2().value(); + gain = getBiquadProcessor()->parameter3().value(); + detune = getBiquadProcessor()->parameter4().value(); } updateCoefficients(1, &cutoffFrequency, &Q, &gain, &detune); diff --git a/third_party/WebKit/Source/modules/webaudio/BiquadDSPKernel.h b/third_party/WebKit/Source/modules/webaudio/BiquadDSPKernel.h index 971ef5e..26dd73b 100644 --- a/third_party/WebKit/Source/modules/webaudio/BiquadDSPKernel.h +++ b/third_party/WebKit/Source/modules/webaudio/BiquadDSPKernel.h @@ -55,7 +55,7 @@ public: protected: Biquad m_biquad; - BiquadProcessor* biquadProcessor() { return static_cast<BiquadProcessor*>(processor()); } + BiquadProcessor* getBiquadProcessor() { return static_cast<BiquadProcessor*>(processor()); } // To prevent audio glitches when parameters are changed, // dezippering is used to slowly change the parameters. diff --git a/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.cpp b/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.cpp index abea4f4..45a2fc7 100644 --- a/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.cpp @@ -46,14 +46,14 @@ DEFINE_TRACE(BiquadFilterNode) AudioNode::trace(visitor); } -BiquadProcessor* BiquadFilterNode::biquadProcessor() const +BiquadProcessor* BiquadFilterNode::getBiquadProcessor() const { return static_cast<BiquadProcessor*>(static_cast<AudioBasicProcessorHandler&>(handler()).processor()); } String BiquadFilterNode::type() const { - switch (const_cast<BiquadFilterNode*>(this)->biquadProcessor()->type()) { + switch (const_cast<BiquadFilterNode*>(this)->getBiquadProcessor()->type()) { case BiquadProcessor::LowPass: return "lowpass"; case BiquadProcessor::HighPass: @@ -101,7 +101,7 @@ bool BiquadFilterNode::setType(unsigned type) if (type > BiquadProcessor::Allpass) return false; - biquadProcessor()->setType(static_cast<BiquadProcessor::FilterType>(type)); + getBiquadProcessor()->setType(static_cast<BiquadProcessor::FilterType>(type)); return true; } @@ -111,7 +111,7 @@ void BiquadFilterNode::getFrequencyResponse(const DOMFloat32Array* frequencyHz, int n = std::min(frequencyHz->length(), std::min(magResponse->length(), phaseResponse->length())); if (n) - biquadProcessor()->getFrequencyResponse(n, frequencyHz->data(), magResponse->data(), phaseResponse->data()); + getBiquadProcessor()->getFrequencyResponse(n, frequencyHz->data(), magResponse->data(), phaseResponse->data()); } } // namespace blink diff --git a/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.h b/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.h index ad8ea74..1119629 100644 --- a/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.h +++ b/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.h @@ -70,7 +70,7 @@ public: private: BiquadFilterNode(AbstractAudioContext&, float sampleRate); - BiquadProcessor* biquadProcessor() const; + BiquadProcessor* getBiquadProcessor() const; bool setType(unsigned); // Returns true on success. Member<AudioParam> m_frequency; diff --git a/third_party/WebKit/Source/modules/webaudio/DefaultAudioDestinationNode.cpp b/third_party/WebKit/Source/modules/webaudio/DefaultAudioDestinationNode.cpp index 2bfb443..5321e32 100644 --- a/third_party/WebKit/Source/modules/webaudio/DefaultAudioDestinationNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/DefaultAudioDestinationNode.cpp @@ -85,7 +85,7 @@ void DefaultAudioDestinationHandler::createDestination() float hardwareSampleRate = AudioDestination::hardwareSampleRate(); WTF_LOG(WebAudio, ">>>> hardwareSampleRate = %f\n", hardwareSampleRate); - m_destination = AudioDestination::create(*this, m_inputDeviceId, m_numberOfInputChannels, channelCount(), hardwareSampleRate, context()->securityOrigin()); + m_destination = AudioDestination::create(*this, m_inputDeviceId, m_numberOfInputChannels, channelCount(), hardwareSampleRate, context()->getSecurityOrigin()); } void DefaultAudioDestinationHandler::startRendering() diff --git a/third_party/WebKit/Source/modules/webaudio/DelayDSPKernel.cpp b/third_party/WebKit/Source/modules/webaudio/DelayDSPKernel.cpp index 001a5f73..784621b 100644 --- a/third_party/WebKit/Source/modules/webaudio/DelayDSPKernel.cpp +++ b/third_party/WebKit/Source/modules/webaudio/DelayDSPKernel.cpp @@ -53,17 +53,17 @@ DelayDSPKernel::DelayDSPKernel(DelayProcessor* processor) bool DelayDSPKernel::hasSampleAccurateValues() { - return delayProcessor()->delayTime().hasSampleAccurateValues(); + return getDelayProcessor()->delayTime().hasSampleAccurateValues(); } void DelayDSPKernel::calculateSampleAccurateValues(float* delayTimes, size_t framesToProcess) { - delayProcessor()->delayTime().calculateSampleAccurateValues(delayTimes, framesToProcess); + getDelayProcessor()->delayTime().calculateSampleAccurateValues(delayTimes, framesToProcess); } double DelayDSPKernel::delayTime(float) { - return delayProcessor()->delayTime().finalValue(); + return getDelayProcessor()->delayTime().finalValue(); } } // namespace blink diff --git a/third_party/WebKit/Source/modules/webaudio/DelayDSPKernel.h b/third_party/WebKit/Source/modules/webaudio/DelayDSPKernel.h index dba31b6..d7871b1 100644 --- a/third_party/WebKit/Source/modules/webaudio/DelayDSPKernel.h +++ b/third_party/WebKit/Source/modules/webaudio/DelayDSPKernel.h @@ -42,7 +42,7 @@ protected: double delayTime(float sampleRate) override; private: - DelayProcessor* delayProcessor() { return static_cast<DelayProcessor*>(processor()); } + DelayProcessor* getDelayProcessor() { return static_cast<DelayProcessor*>(processor()); } }; } // namespace blink diff --git a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp index a04a056..9750a6b 100644 --- a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.cpp @@ -135,13 +135,13 @@ void MediaElementAudioSourceHandler::onCurrentSrcChanged(const KURL& currentSrc) bool MediaElementAudioSourceHandler::passesCurrentSrcCORSAccessCheck(const KURL& currentSrc) { ASSERT(isMainThread()); - return context()->securityOrigin() && context()->securityOrigin()->canRequest(currentSrc); + return context()->getSecurityOrigin() && context()->getSecurityOrigin()->canRequest(currentSrc); } void MediaElementAudioSourceHandler::printCORSMessage(const String& message) { - if (context()->executionContext()) { - context()->executionContext()->addConsoleMessage( + if (context()->getExecutionContext()) { + context()->getExecutionContext()->addConsoleMessage( ConsoleMessage::create(SecurityMessageSource, InfoMessageLevel, "MediaElementAudioSource outputs zeroes due to CORS access restrictions for " + message)); } @@ -160,7 +160,7 @@ void MediaElementAudioSourceHandler::process(size_t numberOfFrames) outputBus->zero(); return; } - AudioSourceProvider& provider = mediaElement()->audioSourceProvider(); + AudioSourceProvider& provider = mediaElement()->getAudioSourceProvider(); // Grab data from the provider so that the element continues to make progress, even if // we're going to output silence anyway. if (m_multiChannelResampler.get()) { @@ -177,8 +177,8 @@ void MediaElementAudioSourceHandler::process(size_t numberOfFrames) // Print a CORS message, but just once for each change in the current media // element source, and only if we have a document to print to. m_maybePrintCORSMessage = false; - if (context()->executionContext()) { - context()->executionContext()->postTask(BLINK_FROM_HERE, + if (context()->getExecutionContext()) { + context()->getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&MediaElementAudioSourceHandler::printCORSMessage, this, m_currentSrcString)); diff --git a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.h b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.h index fa5edd3..c8a460e 100644 --- a/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.h +++ b/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.h @@ -81,7 +81,7 @@ private: OwnPtr<MultiChannelResampler> m_multiChannelResampler; // |m_passesCurrentSrcCORSAccessCheck| holds the value of - // context()->securityOrigin() && context()->securityOrigin()->canRequest(mediaElement()->currentSrc()), + // context()->getSecurityOrigin() && context()->getSecurityOrigin()->canRequest(mediaElement()->currentSrc()), // updated in the ctor and onCurrentSrcChanged() on the main thread and // used in passesCORSAccessCheck() on the audio thread, // protected by |m_processLock|. diff --git a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.cpp b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.cpp index 297bb6d..2e2de3f 100644 --- a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.cpp @@ -47,7 +47,7 @@ MediaStreamAudioDestinationHandler::MediaStreamAudioDestinationHandler(AudioNode MediaStreamSourceVector audioSources; audioSources.append(m_source.get()); MediaStreamSourceVector videoSources; - m_stream = MediaStream::create(node.context()->executionContext(), MediaStreamDescriptor::create(audioSources, videoSources)); + m_stream = MediaStream::create(node.context()->getExecutionContext(), MediaStreamDescriptor::create(audioSources, videoSources)); MediaStreamCenter::instance().didCreateMediaStreamAndTracks(m_stream->descriptor()); m_source->setAudioFormat(numberOfChannels, node.context()->sampleRate()); diff --git a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.cpp b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.cpp index 4c1b3e8..573270f 100644 --- a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.cpp @@ -84,12 +84,12 @@ void MediaStreamAudioSourceHandler::process(size_t numberOfFrames) { AudioBus* outputBus = output(0).bus(); - if (!audioSourceProvider()) { + if (!getAudioSourceProvider()) { outputBus->zero(); return; } - if (!mediaStream() || m_sourceNumberOfChannels != outputBus->numberOfChannels()) { + if (!getMediaStream() || m_sourceNumberOfChannels != outputBus->numberOfChannels()) { outputBus->zero(); return; } @@ -99,7 +99,7 @@ void MediaStreamAudioSourceHandler::process(size_t numberOfFrames) // a format change, so we output silence in this case. MutexTryLocker tryLocker(m_processLock); if (tryLocker.locked()) { - audioSourceProvider()->provideInput(outputBus, numberOfFrames); + getAudioSourceProvider()->provideInput(outputBus, numberOfFrames); } else { // We failed to acquire the lock. outputBus->zero(); @@ -130,9 +130,9 @@ MediaStreamAudioSourceHandler& MediaStreamAudioSourceNode::mediaStreamAudioSourc return static_cast<MediaStreamAudioSourceHandler&>(handler()); } -MediaStream* MediaStreamAudioSourceNode::mediaStream() const +MediaStream* MediaStreamAudioSourceNode::getMediaStream() const { - return mediaStreamAudioSourceHandler().mediaStream(); + return mediaStreamAudioSourceHandler().getMediaStream(); } void MediaStreamAudioSourceNode::setFormat(size_t numberOfChannels, float sourceSampleRate) diff --git a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.h b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.h index d082be8..4786ec4 100644 --- a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.h +++ b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.h @@ -42,7 +42,7 @@ public: static PassRefPtr<MediaStreamAudioSourceHandler> create(AudioNode&, MediaStream&, MediaStreamTrack*, PassOwnPtr<AudioSourceProvider>); ~MediaStreamAudioSourceHandler() override; - MediaStream* mediaStream() { return m_mediaStream.get(); } + MediaStream* getMediaStream() { return m_mediaStream.get(); } // AudioHandler void process(size_t framesToProcess) override; @@ -51,7 +51,7 @@ public: // MediaStreamAudioSourceNode. void setFormat(size_t numberOfChannels, float sampleRate); - AudioSourceProvider* audioSourceProvider() const { return m_audioSourceProvider.get(); } + AudioSourceProvider* getAudioSourceProvider() const { return m_audioSourceProvider.get(); } private: MediaStreamAudioSourceHandler(AudioNode&, MediaStream&, MediaStreamTrack*, PassOwnPtr<AudioSourceProvider>); @@ -77,7 +77,7 @@ public: DECLARE_VIRTUAL_TRACE(); MediaStreamAudioSourceHandler& mediaStreamAudioSourceHandler() const; - MediaStream* mediaStream() const; + MediaStream* getMediaStream() const; // AudioSourceProviderClient functions: void setFormat(size_t numberOfChannels, float sampleRate) override; diff --git a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.idl b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.idl index 6da028b..4828d9b 100644 --- a/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.idl +++ b/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.idl @@ -23,5 +23,5 @@ */ interface MediaStreamAudioSourceNode : AudioSourceNode { - readonly attribute MediaStream mediaStream; + [ImplementedAs=getMediaStream] readonly attribute MediaStream mediaStream; }; diff --git a/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp index 1ac7fe9..2429c66 100644 --- a/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp +++ b/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp @@ -315,7 +315,7 @@ void OfflineAudioContext::fireCompletionEvent() return; // Avoid firing the event if the document has already gone away. - if (executionContext()) { + if (getExecutionContext()) { // Call the offline rendering completion event listener and resolve the // promise too. dispatchEvent(OfflineAudioCompletionEvent::create(renderedBuffer)); diff --git a/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp b/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp index 4a3ce4a..ee8e116 100644 --- a/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp @@ -200,8 +200,8 @@ void OfflineAudioDestinationHandler::suspendOfflineRendering() ASSERT(!isMainThread()); // The actual rendering has been suspended. Notify the context. - if (context()->executionContext()) { - context()->executionContext()->postTask(BLINK_FROM_HERE, + if (context()->getExecutionContext()) { + context()->getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&OfflineAudioDestinationHandler::notifySuspend, this)); } } @@ -211,8 +211,8 @@ void OfflineAudioDestinationHandler::finishOfflineRendering() ASSERT(!isMainThread()); // The actual rendering has been completed. Notify the context. - if (context()->executionContext()) { - context()->executionContext()->postTask(BLINK_FROM_HERE, + if (context()->getExecutionContext()) { + context()->getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&OfflineAudioDestinationHandler::notifyComplete, this)); } } diff --git a/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp b/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp index 7274ba1..b7f78f0 100644 --- a/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.cpp @@ -161,10 +161,10 @@ void ScriptProcessorHandler::process(size_t framesToProcess) // We're late in handling the previous request. The main thread must be very busy. // The best we can do is clear out the buffer ourself here. outputBuffer->zero(); - } else if (context()->executionContext()) { + } else if (context()->getExecutionContext()) { // Fire the event on the main thread with the appropriate buffer // index. - context()->executionContext()->postTask(BLINK_FROM_HERE, + context()->getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&ScriptProcessorHandler::fireProcessEvent, this, m_doubleBufferIndex)); } @@ -187,7 +187,7 @@ void ScriptProcessorHandler::fireProcessEvent(unsigned doubleBufferIndex) return; // Avoid firing the event if the document has already gone away. - if (node() && context() && context()->executionContext()) { + if (node() && context() && context()->getExecutionContext()) { // This synchronizes with process(). MutexLocker processLocker(m_processEventLock); diff --git a/third_party/WebKit/Source/modules/webaudio/WaveShaperDSPKernel.cpp b/third_party/WebKit/Source/modules/webaudio/WaveShaperDSPKernel.cpp index a5ed118..2833319 100644 --- a/third_party/WebKit/Source/modules/webaudio/WaveShaperDSPKernel.cpp +++ b/third_party/WebKit/Source/modules/webaudio/WaveShaperDSPKernel.cpp @@ -52,7 +52,7 @@ void WaveShaperDSPKernel::lazyInitializeOversampling() void WaveShaperDSPKernel::process(const float* source, float* destination, size_t framesToProcess) { - switch (waveShaperProcessor()->oversample()) { + switch (getWaveShaperProcessor()->oversample()) { case WaveShaperProcessor::OverSampleNone: processCurve(source, destination, framesToProcess); break; @@ -72,9 +72,9 @@ void WaveShaperDSPKernel::processCurve(const float* source, float* destination, { ASSERT(source); ASSERT(destination); - ASSERT(waveShaperProcessor()); + ASSERT(getWaveShaperProcessor()); - DOMFloat32Array* curve = waveShaperProcessor()->curve(); + DOMFloat32Array* curve = getWaveShaperProcessor()->curve(); if (!curve) { // Act as "straight wire" pass-through if no curve is set. memcpy(destination, source, sizeof(float) * framesToProcess); @@ -175,7 +175,7 @@ double WaveShaperDSPKernel::latencyTime() const size_t latencyFrames = 0; WaveShaperDSPKernel* kernel = const_cast<WaveShaperDSPKernel*>(this); - switch (kernel->waveShaperProcessor()->oversample()) { + switch (kernel->getWaveShaperProcessor()->oversample()) { case WaveShaperProcessor::OverSampleNone: break; case WaveShaperProcessor::OverSample2x: diff --git a/third_party/WebKit/Source/modules/webaudio/WaveShaperDSPKernel.h b/third_party/WebKit/Source/modules/webaudio/WaveShaperDSPKernel.h index e75be26..7d8c2dd 100644 --- a/third_party/WebKit/Source/modules/webaudio/WaveShaperDSPKernel.h +++ b/third_party/WebKit/Source/modules/webaudio/WaveShaperDSPKernel.h @@ -59,7 +59,7 @@ protected: void processCurve2x(const float* source, float* dest, size_t framesToProcess); void processCurve4x(const float* source, float* dest, size_t framesToProcess); - WaveShaperProcessor* waveShaperProcessor() { return static_cast<WaveShaperProcessor*>(processor()); } + WaveShaperProcessor* getWaveShaperProcessor() { return static_cast<WaveShaperProcessor*>(processor()); } // Oversampling. OwnPtr<AudioFloatArray> m_tempBuffer; diff --git a/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp b/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp index 6a82ba2..83d0329 100644 --- a/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp @@ -40,7 +40,7 @@ WaveShaperNode::WaveShaperNode(AbstractAudioContext& context) handler().initialize(); } -WaveShaperProcessor* WaveShaperNode::waveShaperProcessor() const +WaveShaperProcessor* WaveShaperNode::getWaveShaperProcessor() const { return static_cast<WaveShaperProcessor*>(static_cast<AudioBasicProcessorHandler&>(handler()).processor()); } @@ -59,12 +59,12 @@ void WaveShaperNode::setCurve(DOMFloat32Array* curve, ExceptionState& exceptionS return; } - waveShaperProcessor()->setCurve(curve); + getWaveShaperProcessor()->setCurve(curve); } DOMFloat32Array* WaveShaperNode::curve() { - return waveShaperProcessor()->curve(); + return getWaveShaperProcessor()->curve(); } void WaveShaperNode::setOversample(const String& type) @@ -77,11 +77,11 @@ void WaveShaperNode::setOversample(const String& type) AbstractAudioContext::AutoLocker contextLocker(context()); if (type == "none") { - waveShaperProcessor()->setOversample(WaveShaperProcessor::OverSampleNone); + getWaveShaperProcessor()->setOversample(WaveShaperProcessor::OverSampleNone); } else if (type == "2x") { - waveShaperProcessor()->setOversample(WaveShaperProcessor::OverSample2x); + getWaveShaperProcessor()->setOversample(WaveShaperProcessor::OverSample2x); } else if (type == "4x") { - waveShaperProcessor()->setOversample(WaveShaperProcessor::OverSample4x); + getWaveShaperProcessor()->setOversample(WaveShaperProcessor::OverSample4x); } else { ASSERT_NOT_REACHED(); } @@ -89,7 +89,7 @@ void WaveShaperNode::setOversample(const String& type) String WaveShaperNode::oversample() const { - switch (const_cast<WaveShaperNode*>(this)->waveShaperProcessor()->oversample()) { + switch (const_cast<WaveShaperNode*>(this)->getWaveShaperProcessor()->oversample()) { case WaveShaperProcessor::OverSampleNone: return "none"; case WaveShaperProcessor::OverSample2x: diff --git a/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.h b/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.h index fb05ea3..740af6d 100644 --- a/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.h +++ b/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.h @@ -52,7 +52,7 @@ public: private: explicit WaveShaperNode(AbstractAudioContext&); - WaveShaperProcessor* waveShaperProcessor() const; + WaveShaperProcessor* getWaveShaperProcessor() const; }; } // namespace blink diff --git a/third_party/WebKit/Source/modules/webdatabase/DOMWindowWebDatabase.cpp b/third_party/WebKit/Source/modules/webdatabase/DOMWindowWebDatabase.cpp index ab87d89..e66b55d 100644 --- a/third_party/WebKit/Source/modules/webdatabase/DOMWindowWebDatabase.cpp +++ b/third_party/WebKit/Source/modules/webdatabase/DOMWindowWebDatabase.cpp @@ -47,7 +47,7 @@ Database* DOMWindowWebDatabase::openDatabase(DOMWindow& windowArg, const String& Database* database = nullptr; DatabaseManager& dbManager = DatabaseManager::manager(); DatabaseError error = DatabaseError::None; - if (RuntimeEnabledFeatures::databaseEnabled() && window.document()->securityOrigin()->canAccessDatabase()) { + if (RuntimeEnabledFeatures::databaseEnabled() && window.document()->getSecurityOrigin()->canAccessDatabase()) { String errorMessage; database = dbManager.openDatabase(window.document(), name, version, displayName, estimatedSize, creationCallback, error, errorMessage); ASSERT(database || error != DatabaseError::None); diff --git a/third_party/WebKit/Source/modules/webdatabase/Database.cpp b/third_party/WebKit/Source/modules/webdatabase/Database.cpp index 545f8bc..32b524b 100644 --- a/third_party/WebKit/Source/modules/webdatabase/Database.cpp +++ b/third_party/WebKit/Source/modules/webdatabase/Database.cpp @@ -215,7 +215,7 @@ Database::Database(DatabaseContext* databaseContext, const String& name, const S , m_transactionInProgress(false) , m_isTransactionQueueEnabled(true) { - m_contextThreadSecurityOrigin = m_databaseContext->securityOrigin()->isolatedCopy(); + m_contextThreadSecurityOrigin = m_databaseContext->getSecurityOrigin()->isolatedCopy(); m_databaseAuthorizer = DatabaseAuthorizer::create(infoTableName); @@ -224,11 +224,11 @@ Database::Database(DatabaseContext* databaseContext, const String& name, const S { SafePointAwareMutexLocker locker(guidMutex()); - m_guid = guidForOriginAndName(securityOrigin()->toString(), name); + m_guid = guidForOriginAndName(getSecurityOrigin()->toString(), name); guidCount().add(m_guid); } - m_filename = DatabaseManager::manager().fullPathForDatabase(securityOrigin(), m_name); + m_filename = DatabaseManager::manager().fullPathForDatabase(getSecurityOrigin(), m_name); m_databaseThreadSecurityOrigin = m_contextThreadSecurityOrigin->isolatedCopy(); ASSERT(m_databaseContext->databaseThread()); @@ -260,13 +260,13 @@ DEFINE_TRACE(Database) bool Database::openAndVerifyVersion(bool setVersionInNewDatabase, DatabaseError& error, String& errorMessage) { TaskSynchronizer synchronizer; - if (!databaseContext()->databaseThreadAvailable()) + if (!getDatabaseContext()->databaseThreadAvailable()) return false; DatabaseTracker::tracker().prepareToOpenDatabase(this); bool success = false; OwnPtr<DatabaseOpenTask> task = DatabaseOpenTask::create(this, setVersionInNewDatabase, &synchronizer, error, errorMessage, success); - databaseContext()->databaseThread()->scheduleTask(task.release()); + getDatabaseContext()->databaseThread()->scheduleTask(task.release()); synchronizer.waitForTaskCompletion(); return success; @@ -274,8 +274,8 @@ bool Database::openAndVerifyVersion(bool setVersionInNewDatabase, DatabaseError& void Database::close() { - ASSERT(databaseContext()->databaseThread()); - ASSERT(databaseContext()->databaseThread()->isDatabaseThread()); + ASSERT(getDatabaseContext()->databaseThread()); + ASSERT(getDatabaseContext()->databaseThread()->isDatabaseThread()); { MutexLocker locker(m_transactionInProgressMutex); @@ -294,7 +294,7 @@ void Database::close() } closeDatabase(); - databaseContext()->databaseThread()->recordDatabaseClosed(this); + getDatabaseContext()->databaseThread()->recordDatabaseClosed(this); } SQLTransactionBackend* Database::runTransaction(SQLTransaction* transaction, bool readOnly, const ChangeVersionData* data) @@ -330,11 +330,11 @@ void Database::scheduleTransaction() if (m_isTransactionQueueEnabled && !m_transactionQueue.isEmpty()) transaction = m_transactionQueue.takeFirst(); - if (transaction && databaseContext()->databaseThreadAvailable()) { + if (transaction && getDatabaseContext()->databaseThreadAvailable()) { OwnPtr<DatabaseTransactionTask> task = DatabaseTransactionTask::create(transaction); WTF_LOG(StorageAPI, "Scheduling DatabaseTransactionTask %p for transaction %p\n", task.get(), task->transaction()); m_transactionInProgress = true; - databaseContext()->databaseThread()->scheduleTask(task.release()); + getDatabaseContext()->databaseThread()->scheduleTask(task.release()); } else { m_transactionInProgress = false; } @@ -342,22 +342,22 @@ void Database::scheduleTransaction() void Database::scheduleTransactionStep(SQLTransactionBackend* transaction) { - if (!databaseContext()->databaseThreadAvailable()) + if (!getDatabaseContext()->databaseThreadAvailable()) return; OwnPtr<DatabaseTransactionTask> task = DatabaseTransactionTask::create(transaction); WTF_LOG(StorageAPI, "Scheduling DatabaseTransactionTask %p for the transaction step\n", task.get()); - databaseContext()->databaseThread()->scheduleTask(task.release()); + getDatabaseContext()->databaseThread()->scheduleTask(task.release()); } SQLTransactionClient* Database::transactionClient() const { - return databaseContext()->databaseThread()->transactionClient(); + return getDatabaseContext()->databaseThread()->transactionClient(); } SQLTransactionCoordinator* Database::transactionCoordinator() const { - return databaseContext()->databaseThread()->transactionCoordinator(); + return getDatabaseContext()->databaseThread()->transactionCoordinator(); } // static @@ -546,8 +546,8 @@ bool Database::performOpenAndVerify(bool shouldSetVersionInNewDatabase, Database reportOpenDatabaseResult(0, -1, 0, WTF::monotonicallyIncreasingTime() - callStartTime); // OK - if (databaseContext()->databaseThread()) - databaseContext()->databaseThread()->recordDatabaseOpen(this); + if (getDatabaseContext()->databaseThread()) + getDatabaseContext()->databaseThread()->recordDatabaseOpen(this); return true; } @@ -712,7 +712,7 @@ void Database::reportOpenDatabaseResult(int errorSite, int webSqlErrorCode, int { if (Platform::current()->databaseObserver()) { Platform::current()->databaseObserver()->reportOpenDatabaseResult( - createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), + createDatabaseIdentifierFromSecurityOrigin(getSecurityOrigin()), stringIdentifier(), errorSite, webSqlErrorCode, sqliteErrorCode, duration); } @@ -722,7 +722,7 @@ void Database::reportChangeVersionResult(int errorSite, int webSqlErrorCode, int { if (Platform::current()->databaseObserver()) { Platform::current()->databaseObserver()->reportChangeVersionResult( - createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), + createDatabaseIdentifierFromSecurityOrigin(getSecurityOrigin()), stringIdentifier(), errorSite, webSqlErrorCode, sqliteErrorCode); } } @@ -731,7 +731,7 @@ void Database::reportStartTransactionResult(int errorSite, int webSqlErrorCode, { if (Platform::current()->databaseObserver()) { Platform::current()->databaseObserver()->reportStartTransactionResult( - createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), + createDatabaseIdentifierFromSecurityOrigin(getSecurityOrigin()), stringIdentifier(), errorSite, webSqlErrorCode, sqliteErrorCode); } } @@ -740,7 +740,7 @@ void Database::reportCommitTransactionResult(int errorSite, int webSqlErrorCode, { if (Platform::current()->databaseObserver()) { Platform::current()->databaseObserver()->reportCommitTransactionResult( - createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), + createDatabaseIdentifierFromSecurityOrigin(getSecurityOrigin()), stringIdentifier(), errorSite, webSqlErrorCode, sqliteErrorCode); } } @@ -749,7 +749,7 @@ void Database::reportExecuteStatementResult(int errorSite, int webSqlErrorCode, { if (Platform::current()->databaseObserver()) { Platform::current()->databaseObserver()->reportExecuteStatementResult( - createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), + createDatabaseIdentifierFromSecurityOrigin(getSecurityOrigin()), stringIdentifier(), errorSite, webSqlErrorCode, sqliteErrorCode); } } @@ -758,27 +758,27 @@ void Database::reportVacuumDatabaseResult(int sqliteErrorCode) { if (Platform::current()->databaseObserver()) { Platform::current()->databaseObserver()->reportVacuumDatabaseResult( - createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), + createDatabaseIdentifierFromSecurityOrigin(getSecurityOrigin()), stringIdentifier(), sqliteErrorCode); } } void Database::logErrorMessage(const String& message) { - executionContext()->addConsoleMessage(ConsoleMessage::create(StorageMessageSource, ErrorMessageLevel, message)); + getExecutionContext()->addConsoleMessage(ConsoleMessage::create(StorageMessageSource, ErrorMessageLevel, message)); } -ExecutionContext* Database::executionContext() const +ExecutionContext* Database::getExecutionContext() const { - return databaseContext()->executionContext(); + return getDatabaseContext()->getExecutionContext(); } void Database::closeImmediately() { - ASSERT(executionContext()->isContextThread()); - if (databaseContext()->databaseThreadAvailable() && opened()) { + ASSERT(getExecutionContext()->isContextThread()); + if (getDatabaseContext()->databaseThreadAvailable() && opened()) { logErrorMessage("forcibly closing database"); - databaseContext()->databaseThread()->scheduleTask(DatabaseCloseTask::create(this, 0)); + getDatabaseContext()->databaseThread()->scheduleTask(DatabaseCloseTask::create(this, 0)); } } @@ -821,7 +821,7 @@ void Database::runTransaction( bool readOnly, const ChangeVersionData* changeVersionData) { - ASSERT(executionContext()->isContextThread()); + ASSERT(getExecutionContext()->isContextThread()); // FIXME: Rather than passing errorCallback to SQLTransaction and then // sometimes firing it ourselves, this code should probably be pushed down // into Database so that we only create the SQLTransaction if we're @@ -836,7 +836,7 @@ void Database::runTransaction( ASSERT(callback == originalErrorCallback); if (callback) { OwnPtr<SQLErrorData> error = SQLErrorData::create(SQLError::UNKNOWN_ERR, "database has been closed"); - executionContext()->postTask(BLINK_FROM_HERE, createSameThreadTask(&callTransactionErrorCallback, callback, error.release())); + getExecutionContext()->postTask(BLINK_FROM_HERE, createSameThreadTask(&callTransactionErrorCallback, callback, error.release())); } } } @@ -845,7 +845,7 @@ void Database::scheduleTransactionCallback(SQLTransaction* transaction) { // The task is constructed in a database thread, and destructed in the // context thread. - executionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&SQLTransaction::performPendingCallback, transaction)); + getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&SQLTransaction::performPendingCallback, transaction)); } Vector<String> Database::performGetTableNames() @@ -884,21 +884,21 @@ Vector<String> Database::tableNames() // this may not be true anymore. Vector<String> result; TaskSynchronizer synchronizer; - if (!databaseContext()->databaseThreadAvailable()) + if (!getDatabaseContext()->databaseThreadAvailable()) return result; OwnPtr<DatabaseTableNamesTask> task = DatabaseTableNamesTask::create(this, &synchronizer, result); - databaseContext()->databaseThread()->scheduleTask(task.release()); + getDatabaseContext()->databaseThread()->scheduleTask(task.release()); synchronizer.waitForTaskCompletion(); return result; } -SecurityOrigin* Database::securityOrigin() const +SecurityOrigin* Database::getSecurityOrigin() const { - if (executionContext()->isContextThread()) + if (getExecutionContext()->isContextThread()) return m_contextThreadSecurityOrigin.get(); - if (databaseContext()->databaseThread()->isDatabaseThread()) + if (getDatabaseContext()->databaseThread()->isDatabaseThread()) return m_databaseThreadSecurityOrigin.get(); return 0; } diff --git a/third_party/WebKit/Source/modules/webdatabase/Database.h b/third_party/WebKit/Source/modules/webdatabase/Database.h index d76bc19..d9b8e64 100644 --- a/third_party/WebKit/Source/modules/webdatabase/Database.h +++ b/third_party/WebKit/Source/modules/webdatabase/Database.h @@ -84,7 +84,7 @@ public: bool opened(); bool isNew() const { return m_new; } - SecurityOrigin* securityOrigin() const; + SecurityOrigin* getSecurityOrigin() const; String stringIdentifier() const; String displayName() const; unsigned long estimatedSize() const; @@ -108,8 +108,8 @@ public: void closeImmediately(); void closeDatabase(); - DatabaseContext* databaseContext() const { return m_databaseContext.get(); } - ExecutionContext* executionContext() const; + DatabaseContext* getDatabaseContext() const { return m_databaseContext.get(); } + ExecutionContext* getExecutionContext() const; private: class DatabaseOpenTask; diff --git a/third_party/WebKit/Source/modules/webdatabase/DatabaseContext.cpp b/third_party/WebKit/Source/modules/webdatabase/DatabaseContext.cpp index a03d118..5214070 100644 --- a/third_party/WebKit/Source/modules/webdatabase/DatabaseContext.cpp +++ b/third_party/WebKit/Source/modules/webdatabase/DatabaseContext.cpp @@ -190,17 +190,17 @@ void DatabaseContext::stopDatabases() bool DatabaseContext::allowDatabaseAccess() const { - return toDocument(executionContext())->isActive(); + return toDocument(getExecutionContext())->isActive(); } -SecurityOrigin* DatabaseContext::securityOrigin() const +SecurityOrigin* DatabaseContext::getSecurityOrigin() const { - return executionContext()->securityOrigin(); + return getExecutionContext()->getSecurityOrigin(); } bool DatabaseContext::isContextThread() const { - return executionContext()->isContextThread(); + return getExecutionContext()->isContextThread(); } } // namespace blink diff --git a/third_party/WebKit/Source/modules/webdatabase/DatabaseContext.h b/third_party/WebKit/Source/modules/webdatabase/DatabaseContext.h index 251f590..c71a676 100644 --- a/third_party/WebKit/Source/modules/webdatabase/DatabaseContext.h +++ b/third_party/WebKit/Source/modules/webdatabase/DatabaseContext.h @@ -64,7 +64,7 @@ public: bool allowDatabaseAccess() const; - SecurityOrigin* securityOrigin() const; + SecurityOrigin* getSecurityOrigin() const; bool isContextThread() const; private: diff --git a/third_party/WebKit/Source/modules/webdatabase/DatabaseManager.cpp b/third_party/WebKit/Source/modules/webdatabase/DatabaseManager.cpp index 060dfc5..282b43c 100644 --- a/third_party/WebKit/Source/modules/webdatabase/DatabaseManager.cpp +++ b/third_party/WebKit/Source/modules/webdatabase/DatabaseManager.cpp @@ -120,7 +120,7 @@ DatabaseContext* DatabaseManager::databaseContextFor(ExecutionContext* context) void DatabaseManager::registerDatabaseContext(DatabaseContext* databaseContext) { - ExecutionContext* context = databaseContext->executionContext(); + ExecutionContext* context = databaseContext->getExecutionContext(); m_contextMap.set(context, databaseContext); #if ENABLE(ASSERT) m_databaseContextRegisteredCount++; @@ -129,7 +129,7 @@ void DatabaseManager::registerDatabaseContext(DatabaseContext* databaseContext) void DatabaseManager::unregisterDatabaseContext(DatabaseContext* databaseContext) { - ExecutionContext* context = databaseContext->executionContext(); + ExecutionContext* context = databaseContext->getExecutionContext(); ASSERT(m_contextMap.get(context)); #if ENABLE(ASSERT) m_databaseContextRegisteredCount--; @@ -169,7 +169,7 @@ void DatabaseManager::throwExceptionForDatabaseError(DatabaseError error, const static void logOpenDatabaseError(ExecutionContext* context, const String& name) { WTF_LOG(StorageAPI, "Database %s for origin %s not allowed to be established", name.ascii().data(), - context->securityOrigin()->toString().ascii().data()); + context->getSecurityOrigin()->toString().ascii().data()); } Database* DatabaseManager::openDatabaseInternal(ExecutionContext* context, @@ -215,11 +215,11 @@ Database* DatabaseManager::openDatabase(ExecutionContext* context, return nullptr; databaseContextFor(context)->setHasOpenDatabases(); - DatabaseClient::from(context)->didOpenDatabase(database, context->securityOrigin()->host(), name, expectedVersion); + DatabaseClient::from(context)->didOpenDatabase(database, context->getSecurityOrigin()->host(), name, expectedVersion); if (database->isNew() && creationCallback) { WTF_LOG(StorageAPI, "Scheduling DatabaseCreationCallbackTask for database %p\n", database); - database->executionContext()->postTask(BLINK_FROM_HERE, DatabaseCreationCallbackTask::create(database, creationCallback)); + database->getExecutionContext()->postTask(BLINK_FROM_HERE, DatabaseCreationCallbackTask::create(database, creationCallback)); } ASSERT(database); diff --git a/third_party/WebKit/Source/modules/webdatabase/DatabaseTask.cpp b/third_party/WebKit/Source/modules/webdatabase/DatabaseTask.cpp index eea9024..e7710a7 100644 --- a/third_party/WebKit/Source/modules/webdatabase/DatabaseTask.cpp +++ b/third_party/WebKit/Source/modules/webdatabase/DatabaseTask.cpp @@ -58,7 +58,7 @@ void DatabaseTask::run() ASSERT(!m_complete); #endif - if (!m_synchronizer && !m_database->databaseContext()->databaseThread()->isDatabaseOpen(m_database.get())) { + if (!m_synchronizer && !m_database->getDatabaseContext()->databaseThread()->isDatabaseOpen(m_database.get())) { taskCancelled(); #if !LOG_DISABLED m_complete = true; diff --git a/third_party/WebKit/Source/modules/webdatabase/DatabaseTracker.cpp b/third_party/WebKit/Source/modules/webdatabase/DatabaseTracker.cpp index e64894d..24f5626 100644 --- a/third_party/WebKit/Source/modules/webdatabase/DatabaseTracker.cpp +++ b/third_party/WebKit/Source/modules/webdatabase/DatabaseTracker.cpp @@ -52,7 +52,7 @@ static void databaseClosed(Database* database) { if (Platform::current()->databaseObserver()) { Platform::current()->databaseObserver()->databaseClosed( - createDatabaseIdentifierFromSecurityOrigin(database->securityOrigin()), + createDatabaseIdentifierFromSecurityOrigin(database->getSecurityOrigin()), database->stringIdentifier()); } } @@ -70,7 +70,7 @@ DatabaseTracker::DatabaseTracker() bool DatabaseTracker::canEstablishDatabase(DatabaseContext* databaseContext, const String& name, const String& displayName, unsigned long estimatedSize, DatabaseError& error) { - ExecutionContext* executionContext = databaseContext->executionContext(); + ExecutionContext* executionContext = databaseContext->getExecutionContext(); bool success = DatabaseClient::from(executionContext)->allowDatabase(executionContext, name, displayName, estimatedSize); if (!success) error = DatabaseError::GenericSecurityError; @@ -88,7 +88,7 @@ void DatabaseTracker::addOpenDatabase(Database* database) if (!m_openDatabaseMap) m_openDatabaseMap = adoptPtr(new DatabaseOriginMap); - String originIdentifier = createDatabaseIdentifierFromSecurityOrigin(database->securityOrigin()); + String originIdentifier = createDatabaseIdentifierFromSecurityOrigin(database->getSecurityOrigin()); DatabaseNameMap* nameMap = m_openDatabaseMap->get(originIdentifier); if (!nameMap) { nameMap = new DatabaseNameMap(); @@ -109,7 +109,7 @@ void DatabaseTracker::removeOpenDatabase(Database* database) { { MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard); - String originIdentifier = createDatabaseIdentifierFromSecurityOrigin(database->securityOrigin()); + String originIdentifier = createDatabaseIdentifierFromSecurityOrigin(database->getSecurityOrigin()); ASSERT(m_openDatabaseMap); DatabaseNameMap* nameMap = m_openDatabaseMap->get(originIdentifier); if (!nameMap) @@ -139,10 +139,10 @@ void DatabaseTracker::removeOpenDatabase(Database* database) void DatabaseTracker::prepareToOpenDatabase(Database* database) { - ASSERT(database->databaseContext()->executionContext()->isContextThread()); + ASSERT(database->getDatabaseContext()->getExecutionContext()->isContextThread()); if (Platform::current()->databaseObserver()) { Platform::current()->databaseObserver()->databaseOpened( - createDatabaseIdentifierFromSecurityOrigin(database->securityOrigin()), + createDatabaseIdentifierFromSecurityOrigin(database->getSecurityOrigin()), database->stringIdentifier(), database->displayName(), database->estimatedSize()); @@ -159,7 +159,7 @@ unsigned long long DatabaseTracker::getMaxSizeForDatabase(const Database* databa unsigned long long spaceAvailable = 0; unsigned long long databaseSize = 0; QuotaTracker::instance().getDatabaseSizeAndSpaceAvailableToOrigin( - createDatabaseIdentifierFromSecurityOrigin(database->securityOrigin()), + createDatabaseIdentifierFromSecurityOrigin(database->getSecurityOrigin()), database->stringIdentifier(), &databaseSize, &spaceAvailable); return databaseSize + spaceAvailable; } @@ -205,7 +205,7 @@ void DatabaseTracker::closeDatabasesImmediately(const String& originIdentifier, // We have to call closeImmediately() on the context thread. for (DatabaseSet::iterator it = databaseSet->begin(); it != databaseSet->end(); ++it) - (*it)->databaseContext()->executionContext()->postTask(BLINK_FROM_HERE, CloseOneDatabaseImmediatelyTask::create(originIdentifier, name, *it)); + (*it)->getDatabaseContext()->getExecutionContext()->postTask(BLINK_FROM_HERE, CloseOneDatabaseImmediatelyTask::create(originIdentifier, name, *it)); } void DatabaseTracker::closeOneDatabaseImmediately(const String& originIdentifier, const String& name, Database* database) diff --git a/third_party/WebKit/Source/modules/webdatabase/SQLStatement.cpp b/third_party/WebKit/Source/modules/webdatabase/SQLStatement.cpp index 89b8347..95f3799 100644 --- a/third_party/WebKit/Source/modules/webdatabase/SQLStatement.cpp +++ b/third_party/WebKit/Source/modules/webdatabase/SQLStatement.cpp @@ -56,7 +56,7 @@ SQLStatement::SQLStatement(Database* database, SQLStatementCallback* callback, , m_asyncOperationId(0) { if (hasCallback() || hasErrorCallback()) - m_asyncOperationId = InspectorInstrumentation::traceAsyncOperationStarting(database->executionContext(), "SQLStatement"); + m_asyncOperationId = InspectorInstrumentation::traceAsyncOperationStarting(database->getExecutionContext(), "SQLStatement"); } SQLStatement::~SQLStatement() @@ -96,7 +96,7 @@ bool SQLStatement::performCallback(SQLTransaction* transaction) SQLStatementErrorCallback* errorCallback = m_statementErrorCallback.release(); SQLErrorData* error = m_backend->sqlError(); - InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncOperationCompletedCallbackStarting(transaction->database()->executionContext(), m_asyncOperationId); + InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncOperationCompletedCallbackStarting(transaction->database()->getExecutionContext(), m_asyncOperationId); // Call the appropriate statement callback and track if it resulted in an error, // because then we need to jump to the transaction error callback. diff --git a/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.cpp b/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.cpp index a0feedb..a1df309 100644 --- a/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.cpp +++ b/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.cpp @@ -65,7 +65,7 @@ SQLTransaction::SQLTransaction(Database* db, SQLTransactionCallback* callback, , m_readOnly(readOnly) { ASSERT(m_database); - m_asyncOperationId = InspectorInstrumentation::traceAsyncOperationStarting(db->executionContext(), "SQLTransaction"); + m_asyncOperationId = InspectorInstrumentation::traceAsyncOperationStarting(db->getExecutionContext(), "SQLTransaction"); } SQLTransaction::~SQLTransaction() @@ -154,7 +154,7 @@ SQLTransactionState SQLTransaction::deliverTransactionCallback() // Spec 4.3.2 4: Invoke the transaction callback with the new SQLTransaction object if (SQLTransactionCallback* callback = m_callback.release()) { m_executeSqlAllowed = true; - InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_database->executionContext(), m_asyncOperationId); + InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_database->getExecutionContext(), m_asyncOperationId); shouldDeliverErrorCallback = !callback->handleEvent(this); InspectorInstrumentation::traceAsyncCallbackCompleted(cookie); m_executeSqlAllowed = false; @@ -173,7 +173,7 @@ SQLTransactionState SQLTransaction::deliverTransactionCallback() SQLTransactionState SQLTransaction::deliverTransactionErrorCallback() { - InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncOperationCompletedCallbackStarting(m_database->executionContext(), m_asyncOperationId); + InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncOperationCompletedCallbackStarting(m_database->getExecutionContext(), m_asyncOperationId); // Spec 4.3.2.10: If exists, invoke error callback with the last // error to have occurred in this transaction. @@ -232,7 +232,7 @@ SQLTransactionState SQLTransaction::deliverQuotaIncreaseCallback() SQLTransactionState SQLTransaction::deliverSuccessCallback() { - InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncOperationCompletedCallbackStarting(m_database->executionContext(), m_asyncOperationId); + InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncOperationCompletedCallbackStarting(m_database->getExecutionContext(), m_asyncOperationId); // Spec 4.3.2.8: Deliver success callback. if (VoidCallback* successCallback = m_successCallback.release()) @@ -281,7 +281,7 @@ void SQLTransaction::executeSQL(const String& sqlStatement, const Vector<SQLValu } int permissions = DatabaseAuthorizer::ReadWriteMask; - if (!m_database->databaseContext()->allowDatabaseAccess()) + if (!m_database->getDatabaseContext()->allowDatabaseAccess()) permissions |= DatabaseAuthorizer::NoAccessMask; else if (m_readOnly) permissions |= DatabaseAuthorizer::ReadOnlyMask; diff --git a/third_party/WebKit/Source/modules/webdatabase/SQLTransactionBackend.cpp b/third_party/WebKit/Source/modules/webdatabase/SQLTransactionBackend.cpp index c385a78..24dd875 100644 --- a/third_party/WebKit/Source/modules/webdatabase/SQLTransactionBackend.cpp +++ b/third_party/WebKit/Source/modules/webdatabase/SQLTransactionBackend.cpp @@ -381,7 +381,7 @@ void SQLTransactionBackend::doCleanup() return; m_frontend = nullptr; // Break the reference cycle. See comment about the life-cycle above. - ASSERT(database()->databaseContext()->databaseThread()->isDatabaseThread()); + ASSERT(database()->getDatabaseContext()->databaseThread()->isDatabaseThread()); MutexLocker locker(m_statementMutex); m_statementQueue.clear(); @@ -525,7 +525,7 @@ void SQLTransactionBackend::executeSQL(SQLStatement* statement, void SQLTransactionBackend::notifyDatabaseThreadIsShuttingDown() { - ASSERT(database()->databaseContext()->databaseThread()->isDatabaseThread()); + ASSERT(database()->getDatabaseContext()->databaseThread()->isDatabaseThread()); // If the transaction is in progress, we should roll it back here, since this // is our last opportunity to do something related to this transaction on the diff --git a/third_party/WebKit/Source/modules/webdatabase/SQLTransactionClient.cpp b/third_party/WebKit/Source/modules/webdatabase/SQLTransactionClient.cpp index e88c926..5670e2f 100644 --- a/third_party/WebKit/Source/modules/webdatabase/SQLTransactionClient.cpp +++ b/third_party/WebKit/Source/modules/webdatabase/SQLTransactionClient.cpp @@ -51,9 +51,9 @@ static void databaseModified(const String& originIdentifier, const String& datab void SQLTransactionClient::didCommitWriteTransaction(Database* database) { - String originIdentifier = createDatabaseIdentifierFromSecurityOrigin(database->securityOrigin()); + String originIdentifier = createDatabaseIdentifierFromSecurityOrigin(database->getSecurityOrigin()); String databaseName = database->stringIdentifier(); - ExecutionContext* executionContext = database->databaseContext()->executionContext(); + ExecutionContext* executionContext = database->getDatabaseContext()->getExecutionContext(); if (!executionContext->isContextThread()) { executionContext->postTask(BLINK_FROM_HERE, createCrossThreadTask(&databaseModified, originIdentifier, databaseName)); } else { @@ -65,7 +65,7 @@ bool SQLTransactionClient::didExceedQuota(Database* database) { // Chromium does not allow users to manually change the quota for an origin (for now, at least). // Don't do anything. - ASSERT(database->databaseContext()->executionContext()->isContextThread()); + ASSERT(database->getDatabaseContext()->getExecutionContext()->isContextThread()); return false; } diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIAccess.cpp b/third_party/WebKit/Source/modules/webmidi/MIDIAccess.cpp index 47b3086..ec8f2c8 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIAccess.cpp +++ b/third_party/WebKit/Source/modules/webmidi/MIDIAccess.cpp @@ -81,7 +81,7 @@ void MIDIAccess::setOnstatechange(PassRefPtrWillBeRawPtr<EventListener> listener bool MIDIAccess::hasPendingActivity() const { - return m_hasPendingActivity && !executionContext()->activeDOMObjectsAreStopped(); + return m_hasPendingActivity && !getExecutionContext()->activeDOMObjectsAreStopped(); } MIDIInputMap* MIDIAccess::inputs() const @@ -164,7 +164,7 @@ void MIDIAccess::didReceiveMIDIData(unsigned portIndex, const unsigned char* dat // Convert from time in seconds which is based on the time coordinate system of monotonicallyIncreasingTime() // into time in milliseconds (a DOMHighResTimeStamp) according to the same time coordinate system as performance.now(). // This is how timestamps are defined in the Web MIDI spec. - Document* document = toDocument(executionContext()); + Document* document = toDocument(getExecutionContext()); ASSERT(document); double timeStampInMilliseconds = 1000 * document->loader()->timing().monotonicTimeToZeroBasedDocumentTime(timeStamp); @@ -185,7 +185,7 @@ void MIDIAccess::sendMIDIData(unsigned portIndex, const unsigned char* data, siz // We need to translate it exactly to 0 seconds. timeStamp = 0; } else { - Document* document = toDocument(executionContext()); + Document* document = toDocument(getExecutionContext()); ASSERT(document); double documentStartTime = document->loader()->timing().referenceMonotonicTime(); timeStamp = documentStartTime + 0.001 * timeStampInMilliseconds; diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIAccess.h b/third_party/WebKit/Source/modules/webmidi/MIDIAccess.h index 110172a..b7e78cf 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIAccess.h +++ b/third_party/WebKit/Source/modules/webmidi/MIDIAccess.h @@ -71,7 +71,7 @@ public: // EventTarget const AtomicString& interfaceName() const override { return EventTargetNames::MIDIAccess; } - ExecutionContext* executionContext() const override { return ActiveDOMObject::executionContext(); } + ExecutionContext* getExecutionContext() const override { return ActiveDOMObject::getExecutionContext(); } // ActiveDOMObject bool hasPendingActivity() const override; diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIAccessInitializer.cpp b/third_party/WebKit/Source/modules/webmidi/MIDIAccessInitializer.cpp index 40a3410..766c89c 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIAccessInitializer.cpp +++ b/third_party/WebKit/Source/modules/webmidi/MIDIAccessInitializer.cpp @@ -43,11 +43,11 @@ void MIDIAccessInitializer::dispose() if (m_hasBeenDisposed) return; - if (!executionContext()) + if (!getExecutionContext()) return; if (!m_permissionResolved) { - Document* document = toDocument(executionContext()); + Document* document = toDocument(getExecutionContext()); ASSERT(document); if (MIDIController* controller = MIDIController::from(document->frame())) controller->cancelPermissionRequest(this); @@ -62,7 +62,7 @@ ScriptPromise MIDIAccessInitializer::start() ScriptPromise promise = this->promise(); m_accessor = MIDIAccessor::create(this); - Document* document = toDocument(executionContext()); + Document* document = toDocument(getExecutionContext()); ASSERT(document); if (MIDIController* controller = MIDIController::from(document->frame())) controller->requestPermission(this, m_options); @@ -102,7 +102,7 @@ void MIDIAccessInitializer::didStartSession(bool success, const String& error, c { ASSERT(m_accessor); if (success) { - resolve(MIDIAccess::create(m_accessor.release(), m_options.hasSysex() && m_options.sysex(), m_portDescriptors, executionContext())); + resolve(MIDIAccess::create(m_accessor.release(), m_options.hasSysex() && m_options.sysex(), m_portDescriptors, getExecutionContext())); } else { // The spec says the name is one of // - SecurityError @@ -134,14 +134,14 @@ void MIDIAccessInitializer::resolvePermission(bool allowed) reject(DOMException::create(SecurityError)); } -SecurityOrigin* MIDIAccessInitializer::securityOrigin() const +SecurityOrigin* MIDIAccessInitializer::getSecurityOrigin() const { - return executionContext()->securityOrigin(); + return getExecutionContext()->getSecurityOrigin(); } -ExecutionContext* MIDIAccessInitializer::executionContext() const +ExecutionContext* MIDIAccessInitializer::getExecutionContext() const { - return scriptState()->executionContext(); + return getScriptState()->getExecutionContext(); } } // namespace blink diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIAccessInitializer.h b/third_party/WebKit/Source/modules/webmidi/MIDIAccessInitializer.h index dd0cc7c..727630c 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIAccessInitializer.h +++ b/third_party/WebKit/Source/modules/webmidi/MIDIAccessInitializer.h @@ -62,12 +62,12 @@ public: void didReceiveMIDIData(unsigned portIndex, const unsigned char* data, size_t length, double timeStamp) override { } void resolvePermission(bool allowed); - SecurityOrigin* securityOrigin() const; + SecurityOrigin* getSecurityOrigin() const; private: MIDIAccessInitializer(ScriptState*, const MIDIOptions&); - ExecutionContext* executionContext() const; + ExecutionContext* getExecutionContext() const; ScriptPromise start(); void dispose(); diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIOutput.cpp b/third_party/WebKit/Source/modules/webmidi/MIDIOutput.cpp index bb2a8dd..5cad114 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIOutput.cpp +++ b/third_party/WebKit/Source/modules/webmidi/MIDIOutput.cpp @@ -198,7 +198,7 @@ void MIDIOutput::send(DOMUint8Array* array, double timestamp, ExceptionState& ex ASSERT(array); if (timestamp == 0.0) - timestamp = now(executionContext()); + timestamp = now(getExecutionContext()); // Implicit open. It does nothing if the port is already opened. // This should be performed even if |array| is invalid. @@ -211,7 +211,7 @@ void MIDIOutput::send(DOMUint8Array* array, double timestamp, ExceptionState& ex void MIDIOutput::send(Vector<unsigned> unsignedData, double timestamp, ExceptionState& exceptionState) { if (timestamp == 0.0) - timestamp = now(executionContext()); + timestamp = now(getExecutionContext()); RefPtr<DOMUint8Array> array = DOMUint8Array::create(unsignedData.size()); DOMUint8Array::ValueType* const arrayData = array->data(); diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIPort.cpp b/third_party/WebKit/Source/modules/webmidi/MIDIPort.cpp index 80d79cb..b90614a2 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIPort.cpp +++ b/third_party/WebKit/Source/modules/webmidi/MIDIPort.cpp @@ -40,7 +40,7 @@ namespace blink { using PortState = MIDIAccessor::MIDIPortState; MIDIPort::MIDIPort(MIDIAccess* access, const String& id, const String& manufacturer, const String& name, TypeCode type, const String& version, PortState state) - : ActiveDOMObject(access->executionContext()) + : ActiveDOMObject(access->getExecutionContext()) , m_id(id) , m_manufacturer(manufacturer) , m_name(name) @@ -141,9 +141,9 @@ void MIDIPort::setState(PortState state) } } -ExecutionContext* MIDIPort::executionContext() const +ExecutionContext* MIDIPort::getExecutionContext() const { - return m_access->executionContext(); + return m_access->getExecutionContext(); } bool MIDIPort::hasPendingActivity() const diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIPort.h b/third_party/WebKit/Source/modules/webmidi/MIDIPort.h index 96066ce..e67c069 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIPort.h +++ b/third_party/WebKit/Source/modules/webmidi/MIDIPort.h @@ -82,7 +82,7 @@ public: // EventTarget const AtomicString& interfaceName() const override { return EventTargetNames::MIDIPort; } - ExecutionContext* executionContext() const final; + ExecutionContext* getExecutionContext() const final; // ActiveDOMObject bool hasPendingActivity() const override; diff --git a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp index 5e7da65..dff099f 100644 --- a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp +++ b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp @@ -76,7 +76,7 @@ void DOMWebSocket::EventQueue::dispatch(PassRefPtrWillBeRawPtr<Event> event) switch (m_state) { case Active: ASSERT(m_events.isEmpty()); - ASSERT(m_target->executionContext()); + ASSERT(m_target->getExecutionContext()); m_target->dispatchEvent(event); break; case Suspended: @@ -132,7 +132,7 @@ void DOMWebSocket::EventQueue::dispatchQueuedEvents() if (m_state == Stopped || m_state == Suspended) break; ASSERT(m_state == Active); - ASSERT(m_target->executionContext()); + ASSERT(m_target->getExecutionContext()); m_target->dispatchEvent(events.takeFirst()); // |this| can be stopped here. } @@ -238,7 +238,7 @@ DOMWebSocket::~DOMWebSocket() void DOMWebSocket::logError(const String& message) { - executionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, message)); + getExecutionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, message)); } DOMWebSocket* DOMWebSocket::create(ExecutionContext* context, const String& url, ExceptionState& exceptionState) @@ -277,13 +277,13 @@ DOMWebSocket* DOMWebSocket::create(ExecutionContext* context, const String& url, void DOMWebSocket::connect(const String& url, const Vector<String>& protocols, ExceptionState& exceptionState) { - UseCounter::count(executionContext(), UseCounter::WebSocket); + UseCounter::count(getExecutionContext(), UseCounter::WebSocket); WTF_LOG(Network, "WebSocket %p connect() url='%s'", this, url.utf8().data()); m_url = KURL(KURL(), url); - if (executionContext()->securityContext().getInsecureRequestsPolicy() == SecurityContext::InsecureRequestsUpgrade && m_url.protocol() == "ws") { - UseCounter::count(executionContext(), UseCounter::UpgradeInsecureRequestsUpgradedRequest); + if (getExecutionContext()->securityContext().getInsecureRequestsPolicy() == SecurityContext::InsecureRequestsUpgrade && m_url.protocol() == "ws") { + UseCounter::count(getExecutionContext(), UseCounter::UpgradeInsecureRequestsUpgradedRequest); m_url.setProtocol("wss"); if (m_url.port() == 80) m_url.setPort(443); @@ -313,7 +313,7 @@ void DOMWebSocket::connect(const String& url, const Vector<String>& protocols, E } // FIXME: Convert this to check the isolated world's Content Security Policy once webkit.org/b/104520 is solved. - if (!ContentSecurityPolicy::shouldBypassMainWorld(executionContext()) && !executionContext()->contentSecurityPolicy()->allowConnectToSource(m_url)) { + if (!ContentSecurityPolicy::shouldBypassMainWorld(getExecutionContext()) && !getExecutionContext()->contentSecurityPolicy()->allowConnectToSource(m_url)) { m_state = CLOSED; // The URL is safe to expose to JavaScript, as this check happens synchronously before redirection. exceptionState.throwSecurityError("Refused to connect to '" + m_url.elidedString() + "' because it violates the document's Content Security Policy."); @@ -343,7 +343,7 @@ void DOMWebSocket::connect(const String& url, const Vector<String>& protocols, E if (!protocols.isEmpty()) protocolString = joinStrings(protocols, subprotocolSeperator()); - m_channel = createChannel(executionContext(), this); + m_channel = createChannel(getExecutionContext(), this); if (!m_channel->connect(m_url, protocolString)) { m_state = CLOSED; @@ -576,9 +576,9 @@ const AtomicString& DOMWebSocket::interfaceName() const return EventTargetNames::DOMWebSocket; } -ExecutionContext* DOMWebSocket::executionContext() const +ExecutionContext* DOMWebSocket::getExecutionContext() const { - return ActiveDOMObject::executionContext(); + return ActiveDOMObject::getExecutionContext(); } void DOMWebSocket::contextDestroyed() diff --git a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.h b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.h index 441e3ad..6a27148 100644 --- a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.h +++ b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.h @@ -111,7 +111,7 @@ public: // EventTarget functions. const AtomicString& interfaceName() const override; - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; // ActiveDOMObject functions. void contextDestroyed() override; diff --git a/third_party/WebKit/Source/modules/websockets/DOMWebSocketTest.cpp b/third_party/WebKit/Source/modules/websockets/DOMWebSocketTest.cpp index dfd8d36..b344c42 100644 --- a/third_party/WebKit/Source/modules/websockets/DOMWebSocketTest.cpp +++ b/third_party/WebKit/Source/modules/websockets/DOMWebSocketTest.cpp @@ -102,7 +102,7 @@ public: : m_pageHolder(DummyPageHolder::create()) , m_websocket(DOMWebSocketWithMockChannel::create(&m_pageHolder->document())) , m_executionScope(v8::Isolate::GetCurrent()) - , m_exceptionState(ExceptionState::ConstructionContext, "property", "interface", m_executionScope.scriptState()->context()->Global(), m_executionScope.isolate()) + , m_exceptionState(ExceptionState::ConstructionContext, "property", "interface", m_executionScope.getScriptState()->context()->Global(), m_executionScope.isolate()) { } diff --git a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp index 797dab0..d833cf3 100644 --- a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp +++ b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp @@ -87,7 +87,7 @@ DocumentWebSocketChannel::BlobLoader::BlobLoader(PassRefPtr<BlobDataHandle> blob : m_channel(channel) , m_loader(FileReaderLoader::ReadAsArrayBuffer, this) { - m_loader.start(channel->executionContext(), blobDataHandle); + m_loader.start(channel->getExecutionContext(), blobDataHandle); } void DocumentWebSocketChannel::BlobLoader::cancel() @@ -137,7 +137,7 @@ bool DocumentWebSocketChannel::connect(const KURL& url, const String& protocol) if (MixedContentChecker::shouldBlockWebSocket(document()->frame(), url)) return false; } - if (MixedContentChecker::isMixedContent(document()->securityOrigin(), url)) { + if (MixedContentChecker::isMixedContent(document()->getSecurityOrigin(), url)) { String message = "Connecting to a non-secure WebSocket server from a secure origin is deprecated."; document()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, message)); } @@ -158,7 +158,7 @@ bool DocumentWebSocketChannel::connect(const KURL& url, const String& protocol) if (document()->frame()) document()->frame()->loader().client()->dispatchWillOpenWebSocket(m_handle.get()); - m_handle->connect(url, webProtocols, WebSecurityOrigin(executionContext()->securityOrigin()), this); + m_handle->connect(url, webProtocols, WebSecurityOrigin(getExecutionContext()->getSecurityOrigin()), this); flowControlIfNecessary(); TRACE_EVENT_INSTANT1("devtools.timeline", "WebSocketCreate", TRACE_EVENT_SCOPE_THREAD, "data", InspectorWebSocketCreateEvent::data(document(), m_identifier, url, protocol)); @@ -238,7 +238,7 @@ void DocumentWebSocketChannel::fail(const String& reason, MessageLevel level, co InspectorInstrumentation::didReceiveWebSocketFrameError(document(), m_identifier, reason); const String message = "WebSocket connection to '" + m_url.elidedString() + "' failed: " + reason; - executionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, level, message, sourceURL, lineNumber)); + getExecutionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, level, message, sourceURL, lineNumber)); if (m_client) m_client->didError(); @@ -382,7 +382,7 @@ void DocumentWebSocketChannel::handleDidClose(bool wasClean, unsigned short code Document* DocumentWebSocketChannel::document() { // This context is always a Document. See the constructor. - ExecutionContext* context = executionContext(); + ExecutionContext* context = getExecutionContext(); ASSERT(context->isDocument()); return toDocument(context); } diff --git a/third_party/WebKit/Source/modules/webusb/USB.cpp b/third_party/WebKit/Source/modules/webusb/USB.cpp index 06204cf..b96657e 100644 --- a/third_party/WebKit/Source/modules/webusb/USB.cpp +++ b/third_party/WebKit/Source/modules/webusb/USB.cpp @@ -94,7 +94,7 @@ ScriptPromise USB::getDevices(ScriptState* scriptState) return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(NotSupportedError)); String errorMessage; - if (!scriptState->executionContext()->isSecureContext(errorMessage)) + if (!scriptState->getExecutionContext()->isSecureContext(errorMessage)) return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(SecurityError, errorMessage)); ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); @@ -110,7 +110,7 @@ ScriptPromise USB::requestDevice(ScriptState* scriptState, const USBDeviceReques return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(NotSupportedError)); String errorMessage; - if (!scriptState->executionContext()->isSecureContext(errorMessage)) + if (!scriptState->getExecutionContext()->isSecureContext(errorMessage)) return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(SecurityError, errorMessage)); if (!UserGestureIndicator::consumeUserGesture()) @@ -126,7 +126,7 @@ ScriptPromise USB::requestDevice(ScriptState* scriptState, const USBDeviceReques return promise; } -ExecutionContext* USB::executionContext() const +ExecutionContext* USB::getExecutionContext() const { return frame() ? frame()->document() : nullptr; } diff --git a/third_party/WebKit/Source/modules/webusb/USB.h b/third_party/WebKit/Source/modules/webusb/USB.h index b4baae6..fbad005 100644 --- a/third_party/WebKit/Source/modules/webusb/USB.h +++ b/third_party/WebKit/Source/modules/webusb/USB.h @@ -41,7 +41,7 @@ public: DEFINE_ATTRIBUTE_EVENT_LISTENER(disconnect); // EventTarget overrides. - ExecutionContext* executionContext() const override; + ExecutionContext* getExecutionContext() const override; const AtomicString& interfaceName() const override; // LocalFrameLifecycleObserver overrides. diff --git a/third_party/WebKit/Source/modules/webusb/USBDevice.cpp b/third_party/WebKit/Source/modules/webusb/USBDevice.cpp index 94d3fd9..5131a90 100644 --- a/third_party/WebKit/Source/modules/webusb/USBDevice.cpp +++ b/third_party/WebKit/Source/modules/webusb/USBDevice.cpp @@ -80,14 +80,14 @@ public: void onSuccess(uint8_t value) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->resolve(USBConfiguration::createFromValue(m_device, value)); } void onError(const WebUSBError& e) override { - if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) + if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()->activeDOMObjectsAreStopped()) return; m_resolver->reject(USBError::take(m_resolver, e)); } @@ -205,7 +205,7 @@ ScriptPromise USBDevice::open(ScriptState* scriptState) ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); ScriptPromise promise = resolver->promise(); m_device->open(new CallbackPromiseAdapter<void, USBError>(resolver)); - setContext(scriptState->executionContext()); + setContext(scriptState->getExecutionContext()); return promise; } diff --git a/third_party/WebKit/Source/modules/worklet/Worklet.cpp b/third_party/WebKit/Source/modules/worklet/Worklet.cpp index 59086a8..a12d417 100644 --- a/third_party/WebKit/Source/modules/worklet/Worklet.cpp +++ b/third_party/WebKit/Source/modules/worklet/Worklet.cpp @@ -24,13 +24,13 @@ Worklet* Worklet::create(LocalFrame* frame, ExecutionContext* executionContext) Worklet::Worklet(LocalFrame* frame, ExecutionContext* executionContext) : ActiveDOMObject(executionContext) - , m_workletGlobalScope(WorkletGlobalScope::create(frame, executionContext->url(), executionContext->userAgent(), executionContext->securityOrigin(), toIsolate(executionContext))) + , m_workletGlobalScope(WorkletGlobalScope::create(frame, executionContext->url(), executionContext->userAgent(), executionContext->getSecurityOrigin(), toIsolate(executionContext))) { } ScriptPromise Worklet::import(ScriptState* scriptState, const String& url) { - KURL scriptURL = executionContext()->completeURL(url); + KURL scriptURL = getExecutionContext()->completeURL(url); if (!scriptURL.isValid()) { return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(SyntaxError, "'" + url + "' is not a valid URL.")); } @@ -49,8 +49,8 @@ ScriptPromise Worklet::import(ScriptState* scriptState, const String& url) // NOTE: WorkerScriptLoader may synchronously invoke its callbacks // (resolving the promise) before we return it. m_scriptLoaders.append(WorkerScriptLoader::create()); - m_scriptLoaders.last()->loadAsynchronously(*executionContext(), scriptURL, DenyCrossOriginRequests, - executionContext()->securityContext().addressSpace(), + m_scriptLoaders.last()->loadAsynchronously(*getExecutionContext(), scriptURL, DenyCrossOriginRequests, + getExecutionContext()->securityContext().addressSpace(), bind(&Worklet::onResponse, this), bind(&Worklet::onFinished, this, m_scriptLoaders.last().get(), resolver)); diff --git a/third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.cpp b/third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.cpp index 833e715..ed7b505 100644 --- a/third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.cpp +++ b/third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.cpp @@ -63,9 +63,9 @@ bool WorkletGlobalScope::isSecureContext(String& errorMessage, const SecureConte // Until there are APIs that are available in worklets and that // require a privileged context test that checks ancestors, just do // a simple check here. - if (securityOrigin()->isPotentiallyTrustworthy()) + if (getSecurityOrigin()->isPotentiallyTrustworthy()) return true; - errorMessage = securityOrigin()->isPotentiallyTrustworthyErrorMessage(); + errorMessage = getSecurityOrigin()->isPotentiallyTrustworthyErrorMessage(); return false; } diff --git a/third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.h b/third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.h index 2546c2f..e1d63579 100644 --- a/third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.h +++ b/third_party/WebKit/Source/modules/worklet/WorkletGlobalScope.h @@ -42,7 +42,7 @@ public: WorkletConsole* console(); // WorkerOrWorkletGlobalScope - ScriptWrappable* scriptWrappable() const final { return const_cast<WorkletGlobalScope*>(this); } + ScriptWrappable* getScriptWrappable() const final { return const_cast<WorkletGlobalScope*>(this); } WorkerOrWorkletScriptController* scriptController() final { return m_scriptController.get(); } // ScriptWrappable @@ -53,10 +53,10 @@ public: void disableEval(const String& errorMessage) final; String userAgent() const final { return m_userAgent; } SecurityContext& securityContext() final { return *this; } - EventQueue* eventQueue() const final { ASSERT_NOT_REACHED(); return nullptr; } // WorkletGlobalScopes don't have an event queue. + EventQueue* getEventQueue() const final { ASSERT_NOT_REACHED(); return nullptr; } // WorkletGlobalScopes don't have an event queue. bool isSecureContext(String& errorMessage, const SecureContextCheck = StandardSecureContextCheck) const final; - using SecurityContext::securityOrigin; + using SecurityContext::getSecurityOrigin; using SecurityContext::contentSecurityPolicy; DOMTimerCoordinator* timers() final { ASSERT_NOT_REACHED(); return nullptr; } // WorkletGlobalScopes don't have timers. diff --git a/third_party/WebKit/Source/platform/EncryptedMediaRequest.h b/third_party/WebKit/Source/platform/EncryptedMediaRequest.h index a260abf..6e396fa 100644 --- a/third_party/WebKit/Source/platform/EncryptedMediaRequest.h +++ b/third_party/WebKit/Source/platform/EncryptedMediaRequest.h @@ -22,7 +22,7 @@ public: virtual WebString keySystem() const = 0; virtual const WebVector<WebMediaKeySystemConfiguration>& supportedConfigurations() const = 0; - virtual SecurityOrigin* securityOrigin() const = 0; + virtual SecurityOrigin* getSecurityOrigin() const = 0; virtual void requestSucceeded(WebContentDecryptionModuleAccess*) = 0; virtual void requestNotSupported(const WebString& errorMessage) = 0; diff --git a/third_party/WebKit/Source/platform/exported/WebEncryptedMediaRequest.cpp b/third_party/WebKit/Source/platform/exported/WebEncryptedMediaRequest.cpp index 4409af0..23e12ae 100644 --- a/third_party/WebKit/Source/platform/exported/WebEncryptedMediaRequest.cpp +++ b/third_party/WebKit/Source/platform/exported/WebEncryptedMediaRequest.cpp @@ -38,9 +38,9 @@ const WebVector<WebMediaKeySystemConfiguration>& WebEncryptedMediaRequest::suppo return m_private->supportedConfigurations(); } -WebSecurityOrigin WebEncryptedMediaRequest::securityOrigin() const +WebSecurityOrigin WebEncryptedMediaRequest::getSecurityOrigin() const { - return WebSecurityOrigin(m_private->securityOrigin()); + return WebSecurityOrigin(m_private->getSecurityOrigin()); } void WebEncryptedMediaRequest::requestSucceeded(WebContentDecryptionModuleAccess* access) diff --git a/third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.h b/third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.h index 8a7824c..7594056 100644 --- a/third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.h +++ b/third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.h @@ -68,7 +68,7 @@ public: void setEnabled(bool enabled) { m_enabled = enabled; } bool muted() const { return m_muted; } void setMuted(bool muted) { m_muted = muted; } - AudioSourceProvider* audioSourceProvider() { return &m_sourceProvider; } + AudioSourceProvider* getAudioSourceProvider() { return &m_sourceProvider; } void setSourceProvider(WebAudioSourceProvider* provider) { m_sourceProvider.wrap(provider); } ExtraData* extraData() const { return m_extraData.get(); } diff --git a/third_party/WebKit/Source/web/AudioOutputDeviceClientImpl.cpp b/third_party/WebKit/Source/web/AudioOutputDeviceClientImpl.cpp index 398a5f6..a430be4 100644 --- a/third_party/WebKit/Source/web/AudioOutputDeviceClientImpl.cpp +++ b/third_party/WebKit/Source/web/AudioOutputDeviceClientImpl.cpp @@ -29,7 +29,7 @@ void AudioOutputDeviceClientImpl::checkIfAudioSinkExistsAndIsAuthorized(Executio ASSERT(context && context->isDocument()); Document* document = toDocument(context); WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->frame()); - webFrame->client()->checkIfAudioSinkExistsAndIsAuthorized(sinkId, WebSecurityOrigin(context->securityOrigin()), callbacks.leakPtr()); + webFrame->client()->checkIfAudioSinkExistsAndIsAuthorized(sinkId, WebSecurityOrigin(context->getSecurityOrigin()), callbacks.leakPtr()); } } // namespace blink diff --git a/third_party/WebKit/Source/web/ChromeClientImpl.cpp b/third_party/WebKit/Source/web/ChromeClientImpl.cpp index b099c8b..e2e82f9 100644 --- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp +++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp @@ -722,10 +722,10 @@ void ChromeClientImpl::setCursorOverridden(bool overridden) void ChromeClientImpl::postAccessibilityNotification(AXObject* obj, AXObjectCache::AXNotification notification) { // Alert assistive technology about the accessibility object notification. - if (!obj || !obj->document()) + if (!obj || !obj->getDocument()) return; - WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(obj->document()->axObjectCacheOwner().frame()); + WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(obj->getDocument()->axObjectCacheOwner().frame()); if (webframe && webframe->client()) webframe->client()->postAccessibilityEvent(WebAXObject(obj), toWebAXEvent(notification)); } diff --git a/third_party/WebKit/Source/web/ContextFeaturesClientImpl.cpp b/third_party/WebKit/Source/web/ContextFeaturesClientImpl.cpp index f4bf9f0..066139c 100644 --- a/third_party/WebKit/Source/web/ContextFeaturesClientImpl.cpp +++ b/third_party/WebKit/Source/web/ContextFeaturesClientImpl.cpp @@ -116,7 +116,7 @@ ContextFeaturesCache& ContextFeaturesCache::from(Document& document) void ContextFeaturesCache::validateAgainst(Document* document) { - String currentDomain = document->securityOrigin()->domain(); + String currentDomain = document->getSecurityOrigin()->domain(); if (currentDomain == m_domain) return; m_domain = currentDomain; diff --git a/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp b/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp index 4eead30..3dce1b8 100644 --- a/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp +++ b/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp @@ -268,7 +268,7 @@ void ContextMenuClientImpl::showContextMenu(const ContextMenu* defaultMenu) // It mostly works to convert the security origin to a URL, but // extensions accessing that property will not get the correct value // in that case. See https://crbug.com/534561 - WebSecurityOrigin origin = m_webView->mainFrame()->securityOrigin(); + WebSecurityOrigin origin = m_webView->mainFrame()->getSecurityOrigin(); if (!origin.isNull()) data.pageURL = KURL(ParsedURLString, origin.toString()); } else { diff --git a/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp b/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp index 2e93627..4ac562a 100644 --- a/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp +++ b/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp @@ -818,7 +818,7 @@ PassOwnPtr<WebMediaPlayer> FrameLoaderClientImpl::createWebMediaPlayer( WebMediaSession* webMediaSession = nullptr; if (MediaSession* mediaSession = HTMLMediaElementMediaSession::session(htmlMediaElement)) - webMediaSession = mediaSession->webMediaSession(); + webMediaSession = mediaSession->getWebMediaSession(); HTMLMediaElementEncryptedMedia& encryptedMedia = HTMLMediaElementEncryptedMedia::from(htmlMediaElement); WebString sinkId(HTMLMediaElementAudioOutputDevice::sinkId(htmlMediaElement)); diff --git a/third_party/WebKit/Source/web/IndexedDBClientImpl.cpp b/third_party/WebKit/Source/web/IndexedDBClientImpl.cpp index 9069a51..5a1b900 100644 --- a/third_party/WebKit/Source/web/IndexedDBClientImpl.cpp +++ b/third_party/WebKit/Source/web/IndexedDBClientImpl.cpp @@ -50,7 +50,7 @@ bool IndexedDBClientImpl::allowIndexedDB(ExecutionContext* context, const String ASSERT_WITH_SECURITY_IMPLICATION(context->isDocument() || context->isWorkerGlobalScope()); if (context->isDocument()) { - WebSecurityOrigin origin(context->securityOrigin()); + WebSecurityOrigin origin(context->getSecurityOrigin()); Document* document = toDocument(context); WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->frame()); // FIXME: webFrame->contentSettingsClient() returns 0 in test_shell and content_shell http://crbug.com/137269 diff --git a/third_party/WebKit/Source/web/NotificationPermissionClientImpl.cpp b/third_party/WebKit/Source/web/NotificationPermissionClientImpl.cpp index 60c4c985..9334e3f 100644 --- a/third_party/WebKit/Source/web/NotificationPermissionClientImpl.cpp +++ b/third_party/WebKit/Source/web/NotificationPermissionClientImpl.cpp @@ -61,7 +61,7 @@ ScriptPromise NotificationPermissionClientImpl::requestPermission(ScriptState* s { ASSERT(scriptState); - ExecutionContext* context = scriptState->executionContext(); + ExecutionContext* context = scriptState->getExecutionContext(); ASSERT(context && context->isDocument()); Document* document = toDocument(context); @@ -70,7 +70,7 @@ ScriptPromise NotificationPermissionClientImpl::requestPermission(ScriptState* s ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); ScriptPromise promise = resolver->promise(); - webFrame->client()->requestNotificationPermission(WebSecurityOrigin(context->securityOrigin()), new WebNotificationPermissionCallbackImpl(resolver, deprecatedCallback)); + webFrame->client()->requestNotificationPermission(WebSecurityOrigin(context->getSecurityOrigin()), new WebNotificationPermissionCallbackImpl(resolver, deprecatedCallback)); return promise; } diff --git a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp index f187c2a..283ccca 100644 --- a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp +++ b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp @@ -230,7 +230,7 @@ void ServiceWorkerGlobalScopeProxy::didEvaluateWorkerScript(bool success) void ServiceWorkerGlobalScopeProxy::didInitializeWorkerContext() { - ScriptState::Scope scope(workerGlobalScope()->scriptController()->scriptState()); + ScriptState::Scope scope(workerGlobalScope()->scriptController()->getScriptState()); client().didInitializeWorkerContext(workerGlobalScope()->scriptController()->context()); } @@ -297,7 +297,7 @@ void ServiceWorkerGlobalScopeProxy::dispatchFetchEventImpl(int eventID, const We { RespondWithObserver* observer = RespondWithObserver::create(workerGlobalScope(), eventID, webRequest.url(), webRequest.mode(), webRequest.frameType(), webRequest.requestContext()); Request* request = Request::create(workerGlobalScope(), webRequest); - request->headers()->setGuard(Headers::ImmutableGuard); + request->getHeaders()->setGuard(Headers::ImmutableGuard); FetchEventInit eventInit; eventInit.setCancelable(true); eventInit.setRequest(request); diff --git a/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp b/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp index d7aeb70..bbe6367 100644 --- a/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp +++ b/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp @@ -113,14 +113,14 @@ void SharedWorkerRepositoryClientImpl::connect(SharedWorker* worker, PassOwnPtr< ASSERT(m_client); // No nested workers (for now) - connect() should only be called from document context. - ASSERT(worker->executionContext()->isDocument()); - Document* document = toDocument(worker->executionContext()); + ASSERT(worker->getExecutionContext()->isDocument()); + Document* document = toDocument(worker->getExecutionContext()); // TODO(estark): this is broken, as it only uses the first header // when multiple might have been sent. Fix by making the // SharedWorkerConnector interface take a map that can contain // multiple headers. - OwnPtr<Vector<CSPHeaderAndType>> headers = worker->executionContext()->contentSecurityPolicy()->headers(); + OwnPtr<Vector<CSPHeaderAndType>> headers = worker->getExecutionContext()->contentSecurityPolicy()->headers(); WebString header; WebContentSecurityPolicyType headerType = WebContentSecurityPolicyTypeReport; @@ -131,8 +131,8 @@ void SharedWorkerRepositoryClientImpl::connect(SharedWorker* worker, PassOwnPtr< WebWorkerCreationError creationError; String unusedSecureContextError; - bool isSecureContext = worker->executionContext()->isSecureContext(unusedSecureContextError); - OwnPtr<WebSharedWorkerConnector> webWorkerConnector = adoptPtr(m_client->createSharedWorkerConnector(url, name, getId(document), header, headerType, worker->executionContext()->securityContext().addressSpace(), isSecureContext ? WebSharedWorkerCreationContextTypeSecure : WebSharedWorkerCreationContextTypeNonsecure, &creationError)); + bool isSecureContext = worker->getExecutionContext()->isSecureContext(unusedSecureContextError); + OwnPtr<WebSharedWorkerConnector> webWorkerConnector = adoptPtr(m_client->createSharedWorkerConnector(url, name, getId(document), header, headerType, worker->getExecutionContext()->securityContext().addressSpace(), isSecureContext ? WebSharedWorkerCreationContextTypeSecure : WebSharedWorkerCreationContextTypeNonsecure, &creationError)); if (creationError != WebWorkerCreationErrorNone) { if (creationError == WebWorkerCreationErrorURLMismatch) { // Existing worker does not match this url, so return an error back to the caller. diff --git a/third_party/WebKit/Source/web/SpeechRecognitionClientProxy.cpp b/third_party/WebKit/Source/web/SpeechRecognitionClientProxy.cpp index 8e6d927..798091f 100644 --- a/third_party/WebKit/Source/web/SpeechRecognitionClientProxy.cpp +++ b/third_party/WebKit/Source/web/SpeechRecognitionClientProxy.cpp @@ -64,7 +64,7 @@ void SpeechRecognitionClientProxy::start(SpeechRecognition* recognition, const S WebMediaStreamTrack track; if (RuntimeEnabledFeatures::mediaStreamSpeechEnabled() && audioTrack) track.assign(audioTrack->component()); - WebSpeechRecognitionParams params(webSpeechGrammars, lang, continuous, interimResults, maxAlternatives, track, WebSecurityOrigin(recognition->executionContext()->securityOrigin())); + WebSpeechRecognitionParams params(webSpeechGrammars, lang, continuous, interimResults, maxAlternatives, track, WebSecurityOrigin(recognition->getExecutionContext()->getSecurityOrigin())); m_recognizer->start(recognition, params, this); } diff --git a/third_party/WebKit/Source/web/StorageQuotaClientImpl.cpp b/third_party/WebKit/Source/web/StorageQuotaClientImpl.cpp index bc3ea50..29870a4 100644 --- a/third_party/WebKit/Source/web/StorageQuotaClientImpl.cpp +++ b/third_party/WebKit/Source/web/StorageQuotaClientImpl.cpp @@ -77,8 +77,8 @@ ScriptPromise StorageQuotaClientImpl::requestPersistentQuota(ScriptState* script ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); ScriptPromise promise = resolver->promise(); - if (scriptState->executionContext()->isDocument()) { - Document* document = toDocument(scriptState->executionContext()); + if (scriptState->getExecutionContext()->isDocument()) { + Document* document = toDocument(scriptState->getExecutionContext()); WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->frame()); StorageQuotaCallbacks* callbacks = StorageQuotaCallbacksImpl::create(resolver); webFrame->client()->requestStorageQuota(WebStorageQuotaTypePersistent, newQuotaInBytes, callbacks); diff --git a/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp b/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp index 5929784..451911c 100644 --- a/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp +++ b/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp @@ -50,7 +50,7 @@ void SuspendableScriptExecutor::fired() void SuspendableScriptExecutor::run() { - ExecutionContext* context = executionContext(); + ExecutionContext* context = getExecutionContext(); ASSERT(context); if (!context->activeDOMObjectsAreSuspended()) { suspendIfNeeded(); diff --git a/third_party/WebKit/Source/web/WebAXObject.cpp b/third_party/WebKit/Source/web/WebAXObject.cpp index ff44de7..ca85de8 100644 --- a/third_party/WebKit/Source/web/WebAXObject.cpp +++ b/third_party/WebKit/Source/web/WebAXObject.cpp @@ -123,7 +123,7 @@ int WebAXObject::axID() const bool WebAXObject::updateLayoutAndCheckValidity() { if (!isDetached()) { - Document* document = m_private->document(); + Document* document = m_private->getDocument(); if (!document || !document->topDocument().view()) return false; document->view()->updateAllLifecyclePhases(); @@ -631,7 +631,7 @@ WebRect WebAXObject::boundingBoxRect() const if (isDetached()) return WebRect(); - ASSERT(isLayoutClean(m_private->document())); + ASSERT(isLayoutClean(m_private->getDocument())); return pixelSnappedIntRect(m_private->elementRect()); } @@ -923,7 +923,7 @@ void WebAXObject::showContextMenu() const if (isDetached()) return; - Node* node = m_private->node(); + Node* node = m_private->getNode(); if (!node) return; @@ -1082,7 +1082,7 @@ WebNode WebAXObject::node() const if (isDetached()) return WebNode(); - Node* node = m_private->node(); + Node* node = m_private->getNode(); if (!node) return WebNode(); @@ -1094,7 +1094,7 @@ WebDocument WebAXObject::document() const if (isDetached()) return WebDocument(); - Document* document = m_private->document(); + Document* document = m_private->getDocument(); if (!document) return WebDocument(); @@ -1106,11 +1106,11 @@ bool WebAXObject::hasComputedStyle() const if (isDetached()) return false; - Document* document = m_private->document(); + Document* document = m_private->getDocument(); if (document) document->updateLayoutTree(); - Node* node = m_private->node(); + Node* node = m_private->getNode(); if (!node) return false; @@ -1122,11 +1122,11 @@ WebString WebAXObject::computedStyleDisplay() const if (isDetached()) return WebString(); - Document* document = m_private->document(); + Document* document = m_private->getDocument(); if (document) document->updateLayoutTree(); - Node* node = m_private->node(); + Node* node = m_private->getNode(); if (!node) return WebString(); diff --git a/third_party/WebKit/Source/web/WebDevToolsFrontendImpl.cpp b/third_party/WebKit/Source/web/WebDevToolsFrontendImpl.cpp index 59d83a5..74edde6 100644 --- a/third_party/WebKit/Source/web/WebDevToolsFrontendImpl.cpp +++ b/third_party/WebKit/Source/web/WebDevToolsFrontendImpl.cpp @@ -86,7 +86,7 @@ void WebDevToolsFrontendImpl::didClearWindowObject(WebLocalFrameImpl* frame) if (m_injectedScriptForOrigin.isEmpty()) return; - String origin = frame->securityOrigin().toString(); + String origin = frame->getSecurityOrigin().toString(); String script = m_injectedScriptForOrigin.get(origin); if (script.isEmpty()) return; diff --git a/third_party/WebKit/Source/web/WebDocument.cpp b/third_party/WebKit/Source/web/WebDocument.cpp index 80aad5b..e1a0c23 100644 --- a/third_party/WebKit/Source/web/WebDocument.cpp +++ b/third_party/WebKit/Source/web/WebDocument.cpp @@ -74,11 +74,11 @@ WebURL WebDocument::url() const return constUnwrap<Document>()->url(); } -WebSecurityOrigin WebDocument::securityOrigin() const +WebSecurityOrigin WebDocument::getSecurityOrigin() const { if (!constUnwrap<Document>()) return WebSecurityOrigin(); - return WebSecurityOrigin(constUnwrap<Document>()->securityOrigin()); + return WebSecurityOrigin(constUnwrap<Document>()->getSecurityOrigin()); } bool WebDocument::isSecureContext(WebString& errorMessage) const diff --git a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp index f20b49a..05d8ae6 100644 --- a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp +++ b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp @@ -348,7 +348,7 @@ void WebEmbeddedWorkerImpl::startWorkerThread() Document* document = m_mainFrame->frame()->document(); // FIXME: this document's origin is pristine and without any extra privileges. (crbug.com/254993) - SecurityOrigin* starterOrigin = document->securityOrigin(); + SecurityOrigin* starterOrigin = document->getSecurityOrigin(); OwnPtrWillBeRawPtr<WorkerClients> workerClients = WorkerClients::create(); provideContentSettingsClientToWorker(workerClients.get(), m_contentSettingsClient.release()); diff --git a/third_party/WebKit/Source/web/WebFrame.cpp b/third_party/WebKit/Source/web/WebFrame.cpp index 338b461..e77815d 100644 --- a/third_party/WebKit/Source/web/WebFrame.cpp +++ b/third_party/WebKit/Source/web/WebFrame.cpp @@ -117,9 +117,9 @@ void WebFrame::detach() toImplBase()->frame()->detach(FrameDetachType::Remove); } -WebSecurityOrigin WebFrame::securityOrigin() const +WebSecurityOrigin WebFrame::getSecurityOrigin() const { - return WebSecurityOrigin(toImplBase()->frame()->securityContext()->securityOrigin()); + return WebSecurityOrigin(toImplBase()->frame()->securityContext()->getSecurityOrigin()); } diff --git a/third_party/WebKit/Source/web/WebGeolocationPermissionRequest.cpp b/third_party/WebKit/Source/web/WebGeolocationPermissionRequest.cpp index c19a1f0..29540c0 100644 --- a/third_party/WebKit/Source/web/WebGeolocationPermissionRequest.cpp +++ b/third_party/WebKit/Source/web/WebGeolocationPermissionRequest.cpp @@ -43,9 +43,9 @@ void WebGeolocationPermissionRequest::reset() m_private.reset(); } -WebSecurityOrigin WebGeolocationPermissionRequest::securityOrigin() const +WebSecurityOrigin WebGeolocationPermissionRequest::getSecurityOrigin() const { - return WebSecurityOrigin(m_private->executionContext()->securityOrigin()); + return WebSecurityOrigin(m_private->getExecutionContext()->getSecurityOrigin()); } void WebGeolocationPermissionRequest::setIsAllowed(bool allowed) diff --git a/third_party/WebKit/Source/web/WebMIDIPermissionRequest.cpp b/third_party/WebKit/Source/web/WebMIDIPermissionRequest.cpp index 504275c..be2b7ff 100644 --- a/third_party/WebKit/Source/web/WebMIDIPermissionRequest.cpp +++ b/third_party/WebKit/Source/web/WebMIDIPermissionRequest.cpp @@ -56,9 +56,9 @@ bool WebMIDIPermissionRequest::equals(const WebMIDIPermissionRequest& n) const return m_private.get() == n.m_private.get(); } -WebSecurityOrigin WebMIDIPermissionRequest::securityOrigin() const +WebSecurityOrigin WebMIDIPermissionRequest::getSecurityOrigin() const { - return WebSecurityOrigin(m_private->securityOrigin()); + return WebSecurityOrigin(m_private->getSecurityOrigin()); } void WebMIDIPermissionRequest::setIsAllowed(bool allowed) diff --git a/third_party/WebKit/Source/web/WebMediaDevicesRequest.cpp b/third_party/WebKit/Source/web/WebMediaDevicesRequest.cpp index c86e9df..a20f5815 100644 --- a/third_party/WebKit/Source/web/WebMediaDevicesRequest.cpp +++ b/third_party/WebKit/Source/web/WebMediaDevicesRequest.cpp @@ -47,10 +47,10 @@ void WebMediaDevicesRequest::reset() m_private.reset(); } -WebSecurityOrigin WebMediaDevicesRequest::securityOrigin() const +WebSecurityOrigin WebMediaDevicesRequest::getSecurityOrigin() const { - ASSERT(!isNull() && m_private->executionContext()); - return WebSecurityOrigin(m_private->executionContext()->securityOrigin()); + ASSERT(!isNull() && m_private->getExecutionContext()); + return WebSecurityOrigin(m_private->getExecutionContext()->getSecurityOrigin()); } WebDocument WebMediaDevicesRequest::ownerDocument() const diff --git a/third_party/WebKit/Source/web/WebNode.cpp b/third_party/WebKit/Source/web/WebNode.cpp index e5bb144..ed7f5ec 100644 --- a/third_party/WebKit/Source/web/WebNode.cpp +++ b/third_party/WebKit/Source/web/WebNode.cpp @@ -219,12 +219,12 @@ bool WebNode::isDocumentTypeNode() const void WebNode::dispatchEvent(const WebDOMEvent& event) { if (!event.isNull()) - m_private->executionContext()->postSuspendableTask(adoptPtr(new NodeDispatchEventTask(m_private, event))); + m_private->getExecutionContext()->postSuspendableTask(adoptPtr(new NodeDispatchEventTask(m_private, event))); } void WebNode::simulateClick() { - m_private->executionContext()->postSuspendableTask(adoptPtr(new NodeDispatchSimulatedClickTask(m_private))); + m_private->getExecutionContext()->postSuspendableTask(adoptPtr(new NodeDispatchSimulatedClickTask(m_private))); } WebElementCollection WebNode::getElementsByHTMLTagName(const WebString& tag) const diff --git a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp index 45ecd18..0344fbc 100644 --- a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp +++ b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp @@ -326,11 +326,11 @@ void WebSharedWorkerImpl::onScriptLoaderFinished() Document* document = m_mainFrame->frame()->document(); // FIXME: this document's origin is pristine and without any extra privileges. (crbug.com/254993) - SecurityOrigin* starterOrigin = document->securityOrigin(); + SecurityOrigin* starterOrigin = document->getSecurityOrigin(); OwnPtrWillBeRawPtr<WorkerClients> workerClients = WorkerClients::create(); provideLocalFileSystemToWorker(workerClients.get(), LocalFileSystemClient::create()); - WebSecurityOrigin webSecurityOrigin(m_loadingDocument->securityOrigin()); + WebSecurityOrigin webSecurityOrigin(m_loadingDocument->getSecurityOrigin()); provideContentSettingsClientToWorker(workerClients.get(), adoptPtr(m_client->createWorkerContentSettingsClientProxy(webSecurityOrigin))); RefPtrWillBeRawPtr<ContentSecurityPolicy> contentSecurityPolicy = m_mainScriptLoader->releaseContentSecurityPolicy(); WorkerThreadStartMode startMode = m_workerInspectorProxy->workerStartMode(document); diff --git a/third_party/WebKit/Source/web/WebUserMediaRequest.cpp b/third_party/WebKit/Source/web/WebUserMediaRequest.cpp index aa4131e..0b7fa40 100644 --- a/third_party/WebKit/Source/web/WebUserMediaRequest.cpp +++ b/third_party/WebKit/Source/web/WebUserMediaRequest.cpp @@ -78,10 +78,10 @@ WebMediaConstraints WebUserMediaRequest::videoConstraints() const return m_private->videoConstraints(); } -WebSecurityOrigin WebUserMediaRequest::securityOrigin() const +WebSecurityOrigin WebUserMediaRequest::getSecurityOrigin() const { - ASSERT(!isNull() && m_private->executionContext()); - return WebSecurityOrigin(m_private->executionContext()->securityOrigin()); + ASSERT(!isNull() && m_private->getExecutionContext()); + return WebSecurityOrigin(m_private->getExecutionContext()->getSecurityOrigin()); } WebDocument WebUserMediaRequest::ownerDocument() const diff --git a/third_party/WebKit/Source/web/WorkerGlobalScopeProxyProviderImpl.cpp b/third_party/WebKit/Source/web/WorkerGlobalScopeProxyProviderImpl.cpp index f351c47..69cb308 100644 --- a/third_party/WebKit/Source/web/WorkerGlobalScopeProxyProviderImpl.cpp +++ b/third_party/WebKit/Source/web/WorkerGlobalScopeProxyProviderImpl.cpp @@ -47,8 +47,8 @@ namespace blink { WorkerGlobalScopeProxy* WorkerGlobalScopeProxyProviderImpl::createWorkerGlobalScopeProxy(Worker* worker) { - if (worker->executionContext()->isDocument()) { - Document* document = toDocument(worker->executionContext()); + if (worker->getExecutionContext()->isDocument()) { + Document* document = toDocument(worker->getExecutionContext()); WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->frame()); OwnPtrWillBeRawPtr<WorkerClients> workerClients = WorkerClients::create(); provideLocalFileSystemToWorker(workerClients.get(), LocalFileSystemClient::create()); diff --git a/third_party/WebKit/Source/web/tests/MHTMLTest.cpp b/third_party/WebKit/Source/web/tests/MHTMLTest.cpp index f429275..5bf20f2 100644 --- a/third_party/WebKit/Source/web/tests/MHTMLTest.cpp +++ b/third_party/WebKit/Source/web/tests/MHTMLTest.cpp @@ -194,7 +194,7 @@ TEST_F(MHTMLTest, CheckDomain) EXPECT_STREQ(kFileURL, frame->domWindow()->location()->href().ascii().data()); - SecurityOrigin* origin = document->securityOrigin(); + SecurityOrigin* origin = document->getSecurityOrigin(); EXPECT_STRNE("localhost", origin->domain().ascii().data()); } diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp index 972c7f4..5ba5650c 100644 --- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp +++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp @@ -7709,7 +7709,7 @@ TEST_F(WebFrameTest, NavigateRemoteToLocalWithOpener) popupView->setMainFrame(popupRemoteFrame); popupRemoteFrame->setOpener(mainFrame); popupRemoteFrame->setReplicatedOrigin(WebSecurityOrigin::createFromString("http://foo.com")); - EXPECT_FALSE(mainFrame->securityOrigin().canAccess(popupView->mainFrame()->securityOrigin())); + EXPECT_FALSE(mainFrame->getSecurityOrigin().canAccess(popupView->mainFrame()->getSecurityOrigin())); // Do a remote-to-local swap in the popup. FrameTestHelpers::TestWebFrameClient popupLocalClient; @@ -7718,7 +7718,7 @@ TEST_F(WebFrameTest, NavigateRemoteToLocalWithOpener) // The initial document created during the remote-to-local swap should have // inherited its opener's SecurityOrigin. - EXPECT_TRUE(mainFrame->securityOrigin().canAccess(popupView->mainFrame()->securityOrigin())); + EXPECT_TRUE(mainFrame->getSecurityOrigin().canAccess(popupView->mainFrame()->getSecurityOrigin())); popupView->close(); } diff --git a/third_party/WebKit/public/platform/WebCredential.h b/third_party/WebKit/public/platform/WebCredential.h index 23c7091..8586302 100644 --- a/third_party/WebKit/public/platform/WebCredential.h +++ b/third_party/WebKit/public/platform/WebCredential.h @@ -37,7 +37,7 @@ public: #if INSIDE_BLINK BLINK_PLATFORM_EXPORT static WebCredential create(PlatformCredential*); BLINK_PLATFORM_EXPORT WebCredential& operator=(PlatformCredential*); - BLINK_PLATFORM_EXPORT PlatformCredential* platformCredential() const { return m_platformCredential.get(); } + BLINK_PLATFORM_EXPORT PlatformCredential* getPlatformCredential() const { return m_platformCredential.get(); } #endif protected: diff --git a/third_party/WebKit/public/platform/WebEncryptedMediaRequest.h b/third_party/WebKit/public/platform/WebEncryptedMediaRequest.h index 16f5a60..f981f1b 100644 --- a/third_party/WebKit/public/platform/WebEncryptedMediaRequest.h +++ b/third_party/WebKit/public/platform/WebEncryptedMediaRequest.h @@ -25,7 +25,7 @@ public: BLINK_PLATFORM_EXPORT WebString keySystem() const; BLINK_PLATFORM_EXPORT const WebVector<WebMediaKeySystemConfiguration>& supportedConfigurations() const; - BLINK_PLATFORM_EXPORT WebSecurityOrigin securityOrigin() const; + BLINK_PLATFORM_EXPORT WebSecurityOrigin getSecurityOrigin() const; BLINK_PLATFORM_EXPORT void requestSucceeded(WebContentDecryptionModuleAccess*); BLINK_PLATFORM_EXPORT void requestNotSupported(const WebString& errorMessage); diff --git a/third_party/WebKit/public/platform/WebMediaPlayer.h b/third_party/WebKit/public/platform/WebMediaPlayer.h index 68a8803..9a5eb43 100644 --- a/third_party/WebKit/public/platform/WebMediaPlayer.h +++ b/third_party/WebKit/public/platform/WebMediaPlayer.h @@ -173,7 +173,7 @@ public: unsigned texture, int level, int xoffset, int yoffset, bool premultiplyAlpha, bool flipY) { return false; } - virtual WebAudioSourceProvider* audioSourceProvider() { return nullptr; } + virtual WebAudioSourceProvider* getAudioSourceProvider() { return nullptr; } virtual void setContentDecryptionModule(WebContentDecryptionModule* cdm, WebContentDecryptionModuleResult result) { result.completeWithError(WebContentDecryptionModuleExceptionNotSupportedError, 0, "ERROR"); } diff --git a/third_party/WebKit/public/web/WebDocument.h b/third_party/WebKit/public/web/WebDocument.h index 2960c6d..3db06b6 100644 --- a/third_party/WebKit/public/web/WebDocument.h +++ b/third_party/WebKit/public/web/WebDocument.h @@ -74,8 +74,8 @@ public: void assign(const WebDocument& e) { WebNode::assign(e); } BLINK_EXPORT WebURL url() const; - // Note: Security checks should use the securityOrigin(), not url(). - BLINK_EXPORT WebSecurityOrigin securityOrigin() const; + // Note: Security checks should use the getSecurityOrigin(), not url(). + BLINK_EXPORT WebSecurityOrigin getSecurityOrigin() const; BLINK_EXPORT bool isSecureContext(WebString& errorMessage) const; BLINK_EXPORT WebString encoding() const; diff --git a/third_party/WebKit/public/web/WebFrame.h b/third_party/WebKit/public/web/WebFrame.h index 4a1e5c7c..06264de 100644 --- a/third_party/WebKit/public/web/WebFrame.h +++ b/third_party/WebKit/public/web/WebFrame.h @@ -159,7 +159,7 @@ public: virtual void setSharedWorkerRepositoryClient(WebSharedWorkerRepositoryClient*) = 0; // The security origin of this frame. - BLINK_EXPORT WebSecurityOrigin securityOrigin() const; + BLINK_EXPORT WebSecurityOrigin getSecurityOrigin() const; // Updates the sandbox flags in the frame's FrameOwner. This is used when // this frame's parent is in another process and it dynamically updates diff --git a/third_party/WebKit/public/web/WebGeolocationPermissionRequest.h b/third_party/WebKit/public/web/WebGeolocationPermissionRequest.h index c9fe120..29d4c97 100644 --- a/third_party/WebKit/public/web/WebGeolocationPermissionRequest.h +++ b/third_party/WebKit/public/web/WebGeolocationPermissionRequest.h @@ -42,7 +42,7 @@ class WebSecurityOrigin; class WebGeolocationPermissionRequest { public: ~WebGeolocationPermissionRequest() { reset(); } - BLINK_EXPORT WebSecurityOrigin securityOrigin() const; + BLINK_EXPORT WebSecurityOrigin getSecurityOrigin() const; BLINK_EXPORT void setIsAllowed(bool); #if BLINK_IMPLEMENTATION diff --git a/third_party/WebKit/public/web/WebMediaDevicesRequest.h b/third_party/WebKit/public/web/WebMediaDevicesRequest.h index 469a699..2b9a39c 100644 --- a/third_party/WebKit/public/web/WebMediaDevicesRequest.h +++ b/third_party/WebKit/public/web/WebMediaDevicesRequest.h @@ -55,7 +55,7 @@ public: BLINK_EXPORT bool equals(const WebMediaDevicesRequest&) const; BLINK_EXPORT void assign(const WebMediaDevicesRequest&); - BLINK_EXPORT WebSecurityOrigin securityOrigin() const; + BLINK_EXPORT WebSecurityOrigin getSecurityOrigin() const; BLINK_EXPORT WebDocument ownerDocument() const; BLINK_EXPORT void requestSucceeded(WebVector<WebMediaDeviceInfo>); diff --git a/third_party/WebKit/public/web/WebUserMediaRequest.h b/third_party/WebKit/public/web/WebUserMediaRequest.h index dd9d399..93d7405 100644 --- a/third_party/WebKit/public/web/WebUserMediaRequest.h +++ b/third_party/WebKit/public/web/WebUserMediaRequest.h @@ -65,7 +65,7 @@ public: BLINK_EXPORT WebMediaConstraints audioConstraints() const; BLINK_EXPORT WebMediaConstraints videoConstraints() const; - BLINK_EXPORT WebSecurityOrigin securityOrigin() const; + BLINK_EXPORT WebSecurityOrigin getSecurityOrigin() const; BLINK_EXPORT WebDocument ownerDocument() const; BLINK_EXPORT void requestSucceeded(const WebMediaStream&); diff --git a/third_party/WebKit/public/web/modules/webmidi/WebMIDIPermissionRequest.h b/third_party/WebKit/public/web/modules/webmidi/WebMIDIPermissionRequest.h index 7d69c4c..3c20dfb 100644 --- a/third_party/WebKit/public/web/modules/webmidi/WebMIDIPermissionRequest.h +++ b/third_party/WebKit/public/web/modules/webmidi/WebMIDIPermissionRequest.h @@ -56,7 +56,7 @@ public: reset(); } - BLINK_EXPORT WebSecurityOrigin securityOrigin() const; + BLINK_EXPORT WebSecurityOrigin getSecurityOrigin() const; BLINK_EXPORT void setIsAllowed(bool); BLINK_EXPORT bool equals(const WebMIDIPermissionRequest&) const; |