diff --git a/base/bind.h b/base/bind.h index 944b7d8..b8e3d2a4 100644 --- a/base/bind.h +++ b/base/bind.h
@@ -239,8 +239,8 @@ template <typename Functor, typename... Args> inline Callback<MakeUnboundRunType<Functor, Args...>> Bind(Functor&& functor, Args&&... args) { - return BindRepeating(std::forward<Functor>(functor), - std::forward<Args>(args)...); + return base::BindRepeating(std::forward<Functor>(functor), + std::forward<Args>(args)...); } // Special cases for binding to a base::Callback without extra bound arguments.
diff --git a/chrome/VERSION b/chrome/VERSION index e4d2d82..4fee3b65e 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ -MAJOR=64 +MAJOR=65 MINOR=0 -BUILD=3282 +BUILD=3283 PATCH=0
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/password/PasswordReauthenticationFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/password/PasswordReauthenticationFragment.java index 8c183e1..5b26043 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/password/PasswordReauthenticationFragment.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/password/PasswordReauthenticationFragment.java
@@ -41,8 +41,8 @@ if (requestCode == CONFIRM_DEVICE_CREDENTIAL_REQUEST_CODE) { if (resultCode == getActivity().RESULT_OK) { ReauthenticationManager.setLastReauthTimeMillis(System.currentTimeMillis()); - mFragmentManager.popBackStack(); } + mFragmentManager.popBackStack(); } }
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/preferences/password/PasswordReauthenticationFragmentTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/preferences/password/PasswordReauthenticationFragmentTest.java index 0c22c37b..1a756cd 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/preferences/password/PasswordReauthenticationFragmentTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/preferences/password/PasswordReauthenticationFragmentTest.java
@@ -26,12 +26,13 @@ @Config(manifest = Config.NONE) public class PasswordReauthenticationFragmentTest { /** - * Ensure that upon reauthentication PasswordReauthenticationFragment is popped from - * the FragmentManager backstack. + * Creates a dummy fragment, pushes the reauth fragment on top of it, then resolves the activity + * for the reauth fragment and checks that back stack is in a correct state. + * @param resultCode The code which is passed to the reauth fragment as the result of the + * activity. */ - @Test - public void testOnActivityResult() { - PasswordReauthenticationFragment mockPasswordReauthentication = + private void checkPopFromBackStackOnResult(int resultCode) { + PasswordReauthenticationFragment passwordReauthentication = new PasswordReauthenticationFragment(); // Replacement fragment for PasswordEntryEditor, which is the fragment that @@ -50,13 +51,13 @@ fragmentTransaction.commit(); FragmentTransaction fragmentTransaction2 = fragmentManager.beginTransaction(); - fragmentTransaction2.add(mockPasswordReauthentication, "password_reauthentication"); + fragmentTransaction2.add(passwordReauthentication, "password_reauthentication"); fragmentTransaction2.addToBackStack("add_password_reauthentication"); fragmentTransaction2.commit(); - mockPasswordReauthentication.onActivityResult( - PasswordReauthenticationFragment.CONFIRM_DEVICE_CREDENTIAL_REQUEST_CODE, - testActivity.RESULT_OK, returnIntent); + passwordReauthentication.onActivityResult( + PasswordReauthenticationFragment.CONFIRM_DEVICE_CREDENTIAL_REQUEST_CODE, resultCode, + returnIntent); fragmentManager.executePendingTransactions(); // Assert that the number of fragments in the Back Stack is equal to 1 after @@ -66,4 +67,22 @@ // Assert that the remaining fragment in the Back Stack is PasswordEntryEditor. assertEquals("add_password_entry_editor", fragmentManager.getBackStackEntryAt(0).getName()); } + + /** + * Ensure that upon successful reauthentication PasswordReauthenticationFragment is popped from + * the FragmentManager backstack. + */ + @Test + public void testOnOkActivityResult() { + checkPopFromBackStackOnResult(Activity.RESULT_OK); + } + + /** + * Ensure that upon canceled reauthentication PasswordReauthenticationFragment is popped from + * the FragmentManager backstack. + */ + @Test + public void testOnCanceledActivityResult() { + checkPopFromBackStackOnResult(Activity.RESULT_CANCELED); + } }
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc index ccdafd2e..bc1151fc 100644 --- a/content/browser/browser_plugin/browser_plugin_guest.cc +++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -54,6 +54,7 @@ #include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/common/drop_data.h" +#include "ui/base/ui_base_switches_util.h" #include "ui/events/blink/web_input_event_traits.h" #include "ui/gfx/geometry/size_conversions.h" @@ -436,7 +437,7 @@ const viz::SurfaceInfo& surface_info, const viz::SurfaceSequence& sequence) { has_attached_since_surface_set_ = false; - if (!IsUsingMus()) { + if (!switches::IsMusHostingViz()) { SendMessageToEmbedder( std::make_unique<BrowserPluginMsg_SetChildFrameSurface>( browser_plugin_instance_id(), surface_info, sequence)); @@ -703,7 +704,7 @@ // In case we've created a new guest render process after a crash, let the // associated BrowserPlugin know. We only need to send this if we're attached, // as guest_crashed_ is cleared automatically on attach anyways. - if (attached() && !IsUsingMus()) { + if (attached() && !switches::IsMusHostingViz()) { RenderWidgetHostViewGuest* rwhv = static_cast<RenderWidgetHostViewGuest*>( web_contents()->GetRenderWidgetHostView()); if (rwhv) {
diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame.cc b/content/browser/renderer_host/render_widget_host_view_child_frame.cc index eaa06d4..ded662d 100644 --- a/content/browser/renderer_host/render_widget_host_view_child_frame.cc +++ b/content/browser/renderer_host/render_widget_host_view_child_frame.cc
@@ -43,6 +43,7 @@ #include "gpu/ipc/common/gpu_messages.h" #include "services/service_manager/runner/common/client_util.h" #include "third_party/WebKit/public/platform/WebTouchEvent.h" +#include "ui/base/ui_base_switches_util.h" #include "ui/gfx/geometry/size_conversions.h" #include "ui/gfx/geometry/size_f.h" #include "ui/touch_selection/touch_selection_controller.h" @@ -77,7 +78,7 @@ background_color_(SK_ColorWHITE), scroll_bubbling_state_(NO_ACTIVE_GESTURE_SCROLL), weak_factory_(this) { - if (IsUsingMus()) { + if (switches::IsMusHostingViz()) { // In Mus the RenderFrameProxy will eventually assign a viz::FrameSinkId // until then set ours invalid, as operations using it will be disregarded. frame_sink_id_ = viz::FrameSinkId(); @@ -98,7 +99,7 @@ if (frame_connector_) DetachFromTouchSelectionClientManagerIfNecessary(); - if (!IsUsingMus()) { + if (!switches::IsMusHostingViz()) { ResetCompositorFrameSinkSupport(); if (GetHostFrameSinkManager()) GetHostFrameSinkManager()->InvalidateFrameSinkId(frame_sink_id_); @@ -152,7 +153,8 @@ frame_connector_->GetParentRenderWidgetHostView(); if (parent_view) { - DCHECK(parent_view->GetFrameSinkId().is_valid() || IsUsingMus()); + DCHECK(parent_view->GetFrameSinkId().is_valid() || + switches::IsMusHostingViz()); SetParentFrameSinkId(parent_view->GetFrameSinkId()); } @@ -183,7 +185,7 @@ #if defined(USE_AURA) void RenderWidgetHostViewChildFrame::SetFrameSinkId( const viz::FrameSinkId& frame_sink_id) { - if (IsUsingMus()) + if (switches::IsMusHostingViz()) frame_sink_id_ = frame_sink_id; } #endif // defined(USE_AURA) @@ -539,7 +541,8 @@ void RenderWidgetHostViewChildFrame::SetParentFrameSinkId( const viz::FrameSinkId& parent_frame_sink_id) { - if (parent_frame_sink_id_ == parent_frame_sink_id || IsUsingMus()) + if (parent_frame_sink_id_ == parent_frame_sink_id || + switches::IsMusHostingViz()) return; auto* host_frame_sink_manager = GetHostFrameSinkManager(); @@ -586,7 +589,7 @@ } void RenderWidgetHostViewChildFrame::SendSurfaceInfoToEmbedder() { - if (IsUsingMus()) + if (switches::IsMusHostingViz()) return; // TODO(kylechar): Remove sequence generation and only send surface info. // See https://crbug.com/676384. @@ -1026,7 +1029,7 @@ } void RenderWidgetHostViewChildFrame::CreateCompositorFrameSinkSupport() { - if (IsUsingMus() || enable_viz_) + if (switches::IsMusHostingViz() || enable_viz_) return; DCHECK(!support_);
diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame_browsertest.cc b/content/browser/renderer_host/render_widget_host_view_child_frame_browsertest.cc index 9fa1e49..7a8c3149 100644 --- a/content/browser/renderer_host/render_widget_host_view_child_frame_browsertest.cc +++ b/content/browser/renderer_host/render_widget_host_view_child_frame_browsertest.cc
@@ -153,7 +153,7 @@ } // Tests that while in mus, the child frame receives an updated FrameSinkId -// representing the frame sink used by the RenderFrameProxy +// representing the frame sink used by the RenderFrameProxy. IN_PROC_BROWSER_TEST_F(RenderWidgetHostViewChildFrameTest, ChildFrameSinkId) { // Only in mus do we expect a RenderFrameProxy to provide the FrameSinkId. if (!IsUsingMus())
diff --git a/content/renderer/render_frame_proxy.cc b/content/renderer/render_frame_proxy.cc index f610f83..44c2ee0 100644 --- a/content/renderer/render_frame_proxy.cc +++ b/content/renderer/render_frame_proxy.cc
@@ -40,6 +40,7 @@ #include "third_party/WebKit/public/web/WebTriggeringEventInfo.h" #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" #include "third_party/WebKit/public/web/WebView.h" +#include "ui/base/ui_base_switches_util.h" #if defined(USE_AURA) #include "content/renderer/mus/mus_embedded_frame.h" @@ -410,7 +411,7 @@ void RenderFrameProxy::OnViewChanged(const viz::FrameSinkId& frame_sink_id) { // In mash the FrameSinkId comes from RendererWindowTreeClient. - if (!IsRunningWithMus()) + if (!switches::IsMusHostingViz()) frame_sink_id_ = frame_sink_id; // Resend the FrameRects and allocate a new viz::LocalSurfaceId when the view
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index 10b32b1..5984076 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc
@@ -794,9 +794,8 @@ // Register exported services: #if defined(USE_AURA) - if (IsRunningWithMus()) { + if (IsRunningWithMus()) CreateRenderWidgetWindowTreeClientFactory(GetServiceManagerConnection()); - } #endif registry->AddInterface(base::Bind(&SharedWorkerFactoryImpl::Create),
diff --git a/content/renderer/webgraphicscontext3d_provider_impl.cc b/content/renderer/webgraphicscontext3d_provider_impl.cc index 754b103..3a4b93c 100644 --- a/content/renderer/webgraphicscontext3d_provider_impl.cc +++ b/content/renderer/webgraphicscontext3d_provider_impl.cc
@@ -62,8 +62,8 @@ } void WebGraphicsContext3DProviderImpl::SetLostContextCallback( - const base::Closure& c) { - context_lost_callback_ = c; + base::RepeatingClosure c) { + context_lost_callback_ = std::move(c); } void WebGraphicsContext3DProviderImpl::SetErrorMessageCallback(
diff --git a/content/renderer/webgraphicscontext3d_provider_impl.h b/content/renderer/webgraphicscontext3d_provider_impl.h index 8f4dffb..75cbe07 100644 --- a/content/renderer/webgraphicscontext3d_provider_impl.h +++ b/content/renderer/webgraphicscontext3d_provider_impl.h
@@ -45,7 +45,7 @@ const gpu::GpuFeatureInfo& GetGpuFeatureInfo() const override; viz::GLHelper* GetGLHelper() override; bool IsSoftwareRendering() const override; - void SetLostContextCallback(const base::Closure&) override; + void SetLostContextCallback(base::RepeatingClosure) override; void SetErrorMessageCallback( base::RepeatingCallback<void(const char*, int32_t)>) override; void SignalQuery(uint32_t, base::OnceClosure) override; @@ -61,7 +61,7 @@ scoped_refptr<ui::ContextProviderCommandBuffer> provider_; std::unique_ptr<viz::GLHelper> gl_helper_; const bool software_rendering_; - base::Closure context_lost_callback_; + base::RepeatingClosure context_lost_callback_; DISALLOW_COPY_AND_ASSIGN(WebGraphicsContext3DProviderImpl); };
diff --git a/mojo/public/cpp/system/simple_watcher.h b/mojo/public/cpp/system/simple_watcher.h index d329038d..8702689 100644 --- a/mojo/public/cpp/system/simple_watcher.h +++ b/mojo/public/cpp/system/simple_watcher.h
@@ -50,12 +50,13 @@ // // Note that unlike the first two conditions, this callback may be invoked // with |MOJO_RESULT_CANCELLED| even while the SimpleWatcher is disarmed. - using ReadyCallback = base::Callback<void(MojoResult result)>; + using ReadyCallback = base::RepeatingCallback<void(MojoResult result)>; // Like above but also receives the last known handle signal state at the time // of the notification. using ReadyCallbackWithState = - base::Callback<void(MojoResult result, const HandleSignalsState& state)>; + base::RepeatingCallback<void(MojoResult result, + const HandleSignalsState& state)>; // Selects how this SimpleWatcher is to be armed. enum class ArmingPolicy {
diff --git a/net/reporting/reporting_cache.cc b/net/reporting/reporting_cache.cc index dde13eda..822f14f 100644 --- a/net/reporting/reporting_cache.cc +++ b/net/reporting/reporting_cache.cc
@@ -464,6 +464,6 @@ return std::make_unique<ReportingCacheImpl>(context); } -ReportingCache::~ReportingCache() {} +ReportingCache::~ReportingCache() = default; } // namespace net
diff --git a/net/reporting/reporting_client.cc b/net/reporting/reporting_client.cc index d8c8a0f..609441d2 100644 --- a/net/reporting/reporting_client.cc +++ b/net/reporting/reporting_client.cc
@@ -23,6 +23,6 @@ group(group), expires(expires) {} -ReportingClient::~ReportingClient() {} +ReportingClient::~ReportingClient() = default; } // namespace net
diff --git a/net/reporting/reporting_context.cc b/net/reporting/reporting_context.cc index b46bc865..8def197 100644 --- a/net/reporting/reporting_context.cc +++ b/net/reporting/reporting_context.cc
@@ -50,7 +50,7 @@ return std::make_unique<ReportingContextImpl>(policy, request_context); } -ReportingContext::~ReportingContext() {} +ReportingContext::~ReportingContext() = default; void ReportingContext::AddObserver(ReportingObserver* observer) { DCHECK(!observers_.HasObserver(observer));
diff --git a/net/reporting/reporting_delegate.cc b/net/reporting/reporting_delegate.cc index 4e4e3d12..42006db 100644 --- a/net/reporting/reporting_delegate.cc +++ b/net/reporting/reporting_delegate.cc
@@ -18,7 +18,7 @@ DCHECK(request_context); } - ~ReportingDelegateImpl() override {} + ~ReportingDelegateImpl() override = default; bool CanQueueReport(const url::Origin& origin) const override { return network_delegate() && @@ -58,6 +58,6 @@ return std::make_unique<ReportingDelegateImpl>(request_context); } -ReportingDelegate::~ReportingDelegate() {} +ReportingDelegate::~ReportingDelegate() = default; } // namespace net
diff --git a/net/reporting/reporting_delivery_agent.cc b/net/reporting/reporting_delivery_agent.cc index ad439cb..0324694 100644 --- a/net/reporting/reporting_delivery_agent.cc +++ b/net/reporting/reporting_delivery_agent.cc
@@ -81,7 +81,7 @@ const std::vector<const ReportingReport*>& reports) : endpoint(endpoint), reports(reports) {} - ~Delivery() {} + ~Delivery() = default; const GURL endpoint; const std::vector<const ReportingReport*> reports; @@ -219,6 +219,6 @@ return std::make_unique<ReportingDeliveryAgentImpl>(context); } -ReportingDeliveryAgent::~ReportingDeliveryAgent() {} +ReportingDeliveryAgent::~ReportingDeliveryAgent() = default; } // namespace net
diff --git a/net/reporting/reporting_endpoint_manager.cc b/net/reporting/reporting_endpoint_manager.cc index f216a86..6b7ac814 100644 --- a/net/reporting/reporting_endpoint_manager.cc +++ b/net/reporting/reporting_endpoint_manager.cc
@@ -30,7 +30,7 @@ public: ReportingEndpointManagerImpl(ReportingContext* context) : context_(context) {} - ~ReportingEndpointManagerImpl() override {} + ~ReportingEndpointManagerImpl() override = default; bool FindEndpointForOriginAndGroup(const url::Origin& origin, const std::string& group, @@ -109,6 +109,6 @@ return std::make_unique<ReportingEndpointManagerImpl>(context); } -ReportingEndpointManager::~ReportingEndpointManager() {} +ReportingEndpointManager::~ReportingEndpointManager() = default; } // namespace net
diff --git a/net/reporting/reporting_garbage_collector.cc b/net/reporting/reporting_garbage_collector.cc index 3cefeaa2..68b31229 100644 --- a/net/reporting/reporting_garbage_collector.cc +++ b/net/reporting/reporting_garbage_collector.cc
@@ -86,6 +86,6 @@ return std::make_unique<ReportingGarbageCollectorImpl>(context); } -ReportingGarbageCollector::~ReportingGarbageCollector() {} +ReportingGarbageCollector::~ReportingGarbageCollector() = default; } // namespace net
diff --git a/net/reporting/reporting_network_change_observer.cc b/net/reporting/reporting_network_change_observer.cc index 2141efa..20e33a3 100644 --- a/net/reporting/reporting_network_change_observer.cc +++ b/net/reporting/reporting_network_change_observer.cc
@@ -60,6 +60,6 @@ return std::make_unique<ReportingNetworkChangeObserverImpl>(context); } -ReportingNetworkChangeObserver::~ReportingNetworkChangeObserver() {} +ReportingNetworkChangeObserver::~ReportingNetworkChangeObserver() = default; } // namespace net
diff --git a/net/reporting/reporting_observer.cc b/net/reporting/reporting_observer.cc index 5e8d778..a37548c 100644 --- a/net/reporting/reporting_observer.cc +++ b/net/reporting/reporting_observer.cc
@@ -8,8 +8,8 @@ void ReportingObserver::OnCacheUpdated() {} -ReportingObserver::ReportingObserver() {} +ReportingObserver::ReportingObserver() = default; -ReportingObserver::~ReportingObserver() {} +ReportingObserver::~ReportingObserver() = default; } // namespace net
diff --git a/net/reporting/reporting_persister.cc b/net/reporting/reporting_persister.cc index 198ee76b..c4f0e71 100644 --- a/net/reporting/reporting_persister.cc +++ b/net/reporting/reporting_persister.cc
@@ -66,7 +66,7 @@ // ReportingPersister implementation: - ~ReportingPersisterImpl() override {} + ~ReportingPersisterImpl() override = default; private: std::string SerializeTicks(base::TimeTicks time_ticks) { @@ -316,6 +316,6 @@ return std::make_unique<ReportingPersisterImpl>(context); } -ReportingPersister::~ReportingPersister() {} +ReportingPersister::~ReportingPersister() = default; } // namespace net
diff --git a/net/reporting/reporting_policy.cc b/net/reporting/reporting_policy.cc index 62b7f68..007eb89 100644 --- a/net/reporting/reporting_policy.cc +++ b/net/reporting/reporting_policy.cc
@@ -29,21 +29,8 @@ endpoint_backoff_policy.always_use_initial_delay = false; } -ReportingPolicy::ReportingPolicy(const ReportingPolicy& other) - : max_report_count(other.max_report_count), - max_client_count(other.max_client_count), - delivery_interval(other.delivery_interval), - endpoint_backoff_policy(other.endpoint_backoff_policy), - persistence_interval(other.persistence_interval), - persist_reports_across_restarts(other.persist_reports_across_restarts), - persist_clients_across_restarts(other.persist_clients_across_restarts), - garbage_collection_interval(other.garbage_collection_interval), - max_report_age(other.max_report_age), - max_report_attempts(other.max_report_attempts), - clear_reports_on_network_changes(other.clear_reports_on_network_changes), - clear_clients_on_network_changes(other.clear_clients_on_network_changes) { -} +ReportingPolicy::ReportingPolicy(const ReportingPolicy& other) = default; -ReportingPolicy::~ReportingPolicy() {} +ReportingPolicy::~ReportingPolicy() = default; } // namespace net
diff --git a/net/reporting/reporting_service.cc b/net/reporting/reporting_service.cc index e72eb752..935fd6d 100644 --- a/net/reporting/reporting_service.cc +++ b/net/reporting/reporting_service.cc
@@ -28,7 +28,7 @@ ReportingServiceImpl(std::unique_ptr<ReportingContext> context) : context_(std::move(context)) {} - ~ReportingServiceImpl() override {} + ~ReportingServiceImpl() override = default; void QueueReport(const GURL& url, const std::string& group, @@ -61,7 +61,7 @@ } // namespace -ReportingService::~ReportingService() {} +ReportingService::~ReportingService() = default; // static std::unique_ptr<ReportingService> ReportingService::Create(
diff --git a/net/reporting/reporting_test_util.cc b/net/reporting/reporting_test_util.cc index d5f0a8c..8c98b8f 100644 --- a/net/reporting/reporting_test_util.cc +++ b/net/reporting/reporting_test_util.cc
@@ -43,7 +43,7 @@ callback_(callback), complete_callback_(complete_callback) {} - ~PendingUploadImpl() override {} + ~PendingUploadImpl() override = default; // PendingUpload implementationP: const GURL& url() const override { return url_; } @@ -91,11 +91,11 @@ return nullptr; } -TestReportingUploader::PendingUpload::~PendingUpload() {} -TestReportingUploader::PendingUpload::PendingUpload() {} +TestReportingUploader::PendingUpload::~PendingUpload() = default; +TestReportingUploader::PendingUpload::PendingUpload() = default; -TestReportingUploader::TestReportingUploader() {} -TestReportingUploader::~TestReportingUploader() {} +TestReportingUploader::TestReportingUploader() = default; +TestReportingUploader::~TestReportingUploader() = default; void TestReportingUploader::StartUpload(const GURL& url, const std::string& json, @@ -104,9 +104,9 @@ url, json, callback, base::Bind(&ErasePendingUpload, &pending_uploads_))); } -TestReportingDelegate::TestReportingDelegate() {} +TestReportingDelegate::TestReportingDelegate() = default; -TestReportingDelegate::~TestReportingDelegate() {} +TestReportingDelegate::~TestReportingDelegate() = default; bool TestReportingDelegate::CanQueueReport(const url::Origin& origin) const { return true; @@ -155,7 +155,7 @@ CreateContext(policy, base::Time::Now(), base::TimeTicks::Now()); } -ReportingTestBase::~ReportingTestBase() {} +ReportingTestBase::~ReportingTestBase() = default; void ReportingTestBase::UsePolicy(const ReportingPolicy& new_policy) { CreateContext(new_policy, clock()->Now(), tick_clock()->NowTicks());
diff --git a/net/reporting/reporting_uploader.cc b/net/reporting/reporting_uploader.cc index 72352ba..43b628a 100644 --- a/net/reporting/reporting_uploader.cc +++ b/net/reporting/reporting_uploader.cc
@@ -163,7 +163,7 @@ // static const char ReportingUploader::kUploadContentType[] = "application/report"; -ReportingUploader::~ReportingUploader() {} +ReportingUploader::~ReportingUploader() = default; // static std::unique_ptr<ReportingUploader> ReportingUploader::Create(
diff --git a/printing/BUILD.gn b/printing/BUILD.gn index 5ee1cb33..277f5025 100644 --- a/printing/BUILD.gn +++ b/printing/BUILD.gn
@@ -242,6 +242,10 @@ "pdf_transform.h", ] } + + if (is_fuchsia) { + sources += [ "image_fuchsia.cc" ] + } } static_library("test_support") {
diff --git a/printing/backend/print_backend.cc b/printing/backend/print_backend.cc index 3a03950..b19fb76 100644 --- a/printing/backend/print_backend.cc +++ b/printing/backend/print_backend.cc
@@ -19,7 +19,7 @@ PrinterBasicInfo::PrinterBasicInfo(const PrinterBasicInfo& other) = default; -PrinterBasicInfo::~PrinterBasicInfo() {} +PrinterBasicInfo::~PrinterBasicInfo() = default; PrinterSemanticCapsAndDefaults::PrinterSemanticCapsAndDefaults() : collate_capable(false), @@ -36,16 +36,16 @@ PrinterSemanticCapsAndDefaults::PrinterSemanticCapsAndDefaults( const PrinterSemanticCapsAndDefaults& other) = default; -PrinterSemanticCapsAndDefaults::~PrinterSemanticCapsAndDefaults() {} +PrinterSemanticCapsAndDefaults::~PrinterSemanticCapsAndDefaults() = default; -PrinterCapsAndDefaults::PrinterCapsAndDefaults() {} +PrinterCapsAndDefaults::PrinterCapsAndDefaults() = default; PrinterCapsAndDefaults::PrinterCapsAndDefaults( const PrinterCapsAndDefaults& other) = default; -PrinterCapsAndDefaults::~PrinterCapsAndDefaults() {} +PrinterCapsAndDefaults::~PrinterCapsAndDefaults() = default; -PrintBackend::~PrintBackend() {} +PrintBackend::~PrintBackend() = default; // static scoped_refptr<PrintBackend> PrintBackend::CreateInstance(
diff --git a/printing/backend/print_backend_chromeos.cc b/printing/backend/print_backend_chromeos.cc index 96e4457..882e6a8 100644 --- a/printing/backend/print_backend_chromeos.cc +++ b/printing/backend/print_backend_chromeos.cc
@@ -60,10 +60,10 @@ bool IsValidPrinter(const std::string& printer_name) override; protected: - ~PrintBackendChromeOS() override {} + ~PrintBackendChromeOS() override = default; }; -PrintBackendChromeOS::PrintBackendChromeOS() {} +PrintBackendChromeOS::PrintBackendChromeOS() = default; bool PrintBackendChromeOS::EnumeratePrinters(PrinterList* printer_list) { return true;
diff --git a/printing/backend/test_print_backend.cc b/printing/backend/test_print_backend.cc index 5e7eaf9..3c4d2172 100644 --- a/printing/backend/test_print_backend.cc +++ b/printing/backend/test_print_backend.cc
@@ -12,9 +12,9 @@ namespace printing { -TestPrintBackend::TestPrintBackend() {} +TestPrintBackend::TestPrintBackend() = default; -TestPrintBackend::~TestPrintBackend() {} +TestPrintBackend::~TestPrintBackend() = default; bool TestPrintBackend::EnumeratePrinters(PrinterList* printer_list) { if (printer_list_.empty())
diff --git a/printing/image.cc b/printing/image.cc index 37c4ced..194a410c 100644 --- a/printing/image.cc +++ b/printing/image.cc
@@ -24,14 +24,9 @@ LoadMetafile(metafile); } -Image::Image(const Image& image) - : size_(image.size_), - row_length_(image.row_length_), - data_(image.data_), - ignore_alpha_(image.ignore_alpha_) { -} +Image::Image(const Image& image) = default; -Image::~Image() {} +Image::~Image() = default; std::string Image::checksum() const { base::MD5Digest digest;
diff --git a/printing/image_fuchsia.cc b/printing/image_fuchsia.cc new file mode 100644 index 0000000..5389ca2 --- /dev/null +++ b/printing/image_fuchsia.cc
@@ -0,0 +1,14 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "printing/image.h" + +namespace printing { + +bool Image::LoadMetafile(const Metafile& metafile) { + NOTIMPLEMENTED(); + return false; +} + +} // namespace printing
diff --git a/printing/metafile.cc b/printing/metafile.cc index fd2c829..7ecbea7c 100644 --- a/printing/metafile.cc +++ b/printing/metafile.cc
@@ -13,17 +13,13 @@ namespace printing { -MetafilePlayer::MetafilePlayer() { -} +MetafilePlayer::MetafilePlayer() = default; -MetafilePlayer::~MetafilePlayer() { -} +MetafilePlayer::~MetafilePlayer() = default; -Metafile::Metafile() { -} +Metafile::Metafile() = default; -Metafile::~Metafile() { -} +Metafile::~Metafile() = default; bool Metafile::GetDataAsVector(std::vector<char>* buffer) const { buffer->resize(GetDataSize());
diff --git a/printing/page_setup.cc b/printing/page_setup.cc index 69442b0..fb342d5 100644 --- a/printing/page_setup.cc +++ b/printing/page_setup.cc
@@ -43,7 +43,7 @@ PageSetup::PageSetup(const PageSetup& other) = default; -PageSetup::~PageSetup() {} +PageSetup::~PageSetup() = default; void PageSetup::Clear() { physical_size_.SetSize(0, 0);
diff --git a/printing/pdf_metafile_skia.cc b/printing/pdf_metafile_skia.cc index d5b59a7..96ee23a 100644 --- a/printing/pdf_metafile_skia.cc +++ b/printing/pdf_metafile_skia.cc
@@ -80,7 +80,7 @@ #endif }; -PdfMetafileSkia::~PdfMetafileSkia() {} +PdfMetafileSkia::~PdfMetafileSkia() = default; bool PdfMetafileSkia::Init() { return true;
diff --git a/printing/print_settings.cc b/printing/print_settings.cc index f7935649..28967e8 100644 --- a/printing/print_settings.cc +++ b/printing/print_settings.cc
@@ -154,8 +154,7 @@ PrintSettings::PrintSettings(const PrintSettings& other) = default; -PrintSettings::~PrintSettings() { -} +PrintSettings::~PrintSettings() = default; void PrintSettings::Clear() { ranges_.clear();
diff --git a/printing/printed_document.cc b/printing/printed_document.cc index f541f3df..b4f6f9d 100644 --- a/printing/printed_document.cc +++ b/printing/printed_document.cc
@@ -111,8 +111,7 @@ DebugDumpSettings(name, settings); } -PrintedDocument::~PrintedDocument() { -} +PrintedDocument::~PrintedDocument() = default; void PrintedDocument::SetPage(int page_number, std::unique_ptr<MetafilePlayer> metafile, @@ -239,16 +238,16 @@ base::RetainedRef(data))); } -PrintedDocument::Mutable::Mutable() {} +PrintedDocument::Mutable::Mutable() = default; -PrintedDocument::Mutable::~Mutable() {} +PrintedDocument::Mutable::~Mutable() = default; PrintedDocument::Immutable::Immutable(const PrintSettings& settings, const base::string16& name, int cookie) : settings_(settings), name_(name), cookie_(cookie) {} -PrintedDocument::Immutable::~Immutable() {} +PrintedDocument::Immutable::~Immutable() = default; #if defined(OS_ANDROID) // This function is not used on android.
diff --git a/printing/printed_page.cc b/printing/printed_page.cc index 5bc8487..c2d2c1d86 100644 --- a/printing/printed_page.cc +++ b/printing/printed_page.cc
@@ -21,8 +21,7 @@ page_content_rect_(page_content_rect) { } -PrintedPage::~PrintedPage() { -} +PrintedPage::~PrintedPage() = default; const MetafilePlayer* PrintedPage::metafile() const { return metafile_.get();
diff --git a/printing/printing_context.cc b/printing/printing_context.cc index 26b7df3..9cdde9f 100644 --- a/printing/printing_context.cc +++ b/printing/printing_context.cc
@@ -26,8 +26,7 @@ DCHECK(delegate_); } -PrintingContext::~PrintingContext() { -} +PrintingContext::~PrintingContext() = default; void PrintingContext::set_margin_type(MarginType type) { DCHECK(type != CUSTOM_MARGINS);
diff --git a/services/service_manager/public/cpp/connector.h b/services/service_manager/public/cpp/connector.h index 33c6310..88c34882 100644 --- a/services/service_manager/public/cpp/connector.h +++ b/services/service_manager/public/cpp/connector.h
@@ -42,7 +42,7 @@ class TestApi { public: - using Binder = base::Callback<void(mojo::ScopedMessagePipeHandle)>; + using Binder = base::RepeatingCallback<void(mojo::ScopedMessagePipeHandle)>; explicit TestApi(Connector* connector) : connector_(connector) {} ~TestApi() { connector_->ResetStartServiceCallback(); }
diff --git a/services/service_manager/public/cpp/interface_provider.h b/services/service_manager/public/cpp/interface_provider.h index 3a87081..75c3f55 100644 --- a/services/service_manager/public/cpp/interface_provider.h +++ b/services/service_manager/public/cpp/interface_provider.h
@@ -29,8 +29,8 @@ void SetBinderForName( const std::string& name, - const base::Callback<void(mojo::ScopedMessagePipeHandle)>& binder) { - provider_->SetBinderForName(name, binder); + base::RepeatingCallback<void(mojo::ScopedMessagePipeHandle)> binder) { + provider_->SetBinderForName(name, std::move(binder)); } bool HasBinderForName(const std::string& name) { @@ -120,15 +120,16 @@ void SetBinderForName( const std::string& name, - const base::Callback<void(mojo::ScopedMessagePipeHandle)>& binder) { - binders_[name] = binder; + base::RepeatingCallback<void(mojo::ScopedMessagePipeHandle)> binder) { + binders_[name] = std::move(binder); } bool HasBinderForName(const std::string& name) const; void ClearBinderForName(const std::string& name); void ClearBinders(); - using BinderMap = std::map< - std::string, base::Callback<void(mojo::ScopedMessagePipeHandle)>>; + using BinderMap = + std::map<std::string, + base::RepeatingCallback<void(mojo::ScopedMessagePipeHandle)>>; BinderMap binders_; mojom::InterfaceProviderPtr interface_provider_;
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG index 3cdd35c..5d1d329 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG +++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
@@ -2357,6 +2357,9 @@ crbug.com/591099 external/wpt/css/css-display/display-contents-dynamic-flex-002-none.html [ Failure ] crbug.com/591099 external/wpt/css/css-display/display-contents-dynamic-table-001-inline.html [ Failure ] crbug.com/591099 external/wpt/css/css-display/display-flow-root-001.html [ Failure ] +crbug.com/591099 external/wpt/css/css-flexbox/anonymous-flex-item-001.html [ Failure ] +crbug.com/591099 external/wpt/css/css-flexbox/anonymous-flex-item-003.html [ Failure ] +crbug.com/591099 external/wpt/css/css-flexbox/anonymous-flex-item-006.html [ Failure ] crbug.com/591099 external/wpt/css/css-flexbox/percentage-heights-001.html [ Failure ] crbug.com/591099 external/wpt/css/css-fonts/matching/stretch-distance-over-weight-distance.html [ Pass ] crbug.com/591099 external/wpt/css/css-fonts/matching/style-ranges-over-weight-direction.html [ Pass ] @@ -4862,6 +4865,7 @@ crbug.com/591099 fast/overflow/replaced-child-100percent-height-inside-fixed-container-with-overflow-auto.html [ Failure ] crbug.com/591099 fast/overflow/scrollbar-restored-and-then-locked.html [ Failure ] crbug.com/591099 fast/overflow/scrollbar-restored.html [ Failure ] +crbug.com/591099 fast/overflow/overflow-of-video-outline.html [ Failure ] crbug.com/591099 fast/pagination/auto-height-with-break.html [ Failure ] crbug.com/591099 fast/pagination/break-in-paged-overflow.html [ Failure ] crbug.com/591099 fast/pagination/caret-range-outside-paged-x-rtl.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 4f77fd67..b4e7d20 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -614,6 +614,9 @@ # ====== LayoutNG,LayoutNGPaintFragments ====== +# expected is wrong +crbug.com/789390 virtual/layout_ng_paint/fast/inline/vertical-align-text-inherit.html [ Failure ] + ### Crash site: ContainerNode.cpp crbug.com/714962 virtual/layout_ng_paint/fast/inline/inline-with-empty-inline-children.html [ Crash Failure ]
diff --git a/third_party/WebKit/LayoutTests/fast/backgrounds/mask-box-image.html b/third_party/WebKit/LayoutTests/fast/backgrounds/mask-box-image.html index b9d5902..0f09d13 100644 --- a/third_party/WebKit/LayoutTests/fast/backgrounds/mask-box-image.html +++ b/third_party/WebKit/LayoutTests/fast/backgrounds/mask-box-image.html
@@ -6,7 +6,7 @@ border: 1px solid black; margin: 20px; } - + .scaled { transform: scale(1.0001); -webkit-transform-origin: top left; @@ -18,7 +18,7 @@ background-color: black; margin: 10px; } - + .mask3 { -webkit-mask-box-image: url(resources/dot.png) 3 stretch stretch; }
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssRotation-expected.txt b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssRotation-expected.txt index 744051fd..0f541a86 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssRotation-expected.txt +++ b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssRotation-expected.txt
@@ -2,7 +2,7 @@ PASS Constructing a CSSRotation with a CSSUnitValue with type other than angle for the angle throws a TypeError PASS Constructing a CSSRotation with a CSSMathValue that doesn't match <angle> for the angle throws a TypeError PASS Constructing a CSSRotation with a CSSUnitValue with type other than number for the coordinates throws a TypeError -FAIL Constructing a CSSRotation with a CSSMathValue that doesn't match <number> for the coordinates throws a TypeError assert_throws: function "() => new CSSRotation(coord, 0, 0, CSS.deg(0))" did not throw +PASS Constructing a CSSRotation with a CSSMathValue that doesn't match <number> for the coordinates throws a TypeError PASS Updating CSSRotation.x to a CSSUnitValue with type other than number throws a TypeError PASS Updating CSSRotation.x to a CSSMathValue that doesn't match <number> throws a TypeError PASS Updating CSSRotation.y to a CSSUnitValue with type other than number throws a TypeError @@ -11,18 +11,18 @@ PASS Updating CSSRotation.z to a CSSMathValue that doesn't match <number> throws a TypeError PASS Updating CSSRotation.angle to a CSSUnitValue with type other than angle throws a TypeError PASS Updating CSSRotation.angle to a CSSMathValue that doesn't match <angle> throws a TypeError -FAIL CSSRotation can be constructed from a single angle assert_equals: expected "CSSUnitValue" but got "Number" -FAIL CSSRotation can be constructed from numberish coordinates assert_equals: expected "CSSUnitValue" but got "Number" -FAIL CSSRotation can be constructed from CSSMathValues Failed to construct 'CSSRotation': Must pass an angle to CSSRotation -FAIL CSSRotation.x can be updated to a double assert_equals: expected (object) object "3.14" but got (number) 3.14 -FAIL CSSRotation.x can be updated to a number CSSUnitValue assert_equals: expected "CSSUnitValue" but got "Number" -FAIL CSSRotation.x can be updated to a CSSMathValue matching <number> assert_equals: expected "CSSMathSum" but got "Number" -FAIL CSSRotation.y can be updated to a double assert_equals: expected (object) object "3.14" but got (number) 3.14 -FAIL CSSRotation.y can be updated to a number CSSUnitValue assert_equals: expected "CSSUnitValue" but got "Number" -FAIL CSSRotation.y can be updated to a CSSMathValue matching <number> assert_equals: expected "CSSMathSum" but got "Number" -FAIL CSSRotation.z can be updated to a double assert_equals: expected (object) object "3.14" but got (number) 3.14 -FAIL CSSRotation.z can be updated to a number CSSUnitValue assert_equals: expected "CSSUnitValue" but got "Number" -FAIL CSSRotation.z can be updated to a CSSMathValue matching <number> assert_equals: expected "CSSMathSum" but got "Number" +PASS CSSRotation can be constructed from a single angle +FAIL CSSRotation can be constructed from numberish coordinates angle is not defined +FAIL CSSRotation can be constructed from CSSMathValues Failed to construct 'CSSRotation': Must specify an number unit +PASS CSSRotation.x can be updated to a double +PASS CSSRotation.x can be updated to a number CSSUnitValue +FAIL CSSRotation.x can be updated to a CSSMathValue matching <number> Failed to set the 'x' property on 'CSSRotation': Must specify a number unit +PASS CSSRotation.y can be updated to a double +PASS CSSRotation.y can be updated to a number CSSUnitValue +FAIL CSSRotation.y can be updated to a CSSMathValue matching <number> Failed to set the 'y' property on 'CSSRotation': Must specify a number unit +PASS CSSRotation.z can be updated to a double +PASS CSSRotation.z can be updated to a number CSSUnitValue +FAIL CSSRotation.z can be updated to a CSSMathValue matching <number> Failed to set the 'z' property on 'CSSRotation': Must specify a number unit PASS CSSRotation.angle can be updated to a degree CSSUnitValue FAIL CSSRotation.angle can be updated to a CSSMathValue matching <angle> Failed to set the 'angle' property on 'CSSRotation': Must pass an angle to CSSRotation PASS Modifying CSSRotation.is2D can be updated to true or false
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssRotation.html b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssRotation.html index 546593b..28c787e 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssRotation.html +++ b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssRotation.html
@@ -38,7 +38,7 @@ test(() => { let result = new CSSRotation(0, 0, 0, CSS.deg(0)); assert_throws(new TypeError(), () => result[attr] = value); - assert_equals(result[attr], 0); + assert_style_value_equals(result[attr], CSS.number(0)); }, 'Updating CSSRotation.' + attr + ' to ' + desc + ' throws a TypeError'); } } @@ -56,7 +56,7 @@ assert_style_value_equals(result.x, CSS.number(0)); assert_style_value_equals(result.y, CSS.number(0)); assert_style_value_equals(result.z, CSS.number(1)); - assert_equals(result.angle, CSS.deg(3.14)); + assert_style_value_equals(result.angle, CSS.deg(3.14)); assert_true(result.is2D); }, 'CSSRotation can be constructed from a single angle'); @@ -87,7 +87,7 @@ test(() => { let result = new CSSRotation(0, 0, 0, CSS.deg(0)); result[attr] = 3.14; - assert_equals(result[attr], CSS.number(3.14)); + assert_style_value_equals(result[attr], CSS.number(3.14)); }, 'CSSRotation.' + attr + ' can be updated to a double'); test(() => {
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.cpp index 463bfe4..50b12b0 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.cpp
@@ -6,9 +6,6 @@ namespace blink { -ScriptSourceCode::ScriptSourceCode() - : start_position_(TextPosition::MinimumPosition()) {} - ScriptSourceCode::ScriptSourceCode( const String& source, ScriptSourceLocationType source_location_type,
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.h b/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.h index fa6f37d0..3fd58b0c 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.h +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.h
@@ -46,7 +46,6 @@ DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); public: - ScriptSourceCode(); // We lose the encoding information from ScriptResource. // Not sure if that matters. explicit ScriptSourceCode(ScriptResource*);
diff --git a/third_party/WebKit/Source/bindings/modules/v8/serialization/V8ScriptValueSerializerForModulesTest.cpp b/third_party/WebKit/Source/bindings/modules/v8/serialization/V8ScriptValueSerializerForModulesTest.cpp index b0d86a9..c1aabc4 100644 --- a/third_party/WebKit/Source/bindings/modules/v8/serialization/V8ScriptValueSerializerForModulesTest.cpp +++ b/third_party/WebKit/Source/bindings/modules/v8/serialization/V8ScriptValueSerializerForModulesTest.cpp
@@ -264,18 +264,18 @@ WTF::RepeatingFunction<void(T)> function_; template <typename U> friend WebCryptoResult ToWebCryptoResult(ScriptState*, - WTF::Function<void(U)>); + WTF::RepeatingFunction<void(U)>); }; template <typename T> WebCryptoResult ToWebCryptoResult(ScriptState* script_state, - WTF::Function<void(T)> function) { + WTF::RepeatingFunction<void(T)> function) { CryptoResultImpl* result = CryptoResultImpl::Create(script_state); result->Promise().Then( (new WebCryptoResultAdapter<T>(script_state, std::move(function))) ->BindToV8Function(), (new WebCryptoResultAdapter<DOMException*>( - script_state, WTF::Bind([](DOMException* exception) { + script_state, WTF::BindRepeating([](DOMException* exception) { CHECK(false) << "crypto operation failed"; }))) ->BindToV8Function()); @@ -287,7 +287,7 @@ T result; (Platform::Current()->Crypto()->*func)( std::forward<Args>(args)..., - ToWebCryptoResult(script_state, WTF::Bind( + ToWebCryptoResult(script_state, WTF::BindRepeating( [](T* out, T result) { *out = result; testing::ExitRunLoop();
diff --git a/third_party/WebKit/Source/build/scripts/core/css/properties/make_css_property_headers.py b/third_party/WebKit/Source/build/scripts/core/css/properties/make_css_property_headers.py index 50a9de0..f71a2b7 100755 --- a/third_party/WebKit/Source/build/scripts/core/css/properties/make_css_property_headers.py +++ b/third_party/WebKit/Source/build/scripts/core/css/properties/make_css_property_headers.py
@@ -95,6 +95,21 @@ 'auto_getter': 'HasNormalColumnGap', 'auto_setter': 'SetHasNormalColumnGap', 'auto_identity': 'CSSValueNormal'} + if (property_name in + ['BorderImageOutset', 'BorderImageRepeat', + 'BorderImageSlice', 'BorderImageWidth', + 'WebkitMaskBoxImageOutset', 'WebkitMaskBoxImageRepeat', + 'WebkitMaskBoxImageSlice', 'WebkitMaskBoxImageWidth']): + property_['custom_apply'] = 'border_image' + is_mask_box = 'WebkitMaskBox' in property_name + getter = 'MaskBoxImage' if is_mask_box else 'BorderImage' + modifier_type = property_name[len('WebkitMaskBoxImage'):] if is_mask_box else property_name[len('BorderImage'):] + property_['custom_apply_args'] = { + 'is_mask_box': is_mask_box, + 'modifier_type': modifier_type, + 'getter': getter, + 'setter': 'Set' + getter + } property_['should_implement_apply_functions'] = ( property_['should_declare_apply_functions'] and (not (property_['custom_apply_functions_initial'] and @@ -125,6 +140,9 @@ includes.append("core/style/SVGComputedStyle.h") else: includes.append("core/style/ComputedStyle.h") + if (property_.get('custom_apply_args') and + property_.get('custom_apply_args').get('modifier_type') in ['Width', 'Slice', 'Outset']): + includes.append("core/css/properties/StyleBuildingUtils.h") includes.sort() property_['includes'] = includes
diff --git a/third_party/WebKit/Source/build/scripts/core/css/properties/templates/style_builder_functions.tmpl b/third_party/WebKit/Source/build/scripts/core/css/properties/templates/style_builder_functions.tmpl index e5b91f47..d533ace 100644 --- a/third_party/WebKit/Source/build/scripts/core/css/properties/templates/style_builder_functions.tmpl +++ b/third_party/WebKit/Source/build/scripts/core/css/properties/templates/style_builder_functions.tmpl
@@ -92,6 +92,86 @@ else {{convert_and_set_value(property)}} } + {% elif property.custom_apply == "border_image" %} + {% set is_mask_box = property.custom_apply_args['is_mask_box'] %} + {% set modifier_type = property.custom_apply_args['modifier_type'] %} + {% set getter = property.custom_apply_args['getter'] %} + {% set setter = property.custom_apply_args['setter'] %} + {{declare_initial()}} + const NinePieceImage& currentImage = state.Style()->{{getter}}(); + {# Check for equality in case we can bail out before creating a new NinePieceImage. #} + {% if modifier_type == 'Outset' %} + if (StyleBuildingUtils::borderImageLengthMatchesAllSides(currentImage.Outset(), + BorderImageLength(Length(0, kFixed)))) + return; + {% elif modifier_type == 'Repeat' %} + if (currentImage.HorizontalRule() == kStretchImageRule && + currentImage.VerticalRule() == kStretchImageRule) + return; + {% elif modifier_type == 'Slice' and is_mask_box %} + // Masks have a different initial value for slices. Preserve the value of 0 + // for backwards compatibility. + if (currentImage.Fill() == true && + StyleBuildingUtils::lengthMatchesAllSides(currentImage.ImageSlices(), Length(0, kFixed))) + return; + {% elif modifier_type == 'Slice' and not is_mask_box %} + if (currentImage.Fill() == false && + StyleBuildingUtils::lengthMatchesAllSides(currentImage.ImageSlices(), Length(100, kPercent))) + return; + {% elif modifier_type == 'Width' and is_mask_box %} + // Masks have a different initial value for widths. Preserve the value of + // 'auto' for backwards compatibility. + if (StyleBuildingUtils::borderImageLengthMatchesAllSides(currentImage.BorderSlices(), + BorderImageLength(Length(kAuto)))) + return; + {% elif modifier_type == 'Width' and not is_mask_box %} + if (StyleBuildingUtils::borderImageLengthMatchesAllSides(currentImage.BorderSlices(), + BorderImageLength(1.0))) + return; + {% endif %} + NinePieceImage image(currentImage); + {% if modifier_type == 'Outset' %} + image.SetOutset(Length(0, kFixed)); + {% elif modifier_type == 'Repeat' %} + image.SetHorizontalRule(kStretchImageRule); + image.SetVerticalRule(kStretchImageRule); + {% elif modifier_type == 'Slice' and is_mask_box %} + image.SetImageSlices(LengthBox({{ (['Length(0, kFixed)']*4) | join(', ') }})); + image.SetFill(true); + {% elif modifier_type == 'Slice' and not is_mask_box %} + image.SetImageSlices(LengthBox({{ (['Length(100, kPercent)']*4) | join(', ') }})); + image.SetFill(false); + {% elif modifier_type == 'Width' %} + image.SetBorderSlices({{ 'Length(kAuto)' if is_mask_box else '1.0' }}); + {% endif %} + state.Style()->{{setter}}(image); + } + {{declare_inherit()}} + NinePieceImage image(state.Style()->{{getter}}()); + {% if modifier_type == 'Outset' %} + image.CopyOutsetFrom(state.ParentStyle()->{{getter}}()); + {% elif modifier_type == 'Repeat' %} + image.CopyRepeatFrom(state.ParentStyle()->{{getter}}()); + {% elif modifier_type == 'Slice' %} + image.CopyImageSlicesFrom(state.ParentStyle()->{{getter}}()); + {% elif modifier_type == 'Width' %} + image.CopyBorderSlicesFrom(state.ParentStyle()->{{getter}}()); + {% endif %} + state.Style()->{{setter}}(image); + } + {{declare_value()}} + NinePieceImage image(state.Style()->{{getter}}()); + {% if modifier_type == 'Outset' %} + image.SetOutset(CSSToStyleMap::MapNinePieceImageQuad(state, value)); + {% elif modifier_type == 'Repeat' %} + CSSToStyleMap::MapNinePieceImageRepeat(state, value, image); + {% elif modifier_type == 'Slice' %} + CSSToStyleMap::MapNinePieceImageSlice(state, value, image); + {% elif modifier_type == 'Width' %} + image.SetBorderSlices(CSSToStyleMap::MapNinePieceImageQuad(state, value)); + {% endif %} + state.Style()->{{setter}}(image); + } {% endif %} {# TODO(crbug.com/751354): emit function declaration only for larger functions #} {%- endmacro %}
diff --git a/third_party/WebKit/Source/build/scripts/make_style_builder.py b/third_party/WebKit/Source/build/scripts/make_style_builder.py index 3ba377b..ac7aa2b 100755 --- a/third_party/WebKit/Source/build/scripts/make_style_builder.py +++ b/third_party/WebKit/Source/build/scripts/make_style_builder.py
@@ -52,9 +52,15 @@ property_['custom_apply_functions_value']) \ and property_['property_class'] \ and isinstance(property_['property_class'], types.BooleanType) + # TODO(crbug.com/751354): Remove this hard coded list of supported + # properties once all of them have been implemented if property_['custom_apply_functions_all']: if (property_['upper_camel_name'] in - ['Clip', 'ColumnCount', 'ColumnGap', 'ColumnWidth', 'ZIndex']): + ['BorderImageOutset', 'BorderImageRepeat', 'BorderImageSlice', + 'BorderImageWidth', 'Clip', 'ColumnCount', 'ColumnGap', + 'ColumnWidth', 'WebkitMaskBoxImageOutset', + 'WebkitMaskBoxImageRepeat', 'WebkitMaskBoxImageSlice', + 'WebkitMaskBoxImageWidth', 'ZIndex']): property_['use_property_class_in_stylebuilder'] = True
diff --git a/third_party/WebKit/Source/build/scripts/templates/StyleBuilder.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/StyleBuilder.cpp.tmpl index 641ebb41..bc29e8c 100644 --- a/third_party/WebKit/Source/build/scripts/templates/StyleBuilder.cpp.tmpl +++ b/third_party/WebKit/Source/build/scripts/templates/StyleBuilder.cpp.tmpl
@@ -11,11 +11,11 @@ #include "core/css/resolver/StyleResolverState.h" #include "core/style/ComputedStyle.h" -// FIXME: currently we're just generating a switch statement, but we should -// test other variations for performance once we have more properties here. - namespace blink { +// TODO(crbug.com/751354): Delete this method and call property class methods +// directly using CSSProperty::Get() once all StyleBuilderFunctions have been +// moved to property classes. void StyleBuilder::ApplyProperty(const CSSProperty& property, StyleResolverState& state, const CSSValue& value,
diff --git a/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl index ece4ea1..189bab14 100644 --- a/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl +++ b/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
@@ -121,115 +121,6 @@ {{apply_animation('CSSPropertyTransitionProperty', 'Property', 'Transition')}} {{apply_animation('CSSPropertyTransitionTimingFunction', 'TimingFunction', 'Transition')}} -static bool lengthMatchesAllSides(const LengthBox& lengthBox, - const Length& length) { - return (lengthBox.Left() == length && - lengthBox.Right() == length && - lengthBox.Top() == length && - lengthBox.Bottom() == length); -} - -static bool borderImageLengthMatchesAllSides( - const BorderImageLengthBox& borderImageLengthBox, - const BorderImageLength& borderImageLength) { - return (borderImageLengthBox.Left() == borderImageLength && - borderImageLengthBox.Right() == borderImageLength && - borderImageLengthBox.Top() == borderImageLength && - borderImageLengthBox.Bottom() == borderImageLength); -} - -{% macro apply_border_image_modifier(property_id, modifier_type) %} -{% set is_mask_box = 'MaskBox' in property_id %} -{% set getter = 'MaskBoxImage' if is_mask_box else 'BorderImage' %} -{% set setter = 'SetMaskBoxImage' if is_mask_box else 'SetBorderImage' %} -{{ declare_initial_function(property_id) }} { - const NinePieceImage& currentImage = state.Style()->{{getter}}(); - {# Check for equality in case we can bail out before creating a new NinePieceImage. #} - {% if modifier_type == 'Outset' %} - if (borderImageLengthMatchesAllSides(currentImage.Outset(), - BorderImageLength(Length(0, kFixed)))) - return; - {% elif modifier_type == 'Repeat' %} - if (currentImage.HorizontalRule() == kStretchImageRule && - currentImage.VerticalRule() == kStretchImageRule) - return; - {% elif modifier_type == 'Slice' and is_mask_box %} - // Masks have a different initial value for slices. Preserve the value of 0 - // for backwards compatibility. - if (currentImage.Fill() == true && - lengthMatchesAllSides(currentImage.ImageSlices(), Length(0, kFixed))) - return; - {% elif modifier_type == 'Slice' and not is_mask_box %} - if (currentImage.Fill() == false && - lengthMatchesAllSides(currentImage.ImageSlices(), Length(100, kPercent))) - return; - {% elif modifier_type == 'Width' and is_mask_box %} - // Masks have a different initial value for widths. Preserve the value of - // 'auto' for backwards compatibility. - if (borderImageLengthMatchesAllSides(currentImage.BorderSlices(), - BorderImageLength(Length(kAuto)))) - return; - {% elif modifier_type == 'Width' and not is_mask_box %} - if (borderImageLengthMatchesAllSides(currentImage.BorderSlices(), - BorderImageLength(1.0))) - return; - {% endif %} - - NinePieceImage image(currentImage); - {% if modifier_type == 'Outset' %} - image.SetOutset(Length(0, kFixed)); - {% elif modifier_type == 'Repeat' %} - image.SetHorizontalRule(kStretchImageRule); - image.SetVerticalRule(kStretchImageRule); - {% elif modifier_type == 'Slice' and is_mask_box %} - image.SetImageSlices(LengthBox({{ (['Length(0, kFixed)']*4) | join(', ') }})); - image.SetFill(true); - {% elif modifier_type == 'Slice' and not is_mask_box %} - image.SetImageSlices(LengthBox({{ (['Length(100, kPercent)']*4) | join(', ') }})); - image.SetFill(false); - {% elif modifier_type == 'Width' %} - image.SetBorderSlices({{ 'Length(kAuto)' if is_mask_box else '1.0' }}); - {% endif %} - state.Style()->{{setter}}(image); -} - -{{declare_inherit_function(property_id)}} { - NinePieceImage image(state.Style()->{{getter}}()); - {% if modifier_type == 'Outset' %} - image.CopyOutsetFrom(state.ParentStyle()->{{getter}}()); - {% elif modifier_type == 'Repeat' %} - image.CopyRepeatFrom(state.ParentStyle()->{{getter}}()); - {% elif modifier_type == 'Slice' %} - image.CopyImageSlicesFrom(state.ParentStyle()->{{getter}}()); - {% elif modifier_type == 'Width' %} - image.CopyBorderSlicesFrom(state.ParentStyle()->{{getter}}()); - {% endif %} - state.Style()->{{setter}}(image); -} - -{{declare_value_function(property_id)}} { - NinePieceImage image(state.Style()->{{getter}}()); - {% if modifier_type == 'Outset' %} - image.SetOutset(CSSToStyleMap::MapNinePieceImageQuad(state, value)); - {% elif modifier_type == 'Repeat' %} - CSSToStyleMap::MapNinePieceImageRepeat(state, value, image); - {% elif modifier_type == 'Slice' %} - CSSToStyleMap::MapNinePieceImageSlice(state, value, image); - {% elif modifier_type == 'Width' %} - image.SetBorderSlices(CSSToStyleMap::MapNinePieceImageQuad(state, value)); - {% endif %} - state.Style()->{{setter}}(image); -} -{% endmacro %} -{{apply_border_image_modifier('CSSPropertyBorderImageOutset', 'Outset')}} -{{apply_border_image_modifier('CSSPropertyBorderImageRepeat', 'Repeat')}} -{{apply_border_image_modifier('CSSPropertyBorderImageSlice', 'Slice')}} -{{apply_border_image_modifier('CSSPropertyBorderImageWidth', 'Width')}} -{{apply_border_image_modifier('CSSPropertyWebkitMaskBoxImageOutset', 'Outset')}} -{{apply_border_image_modifier('CSSPropertyWebkitMaskBoxImageRepeat', 'Repeat')}} -{{apply_border_image_modifier('CSSPropertyWebkitMaskBoxImageSlice', 'Slice')}} -{{apply_border_image_modifier('CSSPropertyWebkitMaskBoxImageWidth', 'Width')}} - {% macro apply_value_border_image_source(property_id) %} {{declare_value_function(property_id)}} { {% set property = properties_by_id[property_id] %}
diff --git a/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.h.tmpl index f491907..980575bd 100644 --- a/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.h.tmpl +++ b/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.h.tmpl
@@ -13,6 +13,8 @@ class CSSValue; class StyleResolverState; +// TODO(crbug.com/751354): Delete this class once all StyleBuilderFunctions +// have been moved to property classes. class StyleBuilderFunctions { public:
diff --git a/third_party/WebKit/Source/core/css/BUILD.gn b/third_party/WebKit/Source/core/css/BUILD.gn index 09c950139..a0c29d5 100644 --- a/third_party/WebKit/Source/core/css/BUILD.gn +++ b/third_party/WebKit/Source/core/css/BUILD.gn
@@ -425,6 +425,7 @@ "properties/CSSPropertyBaseCustom.cpp", "properties/Longhand.h", "properties/Shorthand.h", + "properties/StyleBuildingUtils.h", "properties/longhands/AlignItems.cpp", "properties/longhands/AlignOrJustifyContent.cpp", "properties/longhands/AlignSelf.cpp",
diff --git a/third_party/WebKit/Source/core/css/StyleRuleImport.cpp b/third_party/WebKit/Source/core/css/StyleRuleImport.cpp index 3fe4638..c53801b 100644 --- a/third_party/WebKit/Source/core/css/StyleRuleImport.cpp +++ b/third_party/WebKit/Source/core/css/StyleRuleImport.cpp
@@ -65,15 +65,11 @@ StyleRuleBase::TraceAfterDispatch(visitor); } -void StyleRuleImport::SetCSSStyleSheet( - const String& href, - const KURL& base_url, - ReferrerPolicy referrer_policy, - const WTF::TextEncoding& charset, - const CSSStyleSheetResource* cached_style_sheet) { +void StyleRuleImport::NotifyFinished(Resource* resource) { if (style_sheet_) style_sheet_->ClearOwnerRule(); + CSSStyleSheetResource* cached_style_sheet = ToCSSStyleSheetResource(resource); Document* document = nullptr; // Fallback to an insecure context parser if we don't have a parent style @@ -85,10 +81,13 @@ document = parent_style_sheet_->SingleOwnerDocument(); context = parent_style_sheet_->ParserContext(); } - context = CSSParserContext::Create(context, base_url, referrer_policy, - charset, document); + context = + CSSParserContext::Create(context, cached_style_sheet->GetResponse().Url(), + cached_style_sheet->GetReferrerPolicy(), + cached_style_sheet->Encoding(), document); - style_sheet_ = StyleSheetContents::Create(this, href, context); + style_sheet_ = + StyleSheetContents::Create(this, cached_style_sheet->Url(), context); style_sheet_->ParseAuthorStyleSheet( cached_style_sheet, document ? document->GetSecurityOrigin() : nullptr);
diff --git a/third_party/WebKit/Source/core/css/StyleRuleImport.h b/third_party/WebKit/Source/core/css/StyleRuleImport.h index 175a44a..c07f6e1 100644 --- a/third_party/WebKit/Source/core/css/StyleRuleImport.h +++ b/third_party/WebKit/Source/core/css/StyleRuleImport.h
@@ -23,8 +23,8 @@ #define StyleRuleImport_h #include "core/css/StyleRule.h" -#include "core/loader/resource/StyleSheetResourceClient.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/ResourceClient.h" namespace blink { @@ -59,43 +59,34 @@ void TraceAfterDispatch(blink::Visitor*); private: - // FIXME: inherit from StyleSheetResourceClient directly to eliminate back + // FIXME: inherit from ResourceClient directly to eliminate back // pointer, as there are no space savings in this. - // NOTE: We put the StyleSheetResourceClient in a member instead of inheriting + // NOTE: We put the ResourceClient in a member instead of inheriting // from it to avoid adding a vptr to StyleRuleImport. class ImportedStyleSheetClient final : public GarbageCollectedFinalized<ImportedStyleSheetClient>, - public StyleSheetResourceClient { + public ResourceClient { USING_GARBAGE_COLLECTED_MIXIN(ImportedStyleSheetClient); public: ImportedStyleSheetClient(StyleRuleImport* owner_rule) : owner_rule_(owner_rule) {} ~ImportedStyleSheetClient() override = default; - void SetCSSStyleSheet(const String& href, - const KURL& base_url, - ReferrerPolicy referrer_policy, - const WTF::TextEncoding& charset, - const CSSStyleSheetResource* sheet) override { - owner_rule_->SetCSSStyleSheet(href, base_url, referrer_policy, charset, - sheet); + void NotifyFinished(Resource* resource) override { + owner_rule_->NotifyFinished(resource); } String DebugName() const override { return "ImportedStyleSheetClient"; } void Trace(blink::Visitor* visitor) { visitor->Trace(owner_rule_); - StyleSheetResourceClient::Trace(visitor); + ResourceClient::Trace(visitor); } private: Member<StyleRuleImport> owner_rule_; }; - void SetCSSStyleSheet(const String& href, - const KURL& base_url, - ReferrerPolicy, - const WTF::TextEncoding&, - const CSSStyleSheetResource*); + void NotifyFinished(Resource*); StyleRuleImport(const String& href, scoped_refptr<MediaQuerySet>);
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSRotation.cpp b/third_party/WebKit/Source/core/css/cssom/CSSRotation.cpp index 6c39fdc..c75c63f 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSRotation.cpp +++ b/third_party/WebKit/Source/core/css/cssom/CSSRotation.cpp
@@ -18,6 +18,16 @@ return value.IsPrimitiveValue() && ToCSSPrimitiveValue(value).IsNumber(); } +bool IsCoordValid(CSSNumericValue* value) { + // TODO: CSSMathValue are not supported yet + if (!value->IsUnitValue()) + return false; + if (value->GetType() != CSSStyleValue::StyleValueType::kNumberType) { + return false; + } + return true; +} + CSSRotation* FromCSSRotate(const CSSFunctionValue& value) { DCHECK_EQ(value.length(), 1UL); const CSSPrimitiveValue& primitive_value = ToCSSPrimitiveValue(value.Item(0)); @@ -39,7 +49,9 @@ double y = ToCSSPrimitiveValue(value.Item(1)).GetDoubleValue(); double z = ToCSSPrimitiveValue(value.Item(2)).GetDoubleValue(); - return CSSRotation::Create(x, y, z, CSSNumericValue::FromCSSValue(angle)); + return CSSRotation::Create(CSSUnitValue::Create(x), CSSUnitValue::Create(y), + CSSUnitValue::Create(z), + CSSNumericValue::FromCSSValue(angle)); } CSSRotation* FromCSSRotateXYZ(const CSSFunctionValue& value) { @@ -50,11 +62,17 @@ CSSNumericValue* angle = CSSNumericValue::FromCSSValue(primitive_value); switch (value.FunctionType()) { case CSSValueRotateX: - return CSSRotation::Create(1, 0, 0, angle); + return CSSRotation::Create(CSSUnitValue::Create(1), + CSSUnitValue::Create(0), + CSSUnitValue::Create(0), angle); case CSSValueRotateY: - return CSSRotation::Create(0, 1, 0, angle); + return CSSRotation::Create(CSSUnitValue::Create(0), + CSSUnitValue::Create(1), + CSSUnitValue::Create(0), angle); case CSSValueRotateZ: - return CSSRotation::Create(0, 0, 1, angle); + return CSSRotation::Create(CSSUnitValue::Create(0), + CSSUnitValue::Create(0), + CSSUnitValue::Create(1), angle); default: NOTREACHED(); return nullptr; @@ -69,29 +87,40 @@ exception_state.ThrowTypeError("Must pass an angle to CSSRotation"); return nullptr; } - return new CSSRotation(0, 0, 1, angle, true /* is2D */); + return new CSSRotation(CSSUnitValue::Create(0), CSSUnitValue::Create(0), + CSSUnitValue::Create(1), angle, true /* is2D */); } -CSSRotation* CSSRotation::Create(double x, - double y, - double z, +CSSRotation* CSSRotation::Create(const CSSNumberish& x, + const CSSNumberish& y, + const CSSNumberish& z, CSSNumericValue* angle, ExceptionState& exception_state) { + CSSNumericValue* x_value = CSSNumericValue::FromNumberish(x); + CSSNumericValue* y_value = CSSNumericValue::FromNumberish(y); + CSSNumericValue* z_value = CSSNumericValue::FromNumberish(z); + + if (!IsCoordValid(x_value) || !IsCoordValid(y_value) || + !IsCoordValid(z_value)) { + exception_state.ThrowTypeError("Must specify an number unit"); + return nullptr; + } if (angle->GetType() != CSSStyleValue::StyleValueType::kAngleType) { exception_state.ThrowTypeError("Must pass an angle to CSSRotation"); return nullptr; } - return new CSSRotation(x, y, z, angle, false /* is2D */); + return new CSSRotation(x_value, y_value, z_value, angle, false /* is2D */); } CSSRotation* CSSRotation::Create(CSSNumericValue* angle) { DCHECK_EQ(angle->GetType(), CSSStyleValue::StyleValueType::kAngleType); - return new CSSRotation(0, 0, 1, angle, true /* is2D */); + return new CSSRotation(CSSUnitValue::Create(0), CSSUnitValue::Create(0), + CSSUnitValue::Create(1), angle, true /* is2D */); } -CSSRotation* CSSRotation::Create(double x, - double y, - double z, +CSSRotation* CSSRotation::Create(CSSNumericValue* x, + CSSNumericValue* y, + CSSNumericValue* z, CSSNumericValue* angle) { DCHECK_EQ(angle->GetType(), CSSStyleValue::StyleValueType::kAngleType); return new CSSRotation(x, y, z, angle, false /* is2D */); @@ -126,33 +155,74 @@ angle_ = angle; } -const DOMMatrix* CSSRotation::AsMatrix(ExceptionState&) const { +const DOMMatrix* CSSRotation::AsMatrix(ExceptionState& exception_state) const { + CSSUnitValue* x = x_->to(CSSPrimitiveValue::UnitType::kNumber); + CSSUnitValue* y = y_->to(CSSPrimitiveValue::UnitType::kNumber); + CSSUnitValue* z = z_->to(CSSPrimitiveValue::UnitType::kNumber); + if (!x || !y || !z) { + exception_state.ThrowTypeError( + "Cannot create matrix if units cannot be converted to CSSUnitValue"); + return nullptr; + } + DOMMatrix* matrix = DOMMatrix::Create(); CSSUnitValue* angle = angle_->to(CSSPrimitiveValue::UnitType::kDegrees); if (is2D()) { matrix->rotateAxisAngleSelf(0, 0, 1, angle->value()); } else { - matrix->rotateAxisAngleSelf(x_, y_, z_, angle->value()); + matrix->rotateAxisAngleSelf(x->value(), y->value(), z->value(), + angle->value()); } return matrix; } -const CSSFunctionValue* CSSRotation::ToCSSValue(SecureContextMode) const { +const CSSFunctionValue* CSSRotation::ToCSSValue( + SecureContextMode secure_context_mode) const { // TODO(meade): Handle calc angles. + CSSUnitValue* x = x_->to(CSSPrimitiveValue::UnitType::kNumber); + CSSUnitValue* y = y_->to(CSSPrimitiveValue::UnitType::kNumber); + CSSUnitValue* z = z_->to(CSSPrimitiveValue::UnitType::kNumber); + if (!x || !y || !z) { + return nullptr; + } CSSUnitValue* angle = ToCSSUnitValue(angle_); CSSFunctionValue* result = CSSFunctionValue::Create(is2D() ? CSSValueRotate : CSSValueRotate3d); if (!is2D()) { - result->Append( - *CSSPrimitiveValue::Create(x_, CSSPrimitiveValue::UnitType::kNumber)); - result->Append( - *CSSPrimitiveValue::Create(y_, CSSPrimitiveValue::UnitType::kNumber)); - result->Append( - *CSSPrimitiveValue::Create(z_, CSSPrimitiveValue::UnitType::kNumber)); + result->Append(*x->ToCSSValue(secure_context_mode)); + result->Append(*y->ToCSSValue(secure_context_mode)); + result->Append(*z->ToCSSValue(secure_context_mode)); } result->Append( *CSSPrimitiveValue::Create(angle->value(), angle->GetInternalUnit())); return result; } +void CSSRotation::setX(const CSSNumberish& x, ExceptionState& exception_state) { + CSSNumericValue* value = CSSNumericValue::FromNumberish(x); + if (!IsCoordValid(value)) { + exception_state.ThrowTypeError("Must specify a number unit"); + return; + } + x_ = value; +} + +void CSSRotation::setY(const CSSNumberish& y, ExceptionState& exception_state) { + CSSNumericValue* value = CSSNumericValue::FromNumberish(y); + if (!IsCoordValid(value)) { + exception_state.ThrowTypeError("Must specify a number unit"); + return; + } + y_ = value; +} + +void CSSRotation::setZ(const CSSNumberish& z, ExceptionState& exception_state) { + CSSNumericValue* value = CSSNumericValue::FromNumberish(z); + if (!IsCoordValid(value)) { + exception_state.ThrowTypeError("Must specify a number unit"); + return; + } + z_ = value; +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSRotation.h b/third_party/WebKit/Source/core/css/cssom/CSSRotation.h index 4aa30616..3a308a9 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSRotation.h +++ b/third_party/WebKit/Source/core/css/cssom/CSSRotation.h
@@ -13,6 +13,7 @@ class DOMMatrix; class ExceptionState; +class CSSNumericValue; // Represents a rotation value in a CSSTransformValue used for properties like // "transform". @@ -23,29 +24,29 @@ public: // Constructors defined in the IDL. static CSSRotation* Create(CSSNumericValue* angle, ExceptionState&); - static CSSRotation* Create(double x, - double y, - double z, + static CSSRotation* Create(const CSSNumberish& x, + const CSSNumberish& y, + const CSSNumberish& z, CSSNumericValue* angle, ExceptionState&); // Blink-internal ways of creating CSSRotations. static CSSRotation* Create(CSSNumericValue* angle); - static CSSRotation* Create(double x, - double y, - double z, + static CSSRotation* Create(CSSNumericValue* x, + CSSNumericValue* y, + CSSNumericValue* z, CSSNumericValue* angle); static CSSRotation* FromCSSValue(const CSSFunctionValue&); // Getters and setters for attributes defined in the IDL. CSSNumericValue* angle() { return angle_.Get(); } - double x() const { return x_; } - double y() const { return y_; } - double z() const { return z_; } void setAngle(CSSNumericValue* angle, ExceptionState&); - void setX(double x) { x_ = x; } - void setY(double y) { y_ = y; } - void setZ(double z) { z_ = z; } + void x(CSSNumberish& x) { x.SetCSSNumericValue(x_); } + void y(CSSNumberish& y) { y.SetCSSNumericValue(y_); } + void z(CSSNumberish& z) { z.SetCSSNumericValue(z_); } + void setX(const CSSNumberish&, ExceptionState&); + void setY(const CSSNumberish&, ExceptionState&); + void setZ(const CSSNumberish&, ExceptionState&); // Internal methods - from CSSTransformComponent. TransformComponentType GetType() const final { return kRotationType; } @@ -54,17 +55,24 @@ virtual void Trace(blink::Visitor* visitor) { visitor->Trace(angle_); + visitor->Trace(x_); + visitor->Trace(y_); + visitor->Trace(z_); CSSTransformComponent::Trace(visitor); } private: - CSSRotation(double x, double y, double z, CSSNumericValue* angle, bool is2D) + CSSRotation(CSSNumericValue* x, + CSSNumericValue* y, + CSSNumericValue* z, + CSSNumericValue* angle, + bool is2D) : CSSTransformComponent(is2D), angle_(angle), x_(x), y_(y), z_(z) {} Member<CSSNumericValue> angle_; - double x_; - double y_; - double z_; + Member<CSSNumericValue> x_; + Member<CSSNumericValue> y_; + Member<CSSNumericValue> z_; DISALLOW_COPY_AND_ASSIGN(CSSRotation); };
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSRotation.idl b/third_party/WebKit/Source/core/css/cssom/CSSRotation.idl index c4018ed..46f2e44 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSRotation.idl +++ b/third_party/WebKit/Source/core/css/cssom/CSSRotation.idl
@@ -7,13 +7,13 @@ // Spec: https://drafts.css-houdini.org/css-typed-om/#cssrotation [ Constructor(CSSNumericValue angleValue), - Constructor(double x, double y, double z, CSSNumericValue angle), + Constructor(CSSNumberish x, CSSNumberish y, CSSNumberish z, CSSNumericValue angle), Exposed=(Window,PaintWorklet), RuntimeEnabled=CSSTypedOM, RaisesException=Constructor ] interface CSSRotation : CSSTransformComponent { [RaisesException=Setter] attribute CSSNumericValue angle; - attribute double x; - attribute double y; - attribute double z; + [RaisesException=Setter] attribute CSSNumberish x; + [RaisesException=Setter] attribute CSSNumberish y; + [RaisesException=Setter] attribute CSSNumberish z; };
diff --git a/third_party/WebKit/Source/core/css/properties/StyleBuildingUtils.h b/third_party/WebKit/Source/core/css/properties/StyleBuildingUtils.h new file mode 100644 index 0000000..2a9eb7d --- /dev/null +++ b/third_party/WebKit/Source/core/css/properties/StyleBuildingUtils.h
@@ -0,0 +1,33 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef StyleBuildingUtils_h +#define StyleBuildingUtils_h + +#include "core/style/BorderImageLength.h" +#include "core/style/BorderImageLengthBox.h" +#include "platform/Length.h" +#include "platform/LengthBox.h" + +namespace blink { +namespace StyleBuildingUtils { + +inline bool borderImageLengthMatchesAllSides( + const BorderImageLengthBox& borderImageLengthBox, + const BorderImageLength& borderImageLength) { + return (borderImageLengthBox.Left() == borderImageLength && + borderImageLengthBox.Right() == borderImageLength && + borderImageLengthBox.Top() == borderImageLength && + borderImageLengthBox.Bottom() == borderImageLength); +} +inline bool lengthMatchesAllSides(const LengthBox& lengthBox, + const Length& length) { + return (lengthBox.Left() == length && lengthBox.Right() == length && + lengthBox.Top() == length && lengthBox.Bottom() == length); +} + +} // namespace StyleBuildingUtils +} // namespace blink + +#endif // StyleBuildingUtils_h
diff --git a/third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp b/third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp index cd466cf7..f4ea4ff4 100644 --- a/third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp +++ b/third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp
@@ -27,8 +27,8 @@ intersection_observer_ = IntersectionObserver::Create( {} /* root_margin */, {threshold}, &document, - WTF::Bind(&ElementVisibilityObserver::OnVisibilityChanged, - WrapWeakPersistent(this))); + WTF::BindRepeating(&ElementVisibilityObserver::OnVisibilityChanged, + WrapWeakPersistent(this))); DCHECK(intersection_observer_); intersection_observer_->observe(element_.Release());
diff --git a/third_party/WebKit/Source/core/dom/ElementVisibilityObserverTest.cpp b/third_party/WebKit/Source/core/dom/ElementVisibilityObserverTest.cpp index 09ae8bad..279eca2 100644 --- a/third_party/WebKit/Source/core/dom/ElementVisibilityObserverTest.cpp +++ b/third_party/WebKit/Source/core/dom/ElementVisibilityObserverTest.cpp
@@ -71,7 +71,7 @@ Persistent<HTMLElement> element = HTMLDivElement::Create(GetDocument()); ElementVisibilityObserver* observer = - new ElementVisibilityObserver(element, WTF::Bind([](bool) {})); + new ElementVisibilityObserver(element, WTF::BindRepeating([](bool) {})); observer->Start(); observer->DeliverObservationsForTesting(); observer->Stop();
diff --git a/third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp b/third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp index 08d7414..8de30db 100644 --- a/third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp +++ b/third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp
@@ -149,7 +149,7 @@ String url = GetDocument().CompleteURL(href).GetString(); - StyleSheetResource* resource = nullptr; + TextResource* resource = nullptr; ResourceLoaderOptions options; options.initiator_info.name = FetchInitiatorTypeNames::processinginstruction; FetchParameters params(ResourceRequest(GetDocument().CompleteURL(href)), @@ -189,60 +189,44 @@ return false; } -void ProcessingInstruction::SetCSSStyleSheet( - const String& href, - const KURL& base_url, - ReferrerPolicy referrer_policy, - const WTF::TextEncoding& charset, - const CSSStyleSheetResource* sheet) { +void ProcessingInstruction::NotifyFinished(Resource* resource) { if (!isConnected()) { DCHECK(!sheet_); return; } - DCHECK(is_css_); - CSSParserContext* parser_context = CSSParserContext::Create( - GetDocument(), base_url, referrer_policy, charset); - - StyleSheetContents* new_sheet = - StyleSheetContents::Create(href, parser_context); - - CSSStyleSheet* css_sheet = CSSStyleSheet::Create(new_sheet, *this); - css_sheet->setDisabled(alternate_); - css_sheet->SetTitle(title_); - if (!alternate_ && !title_.IsEmpty()) - GetDocument().GetStyleEngine().SetPreferredStylesheetSetNameIfNotSet( - title_); - css_sheet->SetMediaQueries(MediaQuerySet::Create(media_)); - - sheet_ = css_sheet; - - // We don't need the cross-origin security check here because we are - // getting the sheet text in "strict" mode. This enforces a valid CSS MIME - // type. - ParseStyleSheet(sheet->SheetText(parser_context)); -} - -void ProcessingInstruction::SetXSLStyleSheet(const String& href, - const KURL& base_url, - const String& sheet) { - if (!isConnected()) { - DCHECK(!sheet_); - return; - } - - DCHECK(is_xsl_); - sheet_ = XSLStyleSheet::Create(this, href, base_url); std::unique_ptr<IncrementLoadEventDelayCount> delay = - IncrementLoadEventDelayCount::Create(GetDocument()); - ParseStyleSheet(sheet); -} + is_xsl_ ? IncrementLoadEventDelayCount::Create(GetDocument()) : nullptr; + if (is_xsl_) { + sheet_ = XSLStyleSheet::Create(this, resource->Url(), + resource->GetResponse().Url()); + ToXSLStyleSheet(sheet_.Get()) + ->ParseString(ToXSLStyleSheetResource(resource)->Sheet()); + } else { + DCHECK(is_css_); + CSSStyleSheetResource* style_resource = ToCSSStyleSheetResource(resource); + CSSParserContext* parser_context = CSSParserContext::Create( + GetDocument(), style_resource->GetResponse().Url(), + style_resource->GetReferrerPolicy(), style_resource->Encoding()); -void ProcessingInstruction::ParseStyleSheet(const String& sheet) { - if (is_css_) - ToCSSStyleSheet(sheet_.Get())->Contents()->ParseString(sheet); - else if (is_xsl_) - ToXSLStyleSheet(sheet_.Get())->ParseString(sheet); + StyleSheetContents* new_sheet = + StyleSheetContents::Create(style_resource->Url(), parser_context); + + CSSStyleSheet* css_sheet = CSSStyleSheet::Create(new_sheet, *this); + css_sheet->setDisabled(alternate_); + css_sheet->SetTitle(title_); + if (!alternate_ && !title_.IsEmpty()) { + GetDocument().GetStyleEngine().SetPreferredStylesheetSetNameIfNotSet( + title_); + } + css_sheet->SetMediaQueries(MediaQuerySet::Create(media_)); + sheet_ = css_sheet; + // We don't need the cross-origin security check here because we are + // getting the sheet text in "strict" mode. This enforces a valid CSS MIME + // type. + css_sheet->Contents()->ParseString( + style_resource->SheetText(parser_context)); + } ClearResource(); loading_ = false; @@ -303,7 +287,7 @@ visitor->Trace(sheet_); visitor->Trace(listener_for_xslt_); CharacterData::Trace(visitor); - ResourceOwner<StyleSheetResource>::Trace(visitor); + ResourceOwner<TextResource>::Trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/dom/ProcessingInstruction.h b/third_party/WebKit/Source/core/dom/ProcessingInstruction.h index f0ad7cc4..c99e301e 100644 --- a/third_party/WebKit/Source/core/dom/ProcessingInstruction.h +++ b/third_party/WebKit/Source/core/dom/ProcessingInstruction.h
@@ -24,8 +24,8 @@ #include "core/css/StyleEngineContext.h" #include "core/dom/CharacterData.h" -#include "core/loader/resource/StyleSheetResource.h" -#include "core/loader/resource/StyleSheetResourceClient.h" +#include "core/loader/resource/TextResource.h" +#include "platform/loader/fetch/ResourceClient.h" #include "platform/loader/fetch/ResourceOwner.h" namespace blink { @@ -34,7 +34,7 @@ class EventListener; class ProcessingInstruction final : public CharacterData, - private ResourceOwner<StyleSheetResource> { + private ResourceOwner<TextResource> { DEFINE_WRAPPERTYPEINFO(); USING_GARBAGE_COLLECTED_MIXIN(ProcessingInstruction); @@ -85,14 +85,7 @@ bool CheckStyleSheet(String& href, String& charset); void Process(const String& href, const String& charset); - void SetCSSStyleSheet(const String& href, - const KURL& base_url, - ReferrerPolicy, - const WTF::TextEncoding&, - const CSSStyleSheetResource*) override; - void SetXSLStyleSheet(const String& href, - const KURL& base_url, - const String& sheet) override; + void NotifyFinished(Resource*) override; bool SheetLoaded() override;
diff --git a/third_party/WebKit/Source/core/dom/ScriptedAnimationControllerTest.cpp b/third_party/WebKit/Source/core/dom/ScriptedAnimationControllerTest.cpp index 2655cba8d..387c6d2 100644 --- a/third_party/WebKit/Source/core/dom/ScriptedAnimationControllerTest.cpp +++ b/third_party/WebKit/Source/core/dom/ScriptedAnimationControllerTest.cpp
@@ -44,8 +44,9 @@ class TaskOrderObserver { public: - WTF::Closure CreateTask(int id) { - return WTF::Bind(&TaskOrderObserver::RunTask, WTF::Unretained(this), id); + WTF::RepeatingClosure CreateTask(int id) { + return WTF::BindRepeating(&TaskOrderObserver::RunTask, + WTF::Unretained(this), id); } const Vector<int>& Order() const { return order_; }
diff --git a/third_party/WebKit/Source/core/editing/LayoutSelection.cpp b/third_party/WebKit/Source/core/editing/LayoutSelection.cpp index 311e19d..c2adfe2 100644 --- a/third_party/WebKit/Source/core/editing/LayoutSelection.cpp +++ b/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
@@ -687,43 +687,15 @@ paint_range_ = new_range.PaintRange(); if (paint_range_.IsNull()) return; - // TODO(yoichio): Remove this if state. - // This SelectionState reassignment is ad-hoc patch for - // prohibiting use-after-free(crbug.com/752715). - // LayoutText::setSelectionState(state) propergates |state| to ancestor - // LayoutObjects, which can accidentally change start/end LayoutObject state - // then LayoutObject::IsSelectionBorder() returns false although we should - // clear selection at LayoutObject::WillBeRemoved(). - // We should make LayoutObject::setSelectionState() trivial and remove - // such propagation or at least do it in LayoutSelection. - if ((paint_range_.StartLayoutObject()->GetSelectionState() != - SelectionState::kStart && - paint_range_.StartLayoutObject()->GetSelectionState() != - SelectionState::kStartAndEnd) || - (paint_range_.EndLayoutObject()->GetSelectionState() != - SelectionState::kEnd && - paint_range_.EndLayoutObject()->GetSelectionState() != - SelectionState::kStartAndEnd)) { - if (paint_range_.StartLayoutObject() == paint_range_.EndLayoutObject()) { - paint_range_.StartLayoutObject()->LayoutObject::SetSelectionState( - SelectionState::kStartAndEnd); - } else { - paint_range_.StartLayoutObject()->LayoutObject::SetSelectionState( - SelectionState::kStart); - paint_range_.EndLayoutObject()->LayoutObject::SetSelectionState( - SelectionState::kEnd); - } + if (paint_range_.StartLayoutObject() == paint_range_.EndLayoutObject()) { + DCHECK_EQ(paint_range_.StartLayoutObject()->GetSelectionState(), + SelectionState::kStartAndEnd); + return; } - // TODO(yoichio): If start == end, they should be kStartAndEnd. - // If not, start.SelectionState == kStart and vice versa. - DCHECK(paint_range_.StartLayoutObject()->GetSelectionState() == - SelectionState::kStart || - paint_range_.StartLayoutObject()->GetSelectionState() == - SelectionState::kStartAndEnd); - DCHECK(paint_range_.EndLayoutObject()->GetSelectionState() == - SelectionState::kEnd || - paint_range_.EndLayoutObject()->GetSelectionState() == - SelectionState::kStartAndEnd); + DCHECK_EQ(paint_range_.StartLayoutObject()->GetSelectionState(), + SelectionState::kStart); + DCHECK_EQ(paint_range_.EndLayoutObject()->GetSelectionState(), + SelectionState::kEnd); } void LayoutSelection::OnDocumentShutdown() {
diff --git a/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp b/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp index 6dabf49..aad1288 100644 --- a/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp +++ b/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp
@@ -83,7 +83,7 @@ USING_LAYOUTOBJECT_FUNC(IsLayoutEmbeddedContent); static IsTypeOf IsLayoutTextFragmentOf(const String& text) { - return WTF::Bind( + return WTF::BindRepeating( [](const String& text, const LayoutObject& object) { if (!object.IsText()) return false; @@ -126,7 +126,7 @@ InvalidateOption invalidate) { return TestLayoutObject( object, - WTF::Bind( + WTF::BindRepeating( [](const String& text, const LayoutObject& object) { if (!object.IsText()) return false;
diff --git a/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp b/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp index 7f28e1c..b7db814 100644 --- a/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp +++ b/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp
@@ -270,8 +270,8 @@ } else { handle_watcher_.Watch( consumer_handle_.get(), MOJO_HANDLE_SIGNAL_READABLE, - ConvertToBaseCallback(WTF::Bind( - &FileReaderLoaderMojo::OnDataPipeReadable, WTF::Unretained(this)))); + WTF::BindRepeating(&FileReaderLoaderMojo::OnDataPipeReadable, + WTF::Unretained(this))); } }
diff --git a/third_party/WebKit/Source/core/frame/LocalFrameView.cpp b/third_party/WebKit/Source/core/frame/LocalFrameView.cpp index 25a6fea..813954a 100644 --- a/third_party/WebKit/Source/core/frame/LocalFrameView.cpp +++ b/third_party/WebKit/Source/core/frame/LocalFrameView.cpp
@@ -383,7 +383,7 @@ return; visibility_observer_ = new ElementVisibilityObserver( - target_element, WTF::Bind( + target_element, WTF::BindRepeating( [](LocalFrameView* frame_view, bool is_visible) { if (!frame_view) return;
diff --git a/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp b/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp index 1c1971a..1ba8cda 100644 --- a/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp +++ b/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp
@@ -181,7 +181,7 @@ return; visibility_observer_ = new ElementVisibilityObserver( - target_element, WTF::Bind( + target_element, WTF::BindRepeating( [](RemoteFrameView* remote_view, bool is_visible) { remote_view->UpdateRenderThrottlingStatus( !is_visible, remote_view->subtree_throttled_);
diff --git a/third_party/WebKit/Source/core/html/LinkStyle.cpp b/third_party/WebKit/Source/core/html/LinkStyle.cpp index 141ad3a..c8a7dba 100644 --- a/third_party/WebKit/Source/core/html/LinkStyle.cpp +++ b/third_party/WebKit/Source/core/html/LinkStyle.cpp
@@ -58,12 +58,7 @@ kStyleSheetCacheStatusCount, }; -void LinkStyle::SetCSSStyleSheet( - const String& href, - const KURL& base_url, - ReferrerPolicy referrer_policy, - const WTF::TextEncoding& charset, - const CSSStyleSheetResource* cached_style_sheet) { +void LinkStyle::NotifyFinished(Resource* resource) { if (!owner_->isConnected()) { // While the stylesheet is asynchronously loading, the owner can be // disconnected from a document. @@ -75,6 +70,7 @@ return; } + CSSStyleSheetResource* cached_style_sheet = ToCSSStyleSheetResource(resource); // See the comment in PendingScript.cpp about why this check is necessary // here, instead of in the resource fetcher. https://crbug.com/500701. if (!cached_style_sheet->ErrorOccurred() && @@ -96,11 +92,11 @@ } CSSParserContext* parser_context = CSSParserContext::Create( - GetDocument(), base_url, referrer_policy, charset); + GetDocument(), cached_style_sheet->GetResponse().Url(), + cached_style_sheet->GetReferrerPolicy(), cached_style_sheet->Encoding()); if (StyleSheetContents* parsed_sheet = - const_cast<CSSStyleSheetResource*>(cached_style_sheet) - ->CreateParsedStyleSheetFromCache(parser_context)) { + cached_style_sheet->CreateParsedStyleSheetFromCache(parser_context)) { if (sheet_) ClearSheet(); sheet_ = CSSStyleSheet::Create(parsed_sheet, *owner_); @@ -116,7 +112,7 @@ } StyleSheetContents* style_sheet = - StyleSheetContents::Create(href, parser_context); + StyleSheetContents::Create(cached_style_sheet->Url(), parser_context); if (sheet_) ClearSheet(); @@ -410,7 +406,7 @@ void LinkStyle::Trace(blink::Visitor* visitor) { visitor->Trace(sheet_); LinkResource::Trace(visitor); - ResourceOwner<StyleSheetResource>::Trace(visitor); + ResourceOwner<CSSStyleSheetResource>::Trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/html/LinkStyle.h b/third_party/WebKit/Source/core/html/LinkStyle.h index 9f0add7..ba2f3a6c 100644 --- a/third_party/WebKit/Source/core/html/LinkStyle.h +++ b/third_party/WebKit/Source/core/html/LinkStyle.h
@@ -8,8 +8,8 @@ #include "core/css/StyleEngine.h" #include "core/dom/Node.h" #include "core/html/LinkResource.h" -#include "core/loader/resource/StyleSheetResource.h" -#include "core/loader/resource/StyleSheetResourceClient.h" +#include "core/loader/resource/CSSStyleSheetResource.h" +#include "platform/loader/fetch/ResourceClient.h" #include "platform/loader/fetch/ResourceOwner.h" #include "platform/wtf/Forward.h" @@ -25,7 +25,8 @@ // types might better be handled by a separate class, but dynamically // changing @rel makes it harder to move such a design so we are // sticking current way so far. -class LinkStyle final : public LinkResource, ResourceOwner<StyleSheetResource> { +class LinkStyle final : public LinkResource, + ResourceOwner<CSSStyleSheetResource> { USING_GARBAGE_COLLECTED_MIXIN(LinkStyle); public: @@ -59,12 +60,8 @@ CSSStyleSheet* Sheet() const { return sheet_.Get(); } private: - // From StyleSheetResourceClient - void SetCSSStyleSheet(const String& href, - const KURL& base_url, - ReferrerPolicy, - const WTF::TextEncoding&, - const CSSStyleSheetResource*) override; + // From ResourceClient + void NotifyFinished(Resource*) override; String DebugName() const override { return "LinkStyle"; } enum LoadReturnValue { kLoaded, kNotNeeded, kBail }; LoadReturnValue LoadStylesheetIfNeeded(const KURL&,
diff --git a/third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp b/third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp index 9ce7784..e56a166 100644 --- a/third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp +++ b/third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp
@@ -24,8 +24,8 @@ &frame.GetInterfaceProvider()); test_api.SetBinderForName( mojom::blink::InsecureInputService::Name_, - ConvertToBaseCallback(WTF::Bind(&MockInsecureInputService::BindRequest, - WTF::Unretained(this)))); + WTF::BindRepeating(&MockInsecureInputService::BindRequest, + WTF::Unretained(this))); } ~MockInsecureInputService() override {}
diff --git a/third_party/WebKit/Source/core/html/media/AutoplayPolicy.cpp b/third_party/WebKit/Source/core/html/media/AutoplayPolicy.cpp index fbf699ed..b2883c6 100644 --- a/third_party/WebKit/Source/core/html/media/AutoplayPolicy.cpp +++ b/third_party/WebKit/Source/core/html/media/AutoplayPolicy.cpp
@@ -162,8 +162,9 @@ return; autoplay_visibility_observer_ = new ElementVisibilityObserver( - element_, WTF::Bind(&AutoplayPolicy::OnVisibilityChangedForAutoplay, - WrapWeakPersistent(this))); + element_, + WTF::BindRepeating(&AutoplayPolicy::OnVisibilityChangedForAutoplay, + WrapWeakPersistent(this))); autoplay_visibility_observer_->Start(); }
diff --git a/third_party/WebKit/Source/core/html/media/AutoplayUmaHelper.cpp b/third_party/WebKit/Source/core/html/media/AutoplayUmaHelper.cpp index e664c77..f9e8598 100644 --- a/third_party/WebKit/Source/core/html/media/AutoplayUmaHelper.cpp +++ b/third_party/WebKit/Source/core/html/media/AutoplayUmaHelper.cpp
@@ -384,10 +384,10 @@ return; muted_video_play_method_visibility_observer_ = new ElementVisibilityObserver( - element_, - WTF::Bind(&AutoplayUmaHelper:: - OnVisibilityChangedForMutedVideoPlayMethodBecomeVisible, - WrapWeakPersistent(this))); + element_, WTF::BindRepeating( + &AutoplayUmaHelper:: + OnVisibilityChangedForMutedVideoPlayMethodBecomeVisible, + WrapWeakPersistent(this))); muted_video_play_method_visibility_observer_->Start(); SetContext(&element_->GetDocument()); } @@ -417,10 +417,10 @@ is_visible_ = false; muted_video_offscreen_duration_visibility_observer_ = new ElementVisibilityObserver( - element_, - WTF::Bind(&AutoplayUmaHelper:: - OnVisibilityChangedForMutedVideoOffscreenDuration, - WrapWeakPersistent(this))); + element_, WTF::BindRepeating( + &AutoplayUmaHelper:: + OnVisibilityChangedForMutedVideoOffscreenDuration, + WrapWeakPersistent(this))); muted_video_offscreen_duration_visibility_observer_->Start(); element_->addEventListener(EventTypeNames::pause, this, false); SetContext(&element_->GetDocument());
diff --git a/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp b/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp index 8ba5ba6..447e3da 100644 --- a/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp +++ b/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp
@@ -271,12 +271,7 @@ CSSPreloaderResourceClient::~CSSPreloaderResourceClient() {} -void CSSPreloaderResourceClient::SetCSSStyleSheet( - const String& href, - const KURL& base_url, - ReferrerPolicy referrer_policy, - const WTF::TextEncoding&, - const CSSStyleSheetResource*) { +void CSSPreloaderResourceClient::NotifyFinished(Resource*) { ClearResource(); } @@ -370,7 +365,7 @@ void CSSPreloaderResourceClient::Trace(blink::Visitor* visitor) { visitor->Trace(preloader_); visitor->Trace(resource_); - StyleSheetResourceClient::Trace(visitor); + ResourceClient::Trace(visitor); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.h b/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.h index 0c30a25..7dd101e 100644 --- a/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.h +++ b/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.h
@@ -31,8 +31,8 @@ #include "core/html/parser/HTMLToken.h" #include "core/html/parser/PreloadRequest.h" #include "core/loader/resource/CSSStyleSheetResource.h" -#include "core/loader/resource/StyleSheetResourceClient.h" #include "platform/heap/Handle.h" +#include "platform/loader/fetch/ResourceClient.h" #include "platform/loader/fetch/ResourceOwner.h" #include "platform/wtf/text/StringBuilder.h" @@ -103,17 +103,13 @@ // @import tags before parsing. class CORE_EXPORT CSSPreloaderResourceClient : public GarbageCollectedFinalized<CSSPreloaderResourceClient>, - public StyleSheetResourceClient { + public ResourceClient { USING_GARBAGE_COLLECTED_MIXIN(CSSPreloaderResourceClient); public: CSSPreloaderResourceClient(Resource*, HTMLResourcePreloader*); ~CSSPreloaderResourceClient() override; - void SetCSSStyleSheet(const String& href, - const KURL& base_url, - ReferrerPolicy, - const WTF::TextEncoding&, - const CSSStyleSheetResource*) override; + void NotifyFinished(Resource*) override; void DataReceived(Resource*, const char*, size_t) override; String DebugName() const override { return "CSSPreloaderResourceClient"; }
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.h b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.h index c4d8fab..e46d457 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.h +++ b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.h
@@ -254,7 +254,7 @@ static void CollectNodes(Node* root, int depth, bool pierce, - const Function<bool(Node*)>&, + const WTF::RepeatingFunction<bool(Node*)>&, HeapVector<Member<Node>>* result); protocol::Response AssertNode(int node_id, Node*&);
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp index eb18db0..d75002c 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
@@ -165,7 +165,8 @@ depth = INT_MAX; HeapVector<Member<Node>> nodes; InspectorDOMAgent::CollectNodes( - node, depth, pierce, WTF::Bind(&FilterNodesWithListeners), &nodes); + node, depth, pierce, WTF::BindRepeating(&FilterNodesWithListeners), + &nodes); for (Node* n : nodes) { // We are only interested in listeners from the current context. CollectEventListeners(isolate, n, v8::Local<v8::Value>(), n, pierce,
diff --git a/third_party/WebKit/Source/core/inspector/InspectorResourceContentLoader.cpp b/third_party/WebKit/Source/core/inspector/InspectorResourceContentLoader.cpp index 70ac5b4..14cc6ec 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorResourceContentLoader.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorResourceContentLoader.cpp
@@ -13,7 +13,6 @@ #include "core/inspector/InspectorPageAgent.h" #include "core/loader/DocumentLoader.h" #include "core/loader/resource/CSSStyleSheetResource.h" -#include "core/loader/resource/StyleSheetResourceClient.h" #include "core/page/Page.h" #include "platform/loader/fetch/RawResource.h" #include "platform/loader/fetch/Resource.h" @@ -25,74 +24,42 @@ namespace blink { +// NOTE: While this is a RawResourceClient, it loads both raw and css stylesheet +// resources. Stylesheets can only safely use a RawResourceClient because it has +// no custom interface and simply uses the base ResourceClient. class InspectorResourceContentLoader::ResourceClient final : public GarbageCollectedFinalized< InspectorResourceContentLoader::ResourceClient>, - private RawResourceClient, - private StyleSheetResourceClient { + private RawResourceClient { USING_GARBAGE_COLLECTED_MIXIN(ResourceClient); public: explicit ResourceClient(InspectorResourceContentLoader* loader) : loader_(loader) {} - void WaitForResource(Resource* resource) { - if (resource->GetType() == Resource::kRaw) - resource->AddClient(static_cast<RawResourceClient*>(this)); - else - resource->AddClient(static_cast<StyleSheetResourceClient*>(this)); - } + void WaitForResource(Resource* resource) { resource->AddClient(this); } void Trace(blink::Visitor* visitor) override { visitor->Trace(loader_); - StyleSheetResourceClient::Trace(visitor); RawResourceClient::Trace(visitor); } private: Member<InspectorResourceContentLoader> loader_; - void SetCSSStyleSheet(const String&, - const KURL&, - ReferrerPolicy, - const WTF::TextEncoding&, - const CSSStyleSheetResource*) override; - void NotifyFinished(Resource*) override; + void NotifyFinished(Resource* resource) override { + if (loader_) + loader_->ResourceFinished(this); + resource->RemoveClient(this); + } + String DebugName() const override { return "InspectorResourceContentLoader::ResourceClient"; } - void ResourceFinished(Resource*); friend class InspectorResourceContentLoader; }; -void InspectorResourceContentLoader::ResourceClient::ResourceFinished( - Resource* resource) { - if (loader_) - loader_->ResourceFinished(this); - - if (resource->GetType() == Resource::kRaw) - resource->RemoveClient(static_cast<RawResourceClient*>(this)); - else - resource->RemoveClient(static_cast<StyleSheetResourceClient*>(this)); -} - -void InspectorResourceContentLoader::ResourceClient::SetCSSStyleSheet( - const String&, - const KURL& url, - ReferrerPolicy, - const WTF::TextEncoding&, - const CSSStyleSheetResource* resource) { - ResourceFinished(const_cast<CSSStyleSheetResource*>(resource)); -} - -void InspectorResourceContentLoader::ResourceClient::NotifyFinished( - Resource* resource) { - if (resource->GetType() == Resource::kCSSStyleSheet) - return; - ResourceFinished(resource); -} - InspectorResourceContentLoader::InspectorResourceContentLoader( LocalFrame* inspected_frame) : all_requests_started_(false),
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm.cc index 6b2a23f..1252ca7 100644 --- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm.cc +++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm.cc
@@ -37,7 +37,17 @@ inline bool ShouldCreateBoxFragment(const NGInlineItem& item, const NGInlineItemResult& item_result) { + // Note: When you introduce more conditions, please make sure we have + // box fragments for plain SPAN to avoid using culled InlineBox which + // requires traversing layout tree to find |InlineBox| in SPAN, e.g. + // <div><span>foo</span></div>. + // In legacy layout tree, we don't have |InlineBox| for plain SPAN if + // |LayoutObject::AlwaysCreateLineBoxes()| is false. + // See |LayoutBlockFlow::LayoutInlineChildren()| for conditions for + // enabling |AlwaysCreateLineBoxes()|. DCHECK(item.Style()); + if (RuntimeEnabledFeatures::LayoutNGPaintFragmentsEnabled()) + return true; const ComputedStyle& style = *item.Style(); // TODO(kojii): We might need more conditions to create box fragments. return style.HasBoxDecorationBackground() || style.HasOutline() ||
diff --git a/third_party/WebKit/Source/core/loader/BUILD.gn b/third_party/WebKit/Source/core/loader/BUILD.gn index 721f5cc..1d4d0e3 100644 --- a/third_party/WebKit/Source/core/loader/BUILD.gn +++ b/third_party/WebKit/Source/core/loader/BUILD.gn
@@ -77,8 +77,6 @@ "WorkerFetchContext.h", "WorkerThreadableLoader.cpp", "WorkerThreadableLoader.h", - "WorkletScriptLoader.cpp", - "WorkletScriptLoader.h", "appcache/ApplicationCache.cpp", "appcache/ApplicationCache.h", "appcache/ApplicationCacheHost.cpp", @@ -122,8 +120,6 @@ "resource/MultipartImageResourceParser.h", "resource/ScriptResource.cpp", "resource/ScriptResource.h", - "resource/StyleSheetResource.h", - "resource/StyleSheetResourceClient.h", "resource/TextResource.cpp", "resource/TextResource.h", "resource/XSLStyleSheetResource.cpp",
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp index d1f7539..a29af07 100644 --- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp +++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -79,6 +79,7 @@ #include "platform/loader/fetch/fetch_initiator_type_names.h" #include "platform/mhtml/MHTMLArchive.h" #include "platform/network/NetworkStateNotifier.h" +#include "platform/network/NetworkUtils.h" #include "platform/network/http_names.h" #include "platform/scheduler/child/web_scheduler.h" #include "platform/scheduler/renderer/web_view_scheduler.h" @@ -609,6 +610,12 @@ if (IsDetached()) return; + if (NetworkUtils::IsCertificateTransparencyRequiredError(error.ErrorCode())) { + UseCounter::Count( + GetFrame()->GetDocument(), + WebFeature::kCertificateTransparencyRequiredErrorOnResourceLoad); + } + GetFrame()->Loader().Progress().CompleteProgress(identifier); probe::didFailLoading(GetFrame()->GetDocument(), identifier, MasterDocumentLoader(), error);
diff --git a/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp b/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp index 6bd9595..2e9d4e5 100644 --- a/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp +++ b/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp
@@ -17,6 +17,7 @@ #include "platform/exported/WrappedResourceRequest.h" #include "platform/loader/fetch/ResourceFetcher.h" #include "platform/network/NetworkStateNotifier.h" +#include "platform/network/NetworkUtils.h" #include "platform/runtime_enabled_features.h" #include "platform/weborigin/SecurityPolicy.h" #include "public/platform/Platform.h" @@ -318,6 +319,9 @@ int64_t encoded_data_length, bool is_internal_request) { probe::didFailLoading(global_scope_, identifier, nullptr, error); + if (NetworkUtils::IsCertificateTransparencyRequiredError(error.ErrorCode())) { + CountUsage(WebFeature::kCertificateTransparencyRequiredErrorOnResourceLoad); + } } void WorkerFetchContext::AddResourceTiming(const ResourceTimingInfo& info) {
diff --git a/third_party/WebKit/Source/core/loader/WorkletScriptLoader.cpp b/third_party/WebKit/Source/core/loader/WorkletScriptLoader.cpp deleted file mode 100644 index fe495b1..0000000 --- a/third_party/WebKit/Source/core/loader/WorkletScriptLoader.cpp +++ /dev/null
@@ -1,72 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "core/loader/WorkletScriptLoader.h" - -#include "bindings/core/v8/ScriptSourceCode.h" -#include "core/loader/FrameFetchContext.h" -#include "platform/loader/fetch/ResourceLoaderOptions.h" -#include "platform/loader/fetch/fetch_initiator_type_names.h" -#include "platform/wtf/WTF.h" - -namespace blink { - -WorkletScriptLoader::WorkletScriptLoader(ResourceFetcher* fetcher, - Client* client) - : fetcher_(fetcher), client_(client) {} - -void WorkletScriptLoader::FetchScript(const KURL& module_url_record) { - DCHECK(IsMainThread()); - DCHECK(!GetResource()); - DCHECK(!was_script_load_complete_); - - ResourceRequest resource_request(module_url_record); - resource_request.SetRequestContext(WebURLRequest::kRequestContextScript); - ResourceLoaderOptions options; - options.initiator_info.name = FetchInitiatorTypeNames::internal; - FetchParameters params(resource_request, options); - ScriptResource* resource = ScriptResource::Fetch(params, fetcher_); - if (!resource) { - NotifyFinished(nullptr); - return; - } - SetResource(resource); - // notifyFinished() will be called later. -} - -void WorkletScriptLoader::Cancel() { - DCHECK(IsMainThread()); - if (!GetResource() || was_script_load_complete_) - return; - NotifyFinished(nullptr); -} - -void WorkletScriptLoader::NotifyFinished(Resource* resource) { - DCHECK(IsMainThread()); - DCHECK(!was_script_load_complete_); - ClearResource(); - was_script_load_complete_ = true; - if (!resource || resource->ErrorOccurred()) { - client_->NotifyWorkletScriptLoadingFinished(this, ScriptSourceCode()); - } else { - was_script_load_successful_ = true; - client_->NotifyWorkletScriptLoadingFinished( - this, ScriptSourceCode(static_cast<ScriptResource*>(resource))); - } - fetcher_ = nullptr; - client_ = nullptr; -} - -bool WorkletScriptLoader::WasScriptLoadSuccessful() const { - DCHECK(was_script_load_complete_); - return was_script_load_successful_; -} - -void WorkletScriptLoader::Trace(blink::Visitor* visitor) { - visitor->Trace(fetcher_); - visitor->Trace(client_); - ResourceOwner<ScriptResource>::Trace(visitor); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/core/loader/WorkletScriptLoader.h b/third_party/WebKit/Source/core/loader/WorkletScriptLoader.h deleted file mode 100644 index 576faeb..0000000 --- a/third_party/WebKit/Source/core/loader/WorkletScriptLoader.h +++ /dev/null
@@ -1,75 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WorkletScriptLoader_h -#define WorkletScriptLoader_h - -#include "core/CoreExport.h" -#include "core/loader/resource/ScriptResource.h" -#include "platform/loader/fetch/ResourceClient.h" -#include "platform/loader/fetch/ResourceOwner.h" - -namespace blink { - -class ResourceFetcher; -class ScriptSourceCode; - -// This class is responsible for fetching and loading a worklet script as a -// classic script. You can access this class only on the main thread. -// A client of this class receives notifications via Client interface. -// TODO(nhiroki): Switch to module script loading (https://crbug.com/627945) -class CORE_EXPORT WorkletScriptLoader final - : public GarbageCollectedFinalized<WorkletScriptLoader>, - public ResourceOwner<ScriptResource> { - USING_GARBAGE_COLLECTED_MIXIN(WorkletScriptLoader); - WTF_MAKE_NONCOPYABLE(WorkletScriptLoader); - - public: - class CORE_EXPORT Client : public GarbageCollectedMixin { - public: - // Called when resource loading is completed. If loading is failed or - // canceled, an empty ScriptSourceCode is passed. You can check if loading - // is successfully completed by wasScriptLoadSuccessful(). - virtual void NotifyWorkletScriptLoadingFinished( - WorkletScriptLoader*, - const ScriptSourceCode&) = 0; - }; - - static WorkletScriptLoader* Create(ResourceFetcher* fetcher, Client* client) { - return new WorkletScriptLoader(fetcher, client); - } - - ~WorkletScriptLoader() override = default; - - // Fetches an URL and loads it as a classic script. Synchronously calls - // Client::notifyWorkletScriptLoadingFinished() if there is an error. - void FetchScript(const KURL& module_url_record); - - // Cancels resource loading and synchronously calls - // Client::notifyWorkletScriptLoadingFinished(). - void Cancel(); - - // Returns true if a script was successfully loaded. This should be called - // after Client::notifyWorkletScriptLoadingFinished() is called. - bool WasScriptLoadSuccessful() const; - - void Trace(blink::Visitor*) override; - - private: - WorkletScriptLoader(ResourceFetcher*, Client*); - - // ResourceClient - void NotifyFinished(Resource*) final; - String DebugName() const final { return "WorkletLoader"; } - - Member<ResourceFetcher> fetcher_; - Member<Client> client_; - - bool was_script_load_successful_ = false; - bool was_script_load_complete_ = false; -}; - -} // namespace blink - -#endif // WorkletScriptLoader_h
diff --git a/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.cpp b/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.cpp index 543a73e..87dce93 100644 --- a/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.cpp +++ b/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.cpp
@@ -28,11 +28,8 @@ #include "core/css/StyleSheetContents.h" #include "core/frame/WebFeature.h" -#include "core/loader/resource/StyleSheetResourceClient.h" -#include "platform/SharedBuffer.h" #include "platform/loader/fetch/FetchParameters.h" #include "platform/loader/fetch/MemoryCache.h" -#include "platform/loader/fetch/ResourceClientWalker.h" #include "platform/loader/fetch/ResourceFetcher.h" #include "platform/loader/fetch/ResourceLoaderOptions.h" #include "platform/loader/fetch/TextResourceDecoderOptions.h" @@ -40,7 +37,6 @@ #include "platform/network/mime/MIMETypeRegistry.h" #include "platform/runtime_enabled_features.h" #include "platform/weborigin/SecurityPolicy.h" -#include "platform/wtf/Time.h" #include "platform/wtf/text/TextEncoding.h" namespace blink { @@ -73,10 +69,8 @@ const ResourceRequest& resource_request, const ResourceLoaderOptions& options, const TextResourceDecoderOptions& decoder_options) - : StyleSheetResource(resource_request, - kCSSStyleSheet, - options, - decoder_options) {} + : TextResource(resource_request, kCSSStyleSheet, options, decoder_options) { +} CSSStyleSheetResource::~CSSStyleSheetResource() {} @@ -94,31 +88,19 @@ void CSSStyleSheetResource::Trace(blink::Visitor* visitor) { visitor->Trace(parsed_style_sheet_cache_); - StyleSheetResource::Trace(visitor); + TextResource::Trace(visitor); } -void CSSStyleSheetResource::DidAddClient(ResourceClient* c) { - DCHECK(StyleSheetResourceClient::IsExpectedType(c)); - // Resource::didAddClient() must be before setCSSStyleSheet(), because - // setCSSStyleSheet() may cause scripts to be executed, which could destroy - // 'c' if it is an instance of HTMLLinkElement. see the comment of - // HTMLLinkElement::setCSSStyleSheet. - Resource::DidAddClient(c); - - // |c| might be removed in didAppendFirstData, so ensure it is still a client. - if (HasClient(c) && !IsLoading()) { - ReferrerPolicy referrer_policy = kReferrerPolicyDefault; - String referrer_policy_header = - GetResponse().HttpHeaderField(HTTPNames::Referrer_Policy); - if (!referrer_policy_header.IsNull()) { - SecurityPolicy::ReferrerPolicyFromHeaderValue( - referrer_policy_header, kDoNotSupportReferrerPolicyLegacyKeywords, - &referrer_policy); - } - static_cast<StyleSheetResourceClient*>(c)->SetCSSStyleSheet( - GetResourceRequest().Url(), GetResponse().Url(), referrer_policy, - Encoding(), this); +ReferrerPolicy CSSStyleSheetResource::GetReferrerPolicy() const { + ReferrerPolicy referrer_policy = kReferrerPolicyDefault; + String referrer_policy_header = + GetResponse().HttpHeaderField(HTTPNames::Referrer_Policy); + if (!referrer_policy_header.IsNull()) { + SecurityPolicy::ReferrerPolicyFromHeaderValue( + referrer_policy_header, kDoNotSupportReferrerPolicyLegacyKeywords, + &referrer_policy); } + return referrer_policy; } const String CSSStyleSheetResource::SheetText( @@ -147,21 +129,7 @@ if (Data()) SetDecodedSheetText(DecodedText()); - ReferrerPolicy referrer_policy = kReferrerPolicyDefault; - String referrer_policy_header = - GetResponse().HttpHeaderField(HTTPNames::Referrer_Policy); - if (!referrer_policy_header.IsNull()) { - SecurityPolicy::ReferrerPolicyFromHeaderValue( - referrer_policy_header, kDoNotSupportReferrerPolicyLegacyKeywords, - &referrer_policy); - } - - ResourceClientWalker<StyleSheetResourceClient> w(Clients()); - while (StyleSheetResourceClient* c = w.Next()) { - MarkClientFinished(c); - c->SetCSSStyleSheet(GetResourceRequest().Url(), GetResponse().Url(), - referrer_policy, Encoding(), this); - } + Resource::NotifyFinished(); // Clear raw bytes as now we have the full decoded sheet text. // We wait for all LinkStyle::setCSSStyleSheet to run (at least once)
diff --git a/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.h b/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.h index c1d9dd2..3205b37 100644 --- a/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.h +++ b/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.h
@@ -27,7 +27,7 @@ #define CSSStyleSheetResource_h #include "core/CoreExport.h" -#include "core/loader/resource/StyleSheetResource.h" +#include "core/loader/resource/TextResource.h" #include "platform/heap/Handle.h" #include "platform/loader/fetch/TextResourceDecoderOptions.h" #include "platform/wtf/text/TextEncoding.h" @@ -37,11 +37,10 @@ class CSSParserContext; class FetchParameters; class KURL; -class ResourceClient; class ResourceFetcher; class StyleSheetContents; -class CORE_EXPORT CSSStyleSheetResource final : public StyleSheetResource { +class CORE_EXPORT CSSStyleSheetResource final : public TextResource { public: enum class MIMETypeCheck { kStrict, kLax }; @@ -54,11 +53,9 @@ const String SheetText(const CSSParserContext*, MIMETypeCheck = MIMETypeCheck::kStrict) const; - - void DidAddClient(ResourceClient*) override; - StyleSheetContents* CreateParsedStyleSheetFromCache(const CSSParserContext*); void SaveParsedStyleSheet(StyleSheetContents*); + ReferrerPolicy GetReferrerPolicy() const; private: class CSSStyleSheetResourceFactory : public ResourceFactory {
diff --git a/third_party/WebKit/Source/core/loader/resource/StyleSheetResource.h b/third_party/WebKit/Source/core/loader/resource/StyleSheetResource.h deleted file mode 100644 index 0cdf917..0000000 --- a/third_party/WebKit/Source/core/loader/resource/StyleSheetResource.h +++ /dev/null
@@ -1,55 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef StyleSheetResource_h -#define StyleSheetResource_h - -#include "core/CoreExport.h" -#include "core/loader/resource/TextResource.h" -#include "platform/loader/fetch/TextResourceDecoderOptions.h" - -namespace blink { - -class StyleSheetResourceClient; - -class CORE_EXPORT StyleSheetResource : public TextResource { - public: - using ClientType = StyleSheetResourceClient; - - StyleSheetResource(const ResourceRequest& request, - Type type, - const ResourceLoaderOptions& options, - const TextResourceDecoderOptions& decoder_options) - : TextResource(request, type, options, decoder_options) {} -}; - -} // namespace blink - -#endif
diff --git a/third_party/WebKit/Source/core/loader/resource/StyleSheetResourceClient.h b/third_party/WebKit/Source/core/loader/resource/StyleSheetResourceClient.h deleted file mode 100644 index 5a76c80..0000000 --- a/third_party/WebKit/Source/core/loader/resource/StyleSheetResourceClient.h +++ /dev/null
@@ -1,62 +0,0 @@ -/* - Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) - Copyright (C) 2001 Dirk Mueller <mueller@kde.org> - Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - Copyright (C) 2011 Google Inc. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - This class provides all functionality needed for loading images, style sheets - and html pages from the web. It has a memory cache for these objects. - */ - -#ifndef StyleSheetResourceClient_h -#define StyleSheetResourceClient_h - -#include "core/CoreExport.h" -#include "platform/loader/fetch/ResourceClient.h" -#include "platform/weborigin/KURL.h" -#include "platform/weborigin/ReferrerPolicy.h" -#include "platform/wtf/Forward.h" - -namespace blink { -class CSSStyleSheetResource; - -class CORE_EXPORT StyleSheetResourceClient : public ResourceClient { - public: - static bool IsExpectedType(ResourceClient* client) { - return client->GetResourceClientType() == kStyleSheetType; - } - ResourceClientType GetResourceClientType() const final { - return kStyleSheetType; - } - virtual void SetCSSStyleSheet(const String& /* href */, - const KURL& /* baseURL */, - ReferrerPolicy, - const WTF::TextEncoding&, - const CSSStyleSheetResource*) {} - virtual void SetXSLStyleSheet(const String& /* href */, - const KURL& /* baseURL */, - const String& /* sheet */) {} - - void Trace(blink::Visitor* visitor) override { - ResourceClient::Trace(visitor); - } -}; - -} // namespace blink - -#endif // StyleSheetResourceClient_h
diff --git a/third_party/WebKit/Source/core/loader/resource/TextResource.h b/third_party/WebKit/Source/core/loader/resource/TextResource.h index 2457ff2..ec41db1 100644 --- a/third_party/WebKit/Source/core/loader/resource/TextResource.h +++ b/third_party/WebKit/Source/core/loader/resource/TextResource.h
@@ -15,6 +15,8 @@ class CORE_EXPORT TextResource : public Resource { public: + using ClientType = ResourceClient; + // Returns the decoded data in text form. The data has to be available at // call time. String DecodedText() const;
diff --git a/third_party/WebKit/Source/core/loader/resource/XSLStyleSheetResource.cpp b/third_party/WebKit/Source/core/loader/resource/XSLStyleSheetResource.cpp index 5229e18..52f51ca 100644 --- a/third_party/WebKit/Source/core/loader/resource/XSLStyleSheetResource.cpp +++ b/third_party/WebKit/Source/core/loader/resource/XSLStyleSheetResource.cpp
@@ -26,10 +26,7 @@ #include "core/loader/resource/XSLStyleSheetResource.h" -#include "core/loader/resource/StyleSheetResourceClient.h" -#include "platform/SharedBuffer.h" #include "platform/loader/fetch/FetchParameters.h" -#include "platform/loader/fetch/ResourceClientWalker.h" #include "platform/loader/fetch/ResourceFetcher.h" #include "platform/loader/fetch/TextResourceDecoderOptions.h" #include "platform/runtime_enabled_features.h" @@ -73,30 +70,13 @@ const ResourceRequest& resource_request, const ResourceLoaderOptions& options, const TextResourceDecoderOptions& decoder_options) - : StyleSheetResource(resource_request, - kXSLStyleSheet, - options, - decoder_options) {} - -void XSLStyleSheetResource::DidAddClient(ResourceClient* c) { - DCHECK(StyleSheetResourceClient::IsExpectedType(c)); - Resource::DidAddClient(c); - if (!IsLoading()) { - static_cast<StyleSheetResourceClient*>(c)->SetXSLStyleSheet( - GetResourceRequest().Url(), GetResponse().Url(), sheet_); - } + : TextResource(resource_request, kXSLStyleSheet, options, decoder_options) { } void XSLStyleSheetResource::NotifyFinished() { if (Data()) sheet_ = DecodedText(); - - ResourceClientWalker<StyleSheetResourceClient> w(Clients()); - while (StyleSheetResourceClient* c = w.Next()) { - MarkClientFinished(c); - c->SetXSLStyleSheet(GetResourceRequest().Url(), GetResponse().Url(), - sheet_); - } + Resource::NotifyFinished(); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/loader/resource/XSLStyleSheetResource.h b/third_party/WebKit/Source/core/loader/resource/XSLStyleSheetResource.h index 7b684687..e1b310f 100644 --- a/third_party/WebKit/Source/core/loader/resource/XSLStyleSheetResource.h +++ b/third_party/WebKit/Source/core/loader/resource/XSLStyleSheetResource.h
@@ -26,7 +26,7 @@ #ifndef XSLStyleSheetResource_h #define XSLStyleSheetResource_h -#include "core/loader/resource/StyleSheetResource.h" +#include "core/loader/resource/TextResource.h" #include "platform/loader/fetch/TextResourceDecoderOptions.h" namespace blink { @@ -34,7 +34,7 @@ class FetchParameters; class ResourceFetcher; -class XSLStyleSheetResource final : public StyleSheetResource { +class XSLStyleSheetResource final : public TextResource { public: static XSLStyleSheetResource* FetchSynchronously(FetchParameters&, ResourceFetcher*); @@ -42,8 +42,6 @@ const String& Sheet() const { return sheet_; } - void DidAddClient(ResourceClient*) override; - private: class XSLStyleSheetResourceFactory : public ResourceFactory { public:
diff --git a/third_party/WebKit/Source/core/mojo/test/MojoInterfaceInterceptor.cpp b/third_party/WebKit/Source/core/mojo/test/MojoInterfaceInterceptor.cpp index a52a424..3c2df9fe 100644 --- a/third_party/WebKit/Source/core/mojo/test/MojoInterfaceInterceptor.cpp +++ b/third_party/WebKit/Source/core/mojo/test/MojoInterfaceInterceptor.cpp
@@ -73,9 +73,8 @@ started_ = true; test_api.OverrideBinderForTesting( browser_service, interface_name, - ConvertToBaseCallback( - WTF::Bind(&MojoInterfaceInterceptor::OnInterfaceRequest, - WrapWeakPersistent(this)))); + WTF::BindRepeating(&MojoInterfaceInterceptor::OnInterfaceRequest, + WrapWeakPersistent(this))); return; } @@ -89,10 +88,10 @@ } started_ = true; - test_api.SetBinderForName(interface_name, - ConvertToBaseCallback(WTF::Bind( - &MojoInterfaceInterceptor::OnInterfaceRequest, - WrapWeakPersistent(this)))); + test_api.SetBinderForName( + interface_name, + WTF::BindRepeating(&MojoInterfaceInterceptor::OnInterfaceRequest, + WrapWeakPersistent(this))); } void MojoInterfaceInterceptor::stop() {
diff --git a/third_party/WebKit/Source/core/svg/SVGURIReference.cpp b/third_party/WebKit/Source/core/svg/SVGURIReference.cpp index e5c9e8a..3a1f323 100644 --- a/third_party/WebKit/Source/core/svg/SVGURIReference.cpp +++ b/third_party/WebKit/Source/core/svg/SVGURIReference.cpp
@@ -35,7 +35,7 @@ public: SVGElementReferenceObserver(TreeScope& tree_scope, const AtomicString& id, - WTF::Closure closure) + WTF::RepeatingClosure closure) : IdTargetObserver(tree_scope.GetIdTargetObserverRegistry(), id), closure_(std::move(closure)) {} @@ -125,15 +125,16 @@ const String& href_string) { TreeScope& tree_scope = context_element.GetTreeScope(); AtomicString id = FragmentIdentifierFromIRIString(href_string, tree_scope); - return ObserveTarget(observer, tree_scope, id, - WTF::Bind(&SVGElement::BuildPendingResource, - WrapWeakPersistent(&context_element))); + return ObserveTarget( + observer, tree_scope, id, + WTF::BindRepeating(&SVGElement::BuildPendingResource, + WrapWeakPersistent(&context_element))); } Element* SVGURIReference::ObserveTarget(Member<IdTargetObserver>& observer, TreeScope& tree_scope, const AtomicString& id, - WTF::Closure closure) { + WTF::RepeatingClosure closure) { DCHECK(!observer); if (id.IsEmpty()) return nullptr;
diff --git a/third_party/WebKit/Source/core/svg/SVGURIReference.h b/third_party/WebKit/Source/core/svg/SVGURIReference.h index f55b6d3..2911ef0 100644 --- a/third_party/WebKit/Source/core/svg/SVGURIReference.h +++ b/third_party/WebKit/Source/core/svg/SVGURIReference.h
@@ -71,7 +71,7 @@ static Element* ObserveTarget(Member<IdTargetObserver>&, TreeScope&, const AtomicString& id, - WTF::Closure); + WTF::RepeatingClosure); // Unregister and destroy the observer. static void UnobserveTarget(Member<IdTargetObserver>&);
diff --git a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp index 7426d64..9ac03e8 100644 --- a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
@@ -310,10 +310,10 @@ if (!IsStructurallyExternal()) { if (observe_behavior == kDontAddObserver) return GetTreeScope().getElementById(element_identifier); - return ObserveTarget(target_id_observer_, GetTreeScope(), - element_identifier, - WTF::Bind(&SVGUseElement::InvalidateShadowTree, - WrapWeakPersistent(this))); + return ObserveTarget( + target_id_observer_, GetTreeScope(), element_identifier, + WTF::BindRepeating(&SVGUseElement::InvalidateShadowTree, + WrapWeakPersistent(this))); } if (!ResourceIsValid()) return nullptr;
diff --git a/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp b/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp index 05806fd..0670af6 100644 --- a/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp +++ b/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp
@@ -181,8 +181,8 @@ } else { target = SVGURIReference::ObserveTarget( base_id_observer_, timed_element.GetTreeScope(), base_id_, - WTF::Bind(&SVGSMILElement::BuildPendingResource, - WrapWeakPersistent(&timed_element))); + WTF::BindRepeating(&SVGSMILElement::BuildPendingResource, + WrapWeakPersistent(&timed_element))); } if (!target || !target->IsSVGElement()) return;
diff --git a/third_party/WebKit/Source/modules/ModulesInitializer.cpp b/third_party/WebKit/Source/modules/ModulesInitializer.cpp index 80fcbf8..809f823 100644 --- a/third_party/WebKit/Source/modules/ModulesInitializer.cpp +++ b/third_party/WebKit/Source/modules/ModulesInitializer.cpp
@@ -138,17 +138,17 @@ void ModulesInitializer::InitLocalFrame(LocalFrame& frame) const { // CoreInitializer::RegisterLocalFrameInitCallback([](LocalFrame& frame) { if (frame.IsMainFrame()) { - frame.GetInterfaceRegistry()->AddInterface(WTF::Bind( + frame.GetInterfaceRegistry()->AddInterface(WTF::BindRepeating( &CopylessPasteServer::BindMojoRequest, WrapWeakPersistent(&frame))); } - frame.GetInterfaceRegistry()->AddInterface( - WTF::Bind(&InstallationServiceImpl::Create, WrapWeakPersistent(&frame))); + frame.GetInterfaceRegistry()->AddInterface(WTF::BindRepeating( + &InstallationServiceImpl::Create, WrapWeakPersistent(&frame))); // TODO(dominickn): This interface should be document-scoped rather than // frame-scoped, as the resulting banner event is dispatched to // frame()->document(). - frame.GetInterfaceRegistry()->AddInterface(WTF::Bind( + frame.GetInterfaceRegistry()->AddInterface(WTF::BindRepeating( &AppBannerController::BindMojoRequest, WrapWeakPersistent(&frame))); - frame.GetInterfaceRegistry()->AddInterface(WTF::Bind( + frame.GetInterfaceRegistry()->AddInterface(WTF::BindRepeating( &TextSuggestionBackendImpl::Create, WrapWeakPersistent(&frame))); }
diff --git a/third_party/WebKit/Source/modules/fetch/FetchDataLoader.cpp b/third_party/WebKit/Source/modules/fetch/FetchDataLoader.cpp index f85121a4..8949768 100644 --- a/third_party/WebKit/Source/modules/fetch/FetchDataLoader.cpp +++ b/third_party/WebKit/Source/modules/fetch/FetchDataLoader.cpp
@@ -499,8 +499,8 @@ DCHECK(!consumer_); data_pipe_watcher_.Watch( out_data_pipe_.get(), MOJO_HANDLE_SIGNAL_WRITABLE, - ConvertToBaseCallback(WTF::Bind(&FetchDataLoaderAsDataPipe::OnWritable, - WrapWeakPersistent(this)))); + WTF::BindRepeating(&FetchDataLoaderAsDataPipe::OnWritable, + WrapWeakPersistent(this))); data_pipe_watcher_.ArmOrNotify(); client_ = client; consumer_ = consumer;
diff --git a/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp b/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp index ae1aaf5..972ae8b 100644 --- a/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp +++ b/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp
@@ -307,8 +307,8 @@ media_event_listener_(new MediaControlsMediaEventListener(this)), window_event_listener_(MediaControlsWindowEventListener::Create( this, - WTF::Bind(&MediaControlsImpl::HideAllMenus, - WrapWeakPersistent(this)))), + WTF::BindRepeating(&MediaControlsImpl::HideAllMenus, + WrapWeakPersistent(this)))), orientation_lock_delegate_(nullptr), rotate_to_fullscreen_delegate_(nullptr), hide_media_controls_timer_(
diff --git a/third_party/WebKit/Source/modules/media_controls/MediaControlsMediaEventListener.cpp b/third_party/WebKit/Source/modules/media_controls/MediaControlsMediaEventListener.cpp index f4f1189..45a141b5 100644 --- a/third_party/WebKit/Source/modules/media_controls/MediaControlsMediaEventListener.cpp +++ b/third_party/WebKit/Source/modules/media_controls/MediaControlsMediaEventListener.cpp
@@ -72,9 +72,9 @@ if (!remote_playback_availability_callback_id_.has_value()) { remote_playback_availability_callback_id_ = WTF::make_optional( remote->WatchAvailabilityInternal(new AvailabilityCallbackWrapper( - WTF::Bind(&MediaControlsMediaEventListener:: - OnRemotePlaybackAvailabilityChanged, - WrapWeakPersistent(this))))); + WTF::BindRepeating(&MediaControlsMediaEventListener:: + OnRemotePlaybackAvailabilityChanged, + WrapWeakPersistent(this))))); } } }
diff --git a/third_party/WebKit/Source/modules/media_controls/MediaControlsRotateToFullscreenDelegate.cpp b/third_party/WebKit/Source/modules/media_controls/MediaControlsRotateToFullscreenDelegate.cpp index 2be2a17..8012d00 100644 --- a/third_party/WebKit/Source/modules/media_controls/MediaControlsRotateToFullscreenDelegate.cpp +++ b/third_party/WebKit/Source/modules/media_controls/MediaControlsRotateToFullscreenDelegate.cpp
@@ -125,8 +125,9 @@ if (needs_visibility_observer && !visibility_observer_) { visibility_observer_ = new ElementVisibilityObserver( video_element_, - WTF::Bind(&MediaControlsRotateToFullscreenDelegate::OnVisibilityChange, - WrapWeakPersistent(this))); + WTF::BindRepeating( + &MediaControlsRotateToFullscreenDelegate::OnVisibilityChange, + WrapWeakPersistent(this))); visibility_observer_->Start(kVisibilityThreshold); } else if (!needs_visibility_observer && visibility_observer_) { visibility_observer_->Stop();
diff --git a/third_party/WebKit/Source/modules/nfc/NFC.cpp b/third_party/WebKit/Source/modules/nfc/NFC.cpp index d2452b95..92bfe960 100644 --- a/third_party/WebKit/Source/modules/nfc/NFC.cpp +++ b/third_party/WebKit/Source/modules/nfc/NFC.cpp
@@ -721,7 +721,8 @@ WrapPersistent(this), WrapPersistent(resolver))); nfc_->Push(std::move(message), - device::mojom::blink::NFCPushOptions::From(options), callback); + device::mojom::blink::NFCPushOptions::From(options), + std::move(callback)); return resolver->Promise(); } @@ -737,7 +738,7 @@ auto callback = ConvertToBaseCallback(WTF::Bind(&NFC::OnRequestCompleted, WrapPersistent(this), WrapPersistent(resolver))); - nfc_->CancelPush(mojo::toNFCPushTarget(target), callback); + nfc_->CancelPush(mojo::toNFCPushTarget(target), std::move(callback)); return resolver->Promise(); } @@ -767,7 +768,7 @@ WTF::Bind(&NFC::OnWatchRegistered, WrapPersistent(this), WrapPersistent(callback), WrapPersistent(resolver))); nfc_->Watch(device::mojom::blink::NFCWatchOptions::From(options), - watch_callback); + std::move(watch_callback)); return resolver->Promise(); }
diff --git a/third_party/WebKit/Source/modules/remoteplayback/AvailabilityCallbackWrapper.cpp b/third_party/WebKit/Source/modules/remoteplayback/AvailabilityCallbackWrapper.cpp index 86866966..495a2109 100644 --- a/third_party/WebKit/Source/modules/remoteplayback/AvailabilityCallbackWrapper.cpp +++ b/third_party/WebKit/Source/modules/remoteplayback/AvailabilityCallbackWrapper.cpp
@@ -13,7 +13,8 @@ V8RemotePlaybackAvailabilityCallback* callback) : bindings_cb_(callback) {} -AvailabilityCallbackWrapper::AvailabilityCallbackWrapper(WTF::Closure callback) +AvailabilityCallbackWrapper::AvailabilityCallbackWrapper( + WTF::RepeatingClosure callback) : internal_cb_(std::move(callback)) {} void AvailabilityCallbackWrapper::Run(RemotePlayback* remote_playback,
diff --git a/third_party/WebKit/Source/modules/remoteplayback/AvailabilityCallbackWrapper.h b/third_party/WebKit/Source/modules/remoteplayback/AvailabilityCallbackWrapper.h index 1e50a51f..2f4744a 100644 --- a/third_party/WebKit/Source/modules/remoteplayback/AvailabilityCallbackWrapper.h +++ b/third_party/WebKit/Source/modules/remoteplayback/AvailabilityCallbackWrapper.h
@@ -27,7 +27,7 @@ public: explicit AvailabilityCallbackWrapper(V8RemotePlaybackAvailabilityCallback*); - explicit AvailabilityCallbackWrapper(WTF::Closure); + explicit AvailabilityCallbackWrapper(WTF::RepeatingClosure); ~AvailabilityCallbackWrapper() = default; void Run(RemotePlayback*, bool new_availability);
diff --git a/third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.cpp b/third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.cpp index a888be8..6e3ca83 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/RespondWithObserver.cpp
@@ -58,10 +58,11 @@ state_ = kPending; observer_->WaitUntil( script_state, script_promise, exception_state, - WTF::Bind(&RespondWithObserver::ResponseWasFulfilled, - WrapPersistent(this)), - WTF::Bind(&RespondWithObserver::ResponseWasRejected, WrapPersistent(this), - ServiceWorkerResponseError::kPromiseRejected)); + WTF::BindRepeating(&RespondWithObserver::ResponseWasFulfilled, + WrapPersistent(this)), + WTF::BindRepeating(&RespondWithObserver::ResponseWasRejected, + WrapPersistent(this), + ServiceWorkerResponseError::kPromiseRejected)); } void RespondWithObserver::ResponseWasRejected(ServiceWorkerResponseError error,
diff --git a/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLockTest.cpp b/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLockTest.cpp index d65a312..c45551b 100644 --- a/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLockTest.cpp +++ b/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLockTest.cpp
@@ -58,9 +58,8 @@ service_manager::InterfaceProvider::TestApi test_api( test_web_frame_client_.GetInterfaceProvider()); test_api.SetBinderForName( - WakeLock::Name_, - ConvertToBaseCallback( - WTF::Bind(&MockWakeLock::Bind, WTF::Unretained(&mock_wake_lock_)))); + WakeLock::Name_, WTF::BindRepeating(&MockWakeLock::Bind, + WTF::Unretained(&mock_wake_lock_))); web_view_helper_.Initialize(&test_web_frame_client_); URLTestHelpers::RegisterMockedURLLoadFromBase(
diff --git a/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp b/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp index 3650c23..7c974134 100644 --- a/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp +++ b/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp
@@ -287,8 +287,9 @@ if (DatabaseClient* client = DatabaseClient::FromPage(page_)) client->SetInspectorAgent(this); DatabaseTracker::Tracker().ForEachOpenDatabaseInPage( - page_, WTF::Bind(&InspectorDatabaseAgent::RegisterDatabaseOnCreation, - WrapPersistent(this))); + page_, + WTF::BindRepeating(&InspectorDatabaseAgent::RegisterDatabaseOnCreation, + WrapPersistent(this))); return Response::OK(); }
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp index d89dab9..1802d96 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp +++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -1195,14 +1195,13 @@ scissor_box_[3]); GetDrawingBuffer()->ContextProvider()->SetLostContextCallback( - ConvertToBaseCallback(WTF::Bind( - &WebGLRenderingContextBase::ForceLostContext, - WrapWeakPersistent(this), WebGLRenderingContextBase::kRealLostContext, - WebGLRenderingContextBase::kAuto))); + WTF::BindRepeating(&WebGLRenderingContextBase::ForceLostContext, + WrapWeakPersistent(this), + WebGLRenderingContextBase::kRealLostContext, + WebGLRenderingContextBase::kAuto)); GetDrawingBuffer()->ContextProvider()->SetErrorMessageCallback( - ConvertToBaseCallback( - WTF::Bind(&WebGLRenderingContextBase::OnErrorMessage, - WrapWeakPersistent(this)))); + WTF::BindRepeating(&WebGLRenderingContextBase::OnErrorMessage, + WrapWeakPersistent(this))); // If WebGL 2, the PRIMITIVE_RESTART_FIXED_INDEX should be always enabled. // See the section <Primitive Restart is Always Enabled> in WebGL 2 spec: @@ -1305,12 +1304,12 @@ extensions_util_.reset(); - WTF::Closure null_closure; - WTF::Function<void(const char*, int32_t)> null_function; + WTF::RepeatingClosure null_closure; + WTF::RepeatingFunction<void(const char*, int32_t)> null_function; GetDrawingBuffer()->ContextProvider()->SetLostContextCallback( - ConvertToBaseCallback(std::move(null_closure))); + std::move(null_closure)); GetDrawingBuffer()->ContextProvider()->SetErrorMessageCallback( - ConvertToBaseCallback(std::move(null_function))); + std::move(null_function)); DCHECK(GetDrawingBuffer()); drawing_buffer_->BeginDestruction();
diff --git a/third_party/WebKit/Source/platform/blob/BlobBytesProvider.cpp b/third_party/WebKit/Source/platform/blob/BlobBytesProvider.cpp index eee97416..1f68f24 100644 --- a/third_party/WebKit/Source/platform/blob/BlobBytesProvider.cpp +++ b/third_party/WebKit/Source/platform/blob/BlobBytesProvider.cpp
@@ -26,8 +26,8 @@ pipe_(std::move(pipe)), watcher_(FROM_HERE, mojo::SimpleWatcher::ArmingPolicy::AUTOMATIC) { watcher_.Watch(pipe_.get(), MOJO_HANDLE_SIGNAL_WRITABLE, - ConvertToBaseCallback(WTF::Bind( - &BlobBytesStreamer::OnWritable, WTF::Unretained(this)))); + WTF::BindRepeating(&BlobBytesStreamer::OnWritable, + WTF::Unretained(this))); } void OnWritable(MojoResult result) {
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTestHelpers.h b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTestHelpers.h index b0cfd74..5238dc2 100644 --- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTestHelpers.h +++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTestHelpers.h
@@ -50,7 +50,7 @@ return gpu_feature_info_; } viz::GLHelper* GetGLHelper() override { return nullptr; } - void SetLostContextCallback(const base::Closure&) override {} + void SetLostContextCallback(base::Closure) override {} void SetErrorMessageCallback( base::RepeatingCallback<void(const char*, int32_t id)>) {} void SignalQuery(uint32_t, base::OnceClosure) override {}
diff --git a/third_party/WebKit/Source/platform/graphics/test/FakeWebGraphicsContext3DProvider.h b/third_party/WebKit/Source/platform/graphics/test/FakeWebGraphicsContext3DProvider.h index fab2172..751528e 100644 --- a/third_party/WebKit/Source/platform/graphics/test/FakeWebGraphicsContext3DProvider.h +++ b/third_party/WebKit/Source/platform/graphics/test/FakeWebGraphicsContext3DProvider.h
@@ -44,7 +44,7 @@ gpu::gles2::GLES2Interface* ContextGL() override { return gl_; } bool BindToCurrentThread() override { return false; } - void SetLostContextCallback(const base::Closure&) override {} + void SetLostContextCallback(base::Closure) override {} void SetErrorMessageCallback( base::RepeatingCallback<void(const char*, int32_t id)>) {} void SignalQuery(uint32_t, base::OnceClosure) override {}
diff --git a/third_party/WebKit/Source/platform/heap/PersistentTest.cpp b/third_party/WebKit/Source/platform/heap/PersistentTest.cpp index fb8b81d..ae905981 100644 --- a/third_party/WebKit/Source/platform/heap/PersistentTest.cpp +++ b/third_party/WebKit/Source/platform/heap/PersistentTest.cpp
@@ -24,8 +24,8 @@ Receiver* receiver = new Receiver; int counter = 0; WTF::RepeatingClosure function = - WTF::Bind(&Receiver::Increment, WrapWeakPersistent(receiver), - WTF::Unretained(&counter)); + WTF::BindRepeating(&Receiver::Increment, WrapWeakPersistent(receiver), + WTF::Unretained(&counter)); function.Run(); EXPECT_EQ(1, counter);
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceClient.h b/third_party/WebKit/Source/platform/loader/fetch/ResourceClient.h index c34a8781..b588e08 100644 --- a/third_party/WebKit/Source/platform/loader/fetch/ResourceClient.h +++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceClient.h
@@ -39,7 +39,6 @@ enum ResourceClientType { kBaseResourceType, kFontType, - kStyleSheetType, kRawResourceType };
diff --git a/third_party/WebKit/Source/platform/network/NetworkUtils.cpp b/third_party/WebKit/Source/platform/network/NetworkUtils.cpp index 84c7076..8de98d1 100644 --- a/third_party/WebKit/Source/platform/network/NetworkUtils.cpp +++ b/third_party/WebKit/Source/platform/network/NetworkUtils.cpp
@@ -119,6 +119,10 @@ return net::HttpResponseHeaders::IsRedirectResponseCode(response_code); } +bool IsCertificateTransparencyRequiredError(int error_code) { + return error_code == net::ERR_CERTIFICATE_TRANSPARENCY_REQUIRED; +} + } // NetworkUtils } // namespace blink
diff --git a/third_party/WebKit/Source/platform/network/NetworkUtils.h b/third_party/WebKit/Source/platform/network/NetworkUtils.h index e12876d..5f0f1ede 100644 --- a/third_party/WebKit/Source/platform/network/NetworkUtils.h +++ b/third_party/WebKit/Source/platform/network/NetworkUtils.h
@@ -40,6 +40,8 @@ PLATFORM_EXPORT bool IsRedirectResponseCode(int); +PLATFORM_EXPORT bool IsCertificateTransparencyRequiredError(int); + } // NetworkUtils } // namespace blink
diff --git a/third_party/WebKit/Source/platform/wtf/Functional.h b/third_party/WebKit/Source/platform/wtf/Functional.h index 83deef9..2a04456 100644 --- a/third_party/WebKit/Source/platform/wtf/Functional.h +++ b/third_party/WebKit/Source/platform/wtf/Functional.h
@@ -49,6 +49,51 @@ // arguments together into a function object that can be stored, copied and // invoked, similar to boost::bind and std::bind in C++11. +// *************************************************************************** +// ** NOTICE: same-thread WTF::Function is being migrated to base::Callback ** +// *************************************************************************** +// +// We are in the process of replace same-thread WTF::Function with +// base::{Once,Repeating}Callback (crbug.com/771087). +// +// One of the most important implications of this is that we'll need to +// distinguish a callback function that's only used once from one that may be +// called multiple times. +// +// Use the following guide to determine the correct usage for your use case +// (note this guideline may change as the migration effort progresses): +// +// 1. To create a callback that may be used or destructed in another thread +// +// Use CrossThreadBind() (defined in platform/CrossThreadFunctional.h), and +// receive the returned callback as WTF::CrossThreadFunction. There is no +// distinction of Once and Repeating for cross-thread usage for now. +// +// 2. To create a same-thread callback that's called only once +// +// Use WTF::Bind(), and receive the returned callback as WTF::Function or +// WTF::Closure. To convert it to base::OnceCallback, use +// ConvertToBaseCallback(). +// +// You should not copy WTF::Function so we can ensure it's called only once. +// It should be always passed by move. +// +// To invoke the callback function, do: +// +// std::move(function).Run(<arguments...>); +// +// 3. To create a same-thread callback that may be called multiple times +// +// Use WTF::BindRepeating(), and receive the returned callback as +// WTF::RepeatingFunction or WTF::RepeatingClosure. Those types are now an +// alias of base::RepeatingCallback, so you can just use it interchangably. +// +// You can copy WTF::RepeatingFunction. +// +// To invoke the callback function, simply do: +// +// function.Run(<arguments...>); + // Thread Safety: // // WTF::Bind() and WTF::Closure should be used for same-thread closures @@ -57,8 +102,8 @@ // Use crossThreadBind() and CrossThreadClosure if the function/task is called // or destructed on a (potentially) different thread from the current thread. -// WTF::bind() and move semantics -// ============================== +// WTF::Bind() / WTF::BindRepeating() and move semantics +// ===================================================== // // For unbound parameters, there are two ways to pass movable arguments: // @@ -70,7 +115,7 @@ // 2) Pass by value. // // void YourFunction(Argument argument) { ... } -// Function<void(Argument)> functor = Bind(YourFunction); +// Function<void(Argument)> functor = Bind(&YourFunction); // // Note that with the latter there will be *two* move constructions happening, // because there needs to be at least one intermediary function call taking an @@ -95,7 +140,7 @@ // ... // Function<void()> functor = Bind(&YourFunction, WTF::Passed(Argument())); // ... -// functor(); +// std::move(functor).Run(); // // The underlying function must receive the argument wrapped by WTF::Passed() by // rvalue reference or by value. @@ -290,7 +335,7 @@ public: Function() {} - explicit Function(base::Callback<R(Args...)> callback) + Function(base::Callback<R(Args...)> callback) : callback_(std::move(callback)) {} ~Function() {} @@ -316,7 +361,8 @@ void Reset() { callback_.Reset(); } explicit operator bool() const { return static_cast<bool>(callback_); } - friend base::Callback<R(Args...)> ConvertToBaseCallback(Function function) { + friend base::OnceCallback<R(Args...)> ConvertToBaseCallback( + Function function) { return std::move(function.callback_); } @@ -364,6 +410,8 @@ base::Callback<R(Args...)> callback_; }; +// Note: now there is WTF::Bind()and WTF::BindRepeating(). See the comment block +// above for the correct usage of those. template <typename FunctionType, typename... BoundParameters> Function<base::MakeUnboundRunType<FunctionType, BoundParameters...>> Bind( FunctionType function, @@ -385,11 +433,31 @@ return Function<UnboundRunType>(std::move(cb)); } -// TODO(tzik): Replace WTF::Function with base::OnceCallback, and -// WTF::RepeatingFunction with base::RepeatingCallback. +template <typename FunctionType, typename... BoundParameters> +base::RepeatingCallback< + base::MakeUnboundRunType<FunctionType, BoundParameters...>> +BindRepeating(FunctionType function, BoundParameters&&... bound_parameters) { + static_assert(internal::CheckGCedTypeRestrictions< + std::index_sequence_for<BoundParameters...>, + std::decay_t<BoundParameters>...>::ok, + "A bound argument uses a bad pattern."); + auto cb = base::BindRepeating( + function, std::forward<BoundParameters>(bound_parameters)...); +#if DCHECK_IS_ON() + using UnboundRunType = + base::MakeUnboundRunType<FunctionType, BoundParameters...>; + using WrapperType = + ThreadCheckingCallbackWrapper<base::RepeatingCallback<UnboundRunType>>; + cb = base::BindRepeating(&WrapperType::Run, + std::make_unique<WrapperType>(std::move(cb))); +#endif + return cb; +} + +// TODO(yutak): Replace WTF::Function with base::OnceCallback. template <typename T> -using RepeatingFunction = Function<T>; -using RepeatingClosure = Function<void()>; +using RepeatingFunction = base::RepeatingCallback<T>; +using RepeatingClosure = base::RepeatingCallback<void()>; using Closure = Function<void()>; template <typename T>
diff --git a/third_party/WebKit/Source/platform/wtf/FunctionalTest.cpp b/third_party/WebKit/Source/platform/wtf/FunctionalTest.cpp index 3d2ca8e..7a7b417d 100644 --- a/third_party/WebKit/Source/platform/wtf/FunctionalTest.cpp +++ b/third_party/WebKit/Source/platform/wtf/FunctionalTest.cpp
@@ -138,8 +138,8 @@ HasWeakPtrSupport obj; int counter = 0; WTF::RepeatingClosure bound = - WTF::Bind(&HasWeakPtrSupport::Increment, obj.CreateWeakPtr(), - WTF::Unretained(&counter)); + WTF::BindRepeating(&HasWeakPtrSupport::Increment, obj.CreateWeakPtr(), + WTF::Unretained(&counter)); bound.Run(); EXPECT_FALSE(bound.IsCancelled());
diff --git a/third_party/WebKit/public/platform/InterfaceRegistry.h b/third_party/WebKit/public/platform/InterfaceRegistry.h index dc77227..5725979 100644 --- a/third_party/WebKit/public/platform/InterfaceRegistry.h +++ b/third_party/WebKit/public/platform/InterfaceRegistry.h
@@ -46,9 +46,9 @@ void AddInterface( WTF::RepeatingFunction<void(mojo::InterfaceRequest<Interface>)> factory) { AddInterface(Interface::Name_, - ConvertToBaseCallback(WTF::Bind( + WTF::BindRepeating( &InterfaceRegistry::ForwardToInterfaceFactory<Interface>, - std::move(factory)))); + std::move(factory))); } template <typename Interface>
diff --git a/third_party/WebKit/public/platform/WebGraphicsContext3DProvider.h b/third_party/WebKit/public/platform/WebGraphicsContext3DProvider.h index e2f4c86..a2d237d 100644 --- a/third_party/WebKit/public/platform/WebGraphicsContext3DProvider.h +++ b/third_party/WebKit/public/platform/WebGraphicsContext3DProvider.h
@@ -70,7 +70,7 @@ // CompositingModeWatcher. virtual bool IsSoftwareRendering() const = 0; - virtual void SetLostContextCallback(const base::Closure&) = 0; + virtual void SetLostContextCallback(base::RepeatingClosure) = 0; virtual void SetErrorMessageCallback( base::RepeatingCallback<void(const char* msg, int32_t id)>) = 0; virtual void SignalQuery(uint32_t, base::OnceClosure) = 0;
diff --git a/third_party/WebKit/public/platform/web_feature.mojom b/third_party/WebKit/public/platform/web_feature.mojom index 4aa6a05f..6c8a082 100644 --- a/third_party/WebKit/public/platform/web_feature.mojom +++ b/third_party/WebKit/public/platform/web_feature.mojom
@@ -1777,6 +1777,7 @@ kLocalCSSFile = 2256, kLocalCSSFileExtensionRejected = 2257, kUserMediaDisableHardwareNoiseSuppression = 2258, + kCertificateTransparencyRequiredErrorOnResourceLoad = 2259, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots.
diff --git a/third_party/openvr/README.chromium b/third_party/openvr/README.chromium index 7c3af2d..c8f4078 100644 --- a/third_party/openvr/README.chromium +++ b/third_party/openvr/README.chromium
@@ -12,9 +12,9 @@ The OpenVR API supports HTC Vive and other headsets for VR. Local Modifications: -Only contains a subset of the git repo necessary to build Chromium. jsoncpp.cpp -has been modified to remove exceptions. -json.h has been modified to remove exceptions (delete "throw()"). +Only contains a subset of the git repo necessary to build Chromium. +jsoncpp.cpp has been modified to replace two "throw" statements with invocations +of JSON_FAIL_MESSAGE because "cannot use 'throw' with exceptions disabled". openvr.h has been modified to remove dllimport/dllexport when building a non-component build so this can be built as a static library.
diff --git a/third_party/openvr/src/src/json/json.h b/third_party/openvr/src/src/json/json.h index 2c4949b3..d27f65d 100644 --- a/third_party/openvr/src/src/json/json.h +++ b/third_party/openvr/src/src/json/json.h
@@ -425,8 +425,8 @@ class JSON_API Exception : public std::exception { public: Exception(std::string const& msg); - ~Exception(); - char const* what() const; + ~Exception() throw(); + char const* what() const throw(); protected: std::string msg_; };
diff --git a/third_party/openvr/src/src/jsoncpp.cpp b/third_party/openvr/src/src/jsoncpp.cpp index 26409c5..799a21e3 100644 --- a/third_party/openvr/src/src/jsoncpp.cpp +++ b/third_party/openvr/src/src/jsoncpp.cpp
@@ -2593,9 +2593,9 @@ Exception::Exception(std::string const& msg) : msg_(msg) {} -Exception::~Exception() +Exception::~Exception() throw() {} -char const* Exception::what() const +char const* Exception::what() const throw() { return msg_.c_str(); }
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 1c58782..fc0e576 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -17109,6 +17109,7 @@ <int value="2256" label="LocalCSSFile"/> <int value="2257" label="LocalCSSFileExtensionRejected"/> <int value="2258" label="UserMediaDisableHardwareNoiseSuppression"/> + <int value="2259" label="CertificateTransparencyRequiredErrorOnResourceLoad"/> </enum> <enum name="FeedbackSource">