diff --git a/DEPS b/DEPS index bd6e9de..274c99d9 100644 --- a/DEPS +++ b/DEPS
@@ -105,11 +105,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '0bf5408286ea3dacb197c220e1033dea3eeef2a8', + 'skia_revision': '74c6ed3d1f179209ec90025532310d9c8151999f', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': 'eb15bd6c048b992781fc52187316b9d31ac3cf4c', + 'v8_revision': 'e8e10fdf6577dbb360e4b5d404fc719ac3978571', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other. @@ -117,7 +117,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': '67c388e6c04ec35da3c72dd5fb3275a189c99fd1', + 'angle_revision': '2eb65034db7115f7cce46e119a6ac0c99f8d1584', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling build tools # and whatever else without interference from each other. @@ -165,7 +165,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': '65f883bb77390e3208346e653f3a518c3a63ded7', + 'catapult_revision': '100f0ee2ceb7b787e4743d9ec8154210bc047bc4', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -912,7 +912,7 @@ }, 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + '296b43d7e177bac4bdb53e8807ef2c0898b53d88', + Var('android_git') + '/platform/external/perfetto.git' + '@' + 'c2ace4e71f593d8b34b03d02c439d663dd20f50a', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + 'ac0d98b5cee6c024b0cffeb4f8f45b6fc5ccdb78', @@ -1034,7 +1034,7 @@ Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + '21dbf06b5aa6c7dc8cf56314d4a3f96f57956c53', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + 'df9e9ae9ee66a97a331ab9bd1dcc36cd2b2c110c', + Var('webrtc_git') + '/src.git' + '@' + '2a99c0bf6765d9c4615236ba4e00886678b2ef76', 'src/third_party/xdg-utils': { 'url': Var('chromium_git') + '/chromium/deps/xdg-utils.git' + '@' + 'd80274d5869b17b8c9067a1022e4416ee7ed5e0d', @@ -1068,7 +1068,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@131b85f314dbdf7928ec8bd855313748f93ade10', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@aa1425d9d8770b69e710bc700c9709a05b230165', 'condition': 'checkout_src_internal', },
diff --git a/WATCHLISTS b/WATCHLISTS index 2963302c5..d0a9078 100644 --- a/WATCHLISTS +++ b/WATCHLISTS
@@ -576,12 +576,17 @@ 'breve': { 'filepath': 'chrome/browser/net/spdyproxy|'\ 'chrome_proxy|'\ + 'client_hints|' 'components/blacklist|'\ 'components/data_use|'\ 'data_reduction_proxy|'\ - 'previews|'\ + 'data_use_measurement|'\ + 'lazy_load|' + 'navigation_predictor|'\ + 'net/nqe|'\ 'optimization_guide|'\ - 'optimization_hints' + 'optimization_hints|'\ + 'previews' }, 'browser_components': { 'filepath': 'chrome/browser/autofill/' \
diff --git a/android_webview/browser/aw_content_browser_client.cc b/android_webview/browser/aw_content_browser_client.cc index 2cf10c04..ce2403f6 100644 --- a/android_webview/browser/aw_content_browser_client.cc +++ b/android_webview/browser/aw_content_browser_client.cc
@@ -202,8 +202,6 @@ } AwContentBrowserClient::AwContentBrowserClient() : net_log_(new net::NetLog()) { - frame_interfaces_.AddInterface(base::BindRepeating( - &autofill::ContentAutofillDriverFactory::BindAutofillDriver)); // Although WebView does not support password manager feature, renderer code // could still request this interface, so we register a dummy binder which // just drops the incoming request, to avoid the 'Failed to locate a binder @@ -572,6 +570,20 @@ render_frame_host); } +bool AwContentBrowserClient::BindAssociatedInterfaceRequestFromFrame( + content::RenderFrameHost* render_frame_host, + const std::string& interface_name, + mojo::ScopedInterfaceEndpointHandle* handle) { + if (interface_name == autofill::mojom::AutofillDriver::Name_) { + autofill::ContentAutofillDriverFactory::BindAutofillDriver( + autofill::mojom::AutofillDriverAssociatedRequest(std::move(*handle)), + render_frame_host); + return true; + } + + return false; +} + void AwContentBrowserClient::ExposeInterfacesToRenderer( service_manager::BinderRegistry* registry, blink::AssociatedInterfaceRegistry* associated_registry,
diff --git a/android_webview/browser/aw_content_browser_client.h b/android_webview/browser/aw_content_browser_client.h index 54446a7..cca2d26 100644 --- a/android_webview/browser/aw_content_browser_client.h +++ b/android_webview/browser/aw_content_browser_client.h
@@ -148,6 +148,10 @@ content::RenderFrameHost* render_frame_host, const std::string& interface_name, mojo::ScopedMessagePipeHandle interface_pipe) override; + bool BindAssociatedInterfaceRequestFromFrame( + content::RenderFrameHost* render_frame_host, + const std::string& interface_name, + mojo::ScopedInterfaceEndpointHandle* handle) override; void ExposeInterfacesToRenderer( service_manager::BinderRegistry* registry, blink::AssociatedInterfaceRegistry* associated_registry,
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwAutofillTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwAutofillTest.java index 6f3502d..f770888 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/AwAutofillTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwAutofillTest.java
@@ -606,7 +606,7 @@ mTest.dispatchDownAndUpKeyEvents(KeyEvent.KEYCODE_A); // Note that we currently call ENTER/EXIT one more time. mCnt += mTest.waitForCallbackAndVerifyTypes(mCnt, - new Integer[] {AUTOFILL_VIEW_EXITED, AUTOFILL_VIEW_ENTERED, + new Integer[] {AUTOFILL_VIEW_EXITED, AUTOFILL_CANCEL, AUTOFILL_VIEW_ENTERED, AUTOFILL_VIEW_EXITED, AUTOFILL_VIEW_ENTERED, AUTOFILL_VALUE_CHANGED}); }
diff --git a/android_webview/renderer/DEPS b/android_webview/renderer/DEPS index 0566009..d626ee80 100644 --- a/android_webview/renderer/DEPS +++ b/android_webview/renderer/DEPS
@@ -25,6 +25,7 @@ "+services/network/public/cpp", "+services/service_manager/public/cpp", + "+third_party/blink/public/common", "+third_party/blink/public/platform", "+third_party/blink/public/web",
diff --git a/android_webview/renderer/aw_render_frame_ext.cc b/android_webview/renderer/aw_render_frame_ext.cc index 298aed63..8f23bb6 100644 --- a/android_webview/renderer/aw_render_frame_ext.cc +++ b/android_webview/renderer/aw_render_frame_ext.cc
@@ -142,23 +142,21 @@ AwRenderFrameExt::AwRenderFrameExt(content::RenderFrame* render_frame) : content::RenderFrameObserver(render_frame) { - registry_ = std::make_unique<service_manager::BinderRegistry>(); - // TODO(sgurun) do not create a password autofill agent (change // autofill agent to store a weakptr). autofill::PasswordAutofillAgent* password_autofill_agent = - new autofill::PasswordAutofillAgent(render_frame, registry_.get()); + new autofill::PasswordAutofillAgent(render_frame, ®istry_); new autofill::AutofillAgent(render_frame, password_autofill_agent, nullptr, - registry_.get()); + ®istry_); } AwRenderFrameExt::~AwRenderFrameExt() { } -void AwRenderFrameExt::OnInterfaceRequestForFrame( +bool AwRenderFrameExt::OnAssociatedInterfaceRequestForFrame( const std::string& interface_name, - mojo::ScopedMessagePipeHandle* interface_pipe) { - registry_->TryBindInterface(interface_name, interface_pipe); + mojo::ScopedInterfaceEndpointHandle* handle) { + return registry_.TryBindInterface(interface_name, handle); } void AwRenderFrameExt::DidCommitProvisionalLoad(
diff --git a/android_webview/renderer/aw_render_frame_ext.h b/android_webview/renderer/aw_render_frame_ext.h index 55d4b38..dfa6ec9 100644 --- a/android_webview/renderer/aw_render_frame_ext.h +++ b/android_webview/renderer/aw_render_frame_ext.h
@@ -7,7 +7,7 @@ #include "base/macros.h" #include "content/public/renderer/render_frame_observer.h" -#include "services/service_manager/public/cpp/binder_registry.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/gfx/geometry/point_f.h" #include "ui/gfx/geometry/size.h" @@ -33,9 +33,9 @@ ~AwRenderFrameExt() override; // RenderFrameObserver: - void OnInterfaceRequestForFrame( + bool OnAssociatedInterfaceRequestForFrame( const std::string& interface_name, - mojo::ScopedMessagePipeHandle* interface_pipe) override; + mojo::ScopedInterfaceEndpointHandle* handle) override; void DidCommitProvisionalLoad(bool is_new_navigation, bool is_same_document_navigation) override; @@ -62,7 +62,7 @@ url::Origin last_origin_; - std::unique_ptr<service_manager::BinderRegistry> registry_; + blink::AssociatedInterfaceRegistry registry_; DISALLOW_COPY_AND_ASSIGN(AwRenderFrameExt); };
diff --git a/android_webview/tools/apk_merger.py b/android_webview/tools/apk_merger.py index f27f037..6136835 100755 --- a/android_webview/tools/apk_merger.py +++ b/android_webview/tools/apk_merger.py
@@ -37,12 +37,12 @@ BUILD_ANDROID_GYP_DIR = os.path.join(BUILD_ANDROID_DIR, 'gyp') sys.path.append(BUILD_ANDROID_GYP_DIR) -import finalize_apk # pylint: disable=import-error -from util import build_utils # pylint: disable=import-error +import finalize_apk # pylint: disable=import-error,wrong-import-position +from util import build_utils # pylint: disable=import-error,wrong-import-position sys.path.append(BUILD_ANDROID_DIR) -from pylib import constants # pylint: disable=import-error +from pylib import constants # pylint: disable=import-error,wrong-import-position DEFAULT_ZIPALIGN_PATH = os.path.join( SRC_DIR, 'third_party', 'android_tools', 'sdk', 'build-tools', @@ -87,7 +87,7 @@ copy_files.extend( GetNonDirFiles(os.path.join(dcmp.right, file_name), base_dir)) -# we cannot merge APKs with files with similar names but different contents + # we cannot merge APKs with files with similar names but different contents if len(dcmp.diff_files) > 0: raise ApkMergeFailure('found differing files: %s in %s and %s' % (dcmp.diff_files, dcmp.left, dcmp.right)) @@ -117,11 +117,6 @@ duplicate_file_set = set( f for f, n in actual_file_names.iteritems() if n > 1) - # TODO(crbug.com/839191): Remove this once we're plumbing the lib correctly. - missing_file_set = set( - f for f in missing_file_set if not os.path.basename(f) == - 'libarcore_sdk_c_minimal.so') - errors = [] if unexpected_file_set: errors.append( @@ -177,10 +172,6 @@ if args.has_unwind_cfi: expected_files['unwind_cfi_32'] = False - # TODO(crbug.com/839191): we should pass this in via script arguments. - if not args.loadable_module_32: - args.loadable_module_32.append('libarcore_sdk_c_minimal.so') - for f in args.loadable_module_32: expected_files[f] = not args.uncompress_shared_libraries
diff --git a/android_webview/tools/run_cts.py b/android_webview/tools/run_cts.py index b02cb7eb..99d8c4cb 100755 --- a/android_webview/tools/run_cts.py +++ b/android_webview/tools/run_cts.py
@@ -104,12 +104,15 @@ if k not in existing_results_json: existing_results_json[k] = v else: - if type(v) != type(existing_results_json[k]): - raise NotImplementedError( - "Can't merge results field %s of different types" % v) - if type(v) is dict: + if isinstance(v, dict): + if not isinstance(existing_results_json[k], dict): + raise NotImplementedError( + "Can't merge results field %s of different types" % v) existing_results_json[k].update(v) - elif type(v) is list: + elif isinstance(v, list): + if not isinstance(existing_results_json[k], list): + raise NotImplementedError( + "Can't merge results field %s of different types" % v) existing_results_json[k].extend(v) else: raise NotImplementedError(
diff --git a/ash/display/resolution_notification_controller_unittest.cc b/ash/display/resolution_notification_controller_unittest.cc index 65afd158..5887b72 100644 --- a/ash/display/resolution_notification_controller_unittest.cc +++ b/ash/display/resolution_notification_controller_unittest.cc
@@ -319,7 +319,9 @@ EXPECT_EQ(59.0f, mode.refresh_rate()); } -TEST_F(ResolutionNotificationControllerTest, MultipleResolutionChange) { +// See http://crbug.com/869401 for details. +TEST_F(ResolutionNotificationControllerTest, + DISABLED_MultipleResolutionChange) { UpdateDisplay( "300x300#300x300%56|200x200%57," "250x250#250x250%58|200x200%59");
diff --git a/base/threading/thread_local_storage.h b/base/threading/thread_local_storage.h index 9cb5aeb..71702de 100644 --- a/base/threading/thread_local_storage.h +++ b/base/threading/thread_local_storage.h
@@ -20,6 +20,7 @@ namespace heap_profiling { class ScopedAllowAlloc; +class ScopedAllowRealloc; } // namespace heap_profiling namespace ui { @@ -166,6 +167,7 @@ friend class base::trace_event::MallocDumpProvider; friend class debug::GlobalActivityTracker; friend class heap_profiling::ScopedAllowAlloc; + friend class heap_profiling::ScopedAllowRealloc; friend class ui::TLSDestructionCheckerForX11; static bool HasBeenDestroyed();
diff --git a/build/fuchsia/sdk.sha1 b/build/fuchsia/sdk.sha1 index b1cade3..e8b9ca0 100644 --- a/build/fuchsia/sdk.sha1 +++ b/build/fuchsia/sdk.sha1
@@ -1 +1 @@ -0e8488b5f1c0c1cdb03f50b262f3d61cbbe9c96a \ No newline at end of file +be1455d02b09799d1150be98feab598f91f00200 \ No newline at end of file
diff --git a/cc/paint/paint_op_writer.cc b/cc/paint/paint_op_writer.cc index afba0a6..bfc85aa8 100644 --- a/cc/paint/paint_op_writer.cc +++ b/cc/paint/paint_op_writer.cc
@@ -350,6 +350,12 @@ return sk_ref_sp<PaintShader>(original); } +void PaintOpWriter::Write(SkMatrix matrix) { + if (!matrix.isIdentity()) + matrix.dirtyMatrixTypeCache(); + WriteSimple(matrix); +} + void PaintOpWriter::Write(const PaintShader* shader, SkFilterQuality quality) { sk_sp<PaintShader> transformed_shader; uint32_t paint_image_transfer_cache_id = kInvalidImageTransferCacheEntryId; @@ -382,7 +388,7 @@ WriteSimple(shader->scaling_behavior_); if (shader->local_matrix_) { Write(true); - WriteSimple(*shader->local_matrix_); + Write(*shader->local_matrix_); } else { Write(false); } @@ -690,7 +696,7 @@ } void PaintOpWriter::Write(const MatrixPaintFilter& filter) { - WriteSimple(filter.matrix()); + Write(filter.matrix()); WriteSimple(filter.filter_quality()); Write(filter.input().get()); }
diff --git a/cc/paint/paint_op_writer.h b/cc/paint/paint_op_writer.h index 25b38e9..87071bb 100644 --- a/cc/paint/paint_op_writer.h +++ b/cc/paint/paint_op_writer.h
@@ -45,6 +45,7 @@ void WriteSize(size_t size); void Write(SkScalar data); + void Write(SkMatrix data); void Write(uint8_t data); void Write(uint32_t data); void Write(uint64_t data);
diff --git a/cc/test/fake_layer_tree_host_impl_client.h b/cc/test/fake_layer_tree_host_impl_client.h index cc33e48e..ef9b186 100644 --- a/cc/test/fake_layer_tree_host_impl_client.h +++ b/cc/test/fake_layer_tree_host_impl_client.h
@@ -30,9 +30,6 @@ void RenewTreePriority() override {} void PostDelayedAnimationTaskOnImplThread(const base::Closure& task, base::TimeDelta delay) override {} - void OnMemoryPressureOnImplThread( - base::MemoryPressureListener::MemoryPressureLevel level) override {} - void DidActivateSyncTree() override {} void WillPrepareTiles() override {} void DidPrepareTiles() override {}
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index fab8210..3da956f 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc
@@ -354,8 +354,7 @@ base::MemoryCoordinatorClientRegistry::GetInstance()->Register(this); memory_pressure_listener_.reset( new base::MemoryPressureListener(base::BindRepeating( - &LayerTreeHostImplClient::OnMemoryPressureOnImplThread, - base::Unretained(client_)))); + &LayerTreeHostImpl::OnMemoryPressure, base::Unretained(this)))); SetDebugState(settings.initial_debug_state); } @@ -2819,6 +2818,22 @@ resource_pool_->OnPurgeMemory(); } +void LayerTreeHostImpl::OnMemoryPressure( + base::MemoryPressureListener::MemoryPressureLevel level) { + // Only work for low-end devices for now. + if (!base::SysInfo::IsLowEndDevice()) + return; + + switch (level) { + case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE: + case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE: + break; + case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL: + OnPurgeMemory(); + break; + } +} + void LayerTreeHostImpl::SetVisible(bool visible) { DCHECK(task_runner_provider_->IsImplThread());
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h index b52b6a6..a910202 100644 --- a/cc/trees/layer_tree_host_impl.h +++ b/cc/trees/layer_tree_host_impl.h
@@ -136,11 +136,6 @@ virtual void WillPrepareTiles() = 0; virtual void DidPrepareTiles() = 0; - // TODO(gyuyoung): OnMemoryPressure is deprecated. So this should be removed - // when the memory coordinator is enabled by default. - virtual void OnMemoryPressureOnImplThread( - base::MemoryPressureListener::MemoryPressureLevel level) = 0; - // Called when page scale animation has completed on the impl thread. virtual void DidCompletePageScaleAnimationOnImplThread() = 0; @@ -716,9 +711,6 @@ void SetActiveURL(const GURL& url); - // Overriden from base::MemoryCoordinatorClient. - void OnPurgeMemory() override; - protected: LayerTreeHostImpl( const LayerTreeSettings& settings, @@ -878,6 +870,14 @@ // active tree. void ActivateStateForImages(); + // Overriden from base::MemoryCoordinatorClient. + void OnPurgeMemory() override; + + // TODO(gyuyoung): OnMemoryPressure is deprecated. So this should be removed + // when the memory coordinator is enabled by default. + void OnMemoryPressure( + base::MemoryPressureListener::MemoryPressureLevel level); + const LayerTreeSettings settings_; const bool is_synchronous_single_threaded_;
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index 2bdc696..fd3cd058 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -197,8 +197,6 @@ } void WillPrepareTiles() override {} void DidPrepareTiles() override {} - void OnMemoryPressureOnImplThread( - base::MemoryPressureListener::MemoryPressureLevel level) override {} void DidCompletePageScaleAnimationOnImplThread() override { did_complete_page_scale_animation_ = true; }
diff --git a/cc/trees/proxy_impl.cc b/cc/trees/proxy_impl.cc index 915d5e20..966124c 100644 --- a/cc/trees/proxy_impl.cc +++ b/cc/trees/proxy_impl.cc
@@ -355,20 +355,6 @@ proxy_main_weak_ptr_, base::Passed(&events))); } -void ProxyImpl::OnMemoryPressureOnImplThread( - base::MemoryPressureListener::MemoryPressureLevel level) { - TRACE_EVENT0("cc", "ProxyImpl::OnMemoryPressureOnImplThread"); - DCHECK(IsImplThread()); - switch (level) { - case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE: - case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE: - break; - case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL: - host_impl_->OnPurgeMemory(); - break; - } -} - size_t ProxyImpl::CompositedAnimationsCount() const { return host_impl_->mutator_host()->CompositedAnimationsCount(); }
diff --git a/cc/trees/proxy_impl.h b/cc/trees/proxy_impl.h index a5545f4..a6b9fa2 100644 --- a/cc/trees/proxy_impl.h +++ b/cc/trees/proxy_impl.h
@@ -8,7 +8,6 @@ #include <memory> #include "base/macros.h" -#include "base/memory/memory_pressure_listener.h" #include "base/memory/weak_ptr.h" #include "cc/base/completion_event.h" #include "cc/base/delayed_unique_notifier.h" @@ -105,8 +104,6 @@ uint32_t frame_token, std::vector<LayerTreeHost::PresentationTimeCallback> callbacks, const gfx::PresentationFeedback& feedback) override; - void OnMemoryPressureOnImplThread( - base::MemoryPressureListener::MemoryPressureLevel level) override; // SchedulerClient implementation bool WillBeginImplFrame(const viz::BeginFrameArgs& args) override;
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc index d28f7e2..1d199d2f 100644 --- a/cc/trees/single_thread_proxy.cc +++ b/cc/trees/single_thread_proxy.cc
@@ -587,20 +587,6 @@ } } -void SingleThreadProxy::OnMemoryPressureOnImplThread( - base::MemoryPressureListener::MemoryPressureLevel level) { - TRACE_EVENT0("cc", "SingleThreadProxy::OnMemoryPressureOnImplThread"); - switch (level) { - case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE: - case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE: - break; - case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL: - DebugScopedSetImplThread impl(task_runner_provider_); - host_impl_->OnPurgeMemory(); - break; - } -} - DrawResult SingleThreadProxy::DoComposite(LayerTreeHostImpl::FrameData* frame) { TRACE_EVENT0("cc", "SingleThreadProxy::DoComposite");
diff --git a/cc/trees/single_thread_proxy.h b/cc/trees/single_thread_proxy.h index 17865966..0ff0f79 100644 --- a/cc/trees/single_thread_proxy.h +++ b/cc/trees/single_thread_proxy.h
@@ -127,9 +127,6 @@ std::vector<LayerTreeHost::PresentationTimeCallback> callbacks, const gfx::PresentationFeedback& feedback) override; - void OnMemoryPressureOnImplThread( - base::MemoryPressureListener::MemoryPressureLevel level) override; - void RequestNewLayerTreeFrameSink(); // Called by the legacy path where RenderWidget does the scheduling.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterChipsProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterChipsProvider.java index 3aabe1a..bb315bbe 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterChipsProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterChipsProvider.java
@@ -158,7 +158,12 @@ Set</* @FilterType */ Integer> filters = new HashSet<>(); filters.add(Filters.FilterType.NONE); for (OfflineItem item : mSource.getItems()) { - filters.add(Filters.fromOfflineItem(item.filter)); + if (item.isSuggested) { + // All suggested content is considered prefetched and is not included in the chips. + filters.add(FilterType.PREFETCHED); + } else { + filters.add(Filters.fromOfflineItem(item.filter)); + } } // Set the enabled states correctly for all chips.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterCoordinator.java index 6884e3d..af18f36 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterCoordinator.java
@@ -11,6 +11,8 @@ import org.chromium.base.ObserverList; import org.chromium.chrome.browser.download.home.filter.Filters.FilterType; import org.chromium.chrome.browser.download.home.filter.chips.ChipsCoordinator; +import org.chromium.chrome.browser.modelutil.PropertyKey; +import org.chromium.chrome.browser.modelutil.PropertyModel; import org.chromium.chrome.browser.modelutil.PropertyModelChangeProcessor; import java.lang.annotation.Retention; @@ -32,15 +34,12 @@ } private final ObserverList<Observer> mObserverList = new ObserverList<>(); - private FilterModel mModel; - private FilterViewBinder mViewBinder; - private FilterView mView; + private final PropertyModel mModel; + private final FilterViewBinder mViewBinder; + private final FilterView mView; - private ChipsCoordinator mChipsCoordinator; - private FilterChipsProvider mChipsProvider; - - /** No-args constructor to be used by subclasses. */ - protected FilterCoordinator() {} + private final ChipsCoordinator mChipsCoordinator; + private final FilterChipsProvider mChipsProvider; /** * Builds a new FilterCoordinator. @@ -50,13 +49,18 @@ mChipsProvider = new FilterChipsProvider(type -> handleChipSelected(), chipFilterSource); mChipsCoordinator = new ChipsCoordinator(context, mChipsProvider); - mModel = new FilterModel(); + mModel = new PropertyModel(FilterProperties.ALL_KEYS); mViewBinder = new FilterViewBinder(); mView = new FilterView(context); - mModel.addObserver(new PropertyModelChangeProcessor<>(mModel, mView, mViewBinder)); + mModel.addObserver(new PropertyModelChangeProcessor<PropertyModel, FilterView, PropertyKey>( + mModel, mView, mViewBinder)); - mModel.setChangeListener(selectedTab -> handleTabSelected(selectedTab)); + mModel.setValue( + FilterProperties.CHANGE_LISTENER, selectedTab -> handleTabSelected(selectedTab)); selectTab(TabType.FILES); + + // TODO(shaktisahu): Check if prefetch UI is enabled. + mModel.setValue(FilterProperties.SHOW_TABS, true); } /** @return The {@link View} representing this widget. */ @@ -88,12 +92,12 @@ } private void selectTab(@TabType int selectedTab) { - mModel.setSelectedTab(selectedTab); + mModel.setValue(FilterProperties.SELECTED_TAB, selectedTab); if (selectedTab == TabType.FILES) { - mModel.setContentView(mChipsCoordinator.getView()); + mModel.setValue(FilterProperties.CONTENT_VIEW, mChipsCoordinator.getView()); } else if (selectedTab == TabType.PREFETCH) { - mModel.setContentView(null); + mModel.setValue(FilterProperties.CONTENT_VIEW, null); } } @@ -111,11 +115,11 @@ notifyFilterChanged(filterType); } - protected void notifyFilterChanged(@FilterType int filter) { + private void notifyFilterChanged(@FilterType int filter) { for (Observer observer : mObserverList) observer.onFilterChanged(filter); } private void handleChipSelected() { - handleTabSelected(mModel.getSelectedTab()); + handleTabSelected(mModel.getValue(FilterProperties.SELECTED_TAB)); } } \ No newline at end of file
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterCoordinatorWithNoTabs.java b/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterCoordinatorWithNoTabs.java deleted file mode 100644 index f8e4547..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterCoordinatorWithNoTabs.java +++ /dev/null
@@ -1,38 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.browser.download.home.filter; - -import android.content.Context; -import android.view.View; - -import org.chromium.chrome.browser.download.home.filter.chips.ChipsCoordinator; - -/** - * An empty version of {@code FilterCoordinator} that doesn't contain any tabs. - */ - -public class FilterCoordinatorWithNoTabs extends FilterCoordinator { - private final ChipsCoordinator mChipsCoordinator; - private final FilterChipsProvider mChipsProvider; - - public FilterCoordinatorWithNoTabs(Context context, OfflineItemFilterSource chipFilterSource) { - mChipsProvider = new FilterChipsProvider(type -> handleChipSelected(), chipFilterSource); - mChipsCoordinator = new ChipsCoordinator(context, mChipsProvider); - } - - @Override - public View getView() { - return mChipsCoordinator.getView(); - } - - @Override - public void setSelectedFilter(int filter) { - mChipsProvider.setFilterSelected(filter); - } - - private void handleChipSelected() { - notifyFilterChanged(mChipsProvider.getSelectedFilter()); - } -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterModel.java b/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterModel.java deleted file mode 100644 index 26a0c73..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterModel.java +++ /dev/null
@@ -1,67 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.browser.download.home.filter; - -import android.view.View; - -import org.chromium.base.Callback; -import org.chromium.chrome.browser.download.home.filter.FilterCoordinator.TabType; -import org.chromium.chrome.browser.modelutil.PropertyObservable; - -/** - * The model responsible for maintaining the visual state of the tab content filter widget. It also - * holds callbacks meant to be notified when the tab selection changes. - */ -class FilterModel extends PropertyObservable<FilterModel.PropertyKey> { - static class PropertyKey { - static final PropertyKey CONTENT_VIEW = new PropertyKey(); - static final PropertyKey SELECTED_TAB = new PropertyKey(); - static final PropertyKey CHANGE_LISTENER = new PropertyKey(); - - private PropertyKey() {} - } - - private View mContentView; - private @TabType int mSelectedTab; - private Callback</* @TabType */ Integer> mChangeListener; - - /** Sets {@code contentView} as the {@link View} to be shown in the content area. */ - public void setContentView(View contentView) { - if (mContentView == contentView) return; - mContentView = contentView; - notifyPropertyChanged(PropertyKey.CONTENT_VIEW); - } - - /** Sets which tab should be selected. */ - public void setSelectedTab(@TabType int selectedTab) { - // Note: This does not early-out if selectedTab is the same as mSelectedTab. This is - // because default values might prevent us from pushing valid state and causing the UI to - // refresh. - mSelectedTab = selectedTab; - notifyPropertyChanged(PropertyKey.SELECTED_TAB); - } - - /** Sets the {@link Callback} to call when a tab is selected. */ - public void setChangeListener(Callback</* @TabType */ Integer> changeListener) { - if (mChangeListener == changeListener) return; - mChangeListener = changeListener; - notifyPropertyChanged(PropertyKey.CHANGE_LISTENER); - } - - /** @return The {@link View} to use in the content area of the tab selection. */ - public View getContentView() { - return mContentView; - } - - /** @return The selected tab type. */ - public @TabType int getSelectedTab() { - return mSelectedTab; - } - - /** @return The {@link Callback} to call when a tab is selected. */ - public Callback</* @TabType */ Integer> getChangeListener() { - return mChangeListener; - } -} \ No newline at end of file
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterProperties.java b/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterProperties.java new file mode 100644 index 0000000..19b1299 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterProperties.java
@@ -0,0 +1,32 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.download.home.filter; + +import android.view.View; + +import org.chromium.base.Callback; +import org.chromium.chrome.browser.modelutil.PropertyKey; +import org.chromium.chrome.browser.modelutil.PropertyModel.BooleanPropertyKey; +import org.chromium.chrome.browser.modelutil.PropertyModel.IntPropertyKey; +import org.chromium.chrome.browser.modelutil.PropertyModel.ObjectPropertyKey; + +/** The properties needed to render the download home filter view. */ +public interface FilterProperties { + /** The {@link View} to show in the content area. */ + public static final ObjectPropertyKey<View> CONTENT_VIEW = new ObjectPropertyKey<>(); + + /** Which {@code TabType} should be selected. */ + public static final IntPropertyKey SELECTED_TAB = new IntPropertyKey(); + + /** The callback listener for {@code TabType} selection changes. */ + public static final ObjectPropertyKey<Callback</* @TabType */ Integer>> CHANGE_LISTENER = + new ObjectPropertyKey<>(); + + /** Whether or not to show the tabs or just show the content. */ + public static final BooleanPropertyKey SHOW_TABS = new BooleanPropertyKey(); + + public static final PropertyKey[] ALL_KEYS = + new PropertyKey[] {CONTENT_VIEW, SELECTED_TAB, CHANGE_LISTENER, SHOW_TABS}; +} \ No newline at end of file
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterView.java b/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterView.java index 28f2673..df7092d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterView.java
@@ -79,4 +79,9 @@ public void setTabSelectedCallback(Callback</* @TabType */ Integer> callback) { mTabSelectedCallback = callback; } + + /** Sets whether or not we show the tabs. */ + public void setShowTabs(boolean show) { + mTabsView.setVisibility(show ? View.VISIBLE : View.GONE); + } } \ No newline at end of file
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterViewBinder.java b/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterViewBinder.java index acaa5c36..b8aebad7 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterViewBinder.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/home/filter/FilterViewBinder.java
@@ -4,22 +4,25 @@ package org.chromium.chrome.browser.download.home.filter; -import org.chromium.chrome.browser.download.home.filter.FilterModel.PropertyKey; +import org.chromium.chrome.browser.modelutil.PropertyKey; +import org.chromium.chrome.browser.modelutil.PropertyModel; import org.chromium.chrome.browser.modelutil.PropertyModelChangeProcessor.ViewBinder; /** - * A helper {@link ViewBinder} responsible for gluing {@link FilterModel} to + * A helper {@link ViewBinder} responsible for gluing {@link FilterProperties} to * {@link FilterView}. */ -class FilterViewBinder implements ViewBinder<FilterModel, FilterView, FilterModel.PropertyKey> { +class FilterViewBinder implements ViewBinder<PropertyModel, FilterView, PropertyKey> { @Override - public void bind(FilterModel model, FilterView view, PropertyKey propertyKey) { - if (propertyKey == FilterModel.PropertyKey.CONTENT_VIEW) { - view.setContentView(model.getContentView()); - } else if (propertyKey == FilterModel.PropertyKey.SELECTED_TAB) { - view.setTabSelected(model.getSelectedTab()); - } else if (propertyKey == FilterModel.PropertyKey.CHANGE_LISTENER) { - view.setTabSelectedCallback(model.getChangeListener()); + public void bind(PropertyModel model, FilterView view, PropertyKey propertyKey) { + if (propertyKey == FilterProperties.CONTENT_VIEW) { + view.setContentView(model.getValue(FilterProperties.CONTENT_VIEW)); + } else if (propertyKey == FilterProperties.SELECTED_TAB) { + view.setTabSelected(model.getValue(FilterProperties.SELECTED_TAB)); + } else if (propertyKey == FilterProperties.CHANGE_LISTENER) { + view.setTabSelectedCallback(model.getValue(FilterProperties.CHANGE_LISTENER)); + } else if (propertyKey == FilterProperties.SHOW_TABS) { + view.setShowTabs(model.getValue(FilterProperties.SHOW_TABS)); } } } \ No newline at end of file
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/home/list/DateOrderedListCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/download/home/list/DateOrderedListCoordinator.java index 6fc68d6..cbce6f2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/home/list/DateOrderedListCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/home/list/DateOrderedListCoordinator.java
@@ -9,7 +9,6 @@ import org.chromium.base.Callback; import org.chromium.chrome.browser.download.home.filter.FilterCoordinator; -import org.chromium.chrome.browser.download.home.filter.FilterCoordinatorWithNoTabs; import org.chromium.chrome.browser.download.home.filter.Filters.FilterType; import org.chromium.chrome.browser.download.home.list.ListItem.ViewListItem; import org.chromium.chrome.browser.widget.selection.SelectionDelegate; @@ -69,9 +68,7 @@ offTheRecord, provider, deleteController, selectionDelegate, model); // Hook up the FilterCoordinator with our mediator. - mFilterCoordinator = shouldShowPrefetchTab() - ? new FilterCoordinator(context, mMediator.getFilterSource()) - : new FilterCoordinatorWithNoTabs(context, mMediator.getFilterSource()); + mFilterCoordinator = new FilterCoordinator(context, mMediator.getFilterSource()); mFilterCoordinator.addObserver(mMediator::onFilterTypeSelected); mFilterCoordinator.addObserver(filterObserver); @@ -105,9 +102,4 @@ public void onDeletionRequested(List<ListItem> items) { mMediator.onDeletionRequested(items); } - - private boolean shouldShowPrefetchTab() { - // TODO(shaktisahu): Check if prefetch UI is enabled. - return true; - } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java index e9904e7..7edbd83 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java
@@ -525,12 +525,12 @@ nativeStoreCachedWebApkPackageForNotificationId( mNativeNotificationPlatformBridge, notificationId, webApkPackage); + // Record whether it's known whether notifications can be shown to the user at all. + NotificationSystemStatusUtil.recordAppNotificationStatusHistogram(); + Context context = ContextUtils.getApplicationContext(); Resources res = context.getResources(); - // Record whether it's known whether notifications can be shown to the user at all. - NotificationSystemStatusUtil.recordAppNotificationStatusHistogram(context); - PendingIntent clickIntent = makePendingIntent(context, NotificationConstants.ACTION_CLICK_NOTIFICATION, notificationId, origin, scopeUrl, profileId, incognito, webApkPackage, -1 /* actionIndex */);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtil.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtil.java index 04670ae..bc868cd 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtil.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtil.java
@@ -5,10 +5,12 @@ package org.chromium.chrome.browser.notifications; import android.annotation.TargetApi; -import android.content.Context; import android.os.Build; import android.support.v4.app.NotificationManagerCompat; +import org.chromium.base.ContextUtils; +import org.chromium.base.VisibleForTesting; +import org.chromium.base.annotations.CalledByNative; import org.chromium.base.metrics.RecordHistogram; /** @@ -21,12 +23,17 @@ * and ways of revoking notifications for a particular website, measuring this is still important. */ public class NotificationSystemStatusUtil { - /** Status codes returned by {@link determineAppNotificationsEnabled}. **/ - private static final int APP_NOTIFICATIONS_STATUS_UNDETERMINABLE = 0; - private static final int APP_NOTIFICATIONS_STATUS_ENABLED = 2; - private static final int APP_NOTIFICATIONS_STATUS_DISABLED = 3; + /** Status codes returned by {@link #getAppNotificationStatus}. **/ + static final int APP_NOTIFICATIONS_STATUS_UNDETERMINABLE = 0; + static final int APP_NOTIFICATIONS_STATUS_ENABLED = 2; + static final int APP_NOTIFICATIONS_STATUS_DISABLED = 3; - /** Must be set to the maximum value of the above values, plus one. **/ + /** + * Must be set to the maximum value of the above values, plus one. + * + * If this value changes, kAppNotificationStatusBoundary in android_metrics_provider.cc must + * also be updated. + **/ private static final int APP_NOTIFICATIONS_STATUS_BOUNDARY = 4; /** @@ -37,22 +44,26 @@ * * This check requires Android KitKat or later. Earlier versions will log an INDETERMINABLE * status. - * - * @param context The context to check of whether it can show notifications. */ @TargetApi(Build.VERSION_CODES.KITKAT) - static void recordAppNotificationStatusHistogram(Context context) { - int histogramValue; + static void recordAppNotificationStatusHistogram() { + RecordHistogram.recordEnumeratedHistogram("Notifications.AppNotificationStatus", + getAppNotificationStatus(), APP_NOTIFICATIONS_STATUS_BOUNDARY); + } + + @CalledByNative + @VisibleForTesting + static int getAppNotificationStatus() { + int status; if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) { - histogramValue = APP_NOTIFICATIONS_STATUS_UNDETERMINABLE; + status = APP_NOTIFICATIONS_STATUS_UNDETERMINABLE; } else { - NotificationManagerCompat manager = NotificationManagerCompat.from(context); - histogramValue = manager.areNotificationsEnabled() ? APP_NOTIFICATIONS_STATUS_ENABLED - : APP_NOTIFICATIONS_STATUS_DISABLED; + NotificationManagerCompat manager = + NotificationManagerCompat.from(ContextUtils.getApplicationContext()); + status = manager.areNotificationsEnabled() ? APP_NOTIFICATIONS_STATUS_ENABLED + : APP_NOTIFICATIONS_STATUS_DISABLED; } - - RecordHistogram.recordEnumeratedHistogram("Notifications.AppNotificationStatus", - histogramValue, APP_NOTIFICATIONS_STATUS_BOUNDARY); + return status; } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/ScrimView.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/ScrimView.java index 356d045..c20a9be9 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/ScrimView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/ScrimView.java
@@ -5,7 +5,6 @@ package org.chromium.chrome.browser.widget; import android.animation.Animator; -import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; import android.content.Context; import android.support.annotation.NonNull; @@ -17,6 +16,7 @@ import org.chromium.base.ApiCompatibilityUtils; import org.chromium.chrome.R; import org.chromium.chrome.browser.util.MathUtils; +import org.chromium.chrome.browser.widget.animation.CancelAwareAnimatorListener; import org.chromium.ui.UiUtils; import org.chromium.ui.interpolators.BakedBezierInterpolator; @@ -260,9 +260,9 @@ mOverlayFadeOutAnimator = ObjectAnimator.ofFloat(this, ALPHA, 0f); mOverlayFadeOutAnimator.setDuration(FADE_DURATION_MS); mOverlayFadeOutAnimator.setInterpolator(BakedBezierInterpolator.FADE_OUT_CURVE); - mOverlayFadeOutAnimator.addListener(new AnimatorListenerAdapter() { + mOverlayFadeOutAnimator.addListener(new CancelAwareAnimatorListener() { @Override - public void onAnimationEnd(Animator animation) { + public void onEnd(Animator animation) { setVisibility(View.GONE); if (mActiveParams != null && mActiveParams.observer != null) { mActiveParams.observer.onScrimVisibilityChanged(false);
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni index 02653ed2..a2b76fc8 100644 --- a/chrome/android/java_sources.gni +++ b/chrome/android/java_sources.gni
@@ -448,8 +448,7 @@ "java/src/org/chromium/chrome/browser/download/home/filter/Filters.java", "java/src/org/chromium/chrome/browser/download/home/filter/FilterChipsProvider.java", "java/src/org/chromium/chrome/browser/download/home/filter/FilterCoordinator.java", - "java/src/org/chromium/chrome/browser/download/home/filter/FilterCoordinatorWithNoTabs.java", - "java/src/org/chromium/chrome/browser/download/home/filter/FilterModel.java", + "java/src/org/chromium/chrome/browser/download/home/filter/FilterProperties.java", "java/src/org/chromium/chrome/browser/download/home/filter/FilterView.java", "java/src/org/chromium/chrome/browser/download/home/filter/FilterViewBinder.java", "java/src/org/chromium/chrome/browser/download/home/filter/OfflineItemFilter.java", @@ -2190,6 +2189,7 @@ "junit/src/org/chromium/chrome/browser/metrics/VariationsSessionTest.java", "junit/src/org/chromium/chrome/browser/modelutil/PropertyModelTest.java", "junit/src/org/chromium/chrome/browser/modelutil/SimpleListObservableTest.java", + "junit/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtilUnitTest.java", "junit/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridgeUnitTest.java", "junit/src/org/chromium/chrome/browser/notifications/channels/ChannelDefinitionsTest.java", "junit/src/org/chromium/chrome/browser/ntp/NativePageFactoryTest.java",
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtilUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtilUnitTest.java new file mode 100644 index 0000000..d36dcfd --- /dev/null +++ b/chrome/android/junit/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtilUnitTest.java
@@ -0,0 +1,60 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.notifications; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.robolectric.Shadows.shadowOf; + +import android.app.NotificationManager; +import android.content.Context; +import android.os.Build; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.robolectric.RuntimeEnvironment; +import org.robolectric.annotation.Config; +import org.robolectric.shadows.ShadowNotificationManager; + +import org.chromium.base.test.BaseRobolectricTestRunner; + +/** + * JUnit tests for NotificationSystemStatusUtil which run against Robolectric so that we can + * manipulate what NotificationManagerCompat.getNotificationsEnabled returns. + */ +@RunWith(BaseRobolectricTestRunner.class) +@Config(manifest = Config.NONE) +public class NotificationSystemStatusUtilUnitTest { + @Test + public void testAppNotificationStatusEnabled() throws Exception { + getShadowNotificationManager().setNotificationsEnabled(true); + assertThat(NotificationSystemStatusUtil.getAppNotificationStatus(), + is(NotificationSystemStatusUtil.APP_NOTIFICATIONS_STATUS_ENABLED)); + } + + @Test + public void testAppNotificationStatusDisabled() throws Exception { + getShadowNotificationManager().setNotificationsEnabled(false); + assertThat(NotificationSystemStatusUtil.getAppNotificationStatus(), + is(NotificationSystemStatusUtil.APP_NOTIFICATIONS_STATUS_DISABLED)); + } + + @Config(sdk = Build.VERSION_CODES.JELLY_BEAN_MR2, manifest = Config.NONE) + @Test + public void testAppNotificationStatusPreKitKat() { + getShadowNotificationManager().setNotificationsEnabled(true); + assertThat(NotificationSystemStatusUtil.getAppNotificationStatus(), + is(NotificationSystemStatusUtil.APP_NOTIFICATIONS_STATUS_UNDETERMINABLE)); + + getShadowNotificationManager().setNotificationsEnabled(false); + assertThat(NotificationSystemStatusUtil.getAppNotificationStatus(), + is(NotificationSystemStatusUtil.APP_NOTIFICATIONS_STATUS_UNDETERMINABLE)); + } + + private ShadowNotificationManager getShadowNotificationManager() { + return shadowOf((NotificationManager) RuntimeEnvironment.application.getSystemService( + Context.NOTIFICATION_SERVICE)); + } +} \ No newline at end of file
diff --git a/chrome/android/profiles/newest.txt b/chrome/android/profiles/newest.txt index 5b5d0f1..cb469285 100644 --- a/chrome/android/profiles/newest.txt +++ b/chrome/android/profiles/newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-70.0.3507.0_rc-r1.afdo.bz2 \ No newline at end of file +chromeos-chrome-amd64-70.0.3508.0_rc-r1.afdo.bz2 \ No newline at end of file
diff --git a/chrome/app/vector_icons/close_all.icon b/chrome/app/vector_icons/close_all.icon index fdf8061..20c8b0c 100644 --- a/chrome/app/vector_icons/close_all.icon +++ b/chrome/app/vector_icons/close_all.icon
@@ -36,3 +36,51 @@ R_LINE_TO, 2.83f, 2.83f, R_LINE_TO, -1.41f, 1.41f, CLOSE + +CANVAS_DIMENSIONS, 16, +MOVE_TO, 2.5f, 13.5f, +LINE_TO, 10.5f, 13.5f, +CUBIC_TO, 10.78f, 13.5f, 11, 13.72f, 11, 14, +LINE_TO, 11, 14.5f, +CUBIC_TO, 11, 14.78f, 10.78f, 15, 10.5f, 15, +LINE_TO, 2.5f, 15, +LINE_TO, 2, 15, +CUBIC_TO, 1.45f, 15, 1, 14.55f, 1, 14, +LINE_TO, 1, 5.5f, +CUBIC_TO, 1, 5.22f, 1.22f, 5, 1.5f, 5, +LINE_TO, 2, 5, +CUBIC_TO, 2.28f, 5, 2.5f, 5.22f, 2.5f, 5.5f, +LINE_TO, 2.5f, 13.5f, +CLOSE, +MOVE_TO, 13.78f, 1, +CUBIC_TO, 14.45f, 1, 15, 1.55f, 15, 2.22f, +LINE_TO, 15, 10.78f, +CUBIC_TO, 15, 11.45f, 14.45f, 12, 13.78f, 12, +LINE_TO, 5.22f, 12, +CUBIC_TO, 4.55f, 12, 4, 11.45f, 4, 10.78f, +LINE_TO, 4, 2.22f, +CUBIC_TO, 4, 1.55f, 4.55f, 1, 5.22f, 1, +LINE_TO, 13.78f, 1, +CLOSE, +MOVE_TO, 12.65f, 3.63f, +LINE_TO, 12.37f, 3.35f, +CUBIC_TO, 12.17f, 3.16f, 11.85f, 3.16f, 11.66f, 3.35f, +LINE_TO, 9.5f, 5.51f, +LINE_TO, 7.34f, 3.35f, +CUBIC_TO, 7.15f, 3.16f, 6.83f, 3.16f, 6.63f, 3.35f, +LINE_TO, 6.35f, 3.63f, +CUBIC_TO, 6.16f, 3.83f, 6.16f, 4.15f, 6.35f, 4.34f, +LINE_TO, 8.51f, 6.5f, +LINE_TO, 6.35f, 8.66f, +CUBIC_TO, 6.16f, 8.85f, 6.16f, 9.17f, 6.35f, 9.37f, +LINE_TO, 6.63f, 9.65f, +CUBIC_TO, 6.83f, 9.84f, 7.15f, 9.84f, 7.34f, 9.65f, +LINE_TO, 9.5f, 7.49f, +LINE_TO, 11.66f, 9.65f, +CUBIC_TO, 11.85f, 9.84f, 12.17f, 9.84f, 12.37f, 9.65f, +LINE_TO, 12.65f, 9.37f, +CUBIC_TO, 12.84f, 9.17f, 12.84f, 8.85f, 12.65f, 8.66f, +LINE_TO, 10.49f, 6.5f, +LINE_TO, 12.65f, 4.34f, +CUBIC_TO, 12.84f, 4.15f, 12.84f, 3.83f, 12.65f, 3.63f, +CLOSE
diff --git a/chrome/app/vector_icons/credit_card.icon b/chrome/app/vector_icons/credit_card.icon index cba5419..a6edbf2 100644 --- a/chrome/app/vector_icons/credit_card.icon +++ b/chrome/app/vector_icons/credit_card.icon
@@ -27,25 +27,25 @@ CLOSE CANVAS_DIMENSIONS, 16, -MOVE_TO, 13, 7, -V_LINE_TO, 5, -H_LINE_TO, 3, -R_V_LINE_TO, 2, -R_H_LINE_TO, 10, +MOVE_TO, 13.6f, 2, +LINE_TO, 2.4f, 2, +CUBIC_TO, 1.63f, 2, 1.01f, 2.62f, 1.01f, 3.38f, +LINE_TO, 1, 12.12f, +CUBIC_TO, 1, 12.88f, 1.63f, 13.5f, 2.4f, 13.5f, +LINE_TO, 13.6f, 13.5f, +CUBIC_TO, 14.37f, 13.5f, 15, 12.88f, 15, 12.12f, +LINE_TO, 15, 3.38f, +CUBIC_TO, 15, 2.62f, 14.37f, 2, 13.6f, 2, CLOSE, -R_MOVE_TO, 0, 2, -R_V_LINE_TO, 3, -H_LINE_TO, 3, -V_LINE_TO, 9, -R_H_LINE_TO, 10, +MOVE_TO, 13.5f, 12, +LINE_TO, 2.5f, 12, +LINE_TO, 2.5f, 7.5f, +LINE_TO, 13.5f, 7.5f, +LINE_TO, 13.5f, 12, CLOSE, -MOVE_TO, 1, 4.99f, -CUBIC_TO, 1, 3.89f, 1.9f, 3, 3.01f, 3, -R_H_LINE_TO, 9.99f, -CUBIC_TO, 14.1f, 3, 15, 3.9f, 15, 4.99f, -R_V_LINE_TO, 7.02f, -R_CUBIC_TO, 0, 1.1f, -0.9f, 1.99f, -2.01f, 1.99f, -H_LINE_TO, 3.01f, -CUBIC_TO, 1.9f, 14, 1, 13.1f, 1, 12.01f, -V_LINE_TO, 4.99f, +MOVE_TO, 13.5f, 5, +LINE_TO, 2.5f, 5, +LINE_TO, 2.5f, 3.5f, +LINE_TO, 13.5f, 3.5f, +LINE_TO, 13.5f, 5, CLOSE
diff --git a/chrome/app/vector_icons/key.icon b/chrome/app/vector_icons/key.icon index f8a919c..9928c7c 100644 --- a/chrome/app/vector_icons/key.icon +++ b/chrome/app/vector_icons/key.icon
@@ -22,3 +22,24 @@ R_CUBIC_TO, -1.66f, 0, -3, 1.34f, -3, 3, R_CUBIC_TO, 0, 1.66f, 1.34f, 3, 3, 3, CLOSE + +CANVAS_DIMENSIONS, 16, +MOVE_TO, 8.41f, 6, +CUBIC_TO, 7.89f, 4.44f, 6.48f, 3.33f, 4.82f, 3.33f, +CUBIC_TO, 2.71f, 3.33f, 1, 5.12f, 1, 7.33f, +CUBIC_TO, 1, 9.54f, 2.71f, 11.33f, 4.82f, 11.33f, +CUBIC_TO, 6.48f, 11.33f, 7.89f, 10.22f, 8.41f, 8.66f, +LINE_TO, 11.18f, 8.66f, +LINE_TO, 11.18f, 11.33f, +LINE_TO, 13.73f, 11.33f, +LINE_TO, 13.73f, 8.66f, +LINE_TO, 15, 8.66f, +LINE_TO, 15, 6, +LINE_TO, 8.41f, 6, +CLOSE, +MOVE_TO, 4.82f, 8.67f, +CUBIC_TO, 4.12f, 8.67f, 3.55f, 8.08f, 3.55f, 7.34f, +CUBIC_TO, 3.55f, 6.6f, 4.12f, 6.01f, 4.82f, 6.01f, +CUBIC_TO, 5.52f, 6.01f, 6.09f, 6.6f, 6.09f, 7.34f, +CUBIC_TO, 6.09f, 8.08f, 5.52f, 8.67f, 4.82f, 8.67f, +CLOSE
diff --git a/chrome/app/vector_icons/settings.icon b/chrome/app/vector_icons/settings.icon index 6286b5e..06989c0 100644 --- a/chrome/app/vector_icons/settings.icon +++ b/chrome/app/vector_icons/settings.icon
@@ -48,3 +48,51 @@ R_CUBIC_TO, 3.87f, 0, 7, 3.13f, 7, 7, R_CUBIC_TO, 0, 3.87f, -3.13f, 7, -7, 7, CLOSE + +CANVAS_DIMENSIONS, 16, +MOVE_TO, 12.58f, 8.59f, +CUBIC_TO, 12.61f, 8.4f, 12.63f, 8.2f, 12.63f, 8, +CUBIC_TO, 12.63f, 7.8f, 12.61f, 7.6f, 12.58f, 7.41f, +LINE_TO, 13.89f, 6.42f, +CUBIC_TO, 14, 6.33f, 14.03f, 6.17f, 13.96f, 6.04f, +LINE_TO, 12.73f, 3.96f, +CUBIC_TO, 12.65f, 3.83f, 12.49f, 3.78f, 12.35f, 3.83f, +LINE_TO, 10.81f, 4.43f, +CUBIC_TO, 10.49f, 4.19f, 10.15f, 3.99f, 9.77f, 3.84f, +LINE_TO, 9.54f, 2.25f, +CUBIC_TO, 9.52f, 2.11f, 9.39f, 2, 9.24f, 2, +LINE_TO, 6.77f, 2, +CUBIC_TO, 6.61f, 2, 6.48f, 2.11f, 6.47f, 2.25f, +LINE_TO, 6.23f, 3.84f, +CUBIC_TO, 5.85f, 3.99f, 5.51f, 4.2f, 5.19f, 4.43f, +LINE_TO, 3.65f, 3.83f, +CUBIC_TO, 3.51f, 3.78f, 3.35f, 3.83f, 3.28f, 3.96f, +LINE_TO, 2.04f, 6.04f, +CUBIC_TO, 1.96f, 6.17f, 2, 6.33f, 2.12f, 6.42f, +LINE_TO, 3.42f, 7.41f, +CUBIC_TO, 3.39f, 7.6f, 3.38f, 7.8f, 3.38f, 8, +CUBIC_TO, 3.38f, 8.2f, 3.39f, 8.4f, 3.42f, 8.59f, +LINE_TO, 2.12f, 9.58f, +CUBIC_TO, 2, 9.67f, 1.97f, 9.83f, 2.04f, 9.96f, +LINE_TO, 3.28f, 12.04f, +CUBIC_TO, 3.35f, 12.17f, 3.52f, 12.22f, 3.65f, 12.17f, +LINE_TO, 5.19f, 11.57f, +CUBIC_TO, 5.51f, 11.81f, 5.85f, 12.01f, 6.23f, 12.16f, +LINE_TO, 6.47f, 13.75f, +CUBIC_TO, 6.48f, 13.89f, 6.61f, 14, 6.77f, 14, +LINE_TO, 9.24f, 14, +CUBIC_TO, 9.39f, 14, 9.52f, 13.89f, 9.54f, 13.75f, +LINE_TO, 9.77f, 12.16f, +CUBIC_TO, 10.15f, 12.01f, 10.49f, 11.8f, 10.81f, 11.57f, +LINE_TO, 12.35f, 12.17f, +CUBIC_TO, 12.49f, 12.22f, 12.65f, 12.17f, 12.73f, 12.04f, +LINE_TO, 13.96f, 9.96f, +CUBIC_TO, 14.03f, 9.83f, 14, 9.67f, 13.89f, 9.58f, +LINE_TO, 12.58f, 8.59f, +CLOSE, +MOVE_TO, 8, 10, +CUBIC_TO, 6.9f, 10, 6, 9.1f, 6, 8, +CUBIC_TO, 6, 6.9f, 6.9f, 6, 8, 6, +CUBIC_TO, 9.1f, 6, 10, 6.9f, 10, 8, +CUBIC_TO, 10, 9.1f, 9.1f, 10, 8, 10, +CLOSE
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index c771dec..f81d99dd 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -4503,6 +4503,7 @@ "../android/java/src/org/chromium/chrome/browser/notifications/ActionInfo.java", "../android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java", "../android/java/src/org/chromium/chrome/browser/notifications/NotificationSettingsBridge.java", + "../android/java/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtil.java", "../android/java/src/org/chromium/chrome/browser/ntp/ContentSuggestionsNotifier.java", "../android/java/src/org/chromium/chrome/browser/ntp/ForeignSessionHelper.java", "../android/java/src/org/chromium/chrome/browser/ntp/LogoBridge.java",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 472aa4e..c5a2d2d 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -2713,6 +2713,12 @@ FEATURE_VALUE_TYPE( password_manager::features::kPasswordsKeyboardAccessory)}, #endif // OS_ANDROID +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) + {"passwords-migrate-linux-to-login-db", + flag_descriptions::kPasswordsMigrateLinuxToLoginDBName, + flag_descriptions::kPasswordsMigrateLinuxToLoginDBDescription, kOsLinux, + FEATURE_VALUE_TYPE(password_manager::features::kMigrateLinuxToLoginDB)}, +#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) #if defined(OS_CHROMEOS) {"enable-experimental-accessibility-features", flag_descriptions::kExperimentalAccessibilityFeaturesName,
diff --git a/chrome/browser/android/compositor/compositor_view.cc b/chrome/browser/android/compositor/compositor_view.cc index d0c90c9..c1e6d959 100644 --- a/chrome/browser/android/compositor/compositor_view.cc +++ b/chrome/browser/android/compositor/compositor_view.cc
@@ -255,7 +255,7 @@ const content::ChildProcessData& data, const content::ChildProcessTerminationInfo& info) { LOG(WARNING) << "Child process died (type=" << data.process_type - << ") pid=" << data.handle << ")"; + << ") pid=" << data.GetHandle() << ")"; if (base::android::BuildInfo::GetInstance()->sdk_int() <= base::android::SDK_VERSION_JELLY_BEAN_MR2 && data.process_type == content::PROCESS_TYPE_GPU) {
diff --git a/chrome/browser/android/feedback/process_id_feedback_source.cc b/chrome/browser/android/feedback/process_id_feedback_source.cc index 687f3201..e6e4b5e69 100644 --- a/chrome/browser/android/feedback/process_id_feedback_source.cc +++ b/chrome/browser/android/feedback/process_id_feedback_source.cc
@@ -65,7 +65,8 @@ DCHECK_CURRENTLY_ON(BrowserThread::IO); for (content::BrowserChildProcessHostIterator iter; !iter.Done(); ++iter) - process_ids_[iter.GetData().process_type].push_back(iter.GetData().handle); + process_ids_[iter.GetData().process_type].push_back( + iter.GetData().GetHandle()); BrowserThread::PostTask( BrowserThread::UI, FROM_HERE,
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index da99f4c..c94cead 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -3487,6 +3487,20 @@ } } +bool ChromeContentBrowserClient::BindAssociatedInterfaceRequestFromFrame( + content::RenderFrameHost* render_frame_host, + const std::string& interface_name, + mojo::ScopedInterfaceEndpointHandle* handle) { + if (interface_name == autofill::mojom::AutofillDriver::Name_) { + autofill::ContentAutofillDriverFactory::BindAutofillDriver( + autofill::mojom::AutofillDriverAssociatedRequest(std::move(*handle)), + render_frame_host); + return true; + } + + return false; +} + void ChromeContentBrowserClient::BindInterfaceRequestFromWorker( content::RenderProcessHost* render_process_host, const url::Origin& origin, @@ -4038,9 +4052,6 @@ &ChromeLanguageDetectionTabHelper::BindContentTranslateDriver)); frame_interfaces_parameterized_->AddInterface( - base::Bind(&autofill::ContentAutofillDriverFactory::BindAutofillDriver)); - - frame_interfaces_parameterized_->AddInterface( base::BindRepeating(&ChromePasswordManagerClient::BindCredentialManager)); frame_interfaces_parameterized_->AddInterface( base::Bind(&InsecureSensitiveInputDriverFactory::BindDriver));
diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index ca83d2de..95a9cf1 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h
@@ -349,6 +349,10 @@ content::RenderFrameHost* render_frame_host, const std::string& interface_name, mojo::ScopedMessagePipeHandle interface_pipe) override; + bool BindAssociatedInterfaceRequestFromFrame( + content::RenderFrameHost* render_frame_host, + const std::string& interface_name, + mojo::ScopedInterfaceEndpointHandle* handle) override; void BindInterfaceRequestFromWorker( content::RenderProcessHost* render_process_host, const url::Origin& origin,
diff --git a/chrome/browser/chrome_content_browser_client_browsertest_chromeos.cc b/chrome/browser/chrome_content_browser_client_browsertest_chromeos.cc index 919e9b8..4ff2f2d 100644 --- a/chrome/browser/chrome_content_browser_client_browsertest_chromeos.cc +++ b/chrome/browser/chrome_content_browser_client_browsertest_chromeos.cc
@@ -26,7 +26,7 @@ void GetUtilityProcessPidsOnIOThread(std::vector<pid_t>* pids) { for (BrowserChildProcessHostIterator it(content::PROCESS_TYPE_UTILITY); !it.Done(); ++it) { - pid_t pid = it.GetData().handle; + pid_t pid = it.GetData().GetHandle(); pids->push_back(pid); } }
diff --git a/chrome/browser/chrome_plugin_browsertest.cc b/chrome/browser/chrome_plugin_browsertest.cc index fab61fa4..9f9e031b 100644 --- a/chrome/browser/chrome_plugin_browsertest.cc +++ b/chrome/browser/chrome_plugin_browsertest.cc
@@ -154,7 +154,7 @@ if (iter.GetData().process_type != content::PROCESS_TYPE_PPAPI_PLUGIN) continue; base::Process process = base::Process::DeprecatedGetProcessFromHandle( - iter.GetData().handle); + iter.GetData().GetHandle()); process.Terminate(0, true); found = true; }
diff --git a/chrome/browser/chromeos/app_mode/app_session.cc b/chrome/browser/chromeos/app_mode/app_session.cc index 43a6be5..56c5e2e2 100644 --- a/chrome/browser/chromeos/app_mode/app_session.cc +++ b/chrome/browser/chromeos/app_mode/app_session.cc
@@ -78,12 +78,12 @@ const content::ChildProcessData& data = iter.GetData(); if (child_ids.count(data.id) == 1) { // Send a signal to dump the plugin process. - if (kill(data.handle, SIGFPE) == 0) { + if (kill(data.GetHandle(), SIGFPE) == 0) { dump_requested = true; } else { LOG(WARNING) << "Failed to send SIGFPE to plugin process" << ", errno=" << errno - << ", pid=" << data.handle + << ", pid=" << data.GetHandle() << ", type=" << data.process_type << ", name=" << data.name; }
diff --git a/chrome/browser/chromeos/policy/user_affiliation_browsertest.cc b/chrome/browser/chromeos/policy/user_affiliation_browsertest.cc index c68d92e13..b04e105 100644 --- a/chrome/browser/chromeos/policy/user_affiliation_browsertest.cc +++ b/chrome/browser/chromeos/policy/user_affiliation_browsertest.cc
@@ -8,6 +8,7 @@ #include "base/callback_helpers.h" #include "base/macros.h" #include "base/memory/ptr_util.h" +#include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/chromeos/policy/affiliation_test_helper.h" #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" #include "chrome/browser/net/nss_context.h" @@ -25,6 +26,7 @@ #include "components/user_manager/user.h" #include "components/user_manager/user_manager.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/notification_service.h" #include "content/public/test/test_launcher.h" #include "content/public/test/test_utils.h" #include "crypto/scoped_test_system_nss_key_slot.h" @@ -112,6 +114,7 @@ protected: // InProcessBrowserTest void SetUpCommandLine(base::CommandLine* command_line) override { + InProcessBrowserTest::SetUpCommandLine(command_line); if (content::IsPreTest()) { affiliation_test_helper::AppendCommandLineSwitchesForLoginManager( command_line); @@ -128,6 +131,7 @@ // InProcessBrowserTest void SetUpInProcessBrowserTestFixture() override { + InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); chromeos::FakeSessionManagerClient* fake_session_manager_client = new chromeos::FakeSessionManagerClient; chromeos::DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient( @@ -156,6 +160,22 @@ policy::DeviceManagementService::SetRetryDelayForTesting(0); } + // InProcessBrowserTest: + void SetUpOnMainThread() override { + InProcessBrowserTest::SetUpOnMainThread(); + if (content::IsPreTest()) { + // Wait for the login manager UI to be available before continuing. + // This is a workaround for chrome crashing when running with DCHECKS when + // it exits while the login manager is being loaded. + // TODO(pmarko): Remove this when https://crbug.com/869272 is fixed. + content::WindowedNotificationObserver( + chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE, + content::NotificationService::AllSources()) + .Wait(); + } + } + + // InProcessBrowserTest: void TearDownOnMainThread() override { InProcessBrowserTest::TearDownOnMainThread();
diff --git a/chrome/browser/conflicts/module_database_win.cc b/chrome/browser/conflicts/module_database_win.cc index 5134408..603879c 100644 --- a/chrome/browser/conflicts/module_database_win.cc +++ b/chrome/browser/conflicts/module_database_win.cc
@@ -15,8 +15,8 @@ #if defined(GOOGLE_CHROME_BUILD) #include "base/feature_list.h" #include "base/task_scheduler/post_task.h" -#include "base/win/windows_version.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/conflicts/incompatible_applications_updater_win.h" #include "chrome/browser/conflicts/module_load_attempt_log_listener_win.h" #include "chrome/browser/conflicts/third_party_conflicts_manager_win.h" #include "chrome/common/chrome_features.h" @@ -345,9 +345,7 @@ if (!IsThirdPartyBlockingPolicyEnabled()) return; - if ((base::FeatureList::IsEnabled( - features::kIncompatibleApplicationsWarning) && - base::win::GetVersion() >= base::win::VERSION_WIN10) || + if (IncompatibleApplicationsUpdater::IsWarningEnabled() || base::FeatureList::IsEnabled(features::kThirdPartyModulesBlocking)) { third_party_conflicts_manager_ = std::make_unique<ThirdPartyConflictsManager>(this);
diff --git a/chrome/browser/conflicts/third_party_conflicts_manager_win.cc b/chrome/browser/conflicts/third_party_conflicts_manager_win.cc index 8e2537f7..125c044c 100644 --- a/chrome/browser/conflicts/third_party_conflicts_manager_win.cc +++ b/chrome/browser/conflicts/third_party_conflicts_manager_win.cc
@@ -19,7 +19,6 @@ #include "base/task_runner.h" #include "base/task_runner_util.h" #include "base/task_scheduler/post_task.h" -#include "base/win/windows_version.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/conflicts/incompatible_applications_updater_win.h" #include "chrome/browser/conflicts/installed_applications_win.h" @@ -124,12 +123,7 @@ // The InstalledApplications instance is only needed for the incompatible // applications warning. - if (!base::FeatureList::IsEnabled(features::kIncompatibleApplicationsWarning)) - return; - - // The incompatible applications warning feature is not available on Windows - // versions other than 10. - if (base::win::GetVersion() < base::win::VERSION_WIN10) + if (!IncompatibleApplicationsUpdater::IsWarningEnabled()) return; base::PostTaskAndReplyWithResult( @@ -282,8 +276,7 @@ // Check if this instance is ready to initialize. if (!exe_certificate_info_ || !module_list_filter_ || (!installed_applications_ && - base::FeatureList::IsEnabled( - features::kIncompatibleApplicationsWarning))) { + IncompatibleApplicationsUpdater::IsWarningEnabled())) { return; }
diff --git a/chrome/browser/conflicts/third_party_conflicts_manager_win_unittest.cc b/chrome/browser/conflicts/third_party_conflicts_manager_win_unittest.cc index b1978233..9994f82 100644 --- a/chrome/browser/conflicts/third_party_conflicts_manager_win_unittest.cc +++ b/chrome/browser/conflicts/third_party_conflicts_manager_win_unittest.cc
@@ -12,6 +12,7 @@ #include "base/run_loop.h" #include "base/test/scoped_feature_list.h" #include "base/threading/sequenced_task_runner_handle.h" +#include "base/win/windows_version.h" #include "chrome/browser/conflicts/proto/module_list.pb.h" #include "chrome/common/chrome_features.h" #include "chrome/test/base/scoped_testing_local_state.h" @@ -84,7 +85,7 @@ DISALLOW_COPY_AND_ASSIGN(ThirdPartyConflictsManagerTest); }; -TEST_F(ThirdPartyConflictsManagerTest, InitializeBothUpdaters) { +TEST_F(ThirdPartyConflictsManagerTest, InitializeUpdaters) { ThirdPartyConflictsManager third_party_conflicts_manager(this); third_party_conflicts_manager.OnModuleDatabaseIdle(); @@ -99,8 +100,12 @@ run_loop.Run(); ASSERT_TRUE(final_state().has_value()); - EXPECT_EQ(final_state().value(), - ThirdPartyConflictsManager::State::kWarningAndBlockingInitialized); + + const auto kExpectedFinalState = + base::win::GetVersion() >= base::win::VERSION_WIN10 + ? ThirdPartyConflictsManager::State::kWarningAndBlockingInitialized + : ThirdPartyConflictsManager::State::kBlockingInitialized; + EXPECT_EQ(final_state().value(), kExpectedFinalState); } TEST_F(ThirdPartyConflictsManagerTest, InvalidModuleList) {
diff --git a/chrome/browser/extensions/api/processes/processes_api.cc b/chrome/browser/extensions/api/processes/processes_api.cc index 1de2474..517c2595 100644 --- a/chrome/browser/extensions/api/processes/processes_api.cc +++ b/chrome/browser/extensions/api/processes/processes_api.cc
@@ -520,7 +520,7 @@ auto* host = content::BrowserChildProcessHost::FromID(child_process_host_id); if (host) - return host->GetData().handle; + return host->GetData().GetHandle(); return base::kNullProcessHandle; }
diff --git a/chrome/browser/extensions/blacklist.cc b/chrome/browser/extensions/blacklist.cc index 3a7e2ef..f1a971fa 100644 --- a/chrome/browser/extensions/blacklist.cc +++ b/chrome/browser/extensions/blacklist.cc
@@ -79,19 +79,26 @@ // Constructs a client to query the database manager for |extension_ids| and // run |callback| with the IDs of those which have been blacklisted. - SafeBrowsingClientImpl( + static void Start( const std::set<std::string>& extension_ids, - const OnResultCallback& callback) - : callback_task_runner_(base::ThreadTaskRunnerHandle::Get()), - callback_(callback) { + const OnResultCallback& callback) { + auto safe_browsing_client = base::WrapRefCounted( + new SafeBrowsingClientImpl(extension_ids, callback)); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, - base::BindOnce(&SafeBrowsingClientImpl::StartCheck, this, - g_database_manager.Get().get(), extension_ids)); + base::BindOnce(&SafeBrowsingClientImpl::StartCheck, + safe_browsing_client, g_database_manager.Get().get(), + extension_ids)); } private: friend class base::RefCountedThreadSafe<SafeBrowsingClientImpl>; + + SafeBrowsingClientImpl(const std::set<std::string>& extension_ids, + const OnResultCallback& callback) + : callback_task_runner_(base::ThreadTaskRunnerHandle::Get()), + callback_(callback) {} + ~SafeBrowsingClientImpl() override {} // Pass |database_manager| as a parameter to avoid touching @@ -197,9 +204,9 @@ // safebrowsing for the blacklisted extensions. The set of blacklisted // extensions returned by SafeBrowsing will then be passed to // GetBlacklistStateIDs to get the particular BlacklistState for each id. - new SafeBrowsingClientImpl( - ids, base::Bind(&Blacklist::GetBlacklistStateForIDs, AsWeakPtr(), - callback)); + SafeBrowsingClientImpl::Start( + ids, + base::Bind(&Blacklist::GetBlacklistStateForIDs, AsWeakPtr(), callback)); } void Blacklist::GetMalwareIDs(const std::set<std::string>& ids,
diff --git a/chrome/browser/extensions/chrome_url_request_util.cc b/chrome/browser/extensions/chrome_url_request_util.cc index 4b9583a..fd4ee30a 100644 --- a/chrome/browser/extensions/chrome_url_request_util.cc +++ b/chrome/browser/extensions/chrome_url_request_util.cc
@@ -24,6 +24,7 @@ #include "extensions/common/file_util.h" #include "mojo/public/cpp/bindings/strong_binding.h" #include "mojo/public/cpp/system/file_data_pipe_producer.h" +#include "net/base/completion_once_callback.h" #include "net/base/mime_util.h" #include "net/base/net_errors.h" #include "net/http/http_request_headers.h" @@ -70,11 +71,10 @@ } // Overridden from URLRequestSimpleJob: - int GetRefCountedData( - std::string* mime_type, - std::string* charset, - scoped_refptr<base::RefCountedMemory>* data, - const net::CompletionCallback& callback) const override { + int GetRefCountedData(std::string* mime_type, + std::string* charset, + scoped_refptr<base::RefCountedMemory>* data, + net::CompletionOnceCallback callback) const override { const ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); *data = rb.LoadDataResourceBytes(resource_id_); @@ -86,11 +86,11 @@ std::string* read_mime_type = new std::string; base::PostTaskWithTraitsAndReplyWithResult( FROM_HERE, {base::MayBlock()}, - base::Bind(&net::GetMimeTypeFromFile, filename_, - base::Unretained(read_mime_type)), - base::Bind(&URLRequestResourceBundleJob::OnMimeTypeRead, - weak_factory_.GetWeakPtr(), mime_type, charset, *data, - base::Owned(read_mime_type), callback)); + base::BindOnce(&net::GetMimeTypeFromFile, filename_, + base::Unretained(read_mime_type)), + base::BindOnce(&URLRequestResourceBundleJob::OnMimeTypeRead, + weak_factory_.GetWeakPtr(), mime_type, charset, *data, + base::Owned(read_mime_type), std::move(callback))); return net::ERR_IO_PENDING; } @@ -106,7 +106,7 @@ std::string* charset, scoped_refptr<base::RefCountedMemory> data, std::string* read_mime_type, - const net::CompletionCallback& callback, + net::CompletionOnceCallback callback, bool read_result) { response_info_.headers->AddHeader( base::StringPrintf("%s: %s", net::HttpRequestHeaders::kContentType, @@ -114,7 +114,7 @@ *out_mime_type = *read_mime_type; DetermineCharset(*read_mime_type, data.get(), charset); int result = read_result ? net::OK : net::ERR_INVALID_URL; - callback.Run(result); + std::move(callback).Run(result); } // We need the filename of the resource to determine the mime type.
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index f0ffd01..18e4b25 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -1412,6 +1412,12 @@ "Adds password generation button and toggle for the passwords bottom sheet " "to the keyboard accessory. Replaces password generation popups."; +const char kPasswordsMigrateLinuxToLoginDBName[] = + "Migrate passwords to \"Login Data\""; +const char kPasswordsMigrateLinuxToLoginDBDescription[] = + "Performs a one-off migration (with retries) of passwords from the " + "gnome-keyring or kwallet into the profile directory."; + const char kPdfIsolationName[] = "PDF Isolation"; const char kPdfIsolationDescription[] = "Render PDF files from different origins in different plugin processes.";
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index e58a3f5..aed1dc1 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -871,6 +871,9 @@ extern const char kPasswordsKeyboardAccessoryName[]; extern const char kPasswordsKeyboardAccessoryDescription[]; +extern const char kPasswordsMigrateLinuxToLoginDBName[]; +extern const char kPasswordsMigrateLinuxToLoginDBDescription[]; + extern const char kPdfIsolationName[]; extern const char kPdfIsolationDescription[];
diff --git a/chrome/browser/image_decoder_browsertest.cc b/chrome/browser/image_decoder_browsertest.cc index a66d5bde..cdc3a41 100644 --- a/chrome/browser/image_decoder_browsertest.cc +++ b/chrome/browser/image_decoder_browsertest.cc
@@ -118,13 +118,12 @@ void BrowserChildProcessHostConnected( const content::ChildProcessData& data) override { DCHECK_CURRENTLY_ON(BrowserThread::UI); - if (data.handle == base::kNullProcessHandle || - data.name != utility_process_name_) { + if (!data.IsHandleValid() || data.name != utility_process_name_) { return; } ASSERT_FALSE(did_kill_); - base::ProcessHandle handle = data.handle; + base::ProcessHandle handle = data.GetHandle(); #if defined(OS_WIN) // On windows, duplicate the process handle since base::Process closes it on
diff --git a/chrome/browser/interstitials/enterprise_util.cc b/chrome/browser/interstitials/enterprise_util.cc index 3a65dc90..4189404 100644 --- a/chrome/browser/interstitials/enterprise_util.cc +++ b/chrome/browser/interstitials/enterprise_util.cc
@@ -81,6 +81,7 @@ case safe_browsing::SB_THREAT_TYPE_URL_CLIENT_SIDE_MALWARE: return "MALWARE"; case safe_browsing::SB_THREAT_TYPE_URL_UNWANTED: + case safe_browsing::SB_THREAT_TYPE_TRICK_TO_BILL: return "HARMFUL"; case safe_browsing::SB_THREAT_TYPE_UNUSED: case safe_browsing::SB_THREAT_TYPE_SAFE:
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc index 55df340..56da4a1 100644 --- a/chrome/browser/io_thread.cc +++ b/chrome/browser/io_thread.cc
@@ -360,6 +360,11 @@ #endif ConstructSystemRequestContext(); + + // Prevent DCHECK failures when a NetworkContext is created with an encrypted + // cookie store. + if (!base::FeatureList::IsEnabled(network::features::kNetworkService)) + content::GetNetworkServiceImpl()->set_os_crypt_is_configured(); } void IOThread::CleanUp() {
diff --git a/chrome/browser/media/router/mojo/media_router_desktop.cc b/chrome/browser/media/router/mojo/media_router_desktop.cc index 3162300..2845cce 100644 --- a/chrome/browser/media/router/mojo/media_router_desktop.cc +++ b/chrome/browser/media/router/mojo/media_router_desktop.cc
@@ -279,6 +279,8 @@ auto* dial_media_sink_service = media_sink_service_->GetDialMediaSinkServiceImpl(); + std::string receiver_id_hash_token = GetReceiverIdHashToken( + Profile::FromBrowserContext(context())->GetPrefs()); auto task_runner = dial_media_sink_service->task_runner(); service_manager::Connector* connector = @@ -288,7 +290,7 @@ new DialMediaRouteProvider(mojo::MakeRequest(&dial_provider_ptr), media_router_ptr.PassInterface(), dial_media_sink_service, connector, - task_runner), + receiver_id_hash_token, task_runner), base::OnTaskRunnerDeleter(task_runner)); RegisterMediaRouteProvider(MediaRouteProviderId::DIAL, std::move(dial_provider_ptr), base::DoNothing());
diff --git a/chrome/browser/media/router/providers/dial/dial_internal_message_util.cc b/chrome/browser/media/router/providers/dial/dial_internal_message_util.cc index 7ae0932..004b4ea 100644 --- a/chrome/browser/media/router/providers/dial/dial_internal_message_util.cc +++ b/chrome/browser/media/router/providers/dial/dial_internal_message_util.cc
@@ -74,27 +74,6 @@ return DialInternalMessageType::kOther; } -base::Value CreateReceiver(const MediaSinkInternal& sink) { - base::Value receiver(base::Value::Type::DICTIONARY); - - std::string label = base::SHA1HashString(sink.sink().id()); - base::Base64UrlEncode(label, base::Base64UrlEncodePolicy::OMIT_PADDING, - &label); - receiver.SetKey("label", base::Value(label)); - - receiver.SetKey("friendlyName", - base::Value(net::EscapeForHTML(sink.sink().name()))); - receiver.SetKey("capabilities", base::ListValue()); - receiver.SetKey("volume", base::Value(base::Value::Type::NONE)); - receiver.SetKey("isActiveInput", base::Value(base::Value::Type::NONE)); - receiver.SetKey("displayStatus", base::Value(base::Value::Type::NONE)); - - receiver.SetKey("receiverType", base::Value("dial")); - receiver.SetKey("ipAddress", - base::Value(sink.dial_data().ip_address.ToString())); - return receiver; -} - std::string DialReceiverActionToString(DialReceiverAction action) { switch (action) { case DialReceiverAction::kCast: @@ -106,60 +85,6 @@ return ""; } -base::Value CreateReceiverActionBody(const MediaSinkInternal& sink, - DialReceiverAction action) { - base::Value message_body(base::Value::Type::DICTIONARY); - message_body.SetKey("receiver", CreateReceiver(sink)); - message_body.SetKey("action", - base::Value(DialReceiverActionToString(action))); - return message_body; -} - -base::Value CreateNewSessionBody(const DialLaunchInfo& launch_info, - const MediaSinkInternal& sink) { - base::Value message_body(base::Value::Type::DICTIONARY); - message_body.SetKey("sessionId", base::Value(GetNextSessionId())); - message_body.SetKey("appId", base::Value("")); - message_body.SetKey("displayName", base::Value(launch_info.app_name)); - message_body.SetKey("statusText", base::Value("")); - message_body.SetKey("appImages", base::ListValue()); - message_body.SetKey("receiver", CreateReceiver(sink)); - message_body.SetKey("senderApps", base::ListValue()); - message_body.SetKey("namespaces", base::ListValue()); - message_body.SetKey("media", base::ListValue()); - message_body.SetKey("status", base::Value("connected")); - message_body.SetKey("transportId", base::Value("")); - return message_body; -} - -base::Value CreateCustomDialLaunchBody(const MediaSinkInternal& sink, - const ParsedDialAppInfo& app_info) { - base::Value message_body(base::Value::Type::DICTIONARY); - message_body.SetKey("receiver", CreateReceiver(sink)); - message_body.SetKey("appState", - base::Value(DialAppStateToString(app_info.state))); - if (!app_info.extra_data.empty()) { - base::Value extra_data(base::Value::Type::DICTIONARY); - for (const auto& key_value : app_info.extra_data) - message_body.SetKey(key_value.first, base::Value(key_value.second)); - - message_body.SetKey("extraData", std::move(extra_data)); - } - return message_body; -} - -base::Value CreateDialMessageCommon(DialInternalMessageType type, - base::Value body, - const std::string& client_id) { - base::Value message(base::Value::Type::DICTIONARY); - message.SetKey("type", base::Value(DialInternalMessageTypeToString(type))); - message.SetKey("message", std::move(body)); - message.SetKey("clientId", base::Value(client_id)); - message.SetKey("sequenceNumber", base::Value(-1)); - message.SetKey("timeoutMillis", base::Value(0)); - return message; -} - } // namespace // static @@ -248,9 +173,12 @@ const CustomDialLaunchMessageBody& other) = default; CustomDialLaunchMessageBody::~CustomDialLaunchMessageBody() = default; -// static +DialInternalMessageUtil::DialInternalMessageUtil(const std::string& hash_token) + : hash_token_(hash_token) {} +DialInternalMessageUtil::~DialInternalMessageUtil() = default; + bool DialInternalMessageUtil::IsStopSessionMessage( - const DialInternalMessage& message) { + const DialInternalMessage& message) const { if (message.type != DialInternalMessageType::kV2Message) return false; @@ -263,10 +191,9 @@ return request_type && request_type->GetString() == "STOP"; } -// static mojom::RouteMessagePtr DialInternalMessageUtil::CreateNewSessionMessage( const DialLaunchInfo& launch_info, - const MediaSinkInternal& sink) { + const MediaSinkInternal& sink) const { base::Value message = CreateDialMessageCommon( DialInternalMessageType::kNewSession, CreateNewSessionBody(launch_info, sink), launch_info.client_id); @@ -276,10 +203,9 @@ return message_util::RouteMessageFromString(std::move(str)); } -// static mojom::RouteMessagePtr DialInternalMessageUtil::CreateReceiverActionCastMessage( const DialLaunchInfo& launch_info, - const MediaSinkInternal& sink) { + const MediaSinkInternal& sink) const { base::Value message = CreateDialMessageCommon( DialInternalMessageType::kReceiverAction, CreateReceiverActionBody(sink, DialReceiverAction::kCast), @@ -290,10 +216,9 @@ return message_util::RouteMessageFromString(std::move(str)); } -// static mojom::RouteMessagePtr DialInternalMessageUtil::CreateReceiverActionStopMessage( const DialLaunchInfo& launch_info, - const MediaSinkInternal& sink) { + const MediaSinkInternal& sink) const { base::Value message = CreateDialMessageCommon( DialInternalMessageType::kReceiverAction, CreateReceiverActionBody(sink, DialReceiverAction::kStop), @@ -304,12 +229,11 @@ return message_util::RouteMessageFromString(std::move(str)); } -// static std::pair<mojom::RouteMessagePtr, int> DialInternalMessageUtil::CreateCustomDialLaunchMessage( const DialLaunchInfo& launch_info, const MediaSinkInternal& sink, - const ParsedDialAppInfo& app_info) { + const ParsedDialAppInfo& app_info) const { int seq_number = GetNextDialLaunchSequenceNumber(); base::Value message = CreateDialMessageCommon( DialInternalMessageType::kCustomDialLaunch, @@ -321,4 +245,84 @@ return {message_util::RouteMessageFromString(std::move(str)), seq_number}; } +base::Value DialInternalMessageUtil::CreateReceiver( + const MediaSinkInternal& sink) const { + base::Value receiver(base::Value::Type::DICTIONARY); + + std::string label = base::SHA1HashString(sink.sink().id() + hash_token_); + base::Base64UrlEncode(label, base::Base64UrlEncodePolicy::OMIT_PADDING, + &label); + receiver.SetKey("label", base::Value(label)); + + receiver.SetKey("friendlyName", + base::Value(net::EscapeForHTML(sink.sink().name()))); + receiver.SetKey("capabilities", base::ListValue()); + receiver.SetKey("volume", base::Value(base::Value::Type::NONE)); + receiver.SetKey("isActiveInput", base::Value(base::Value::Type::NONE)); + receiver.SetKey("displayStatus", base::Value(base::Value::Type::NONE)); + + receiver.SetKey("receiverType", base::Value("dial")); + receiver.SetKey("ipAddress", + base::Value(sink.dial_data().ip_address.ToString())); + return receiver; +} + +base::Value DialInternalMessageUtil::CreateReceiverActionBody( + const MediaSinkInternal& sink, + DialReceiverAction action) const { + base::Value message_body(base::Value::Type::DICTIONARY); + message_body.SetKey("receiver", CreateReceiver(sink)); + message_body.SetKey("action", + base::Value(DialReceiverActionToString(action))); + return message_body; +} + +base::Value DialInternalMessageUtil::CreateNewSessionBody( + const DialLaunchInfo& launch_info, + const MediaSinkInternal& sink) const { + base::Value message_body(base::Value::Type::DICTIONARY); + message_body.SetKey("sessionId", base::Value(GetNextSessionId())); + message_body.SetKey("appId", base::Value("")); + message_body.SetKey("displayName", base::Value(launch_info.app_name)); + message_body.SetKey("statusText", base::Value("")); + message_body.SetKey("appImages", base::ListValue()); + message_body.SetKey("receiver", CreateReceiver(sink)); + message_body.SetKey("senderApps", base::ListValue()); + message_body.SetKey("namespaces", base::ListValue()); + message_body.SetKey("media", base::ListValue()); + message_body.SetKey("status", base::Value("connected")); + message_body.SetKey("transportId", base::Value("")); + return message_body; +} + +base::Value DialInternalMessageUtil::CreateCustomDialLaunchBody( + const MediaSinkInternal& sink, + const ParsedDialAppInfo& app_info) const { + base::Value message_body(base::Value::Type::DICTIONARY); + message_body.SetKey("receiver", CreateReceiver(sink)); + message_body.SetKey("appState", + base::Value(DialAppStateToString(app_info.state))); + if (!app_info.extra_data.empty()) { + base::Value extra_data(base::Value::Type::DICTIONARY); + for (const auto& key_value : app_info.extra_data) + message_body.SetKey(key_value.first, base::Value(key_value.second)); + + message_body.SetKey("extraData", std::move(extra_data)); + } + return message_body; +} + +base::Value DialInternalMessageUtil::CreateDialMessageCommon( + DialInternalMessageType type, + base::Value body, + const std::string& client_id) const { + base::Value message(base::Value::Type::DICTIONARY); + message.SetKey("type", base::Value(DialInternalMessageTypeToString(type))); + message.SetKey("message", std::move(body)); + message.SetKey("clientId", base::Value(client_id)); + message.SetKey("sequenceNumber", base::Value(-1)); + message.SetKey("timeoutMillis", base::Value(0)); + return message; +} + } // namespace media_router
diff --git a/chrome/browser/media/router/providers/dial/dial_internal_message_util.h b/chrome/browser/media/router/providers/dial/dial_internal_message_util.h index 5100eb9..c2da0c5 100644 --- a/chrome/browser/media/router/providers/dial/dial_internal_message_util.h +++ b/chrome/browser/media/router/providers/dial/dial_internal_message_util.h
@@ -8,6 +8,7 @@ #include <memory> #include <string> +#include "base/macros.h" #include "base/values.h" #include "chrome/browser/media/router/discovery/dial/parsed_dial_app_info.h" #include "chrome/common/media_router/mojo/media_router.mojom.h" @@ -87,36 +88,56 @@ base::Optional<std::string> launch_parameter; }; -class DialInternalMessageUtil { +class DialInternalMessageUtil final { public: + // |hash_token|: A per-profile value used to hash sink IDs. + explicit DialInternalMessageUtil(const std::string& hash_token); + ~DialInternalMessageUtil(); + // Returns |true| if |message| is a valid STOP_SESSION message. - static bool IsStopSessionMessage(const DialInternalMessage& message); + bool IsStopSessionMessage(const DialInternalMessage& message) const; // Returns a NEW_SESSION message to be sent to the page when the user requests // an app launch. - static mojom::RouteMessagePtr CreateNewSessionMessage( + mojom::RouteMessagePtr CreateNewSessionMessage( const DialLaunchInfo& launch_info, - const MediaSinkInternal& sink); + const MediaSinkInternal& sink) const; // Returns a RECEIVER_ACTION / CAST message to be sent to the page when the // user requests an app launch. - static mojom::RouteMessagePtr CreateReceiverActionCastMessage( + mojom::RouteMessagePtr CreateReceiverActionCastMessage( const DialLaunchInfo& launch_info, - const MediaSinkInternal& sink); + const MediaSinkInternal& sink) const; // Returns a RECEIVER_ACTION / STOP message to be sent to the page when an app // is stopped by DialMediaRouteProvider. - static mojom::RouteMessagePtr CreateReceiverActionStopMessage( + mojom::RouteMessagePtr CreateReceiverActionStopMessage( const DialLaunchInfo& launch_info, - const MediaSinkInternal& sink); + const MediaSinkInternal& sink) const; // Returns a CUSTOM_DIAL_LAUNCH request message to be sent to the page. // Generates and returns the next number to associate a DIAL launch sequence // with. - static std::pair<mojom::RouteMessagePtr, int> CreateCustomDialLaunchMessage( + std::pair<mojom::RouteMessagePtr, int> CreateCustomDialLaunchMessage( const DialLaunchInfo& launch_info, const MediaSinkInternal& sink, - const ParsedDialAppInfo& app_info); + const ParsedDialAppInfo& app_info) const; + + private: + base::Value CreateReceiver(const MediaSinkInternal& sink) const; + base::Value CreateReceiverActionBody(const MediaSinkInternal& sink, + DialReceiverAction action) const; + base::Value CreateNewSessionBody(const DialLaunchInfo& launch_info, + const MediaSinkInternal& sink) const; + base::Value CreateCustomDialLaunchBody( + const MediaSinkInternal& sink, + const ParsedDialAppInfo& app_info) const; + base::Value CreateDialMessageCommon(DialInternalMessageType type, + base::Value body, + const std::string& client_id) const; + + std::string hash_token_; + DISALLOW_COPY_AND_ASSIGN(DialInternalMessageUtil); }; } // namespace media_router
diff --git a/chrome/browser/media/router/providers/dial/dial_internal_message_util_unittest.cc b/chrome/browser/media/router/providers/dial/dial_internal_message_util_unittest.cc index 923cfdc..ba16c66 100644 --- a/chrome/browser/media/router/providers/dial/dial_internal_message_util_unittest.cc +++ b/chrome/browser/media/router/providers/dial/dial_internal_message_util_unittest.cc
@@ -19,7 +19,8 @@ : launch_info_("YouTube", base::nullopt, "152127444812943594", - GURL("http://172.17.32.151/app/YouTube")) { + GURL("http://172.17.32.151/app/YouTube")), + util_("hash-token") { MediaSink sink("dial:<29a400068c051073801508058128105d>", "Lab Roku", SinkIconType::GENERIC); DialSinkExtraData extra_data; @@ -41,6 +42,7 @@ protected: DialLaunchInfo launch_info_; MediaSinkInternal sink_; + DialInternalMessageUtil util_; }; TEST_F(DialInternalMessageUtilTest, ParseClientConnectMessage) { @@ -104,7 +106,7 @@ EXPECT_EQ("152127444812943594", message->client_id); EXPECT_EQ(-1, message->sequence_number); - EXPECT_TRUE(DialInternalMessageUtil::IsStopSessionMessage(*message)); + EXPECT_TRUE(util_.IsStopSessionMessage(*message)); } TEST_F(DialInternalMessageUtilTest, CreateReceiverActionCastMessage) { @@ -119,7 +121,7 @@ "friendlyName":"Lab Roku", "ipAddress":"172.17.32.151", "isActiveInput":null, - "label":"vSzzcOE6bD_NrLSbPN-qswEktGk", + "label":"vgK6BDL84IzefOLUvy2OcgFPhoo", "receiverType":"dial", "volume":null } @@ -129,8 +131,7 @@ "type":"receiver_action" })"; - auto message = DialInternalMessageUtil::CreateReceiverActionCastMessage( - launch_info_, sink_); + auto message = util_.CreateReceiverActionCastMessage(launch_info_, sink_); ASSERT_TRUE(message->message); ExpectMessagesEqual(kReceiverActionCastMessage, message->message.value()); } @@ -147,7 +148,7 @@ "friendlyName":"Lab Roku", "ipAddress":"172.17.32.151", "isActiveInput":null, - "label":"vSzzcOE6bD_NrLSbPN-qswEktGk", + "label":"vgK6BDL84IzefOLUvy2OcgFPhoo", "receiverType":"dial", "volume":null } @@ -157,8 +158,7 @@ "type":"receiver_action" })"; - auto message = DialInternalMessageUtil::CreateReceiverActionStopMessage( - launch_info_, sink_); + auto message = util_.CreateReceiverActionStopMessage(launch_info_, sink_); ASSERT_TRUE(message->message); ExpectMessagesEqual(kReceiverActionStopMessage, message->message.value()); } @@ -179,7 +179,7 @@ "friendlyName":"Lab Roku", "ipAddress":"172.17.32.151", "isActiveInput":null, - "label":"vSzzcOE6bD_NrLSbPN-qswEktGk", + "label":"vgK6BDL84IzefOLUvy2OcgFPhoo", "receiverType":"dial", "volume":null }, @@ -194,8 +194,7 @@ "type":"new_session" })"; - auto message = - DialInternalMessageUtil::CreateNewSessionMessage(launch_info_, sink_); + auto message = util_.CreateNewSessionMessage(launch_info_, sink_); ASSERT_TRUE(message->message); ExpectMessagesEqual(kNewSessionMessage, message->message.value()); } @@ -212,7 +211,7 @@ "friendlyName":"Lab Roku", "ipAddress":"172.17.32.151", "isActiveInput":null, - "label":"vSzzcOE6bD_NrLSbPN-qswEktGk", + "label":"vgK6BDL84IzefOLUvy2OcgFPhoo", "receiverType":"dial", "volume":null } @@ -225,8 +224,7 @@ ParsedDialAppInfo app_info = CreateParsedDialAppInfo("YouTube", DialAppState::kStopped); auto message_and_seq_num = - DialInternalMessageUtil::CreateCustomDialLaunchMessage(launch_info_, - sink_, app_info); + util_.CreateCustomDialLaunchMessage(launch_info_, sink_, app_info); const auto& message = message_and_seq_num.first; int seq_num = message_and_seq_num.second; ASSERT_TRUE(message->message);
diff --git a/chrome/browser/media/router/providers/dial/dial_media_route_provider.cc b/chrome/browser/media/router/providers/dial/dial_media_route_provider.cc index dda617f..66d1f51 100644 --- a/chrome/browser/media/router/providers/dial/dial_media_route_provider.cc +++ b/chrome/browser/media/router/providers/dial/dial_media_route_provider.cc
@@ -36,10 +36,12 @@ mojom::MediaRouterPtrInfo media_router, DialMediaSinkServiceImpl* media_sink_service, service_manager::Connector* connector, + const std::string& hash_token, const scoped_refptr<base::SequencedTaskRunner>& task_runner) : binding_(this), media_sink_service_(media_sink_service), data_decoder_(std::make_unique<DataDecoder>(connector)), + internal_message_util_(hash_token), weak_ptr_factory_(this) { DETACH_FROM_SEQUENCE(sequence_checker_); DCHECK(media_sink_service_); @@ -119,10 +121,9 @@ // the Cast SDK to complete the launch sequence. The first messages that the // MRP needs to send are the RECEIVER_ACTION and NEW_SESSION. std::vector<mojom::RouteMessagePtr> messages; - messages.emplace_back( - DialInternalMessageUtil::CreateReceiverActionCastMessage( - activity->launch_info, *sink)); - messages.emplace_back(DialInternalMessageUtil::CreateNewSessionMessage( + messages.emplace_back(internal_message_util_.CreateReceiverActionCastMessage( + activity->launch_info, *sink)); + messages.emplace_back(internal_message_util_.CreateNewSessionMessage( activity->launch_info, *sink)); DVLOG(2) << "Sending RECEIVER_ACTION and NEW_SESSION for route " << route_id; message_sender_->SendMessages(route_id, std::move(messages)); @@ -231,7 +232,7 @@ } else if (internal_message->type == DialInternalMessageType::kCustomDialLaunch) { HandleCustomDialLaunchResponse(*activity, *internal_message); - } else if (DialInternalMessageUtil::IsStopSessionMessage(*internal_message)) { + } else if (internal_message_util_.IsStopSessionMessage(*internal_message)) { DoTerminateRoute(*activity, *sink, base::DoNothing()); } } @@ -278,7 +279,7 @@ } auto message_and_seq_number = - DialInternalMessageUtil::CreateCustomDialLaunchMessage( + internal_message_util_.CreateCustomDialLaunchMessage( activity->launch_info, *sink, *result.app_info); pending_dial_launches_.insert(message_and_seq_number.second); if (pending_dial_launches_.size() > kMaxPendingDialLaunches) { @@ -323,9 +324,8 @@ const MediaRoute::Id& route_id = activity.route.media_route_id(); DVLOG(2) << "Terminating route " << route_id; std::vector<mojom::RouteMessagePtr> messages; - messages.emplace_back( - DialInternalMessageUtil::CreateReceiverActionStopMessage( - activity.launch_info, sink)); + messages.emplace_back(internal_message_util_.CreateReceiverActionStopMessage( + activity.launch_info, sink)); message_sender_->SendMessages(route_id, std::move(messages)); activity_manager_->StopApp( route_id,
diff --git a/chrome/browser/media/router/providers/dial/dial_media_route_provider.h b/chrome/browser/media/router/providers/dial/dial_media_route_provider.h index 4467c89..31e53ce 100644 --- a/chrome/browser/media/router/providers/dial/dial_media_route_provider.h +++ b/chrome/browser/media/router/providers/dial/dial_media_route_provider.h
@@ -51,12 +51,14 @@ // |media_router|: Pointer to MediaRouter. // |media_sink_service|: DIAL MediaSinkService providing information on sinks. // |connector|: Connector object for accessing data_decoder services. + // |hash_token|: A per-profile value used to hash sink IDs. // |task_runner|: The task runner on which |this| runs. DialMediaRouteProvider( mojom::MediaRouteProviderRequest request, mojom::MediaRouterPtrInfo media_router, DialMediaSinkServiceImpl* media_sink_service, service_manager::Connector* connector, + const std::string& hash_token, const scoped_refptr<base::SequencedTaskRunner>& task_runner); ~DialMediaRouteProvider() override; @@ -200,6 +202,8 @@ // Used for parsing Custom DIAL launch JSON messages. std::unique_ptr<DataDecoder> data_decoder_; + DialInternalMessageUtil internal_message_util_; + SEQUENCE_CHECKER(sequence_checker_); base::WeakPtrFactory<DialMediaRouteProvider> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(DialMediaRouteProvider);
diff --git a/chrome/browser/media/router/providers/dial/dial_media_route_provider_unittest.cc b/chrome/browser/media/router/providers/dial/dial_media_route_provider_unittest.cc index 7266cc3c..54dc1d1 100644 --- a/chrome/browser/media/router/providers/dial/dial_media_route_provider_unittest.cc +++ b/chrome/browser/media/router/providers/dial/dial_media_route_provider_unittest.cc
@@ -98,7 +98,7 @@ EXPECT_CALL(mock_router_, OnSinkAvailabilityUpdated(_, _)); provider_ = std::make_unique<DialMediaRouteProvider>( mojo::MakeRequest(&provider_ptr_), router_ptr.PassInterface(), - &mock_sink_service_, connector_.get(), + &mock_sink_service_, connector_.get(), "hash-token", base::SequencedTaskRunnerHandle::Get()); auto activity_manager =
diff --git a/chrome/browser/media/webrtc/webrtc_audio_quality_browsertest.cc b/chrome/browser/media/webrtc/webrtc_audio_quality_browsertest.cc index 5d06a0d..bf45007 100644 --- a/chrome/browser/media/webrtc/webrtc_audio_quality_browsertest.cc +++ b/chrome/browser/media/webrtc/webrtc_audio_quality_browsertest.cc
@@ -66,8 +66,7 @@ 200; #endif -// Temporarily disabled on Win (https://crbug.com/850936). -#if defined(OS_LINUX) || defined(OS_MACOSX) +#if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MACOSX) #define MAYBE_WebRtcAudioQualityBrowserTest WebRtcAudioQualityBrowserTest #else // Not implemented on Android, ChromeOS etc.
diff --git a/chrome/browser/memory_details.cc b/chrome/browser/memory_details.cc index abd72f75..4fd1022 100644 --- a/chrome/browser/memory_details.cc +++ b/chrome/browser/memory_details.cc
@@ -197,9 +197,9 @@ // the process is being launched, so we skip it. for (BrowserChildProcessHostIterator iter; !iter.Done(); ++iter) { ProcessMemoryInformation info; - if (!iter.GetData().handle) + if (!iter.GetData().GetHandle()) continue; - info.pid = base::GetProcId(iter.GetData().handle); + info.pid = base::GetProcId(iter.GetData().GetHandle()); if (!info.pid) continue;
diff --git a/chrome/browser/metrics/android_metrics_provider.cc b/chrome/browser/metrics/android_metrics_provider.cc index a46cc7e..1cdf66f 100644 --- a/chrome/browser/metrics/android_metrics_provider.cc +++ b/chrome/browser/metrics/android_metrics_provider.cc
@@ -4,18 +4,31 @@ #include "chrome/browser/metrics/android_metrics_provider.h" +#include "jni/NotificationSystemStatusUtil_jni.h" + #include "base/metrics/histogram_macros.h" #include "base/sys_info.h" #include "chrome/browser/android/feature_utilities.h" namespace { +// Corresponds to APP_NOTIFICATIONS_STATUS_BOUNDARY in +// NotificationSystemStatusUtil.java +const int kAppNotificationStatusBoundary = 3; + void EmitLowRamDeviceHistogram() { // Equivalent to UMA_HISTOGRAM_BOOLEAN with the stability flag set. UMA_STABILITY_HISTOGRAM_ENUMERATION( "MemoryAndroid.LowRamDevice", base::SysInfo::IsLowEndDevice() ? 1 : 0, 2); } +void EmitAppNotificationStatusHistogram() { + auto status = Java_NotificationSystemStatusUtil_getAppNotificationStatus( + base::android::AttachCurrentThread()); + UMA_HISTOGRAM_ENUMERATION("Android.AppNotificationStatus", status, + kAppNotificationStatusBoundary); +} + } // namespace AndroidMetricsProvider::AndroidMetricsProvider() {} @@ -41,4 +54,5 @@ UMA_HISTOGRAM_BOOLEAN( "Android.MultiWindowMode.Active", chrome::android::GetIsInMultiWindowModeValue()); + EmitAppNotificationStatusHistogram(); }
diff --git a/chrome/browser/metrics/android_metrics_provider_unittest.cc b/chrome/browser/metrics/android_metrics_provider_unittest.cc new file mode 100644 index 0000000..bd27569 --- /dev/null +++ b/chrome/browser/metrics/android_metrics_provider_unittest.cc
@@ -0,0 +1,43 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/metrics/android_metrics_provider.h" + +#include "base/test/metrics/histogram_tester.h" +#include "testing/gtest/include/gtest/gtest.h" + +class AndroidMetricsProviderTest : public testing::Test { + public: + AndroidMetricsProviderTest() = default; + ~AndroidMetricsProviderTest() override = default; + + protected: + base::HistogramTester histogram_tester_; + AndroidMetricsProvider metrics_provider_; +}; + +TEST_F(AndroidMetricsProviderTest, ProvidePreviousSessionData_IsLowRamDevice) { + metrics_provider_.ProvidePreviousSessionData(nullptr /* uma_proto */); + histogram_tester_.ExpectTotalCount("MemoryAndroid.LowRamDevice", 1); +} + +TEST_F(AndroidMetricsProviderTest, ProvideCurrentSessionData_IsLowRamDevice) { + metrics_provider_.ProvideCurrentSessionData(nullptr /* uma_proto */); + histogram_tester_.ExpectTotalCount("MemoryAndroid.LowRamDevice", 1); +} + +TEST_F(AndroidMetricsProviderTest, ProvideCurrentSessionData_CustomTabs) { + metrics_provider_.ProvideCurrentSessionData(nullptr /* uma_proto */); + histogram_tester_.ExpectTotalCount("CustomTabs.Visible", 1); +} + +TEST_F(AndroidMetricsProviderTest, ProvideCurrentSessionData_MultiWindowMode) { + metrics_provider_.ProvideCurrentSessionData(nullptr /* uma_proto */); + histogram_tester_.ExpectTotalCount("Android.MultiWindowMode.Active", 1); +} + +TEST_F(AndroidMetricsProviderTest, ProvideCurrentSessionData_AppNotifications) { + metrics_provider_.ProvideCurrentSessionData(nullptr /* uma_proto */); + histogram_tester_.ExpectTotalCount("Android.AppNotificationStatus", 1); +}
diff --git a/chrome/browser/net/network_request_metrics_browsertest.cc b/chrome/browser/net/network_request_metrics_browsertest.cc index e07089d..31a803b 100644 --- a/chrome/browser/net/network_request_metrics_browsertest.cc +++ b/chrome/browser/net/network_request_metrics_browsertest.cc
@@ -31,6 +31,7 @@ #include "content/public/test/test_navigation_observer.h" #include "net/base/filename_util.h" #include "net/base/net_errors.h" +#include "net/http/http_response_info.h" #include "net/test/embedded_test_server/controllable_http_response.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "testing/gtest/include/gtest/gtest.h" @@ -54,6 +55,16 @@ kScript, }; +enum class HeadersReceived { + kHeadersReceived, + kNoHeadersReceived, +}; + +enum class NetworkAccessed { + kNetworkAccessed, + kNoNetworkAccessed, +}; + // Utility class to wait until the main resource load is complete. This is to // make sure, in the cancel tests, the main resource is fully loaded before the // navigation is cancelled, to ensure the main frame load histograms are in a @@ -159,19 +170,35 @@ // Checks all relevant histograms. |expected_net_error| is the expected result // of the RequestType specified by the test parameter. - void CheckHistograms(int expected_net_error) { + void CheckHistograms(int expected_net_error, + HeadersReceived headers_received, + NetworkAccessed network_accessed) { // Some metrics may come from the renderer. This call ensures that those - // metrics are availble. + // metrics are available. SubprocessMetricsProvider::MergeHistogramDeltasForTesting(); if (GetParam() == RequestType::kMainFrame) { - // Can't check Net.ErrorCodesForSubresources3, due to the favicon, which - // Chrome may or may not have attempted to load. - EXPECT_EQ(0u, - histograms_->GetAllSamples("Net.ErrorCodesForImages2").size()); + histograms_->ExpectTotalCount("Net.ErrorCodesForImages2", 0); histograms_->ExpectUniqueSample("Net.ErrorCodesForMainFrame4", -expected_net_error, 1); + + if (headers_received == HeadersReceived::kHeadersReceived) { + histograms_->ExpectUniqueSample( + "Net.ConnectionInfo.MainFrame", + net::HttpResponseInfo::CONNECTION_INFO_HTTP1_1, 1); + } else { + histograms_->ExpectTotalCount("Net.ConnectionInfo.MainFrame", 0); + } + + // Favicon may or may not have been loaded. + EXPECT_GE( + 1u, + histograms_->GetAllSamples("Net.ErrorCodesForSubresources3").size()); + EXPECT_GE( + 1u, + histograms_->GetAllSamples("Net.ConnectionInfo.SubResource").size()); + return; } @@ -202,12 +229,31 @@ EXPECT_TRUE(found_expected_load); if (GetParam() != RequestType::kImage) { - EXPECT_EQ(0u, - histograms_->GetAllSamples("Net.ErrorCodesForImages2").size()); + histograms_->ExpectTotalCount("Net.ErrorCodesForImages2", 0); } else { histograms_->ExpectUniqueSample("Net.ErrorCodesForImages2", -expected_net_error, 1); } + + // A subresource load requires a main frame load, which is only logged for + // network URLs. + if (network_accessed == NetworkAccessed::kNetworkAccessed) { + histograms_->ExpectUniqueSample( + "Net.ConnectionInfo.MainFrame", + net::HttpResponseInfo::CONNECTION_INFO_HTTP1_1, 1); + if (headers_received == HeadersReceived::kHeadersReceived) { + histograms_->ExpectUniqueSample( + "Net.ConnectionInfo.SubResource", + net::HttpResponseInfo::CONNECTION_INFO_HTTP1_1, + found_favicon_load ? 2 : 1); + } else { + histograms_->ExpectTotalCount("Net.ConnectionInfo.SubResource", 0); + } + } else { + histograms_->ExpectTotalCount("Net.ConnectionInfo.MainFrame", 0); + histograms_->ExpectTotalCount("Net.ConnectionInfo.SubResource", + found_favicon_load ? 1 : 0); + } } // Checks all relevant histograms in the case a new main frame navigation @@ -215,17 +261,15 @@ // to fail with net::ERR_ABORTED. void CheckHistogramsAfterMainFrameInterruption() { // Some metrics may come from the renderer. This call ensures that those - // metrics are availble. + // metrics are available. SubprocessMetricsProvider::MergeHistogramDeltasForTesting(); if (GetParam() == RequestType::kMainFrame) { // Can't check Net.ErrorCodesForSubresources3, due to the favicon, which // Chrome may or may not have attempted to load. - EXPECT_EQ(0u, - histograms_->GetAllSamples("Net.ErrorCodesForImages2").size()); + histograms_->ExpectTotalCount("Net.ErrorCodesForImages2", 0); - EXPECT_EQ( - 2u, histograms_->GetAllSamples("Net.ErrorCodesForMainFrame4").size()); + histograms_->ExpectTotalCount("Net.ErrorCodesForMainFrame4", 2); EXPECT_EQ(1, histograms_->GetBucketCount("Net.ErrorCodesForMainFrame4", -net::ERR_ABORTED)); EXPECT_EQ(1, histograms_->GetBucketCount("Net.ErrorCodesForMainFrame4", @@ -260,8 +304,7 @@ EXPECT_TRUE(found_expected_load); if (GetParam() != RequestType::kImage) { - EXPECT_EQ(0u, - histograms_->GetAllSamples("Net.ErrorCodesForImages2").size()); + histograms_->ExpectTotalCount("Net.ErrorCodesForImages2", 0); } else { histograms_->ExpectUniqueSample("Net.ErrorCodesForImages2", -net::ERR_ABORTED, 1); @@ -317,7 +360,8 @@ interesting_http_response()->Done(); navigation_observer.Wait(); - CheckHistograms(net::ERR_EMPTY_RESPONSE); + CheckHistograms(net::ERR_EMPTY_RESPONSE, HeadersReceived::kNoHeadersReceived, + NetworkAccessed::kNetworkAccessed); } IN_PROC_BROWSER_TEST_P(NetworkRequestMetricsBrowserTest, NetErrorDuringBody) { @@ -327,7 +371,9 @@ interesting_http_response()->Done(); navigation_observer.Wait(); - CheckHistograms(net::ERR_CONTENT_LENGTH_MISMATCH); + CheckHistograms(net::ERR_CONTENT_LENGTH_MISMATCH, + HeadersReceived::kHeadersReceived, + NetworkAccessed::kNetworkAccessed); } IN_PROC_BROWSER_TEST_P(NetworkRequestMetricsBrowserTest, CancelBeforeHeaders) { @@ -336,7 +382,8 @@ active_web_contents()->Stop(); navigation_observer.Wait(); - CheckHistograms(net::ERR_ABORTED); + CheckHistograms(net::ERR_ABORTED, HeadersReceived::kNoHeadersReceived, + NetworkAccessed::kNetworkAccessed); } IN_PROC_BROWSER_TEST_P(NetworkRequestMetricsBrowserTest, CancelDuringBody) { @@ -355,7 +402,8 @@ active_web_contents()->Stop(); navigation_observer.Wait(); - CheckHistograms(net::ERR_ABORTED); + CheckHistograms(net::ERR_ABORTED, HeadersReceived::kHeadersReceived, + NetworkAccessed::kNetworkAccessed); } IN_PROC_BROWSER_TEST_P(NetworkRequestMetricsBrowserTest, @@ -407,7 +455,8 @@ interesting_http_response()->Done(); navigation_observer.Wait(); - CheckHistograms(net::OK); + CheckHistograms(net::OK, HeadersReceived::kHeadersReceived, + NetworkAccessed::kNetworkAccessed); } IN_PROC_BROWSER_TEST_P(NetworkRequestMetricsBrowserTest, SuccessWithEmptyBody) { @@ -418,7 +467,8 @@ interesting_http_response()->Done(); navigation_observer.Wait(); - CheckHistograms(net::OK); + CheckHistograms(net::OK, HeadersReceived::kHeadersReceived, + NetworkAccessed::kNetworkAccessed); } // Downloads should not be logged (Either as successes or failures). @@ -453,17 +503,21 @@ download_test_observer_terminal.WaitForFinished(); // Some metrics may come from the renderer. This call ensures that those - // metrics are availble. + // metrics are available. SubprocessMetricsProvider::MergeHistogramDeltasForTesting(); if (GetParam() == RequestType::kMainFrame) { - // Can't check Net.ErrorCodesForSubresources3, due to the favicon, which - // Chrome may or may not have attempted to load. - EXPECT_EQ(0u, - histograms()->GetAllSamples("Net.ErrorCodesForImages2").size()); + histograms()->ExpectTotalCount("Net.ErrorCodesForImages2", 0); + histograms()->ExpectTotalCount("Net.ErrorCodesForMainFrame4", 0); + histograms()->ExpectTotalCount("Net.ConnectionInfo.MainFrame", 0); + // Favicon may or may not have been loaded. + EXPECT_GE( + 1u, + histograms()->GetAllSamples("Net.ErrorCodesForSubresources3").size()); + EXPECT_GE( + 1u, + histograms()->GetAllSamples("Net.ConnectionInfo.SubResource").size()); - EXPECT_EQ( - 0u, histograms()->GetAllSamples("Net.ErrorCodesForMainFrame4").size()); return; } @@ -486,6 +540,17 @@ EXPECT_EQ(0, bucket.count) << "Found unexpected load with result: " << bucket.min; } + + histograms()->ExpectUniqueSample( + "Net.ConnectionInfo.MainFrame", + net::HttpResponseInfo::CONNECTION_INFO_HTTP1_1, 1); + if (found_favicon_load) { + histograms()->ExpectUniqueSample( + "Net.ConnectionInfo.SubResource", + net::HttpResponseInfo::CONNECTION_INFO_HTTP1_1, 1); + } else { + histograms()->ExpectTotalCount("Net.ConnectionInfo.SubResource", 0); + } } // A few tests for file:// URLs, so that URLs not handled by the network service @@ -506,7 +571,8 @@ ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(main_frame_path)); - CheckHistograms(net::ERR_FILE_NOT_FOUND); + CheckHistograms(net::ERR_FILE_NOT_FOUND, HeadersReceived::kNoHeadersReceived, + NetworkAccessed::kNoNetworkAccessed); } IN_PROC_BROWSER_TEST_P(NetworkRequestMetricsBrowserTest, FileURLSuccess) { @@ -533,7 +599,8 @@ ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(main_frame_path)); - CheckHistograms(net::OK); + CheckHistograms(net::OK, HeadersReceived::kNoHeadersReceived, + NetworkAccessed::kNoNetworkAccessed); } INSTANTIATE_TEST_CASE_P(,
diff --git a/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc b/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc index 5aafd721..64abf40 100644 --- a/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc +++ b/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
@@ -48,10 +48,11 @@ #include "content/public/common/url_constants.h" #include "content/public/test/navigation_simulator.h" #include "content/public/test/web_contents_tester.h" -#include "mojo/public/cpp/bindings/binding.h" +#include "mojo/public/cpp/bindings/associated_binding.h" #include "services/service_manager/public/cpp/interface_provider.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" #include "url/url_constants.h" #if BUILDFLAG(ENABLE_EXTENSIONS) @@ -128,9 +129,9 @@ ~FakePasswordAutofillAgent() override {} - void BindRequest(mojo::ScopedMessagePipeHandle handle) { - binding_.Bind( - autofill::mojom::PasswordAutofillAgentRequest(std::move(handle))); + void BindRequest(mojo::ScopedInterfaceEndpointHandle handle) { + binding_.Bind(autofill::mojom::PasswordAutofillAgentAssociatedRequest( + std::move(handle))); } bool called_set_logging_state() { return called_set_logging_state_; } @@ -168,7 +169,7 @@ // Records data received via SetLoggingState() call. bool logging_state_active_; - mojo::Binding<autofill::mojom::PasswordAutofillAgent> binding_; + mojo::AssociatedBinding<autofill::mojom::PasswordAutofillAgent> binding_; }; } // namespace @@ -225,12 +226,12 @@ void ChromePasswordManagerClientTest::SetUp() { ChromeRenderViewHostTestHarness::SetUp(); - service_manager::InterfaceProvider* remote_interfaces = - web_contents()->GetMainFrame()->GetRemoteInterfaces(); - service_manager::InterfaceProvider::TestApi test_api(remote_interfaces); - test_api.SetBinderForName(autofill::mojom::PasswordAutofillAgent::Name_, - base::Bind(&FakePasswordAutofillAgent::BindRequest, - base::Unretained(&fake_agent_))); + blink::AssociatedInterfaceProvider* remote_interfaces = + web_contents()->GetMainFrame()->GetRemoteAssociatedInterfaces(); + remote_interfaces->OverrideBinderForTesting( + autofill::mojom::PasswordAutofillAgent::Name_, + base::BindRepeating(&FakePasswordAutofillAgent::BindRequest, + base::Unretained(&fake_agent_))); prefs_.registry()->RegisterBooleanPref( password_manager::prefs::kCredentialsEnableService, true);
diff --git a/chrome/browser/password_manager/password_store_factory.cc b/chrome/browser/password_manager/password_store_factory.cc index a728e875..3581fe5 100644 --- a/chrome/browser/password_manager/password_store_factory.cc +++ b/chrome/browser/password_manager/password_store_factory.cc
@@ -24,6 +24,7 @@ #include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/os_crypt/os_crypt_switches.h" #include "components/password_manager/core/browser/login_database.h" +#include "components/password_manager/core/browser/password_manager_constants.h" #include "components/password_manager/core/browser/password_manager_util.h" #include "components/password_manager/core/browser/password_reuse_defines.h" #include "components/password_manager/core/browser/password_store.h" @@ -65,8 +66,10 @@ namespace { #if defined(USE_X11) -const LocalProfileId kInvalidLocalProfileId = +constexpr LocalProfileId kInvalidLocalProfileId = static_cast<LocalProfileId>(0); +constexpr PasswordStoreX::MigrationToLoginDBStep + kMigrationToLoginDBNotAttempted = PasswordStoreX::NOT_ATTEMPTED; #endif #if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) @@ -253,8 +256,10 @@ " for more information about password storage options."; } - login_db->disable_encryption(); - ps = new PasswordStoreX(std::move(login_db), std::move(backend)); + ps = new PasswordStoreX( + std::move(login_db), + profile->GetPath().Append(password_manager::kSecondLoginDataFileName), + std::move(backend), prefs); RecordBackendStatistics(desktop_env, store_type, used_backend); #elif defined(USE_OZONE) ps = new password_manager::PasswordStoreDefault(std::move(login_db)); @@ -296,6 +301,9 @@ // result in using PasswordStoreX in BuildServiceInstanceFor(). registry->RegisterIntegerPref(password_manager::prefs::kLocalProfileId, kInvalidLocalProfileId); + registry->RegisterIntegerPref( + password_manager::prefs::kMigrationToLoginDBStep, + kMigrationToLoginDBNotAttempted); #endif }
diff --git a/chrome/browser/password_manager/password_store_x.cc b/chrome/browser/password_manager/password_store_x.cc index 6ef3c151..7502744 100644 --- a/chrome/browser/password_manager/password_store_x.cc +++ b/chrome/browser/password_manager/password_store_x.cc
@@ -10,11 +10,14 @@ #include <vector> #include "base/bind.h" +#include "base/files/file_util.h" #include "base/logging.h" +#include "base/memory/weak_ptr.h" #include "base/stl_util.h" #include "chrome/browser/chrome_notification_types.h" #include "components/password_manager/core/browser/password_manager_util.h" #include "components/password_manager/core/browser/password_store_change.h" +#include "components/password_manager/core/common/password_manager_features.h" #include "components/password_manager/core/common/password_manager_pref_names.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/pref_service.h" @@ -56,15 +59,31 @@ return true; } +// Disables encryption for |login_db| and returns it. +std::unique_ptr<password_manager::LoginDatabase> DisableEncryption( + std::unique_ptr<password_manager::LoginDatabase> login_db) { + login_db->disable_encryption(); + return login_db; +} + } // namespace PasswordStoreX::PasswordStoreX( std::unique_ptr<password_manager::LoginDatabase> login_db, - std::unique_ptr<NativeBackend> backend) - : PasswordStoreDefault(std::move(login_db)), + base::FilePath encrypted_login_db_file, + std::unique_ptr<NativeBackend> backend, + PrefService* prefs) + : PasswordStoreDefault(DisableEncryption(std::move(login_db))), backend_(std::move(backend)), + encrypted_login_db_file_(std::move(encrypted_login_db_file)), migration_checked_(false), - allow_fallback_(false) {} + allow_fallback_(false), + weak_ptr_factory_(this) { + migration_step_pref_.Init(password_manager::prefs::kMigrationToLoginDBStep, + prefs); + migration_to_login_db_step_ = + static_cast<MigrationToLoginDBStep>(migration_step_pref_.GetValue()); +} PasswordStoreX::~PasswordStoreX() {} @@ -115,8 +134,8 @@ base::Time delete_begin, base::Time delete_end) { CheckMigration(); - PasswordStoreChangeList changes; + PasswordStoreChangeList changes; if (use_native_backend() && RemoveLoginsByURLAndTimeFromBackend(backend_.get(), url_filter, delete_begin, delete_end, &changes)) { @@ -247,23 +266,85 @@ void PasswordStoreX::CheckMigration() { DCHECK(background_task_runner()->RunsTasksInCurrentSequence()); + if (migration_checked_ || !backend_.get()) return; migration_checked_ = true; - ssize_t migrated = MigrateLogins(); - if (migrated > 0) { - VLOG(1) << "Migrated " << migrated << " passwords to native store."; - } else if (migrated == 0) { - // As long as we are able to migrate some passwords, we know the native - // store is working. But if there is nothing to migrate, the "migration" - // can succeed even when the native store would fail. In this case we - // allow a later fallback to the default store. Once any later operation - // succeeds on the native store, we will no longer allow fallback. - allow_fallback_ = true; - } else { - LOG(WARNING) << "Native password store migration failed! " << - "Falling back on default (unencrypted) store."; - backend_.reset(); + + // Copy everything from LoginDB (unencrypted) to the native backend if + // migration to encryption is not enabled or if it hasn't succeeded yet. + if (!base::FeatureList::IsEnabled( + password_manager::features::kMigrateLinuxToLoginDB) || + migration_to_login_db_step_ == NOT_ATTEMPTED || + migration_to_login_db_step_ == FAILED) { + ssize_t migrated = MigrateToNativeBackend(); + + if (migrated > 0) { + VLOG(1) << "Migrated " << migrated << " passwords to native store."; + } else if (migrated == 0) { + // As long as we are able to migrate some passwords, we know the native + // store is working. But if there is nothing to migrate, the "migration" + // can succeed even when the native store would fail. In this case we + // allow a later fallback to the default store. Once any later operation + // succeeds on the native store, we will no longer allow fallback. + allow_fallback_ = true; + } else { + LOG(WARNING) << "Native password store migration failed! " + << "Falling back on default (unencrypted) store."; + backend_.reset(); + } + } + + if (base::FeatureList::IsEnabled( + password_manager::features::kMigrateLinuxToLoginDB) && + backend_) { + // Clear the location of the encrypted login database, if it's not the + // result of a successful migration. + if (migration_to_login_db_step_ == NOT_ATTEMPTED || + migration_to_login_db_step_ == FAILED) + base::DeleteFile(encrypted_login_db_file_, false); + + auto encrypted_login_db = std::make_unique<password_manager::LoginDatabase>( + encrypted_login_db_file_); + if (!encrypted_login_db->Init()) { + VLOG(1) << "Failed to init the encrypted database file. Migration " + "aborted."; + // If the migration wasn't already performed, just serve from the native + // backend. + if (migration_to_login_db_step_ != COPIED_ALL) + return; + // When the database file is corrupted, a null reference will make + // PasswordStoreDefault skip all actions on it. + encrypted_login_db.reset(); + } + + // Copy the data, if this wasn't done before. + if (migration_to_login_db_step_ == NOT_ATTEMPTED || + migration_to_login_db_step_ == FAILED) { + // TODO(crbug.com/571003) If we fail, back off and retry at a different + // opportunity. + VLOG(1) + << "Migrating all passwords to the encrypted database. Last status: " + << migration_to_login_db_step_; + migration_to_login_db_step_ = MigrateToLoginDB(encrypted_login_db.get()); + main_task_runner()->PostTask( + FROM_HERE, base::BindOnce(&PasswordStoreX::UpdateMigrationToLoginStep, + weak_ptr_factory_.GetWeakPtr(), + migration_to_login_db_step_)); + if (migration_to_login_db_step_ == FAILED) { + VLOG(1) << "Migration to encryption failed."; + base::DeleteFile(encrypted_login_db_file_, false); + } + } + + // If the data is in the encrypted login database, serve from it. + if (migration_to_login_db_step_ == COPIED_ALL) { + // If there is no |backend_|, PasswordStoreX will use the + // PasswordStoreDefault behaviour. + PasswordStoreDefault::SetLoginDB(std::move(encrypted_login_db)); + backend_.reset(); + VLOG(1) << "Serving passwords from the temporary encrypted database"; + } } } @@ -278,7 +359,7 @@ return !backend_.get(); } -ssize_t PasswordStoreX::MigrateLogins() { +ssize_t PasswordStoreX::MigrateToNativeBackend() { DCHECK(backend_.get()); std::vector<std::unique_ptr<PasswordForm>> forms; std::vector<std::unique_ptr<PasswordForm>> blacklist_forms; @@ -320,3 +401,36 @@ ssize_t result = ok ? forms.size() : -1; return result; } + +PasswordStoreX::MigrationToLoginDBStep PasswordStoreX::MigrateToLoginDB( + password_manager::LoginDatabase* login_db) { + DCHECK(backend_); + DCHECK(login_db); + + if (!login_db->DeleteAndRecreateDatabaseFile()) { + LOG(ERROR) << "Failed to create the encrypted login database file"; + return FAILED; + } + + std::vector<std::unique_ptr<PasswordForm>> forms; + if (!backend_->GetAllLogins(&forms)) + return FAILED; + + for (auto& form : forms) { + PasswordStoreChangeList changes = login_db->AddLogin(*form); + if (changes.empty() || changes.back().type() != PasswordStoreChange::ADD) { + return FAILED; + } + } + + return COPIED_ALL; +} + +void PasswordStoreX::UpdateMigrationToLoginStep(MigrationToLoginDBStep step) { + migration_step_pref_.SetValue(step); +} + +void PasswordStoreX::ShutdownOnUIThread() { + migration_step_pref_.Destroy(); + PasswordStoreDefault::ShutdownOnUIThread(); +}
diff --git a/chrome/browser/password_manager/password_store_x.h b/chrome/browser/password_manager/password_store_x.h index 88740446..6ba57ffa 100644 --- a/chrome/browser/password_manager/password_store_x.h +++ b/chrome/browser/password_manager/password_store_x.h
@@ -8,12 +8,14 @@ #include <stddef.h> #include <memory> +#include <string> #include <vector> #include "base/macros.h" #include "base/sequenced_task_runner.h" #include "base/time/time.h" #include "components/password_manager/core/browser/password_store_default.h" +#include "components/prefs/pref_member.h" namespace password_manager { class LoginDatabase; @@ -28,6 +30,17 @@ // There are currently native backends for GNOME Keyring and KWallet. class PasswordStoreX : public password_manager::PasswordStoreDefault { public: + // The state of the migration from native backends and an unencrypted loginDB + // to an encrypted loginDB. + enum MigrationToLoginDBStep { + // Neither started nor failed. + NOT_ATTEMPTED = 0, + // The last attempt was not completed. + FAILED, + // All the data is in the temporary encrypted loginDB. + COPIED_ALL, + }; + // NativeBackends more or less implement the PaswordStore interface, but // with return values rather than implicit consumer notification. class NativeBackend { @@ -91,9 +104,16 @@ }; // |backend| may be NULL in which case this PasswordStoreX will act the same - // as PasswordStoreDefault. + // as PasswordStoreDefault. |login_db| is the default location and does not + // use encryption. |encrypted_login_db_file| is a separate file and is used + // for the migration to encryption. PasswordStoreX(std::unique_ptr<password_manager::LoginDatabase> login_db, - std::unique_ptr<NativeBackend> backend); + base::FilePath encrypted_login_db_file, + std::unique_ptr<NativeBackend> backend, + PrefService* prefs); + + // RefcountedKeyedService: + void ShutdownOnUIThread() override; private: friend class PasswordStoreXTest; @@ -130,7 +150,12 @@ bool FillBlacklistLogins( std::vector<std::unique_ptr<autofill::PasswordForm>>* forms) override; - // Check to see whether migration is necessary, and perform it if so. + // Check to see whether migration from the unencrypted loginDB is necessary, + // and perform it if so. Additionally, if the migration to encryption is + // enabled, then the passwords will also be copied into the encrypted login + // database and PasswordStoreX will serve from there. If this migration was + // completed in a previous run, CheckMigration will simply enable serving from + // the encrypted login database. void CheckMigration(); // Return true if we should try using the native backend. @@ -140,14 +165,26 @@ // time we call it when falling back is necessary. See |allow_fallback_|. bool allow_default_store(); - // Synchronously migrates all the passwords stored in the login database to - // the native backend. If successful, the login database will be left with no - // stored passwords, and the number of passwords migrated will be returned. - // (This might be 0 if migration was not necessary.) Returns < 0 on failure. - ssize_t MigrateLogins(); + // Synchronously migrates all the passwords stored in the login database + // (PasswordStoreDefault) to the native backend. If successful, the login + // database will be left with no stored passwords, and the number of passwords + // migrated will be returned. (This might be 0 if migration was not + // necessary.) Returns < 0 on failure. + ssize_t MigrateToNativeBackend(); + + // Synchronously copies everything from the |backend_| to |login_db|. Returns + // COPIED_ALL on success and FAILED on error. + MigrationToLoginDBStep MigrateToLoginDB( + password_manager::LoginDatabase* login_db); + + // Update |migration_step_pref_|. It must be executed on the preference's + // thread. + void UpdateMigrationToLoginStep(MigrationToLoginDBStep step); // The native backend in use, or NULL if none. std::unique_ptr<NativeBackend> backend_; + // A second login database, which will hold encrypted values during migration. + const base::FilePath encrypted_login_db_file_; // Whether we have already attempted migration to the native store. bool migration_checked_; // Whether we should allow falling back to the default store. If there is @@ -155,6 +192,12 @@ // be the first time we try to use it and we should allow falling back. If // we have migrated successfully, then we do not allow falling back. bool allow_fallback_; + // Tracks the last completed step in the migration from the native backends to + // LoginDB. + IntegerPrefMember migration_step_pref_; + MigrationToLoginDBStep migration_to_login_db_step_ = NOT_ATTEMPTED; + + base::WeakPtrFactory<PasswordStoreX> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(PasswordStoreX); };
diff --git a/chrome/browser/password_manager/password_store_x_unittest.cc b/chrome/browser/password_manager/password_store_x_unittest.cc index 26c1b9b1..590a402 100644 --- a/chrome/browser/password_manager/password_store_x_unittest.cc +++ b/chrome/browser/password_manager/password_store_x_unittest.cc
@@ -17,6 +17,7 @@ #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" +#include "base/test/scoped_feature_list.h" #include "base/test/scoped_task_environment.h" #include "base/time/time.h" #include "chrome/test/base/testing_browser_process.h" @@ -25,8 +26,11 @@ #include "components/password_manager/core/browser/password_store_change.h" #include "components/password_manager/core/browser/password_store_consumer.h" #include "components/password_manager/core/browser/password_store_origin_unittest.h" +#include "components/password_manager/core/common/password_manager_features.h" #include "components/password_manager/core/common/password_manager_pref_names.h" +#include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" +#include "components/prefs/testing_pref_service.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -36,6 +40,8 @@ using password_manager::UnorderedPasswordFormElementsAre; using testing::ElementsAreArray; using testing::IsEmpty; +using testing::Pointee; +using testing::UnorderedElementsAre; namespace { @@ -327,11 +333,13 @@ void SetupTempDir(); base::FilePath test_login_db_file_path() const; + base::FilePath test_encrypted_login_db_file_path() const; base::test::ScopedTaskEnvironment task_environment_; base::ScopedTempDir temp_dir_; BackendType backend_type_; scoped_refptr<PasswordStoreX> store_; + TestingPrefServiceSimple fake_pref_service; DISALLOW_COPY_AND_ASSIGN(PasswordStoreXTestDelegate); }; @@ -341,8 +349,12 @@ SetupTempDir(); auto login_db = std::make_unique<password_manager::LoginDatabase>( test_login_db_file_path()); - login_db->disable_encryption(); - store_ = new PasswordStoreX(std::move(login_db), GetBackend(backend_type_)); + fake_pref_service.registry()->RegisterIntegerPref( + password_manager::prefs::kMigrationToLoginDBStep, + PasswordStoreX::NOT_ATTEMPTED); + store_ = new PasswordStoreX(std::move(login_db), + test_encrypted_login_db_file_path(), + GetBackend(backend_type_), &fake_pref_service); store_->Init(syncer::SyncableService::StartSyncFlare(), nullptr); } @@ -362,6 +374,11 @@ return temp_dir_.GetPath().Append(FILE_PATH_LITERAL("login_test")); } +base::FilePath PasswordStoreXTestDelegate::test_encrypted_login_db_file_path() + const { + return temp_dir_.GetPath().Append(FILE_PATH_LITERAL("encrypted_login_test")); +} + class PasswordStoreXNoBackendTestDelegate : public PasswordStoreXTestDelegate { public: PasswordStoreXNoBackendTestDelegate() @@ -375,6 +392,18 @@ : PasswordStoreXTestDelegate(WORKING_BACKEND) {} }; +std::vector<std::unique_ptr<PasswordForm>> ReadLoginDB( + const base::FilePath& path, + bool encrypted) { + password_manager::LoginDatabase login_db(path); + if (!encrypted) + login_db.disable_encryption(); + EXPECT_TRUE(login_db.Init()); + std::vector<std::unique_ptr<PasswordForm>> stored_forms; + EXPECT_TRUE(login_db.GetAutofillableLogins(&stored_forms)); + return stored_forms; +} + } // namespace namespace password_manager { @@ -394,14 +423,28 @@ void SetUp() override { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); + fake_pref_service_.registry()->RegisterIntegerPref( + password_manager::prefs::kMigrationToLoginDBStep, + PasswordStoreX::NOT_ATTEMPTED); + OSCryptMocker::SetUp(); } + void TearDown() override { OSCryptMocker::TearDown(); } + base::FilePath test_login_db_file_path() const { return temp_dir_.GetPath().Append(FILE_PATH_LITERAL("login_test")); } + base::FilePath test_encrypted_login_db_file_path() const { + return temp_dir_.GetPath().Append( + FILE_PATH_LITERAL("encrypted_login_test")); + } + void WaitForPasswordStore() { task_environment_.RunUntilIdle(); } + protected: + TestingPrefServiceSimple fake_pref_service_; + private: base::test::ScopedTaskEnvironment task_environment_; base::ScopedTempDir temp_dir_; @@ -412,9 +455,9 @@ TEST_P(PasswordStoreXTest, Notifications) { std::unique_ptr<password_manager::LoginDatabase> login_db( new password_manager::LoginDatabase(test_login_db_file_path())); - login_db->disable_encryption(); - scoped_refptr<PasswordStoreX> store( - new PasswordStoreX(std::move(login_db), GetBackend(GetParam()))); + scoped_refptr<PasswordStoreX> store(new PasswordStoreX( + std::move(login_db), test_encrypted_login_db_file_path(), + GetBackend(GetParam()), &fake_pref_service_)); store->Init(syncer::SyncableService::StartSyncFlare(), nullptr); password_manager::PasswordFormData form_data = { @@ -514,9 +557,9 @@ // Initializing the PasswordStore shouldn't trigger a native migration (yet). login_db.reset(new password_manager::LoginDatabase(login_db_file)); - login_db->disable_encryption(); - scoped_refptr<PasswordStoreX> store( - new PasswordStoreX(std::move(login_db), GetBackend(GetParam()))); + scoped_refptr<PasswordStoreX> store(new PasswordStoreX( + std::move(login_db), test_encrypted_login_db_file_path(), + GetBackend(GetParam()), &fake_pref_service_)); store->Init(syncer::SyncableService::StartSyncFlare(), nullptr); MockPasswordStoreConsumer consumer; @@ -581,6 +624,167 @@ store->ShutdownOnUIThread(); } +TEST_P(PasswordStoreXTest, MigrationToEncryption) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature( + password_manager::features::kMigrateLinuxToLoginDB); + IntegerPrefMember migration_step_pref_; + migration_step_pref_.Init(password_manager::prefs::kMigrationToLoginDBStep, + &fake_pref_service_); + + EXPECT_EQ(PasswordStoreX::NOT_ATTEMPTED, migration_step_pref_.GetValue()); + + // Add existing credentials into the backend. + std::vector<std::unique_ptr<PasswordForm>> old_credentials; + InitExpectedForms(true, 6, &old_credentials); + std::unique_ptr<PasswordStoreX::NativeBackend> backend = + GetBackend(GetParam()); + if (GetParam() != NO_BACKEND) { + for (int i = 0; i < 3; i++) + backend->AddLogin(*old_credentials[i]); + } + + // Add existing credentials into the unencrypted loginDB. + auto login_db = std::make_unique<password_manager::LoginDatabase>( + test_login_db_file_path()); + login_db->disable_encryption(); + ASSERT_TRUE(login_db->Init()); + for (int i = 3; i < 6; i++) + ignore_result(login_db->AddLogin(*old_credentials[i])); + + login_db = std::make_unique<password_manager::LoginDatabase>( + test_login_db_file_path()); + scoped_refptr<PasswordStoreX> store(new PasswordStoreX( + std::move(login_db), test_encrypted_login_db_file_path(), + std::move(backend), &fake_pref_service_)); + store->Init(syncer::SyncableService::StartSyncFlare(), nullptr); + + // Make modifications, so that we trigger the migration and so that we can + // verify where the store serves from. The migration is triggered + // opportunistically during access to the store. + const auto new_form = password_manager::FillPasswordFormWithData( + {PasswordForm::SCHEME_HTML, "https://www.fakebook.com", + "https://www.fakebook.com/li", "https://www.fakebook.com/a", + L"submit_element", L"username_element", L"password_element", + L"username_value", L"password_value", true, 1.0}); + store->RemoveLogin(*old_credentials[0]); + store->AddLogin(*new_form); + + MockPasswordStoreConsumer consumer; + if (GetParam() == WORKING_BACKEND) { + // The store has the native backend data, the initial unencrypted loginDB + // data and modifications. + EXPECT_CALL( + consumer, + OnGetPasswordStoreResultsConstRef(UnorderedElementsAre( + Pointee(*new_form), Pointee(*old_credentials[1]), + Pointee(*old_credentials[2]), Pointee(*old_credentials[3]), + Pointee(*old_credentials[4]), Pointee(*old_credentials[5])))); + } else { + // The has the initial unencrypted loginDB data and modifications. + EXPECT_CALL( + consumer, + OnGetPasswordStoreResultsConstRef(UnorderedElementsAre( + Pointee(*new_form), Pointee(*old_credentials[3]), + Pointee(*old_credentials[4]), Pointee(*old_credentials[5])))); + } + store->GetAutofillableLogins(&consumer); + + WaitForPasswordStore(); + store->ShutdownOnUIThread(); + store.reset(); + WaitForPasswordStore(); + + if (GetParam() == WORKING_BACKEND) { + // Verify that the encrypted loginDB is up-to-date. + std::vector<std::unique_ptr<PasswordForm>> stored_forms = + ReadLoginDB(test_encrypted_login_db_file_path(), true); + EXPECT_EQ(6u, stored_forms.size()); + EXPECT_THAT( + stored_forms, + UnorderedElementsAre( + Pointee(*new_form), Pointee(*old_credentials[1]), + Pointee(*old_credentials[2]), Pointee(*old_credentials[3]), + Pointee(*old_credentials[4]), Pointee(*old_credentials[5]))); + + stored_forms = ReadLoginDB(test_login_db_file_path(), false); + EXPECT_TRUE(stored_forms.empty()); + EXPECT_EQ(PasswordStoreX::COPIED_ALL, migration_step_pref_.GetValue()); + } else { + // No values should be moved without a working backend. + auto stored_forms = ReadLoginDB(test_encrypted_login_db_file_path(), true); + EXPECT_TRUE(stored_forms.empty()); + EXPECT_THAT(migration_step_pref_.GetValue(), PasswordStoreX::NOT_ATTEMPTED); + } +} + +// Once the migration is performed, don't port anything else into the new +// location. +TEST_P(PasswordStoreXTest, MigrationToEncryption_OnlyOnce) { + if (GetParam() != WORKING_BACKEND) + return; + + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature( + password_manager::features::kMigrateLinuxToLoginDB); + IntegerPrefMember migration_step_pref_; + migration_step_pref_.Init(password_manager::prefs::kMigrationToLoginDBStep, + &fake_pref_service_); + // Signal that the migration has been completed. + migration_step_pref_.SetValue(PasswordStoreX::COPIED_ALL); + + // We add new credentials into a backend. They should be completely ignored by + // the store. + std::vector<std::unique_ptr<PasswordForm>> old_credentials; + InitExpectedForms(true, 6, &old_credentials); + auto backend = GetBackend(GetParam()); + for (int i = 0; i < 3; i++) + backend->AddLogin(*old_credentials[i]); + + // Add existing credentials into the encrypted loginDB. They should be the + // only thing that's available in the store. + auto encrypted_login_db = std::make_unique<password_manager::LoginDatabase>( + test_encrypted_login_db_file_path()); + ASSERT_TRUE(encrypted_login_db->Init()); + for (int i = 3; i < 6; i++) + ignore_result(encrypted_login_db->AddLogin(*old_credentials[i])); + encrypted_login_db.reset(); + + // Create the store. + auto login_db = std::make_unique<password_manager::LoginDatabase>( + test_login_db_file_path()); + scoped_refptr<PasswordStoreX> store = new PasswordStoreX( + std::move(login_db), test_encrypted_login_db_file_path(), + std::move(backend), &fake_pref_service_); + store->Init(syncer::SyncableService::StartSyncFlare(), nullptr); + + // Make modifications and check the contents. + MockPasswordStoreConsumer consumer; + EXPECT_CALL(consumer, + OnGetPasswordStoreResultsConstRef(UnorderedElementsAre( + Pointee(*old_credentials[3]), Pointee(*old_credentials[4]), + Pointee(*old_credentials[5])))); + store->GetAutofillableLogins(&consumer); + store->RemoveLogin(*old_credentials[3]); + EXPECT_CALL(consumer, + OnGetPasswordStoreResultsConstRef(UnorderedElementsAre( + Pointee(*old_credentials[4]), Pointee(*old_credentials[5])))); + store->GetAutofillableLogins(&consumer); + + WaitForPasswordStore(); + store->ShutdownOnUIThread(); + store.reset(); + WaitForPasswordStore(); + + // The previous results were served from the encrypted LoginDB. + std::vector<std::unique_ptr<PasswordForm>> stored_forms = + ReadLoginDB(test_encrypted_login_db_file_path(), true); + EXPECT_EQ(2u, stored_forms.size()); + EXPECT_EQ(PasswordStoreX::COPIED_ALL, migration_step_pref_.GetValue()); + EXPECT_THAT(stored_forms, UnorderedElementsAre(Pointee(*old_credentials[4]), + Pointee(*old_credentials[5]))); +} + INSTANTIATE_TEST_CASE_P(NoBackend, PasswordStoreXTest, testing::Values(NO_BACKEND));
diff --git a/chrome/browser/performance_monitor/performance_monitor.cc b/chrome/browser/performance_monitor/performance_monitor.cc index 50c3af6..b0e9936 100644 --- a/chrome/browser/performance_monitor/performance_monitor.cc +++ b/chrome/browser/performance_monitor/performance_monitor.cc
@@ -150,7 +150,7 @@ // See https://crbug.com/821453. for (content::BrowserChildProcessHostIterator iter; !iter.Done(); ++iter) { ProcessMetricsMetadata child_process_data; - child_process_data.handle = iter.GetData().handle; + child_process_data.handle = iter.GetData().GetHandle(); child_process_data.process_type = iter.GetData().process_type; if (iter.GetData().name == base::ASCIIToUTF16(content::kFlashPluginName)) {
diff --git a/chrome/browser/prefs/OWNERS b/chrome/browser/prefs/OWNERS index 512f8a73..b186411e 100644 --- a/chrome/browser/prefs/OWNERS +++ b/chrome/browser/prefs/OWNERS
@@ -3,6 +3,8 @@ gab@chromium.org pam@chromium.org +# For Incognito Whitelist per-file pref_service_incognito_whitelist.cc=rhalavati@chromium.org +per-file pref_service_syncable_util.cc=rhalavati@chromium.org # COMPONENT: UI>Browser>Preferences
diff --git a/chrome/browser/prefs/pref_service_incognito_whitelist.cc b/chrome/browser/prefs/pref_service_incognito_whitelist.cc index b514e64..c605393 100644 --- a/chrome/browser/prefs/pref_service_incognito_whitelist.cc +++ b/chrome/browser/prefs/pref_service_incognito_whitelist.cc
@@ -8,7 +8,6 @@ #include "build/build_config.h" #include "chrome/common/pref_names.h" -#include "components/autofill/core/common/autofill_pref_names.h" #include "components/bookmarks/common/bookmark_pref_names.h" #include "components/certificate_transparency/pref_names.h" #include "components/component_updater/pref_names.h" @@ -47,8 +46,6 @@ #if !defined(OS_ANDROID) #include "chrome/browser/accessibility/animation_policy_prefs.h" -#include "extensions/browser/api/audio/pref_names.h" -#include "extensions/browser/pref_names.h" #endif // !defined(OS_ANDROID) #if defined(OS_CHROMEOS) @@ -236,12 +233,9 @@ prefs::kCurrentThemePackFilename, prefs::kCurrentThemeID, prefs::kCurrentThemeImages, prefs::kCurrentThemeColors, prefs::kCurrentThemeTints, prefs::kCurrentThemeDisplayProperties, - prefs::kExtensionsUIDeveloperMode, - // prefs::kExtensionsUIDismissedADTPromo, - prefs::kExtensionCommands, prefs::kPluginsLastInternalDirectory, - prefs::kPluginsPluginsList, prefs::kPluginsDisabledPlugins, - prefs::kPluginsDisabledPluginsExceptions, prefs::kPluginsEnabledPlugins, - prefs::kPluginsAlwaysOpenPdfExternally, + prefs::kPluginsLastInternalDirectory, prefs::kPluginsPluginsList, + prefs::kPluginsDisabledPlugins, prefs::kPluginsDisabledPluginsExceptions, + prefs::kPluginsEnabledPlugins, prefs::kPluginsAlwaysOpenPdfExternally, #if BUILDFLAG(ENABLE_PLUGINS) prefs::kPluginsShowDetails, #endif @@ -274,13 +268,11 @@ prefs::kEnableReferrers, prefs::kEnableDoNotTrack, prefs::kEnableEncryptedMedia, - prefs::kImportAutofillFormData, prefs::kImportBookmarks, - prefs::kImportHistory, prefs::kImportHomepage, prefs::kImportSavedPasswords, - prefs::kImportSearchEngine, + prefs::kImportBookmarks, prefs::kImportHistory, prefs::kImportHomepage, + prefs::kImportSavedPasswords, prefs::kImportSearchEngine, - prefs::kImportDialogAutofillFormData, prefs::kImportDialogBookmarks, - prefs::kImportDialogHistory, prefs::kImportDialogSavedPasswords, - prefs::kImportDialogSearchEngine, + prefs::kImportDialogBookmarks, prefs::kImportDialogHistory, + prefs::kImportDialogSavedPasswords, prefs::kImportDialogSearchEngine, prefs::kProfileAvatarIndex, prefs::kProfileUsingDefaultName, prefs::kProfileName, prefs::kProfileUsingDefaultAvatar, @@ -331,11 +323,6 @@ prefs::kEasyUnlockAllowed, prefs::kEasyUnlockPairing, -#if BUILDFLAG(ENABLE_EXTENSIONS) - prefs::kToolbarIconSurfacingBubbleAcknowledged, - prefs::kToolbarIconSurfacingBubbleLastShowTime, -#endif - prefs::kWebRTCMultipleRoutesEnabled, prefs::kWebRTCNonProxiedUdpEnabled, prefs::kWebRTCIPHandlingPolicy, prefs::kWebRTCUDPPortRange, @@ -405,8 +392,6 @@ prefs::kSuppressUnsupportedOSWarning, prefs::kWasRestarted, #endif // !defined(OS_ANDROID) - prefs::kDisableExtensions, - #if defined(OS_ANDROID) prefs::kContentSuggestionsNotificationsEnabled, prefs::kContentSuggestionsConsecutiveIgnoredPrefName, @@ -763,19 +748,6 @@ arc::prefs::kVoiceInteractionHotwordEnabled, #endif // defined(OS_CHROMEOS) - // components/autofill/core/common/autofill_pref_names.h - autofill::prefs::kAutofillAcceptSaveCreditCardPromptState, - autofill::prefs::kAutofillBillingCustomerNumber, - autofill::prefs::kAutofillCreditCardEnabled, - autofill::prefs::kAutofillCreditCardSigninPromoImpressionCount, - autofill::prefs::kAutofillProfileEnabled, autofill::prefs::kAutofillEnabled, - autofill::prefs::kAutofillLastVersionDeduped, - autofill::prefs::kAutofillLastVersionDisusedAddressesDeleted, - autofill::prefs::kAutofillLastVersionDisusedCreditCardsDeleted, - autofill::prefs::kAutofillOrphanRowsRemoved, - autofill::prefs::kAutofillWalletImportEnabled, - autofill::prefs::kAutofillWalletImportStorageCheckboxState, - // components/bookmarks/common/bookmark_pref_names.h bookmarks::prefs::kBookmarkEditorExpandedNodes, bookmarks::prefs::kEditBookmarksEnabled, @@ -1027,39 +999,6 @@ // components/web_resource/web_resource_pref_names.h prefs::kEulaAccepted, -// extensions/browser/api/audio/pref_names.h -#if !defined(OS_ANDROID) - extensions::kAudioApiStableDeviceIds, -#endif // !defined(OS_ANDROID) - -// extensions/browser/pref_names.h -#if !defined(OS_ANDROID) - extensions::pref_names::kAlertsInitialized, - extensions::pref_names::kAllowedInstallSites, - extensions::pref_names::kAllowedTypes, - extensions::pref_names::kAppFullscreenAllowed, - extensions::pref_names::kBookmarkAppCreationLaunchType, - extensions::pref_names::kExtensions, - extensions::pref_names::kExtensionManagement, - extensions::pref_names::kInstallAllowList, - extensions::pref_names::kInstallDenyList, - extensions::pref_names::kInstallForceList, - extensions::pref_names::kInstallLoginScreenAppList, - extensions::pref_names::kLastChromeVersion, - extensions::pref_names::kLastUpdateCheck, - extensions::pref_names::kNativeMessagingBlacklist, - extensions::pref_names::kNativeMessagingWhitelist, - extensions::pref_names::kNativeMessagingUserLevelHosts, - extensions::pref_names::kNextUpdateCheck, - extensions::pref_names::kStorageGarbageCollect, - extensions::pref_names::kToolbar, extensions::pref_names::kToolbarSize, - extensions::pref_names::kPrefPreferences, - extensions::pref_names::kPrefIncognitoPreferences, - extensions::pref_names::kPrefRegularOnlyPreferences, - extensions::pref_names::kPrefContentSettings, - extensions::pref_names::kPrefIncognitoContentSettings, -#endif //! defined(OS_ANDROID) - // services/preferences/public/cpp/tracked/pref_names.h user_prefs::kPreferenceResetTime,
diff --git a/chrome/browser/profiles/off_the_record_profile_io_data.cc b/chrome/browser/profiles/off_the_record_profile_io_data.cc index ebb7e951..de61d909 100644 --- a/chrome/browser/profiles/off_the_record_profile_io_data.cc +++ b/chrome/browser/profiles/off_the_record_profile_io_data.cc
@@ -215,14 +215,6 @@ std::make_unique<net::ChannelIDService>( new net::DefaultChannelIDStore(nullptr))); - using content::CookieStoreConfig; - std::unique_ptr<net::CookieStore> cookie_store(CreateCookieStore( - CookieStoreConfig(base::FilePath(), false, false, nullptr))); - cookie_store->SetChannelIDServiceID(channel_id_service->GetUniqueID()); - - builder->SetCookieAndChannelIdStores(std::move(cookie_store), - std::move(channel_id_service)); - AddProtocolHandlersToBuilder(builder, protocol_handlers); SetUpJobFactoryDefaultsForBuilder( builder, std::move(request_interceptors),
diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc index 90160059..404b829 100644 --- a/chrome/browser/profiles/profile_impl_io_data.cc +++ b/chrome/browser/profiles/profile_impl_io_data.cc
@@ -466,49 +466,6 @@ IOThread* const io_thread = profile_params->io_thread; IOThread::Globals* const io_thread_globals = io_thread->globals(); - // This check is needed because with the network service the cookies are used - // in a different process. See the bottom of - // ProfileNetworkContextService::SetUpProfileIODataMainContext. - if (profile_params->main_network_context_params->cookie_path) { - // Create a single task runner to use with the CookieStore and - // ChannelIDStore. - scoped_refptr<base::SequencedTaskRunner> cookie_background_task_runner = - base::CreateSequencedTaskRunnerWithTraits( - {base::MayBlock(), base::TaskPriority::BEST_EFFORT, - base::TaskShutdownBehavior::BLOCK_SHUTDOWN}); - - // Set up server bound cert service. - DCHECK(!profile_params->main_network_context_params->channel_id_path.value() - .empty()); - scoped_refptr<QuotaPolicyChannelIDStore> channel_id_db = - new QuotaPolicyChannelIDStore( - profile_params->main_network_context_params->channel_id_path - .value(), - cookie_background_task_runner, - lazy_params_->special_storage_policy.get()); - std::unique_ptr<net::ChannelIDService> channel_id_service( - std::make_unique<net::ChannelIDService>( - new net::DefaultChannelIDStore(channel_id_db.get()))); - - // Set up cookie store. - content::CookieStoreConfig cookie_config( - profile_params->main_network_context_params->cookie_path.value(), - profile_params->main_network_context_params - ->restore_old_session_cookies, - profile_params->main_network_context_params->persist_session_cookies, - lazy_params_->special_storage_policy.get()); - cookie_config.crypto_delegate = cookie_config::GetCookieCryptoDelegate(); - cookie_config.channel_id_service = channel_id_service.get(); - cookie_config.background_task_runner = cookie_background_task_runner; - std::unique_ptr<net::CookieStore> cookie_store( - content::CreateCookieStore(cookie_config)); - - cookie_store->SetChannelIDServiceID(channel_id_service->GetUniqueID()); - - builder->SetCookieAndChannelIdStores(std::move(cookie_store), - std::move(channel_id_service)); - } - AddProtocolHandlersToBuilder(builder, protocol_handlers); // Install the Offline Page Interceptor.
diff --git a/chrome/browser/resource_coordinator/browser_child_process_watcher.cc b/chrome/browser/resource_coordinator/browser_child_process_watcher.cc index 627a607a..7e66238 100644 --- a/chrome/browser/resource_coordinator/browser_child_process_watcher.cc +++ b/chrome/browser/resource_coordinator/browser_child_process_watcher.cc
@@ -32,7 +32,8 @@ content::ServiceManagerConnection::GetForProcess()->GetConnector()); gpu_process_resource_coordinator_->SetLaunchTime(base::Time::Now()); - gpu_process_resource_coordinator_->SetPID(base::GetProcId(data.handle)); + gpu_process_resource_coordinator_->SetPID( + base::GetProcId(data.GetHandle())); } }
diff --git a/chrome/browser/resources/gaia_auth_host/authenticator.js b/chrome/browser/resources/gaia_auth_host/authenticator.js index 327b0c9..d67eaeb3 100644 --- a/chrome/browser/resources/gaia_auth_host/authenticator.js +++ b/chrome/browser/resources/gaia_auth_host/authenticator.js
@@ -901,6 +901,7 @@ this.authDomain = this.samlHandler_.authDomain; this.authFlow = AuthFlow.SAML; + this.webview_.focus(); this.fireReadyEvent_(); };
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.h b/chrome/browser/safe_browsing/safe_browsing_blocking_page.h index dee6c55..d2817327 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.h +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.h
@@ -97,6 +97,7 @@ ExtendedReportingNotShownInIncognito); FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest, ExtendedReportingNotShownNotAllowExtendedReporting); + FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest, TrickToBillPage); void UpdateReportingPref(); // Used for the transition from old to new pref.
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc index 4d213bd..5c3493d 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc
@@ -289,8 +289,14 @@ } void ShowInterstitial(bool is_subresource, const char* url) { + ShowInterstitial(is_subresource, url, SB_THREAT_TYPE_URL_MALWARE); + } + + void ShowInterstitial(bool is_subresource, + const char* url, + SBThreatType type) { security_interstitials::UnsafeResource resource; - InitResource(&resource, is_subresource, GURL(url)); + InitResource(&resource, is_subresource, GURL(url), type); SafeBrowsingBlockingPage::ShowBlockingPage(ui_manager_.get(), resource); } @@ -345,7 +351,8 @@ private: void InitResource(security_interstitials::UnsafeResource* resource, bool is_subresource, - const GURL& url) { + const GURL& url, + SBThreatType type) { resource->callback = base::Bind(&SafeBrowsingBlockingPageTest::OnBlockingPageComplete, base::Unretained(this)); @@ -353,7 +360,7 @@ content::BrowserThread::IO); resource->url = url; resource->is_subresource = is_subresource; - resource->threat_type = SB_THREAT_TYPE_URL_MALWARE; + resource->threat_type = type; resource->web_contents_getter = security_interstitials::UnsafeResource::GetWebContentsGetter( web_contents()->GetMainFrame()->GetProcess()->GetID(), @@ -942,6 +949,53 @@ ui_manager_->GetThreatDetails()->clear(); } +// Tests showing a blocking page for trick-to-bill. +TEST_F(SafeBrowsingBlockingPageTest, TrickToBillPage) { + // Start a load. + controller().LoadURL(GURL(kBadURL), content::Referrer(), + ui::PAGE_TRANSITION_TYPED, std::string()); + + // Simulate the load causing a safe browsing interstitial to be shown. + ShowInterstitial(false, kBadURL, SB_THREAT_TYPE_TRICK_TO_BILL); + + SafeBrowsingBlockingPage* sb_interstitial = GetSafeBrowsingBlockingPage(); + ASSERT_TRUE(sb_interstitial); + + base::DictionaryValue load_time_data; + sb_interstitial->sb_error_ui()->PopulateStringsForHtml(&load_time_data); + + base::string16 str; + + load_time_data.GetString("heading", &str); + EXPECT_EQ(str, l10n_util::GetStringUTF16(IDS_TRICK_TO_BILL_HEADING)); + load_time_data.GetString("primaryParagraph", &str); + EXPECT_EQ(str, + l10n_util::GetStringUTF16(IDS_TRICK_TO_BILL_PRIMARY_PARAGRAPH)); + load_time_data.GetString("primaryButtonText", &str); + EXPECT_EQ(str, l10n_util::GetStringUTF16(IDS_TRICK_TO_BILL_PRIMARY_BUTTON)); + load_time_data.GetString("proceedButtonText", &str); + EXPECT_EQ(str, l10n_util::GetStringUTF16(IDS_TRICK_TO_BILL_PROCEED_BUTTON)); + + load_time_data.GetString("openDetails", &str); + EXPECT_EQ(str, base::string16()); + load_time_data.GetString("closeDetails", &str); + EXPECT_EQ(str, base::string16()); + load_time_data.GetString("explanationParagraph", &str); + EXPECT_EQ(str, base::string16()); + load_time_data.GetString("finalParagraph", &str); + EXPECT_EQ(str, base::string16()); + + bool flag; + load_time_data.GetBoolean("trick_to_bill", &flag); + EXPECT_TRUE(flag); + load_time_data.GetBoolean("phishing", &flag); + EXPECT_FALSE(flag); + load_time_data.GetBoolean("overridable", &flag); + EXPECT_TRUE(flag); + load_time_data.GetBoolean("hide_primary_button", &flag); + EXPECT_FALSE(flag); +} + class SafeBrowsingBlockingQuietPageTest : public ChromeRenderViewHostTestHarness { public:
diff --git a/chrome/browser/ssl/security_state_tab_helper.cc b/chrome/browser/ssl/security_state_tab_helper.cc index d5b1029..9e0c7748 100644 --- a/chrome/browser/ssl/security_state_tab_helper.cc +++ b/chrome/browser/ssl/security_state_tab_helper.cc
@@ -260,6 +260,9 @@ switch (threat_type) { case safe_browsing::SB_THREAT_TYPE_UNUSED: case safe_browsing::SB_THREAT_TYPE_SAFE: + // TODO(https://crbug.com/867518): Create a malicious trick to bill enum + // and return it. + case safe_browsing::SB_THREAT_TYPE_TRICK_TO_BILL: break; case safe_browsing::SB_THREAT_TYPE_URL_PHISHING: case safe_browsing::SB_THREAT_TYPE_URL_CLIENT_SIDE_PHISHING:
diff --git a/chrome/browser/sync/test/integration/profile_sync_service_harness.cc b/chrome/browser/sync/test/integration/profile_sync_service_harness.cc index 3c8cc12..40bcd59 100644 --- a/chrome/browser/sync/test/integration/profile_sync_service_harness.cc +++ b/chrome/browser/sync/test/integration/profile_sync_service_harness.cc
@@ -174,14 +174,24 @@ return false; } } else if (signin_type_ == SigninType::FAKE_SIGNIN) { - // Authenticate sync client using GAIA credentials. - // TODO(https://crbug.com/814307): This ideally should go through - // identity_test_utils.h (and in the long run IdentityTestEnvironment), but - // making that change is complex for reasons described in the bug. identity::IdentityManager* identity_manager = IdentityManagerFactory::GetForProfile(profile_); - identity_manager->SetPrimaryAccountSynchronouslyForTests( - gaia_id_, username_, GenerateFakeOAuth2RefreshTokenString()); + if (identity_manager->HasPrimaryAccountWithRefreshToken()) { + // Don't sign in again if we're already signed in. The reason is that + // changing the refresh token causes Sync (ServerConnectionManager in + // particular) to mark the current access token as invalid. Since tests + // typically always hand out the same access token string, any new access + // token acquired later would also be considered invalid. + DCHECK_EQ(identity_manager->GetPrimaryAccountInfo().gaia, gaia_id_); + DCHECK_EQ(identity_manager->GetPrimaryAccountInfo().email, username_); + } else { + // Authenticate sync client using GAIA credentials. + // TODO(https://crbug.com/814307): This ideally should go through + // identity_test_utils.h (and in the long run IdentityTestEnvironment), + // but making that change is complex for reasons described in the bug. + identity_manager->SetPrimaryAccountSynchronouslyForTests( + gaia_id_, username_, GenerateFakeOAuth2RefreshTokenString()); + } } else { LOG(ERROR) << "Unsupported profile signin type."; }
diff --git a/chrome/browser/task_manager/providers/child_process_task.cc b/chrome/browser/task_manager/providers/child_process_task.cc index a9f8013..938ebcb 100644 --- a/chrome/browser/task_manager/providers/child_process_task.cc +++ b/chrome/browser/task_manager/providers/child_process_task.cc
@@ -158,7 +158,7 @@ : Task(GetLocalizedTitle(data.name, data.process_type), base::UTF16ToUTF8(data.name), FetchIcon(IDR_PLUGINS_FAVICON, &s_icon_), - data.handle), + data.GetHandle()), process_resources_sampler_(CreateProcessResourcesSampler(data.id)), v8_memory_allocated_(-1), v8_memory_used_(-1),
diff --git a/chrome/browser/task_manager/providers/child_process_task_provider.cc b/chrome/browser/task_manager/providers/child_process_task_provider.cc index 920b7c4..44b759f 100644 --- a/chrome/browser/task_manager/providers/child_process_task_provider.cc +++ b/chrome/browser/task_manager/providers/child_process_task_provider.cc
@@ -31,10 +31,10 @@ const ChildProcessData& process_data = itr.GetData(); // Only add processes that have already started, i.e. with valid handles. - if (process_data.handle == base::kNullProcessHandle) + if (!process_data.IsHandleValid()) continue; - child_processes->push_back(process_data); + child_processes->push_back(process_data.Duplicate()); } return child_processes; @@ -62,7 +62,7 @@ void ChildProcessTaskProvider::BrowserChildProcessLaunchedAndConnected( const content::ChildProcessData& data) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - if (data.handle == base::kNullProcessHandle) + if (!data.IsHandleValid()) return; CreateTask(data); @@ -71,12 +71,12 @@ void ChildProcessTaskProvider::BrowserChildProcessHostDisconnected( const content::ChildProcessData& data) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - DeleteTask(data.handle); + DeleteTask(data.GetHandle()); } void ChildProcessTaskProvider::StartUpdating() { DCHECK_CURRENTLY_ON(BrowserThread::UI); - DCHECK(tasks_by_handle_.empty()); + DCHECK(tasks_by_processid_.empty()); DCHECK(tasks_by_child_id_.empty()); // First, get the pre-existing child processes data. @@ -102,7 +102,7 @@ // StopUpdating() is called after the observer has been cleared. // Then delete all tasks (if any). - tasks_by_handle_.clear(); + tasks_by_processid_.clear(); tasks_by_child_id_.clear(); } @@ -120,7 +120,8 @@ void ChildProcessTaskProvider::CreateTask( const content::ChildProcessData& data) { - std::unique_ptr<ChildProcessTask>& task = tasks_by_handle_[data.handle]; + std::unique_ptr<ChildProcessTask>& task = + tasks_by_processid_[base::GetProcId(data.GetHandle())]; if (task) { // This task is already known to us. This case can happen when some of the // child process data we collect upon StartUpdating() might be of @@ -136,13 +137,13 @@ } void ChildProcessTaskProvider::DeleteTask(base::ProcessHandle handle) { - auto itr = tasks_by_handle_.find(handle); + auto itr = tasks_by_processid_.find(base::GetProcId(handle)); // The following case should never happen since we start observing // |BrowserChildProcessObserver| only after we collect all pre-existing child // processes and are notified (on the UI thread) that the collection is // completed at |ChildProcessDataCollected()|. - if (itr == tasks_by_handle_.end()) { + if (itr == tasks_by_processid_.end()) { // BUG(crbug.com/611067): Temporarily removing due to test flakes. The // reason why this happens is well understood (see bug), but there's no // quick and easy fix. @@ -156,7 +157,7 @@ tasks_by_child_id_.erase(itr->second->GetChildProcessUniqueID()); // Finally delete the task. - tasks_by_handle_.erase(itr); + tasks_by_processid_.erase(itr); } } // namespace task_manager
diff --git a/chrome/browser/task_manager/providers/child_process_task_provider.h b/chrome/browser/task_manager/providers/child_process_task_provider.h index 97e3f49a..f45955f 100644 --- a/chrome/browser/task_manager/providers/child_process_task_provider.h +++ b/chrome/browser/task_manager/providers/child_process_task_provider.h
@@ -65,11 +65,11 @@ // A map to track ChildProcessTasks by their handles. // - // This uses handles instead of pids because on windows (where pids and - // handles differ), BrowserChildProcessObserver gives us a handle instead of a - // pid. - std::map<base::ProcessHandle, std::unique_ptr<ChildProcessTask>> - tasks_by_handle_; + // This uses pids instead of handles because on windows (where pids and + // handles differ), there may be multiple different handles to the same + // process. + std::map<base::ProcessId, std::unique_ptr<ChildProcessTask>> + tasks_by_processid_; // A map to track ChildProcessTask's by their child process unique ids. base::flat_map<int, ChildProcessTask*> tasks_by_child_id_;
diff --git a/chrome/browser/task_manager/providers/child_process_task_unittest.cc b/chrome/browser/task_manager/providers/child_process_task_unittest.cc index 60306cb..70d839c9 100644 --- a/chrome/browser/task_manager/providers/child_process_task_unittest.cc +++ b/chrome/browser/task_manager/providers/child_process_task_unittest.cc
@@ -69,7 +69,7 @@ bool AreProviderContainersEmpty( const ChildProcessTaskProvider& provider) const { - return provider.tasks_by_handle_.empty() && + return provider.tasks_by_processid_.empty() && provider.tasks_by_child_id_.empty(); } @@ -106,7 +106,7 @@ // The following process which has handle = base::kNullProcessHandle, won't be // added. ChildProcessData data1(0); - ASSERT_EQ(base::kNullProcessHandle, data1.handle); + ASSERT_EQ(base::kNullProcessHandle, data1.GetHandle()); provider.BrowserChildProcessLaunchedAndConnected(data1); EXPECT_TRUE(provided_tasks_.empty()); @@ -116,14 +116,15 @@ IDS_TASK_MANAGER_PLUGIN_PREFIX, name)); ChildProcessData data2(content::PROCESS_TYPE_PPAPI_PLUGIN); - data2.handle = base::GetCurrentProcessHandle(); + data2.SetHandle(base::GetCurrentProcessHandle()); data2.name = name; data2.id = unique_id; provider.BrowserChildProcessLaunchedAndConnected(data2); ASSERT_EQ(1U, provided_tasks_.size()); Task* task = provided_tasks_.begin()->second; - EXPECT_EQ(base::GetCurrentProcessHandle(), task->process_handle()); + // Process handles may not match, but process IDs must: + EXPECT_EQ(base::GetCurrentProcId(), base::GetProcId(task->process_handle())); EXPECT_EQ(base::GetCurrentProcId(), task->process_id()); EXPECT_EQ(expected_name, task->title()); EXPECT_EQ(Task::PLUGIN, task->GetType()); @@ -162,11 +163,12 @@ for (const auto& types_pair : process_task_types_pairs) { // Add the task. ChildProcessData data(types_pair.process_type_); - data.handle = base::GetCurrentProcessHandle(); + data.SetHandle(base::GetCurrentProcessHandle()); provider.BrowserChildProcessLaunchedAndConnected(data); ASSERT_EQ(1U, provided_tasks_.size()); Task* task = provided_tasks_.begin()->second; - EXPECT_EQ(base::GetCurrentProcessHandle(), task->process_handle()); + EXPECT_EQ(base::GetCurrentProcId(), + base::GetProcId(task->process_handle())); EXPECT_EQ(types_pair.expected_task_type_, task->GetType()); // Remove the task.
diff --git a/chrome/browser/task_manager/providers/render_process_host_task_provider.cc b/chrome/browser/task_manager/providers/render_process_host_task_provider.cc index 255b7645..031611d9 100644 --- a/chrome/browser/task_manager/providers/render_process_host_task_provider.cc +++ b/chrome/browser/task_manager/providers/render_process_host_task_provider.cc
@@ -82,9 +82,7 @@ // TODO(cburn): plumb out something from RPH so the title can be set here. // Create the task and notify the observer. ChildProcessData data(content::PROCESS_TYPE_RENDERER); - // TODO(siggi): Investigate whether this is also a handle race, per - // https://crbug.com/821453. - data.handle = host->GetProcess().Handle(); + data.SetHandle(host->GetProcess().Handle()); data.id = host->GetID(); task.reset(new ChildProcessTask(data)); NotifyObserverTaskAdded(task.get());
diff --git a/chrome/browser/ui/confirm_quit.cc b/chrome/browser/ui/confirm_quit.cc index b0989f6..f83164d 100644 --- a/chrome/browser/ui/confirm_quit.cc +++ b/chrome/browser/ui/confirm_quit.cc
@@ -19,11 +19,7 @@ } void RegisterLocalState(PrefRegistrySimple* registry) { -#if defined(OS_MACOSX) - registry->RegisterBooleanPref(prefs::kConfirmToQuitEnabled, false); -#else registry->RegisterBooleanPref(prefs::kConfirmToQuitEnabled, true); -#endif } } // namespace confirm_quit
diff --git a/chrome/browser/ui/hung_plugin_tab_helper.cc b/chrome/browser/ui/hung_plugin_tab_helper.cc index 0d791e2..8a1579a21 100644 --- a/chrome/browser/ui/hung_plugin_tab_helper.cc +++ b/chrome/browser/ui/hung_plugin_tab_helper.cc
@@ -38,9 +38,9 @@ while (!iter.Done()) { const content::ChildProcessData& data = iter.GetData(); if (data.id == child_id) { - CrashDumpHungChildProcess(data.handle); + CrashDumpHungChildProcess(data.GetHandle()); base::Process process = - base::Process::DeprecatedGetProcessFromHandle(data.handle); + base::Process::DeprecatedGetProcessFromHandle(data.GetHandle()); process.Terminate(content::RESULT_CODE_HUNG, false); break; }
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index ff32822..aa8439a9 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -2386,12 +2386,14 @@ if (new_parent == this) { // BookmarkBarView is detached. - views::View* target_view = nullptr; - if (ui::MaterialDesignController::IsRefreshUi()) { + views::View* target_view = top_container_; +#if !defined(OS_CHROMEOS) + // CrOS immersive mode needs to show the rest of the top chrome + // in front of the detached bookmark bar, since the detached + // bar is styled to look like it's part of the NTP web content. + if (ui::MaterialDesignController::IsRefreshUi()) target_view = infobar_container_; - } else { - target_view = top_container_; - } +#endif const int target_index = GetIndexOf(target_view); DCHECK_GE(target_index, 0); // |top_container_| contains the toolbar, so putting the bookmark bar ahead
diff --git a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc index 29070c510..c30bd9f 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
@@ -488,11 +488,6 @@ SchedulePaint(); } -views::View* OmniboxPopupContentsView::GetTooltipHandlerForPoint( - const gfx::Point& point) { - return nullptr; -} - bool OmniboxPopupContentsView::OnMouseDragged(const ui::MouseEvent& event) { size_t index = GetIndexForPoint(event.location());
diff --git a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h index 85511e7..46d484b 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h +++ b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h
@@ -69,7 +69,6 @@ // views::View: void Layout() override; - views::View* GetTooltipHandlerForPoint(const gfx::Point& point) override; bool OnMouseDragged(const ui::MouseEvent& event) override; void OnGestureEvent(ui::GestureEvent* event) override; void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc index 909d5b1..b3762c3 100644 --- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc +++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -113,7 +113,7 @@ constexpr int kFixedAccountRemovalViewWidth = 280; constexpr int kFixedMenuWidthPreDice = 240; constexpr int kFixedMenuWidthDice = 288; -constexpr int kIconSize = 20; +constexpr int kIconSize = 16; // Spacing between the edge of the material design user menu and the // top/bottom or left/right of the menu items.
diff --git a/chrome/browser/ui/webui/conflicts/conflicts_handler.cc b/chrome/browser/ui/webui/conflicts/conflicts_handler.cc index 7b9fb38..ab34217 100644 --- a/chrome/browser/ui/webui/conflicts/conflicts_handler.cc +++ b/chrome/browser/ui/webui/conflicts/conflicts_handler.cc
@@ -230,9 +230,7 @@ third_party_features_status_ = kPolicyDisabled; if (!base::FeatureList::IsEnabled(features::kThirdPartyModulesBlocking) && - !(base::FeatureList::IsEnabled( - features::kIncompatibleApplicationsWarning) && - base::win::GetVersion() >= base::win::VERSION_WIN10)) { + !IncompatibleApplicationsUpdater::IsWarningEnabled()) { third_party_features_status_ = kFeatureDisabled; }
diff --git a/chrome/browser/ui/webui/interstitials/interstitial_ui.cc b/chrome/browser/ui/webui/interstitials/interstitial_ui.cc index 5fbf984c..cb82114 100644 --- a/chrome/browser/ui/webui/interstitials/interstitial_ui.cc +++ b/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
@@ -280,6 +280,8 @@ threat_type = safe_browsing::SB_THREAT_TYPE_URL_CLIENT_SIDE_MALWARE; } else if (type_param == "clientside_phishing") { threat_type = safe_browsing::SB_THREAT_TYPE_URL_CLIENT_SIDE_PHISHING; + } else if (type_param == "trick_to_bill") { + threat_type = safe_browsing::SB_THREAT_TYPE_TRICK_TO_BILL; } } safe_browsing::SafeBrowsingBlockingPage::UnsafeResource resource;
diff --git a/chrome/browser/ui/webui/interstitials/interstitial_ui_browsertest.cc b/chrome/browser/ui/webui/interstitials/interstitial_ui_browsertest.cc index cfda310..f4be76c6 100644 --- a/chrome/browser/ui/webui/interstitials/interstitial_ui_browsertest.cc +++ b/chrome/browser/ui/webui/interstitials/interstitial_ui_browsertest.cc
@@ -125,6 +125,12 @@ "Security error"); } +IN_PROC_BROWSER_TEST_F(InterstitialUITest, TrickToBillInterstitial) { + TestInterstitial( + GURL("chrome://interstitials/safebrowsing?type=trick_to_bill"), + "Security error"); +} + IN_PROC_BROWSER_TEST_F(InterstitialUITest, CaptivePortalInterstitial) { TestInterstitial(GURL("chrome://interstitials/captiveportal"), "Connect to network");
diff --git a/chrome/browser/ui/webui/memory_internals_ui.cc b/chrome/browser/ui/webui/memory_internals_ui.cc index 2ab3d76..7a2ee16 100644 --- a/chrome/browser/ui/webui/memory_internals_ui.cc +++ b/chrome/browser/ui/webui/memory_internals_ui.cc
@@ -279,7 +279,7 @@ const content::ChildProcessData& data = iter.GetData(); if (data.process_type == content::PROCESS_TYPE_GPU) { - result.push_back(MakeProcessInfo(base::GetProcId(data.handle), + result.push_back(MakeProcessInfo(base::GetProcId(data.GetHandle()), GetChildDescription(data))); } }
diff --git a/chrome/renderer/autofill/autofill_renderer_browsertest.cc b/chrome/renderer/autofill/autofill_renderer_browsertest.cc index 6f6bd1a..cf121e9 100644 --- a/chrome/renderer/autofill/autofill_renderer_browsertest.cc +++ b/chrome/renderer/autofill/autofill_renderer_browsertest.cc
@@ -20,9 +20,9 @@ #include "content/public/common/content_switches.h" #include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_view.h" -#include "mojo/public/cpp/bindings/binding_set.h" -#include "services/service_manager/public/cpp/interface_provider.h" +#include "mojo/public/cpp/bindings/associated_binding_set.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" #include "third_party/blink/public/platform/web_string.h" #include "third_party/blink/public/platform/web_url_request.h" #include "third_party/blink/public/platform/web_vector.h" @@ -55,7 +55,7 @@ FakeContentAutofillDriver() : called_field_change_(false) {} ~FakeContentAutofillDriver() override {} - void BindRequest(mojom::AutofillDriverRequest request) { + void BindRequest(mojom::AutofillDriverAssociatedRequest request) { bindings_.AddBinding(this, std::move(request)); } @@ -127,7 +127,7 @@ // Records data received via FormSeen() call. std::unique_ptr<std::vector<FormData>> forms_; - mojo::BindingSet<mojom::AutofillDriver> bindings_; + mojo::AssociatedBindingSet<mojom::AutofillDriver> bindings_; }; } // namespace @@ -147,17 +147,17 @@ // We only use the fake driver for main frame // because our test cases only involve the main frame. - service_manager::InterfaceProvider* remote_interfaces = - view_->GetMainRenderFrame()->GetRemoteInterfaces(); - service_manager::InterfaceProvider::TestApi test_api(remote_interfaces); - test_api.SetBinderForName( + blink::AssociatedInterfaceProvider* remote_interfaces = + view_->GetMainRenderFrame()->GetRemoteAssociatedInterfaces(); + remote_interfaces->OverrideBinderForTesting( mojom::AutofillDriver::Name_, - base::Bind(&AutofillRendererTest::BindAutofillDriver, - base::Unretained(this))); + base::BindRepeating(&AutofillRendererTest::BindAutofillDriver, + base::Unretained(this))); } - void BindAutofillDriver(mojo::ScopedMessagePipeHandle handle) { - fake_driver_.BindRequest(mojom::AutofillDriverRequest(std::move(handle))); + void BindAutofillDriver(mojo::ScopedInterfaceEndpointHandle handle) { + fake_driver_.BindRequest( + mojom::AutofillDriverAssociatedRequest(std::move(handle))); } FakeContentAutofillDriver fake_driver_;
diff --git a/chrome/renderer/autofill/form_autocomplete_browsertest.cc b/chrome/renderer/autofill/form_autocomplete_browsertest.cc index a796029..a9c3207 100644 --- a/chrome/renderer/autofill/form_autocomplete_browsertest.cc +++ b/chrome/renderer/autofill/form_autocomplete_browsertest.cc
@@ -13,9 +13,9 @@ #include "components/autofill/core/common/form_data.h" #include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_view.h" -#include "mojo/public/cpp/bindings/binding_set.h" -#include "services/service_manager/public/cpp/interface_provider.h" +#include "mojo/public/cpp/bindings/associated_binding_set.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" #include "third_party/blink/public/web/web_document.h" #include "third_party/blink/public/web/web_element.h" #include "third_party/blink/public/web/web_form_element.h" @@ -37,7 +37,7 @@ ~FakeContentAutofillDriver() override {} - void BindRequest(mojom::AutofillDriverRequest request) { + void BindRequest(mojom::AutofillDriverAssociatedRequest request) { bindings_.AddBinding(this, std::move(request)); } @@ -120,7 +120,7 @@ std::unique_ptr<FormFieldData> select_control_changed_; - mojo::BindingSet<mojom::AutofillDriver> bindings_; + mojo::AssociatedBindingSet<mojom::AutofillDriver> bindings_; }; // Helper function to verify the form-related messages received from the @@ -215,17 +215,17 @@ // We only use the fake driver for main frame // because our test cases only involve the main frame. - service_manager::InterfaceProvider* remote_interfaces = - view_->GetMainRenderFrame()->GetRemoteInterfaces(); - service_manager::InterfaceProvider::TestApi test_api(remote_interfaces); - test_api.SetBinderForName( + blink::AssociatedInterfaceProvider* remote_interfaces = + view_->GetMainRenderFrame()->GetRemoteAssociatedInterfaces(); + remote_interfaces->OverrideBinderForTesting( mojom::AutofillDriver::Name_, - base::Bind(&FormAutocompleteTest::BindAutofillDriver, - base::Unretained(this))); + base::BindRepeating(&FormAutocompleteTest::BindAutofillDriver, + base::Unretained(this))); } - void BindAutofillDriver(mojo::ScopedMessagePipeHandle handle) { - fake_driver_.BindRequest(mojom::AutofillDriverRequest(std::move(handle))); + void BindAutofillDriver(mojo::ScopedInterfaceEndpointHandle handle) { + fake_driver_.BindRequest( + mojom::AutofillDriverAssociatedRequest(std::move(handle))); } void SimulateUserInput(const blink::WebString& id, const std::string& value) {
diff --git a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc index 9731dcd..023f0825 100644 --- a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc +++ b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
@@ -1098,6 +1098,7 @@ } TEST_F(PasswordAutofillAgentTest, SendPasswordFormsTest_EmptyForm) { + base::RunLoop().RunUntilIdle(); fake_driver_.reset_password_forms_calls(); LoadHTML(kEmptyFormHTML); base::RunLoop().RunUntilIdle(); @@ -1108,6 +1109,7 @@ } TEST_F(PasswordAutofillAgentTest, SendPasswordFormsTest_FormWithoutPasswords) { + base::RunLoop().RunUntilIdle(); fake_driver_.reset_password_forms_calls(); LoadHTML(kFormWithoutPasswordsHTML); base::RunLoop().RunUntilIdle(); @@ -1119,6 +1121,7 @@ TEST_F(PasswordAutofillAgentTest, SendPasswordFormsTest_UndetectedPasswordField) { + base::RunLoop().RunUntilIdle(); fake_driver_.reset_password_forms_calls(); LoadHTML(kFormWithoutPasswordsHTML); // Emulate that a password field appears but we don't detect that. @@ -1206,6 +1209,8 @@ } TEST_F(PasswordAutofillAgentTest, SendPasswordFormsTest_Redirection) { + base::RunLoop().RunUntilIdle(); + fake_driver_.reset_password_forms_calls(); LoadHTML(kEmptyWebpage); base::RunLoop().RunUntilIdle();
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc index 6107cff..da38a7e6 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -575,13 +575,15 @@ // Set up a mojo service to test if this page is a contextual search page. new contextual_search::OverlayJsRenderFrameObserver(render_frame, registry); + blink::AssociatedInterfaceRegistry* associated_interfaces = + render_frame_observer->associated_interfaces(); PasswordAutofillAgent* password_autofill_agent = - new PasswordAutofillAgent(render_frame, registry); + new PasswordAutofillAgent(render_frame, associated_interfaces); PasswordGenerationAgent* password_generation_agent = new PasswordGenerationAgent(render_frame, password_autofill_agent, - registry); + associated_interfaces); new AutofillAgent(render_frame, password_autofill_agent, - password_generation_agent, registry); + password_generation_agent, associated_interfaces); // There is no render thread, thus no UnverifiedRulesetDealer in // ChromeRenderViewTests.
diff --git a/chrome/renderer/chrome_render_frame_observer.cc b/chrome/renderer/chrome_render_frame_observer.cc index 744dc014..3bf67bbe 100644 --- a/chrome/renderer/chrome_render_frame_observer.cc +++ b/chrome/renderer/chrome_render_frame_observer.cc
@@ -165,6 +165,12 @@ registry_.TryBindInterface(interface_name, interface_pipe); } +bool ChromeRenderFrameObserver::OnAssociatedInterfaceRequestForFrame( + const std::string& interface_name, + mojo::ScopedInterfaceEndpointHandle* handle) { + return associated_interfaces_.TryBindInterface(interface_name, handle); +} + bool ChromeRenderFrameObserver::OnMessageReceived(const IPC::Message& message) { // Filter only. bool handled = true;
diff --git a/chrome/renderer/chrome_render_frame_observer.h b/chrome/renderer/chrome_render_frame_observer.h index 25666cc..ff71b55b 100644 --- a/chrome/renderer/chrome_render_frame_observer.h +++ b/chrome/renderer/chrome_render_frame_observer.h
@@ -14,6 +14,7 @@ #include "mojo/public/cpp/bindings/associated_binding_set.h" #include "mojo/public/cpp/bindings/binding_set.h" #include "services/service_manager/public/cpp/binder_registry.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" namespace gfx { class Size; @@ -36,6 +37,9 @@ ~ChromeRenderFrameObserver() override; service_manager::BinderRegistry* registry() { return ®istry_; } + blink::AssociatedInterfaceRegistry* associated_interfaces() { + return &associated_interfaces_; + } private: enum TextCaptureType { PRELIMINARY_CAPTURE, FINAL_CAPTURE }; @@ -44,6 +48,9 @@ void OnInterfaceRequestForFrame( const std::string& interface_name, mojo::ScopedMessagePipeHandle* interface_pipe) override; + bool OnAssociatedInterfaceRequestForFrame( + const std::string& interface_name, + mojo::ScopedInterfaceEndpointHandle* handle) override; bool OnMessageReceived(const IPC::Message& message) override; void DidStartProvisionalLoad(blink::WebDocumentLoader* loader) override; void DidFinishLoad() override; @@ -109,6 +116,7 @@ mojo::AssociatedBindingSet<chrome::mojom::ChromeRenderFrame> bindings_; service_manager::BinderRegistry registry_; + blink::AssociatedInterfaceRegistry associated_interfaces_; DISALLOW_COPY_AND_ASSIGN(ChromeRenderFrameObserver); };
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index ebacc21..ad05ec6 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -2922,6 +2922,7 @@ "../browser/android/tasks/task_tab_helper_unittest.cc", "../browser/autofill/autofill_credit_card_filling_infobar_delegate_mobile_unittest.cc", "../browser/autofill/autofill_save_card_infobar_delegate_mobile_unittest.cc", + "../browser/metrics/android_metrics_provider_unittest.cc", "../browser/page_load_metrics/observers/android_page_load_metrics_observer_unittest.cc", "../browser/password_manager/account_chooser_dialog_android_unittest.cc", "../browser/password_manager/auto_signin_first_run_dialog_android_unittest.cc",
diff --git a/chrome/test/base/chrome_render_view_test.cc b/chrome/test/base/chrome_render_view_test.cc index 668f8b9..a9b2855 100644 --- a/chrome/test/base/chrome_render_view_test.cc +++ b/chrome/test/base/chrome_render_view_test.cc
@@ -62,7 +62,7 @@ MockAutofillAgent(RenderFrame* render_frame, PasswordAutofillAgent* password_autofill_agent, PasswordGenerationAgent* password_generation_agent, - service_manager::BinderRegistry* registry) + blink::AssociatedInterfaceRegistry* registry) : AutofillAgent(render_frame, password_autofill_agent, password_generation_agent, @@ -125,12 +125,13 @@ // store them directly (they're stored as RenderFrameObserver*). So just // create another set. password_autofill_agent_ = new autofill::TestPasswordAutofillAgent( - view_->GetMainRenderFrame(), registry_.get()); + view_->GetMainRenderFrame(), &associated_interfaces_); password_generation_ = new autofill::TestPasswordGenerationAgent( - view_->GetMainRenderFrame(), password_autofill_agent_, registry_.get()); + view_->GetMainRenderFrame(), password_autofill_agent_, + &associated_interfaces_); autofill_agent_ = new NiceMock<MockAutofillAgent>( view_->GetMainRenderFrame(), password_autofill_agent_, - password_generation_, registry_.get()); + password_generation_, &associated_interfaces_); } void ChromeRenderViewTest::TearDown() {
diff --git a/chrome/test/base/chrome_render_view_test.h b/chrome/test/base/chrome_render_view_test.h index 06aa121..04f6350 100644 --- a/chrome/test/base/chrome_render_view_test.h +++ b/chrome/test/base/chrome_render_view_test.h
@@ -11,6 +11,7 @@ #include "chrome/renderer/chrome_mock_render_thread.h" #include "content/public/test/render_view_test.h" #include "services/service_manager/public/cpp/binder_registry.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" class ChromeContentRendererClient; @@ -49,6 +50,7 @@ autofill::AutofillAgent* autofill_agent_; std::unique_ptr<service_manager::BinderRegistry> registry_; + blink::AssociatedInterfaceRegistry associated_interfaces_; // Naked pointer as ownership is with content::RenderViewTest::render_thread_. ChromeMockRenderThread* chrome_render_thread_;
diff --git a/chromecast/device/bluetooth/le/gatt_client_manager_impl.cc b/chromecast/device/bluetooth/le/gatt_client_manager_impl.cc index 2c3f099..052f270 100644 --- a/chromecast/device/bluetooth/le/gatt_client_manager_impl.cc +++ b/chromecast/device/bluetooth/le/gatt_client_manager_impl.cc
@@ -8,6 +8,7 @@ #include "base/logging.h" #include "base/memory/ptr_util.h" #include "base/run_loop.h" +#include "base/stl_util.h" #include "chromecast/base/bind_to_task_runner.h" #include "chromecast/device/bluetooth/le/remote_characteristic_impl.h" #include "chromecast/device/bluetooth/le/remote_descriptor_impl.h" @@ -118,9 +119,21 @@ observers_->Notify(FROM_HERE, &Observer::OnConnectInitated, addr); } +void GattClientManagerImpl::EnqueueConnectRequest( + const bluetooth_v2_shlib::Addr& addr) { + DCHECK(io_task_runner_->BelongsToCurrentThread()); + pending_connect_requests_.push_back(addr); + + // Run the request if this is the only request in the queue. Otherwise, it + // will be run when all previous requests complete. + if (pending_connect_requests_.size() == 1) { + RunQueuedConnectRequest(); + } +} + void GattClientManagerImpl::EnqueueReadRemoteRssiRequest( const bluetooth_v2_shlib::Addr& addr) { - MAKE_SURE_IO_THREAD(EnqueueReadRemoteRssiRequest, addr); + DCHECK(io_task_runner_->BelongsToCurrentThread()); pending_read_remote_rssi_requests_.push_back(addr); // Run the request if this is the only request in the queue. Otherwise, it @@ -152,10 +165,14 @@ connected_devices_.insert(addr); } else { connected_devices_.erase(addr); - pending_read_remote_rssi_requests_.erase( - std::remove(pending_read_remote_rssi_requests_.begin(), - pending_read_remote_rssi_requests_.end(), addr), - pending_read_remote_rssi_requests_.end()); + if (addr == pending_connect_requests_.front()) { + pending_connect_requests_.pop_front(); + RunQueuedConnectRequest(); + } else { + base::Erase(pending_connect_requests_, addr); + } + + base::Erase(pending_read_remote_rssi_requests_, addr); } // We won't declare the device connected until service discovery completes. @@ -236,16 +253,15 @@ CHECK_DEVICE_EXISTS_IT(it); it->second->OnReadRemoteRssiComplete(status, rssi); - if (pending_read_remote_rssi_requests_.empty()) { + if (pending_read_remote_rssi_requests_.empty() || + addr != pending_read_remote_rssi_requests_.front()) { NOTREACHED() << "Unexpected call to " << __func__; - } else { - pending_read_remote_rssi_requests_.pop_front(); + return; } - // Run the next request if there is one in the queue. - if (!pending_read_remote_rssi_requests_.empty()) { - RunQueuedReadRemoteRssiRequest(); - } + pending_read_remote_rssi_requests_.pop_front(); + // Try to run the next ReadRemoteRssi request + RunQueuedReadRemoteRssiRequest(); } void GattClientManagerImpl::OnMtuChanged(const bluetooth_v2_shlib::Addr& addr, @@ -275,6 +291,16 @@ observers_->Notify(FROM_HERE, &Observer::OnServicesUpdated, it->second, it->second->GetServicesSync()); + + if (pending_connect_requests_.empty() || + addr != pending_connect_requests_.front()) { + NOTREACHED() << "Unexpected call to " << __func__; + return; + } + + pending_connect_requests_.pop_front(); + // Try to run the next Connect request + RunQueuedConnectRequest(); } void GattClientManagerImpl::OnServicesRemoved( @@ -301,9 +327,37 @@ it->second->GetServicesSync()); } +void GattClientManagerImpl::RunQueuedConnectRequest() { + DCHECK(io_task_runner_->BelongsToCurrentThread()); + + if (pending_connect_requests_.empty()) { + return; + } + + auto addr = pending_connect_requests_.front(); + while (!gatt_client_->Connect(addr)) { + // If current request fails, run the next request + LOG(ERROR) << "Connect failed"; + auto it = addr_to_device_.find(addr); + if (it != addr_to_device_.end()) { + it->second->SetConnected(false); + } + pending_connect_requests_.pop_front(); + + if (pending_connect_requests_.empty()) { + return; + } + + addr = pending_connect_requests_.front(); + } +} + void GattClientManagerImpl::RunQueuedReadRemoteRssiRequest() { DCHECK(io_task_runner_->BelongsToCurrentThread()); - DCHECK(!pending_read_remote_rssi_requests_.empty()); + + if (pending_read_remote_rssi_requests_.empty()) { + return; + } auto addr = pending_read_remote_rssi_requests_.front(); while (!gatt_client_->ReadRemoteRssi(addr)) {
diff --git a/chromecast/device/bluetooth/le/gatt_client_manager_impl.h b/chromecast/device/bluetooth/le/gatt_client_manager_impl.h index 1377b148..668efd82 100644 --- a/chromecast/device/bluetooth/le/gatt_client_manager_impl.h +++ b/chromecast/device/bluetooth/le/gatt_client_manager_impl.h
@@ -43,6 +43,9 @@ void NotifyConnect(const bluetooth_v2_shlib::Addr& addr) override; scoped_refptr<base::SingleThreadTaskRunner> task_runner() override; + // Add a Connect request to the queue. They can only be executed serially. + void EnqueueConnectRequest(const bluetooth_v2_shlib::Addr& addr); + // Add a ReadRemoteRssi request to the queue. They can only be executed // serially. void EnqueueReadRemoteRssiRequest(const bluetooth_v2_shlib::Addr& addr); @@ -89,6 +92,7 @@ const bluetooth_v2_shlib::Addr& addr, const std::vector<bluetooth_v2_shlib::Gatt::Service>& services) override; + void RunQueuedConnectRequest(); void RunQueuedReadRemoteRssiRequest(); static void FinalizeOnIoThread( @@ -108,6 +112,9 @@ addr_to_device_; std::set<bluetooth_v2_shlib::Addr> connected_devices_; + // Queue for concurrent Connect requests. + std::deque<bluetooth_v2_shlib::Addr> pending_connect_requests_; + // Queue for concurrent ReadRemoteRssi requests. std::deque<bluetooth_v2_shlib::Addr> pending_read_remote_rssi_requests_;
diff --git a/chromecast/device/bluetooth/le/gatt_client_manager_impl_test.cc b/chromecast/device/bluetooth/le/gatt_client_manager_impl_test.cc index f05b5e1a..70a7486 100644 --- a/chromecast/device/bluetooth/le/gatt_client_manager_impl_test.cc +++ b/chromecast/device/bluetooth/le/gatt_client_manager_impl_test.cc
@@ -33,6 +33,8 @@ {0x10, 0x11, 0x12, 0x13, 0x14, 0x15}}; const bluetooth_v2_shlib::Addr kTestAddr3 = { {0x20, 0x21, 0x22, 0x23, 0x24, 0x25}}; +const bluetooth_v2_shlib::Addr kTestAddr4 = { + {0x30, 0x31, 0x32, 0x33, 0x34, 0x35}}; class MockGattClientManagerObserver : public GattClientManager::Observer { public: @@ -238,6 +240,66 @@ base::RunLoop().RunUntilIdle(); } +TEST_F(GattClientManagerTest, RemoteDeviceConnectConcurrent) { + bluetooth_v2_shlib::Gatt::Client::Delegate* delegate = + gatt_client_->delegate(); + scoped_refptr<RemoteDevice> device1 = GetDevice(kTestAddr1); + scoped_refptr<RemoteDevice> device2 = GetDevice(kTestAddr2); + scoped_refptr<RemoteDevice> device3 = GetDevice(kTestAddr3); + scoped_refptr<RemoteDevice> device4 = GetDevice(kTestAddr4); + + base::MockCallback<RemoteDevice::StatusCallback> cb1; + base::MockCallback<RemoteDevice::StatusCallback> cb2; + base::MockCallback<RemoteDevice::StatusCallback> cb3; + base::MockCallback<RemoteDevice::StatusCallback> cb4; + + // Only the 1st Connect request will be executed immediately. The rest will be + // queued. + EXPECT_CALL(*gatt_client_, Connect(kTestAddr1)).WillOnce(Return(true)); + device1->Connect(cb1.Get()); + device2->Connect(cb2.Get()); + device3->Connect(cb3.Get()); + device4->Connect(cb4.Get()); + + EXPECT_CALL(*gatt_client_, GetServices(kTestAddr1)).WillOnce(Return(true)); + delegate->OnConnectChanged(kTestAddr1, true /* status */, + true /* connected */); + + // Queued Connect requests will not be called until we receive OnGetServices + // of the current Connect request if it is successful. + EXPECT_CALL(cb1, Run(true)); + EXPECT_CALL(*gatt_client_, Connect(kTestAddr2)).WillOnce(Return(false)); + EXPECT_CALL(cb2, Run(false)); + // If the Connect request fails in the initial request (not in the callback), + // the next queued request will be executed immediately. + EXPECT_CALL(*gatt_client_, Connect(kTestAddr3)).WillOnce(Return(true)); + delegate->OnGetServices(kTestAddr1, {}); + + EXPECT_CALL(cb3, Run(false)); + EXPECT_CALL(*gatt_client_, Connect(kTestAddr4)).WillOnce(Return(true)); + delegate->OnConnectChanged(kTestAddr3, true /* status */, + false /* connected */); + + EXPECT_CALL(*gatt_client_, GetServices(kTestAddr4)).WillOnce(Return(true)); + delegate->OnConnectChanged(kTestAddr4, true /* status */, + true /* connected */); + + EXPECT_CALL(cb4, Run(true)); + delegate->OnGetServices(kTestAddr4, {}); + + EXPECT_TRUE(device1->IsConnected()); + EXPECT_FALSE(device2->IsConnected()); + EXPECT_FALSE(device3->IsConnected()); + EXPECT_TRUE(device4->IsConnected()); + + base::MockCallback<base::OnceCallback<void(size_t)>> + get_num_connected_callback; + EXPECT_CALL(get_num_connected_callback, Run(2)); + gatt_client_manager_->GetNumConnected(get_num_connected_callback.Get()); + + base::RunLoop().RunUntilIdle(); +} + TEST_F(GattClientManagerTest, RemoteDeviceReadRssi) { static const int kRssi = -34; @@ -269,20 +331,25 @@ base::MockCallback<RemoteDevice::RssiCallback> rssi_cb2; base::MockCallback<RemoteDevice::RssiCallback> rssi_cb3; + // Only the 1st ReadRemoteRssi request will be executed immediately. The rest + // will be queued. EXPECT_CALL(*gatt_client_, ReadRemoteRssi(kTestAddr1)).WillOnce(Return(true)); - EXPECT_CALL(*gatt_client_, ReadRemoteRssi(kTestAddr2)) - .WillOnce(Return(false)); - EXPECT_CALL(*gatt_client_, ReadRemoteRssi(kTestAddr3)).WillOnce(Return(true)); - device1->ReadRemoteRssi(rssi_cb1.Get()); device2->ReadRemoteRssi(rssi_cb2.Get()); device3->ReadRemoteRssi(rssi_cb3.Get()); + // Queued ReadRemoteRssi requests will not be called until we receive + // OnGetServices of the current Connect request if it is successful. EXPECT_CALL(rssi_cb1, Run(true, kRssi1)); + EXPECT_CALL(*gatt_client_, ReadRemoteRssi(kTestAddr2)) + .WillOnce(Return(false)); EXPECT_CALL(rssi_cb2, Run(false, _)); - EXPECT_CALL(rssi_cb3, Run(true, kRssi3)); - + // If the ReadRemoteRssi request fails in the initial request (not in the + // callback), the next queued request will be executed immediately. + EXPECT_CALL(*gatt_client_, ReadRemoteRssi(kTestAddr3)).WillOnce(Return(true)); delegate->OnReadRemoteRssi(kTestAddr1, true, kRssi1); + + EXPECT_CALL(rssi_cb3, Run(true, kRssi3)); delegate->OnReadRemoteRssi(kTestAddr3, true, kRssi3); }
diff --git a/chromecast/device/bluetooth/le/remote_device_impl.cc b/chromecast/device/bluetooth/le/remote_device_impl.cc index 04cb4f5..ed00d59 100644 --- a/chromecast/device/bluetooth/le/remote_device_impl.cc +++ b/chromecast/device/bluetooth/le/remote_device_impl.cc
@@ -85,11 +85,10 @@ } gatt_client_manager_->NotifyConnect(addr_); - if (!gatt_client_manager_->gatt_client()->Connect(addr_)) { - LOG(ERROR) << __func__ << " failed"; - return false; - } + connect_pending_ = true; + gatt_client_manager_->EnqueueConnectRequest(addr_); + return true; }
diff --git a/chromeos/services/assistant/BUILD.gn b/chromeos/services/assistant/BUILD.gn index 720e127..bb7b675e 100644 --- a/chromeos/services/assistant/BUILD.gn +++ b/chromeos/services/assistant/BUILD.gn
@@ -53,8 +53,6 @@ "platform/file_provider_impl.h", "platform/network_provider_impl.cc", "platform/network_provider_impl.h", - "platform/resource_provider_impl.cc", - "platform/resource_provider_impl.h", "platform/system_provider_impl.cc", "platform/system_provider_impl.h", "platform_api_impl.cc",
diff --git a/chromeos/services/assistant/platform/file_provider_impl.cc b/chromeos/services/assistant/platform/file_provider_impl.cc index 3077e85..5b7eab7a8 100644 --- a/chromeos/services/assistant/platform/file_provider_impl.cc +++ b/chromeos/services/assistant/platform/file_provider_impl.cc
@@ -7,6 +7,8 @@ #include "base/files/file_util.h" #include "base/logging.h" #include "base/path_service.h" +#include "chromeos/grit/chromeos_resources.h" +#include "ui/base/resource/resource_bundle.h" namespace chromeos { namespace assistant { @@ -82,5 +84,36 @@ base::DeleteFile(root_path_, true); } +bool FileProviderImpl::GetResource(uint16_t resource_id, std::string* out) { + int chrome_resource_id = -1; + switch (resource_id) { + case assistant_client::resource_ids::kGeneralError: + chrome_resource_id = IDR_ASSISTANT_SPEECH_RECOGNITION_ERROR; + break; + case assistant_client::resource_ids::kWifiNeedsSetupError: + case assistant_client::resource_ids::kWifiNotConnectedError: + case assistant_client::resource_ids::kWifiCannotConnectError: + case assistant_client::resource_ids::kNetworkConnectingError: + // These above do not apply to ChromeOS, but let it fall through to get a + // generic error. + case assistant_client::resource_ids::kNetworkCannotReachServerError: + chrome_resource_id = IDR_ASSISTANT_NO_INTERNET_ERROR; + break; + case assistant_client::resource_ids::kDefaultHotwordResourceId: + chrome_resource_id = IDR_ASSISTANT_HOTWORD_MODEL; + break; + default: + break; + } + + if (chrome_resource_id < 0) + return false; + + auto data = ui::ResourceBundle::GetSharedInstance().GetRawDataResource( + chrome_resource_id); + out->assign(data.data(), data.length()); + return true; +} + } // namespace assistant } // namespace chromeos
diff --git a/chromeos/services/assistant/platform/file_provider_impl.h b/chromeos/services/assistant/platform/file_provider_impl.h index ff94b9a..bbd3645 100644 --- a/chromeos/services/assistant/platform/file_provider_impl.h +++ b/chromeos/services/assistant/platform/file_provider_impl.h
@@ -26,6 +26,7 @@ bool WriteSecureFile(const std::string& path, const std::string& data) override; void CleanAssistantData() override; + bool GetResource(uint16_t resource_id, std::string* out) override; private: // Root path which other paths are relative to.
diff --git a/chromeos/services/assistant/platform/resource_provider_impl.cc b/chromeos/services/assistant/platform/resource_provider_impl.cc deleted file mode 100644 index 16bfb19..0000000 --- a/chromeos/services/assistant/platform/resource_provider_impl.cc +++ /dev/null
@@ -1,77 +0,0 @@ -// Copyright 2018 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 "chromeos/services/assistant/platform/resource_provider_impl.h" - -#include "chromeos/grit/chromeos_resources.h" -#include "ui/base/resource/resource_bundle.h" - -namespace { - -constexpr char kHotwordModelName[] = "ok google"; - -} // namespace - -namespace chromeos { -namespace assistant { - -ResourceProviderImpl::ResourceProviderImpl() = default; - -ResourceProviderImpl::~ResourceProviderImpl() = default; - -bool ResourceProviderImpl::GetResource(uint16_t resource_id, std::string* out) { - int chrome_resource_id = -1; - switch (resource_id) { - case assistant_client::resource_ids::kGeneralError: - chrome_resource_id = IDR_ASSISTANT_SPEECH_RECOGNITION_ERROR; - break; - case assistant_client::resource_ids::kWifiNeedsSetupError: - case assistant_client::resource_ids::kWifiNotConnectedError: - case assistant_client::resource_ids::kWifiCannotConnectError: - case assistant_client::resource_ids::kNetworkConnectingError: - // These above do not apply to ChromeOS, but let it fall through to get a - // generic error. - case assistant_client::resource_ids::kNetworkCannotReachServerError: - chrome_resource_id = IDR_ASSISTANT_NO_INTERNET_ERROR; - break; - case assistant_client::resource_ids::kDefaultHotwordResourceId: - return GetHotwordData(GetDefaultHotwordName(), out); - default: - break; - } - - if (chrome_resource_id < 0) - return false; - - auto data = ui::ResourceBundle::GetSharedInstance().GetRawDataResource( - chrome_resource_id); - out->assign(data.data(), data.length()); - return true; -} - -std::vector<std::string> ResourceProviderImpl::GetHotwordNameList() { - std::vector<std::string> result; - std::string name = GetDefaultHotwordName(); - if (!name.empty()) - result.push_back(name); - return result; -} - -std::string ResourceProviderImpl::GetDefaultHotwordName() { - return kHotwordModelName; -} - -bool ResourceProviderImpl::GetHotwordData(const std::string& name, - std::string* result) { - if (name != kHotwordModelName) - return false; - - auto data = ui::ResourceBundle::GetSharedInstance().GetRawDataResource( - IDR_ASSISTANT_HOTWORD_MODEL); - result->assign(data.data(), data.length()); - return true; -} - -} // namespace assistant -} // namespace chromeos
diff --git a/chromeos/services/assistant/platform/resource_provider_impl.h b/chromeos/services/assistant/platform/resource_provider_impl.h deleted file mode 100644 index 00fd9535..0000000 --- a/chromeos/services/assistant/platform/resource_provider_impl.h +++ /dev/null
@@ -1,35 +0,0 @@ -// Copyright 2018 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 CHROMEOS_SERVICES_ASSISTANT_PLATFORM_RESOURCE_PROVIDER_IMPL_H_ -#define CHROMEOS_SERVICES_ASSISTANT_PLATFORM_RESOURCE_PROVIDER_IMPL_H_ - -#include <string> -#include <vector> - -#include "base/macros.h" -#include "libassistant/shared/public/platform_resources.h" - -namespace chromeos { -namespace assistant { - -class ResourceProviderImpl : public assistant_client::ResourceProvider { - public: - ResourceProviderImpl(); - ~ResourceProviderImpl() override; - - // assistant_client::ResourceProvider implementation: - bool GetResource(uint16_t resource_id, std::string* out) override; - std::vector<std::string> GetHotwordNameList() override; - std::string GetDefaultHotwordName() override; - bool GetHotwordData(const std::string& name, std::string* result) override; - - private: - DISALLOW_COPY_AND_ASSIGN(ResourceProviderImpl); -}; - -} // namespace assistant -} // namespace chromeos - -#endif // CHROMEOS_SERVICES_ASSISTANT_PLATFORM_RESOURCE_PROVIDER_IMPL_H_
diff --git a/chromeos/services/assistant/platform_api_impl.cc b/chromeos/services/assistant/platform_api_impl.cc index 574f7d4..0960530 100644 --- a/chromeos/services/assistant/platform_api_impl.cc +++ b/chromeos/services/assistant/platform_api_impl.cc
@@ -18,10 +18,8 @@ using assistant_client::AuthProvider; using assistant_client::FileProvider; using assistant_client::NetworkProvider; -using assistant_client::ResourceProvider; using assistant_client::SystemProvider; using assistant_client::PlatformApi; -using assistant_client::ResourceProvider; namespace chromeos { namespace assistant { @@ -103,10 +101,6 @@ return network_provider_; } -ResourceProvider& PlatformApiImpl::GetResourceProvider() { - return resource_provider_; -} - SystemProvider& PlatformApiImpl::GetSystemProvider() { return system_provider_; }
diff --git a/chromeos/services/assistant/platform_api_impl.h b/chromeos/services/assistant/platform_api_impl.h index f2fcf5c3..1740fb5 100644 --- a/chromeos/services/assistant/platform_api_impl.h +++ b/chromeos/services/assistant/platform_api_impl.h
@@ -13,7 +13,6 @@ #include "chromeos/services/assistant/platform/audio_input_provider_impl.h" #include "chromeos/services/assistant/platform/file_provider_impl.h" #include "chromeos/services/assistant/platform/network_provider_impl.h" -#include "chromeos/services/assistant/platform/resource_provider_impl.h" #include "chromeos/services/assistant/platform/system_provider_impl.h" #include "chromeos/services/assistant/public/mojom/assistant.mojom.h" // TODO(xiaohuic): replace with "base/macros.h" once we remove @@ -45,7 +44,6 @@ assistant_client::AuthProvider& GetAuthProvider() override; assistant_client::FileProvider& GetFileProvider() override; assistant_client::NetworkProvider& GetNetworkProvider() override; - assistant_client::ResourceProvider& GetResourceProvider() override; assistant_client::SystemProvider& GetSystemProvider() override; // Called when the mic state associated with the interaction is changed. @@ -89,7 +87,6 @@ DummyAuthProvider auth_provider_; FileProviderImpl file_provider_; NetworkProviderImpl network_provider_; - ResourceProviderImpl resource_provider_; SystemProviderImpl system_provider_; DISALLOW_COPY_AND_ASSIGN(PlatformApiImpl);
diff --git a/components/arc/arc_session_runner.cc b/components/arc/arc_session_runner.cc index 94c5f30..23cf4f2 100644 --- a/components/arc/arc_session_runner.cc +++ b/components/arc/arc_session_runner.cc
@@ -290,8 +290,8 @@ // PostTask, because observer callback may call RequestStart()/Stop(). VLOG(0) << "ARC restarting"; restart_timer_.Start(FROM_HERE, restart_delay_, - base::Bind(&ArcSessionRunner::RestartArcSession, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&ArcSessionRunner::RestartArcSession, + weak_ptr_factory_.GetWeakPtr())); } // The observers should be agnostic to the existence of the limited-purpose
diff --git a/components/arc/power/arc_power_bridge.cc b/components/arc/power/arc_power_bridge.cc index 7e7a2db..7bb61e2 100644 --- a/components/arc/power/arc_power_bridge.cc +++ b/components/arc/power/arc_power_bridge.cc
@@ -201,8 +201,8 @@ } else { notify_brightness_timer_.Start( FROM_HERE, kNotifyBrightnessDelay, - base::Bind(&ArcPowerBridge::UpdateAndroidScreenBrightness, - weak_ptr_factory_.GetWeakPtr(), change.percent())); + base::BindOnce(&ArcPowerBridge::UpdateAndroidScreenBrightness, + weak_ptr_factory_.GetWeakPtr(), change.percent())); } last_brightness_changed_time_ = now; }
diff --git a/components/autofill/content/browser/DEPS b/components/autofill/content/browser/DEPS index c9b21e4..847530b9 100644 --- a/components/autofill/content/browser/DEPS +++ b/components/autofill/content/browser/DEPS
@@ -4,6 +4,7 @@ "+gpu/config/gpu_info.h", "+services/device/public", "+services/service_manager/public/mojom", + "+third_party/blink/public/common", "+third_party/blink/public/platform/web_rect.h", ]
diff --git a/components/autofill/content/browser/content_autofill_driver.cc b/components/autofill/content/browser/content_autofill_driver.cc index fb8391c..944b69b2 100644 --- a/components/autofill/content/browser/content_autofill_driver.cc +++ b/components/autofill/content/browser/content_autofill_driver.cc
@@ -24,7 +24,7 @@ #include "content/public/browser/storage_partition.h" #include "content/public/browser/web_contents.h" #include "content/public/common/origin_util.h" -#include "services/service_manager/public/cpp/interface_provider.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" #include "ui/gfx/geometry/size_f.h" namespace autofill { @@ -64,7 +64,8 @@ return factory ? factory->DriverForFrame(render_frame_host) : nullptr; } -void ContentAutofillDriver::BindRequest(mojom::AutofillDriverRequest request) { +void ContentAutofillDriver::BindRequest( + mojom::AutofillDriverAssociatedRequest request) { binding_.Bind(std::move(request)); } @@ -285,10 +286,11 @@ autofill_manager_->SetExternalDelegate(autofill_external_delegate_.get()); } -const mojom::AutofillAgentPtr& ContentAutofillDriver::GetAutofillAgent() { +const mojom::AutofillAgentAssociatedPtr& +ContentAutofillDriver::GetAutofillAgent() { // Here is a lazy binding, and will not reconnect after connection error. if (!autofill_agent_) { - render_frame_host_->GetRemoteInterfaces()->GetInterface( + render_frame_host_->GetRemoteAssociatedInterfaces()->GetInterface( mojo::MakeRequest(&autofill_agent_)); }
diff --git a/components/autofill/content/browser/content_autofill_driver.h b/components/autofill/content/browser/content_autofill_driver.h index 83c9d743..248daefe 100644 --- a/components/autofill/content/browser/content_autofill_driver.h +++ b/components/autofill/content/browser/content_autofill_driver.h
@@ -15,7 +15,7 @@ #include "components/autofill/core/browser/autofill_driver.h" #include "components/autofill/core/browser/autofill_external_delegate.h" #include "components/autofill/core/browser/autofill_manager.h" -#include "mojo/public/cpp/bindings/binding.h" +#include "mojo/public/cpp/bindings/associated_binding.h" namespace content { class NavigationHandle; @@ -46,7 +46,7 @@ static ContentAutofillDriver* GetForRenderFrameHost( content::RenderFrameHost* render_frame_host); - void BindRequest(mojom::AutofillDriverRequest request); + void BindRequest(mojom::AutofillDriverAssociatedRequest request); // AutofillDriver: bool IsIncognito() const override; @@ -118,7 +118,7 @@ AutofillManager* autofill_manager() { return autofill_manager_; } content::RenderFrameHost* render_frame_host() { return render_frame_host_; } - const mojom::AutofillAgentPtr& GetAutofillAgent(); + const mojom::AutofillAgentAssociatedPtr& GetAutofillAgent(); // Methods forwarded to key_press_handler_manager_. void RegisterKeyPressHandler( @@ -160,9 +160,9 @@ KeyPressHandlerManager key_press_handler_manager_; - mojo::Binding<mojom::AutofillDriver> binding_; + mojo::AssociatedBinding<mojom::AutofillDriver> binding_; - mojom::AutofillAgentPtr autofill_agent_; + mojom::AutofillAgentAssociatedPtr autofill_agent_; }; } // namespace autofill
diff --git a/components/autofill/content/browser/content_autofill_driver_factory.cc b/components/autofill/content/browser/content_autofill_driver_factory.cc index f67d15c..6825bcf 100644 --- a/components/autofill/content/browser/content_autofill_driver_factory.cc +++ b/components/autofill/content/browser/content_autofill_driver_factory.cc
@@ -79,7 +79,7 @@ // static void ContentAutofillDriverFactory::BindAutofillDriver( - mojom::AutofillDriverRequest request, + mojom::AutofillDriverAssociatedRequest request, content::RenderFrameHost* render_frame_host) { content::WebContents* web_contents = content::WebContents::FromRenderFrameHost(render_frame_host);
diff --git a/components/autofill/content/browser/content_autofill_driver_factory.h b/components/autofill/content/browser/content_autofill_driver_factory.h index 1bcb2f9..2ff9b33 100644 --- a/components/autofill/content/browser/content_autofill_driver_factory.h +++ b/components/autofill/content/browser/content_autofill_driver_factory.h
@@ -45,9 +45,8 @@ static ContentAutofillDriverFactory* FromWebContents( content::WebContents* contents); - static void BindAutofillDriver( - mojom::AutofillDriverRequest request, - content::RenderFrameHost* render_frame_host); + static void BindAutofillDriver(mojom::AutofillDriverAssociatedRequest request, + content::RenderFrameHost* render_frame_host); // Gets the |ContentAutofillDriver| associated with |render_frame_host|. // |render_frame_host| must be owned by |web_contents()|.
diff --git a/components/autofill/content/browser/content_autofill_driver_unittest.cc b/components/autofill/content/browser/content_autofill_driver_unittest.cc index bb19918..b883e96 100644 --- a/components/autofill/content/browser/content_autofill_driver_unittest.cc +++ b/components/autofill/content/browser/content_autofill_driver_unittest.cc
@@ -28,11 +28,11 @@ #include "content/public/browser/web_contents.h" #include "content/public/common/frame_navigate_params.h" #include "content/public/test/test_renderer_host.h" -#include "mojo/public/cpp/bindings/binding_set.h" +#include "mojo/public/cpp/bindings/associated_binding_set.h" #include "net/base/net_errors.h" -#include "services/service_manager/public/cpp/interface_provider.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" namespace autofill { @@ -52,8 +52,9 @@ ~FakeAutofillAgent() override {} - void BindRequest(mojo::ScopedMessagePipeHandle handle) { - bindings_.AddBinding(this, mojom::AutofillAgentRequest(std::move(handle))); + void BindRequest(mojo::ScopedInterfaceEndpointHandle handle) { + bindings_.AddBinding( + this, mojom::AutofillAgentAssociatedRequest(std::move(handle))); } void SetQuitLoopClosure(base::Closure closure) { quit_closure_ = closure; } @@ -210,7 +211,7 @@ void SetQueryPasswordSuggestion(bool query) override{}; - mojo::BindingSet<mojom::AutofillAgent> bindings_; + mojo::AssociatedBindingSet<mojom::AutofillAgent> bindings_; base::Closure quit_closure_; @@ -285,12 +286,12 @@ driver_.reset(new TestContentAutofillDriver(web_contents()->GetMainFrame(), test_autofill_client_.get())); - service_manager::InterfaceProvider* remote_interfaces = - web_contents()->GetMainFrame()->GetRemoteInterfaces(); - service_manager::InterfaceProvider::TestApi test_api(remote_interfaces); - test_api.SetBinderForName(mojom::AutofillAgent::Name_, - base::Bind(&FakeAutofillAgent::BindRequest, - base::Unretained(&fake_agent_))); + blink::AssociatedInterfaceProvider* remote_interfaces = + web_contents()->GetMainFrame()->GetRemoteAssociatedInterfaces(); + remote_interfaces->OverrideBinderForTesting( + mojom::AutofillAgent::Name_, + base::BindRepeating(&FakeAutofillAgent::BindRequest, + base::Unretained(&fake_agent_))); } void TearDown() override {
diff --git a/components/autofill/content/browser/risk/fingerprint.cc b/components/autofill/content/browser/risk/fingerprint.cc index 5b8edff..e6fd910 100644 --- a/components/autofill/content/browser/risk/fingerprint.cc +++ b/components/autofill/content/browser/risk/fingerprint.cc
@@ -289,9 +289,10 @@ weak_ptr_factory_(this) { DCHECK(!install_time_.is_null()); - timeout_timer_.Start(FROM_HERE, timeout, - base::Bind(&FingerprintDataLoader::MaybeFillFingerprint, - weak_ptr_factory_.GetWeakPtr())); + timeout_timer_.Start( + FROM_HERE, timeout, + base::BindOnce(&FingerprintDataLoader::MaybeFillFingerprint, + weak_ptr_factory_.GetWeakPtr())); // Load GPU data if needed. if (gpu_data_manager_->GpuAccessAllowed(nullptr) && @@ -302,17 +303,15 @@ #if BUILDFLAG(ENABLE_PLUGINS) // Load plugin data. - content::PluginService::GetInstance()->GetPlugins( - base::Bind(&FingerprintDataLoader::OnGotPlugins, - weak_ptr_factory_.GetWeakPtr())); + content::PluginService::GetInstance()->GetPlugins(base::BindOnce( + &FingerprintDataLoader::OnGotPlugins, weak_ptr_factory_.GetWeakPtr())); #else waiting_on_plugins_ = false; #endif // Load font data. - content::GetFontListAsync( - base::Bind(&FingerprintDataLoader::OnGotFonts, - weak_ptr_factory_.GetWeakPtr())); + content::GetFontListAsync(base::BindOnce(&FingerprintDataLoader::OnGotFonts, + weak_ptr_factory_.GetWeakPtr())); // Load geolocation data. DCHECK(connector);
diff --git a/components/autofill/content/renderer/BUILD.gn b/components/autofill/content/renderer/BUILD.gn index d113256..21feadfe 100644 --- a/components/autofill/content/renderer/BUILD.gn +++ b/components/autofill/content/renderer/BUILD.gn
@@ -54,6 +54,7 @@ "//services/service_manager/public/cpp", "//skia", "//third_party/blink/public:blink", + "//third_party/blink/public/common", "//third_party/re2", "//ui/base", ]
diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components/autofill/content/renderer/autofill_agent.cc index 55b8e61..3542d614 100644 --- a/components/autofill/content/renderer/autofill_agent.cc +++ b/components/autofill/content/renderer/autofill_agent.cc
@@ -45,6 +45,7 @@ #include "content/public/renderer/render_view.h" #include "net/cert/cert_status_flags.h" #include "services/service_manager/public/cpp/interface_provider.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" #include "third_party/blink/public/platform/web_keyboard_event.h" #include "third_party/blink/public/platform/web_url_request.h" #include "third_party/blink/public/web/web_console_message.h" @@ -132,7 +133,7 @@ AutofillAgent::AutofillAgent(content::RenderFrame* render_frame, PasswordAutofillAgent* password_autofill_agent, PasswordGenerationAgent* password_generation_agent, - service_manager::BinderRegistry* registry) + blink::AssociatedInterfaceRegistry* registry) : content::RenderFrameObserver(render_frame), form_cache_(render_frame->GetWebFrame()), password_autofill_agent_(password_autofill_agent), @@ -158,7 +159,7 @@ RemoveFormObserver(this); } -void AutofillAgent::BindRequest(mojom::AutofillAgentRequest request) { +void AutofillAgent::BindRequest(mojom::AutofillAgentAssociatedRequest request) { binding_.Bind(std::move(request)); } @@ -1130,9 +1131,9 @@ } } -const mojom::AutofillDriverPtr& AutofillAgent::GetAutofillDriver() { +const mojom::AutofillDriverAssociatedPtr& AutofillAgent::GetAutofillDriver() { if (!autofill_driver_) { - render_frame()->GetRemoteInterfaces()->GetInterface( + render_frame()->GetRemoteAssociatedInterfaces()->GetInterface( mojo::MakeRequest(&autofill_driver_)); }
diff --git a/components/autofill/content/renderer/autofill_agent.h b/components/autofill/content/renderer/autofill_agent.h index 4977eace..8da5c3c 100644 --- a/components/autofill/content/renderer/autofill_agent.h +++ b/components/autofill/content/renderer/autofill_agent.h
@@ -19,8 +19,8 @@ #include "components/autofill/content/renderer/form_cache.h" #include "components/autofill/content/renderer/form_tracker.h" #include "content/public/renderer/render_frame_observer.h" -#include "mojo/public/cpp/bindings/binding.h" -#include "services/service_manager/public/cpp/binder_registry.h" +#include "mojo/public/cpp/bindings/associated_binding.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" #include "third_party/blink/public/web/web_autofill_client.h" #include "third_party/blink/public/web/web_form_control_element.h" #include "third_party/blink/public/web/web_form_element.h" @@ -61,12 +61,12 @@ AutofillAgent(content::RenderFrame* render_frame, PasswordAutofillAgent* password_autofill_manager, PasswordGenerationAgent* password_generation_agent, - service_manager::BinderRegistry* registry); + blink::AssociatedInterfaceRegistry* registry); ~AutofillAgent() override; - void BindRequest(mojom::AutofillAgentRequest request); + void BindRequest(mojom::AutofillAgentAssociatedRequest request); - const mojom::AutofillDriverPtr& GetAutofillDriver(); + const mojom::AutofillDriverAssociatedPtr& GetAutofillDriver(); const mojom::PasswordManagerDriverAssociatedPtr& GetPasswordManagerDriver(); @@ -367,9 +367,9 @@ // Whether or not we delay focus handling until scrolling occurs. bool focus_requires_scroll_ = true; - mojo::Binding<mojom::AutofillAgent> binding_; + mojo::AssociatedBinding<mojom::AutofillAgent> binding_; - mojom::AutofillDriverPtr autofill_driver_; + mojom::AutofillDriverAssociatedPtr autofill_driver_; bool was_last_action_fill_ = false;
diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc index 0b261d5..fc06f6d 100644 --- a/components/autofill/content/renderer/password_autofill_agent.cc +++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -684,7 +684,7 @@ PasswordAutofillAgent::PasswordAutofillAgent( content::RenderFrame* render_frame, - service_manager::BinderRegistry* registry) + blink::AssociatedInterfaceRegistry* registry) : content::RenderFrameObserver(render_frame), last_supplied_password_info_iter_(web_input_to_password_info_.end()), logging_state_active_(false), @@ -692,6 +692,7 @@ password_autofill_state_(WebAutofillState::kNotFilled), sent_request_to_store_(false), checked_safe_browsing_reputation_(false), + focus_state_notifier_(this), binding_(this) { registry->AddInterface( base::Bind(&PasswordAutofillAgent::BindRequest, base::Unretained(this))); @@ -704,7 +705,7 @@ } void PasswordAutofillAgent::BindRequest( - mojom::PasswordAutofillAgentRequest request) { + mojom::PasswordAutofillAgentAssociatedRequest request) { binding_.Bind(std::move(request)); } @@ -721,6 +722,26 @@ password_generation_agent_ = generation_agent; } +PasswordAutofillAgent::FocusStateNotifier::FocusStateNotifier( + PasswordAutofillAgent* agent) + : was_fillable_(false), was_password_field_(false), agent_(agent) {} + +PasswordAutofillAgent::FocusStateNotifier::~FocusStateNotifier() = default; + +void PasswordAutofillAgent::FocusStateNotifier::FocusedInputChanged( + bool is_fillable, + bool is_password_field) { + // Forward the request, if the field is valid or the request is different. + if (!is_fillable && !was_fillable_ && !is_password_field && + !was_password_field_) { + return; // A previous request already reported this exact state. + } + was_fillable_ = is_fillable; + was_password_field_ = is_password_field; + agent_->GetPasswordManagerDriver()->FocusedInputChanged(is_fillable, + is_password_field); +} + PasswordAutofillAgent::PasswordValueGatekeeper::PasswordValueGatekeeper() : was_user_gesture_seen_(false) { } @@ -1378,7 +1399,7 @@ if (node.IsNull() || // |node| is null <==> focus outside of frame. !node.IsElementNode()) { // Not a valid WebElement. - GetPasswordManagerDriver()->FocusedInputChanged( + focus_state_notifier_.FocusedInputChanged( /*is_fillable=*/false, /*is_password_field=*/false); return; } @@ -1386,7 +1407,7 @@ WebElement web_element = node.ToConst<WebElement>(); const WebInputElement* input = ToWebInputElement(&web_element); if (!input) { - GetPasswordManagerDriver()->FocusedInputChanged( + focus_state_notifier_.FocusedInputChanged( /*is_fillable=*/false, /*is_password_field=*/false); return; // If the node isn't an element, don't even try to convert. } @@ -1396,7 +1417,7 @@ focused_input_element_ = *input; is_password = focused_input_element_.IsPasswordFieldForAutofill(); } - GetPasswordManagerDriver()->FocusedInputChanged(is_fillable, is_password); + focus_state_notifier_.FocusedInputChanged(is_fillable, is_password); } void PasswordAutofillAgent::OnDestruct() {
diff --git a/components/autofill/content/renderer/password_autofill_agent.h b/components/autofill/content/renderer/password_autofill_agent.h index c68572a..3ae27ad5 100644 --- a/components/autofill/content/renderer/password_autofill_agent.h +++ b/components/autofill/content/renderer/password_autofill_agent.h
@@ -7,6 +7,7 @@ #include <map> #include <memory> +#include <utility> #include <vector> #include "base/macros.h" @@ -26,7 +27,7 @@ #include "content/public/renderer/render_frame_observer.h" #include "content/public/renderer/render_view_observer.h" #include "mojo/public/cpp/bindings/binding.h" -#include "services/service_manager/public/cpp/binder_registry.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" #include "third_party/blink/public/web/web_input_element.h" #if !defined(OS_ANDROID) && !defined(OS_IOS) @@ -59,6 +60,10 @@ kMaxValue = kPrefilledUsernameNotOverridden, }; +// Names of HTML attributes to show form and field signatures for debugging. +extern const char kDebugAttributeForFormSignature[]; +extern const char kDebugAttributeForFieldSignature[]; + class RendererSavePasswordProgressLogger; class PasswordGenerationAgent; @@ -68,10 +73,10 @@ public mojom::PasswordAutofillAgent { public: PasswordAutofillAgent(content::RenderFrame* render_frame, - service_manager::BinderRegistry* registry); + blink::AssociatedInterfaceRegistry* registry); ~PasswordAutofillAgent() override; - void BindRequest(mojom::PasswordAutofillAgentRequest request); + void BindRequest(mojom::PasswordAutofillAgentAssociatedRequest request); void SetAutofillAgent(AutofillAgent* autofill_agent); @@ -206,6 +211,25 @@ using PasswordToLoginMap = std::map<blink::WebInputElement, blink::WebInputElement>; + // This class ensures that the driver will only receive relevant signals by + // caching the parameters of the last message sent to the driver. + class FocusStateNotifier { + public: + // Creates a new notifier that uses the agent which owns it to access the + // real driver implementation. + explicit FocusStateNotifier(PasswordAutofillAgent* agent); + ~FocusStateNotifier(); + + void FocusedInputChanged(bool is_fillable, bool is_password_field); + + private: + bool was_fillable_; + bool was_password_field_; + PasswordAutofillAgent* agent_; + + DISALLOW_COPY_AND_ASSIGN(FocusStateNotifier); + }; + // This class keeps track of autofilled password input elements and makes sure // the autofilled password value is not accessible to JavaScript code until // the user interacts with the page. @@ -419,6 +443,10 @@ // username predictions. UsernameDetectorCache username_detector_cache_; + // This notifier is used to avoid sending redundant messages to the password + // manager driver mojo interface. + FocusStateNotifier focus_state_notifier_; + base::WeakPtr<AutofillAgent> autofill_agent_; PasswordGenerationAgent* password_generation_agent_; // Weak reference. @@ -429,7 +457,7 @@ mojom::PasswordManagerDriverAssociatedPtr password_manager_driver_; - mojo::Binding<mojom::PasswordAutofillAgent> binding_; + mojo::AssociatedBinding<mojom::PasswordAutofillAgent> binding_; bool prefilled_username_metrics_logged_ = false; DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent);
diff --git a/components/autofill/content/renderer/password_generation_agent.cc b/components/autofill/content/renderer/password_generation_agent.cc index ec3ef02e..9a5ca3c3 100644 --- a/components/autofill/content/renderer/password_generation_agent.cc +++ b/components/autofill/content/renderer/password_generation_agent.cc
@@ -200,7 +200,7 @@ PasswordGenerationAgent::PasswordGenerationAgent( content::RenderFrame* render_frame, PasswordAutofillAgent* password_agent, - service_manager::BinderRegistry* registry) + blink::AssociatedInterfaceRegistry* registry) : content::RenderFrameObserver(render_frame), password_is_generated_(false), is_manually_triggered_(false), @@ -215,14 +215,14 @@ binding_(this), maximum_offer_size_(GetMaximumOfferSize()) { LogBoolean(Logger::STRING_GENERATION_RENDERER_ENABLED, enabled_); - registry->AddInterface(base::Bind(&PasswordGenerationAgent::BindRequest, - base::Unretained(this))); + registry->AddInterface(base::BindRepeating( + &PasswordGenerationAgent::BindRequest, base::Unretained(this))); password_agent_->SetPasswordGenerationAgent(this); } PasswordGenerationAgent::~PasswordGenerationAgent() {} void PasswordGenerationAgent::BindRequest( - mojom::PasswordGenerationAgentRequest request) { + mojom::PasswordGenerationAgentAssociatedRequest request) { binding_.Bind(std::move(request)); }
diff --git a/components/autofill/content/renderer/password_generation_agent.h b/components/autofill/content/renderer/password_generation_agent.h index f69ab035..74a2a16b 100644 --- a/components/autofill/content/renderer/password_generation_agent.h +++ b/components/autofill/content/renderer/password_generation_agent.h
@@ -18,8 +18,8 @@ #include "components/autofill/content/common/autofill_driver.mojom.h" #include "components/autofill/content/renderer/renderer_save_password_progress_logger.h" #include "content/public/renderer/render_frame_observer.h" -#include "mojo/public/cpp/bindings/binding.h" -#include "services/service_manager/public/cpp/binder_registry.h" +#include "mojo/public/cpp/bindings/associated_binding.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" #include "third_party/blink/public/web/web_input_element.h" #include "url/gurl.h" @@ -37,10 +37,10 @@ public: PasswordGenerationAgent(content::RenderFrame* render_frame, PasswordAutofillAgent* password_agent, - service_manager::BinderRegistry* registry); + blink::AssociatedInterfaceRegistry* registry); ~PasswordGenerationAgent() override; - void BindRequest(mojom::PasswordGenerationAgentRequest request); + void BindRequest(mojom::PasswordGenerationAgentAssociatedRequest request); // mojom::PasswordGenerationAgent: void FormNotBlacklisted(const PasswordForm& form) override; @@ -226,7 +226,7 @@ mojom::PasswordManagerClientAssociatedPtr password_manager_client_; - mojo::Binding<mojom::PasswordGenerationAgent> binding_; + mojo::AssociatedBinding<mojom::PasswordGenerationAgent> binding_; // The length that a password can be before the UI is hidden. size_t maximum_offer_size_;
diff --git a/components/autofill/content/renderer/test_password_autofill_agent.cc b/components/autofill/content/renderer/test_password_autofill_agent.cc index 560bbbc..6778b3f 100644 --- a/components/autofill/content/renderer/test_password_autofill_agent.cc +++ b/components/autofill/content/renderer/test_password_autofill_agent.cc
@@ -8,7 +8,7 @@ TestPasswordAutofillAgent::TestPasswordAutofillAgent( content::RenderFrame* render_frame, - service_manager::BinderRegistry* registry) + blink::AssociatedInterfaceRegistry* registry) : PasswordAutofillAgent(render_frame, registry) {} TestPasswordAutofillAgent::~TestPasswordAutofillAgent() {}
diff --git a/components/autofill/content/renderer/test_password_autofill_agent.h b/components/autofill/content/renderer/test_password_autofill_agent.h index 2f4add1..12c16dd 100644 --- a/components/autofill/content/renderer/test_password_autofill_agent.h +++ b/components/autofill/content/renderer/test_password_autofill_agent.h
@@ -12,7 +12,7 @@ class TestPasswordAutofillAgent : public PasswordAutofillAgent { public: TestPasswordAutofillAgent(content::RenderFrame* render_frame, - service_manager::BinderRegistry* registry); + blink::AssociatedInterfaceRegistry* registry); ~TestPasswordAutofillAgent() override; private:
diff --git a/components/autofill/content/renderer/test_password_generation_agent.cc b/components/autofill/content/renderer/test_password_generation_agent.cc index 4076003b..14b5017 100644 --- a/components/autofill/content/renderer/test_password_generation_agent.cc +++ b/components/autofill/content/renderer/test_password_generation_agent.cc
@@ -9,7 +9,7 @@ TestPasswordGenerationAgent::TestPasswordGenerationAgent( content::RenderFrame* render_frame, PasswordAutofillAgent* password_agent, - service_manager::BinderRegistry* registry) + blink::AssociatedInterfaceRegistry* registry) : PasswordGenerationAgent(render_frame, password_agent, registry) { // Always enable when testing. set_enabled(true);
diff --git a/components/autofill/content/renderer/test_password_generation_agent.h b/components/autofill/content/renderer/test_password_generation_agent.h index f752803..5ae0e0c 100644 --- a/components/autofill/content/renderer/test_password_generation_agent.h +++ b/components/autofill/content/renderer/test_password_generation_agent.h
@@ -9,7 +9,7 @@ #include "base/macros.h" #include "components/autofill/content/renderer/password_generation_agent.h" -#include "services/service_manager/public/cpp/binder_registry.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" namespace autofill { @@ -17,7 +17,7 @@ public: TestPasswordGenerationAgent(content::RenderFrame* render_frame, PasswordAutofillAgent* password_agent, - service_manager::BinderRegistry* registry); + blink::AssociatedInterfaceRegistry* registry); ~TestPasswordGenerationAgent() override; // PasswordGenreationAgent implementation:
diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc index a357916..a53c36f 100644 --- a/components/autofill/core/browser/personal_data_manager.cc +++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -520,18 +520,6 @@ void PersonalDataManager::OnSyncServiceInitialized( syncer::SyncService* sync_service) { - // If the sync service is not enabled for autofill address profiles then run - // address cleanup/startup code here. Otherwise, defer until after sync has - // started. - if (!IsSyncEnabledFor(sync_service, syncer::AUTOFILL_PROFILE)) - ApplyAddressFixesAndCleanups(); - - // Similarly, if the sync service is not enabled for autofill credit cards - // then run credit card address cleanup/startup code here. Otherwise, defer - // until after sync has started. - if (!IsSyncEnabledFor(sync_service, syncer::AUTOFILL_WALLET_DATA)) - ApplyCardFixesAndCleanups(); - if (sync_service_ != sync_service) { // Before the sync service pointer gets changed, remove the observer. if (sync_service_) @@ -633,9 +621,24 @@ pending_server_profiles_query_ == 0 && pending_server_creditcards_query_ == 0 && database_helper_->GetServerDatabase()) { + // On initial data load, is_data_loaded_ will be false here. + if (!is_data_loaded_) { + // If sync is enabled for addresses, defer running cleanups until address + // sync has started; otherwise, do it now. + if (!IsSyncEnabledFor(sync_service_, syncer::AUTOFILL_PROFILE)) + ApplyAddressFixesAndCleanups(); + + // If sync is enabled for credit cards, defer running cleanups until card + // sync has started; otherwise, do it now. + if (!IsSyncEnabledFor(sync_service_, syncer::AUTOFILL_WALLET_DATA)) + ApplyCardFixesAndCleanups(); + + // Log address and credit card startup metrics. + LogStoredProfileMetrics(); + LogStoredCreditCardMetrics(); + } + is_data_loaded_ = true; - LogStoredProfileMetrics(); - LogStoredCreditCardMetrics(); NotifyPersonalDataChanged(); } } @@ -2463,6 +2466,7 @@ bool PersonalDataManager::DeleteDisusedAddresses() { if (!base::FeatureList::IsEnabled(kAutofillDeleteDisusedAddresses)) { + DVLOG(1) << "Deletion is disabled"; return false; } @@ -2484,6 +2488,7 @@ // Early exit when there are no profiles. if (profiles.empty()) { + DVLOG(1) << "There are no profiles"; return true; }
diff --git a/components/autofill/core/browser/personal_data_manager_unittest.cc b/components/autofill/core/browser/personal_data_manager_unittest.cc index f8146ce..ad871584 100644 --- a/components/autofill/core/browser/personal_data_manager_unittest.cc +++ b/components/autofill/core/browser/personal_data_manager_unittest.cc
@@ -180,7 +180,7 @@ // Verify that the web database has been updated and the notification sent. EXPECT_CALL(personal_data_observer_, OnPersonalDataChanged()) - .WillOnce(QuitMainMessageLoop()); + .WillRepeatedly(QuitMainMessageLoop()); base::RunLoop().Run(); } @@ -349,7 +349,7 @@ // Verifies that the web database has been updated and the notification sent. void WaitForOnPersonalDataChanged() { EXPECT_CALL(personal_data_observer_, OnPersonalDataChanged()) - .WillOnce(QuitMainMessageLoop()); + .WillRepeatedly(QuitMainMessageLoop()); base::RunLoop().Run(); } @@ -6272,7 +6272,7 @@ } // Tests that all the non settings origins of autofill profiles are cleared even -// if Autofill is disabled. +// if sync is disabled. TEST_F( PersonalDataManagerTest, SyncServiceInitializedWithAutofillDisabled_ClearProfileNonSettingsOrigins) { @@ -6285,14 +6285,18 @@ personal_data_->AddProfile(profile); WaitForOnPersonalDataChanged(); - EXPECT_CALL(personal_data_observer_, OnPersonalDataChanged()).Times(1); - prefs_->SetBoolean(prefs::kAutofillEnabled, false); + // Turn off autofill profile sync. + auto model_type_set = sync_service_.GetActiveDataTypes(); + model_type_set.Remove(syncer::AUTOFILL_PROFILE); + sync_service_.SetDataTypes(model_type_set); + // The data should still exist. ASSERT_EQ(1U, personal_data_->GetProfiles().size()); - personal_data_->OnSyncServiceInitialized(nullptr); + // Reload the personal data manager. + ResetPersonalDataManager(USER_MODE_NORMAL); - WaitForOnPersonalDataChanged(); + // The profile should still exist. ASSERT_EQ(1U, personal_data_->GetProfiles().size()); // The profile's origin should be cleared @@ -6300,7 +6304,7 @@ } // Tests that all the non settings origins of autofill credit cards are cleared -// even if Autofill is disabled. +// even if sync is disabled. TEST_F( PersonalDataManagerTest, SyncServiceInitializedWithAutofillDisabled_ClearCreditCardNonSettingsOrigins) { @@ -6312,14 +6316,19 @@ personal_data_->AddCreditCard(credit_card); WaitForOnPersonalDataChanged(); - EXPECT_CALL(personal_data_observer_, OnPersonalDataChanged()).Times(1); - prefs_->SetBoolean(prefs::kAutofillEnabled, false); + // Turn off autofill profile sync. + auto model_type_set = sync_service_.GetActiveDataTypes(); + model_type_set.Remove(syncer::AUTOFILL_WALLET_DATA); + model_type_set.Remove(syncer::AUTOFILL_WALLET_METADATA); + sync_service_.SetDataTypes(model_type_set); + // The credit card should still exist. ASSERT_EQ(1U, personal_data_->GetCreditCards().size()); - personal_data_->OnSyncServiceInitialized(nullptr); + // Reload the personal data manager. + ResetPersonalDataManager(USER_MODE_NORMAL); - WaitForOnPersonalDataChanged(); + // The credit card should still exist. ASSERT_EQ(1U, personal_data_->GetCreditCards().size()); // The card's origin should be cleared
diff --git a/components/autofill/core/browser/region_data_loader_impl.cc b/components/autofill/core/browser/region_data_loader_impl.cc index 9415cc2..698c425 100644 --- a/components/autofill/core/browser/region_data_loader_impl.cc +++ b/components/autofill/core/browser/region_data_loader_impl.cc
@@ -34,8 +34,8 @@ *region_data_supplier_callback_); timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(timeout_ms), - base::Bind(&RegionDataLoaderImpl::OnRegionDataLoaded, - base::Unretained(this), false, country_code, 0)); + base::BindOnce(&RegionDataLoaderImpl::OnRegionDataLoaded, + base::Unretained(this), false, country_code, 0)); } void RegionDataLoaderImpl::ClearCallback() { @@ -61,8 +61,8 @@ // The deletion must be asynchronous since the caller is not quite done with // the preload supplier. base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(&RegionDataLoaderImpl::DeleteThis, base::Unretained(this))); + FROM_HERE, base::BindOnce(&RegionDataLoaderImpl::DeleteThis, + base::Unretained(this))); } void RegionDataLoaderImpl::DeleteThis() {
diff --git a/components/autofill/core/browser/webdata/autocomplete_sync_bridge_unittest.cc b/components/autofill/core/browser/webdata/autocomplete_sync_bridge_unittest.cc index 0dc61f9..a3fae5e 100644 --- a/components/autofill/core/browser/webdata/autocomplete_sync_bridge_unittest.cc +++ b/components/autofill/core/browser/webdata/autocomplete_sync_bridge_unittest.cc
@@ -300,7 +300,7 @@ void VerifyAllData(const std::vector<AutofillSpecifics>& expected) { bridge()->GetAllDataForDebugging( - base::Bind(&VerifyDataBatch, ExpectedMap(expected))); + base::BindOnce(&VerifyDataBatch, ExpectedMap(expected))); } AutocompleteSyncBridge* bridge() { return bridge_.get(); } @@ -424,7 +424,7 @@ SaveSpecificsToTable({specifics1, specifics2, specifics3}); bridge()->GetData( {GetStorageKey(specifics1), GetStorageKey(specifics3)}, - base::Bind(&VerifyDataBatch, ExpectedMap({specifics1, specifics3}))); + base::BindOnce(&VerifyDataBatch, ExpectedMap({specifics1, specifics3}))); } TEST_F(AutocompleteSyncBridgeTest, GetDataNotExist) { @@ -435,7 +435,7 @@ bridge()->GetData( {GetStorageKey(specifics1), GetStorageKey(specifics2), GetStorageKey(specifics3)}, - base::Bind(&VerifyDataBatch, ExpectedMap({specifics1, specifics2}))); + base::BindOnce(&VerifyDataBatch, ExpectedMap({specifics1, specifics2}))); } TEST_F(AutocompleteSyncBridgeTest, GetAllData) {
diff --git a/components/autofill/core/browser/webdata/autofill_webdata_backend_impl.cc b/components/autofill/core/browser/webdata/autofill_webdata_backend_impl.cc index d57b01c..e1f9b6e 100644 --- a/components/autofill/core/browser/webdata/autofill_webdata_backend_impl.cc +++ b/components/autofill/core/browser/webdata/autofill_webdata_backend_impl.cc
@@ -82,8 +82,8 @@ return; // UI sequence notification. - ui_task_runner_->PostTask(FROM_HERE, - base::Bind(on_sync_started_callback_, model_type)); + ui_task_runner_->PostTask( + FROM_HERE, base::BindOnce(on_sync_started_callback_, model_type)); } base::SupportsUserData* AutofillWebDataBackendImpl::GetDBUserData() {
diff --git a/components/autofill/core/browser/webdata/autofill_webdata_service.cc b/components/autofill/core/browser/webdata/autofill_webdata_service.cc index 4d9db9d..e00a5fca 100644 --- a/components/autofill/core/browser/webdata/autofill_webdata_service.cc +++ b/components/autofill/core/browser/webdata/autofill_webdata_service.cc
@@ -67,7 +67,7 @@ weak_ptr_factory_.InvalidateWeakPtrs(); db_task_runner_->PostTask( FROM_HERE, - Bind(&AutofillWebDataBackendImpl::ResetUserData, autofill_backend_)); + BindOnce(&AutofillWebDataBackendImpl::ResetUserData, autofill_backend_)); WebDataServiceBase::ShutdownOnUISequence(); } @@ -298,7 +298,8 @@ void AutofillWebDataService::GetAutofillBackend( const base::Callback<void(AutofillWebDataBackend*)>& callback) { db_task_runner_->PostTask( - FROM_HERE, base::Bind(callback, base::RetainedRef(autofill_backend_))); + FROM_HERE, + base::BindOnce(callback, base::RetainedRef(autofill_backend_))); } base::SingleThreadTaskRunner* AutofillWebDataService::GetDBTaskRunner() {
diff --git a/components/autofill/core/browser/webdata/web_data_service_unittest.cc b/components/autofill/core/browser/webdata/web_data_service_unittest.cc index 9058c7e..329a9085 100644 --- a/components/autofill/core/browser/webdata/web_data_service_unittest.cc +++ b/components/autofill/core/browser/webdata/web_data_service_unittest.cc
@@ -151,7 +151,7 @@ AutofillWebDataServiceObserverOnDBSequence*) = &AutofillWebDataService::AddObserver; wds_->GetDBTaskRunner()->PostTask( - FROM_HERE, base::Bind(add_observer_func, wds_, &observer_)); + FROM_HERE, base::BindOnce(add_observer_func, wds_, &observer_)); base::TaskScheduler::GetInstance()->FlushForTesting(); } @@ -160,7 +160,7 @@ AutofillWebDataServiceObserverOnDBSequence*) = &AutofillWebDataService::RemoveObserver; wds_->GetDBTaskRunner()->PostTask( - FROM_HERE, base::Bind(remove_observer_func, wds_, &observer_)); + FROM_HERE, base::BindOnce(remove_observer_func, wds_, &observer_)); WebDataServiceTest::TearDown(); }
diff --git a/components/bookmarks/browser/bookmark_storage.cc b/components/bookmarks/browser/bookmark_storage.cc index 0cf205f0..5a0be89 100644 --- a/components/bookmarks/browser/bookmark_storage.cc +++ b/components/bookmarks/browser/bookmark_storage.cc
@@ -217,9 +217,9 @@ case BACKUP_NONE: backup_state_ = BACKUP_DISPATCHED; sequenced_task_runner_->PostTaskAndReply( - FROM_HERE, base::Bind(&BackupCallback, writer_.path()), - base::Bind(&BookmarkStorage::OnBackupFinished, - weak_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&BackupCallback, writer_.path()), + base::BindOnce(&BookmarkStorage::OnBackupFinished, + weak_factory_.GetWeakPtr())); return; case BACKUP_DISPATCHED: // Currently doing a backup which will call this function when done.
diff --git a/components/bookmarks/managed/managed_bookmark_service.cc b/components/bookmarks/managed/managed_bookmark_service.cc index 4fd1978..4a619b9 100644 --- a/components/bookmarks/managed/managed_bookmark_service.cc +++ b/components/bookmarks/managed/managed_bookmark_service.cc
@@ -111,7 +111,7 @@ managed_bookmarks_tracker_->GetInitialManagedBookmarks(), IDS_BOOKMARK_BAR_MANAGED_FOLDER_DEFAULT_NAME); - return base::Bind(&LoadExtraNodes, base::Passed(&loader)); + return base::BindOnce(&LoadExtraNodes, std::move(loader)); } bool ManagedBookmarkService::CanSetPermanentNodeTitle(
diff --git a/components/bookmarks/test/test_bookmark_client.cc b/components/bookmarks/test/test_bookmark_client.cc index f9a961c..d9ad27b 100644 --- a/components/bookmarks/test/test_bookmark_client.cc +++ b/components/bookmarks/test/test_bookmark_client.cc
@@ -78,8 +78,8 @@ } LoadExtraCallback TestBookmarkClient::GetLoadExtraNodesCallback() { - return base::Bind(&TestBookmarkClient::LoadExtraNodes, - base::Passed(&extra_nodes_)); + return base::BindOnce(&TestBookmarkClient::LoadExtraNodes, + std::move(extra_nodes_)); } bool TestBookmarkClient::CanSetPermanentNodeTitle(
diff --git a/components/browser_sync/abstract_profile_sync_service_test.cc b/components/browser_sync/abstract_profile_sync_service_test.cc index f335b83..f23bf07 100644 --- a/components/browser_sync/abstract_profile_sync_service_test.cc +++ b/components/browser_sync/abstract_profile_sync_service_test.cc
@@ -107,7 +107,7 @@ // Posted to avoid re-entrancy issues. base::SequencedTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind( + base::BindOnce( &SyncEngineForProfileSyncTest::FinishConfigureDataTypesOnFrontendLoop, base::Unretained(this), params.to_download, params.to_download, syncer::ModelTypeSet(), params.ready_task));
diff --git a/components/browser_watcher/exit_code_watcher_win_unittest.cc b/components/browser_watcher/exit_code_watcher_win_unittest.cc index e5edaa28..2b8845b 100644 --- a/components/browser_watcher/exit_code_watcher_win_unittest.cc +++ b/components/browser_watcher/exit_code_watcher_win_unittest.cc
@@ -119,16 +119,6 @@ } // namespace -TEST_F(ExitCodeWatcherTest, ExitCodeWatcherInvalidHandleFailsInit) { - ExitCodeWatcher watcher(kRegistryPath); - - // A waitable event has a non process-handle. - base::Process event(::CreateEvent(nullptr, false, false, nullptr)); - - // A non-process handle should fail. - EXPECT_FALSE(watcher.Initialize(std::move(event))); -} - TEST_F(ExitCodeWatcherTest, ExitCodeWatcherNoAccessHandleFailsInit) { ExitCodeWatcher watcher(kRegistryPath);
diff --git a/components/browsing_data/content/conditional_cache_counting_helper.cc b/components/browsing_data/content/conditional_cache_counting_helper.cc index 985a4e7..0f9c6fa 100644 --- a/components/browsing_data/content/conditional_cache_counting_helper.cc +++ b/components/browsing_data/content/conditional_cache_counting_helper.cc
@@ -142,8 +142,9 @@ : CacheState::COUNT_MEDIA; rv = http_cache->GetBackend( - &cache_, base::Bind(&ConditionalCacheCountingHelper::DoCountCache, - base::Unretained(this))); + &cache_, + base::BindOnce(&ConditionalCacheCountingHelper::DoCountCache, + base::Unretained(this))); break; } case CacheState::COUNT_MAIN: @@ -156,18 +157,18 @@ if (cache_) { if (begin_time_.is_null() && end_time_.is_max()) { rv = cache_->CalculateSizeOfAllEntries( - base::Bind(&ConditionalCacheCountingHelper::DoCountCache, - base::Unretained(this))); + base::BindOnce(&ConditionalCacheCountingHelper::DoCountCache, + base::Unretained(this))); } else { rv = cache_->CalculateSizeOfEntriesBetween( begin_time_, end_time_, - base::Bind(&ConditionalCacheCountingHelper::DoCountCache, - base::Unretained(this))); + base::BindOnce(&ConditionalCacheCountingHelper::DoCountCache, + base::Unretained(this))); if (rv == net::ERR_NOT_IMPLEMENTED) { is_upper_limit_ = true; rv = cache_->CalculateSizeOfAllEntries( - base::Bind(&ConditionalCacheCountingHelper::DoCountCache, - base::Unretained(this))); + base::BindOnce(&ConditionalCacheCountingHelper::DoCountCache, + base::Unretained(this))); } } cache_ = nullptr; @@ -180,8 +181,8 @@ // Notify the UI thread that we are done. BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - base::Bind(&ConditionalCacheCountingHelper::Finished, - base::Unretained(this))); + base::BindOnce(&ConditionalCacheCountingHelper::Finished, + base::Unretained(this))); return; } case CacheState::NONE: {
diff --git a/components/browsing_data/core/counters/browsing_data_counter_unittest.cc b/components/browsing_data/core/counters/browsing_data_counter_unittest.cc index 370a5a8..ab1bc7f 100644 --- a/components/browsing_data/core/counters/browsing_data_counter_unittest.cc +++ b/components/browsing_data/core/counters/browsing_data_counter_unittest.cc
@@ -48,10 +48,10 @@ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::Bind(static_cast<ReportResultType>( - &MockBrowsingDataCounter::ReportResult), - base::Unretained(this), - static_cast<BrowsingDataCounter::ResultInt>(0)), + base::BindOnce(static_cast<ReportResultType>( + &MockBrowsingDataCounter::ReportResult), + base::Unretained(this), + static_cast<BrowsingDataCounter::ResultInt>(0)), base::TimeDelta::FromMilliseconds(delay_ms_)); }
diff --git a/components/cast_channel/cast_message_handler.cc b/components/cast_channel/cast_message_handler.cc index 11e6042..c74f08c2 100644 --- a/components/cast_channel/cast_message_handler.cc +++ b/components/cast_channel/cast_message_handler.cc
@@ -344,8 +344,9 @@ int request_id = request->request_id; request->timeout_timer.Start( FROM_HERE, kRequestTimeout, - base::Bind(&CastMessageHandler::PendingRequests::AppAvailabilityTimedOut, - base::Unretained(this), request_id)); + base::BindOnce( + &CastMessageHandler::PendingRequests::AppAvailabilityTimedOut, + base::Unretained(this), request_id)); pending_app_availability_requests.emplace(app_id, std::move(request)); return true; } @@ -359,8 +360,9 @@ int request_id = request->request_id; request->timeout_timer.Start( FROM_HERE, timeout, - base::Bind(&CastMessageHandler::PendingRequests::LaunchSessionTimedOut, - base::Unretained(this), request_id)); + base::BindOnce( + &CastMessageHandler::PendingRequests::LaunchSessionTimedOut, + base::Unretained(this), request_id)); pending_launch_session_request = std::move(request); return true; }
diff --git a/components/cast_channel/cast_socket.cc b/components/cast_channel/cast_socket.cc index 29e1201..a7b3206 100644 --- a/components/cast_channel/cast_socket.cc +++ b/components/cast_channel/cast_socket.cc
@@ -307,7 +307,7 @@ ResetConnectLoopCallback(); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(connect_loop_callback_.callback(), result)); + FROM_HERE, base::BindOnce(connect_loop_callback_.callback(), result)); } // This method performs the state machine transitions for connection flow. @@ -380,7 +380,7 @@ tcp_socket_ = CreateTcpSocket(); int rv = tcp_socket_->Connect( - base::Bind(&CastSocketImpl::DoConnectLoop, base::Unretained(this))); + base::BindOnce(&CastSocketImpl::DoConnectLoop, base::Unretained(this))); logger_->LogSocketEventWithRv(channel_id_, ChannelEvent::TCP_SOCKET_CONNECT, rv); return rv; @@ -409,7 +409,7 @@ socket_ = CreateSslSocket(std::move(tcp_socket_)); int rv = socket_->Connect( - base::Bind(&CastSocketImpl::DoConnectLoop, base::Unretained(this))); + base::BindOnce(&CastSocketImpl::DoConnectLoop, base::Unretained(this))); logger_->LogSocketEventWithRv(channel_id_, ChannelEvent::SSL_SOCKET_CONNECT, rv); return rv;
diff --git a/components/cast_channel/cast_socket_unittest.cc b/components/cast_channel/cast_socket_unittest.cc index d9452ca..a67424d 100644 --- a/components/cast_channel/cast_socket_unittest.cc +++ b/components/cast_channel/cast_socket_unittest.cc
@@ -377,8 +377,8 @@ EXPECT_CALL(*socket_->GetMockTransport(), Start()); EXPECT_CALL(handler_, OnConnectComplete(socket_.get())); socket_->AddObserver(observer_.get()); - socket_->Connect(base::Bind(&CompleteHandler::OnConnectComplete, - base::Unretained(&handler_))); + socket_->Connect(base::BindOnce(&CompleteHandler::OnConnectComplete, + base::Unretained(&handler_))); RunPendingTasks(); socket_->GetMockTransport()->current_delegate()->OnMessage( CreateAuthReply()); @@ -428,7 +428,7 @@ accept_result_ = tcp_server_socket_->Accept( &accepted_socket, base::Bind(&SslCastSocketTest::TcpAcceptCallback, base::Unretained(this))); - connect_result_ = tcp_client_socket_->Connect(base::Bind( + connect_result_ = tcp_client_socket_->Connect(base::BindOnce( &SslCastSocketTest::TcpConnectCallback, base::Unretained(this))); while (accept_result_ == net::ERR_IO_PENDING || connect_result_ == net::ERR_IO_PENDING) { @@ -448,8 +448,8 @@ void ConnectSockets() { socket_->AddObserver(observer_.get()); - socket_->Connect(base::Bind(&CompleteHandler::OnConnectComplete, - base::Unretained(&handler_))); + socket_->Connect(base::BindOnce(&CompleteHandler::OnConnectComplete, + base::Unretained(&handler_))); net::TestCompletionCallback handshake_callback; int server_ret = handshake_callback.GetResult( @@ -591,8 +591,8 @@ .WillOnce(PostCompletionCallbackTask<1>(net::OK)); EXPECT_CALL(*socket_->GetMockTransport(), Start()); EXPECT_CALL(handler_, OnConnectComplete(socket_.get())); - socket_->Connect(base::Bind(&CompleteHandler::OnConnectComplete, - base::Unretained(&handler_))); + socket_->Connect(base::BindOnce(&CompleteHandler::OnConnectComplete, + base::Unretained(&handler_))); RunPendingTasks(); CastMessage mangled_auth_reply = CreateAuthReply(); mangled_auth_reply.set_namespace_("BOGUS_NAMESPACE"); @@ -616,8 +616,8 @@ socket_->SetupTcpConnect(net::ASYNC, net::ERR_FAILED); EXPECT_CALL(handler_, OnConnectComplete(socket_.get())); - socket_->Connect(base::Bind(&CompleteHandler::OnConnectComplete, - base::Unretained(&handler_))); + socket_->Connect(base::BindOnce(&CompleteHandler::OnConnectComplete, + base::Unretained(&handler_))); RunPendingTasks(); EXPECT_EQ(ReadyState::CLOSED, socket_->ready_state()); @@ -631,8 +631,8 @@ socket_->SetupTcpConnect(net::SYNCHRONOUS, net::ERR_FAILED); EXPECT_CALL(handler_, OnConnectComplete(socket_.get())); - socket_->Connect(base::Bind(&CompleteHandler::OnConnectComplete, - base::Unretained(&handler_))); + socket_->Connect(base::BindOnce(&CompleteHandler::OnConnectComplete, + base::Unretained(&handler_))); RunPendingTasks(); EXPECT_EQ(ReadyState::CLOSED, socket_->ready_state()); @@ -646,8 +646,8 @@ EXPECT_CALL(handler_, OnConnectComplete(socket_.get())); EXPECT_CALL(*observer_, OnError(_, ChannelError::CONNECT_TIMEOUT)); socket_->AddObserver(observer_.get()); - socket_->Connect(base::Bind(&CompleteHandler::OnConnectComplete, - base::Unretained(&handler_))); + socket_->Connect(base::BindOnce(&CompleteHandler::OnConnectComplete, + base::Unretained(&handler_))); RunPendingTasks(); EXPECT_EQ(ReadyState::CONNECTING, socket_->ready_state()); @@ -666,8 +666,8 @@ EXPECT_CALL(handler_, OnConnectComplete(socket_.get())); EXPECT_CALL(*observer_, OnError(_, ChannelError::CONNECT_TIMEOUT)); socket_->AddObserver(observer_.get()); - socket_->Connect(base::Bind(&CompleteHandler::OnConnectComplete, - base::Unretained(&handler_))); + socket_->Connect(base::BindOnce(&CompleteHandler::OnConnectComplete, + base::Unretained(&handler_))); RunPendingTasks(); EXPECT_EQ(ReadyState::CLOSED, socket_->ready_state()); @@ -684,8 +684,8 @@ socket_->SetupSslConnect(net::SYNCHRONOUS, net::ERR_FAILED); EXPECT_CALL(handler_, OnConnectComplete(socket_.get())); - socket_->Connect(base::Bind(&CompleteHandler::OnConnectComplete, - base::Unretained(&handler_))); + socket_->Connect(base::BindOnce(&CompleteHandler::OnConnectComplete, + base::Unretained(&handler_))); RunPendingTasks(); EXPECT_EQ(ReadyState::CLOSED, socket_->ready_state()); @@ -700,8 +700,8 @@ socket_->SetupSslConnect(net::SYNCHRONOUS, net::ERR_FAILED); EXPECT_CALL(handler_, OnConnectComplete(socket_.get())); - socket_->Connect(base::Bind(&CompleteHandler::OnConnectComplete, - base::Unretained(&handler_))); + socket_->Connect(base::BindOnce(&CompleteHandler::OnConnectComplete, + base::Unretained(&handler_))); RunPendingTasks(); EXPECT_EQ(ReadyState::CLOSED, socket_->ready_state()); @@ -718,8 +718,8 @@ socket_->SetupSslConnect(net::SYNCHRONOUS, net::ERR_CONNECTION_TIMED_OUT); EXPECT_CALL(handler_, OnConnectComplete(socket_.get())); - socket_->Connect(base::Bind(&CompleteHandler::OnConnectComplete, - base::Unretained(&handler_))); + socket_->Connect(base::BindOnce(&CompleteHandler::OnConnectComplete, + base::Unretained(&handler_))); RunPendingTasks(); EXPECT_EQ(ReadyState::CLOSED, socket_->ready_state()); @@ -736,8 +736,8 @@ socket_->SetupSslConnect(net::ASYNC, net::ERR_CONNECTION_TIMED_OUT); EXPECT_CALL(handler_, OnConnectComplete(socket_.get())); - socket_->Connect(base::Bind(&CompleteHandler::OnConnectComplete, - base::Unretained(&handler_))); + socket_->Connect(base::BindOnce(&CompleteHandler::OnConnectComplete, + base::Unretained(&handler_))); RunPendingTasks(); EXPECT_EQ(ReadyState::CLOSED, socket_->ready_state()); @@ -756,8 +756,8 @@ .WillOnce(PostCompletionCallbackTask<1>(net::ERR_CONNECTION_RESET)); EXPECT_CALL(handler_, OnConnectComplete(socket_.get())); - socket_->Connect(base::Bind(&CompleteHandler::OnConnectComplete, - base::Unretained(&handler_))); + socket_->Connect(base::BindOnce(&CompleteHandler::OnConnectComplete, + base::Unretained(&handler_))); RunPendingTasks(); EXPECT_EQ(ReadyState::CLOSED, socket_->ready_state()); @@ -774,8 +774,8 @@ EXPECT_CALL(*socket_->GetMockTransport(), SendMessage(EqualsProto(CreateAuthChallenge()), _, _)) .WillOnce(PostCompletionCallbackTask<1>(net::ERR_CONNECTION_RESET)); - socket_->Connect(base::Bind(&CompleteHandler::OnConnectComplete, - base::Unretained(&handler_))); + socket_->Connect(base::BindOnce(&CompleteHandler::OnConnectComplete, + base::Unretained(&handler_))); socket_.reset(); RunPendingTasks(); } @@ -795,8 +795,8 @@ EXPECT_CALL(handler_, OnConnectComplete(socket_.get())); EXPECT_CALL(*socket_->GetMockTransport(), Start()); socket_->AddObserver(observer_.get()); - socket_->Connect(base::Bind(&CompleteHandler::OnConnectComplete, - base::Unretained(&handler_))); + socket_->Connect(base::BindOnce(&CompleteHandler::OnConnectComplete, + base::Unretained(&handler_))); RunPendingTasks(); socket_->GetMockTransport()->current_delegate()->OnError( ChannelError::CAST_SOCKET_ERROR); @@ -821,8 +821,8 @@ EXPECT_CALL(handler_, OnConnectComplete(socket_.get())); EXPECT_CALL(*socket_->GetMockTransport(), Start()); socket_->AddObserver(observer_.get()); - socket_->Connect(base::Bind(&CompleteHandler::OnConnectComplete, - base::Unretained(&handler_))); + socket_->Connect(base::BindOnce(&CompleteHandler::OnConnectComplete, + base::Unretained(&handler_))); RunPendingTasks(); socket_->GetMockTransport()->current_delegate()->OnMessage(CreateAuthReply()); RunPendingTasks(); @@ -857,8 +857,8 @@ socket_->AddWriteResultForData(net::ASYNC, test_message_str); EXPECT_CALL(handler_, OnConnectComplete(socket_.get())); - socket_->Connect(base::Bind(&CompleteHandler::OnConnectComplete, - base::Unretained(&handler_))); + socket_->Connect(base::BindOnce(&CompleteHandler::OnConnectComplete, + base::Unretained(&handler_))); RunPendingTasks(); EXPECT_EQ(ReadyState::OPEN, socket_->ready_state()); EXPECT_EQ(ChannelError::NONE, socket_->error_state()); @@ -901,8 +901,8 @@ socket_->AddWriteResultForData(net::SYNCHRONOUS, test_message_str); EXPECT_CALL(handler_, OnConnectComplete(socket_.get())); - socket_->Connect(base::Bind(&CompleteHandler::OnConnectComplete, - base::Unretained(&handler_))); + socket_->Connect(base::BindOnce(&CompleteHandler::OnConnectComplete, + base::Unretained(&handler_))); RunPendingTasks(); EXPECT_EQ(ReadyState::OPEN, socket_->ready_state()); EXPECT_EQ(ChannelError::NONE, socket_->error_state()); @@ -940,13 +940,13 @@ TEST_F(MockCastSocketTest, TestOpenChannelConnectingSocket) { CreateCastSocketSecure(); socket_->SetupTcpConnectUnresponsive(); - socket_->Connect(base::Bind(&CompleteHandler::OnConnectComplete, - base::Unretained(&handler_))); + socket_->Connect(base::BindOnce(&CompleteHandler::OnConnectComplete, + base::Unretained(&handler_))); RunPendingTasks(); EXPECT_CALL(handler_, OnConnectComplete(socket_.get())).Times(2); - socket_->Connect(base::Bind(&CompleteHandler::OnConnectComplete, - base::Unretained(&handler_))); + socket_->Connect(base::BindOnce(&CompleteHandler::OnConnectComplete, + base::Unretained(&handler_))); socket_->TriggerTimeout(); RunPendingTasks(); } @@ -959,8 +959,8 @@ HandleAuthHandshake(); EXPECT_CALL(handler_, OnConnectComplete(socket_.get())); - socket_->Connect(base::Bind(&CompleteHandler::OnConnectComplete, - base::Unretained(&handler_))); + socket_->Connect(base::BindOnce(&CompleteHandler::OnConnectComplete, + base::Unretained(&handler_))); } TEST_F(MockCastSocketTest, TestOpenChannelClosedSocket) { @@ -968,13 +968,13 @@ socket_->SetupTcpConnect(net::ASYNC, net::ERR_FAILED); EXPECT_CALL(handler_, OnConnectComplete(socket_.get())); - socket_->Connect(base::Bind(&CompleteHandler::OnConnectComplete, - base::Unretained(&handler_))); + socket_->Connect(base::BindOnce(&CompleteHandler::OnConnectComplete, + base::Unretained(&handler_))); RunPendingTasks(); EXPECT_CALL(handler_, OnConnectComplete(socket_.get())); - socket_->Connect(base::Bind(&CompleteHandler::OnConnectComplete, - base::Unretained(&handler_))); + socket_->Connect(base::BindOnce(&CompleteHandler::OnConnectComplete, + base::Unretained(&handler_))); } // Tests connecting through an actual non-mocked CastTransport object and
diff --git a/components/cast_channel/cast_test_util.h b/components/cast_channel/cast_test_util.h index 5448486..3b1eec7c 100644 --- a/components/cast_channel/cast_test_util.h +++ b/components/cast_channel/cast_test_util.h
@@ -187,7 +187,7 @@ HAS_1_TEMPLATE_PARAMS(int, cb_idx), AND_1_VALUE_PARAMS(rv)) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(testing::get<cb_idx>(args), rv)); + FROM_HERE, base::BindOnce(testing::get<cb_idx>(args), rv)); } } // namespace cast_channel
diff --git a/components/cast_channel/cast_transport.cc b/components/cast_channel/cast_transport.cc index 4040f2f..bfd2030 100644 --- a/components/cast_channel/cast_transport.cc +++ b/components/cast_channel/cast_transport.cc
@@ -78,7 +78,7 @@ for (; !write_queue_.empty(); write_queue_.pop()) { net::CompletionCallback& callback = write_queue_.front().callback; base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, net::ERR_FAILED)); + FROM_HERE, base::BindOnce(callback, net::ERR_FAILED)); callback.Reset(); } } @@ -92,7 +92,7 @@ std::string serialized_message; if (!MessageFramer::Serialize(message, &serialized_message)) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, net::ERR_FAILED)); + FROM_HERE, base::BindOnce(callback, net::ERR_FAILED)); return; } WriteRequest write_request(message.namespace_(), serialized_message, callback, @@ -204,7 +204,7 @@ int rv = socket_->Write( request.io_buffer.get(), request.io_buffer->BytesRemaining(), - base::Bind(&CastTransportImpl::OnWriteResult, base::Unretained(this)), + base::BindOnce(&CastTransportImpl::OnWriteResult, base::Unretained(this)), request.traffic_annotation_); return rv; } @@ -239,7 +239,7 @@ WriteRequest& request = write_queue_.front(); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(request.callback, net::OK)); + FROM_HERE, base::BindOnce(request.callback, net::OK)); write_queue_.pop(); if (write_queue_.empty()) { @@ -327,7 +327,7 @@ // Read up to num_bytes_to_read into |current_read_buffer_|. return socket_->Read( read_buffer_.get(), base::checked_cast<uint32_t>(num_bytes_to_read), - base::Bind(&CastTransportImpl::OnReadResult, base::Unretained(this))); + base::BindOnce(&CastTransportImpl::OnReadResult, base::Unretained(this))); } int CastTransportImpl::DoReadComplete(int result) {
diff --git a/components/component_updater/timer.cc b/components/component_updater/timer.cc index 966c3ace..c45d74b 100644 --- a/components/component_updater/timer.cc +++ b/components/component_updater/timer.cc
@@ -25,7 +25,7 @@ user_task_ = user_task; timer_.Start(FROM_HERE, initial_delay, - base::Bind(&Timer::OnDelay, base::Unretained(this))); + base::BindOnce(&Timer::OnDelay, base::Unretained(this))); } void Timer::Stop() { @@ -39,7 +39,7 @@ user_task_.Run(); timer_.Start(FROM_HERE, delay_, - base::Bind(&Timer::OnDelay, base::Unretained(this))); + base::BindOnce(&Timer::OnDelay, base::Unretained(this))); } } // namespace component_updater
diff --git a/components/crash/content/browser/child_exit_observer_android.cc b/components/crash/content/browser/child_exit_observer_android.cc index c3f2ff9..ebd387de 100644 --- a/components/crash/content/browser/child_exit_observer_android.cc +++ b/components/crash/content/browser/child_exit_observer_android.cc
@@ -152,7 +152,7 @@ browser_child_process_info_.erase(it); } else { info.process_host_id = data.id; - info.pid = data.handle; + info.pid = data.GetHandle(); info.process_type = static_cast<content::ProcessType>(data.process_type); info.app_state = base::android::ApplicationStatusListener::GetState(); info.normal_termination = true; @@ -167,7 +167,7 @@ DCHECK(!base::ContainsKey(browser_child_process_info_, data.id)); TerminationInfo info; info.process_host_id = data.id; - info.pid = data.handle; + info.pid = data.GetHandle(); info.process_type = static_cast<content::ProcessType>(data.process_type); info.app_state = base::android::ApplicationStatusListener::GetState(); PopulateTerminationInfo(content_info, &info);
diff --git a/components/crash/content/browser/crash_handler_host_linux.cc b/components/crash/content/browser/crash_handler_host_linux.cc index 485a1fb..08a59b3 100644 --- a/components/crash/content/browser/crash_handler_host_linux.cc +++ b/components/crash/content/browser/crash_handler_host_linux.cc
@@ -136,7 +136,7 @@ BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, - base::Bind(&CrashHandlerHostLinux::Init, base::Unretained(this))); + base::BindOnce(&CrashHandlerHostLinux::Init, base::Unretained(this))); } CrashHandlerHostLinux::~CrashHandlerHostLinux() {
diff --git a/components/cronet/cronet_prefs_manager.cc b/components/cronet/cronet_prefs_manager.cc index 07ed170d..85316c2 100644 --- a/components/cronet/cronet_prefs_manager.cc +++ b/components/cronet/cronet_prefs_manager.cc
@@ -168,7 +168,7 @@ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::Bind( + base::BindOnce( &NetworkQualitiesPrefDelegateImpl::SchedulePendingLossyWrites, weak_ptr_factory_.GetWeakPtr()), base::TimeDelta::FromSeconds(kUpdatePrefsDelaySeconds));
diff --git a/components/cronet/host_cache_persistence_manager.cc b/components/cronet/host_cache_persistence_manager.cc index 84a6243..89fc9df 100644 --- a/components/cronet/host_cache_persistence_manager.cc +++ b/components/cronet/host_cache_persistence_manager.cc
@@ -74,8 +74,8 @@ net_log_.AddEvent(net::NetLogEventType::HOST_CACHE_PERSISTENCE_START_TIMER); timer_.Start(FROM_HERE, delay_, - base::Bind(&HostCachePersistenceManager::WriteToDisk, - weak_factory_.GetWeakPtr())); + base::BindOnce(&HostCachePersistenceManager::WriteToDisk, + weak_factory_.GetWeakPtr())); } void HostCachePersistenceManager::WriteToDisk() {
diff --git a/components/cronet/run_all_unittests.cc b/components/cronet/run_all_unittests.cc index caf318b3..aca111b 100644 --- a/components/cronet/run_all_unittests.cc +++ b/components/cronet/run_all_unittests.cc
@@ -10,5 +10,5 @@ base::TestSuite test_suite(argc, argv); return base::LaunchUnitTests( argc, argv, - base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite))); + base::BindOnce(&base::TestSuite::Run, base::Unretained(&test_suite))); }
diff --git a/components/cronet/stale_host_resolver.cc b/components/cronet/stale_host_resolver.cc index 57421db..dff2672 100644 --- a/components/cronet/stale_host_resolver.cc +++ b/components/cronet/stale_host_resolver.cc
@@ -253,8 +253,8 @@ no_cache_info.set_allow_cached_response(false); int network_rv = resolver->Resolve( no_cache_info, priority, &network_addresses_, - base::Bind(&StaleHostResolver::RequestImpl::OnNetworkRequestComplete, - base::Unretained(this)), + base::BindOnce(&StaleHostResolver::RequestImpl::OnNetworkRequestComplete, + base::Unretained(this)), &network_request_, net_log); // Network resolver has returned synchronously (for example by resolving from // /etc/hosts).
diff --git a/components/cronet/stale_host_resolver_unittest.cc b/components/cronet/stale_host_resolver_unittest.cc index d7cda2a..49be697 100644 --- a/components/cronet/stale_host_resolver_unittest.cc +++ b/components/cronet/stale_host_resolver_unittest.cc
@@ -212,11 +212,11 @@ resolve_addresses_ = MakeAddressList(kUninitializedAddress); resolve_error_ = net::ERR_UNEXPECTED; - int rv = - resolver_->Resolve(info, net::DEFAULT_PRIORITY, &resolve_addresses_, - base::Bind(&StaleHostResolverTest::OnResolveComplete, - base::Unretained(this)), - &request_, net::NetLogWithSource()); + int rv = resolver_->Resolve( + info, net::DEFAULT_PRIORITY, &resolve_addresses_, + base::BindOnce(&StaleHostResolverTest::OnResolveComplete, + base::Unretained(this)), + &request_, net::NetLogWithSource()); if (rv != net::ERR_IO_PENDING) { resolve_pending_ = false; resolve_complete_ = true;
diff --git a/components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.cc b/components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.cc index d060e23..277a234 100644 --- a/components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.cc +++ b/components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.cc
@@ -296,7 +296,7 @@ if (!timeout_for_sub_status.is_max()) { timer_->Start( FROM_HERE, timeout_for_sub_status, - base::Bind( + base::BindOnce( &BluetoothLowEnergyWeaveClientConnection::OnTimeoutForSubStatus, weak_ptr_factory_.GetWeakPtr(), sub_status_)); } @@ -756,9 +756,9 @@ // the OnSendCompleted() callback, a null pointer is not deferenced. task_runner_->PostTask( FROM_HERE, - base::Bind(&BluetoothLowEnergyWeaveClientConnection::OnDidSendMessage, - weak_ptr_factory_.GetWeakPtr(), *sent_message, - true /* success */)); + base::BindOnce( + &BluetoothLowEnergyWeaveClientConnection::OnDidSendMessage, + weak_ptr_factory_.GetWeakPtr(), *sent_message, true /* success */)); } pending_write_request_.reset(); @@ -814,7 +814,7 @@ // chance to process the OnSendCompleted() call. task_runner_->PostTask( FROM_HERE, - base::Bind( + base::BindOnce( &BluetoothLowEnergyWeaveClientConnection::DestroyConnection, weak_ptr_factory_.GetWeakPtr(), BleWeaveConnectionResult::
diff --git a/components/cryptauth/connection_unittest.cc b/components/cryptauth/connection_unittest.cc index 07a6db9a..a661822 100644 --- a/components/cryptauth/connection_unittest.cc +++ b/components/cryptauth/connection_unittest.cc
@@ -98,7 +98,7 @@ ~CryptAuthConnectionTest() override = default; base::Optional<int32_t> GetRssi(Connection* connection) { - connection->GetConnectionRssi(base::Bind( + connection->GetConnectionRssi(base::BindOnce( &CryptAuthConnectionTest::OnConnectionRssi, base::Unretained(this))); base::Optional<int32_t> rssi = rssi_;
diff --git a/components/cryptauth/device_to_device_authenticator.cc b/components/cryptauth/device_to_device_authenticator.cc index 3e7b038..b218db04 100644 --- a/components/cryptauth/device_to_device_authenticator.cc +++ b/components/cryptauth/device_to_device_authenticator.cc
@@ -140,8 +140,8 @@ timer_ = CreateTimer(); timer_->Start( FROM_HERE, base::TimeDelta::FromSeconds(kResponderAuthTimeoutSeconds), - base::Bind(&DeviceToDeviceAuthenticator::OnResponderAuthTimedOut, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&DeviceToDeviceAuthenticator::OnResponderAuthTimedOut, + weak_ptr_factory_.GetWeakPtr())); // Send the [Initiator Hello] message to the remote device. state_ = State::SENT_HELLO;
diff --git a/components/cryptauth/secure_channel_unittest.cc b/components/cryptauth/secure_channel_unittest.cc index 33b2c77..867094f 100644 --- a/components/cryptauth/secure_channel_unittest.cc +++ b/components/cryptauth/secure_channel_unittest.cc
@@ -348,7 +348,7 @@ void VerifyRssi(base::Optional<int32_t> expected_rssi) { fake_connection_->set_rssi_to_return(expected_rssi); - secure_channel_->GetConnectionRssi(base::Bind( + secure_channel_->GetConnectionRssi(base::BindOnce( &CryptAuthSecureChannelTest::OnConnectionRssi, base::Unretained(this))); base::Optional<int32_t> rssi = rssi_;
diff --git a/components/cryptauth/secure_message_delegate_impl.cc b/components/cryptauth/secure_message_delegate_impl.cc index 83a7447..784a61f 100644 --- a/components/cryptauth/secure_message_delegate_impl.cc +++ b/components/cryptauth/secure_message_delegate_impl.cc
@@ -108,7 +108,7 @@ void SecureMessageDelegateImpl::GenerateKeyPair( const GenerateKeyPairCallback& callback) { dbus_client_->GenerateEcP256KeyPair( - base::Bind(HandleKeyPairResult, callback)); + base::BindOnce(HandleKeyPairResult, callback)); } void SecureMessageDelegateImpl::DeriveKey(const std::string& private_key, @@ -171,8 +171,9 @@ options.encryption_type = EncSchemeToString(unwrap_options.encryption_scheme); options.signature_type = SigSchemeToString(unwrap_options.signature_scheme); - dbus_client_->UnwrapSecureMessage(serialized_message, options, - base::Bind(&HandleUnwrapResult, callback)); + dbus_client_->UnwrapSecureMessage( + serialized_message, options, + base::BindOnce(&HandleUnwrapResult, callback)); } } // namespace cryptauth
diff --git a/components/cryptauth/sync_scheduler_impl.cc b/components/cryptauth/sync_scheduler_impl.cc index c5f5c31..acd44a8 100644 --- a/components/cryptauth/sync_scheduler_impl.cc +++ b/components/cryptauth/sync_scheduler_impl.cc
@@ -141,8 +141,8 @@ timer_ = CreateTimer(); timer_->Start(FROM_HERE, sync_delta, - base::Bind(&SyncSchedulerImpl::OnTimerFired, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&SyncSchedulerImpl::OnTimerFired, + weak_ptr_factory_.GetWeakPtr())); } void SyncSchedulerImpl::OnSyncCompleted(bool success) {
diff --git a/components/data_reduction_proxy/content/browser/content_lofi_decider_unittest.cc b/components/data_reduction_proxy/content/browser/content_lofi_decider_unittest.cc index 8c11b05..4c3727e0 100644 --- a/components/data_reduction_proxy/content/browser/content_lofi_decider_unittest.cc +++ b/components/data_reduction_proxy/content/browser/content_lofi_decider_unittest.cc
@@ -157,8 +157,9 @@ } data_reduction_proxy_network_delegate_->NotifyBeforeStartTransaction( - request, base::Bind(&ContentLoFiDeciderTest::DelegateStageDone, - base::Unretained(this)), + request, + base::BindOnce(&ContentLoFiDeciderTest::DelegateStageDone, + base::Unretained(this)), headers); data_reduction_proxy_network_delegate_->NotifyBeforeSendHeaders( request, data_reduction_proxy_info, proxy_retry_info, headers);
diff --git a/components/data_reduction_proxy/content/browser/content_lofi_ui_service.cc b/components/data_reduction_proxy/content/browser/content_lofi_ui_service.cc index 55229557..20ec7f0 100644 --- a/components/data_reduction_proxy/content/browser/content_lofi_ui_service.cc +++ b/components/data_reduction_proxy/content/browser/content_lofi_ui_service.cc
@@ -36,8 +36,9 @@ &request, &render_process_id, &render_frame_id)) { ui_task_runner_->PostTask( FROM_HERE, - base::Bind(&ContentLoFiUIService::OnLoFiResponseReceivedOnUIThread, - base::Unretained(this), render_process_id, render_frame_id)); + base::BindOnce(&ContentLoFiUIService::OnLoFiResponseReceivedOnUIThread, + base::Unretained(this), render_process_id, + render_frame_id)); } }
diff --git a/components/data_reduction_proxy/content/browser/content_lofi_ui_service_unittest.cc b/components/data_reduction_proxy/content/browser/content_lofi_ui_service_unittest.cc index c0af49d..c6f8816 100644 --- a/components/data_reduction_proxy/content/browser/content_lofi_ui_service_unittest.cc +++ b/components/data_reduction_proxy/content/browser/content_lofi_ui_service_unittest.cc
@@ -58,7 +58,7 @@ content::BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE, - base::Bind(&base::RunLoop::Quit, base::Unretained(ui_run_loop))); + base::BindOnce(&base::RunLoop::Quit, base::Unretained(ui_run_loop))); } std::unique_ptr<net::URLRequest> CreateRequest( @@ -104,8 +104,8 @@ base::RunLoop ui_run_loop; content::BrowserThread::PostTask( content::BrowserThread::IO, FROM_HERE, - base::Bind(&ContentLoFiUIServiceTest::RunTestOnIOThread, - base::Unretained(this), &ui_run_loop)); + base::BindOnce(&ContentLoFiUIServiceTest::RunTestOnIOThread, + base::Unretained(this), &ui_run_loop)); ui_run_loop.Run(); base::RunLoop().RunUntilIdle(); VerifyOnLoFiResponseReceivedCallback();
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc index 9149d4ea..a3776b7 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.cc
@@ -211,9 +211,8 @@ return; } io_task_runner_->PostTask( - FROM_HERE, - base::Bind(&DataReductionProxyIOData::InitializeOnIOThread, - base::Unretained(this))); + FROM_HERE, base::BindOnce(&DataReductionProxyIOData::InitializeOnIOThread, + base::Unretained(this))); } void DataReductionProxyIOData::InitializeOnIOThread() { @@ -231,9 +230,8 @@ return; } ui_task_runner_->PostTask( - FROM_HERE, - base::Bind(&DataReductionProxyService::SetIOData, - service_, weak_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&DataReductionProxyService::SetIOData, service_, + weak_factory_.GetWeakPtr())); } bool DataReductionProxyIOData::IsEnabled() const { @@ -246,8 +244,8 @@ DCHECK(io_task_runner_->BelongsToCurrentThread()); ui_task_runner_->PostTask( FROM_HERE, - base::Bind(&DataReductionProxyService::SetPingbackReportingFraction, - service_, pingback_reporting_fraction)); + base::BindOnce(&DataReductionProxyService::SetPingbackReportingFraction, + service_, pingback_reporting_fraction)); } void DataReductionProxyIOData::DeleteBrowsingHistory(const base::Time start, @@ -340,8 +338,9 @@ DCHECK(io_task_runner_->BelongsToCurrentThread()); ui_task_runner_->PostTask( - FROM_HERE, base::Bind(&DataReductionProxyService::UpdateDataUseForHost, - service_, network_bytes, original_bytes, host)); + FROM_HERE, + base::BindOnce(&DataReductionProxyService::UpdateDataUseForHost, service_, + network_bytes, original_bytes, host)); } void DataReductionProxyIOData::UpdateContentLengths( @@ -403,25 +402,24 @@ void DataReductionProxyIOData::SetUnreachable(bool unreachable) { DCHECK(io_task_runner_->BelongsToCurrentThread()); ui_task_runner_->PostTask( - FROM_HERE, - base::Bind(&DataReductionProxyService::SetUnreachable, - service_, unreachable)); + FROM_HERE, base::BindOnce(&DataReductionProxyService::SetUnreachable, + service_, unreachable)); } void DataReductionProxyIOData::SetInt64Pref(const std::string& pref_path, int64_t value) { DCHECK(io_task_runner_->BelongsToCurrentThread()); ui_task_runner_->PostTask( - FROM_HERE, base::Bind(&DataReductionProxyService::SetInt64Pref, service_, - pref_path, value)); + FROM_HERE, base::BindOnce(&DataReductionProxyService::SetInt64Pref, + service_, pref_path, value)); } void DataReductionProxyIOData::SetStringPref(const std::string& pref_path, const std::string& value) { DCHECK(io_task_runner_->BelongsToCurrentThread()); ui_task_runner_->PostTask( - FROM_HERE, base::Bind(&DataReductionProxyService::SetStringPref, service_, - pref_path, value)); + FROM_HERE, base::BindOnce(&DataReductionProxyService::SetStringPref, + service_, pref_path, value)); } void DataReductionProxyIOData::StoreSerializedConfig(
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data_unittest.cc index 4474cbd9..7c9c066 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data_unittest.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data_unittest.cc
@@ -139,8 +139,9 @@ false); network_delegate->NotifyBeforeURLRequest( fake_request.get(), - base::Bind(&DataReductionProxyIODataTest::RequestCallback, - base::Unretained(this)), nullptr); + base::BindOnce(&DataReductionProxyIODataTest::RequestCallback, + base::Unretained(this)), + nullptr); EXPECT_EQ(1, wrapped_network_delegate->created_requests()); EXPECT_NE(nullptr, io_data->bypass_stats());
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc index 60707080..be1432a6 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc
@@ -793,13 +793,15 @@ net::HttpRequestHeaders* headers) { network_delegate()->NotifyBeforeURLRequest( request, - base::Bind(&DataReductionProxyNetworkDelegateTest::DelegateStageDone, - base::Unretained(this)), + base::BindOnce( + &DataReductionProxyNetworkDelegateTest::DelegateStageDone, + base::Unretained(this)), nullptr); network_delegate()->NotifyBeforeStartTransaction( request, - base::Bind(&DataReductionProxyNetworkDelegateTest::DelegateStageDone, - base::Unretained(this)), + base::BindOnce( + &DataReductionProxyNetworkDelegateTest::DelegateStageDone, + base::Unretained(this)), headers); network_delegate()->NotifyBeforeSendHeaders( request, data_reduction_proxy_info, proxy_retry_info, headers); @@ -890,8 +892,8 @@ // headers get added/removed. network_delegate()->NotifyBeforeStartTransaction( fake_request.get(), - base::Bind(&DataReductionProxyNetworkDelegateTest::DelegateStageDone, - base::Unretained(this)), + base::BindOnce(&DataReductionProxyNetworkDelegateTest::DelegateStageDone, + base::Unretained(this)), &headers); network_delegate()->NotifyBeforeSendHeaders(fake_request.get(), data_reduction_proxy_info, @@ -1087,8 +1089,9 @@ // headers get added/removed. network_delegate()->NotifyBeforeStartTransaction( request.get(), - base::Bind(&DataReductionProxyNetworkDelegateTest::DelegateStageDone, - base::Unretained(this)), + base::BindOnce( + &DataReductionProxyNetworkDelegateTest::DelegateStageDone, + base::Unretained(this)), &headers); network_delegate()->NotifyBeforeSendHeaders( request.get(), data_reduction_proxy_info, proxy_retry_info, &headers); @@ -1190,8 +1193,8 @@ // headers get added/removed. network_delegate()->NotifyBeforeStartTransaction( request.get(), - base::Bind(&DataReductionProxyNetworkDelegateTest::DelegateStageDone, - base::Unretained(this)), + base::BindOnce(&DataReductionProxyNetworkDelegateTest::DelegateStageDone, + base::Unretained(this)), &headers_original); network_delegate()->NotifyBeforeSendHeaders( request.get(), data_reduction_proxy_info, proxy_retry_info, @@ -1230,8 +1233,8 @@ net::HttpRequestHeaders headers_redirect; network_delegate()->NotifyBeforeStartTransaction( request.get(), - base::Bind(&DataReductionProxyNetworkDelegateTest::DelegateStageDone, - base::Unretained(this)), + base::BindOnce(&DataReductionProxyNetworkDelegateTest::DelegateStageDone, + base::Unretained(this)), &headers_redirect); network_delegate()->NotifyBeforeSendHeaders( request.get(), data_reduction_proxy_info, proxy_retry_info, @@ -1838,8 +1841,8 @@ // Send a request and verify the page ID is 1. network_delegate()->NotifyBeforeStartTransaction( request.get(), - base::Bind(&DataReductionProxyNetworkDelegateTest::DelegateStageDone, - base::Unretained(this)), + base::BindOnce(&DataReductionProxyNetworkDelegateTest::DelegateStageDone, + base::Unretained(this)), &headers); network_delegate()->NotifyBeforeSendHeaders( request.get(), data_reduction_proxy_info, proxy_retry_info, &headers); @@ -1854,8 +1857,8 @@ network_delegate()->NotifyBeforeStartTransaction( request.get(), - base::Bind(&DataReductionProxyNetworkDelegateTest::DelegateStageDone, - base::Unretained(this)), + base::BindOnce(&DataReductionProxyNetworkDelegateTest::DelegateStageDone, + base::Unretained(this)), &headers); network_delegate()->NotifyBeforeSendHeaders( request.get(), data_reduction_proxy_info, proxy_retry_info, &headers);
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_service.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_service.cc index f94177e..d6c8a95 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_service.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_service.cc
@@ -51,8 +51,8 @@ weak_factory_(this) { DCHECK(settings); db_task_runner_->PostTask(FROM_HERE, - base::Bind(&DBDataOwner::InitializeOnDBThread, - db_data_owner_->GetWeakPtr())); + base::BindOnce(&DBDataOwner::InitializeOnDBThread, + db_data_owner_->GetWeakPtr())); if (prefs_) { compression_stats_.reset( new DataReductionProxyCompressionStats(this, prefs_, commit_delay)); @@ -108,8 +108,9 @@ io_task_runner_->PostTask( FROM_HERE, - base::Bind(&DataReductionProxyIOData::SetDataReductionProxyConfiguration, - io_data_, config_value)); + base::BindOnce( + &DataReductionProxyIOData::SetDataReductionProxyConfiguration, + io_data_, config_value)); } void DataReductionProxyService::Shutdown() { @@ -194,8 +195,8 @@ return; } io_task_runner_->PostTask( - FROM_HERE, base::Bind(&DataReductionProxyIOData::SetProxyPrefs, io_data_, - enabled, at_startup)); + FROM_HERE, base::BindOnce(&DataReductionProxyIOData::SetProxyPrefs, + io_data_, enabled, at_startup)); } void DataReductionProxyService::SetPingbackReportingFraction( @@ -246,21 +247,22 @@ } void DataReductionProxyService::DeleteHistoricalDataUsage() { - db_task_runner_->PostTask(FROM_HERE, - base::Bind(&DBDataOwner::DeleteHistoricalDataUsage, - db_data_owner_->GetWeakPtr())); + db_task_runner_->PostTask( + FROM_HERE, base::BindOnce(&DBDataOwner::DeleteHistoricalDataUsage, + db_data_owner_->GetWeakPtr())); } void DataReductionProxyService::DeleteBrowsingHistory(const base::Time& start, const base::Time& end) { DCHECK_LE(start, end); db_task_runner_->PostTask( - FROM_HERE, base::Bind(&DBDataOwner::DeleteBrowsingHistory, - db_data_owner_->GetWeakPtr(), start, end)); + FROM_HERE, base::BindOnce(&DBDataOwner::DeleteBrowsingHistory, + db_data_owner_->GetWeakPtr(), start, end)); io_task_runner_->PostTask( - FROM_HERE, base::Bind(&DataReductionProxyIOData::DeleteBrowsingHistory, - io_data_, start, end)); + FROM_HERE, + base::BindOnce(&DataReductionProxyIOData::DeleteBrowsingHistory, io_data_, + start, end)); } void DataReductionProxyService::AddObserver(
diff --git a/components/data_reduction_proxy/core/browser/network_properties_manager.cc b/components/data_reduction_proxy/core/browser/network_properties_manager.cc index 5ba29bd..f7d0618 100644 --- a/components/data_reduction_proxy/core/browser/network_properties_manager.cc +++ b/components/data_reduction_proxy/core/browser/network_properties_manager.cc
@@ -211,8 +211,8 @@ ui_task_runner_->PostTask( FROM_HERE, - base::Bind(&NetworkPropertiesManager::PrefManager::DeleteHistory, - pref_manager_weak_ptr_)); + base::BindOnce(&NetworkPropertiesManager::PrefManager::DeleteHistory, + pref_manager_weak_ptr_)); } void NetworkPropertiesManager::ShutdownOnUIThread() { @@ -273,9 +273,9 @@ ui_task_runner_->PostTask( FROM_HERE, - base::Bind(&NetworkPropertiesManager::PrefManager:: - OnChangeInNetworkPropertyOnUIThread, - pref_manager_weak_ptr_, network_id_, network_properties_)); + base::BindOnce(&NetworkPropertiesManager::PrefManager:: + OnChangeInNetworkPropertyOnUIThread, + pref_manager_weak_ptr_, network_id_, network_properties_)); } // static
diff --git a/components/device_event_log/device_event_log_impl_unittest.cc b/components/device_event_log/device_event_log_impl_unittest.cc index 41b20ab3a8..b7d394c 100644 --- a/components/device_event_log/device_event_log_impl_unittest.cc +++ b/components/device_event_log/device_event_log_impl_unittest.cc
@@ -77,9 +77,8 @@ LogLevel max_level, size_t max_events) { task_runner_->PostTask( - FROM_HERE, - base::Bind(&CallGetAsString, - impl_.get(), order, format, types, max_level, max_events)); + FROM_HERE, base::BindOnce(&CallGetAsString, impl_.get(), order, format, + types, max_level, max_events)); task_runner_->RunUntilIdle(); return s_string_result; }
diff --git a/components/discardable_memory/client/client_discardable_shared_memory_manager.cc b/components/discardable_memory/client/client_discardable_shared_memory_manager.cc index 2cd5e0e5..92140f7 100644 --- a/components/discardable_memory/client/client_discardable_shared_memory_manager.cc +++ b/components/discardable_memory/client/client_discardable_shared_memory_manager.cc
@@ -360,7 +360,7 @@ base::WaitableEvent event(base::WaitableEvent::ResetPolicy::MANUAL, base::WaitableEvent::InitialState::NOT_SIGNALED); base::ScopedClosureRunner event_signal_runner( - base::Bind(&base::WaitableEvent::Signal, base::Unretained(&event))); + base::BindOnce(&base::WaitableEvent::Signal, base::Unretained(&event))); io_task_runner_->PostTask( FROM_HERE, base::BindOnce(&ClientDiscardableSharedMemoryManager::AllocateOnIO, @@ -397,9 +397,9 @@ void ClientDiscardableSharedMemoryManager::DeletedDiscardableSharedMemory( int32_t id) { - io_task_runner_->PostTask( - FROM_HERE, - base::Bind(&DeletedDiscardableSharedMemoryOnIO, manager_mojo_.get(), id)); + io_task_runner_->PostTask(FROM_HERE, + base::BindOnce(&DeletedDiscardableSharedMemoryOnIO, + manager_mojo_.get(), id)); } void ClientDiscardableSharedMemoryManager::MemoryUsageChanged(
diff --git a/components/dom_distiller/content/browser/distillable_page_utils.cc b/components/dom_distiller/content/browser/distillable_page_utils.cc index 80c0351..ed5dfdc1 100644 --- a/components/dom_distiller/content/browser/distillable_page_utils.cc +++ b/components/dom_distiller/content/browser/distillable_page_utils.cc
@@ -33,8 +33,8 @@ base::Callback<void(bool)> callback) { content::RenderFrameHost* main_frame = web_contents->GetMainFrame(); if (!main_frame) { - base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, - base::Bind(callback, false)); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(callback, false)); return; } std::string extract_features_js =
diff --git a/components/dom_distiller/core/distilled_content_store.cc b/components/dom_distiller/core/distilled_content_store.cc index ffe6944a..3548fd82a 100644 --- a/components/dom_distiller/core/distilled_content_store.cc +++ b/components/dom_distiller/core/distilled_content_store.cc
@@ -25,8 +25,8 @@ InMemoryContentStore::SaveCallback callback) { InjectContent(entry, proto); if (!callback.is_null()) { - base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, - base::Bind(callback, true)); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(callback, true)); } }
diff --git a/components/dom_distiller/core/distilled_page_prefs.cc b/components/dom_distiller/core/distilled_page_prefs.cc index 344a67b1..35c1698 100644 --- a/components/dom_distiller/core/distilled_page_prefs.cc +++ b/components/dom_distiller/core/distilled_page_prefs.cc
@@ -42,8 +42,9 @@ DistilledPagePrefs::FontFamily new_font_family) { pref_service_->SetInteger(prefs::kFont, new_font_family); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&DistilledPagePrefs::NotifyOnChangeFontFamily, - weak_ptr_factory_.GetWeakPtr(), new_font_family)); + FROM_HERE, + base::BindOnce(&DistilledPagePrefs::NotifyOnChangeFontFamily, + weak_ptr_factory_.GetWeakPtr(), new_font_family)); } DistilledPagePrefs::FontFamily DistilledPagePrefs::GetFontFamily() { @@ -60,8 +61,8 @@ void DistilledPagePrefs::SetTheme(DistilledPagePrefs::Theme new_theme) { pref_service_->SetInteger(prefs::kTheme, new_theme); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&DistilledPagePrefs::NotifyOnChangeTheme, - weak_ptr_factory_.GetWeakPtr(), new_theme)); + FROM_HERE, base::BindOnce(&DistilledPagePrefs::NotifyOnChangeTheme, + weak_ptr_factory_.GetWeakPtr(), new_theme)); } DistilledPagePrefs::Theme DistilledPagePrefs::GetTheme() { @@ -78,10 +79,8 @@ void DistilledPagePrefs::SetFontScaling(float scaling) { pref_service_->SetDouble(prefs::kFontScale, scaling); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(&DistilledPagePrefs::NotifyOnChangeFontScaling, - weak_ptr_factory_.GetWeakPtr(), - scaling)); + FROM_HERE, base::BindOnce(&DistilledPagePrefs::NotifyOnChangeFontScaling, + weak_ptr_factory_.GetWeakPtr(), scaling)); } float DistilledPagePrefs::GetFontScaling() {
diff --git a/components/dom_distiller/core/distiller_unittest.cc b/components/dom_distiller/core/distiller_unittest.cc index b27dd92..53c06c38 100644 --- a/components/dom_distiller/core/distiller_unittest.cc +++ b/components/dom_distiller/core/distiller_unittest.cc
@@ -246,7 +246,7 @@ ASSERT_TRUE(base::MessageLoopCurrent::Get()); ASSERT_FALSE(callback_.is_null()); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback_, responses_[url_])); + FROM_HERE, base::BindOnce(callback_, responses_[url_])); } private:
diff --git a/components/dom_distiller/core/dom_distiller_service.cc b/components/dom_distiller/core/dom_distiller_service.cc index eb1d639..bf1da18 100644 --- a/components/dom_distiller/core/dom_distiller_service.cc +++ b/components/dom_distiller/core/dom_distiller_service.cc
@@ -85,7 +85,7 @@ // An article may not be available for a variety of reasons, e.g. // distillation failure or blobs not available locally. base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(article_cb, true)); + FROM_HERE, base::BindOnce(article_cb, true)); return entry.entry_id(); } } else {
diff --git a/components/dom_distiller/core/dom_distiller_store.cc b/components/dom_distiller/core/dom_distiller_store.cc index 9e08c65..3ea3751 100644 --- a/components/dom_distiller/core/dom_distiller_store.cc +++ b/components/dom_distiller/core/dom_distiller_store.cc
@@ -47,8 +47,8 @@ weak_ptr_factory_(this) { database_->Init(kDatabaseUMAClientName, database_dir, leveldb_proto::CreateSimpleOptions(), - base::Bind(&DomDistillerStore::OnDatabaseInit, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&DomDistillerStore::OnDatabaseInit, + weak_ptr_factory_.GetWeakPtr())); } DomDistillerStore::DomDistillerStore( @@ -61,8 +61,8 @@ weak_ptr_factory_(this) { database_->Init(kDatabaseUMAClientName, database_dir, leveldb_proto::CreateSimpleOptions(), - base::Bind(&DomDistillerStore::OnDatabaseInit, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&DomDistillerStore::OnDatabaseInit, + weak_ptr_factory_.GetWeakPtr())); } DomDistillerStore::~DomDistillerStore() {} @@ -183,8 +183,8 @@ database_.reset(); return; } - database_->LoadEntries(base::Bind(&DomDistillerStore::OnDatabaseLoad, - weak_ptr_factory_.GetWeakPtr())); + database_->LoadEntries(base::BindOnce(&DomDistillerStore::OnDatabaseLoad, + weak_ptr_factory_.GetWeakPtr())); } void DomDistillerStore::OnDatabaseLoad(bool success, @@ -241,8 +241,8 @@ } database_->UpdateEntries(std::move(entries_to_save), std::move(keys_to_remove), - base::Bind(&DomDistillerStore::OnDatabaseSave, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&DomDistillerStore::OnDatabaseSave, + weak_ptr_factory_.GetWeakPtr())); return true; }
diff --git a/components/dom_distiller/core/task_tracker.cc b/components/dom_distiller/core/task_tracker.cc index 152ba0f5..bb3236c 100644 --- a/components/dom_distiller/core/task_tracker.cc +++ b/components/dom_distiller/core/task_tracker.cc
@@ -89,8 +89,8 @@ // Distillation for this task has already completed, and so the delegate can // be immediately told of the result. base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&TaskTracker::NotifyViewer, - weak_ptr_factory_.GetWeakPtr(), delegate)); + FROM_HERE, base::BindOnce(&TaskTracker::NotifyViewer, + weak_ptr_factory_.GetWeakPtr(), delegate)); } return std::unique_ptr<ViewerHandle>(new ViewerHandle(base::Bind( &TaskTracker::RemoveViewer, weak_ptr_factory_.GetWeakPtr(), delegate))); @@ -136,8 +136,8 @@ void TaskTracker::ScheduleSaveCallbacks(bool distillation_succeeded) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(&TaskTracker::DoSaveCallbacks, weak_ptr_factory_.GetWeakPtr(), - distillation_succeeded)); + base::BindOnce(&TaskTracker::DoSaveCallbacks, + weak_ptr_factory_.GetWeakPtr(), distillation_succeeded)); } void TaskTracker::OnDistillerFinished(
diff --git a/components/domain_reliability/context.cc b/components/domain_reliability/context.cc index a68bf85d..b7088e15 100644 --- a/components/domain_reliability/context.cc +++ b/components/domain_reliability/context.cc
@@ -125,8 +125,8 @@ upload_allowed_callback_.Run( config().origin, - base::Bind(&DomainReliabilityContext::OnUploadAllowedCallbackComplete, - weak_factory_.GetWeakPtr())); + base::BindOnce(&DomainReliabilityContext::OnUploadAllowedCallbackComplete, + weak_factory_.GetWeakPtr())); } void DomainReliabilityContext::OnUploadAllowedCallbackComplete(bool allowed) {
diff --git a/components/domain_reliability/monitor.cc b/components/domain_reliability/monitor.cc index 64cf9b1..4a7f2f8 100644 --- a/components/domain_reliability/monitor.cc +++ b/components/domain_reliability/monitor.cc
@@ -132,8 +132,8 @@ network_task_runner_->PostTask( FROM_HERE, - base::Bind(&net::NetworkChangeNotifier::AddNetworkChangeObserver, - base::Unretained(this))); + base::BindOnce(&net::NetworkChangeNotifier::AddNetworkChangeObserver, + base::Unretained(this))); moved_to_network_thread_ = true; }
diff --git a/components/domain_reliability/service.cc b/components/domain_reliability/service.cc index 388e4a2..cf8287f 100644 --- a/components/domain_reliability/service.cc +++ b/components/domain_reliability/service.cc
@@ -89,8 +89,9 @@ DCHECK(network_task_runner_); network_task_runner_->PostTaskAndReply( - FROM_HERE, base::Bind(&DomainReliabilityMonitor::ClearBrowsingData, - monitor_, clear_mode, origin_filter), + FROM_HERE, + base::BindOnce(&DomainReliabilityMonitor::ClearBrowsingData, monitor_, + clear_mode, origin_filter), callback); } @@ -109,10 +110,8 @@ DCHECK(network_task_runner_); network_task_runner_->PostTask( - FROM_HERE, - base::Bind(&DomainReliabilityMonitor::SetDiscardUploads, - monitor_, - discard_uploads)); + FROM_HERE, base::BindOnce(&DomainReliabilityMonitor::SetDiscardUploads, + monitor_, discard_uploads)); } void AddContextForTesting( @@ -129,8 +128,8 @@ network_task_runner_->PostTask( FROM_HERE, - base::Bind(&DomainReliabilityMonitor::ForceUploadsForTesting, - monitor_)); + base::BindOnce(&DomainReliabilityMonitor::ForceUploadsForTesting, + monitor_)); } private:
diff --git a/components/domain_reliability/uploader_unittest.cc b/components/domain_reliability/uploader_unittest.cc index 1b7d21a4..708d997 100644 --- a/components/domain_reliability/uploader_unittest.cc +++ b/components/domain_reliability/uploader_unittest.cc
@@ -52,8 +52,8 @@ protected: void Start() override { int rv = upload_stream_->Init( - base::Bind(&UploadMockURLRequestJob::OnStreamInitialized, - base::Unretained(this)), + base::BindOnce(&UploadMockURLRequestJob::OnStreamInitialized, + base::Unretained(this)), net::NetLogWithSource()); if (rv == net::ERR_IO_PENDING) return; @@ -73,10 +73,9 @@ size_t upload_size = upload_stream_->size(); upload_buffer_ = new net::IOBufferWithSize(upload_size); rv = upload_stream_->Read( - upload_buffer_.get(), - upload_size, - base::Bind(&UploadMockURLRequestJob::OnStreamRead, - base::Unretained(this))); + upload_buffer_.get(), upload_size, + base::BindOnce(&UploadMockURLRequestJob::OnStreamRead, + base::Unretained(this))); if (rv == net::ERR_IO_PENDING) return; OnStreamRead(rv);
diff --git a/components/download/content/internal/download_driver_impl.cc b/components/download/content/internal/download_driver_impl.cc index f0d9a07..215babd8 100644 --- a/components/download/content/internal/download_driver_impl.cc +++ b/components/download/content/internal/download_driver_impl.cc
@@ -125,8 +125,8 @@ void DownloadDriverImpl::HardRecover() { // TODO(dtrainor, xingliu): Implement recovery for the DownloadManager. base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&DownloadDriverImpl::OnHardRecoverComplete, - weak_ptr_factory_.GetWeakPtr(), true)); + FROM_HERE, base::BindOnce(&DownloadDriverImpl::OnHardRecoverComplete, + weak_ptr_factory_.GetWeakPtr(), true)); } bool DownloadDriverImpl::IsReady() const { @@ -182,8 +182,8 @@ // DownloadItem::Remove will cause the item object removed from memory, post // the remove task to avoid the object being accessed in the same call stack. base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&DownloadDriverImpl::DoRemoveDownload, - weak_ptr_factory_.GetWeakPtr(), guid)); + FROM_HERE, base::BindOnce(&DownloadDriverImpl::DoRemoveDownload, + weak_ptr_factory_.GetWeakPtr(), guid)); } void DownloadDriverImpl::DoRemoveDownload(const std::string& guid) { @@ -278,8 +278,9 @@ // Client has removed the download before content persistence layer created // the record, remove the download immediately. base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&DownloadDriverImpl::DoRemoveDownload, - weak_ptr_factory_.GetWeakPtr(), item->GetGuid())); + FROM_HERE, + base::BindOnce(&DownloadDriverImpl::DoRemoveDownload, + weak_ptr_factory_.GetWeakPtr(), item->GetGuid())); return; }
diff --git a/components/download/internal/background_service/controller_impl.cc b/components/download/internal/background_service/controller_impl.cc index 2d4d780..fa83a25 100644 --- a/components/download/internal/background_service/controller_impl.cc +++ b/components/download/internal/background_service/controller_impl.cc
@@ -456,8 +456,8 @@ // immediately again. base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::Bind(&ControllerImpl::UpdateDriverStateWithGuid, - weak_ptr_factory_.GetWeakPtr(), download.guid), + base::BindOnce(&ControllerImpl::UpdateDriverStateWithGuid, + weak_ptr_factory_.GetWeakPtr(), download.guid), config_->download_retry_delay); } else { HandleCompleteDownload(CompletionType::FAIL, download.guid); @@ -491,9 +491,9 @@ log_sink_->OnServiceDownloadChanged(entry->guid); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&ControllerImpl::SendOnDownloadUpdated, - weak_ptr_factory_.GetWeakPtr(), entry->client, - download.guid, download.bytes_downloaded)); + FROM_HERE, base::BindOnce(&ControllerImpl::SendOnDownloadUpdated, + weak_ptr_factory_.GetWeakPtr(), entry->client, + download.guid, download.bytes_downloaded)); } bool ControllerImpl::IsTrackingDownload(const std::string& guid) const { @@ -684,8 +684,8 @@ // If we cannot recover, notify Clients that the service is unavailable. base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&ControllerImpl::SendOnServiceUnavailable, - weak_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&ControllerImpl::SendOnServiceUnavailable, + weak_ptr_factory_.GetWeakPtr())); } void ControllerImpl::StartHardRecoveryAttempt() { @@ -1053,9 +1053,9 @@ for (auto client_id : clients_->GetRegisteredClients()) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&ControllerImpl::SendOnServiceInitialized, - weak_ptr_factory_.GetWeakPtr(), client_id, - state_lost, categorized[client_id])); + FROM_HERE, base::BindOnce(&ControllerImpl::SendOnServiceInitialized, + weak_ptr_factory_.GetWeakPtr(), client_id, + state_lost, categorized[client_id])); } } @@ -1098,7 +1098,7 @@ if (callback.is_null()) return; base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, guid, result)); + FROM_HERE, base::BindOnce(callback, guid, result)); } void ControllerImpl::HandleCompleteDownload(CompletionType type, @@ -1129,16 +1129,16 @@ entry->last_cleanup_check_time = driver_entry->completion_time; base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&ControllerImpl::SendOnDownloadSucceeded, - weak_ptr_factory_.GetWeakPtr(), entry->client, - guid, completion_info)); + FROM_HERE, base::BindOnce(&ControllerImpl::SendOnDownloadSucceeded, + weak_ptr_factory_.GetWeakPtr(), entry->client, + guid, completion_info)); TransitTo(entry, Entry::State::COMPLETE, model_.get()); ScheduleCleanupTask(); } else { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&ControllerImpl::SendOnDownloadFailed, - weak_ptr_factory_.GetWeakPtr(), entry->client, - guid, FailureReasonFromCompletionType(type))); + FROM_HERE, base::BindOnce(&ControllerImpl::SendOnDownloadFailed, + weak_ptr_factory_.GetWeakPtr(), entry->client, + guid, FailureReasonFromCompletionType(type))); log_sink_->OnServiceDownloadFailed(type, *entry); // TODO(dtrainor): Handle the case where we crash before the model write
diff --git a/components/download/internal/background_service/download_service_impl.cc b/components/download/internal/background_service/download_service_impl.cc index 49bb7fc..8ba75350 100644 --- a/components/download/internal/background_service/download_service_impl.cc +++ b/components/download/internal/background_service/download_service_impl.cc
@@ -44,7 +44,7 @@ pending_tasks_[task_type] = base::BindOnce( &Controller::OnStartScheduledTask, base::Unretained(controller_.get()), - task_type, base::Passed(&callback)); + task_type, std::move(callback)); } bool DownloadServiceImpl::OnStopScheduledTask(DownloadTaskType task_type) {
diff --git a/components/download/internal/background_service/download_store_unittest.cc b/components/download/internal/background_service/download_store_unittest.cc index f008e11..7943c6b 100644 --- a/components/download/internal/background_service/download_store_unittest.cc +++ b/components/download/internal/background_service/download_store_unittest.cc
@@ -77,8 +77,9 @@ ASSERT_FALSE(store_->IsInitialized()); std::vector<Entry> preloaded_entries; - store_->Initialize(base::Bind(&DownloadStoreTest::InitCallback, - base::Unretained(this), &preloaded_entries)); + store_->Initialize(base::BindOnce(&DownloadStoreTest::InitCallback, + base::Unretained(this), + &preloaded_entries)); db_->InitCallback(true); db_->LoadCallback(true); @@ -92,16 +93,17 @@ ASSERT_FALSE(store_->IsInitialized()); std::vector<Entry> preloaded_entries; - store_->Initialize(base::Bind(&DownloadStoreTest::InitCallback, - base::Unretained(this), &preloaded_entries)); + store_->Initialize(base::BindOnce(&DownloadStoreTest::InitCallback, + base::Unretained(this), + &preloaded_entries)); db_->InitCallback(true); db_->LoadCallback(true); ASSERT_TRUE(store_->IsInitialized()); ASSERT_EQ(2u, preloaded_entries.size()); - store_->HardRecover( - base::Bind(&DownloadStoreTest::RecoverCallback, base::Unretained(this))); + store_->HardRecover(base::BindOnce(&DownloadStoreTest::RecoverCallback, + base::Unretained(this))); ASSERT_FALSE(store_->IsInitialized()); @@ -119,16 +121,17 @@ ASSERT_FALSE(store_->IsInitialized()); std::vector<Entry> preloaded_entries; - store_->Initialize(base::Bind(&DownloadStoreTest::InitCallback, - base::Unretained(this), &preloaded_entries)); + store_->Initialize(base::BindOnce(&DownloadStoreTest::InitCallback, + base::Unretained(this), + &preloaded_entries)); db_->InitCallback(true); db_->LoadCallback(true); ASSERT_TRUE(store_->IsInitialized()); ASSERT_EQ(2u, preloaded_entries.size()); - store_->HardRecover( - base::Bind(&DownloadStoreTest::RecoverCallback, base::Unretained(this))); + store_->HardRecover(base::BindOnce(&DownloadStoreTest::RecoverCallback, + base::Unretained(this))); ASSERT_FALSE(store_->IsInitialized()); @@ -145,16 +148,17 @@ ASSERT_FALSE(store_->IsInitialized()); std::vector<Entry> preloaded_entries; - store_->Initialize(base::Bind(&DownloadStoreTest::InitCallback, - base::Unretained(this), &preloaded_entries)); + store_->Initialize(base::BindOnce(&DownloadStoreTest::InitCallback, + base::Unretained(this), + &preloaded_entries)); db_->InitCallback(true); db_->LoadCallback(true); ASSERT_TRUE(store_->IsInitialized()); ASSERT_EQ(2u, preloaded_entries.size()); - store_->HardRecover( - base::Bind(&DownloadStoreTest::RecoverCallback, base::Unretained(this))); + store_->HardRecover(base::BindOnce(&DownloadStoreTest::RecoverCallback, + base::Unretained(this))); ASSERT_FALSE(store_->IsInitialized()); @@ -171,8 +175,9 @@ CreateDatabase(); std::vector<Entry> preloaded_entries; - store_->Initialize(base::Bind(&DownloadStoreTest::InitCallback, - base::Unretained(this), &preloaded_entries)); + store_->Initialize(base::BindOnce(&DownloadStoreTest::InitCallback, + base::Unretained(this), + &preloaded_entries)); db_->InitCallback(true); db_->LoadCallback(true); ASSERT_TRUE(store_->IsInitialized()); @@ -181,17 +186,17 @@ Entry item1 = test::BuildEntry(DownloadClient::TEST, base::GenerateGUID()); Entry item2 = test::BuildEntry(DownloadClient::TEST, base::GenerateGUID()); EXPECT_CALL(*this, StoreCallback(true)).Times(2); - store_->Update(item1, base::Bind(&DownloadStoreTest::StoreCallback, - base::Unretained(this))); + store_->Update(item1, base::BindOnce(&DownloadStoreTest::StoreCallback, + base::Unretained(this))); db_->UpdateCallback(true); - store_->Update(item2, base::Bind(&DownloadStoreTest::StoreCallback, - base::Unretained(this))); + store_->Update(item2, base::BindOnce(&DownloadStoreTest::StoreCallback, + base::Unretained(this))); db_->UpdateCallback(true); // Query the database directly and check for the entry. auto protos = std::make_unique<std::vector<protodb::Entry>>(); - db_->LoadEntries(base::Bind(&DownloadStoreTest::LoadCallback, - base::Unretained(this), protos.get())); + db_->LoadEntries(base::BindOnce(&DownloadStoreTest::LoadCallback, + base::Unretained(this), protos.get())); db_->LoadCallback(true); ASSERT_EQ(4u, protos->size()); ASSERT_TRUE(test::CompareEntryList( @@ -204,23 +209,24 @@ CreateDatabase(); std::vector<Entry> preloaded_entries; - store_->Initialize(base::Bind(&DownloadStoreTest::InitCallback, - base::Unretained(this), &preloaded_entries)); + store_->Initialize(base::BindOnce(&DownloadStoreTest::InitCallback, + base::Unretained(this), + &preloaded_entries)); db_->InitCallback(true); db_->LoadCallback(true); ASSERT_EQ(2u, preloaded_entries.size()); // Remove the entry. EXPECT_CALL(*this, StoreCallback(true)).Times(1); - store_->Remove( - preloaded_entries[0].guid, - base::Bind(&DownloadStoreTest::StoreCallback, base::Unretained(this))); + store_->Remove(preloaded_entries[0].guid, + base::BindOnce(&DownloadStoreTest::StoreCallback, + base::Unretained(this))); db_->UpdateCallback(true); // Query the database directly and check for the entry removed. auto protos = std::make_unique<std::vector<protodb::Entry>>(); - db_->LoadEntries(base::Bind(&DownloadStoreTest::LoadCallback, - base::Unretained(this), protos.get())); + db_->LoadEntries(base::BindOnce(&DownloadStoreTest::LoadCallback, + base::Unretained(this), protos.get())); db_->LoadCallback(true); ASSERT_EQ(1u, protos->size()); ASSERT_TRUE(test::CompareEntryList( @@ -233,8 +239,9 @@ CreateDatabase(); std::vector<Entry> preloaded_entries; - store_->Initialize(base::Bind(&DownloadStoreTest::InitCallback, - base::Unretained(this), &preloaded_entries)); + store_->Initialize(base::BindOnce(&DownloadStoreTest::InitCallback, + base::Unretained(this), + &preloaded_entries)); db_->InitCallback(false); ASSERT_FALSE(store_->IsInitialized()); ASSERT_TRUE(preloaded_entries.empty()); @@ -245,8 +252,9 @@ CreateDatabase(); std::vector<Entry> preloaded_entries; - store_->Initialize(base::Bind(&DownloadStoreTest::InitCallback, - base::Unretained(this), &preloaded_entries)); + store_->Initialize(base::BindOnce(&DownloadStoreTest::InitCallback, + base::Unretained(this), + &preloaded_entries)); db_->InitCallback(true); db_->LoadCallback(false); ASSERT_FALSE(store_->IsInitialized()); @@ -258,8 +266,8 @@ CreateDatabase(); std::vector<Entry> entries; - store_->Initialize(base::Bind(&DownloadStoreTest::InitCallback, - base::Unretained(this), &entries)); + store_->Initialize(base::BindOnce(&DownloadStoreTest::InitCallback, + base::Unretained(this), &entries)); db_->InitCallback(true); db_->LoadCallback(true); ASSERT_TRUE(store_->IsInitialized()); @@ -267,14 +275,14 @@ // Update failed. EXPECT_CALL(*this, StoreCallback(false)).Times(1); - store_->Update(item1, base::Bind(&DownloadStoreTest::StoreCallback, - base::Unretained(this))); + store_->Update(item1, base::BindOnce(&DownloadStoreTest::StoreCallback, + base::Unretained(this))); db_->UpdateCallback(false); // Remove failed. EXPECT_CALL(*this, StoreCallback(false)).Times(1); - store_->Remove(item1.guid, base::Bind(&DownloadStoreTest::StoreCallback, - base::Unretained(this))); + store_->Remove(item1.guid, base::BindOnce(&DownloadStoreTest::StoreCallback, + base::Unretained(this))); db_->UpdateCallback(false); } @@ -282,8 +290,8 @@ CreateDatabase(); std::vector<Entry> entries; - store_->Initialize(base::Bind(&DownloadStoreTest::InitCallback, - base::Unretained(this), &entries)); + store_->Initialize(base::BindOnce(&DownloadStoreTest::InitCallback, + base::Unretained(this), &entries)); db_->InitCallback(true); db_->LoadCallback(true); ASSERT_TRUE(entries.empty()); @@ -291,30 +299,30 @@ Entry item1 = test::BuildEntry(DownloadClient::TEST, base::GenerateGUID()); Entry item2 = test::BuildEntry(DownloadClient::TEST, base::GenerateGUID()); EXPECT_CALL(*this, StoreCallback(true)).Times(2); - store_->Update(item1, base::Bind(&DownloadStoreTest::StoreCallback, - base::Unretained(this))); + store_->Update(item1, base::BindOnce(&DownloadStoreTest::StoreCallback, + base::Unretained(this))); db_->UpdateCallback(true); - store_->Update(item2, base::Bind(&DownloadStoreTest::StoreCallback, - base::Unretained(this))); + store_->Update(item2, base::BindOnce(&DownloadStoreTest::StoreCallback, + base::Unretained(this))); db_->UpdateCallback(true); // Query the database directly and check for the entry. auto protos = std::make_unique<std::vector<protodb::Entry>>(); - db_->LoadEntries(base::Bind(&DownloadStoreTest::LoadCallback, - base::Unretained(this), protos.get())); + db_->LoadEntries(base::BindOnce(&DownloadStoreTest::LoadCallback, + base::Unretained(this), protos.get())); db_->LoadCallback(true); ASSERT_EQ(2u, protos->size()); // Remove the entry. EXPECT_CALL(*this, StoreCallback(true)).Times(1); - store_->Remove(item1.guid, base::Bind(&DownloadStoreTest::StoreCallback, - base::Unretained(this))); + store_->Remove(item1.guid, base::BindOnce(&DownloadStoreTest::StoreCallback, + base::Unretained(this))); db_->UpdateCallback(true); // Query the database directly and check for the entry removed. protos->clear(); - db_->LoadEntries(base::Bind(&DownloadStoreTest::LoadCallback, - base::Unretained(this), protos.get())); + db_->LoadEntries(base::BindOnce(&DownloadStoreTest::LoadCallback, + base::Unretained(this), protos.get())); db_->LoadCallback(true); ASSERT_EQ(1u, protos->size()); ASSERT_TRUE(test::CompareEntryList(
diff --git a/components/download/internal/background_service/file_monitor_impl.cc b/components/download/internal/background_service/file_monitor_impl.cc index e7b0055..21b9bc8 100644 --- a/components/download/internal/background_service/file_monitor_impl.cc +++ b/components/download/internal/background_service/file_monitor_impl.cc
@@ -168,8 +168,8 @@ } file_thread_task_runner_->PostTask( - FROM_HERE, base::Bind(&DeleteUnknownFilesOnFileThread, download_file_dir_, - download_file_paths)); + FROM_HERE, base::BindOnce(&DeleteUnknownFilesOnFileThread, + download_file_dir_, download_file_paths)); } void FileMonitorImpl::CleanupFilesForCompletedEntries( @@ -187,8 +187,8 @@ file_thread_task_runner_->PostTaskAndReply( FROM_HERE, - base::Bind(&DeleteFilesOnFileThread, files_to_remove, - stats::FileCleanupReason::TIMEOUT), + base::BindOnce(&DeleteFilesOnFileThread, files_to_remove, + stats::FileCleanupReason::TIMEOUT), completion_callback); } @@ -196,7 +196,8 @@ const std::set<base::FilePath>& files_to_remove, stats::FileCleanupReason reason) { file_thread_task_runner_->PostTask( - FROM_HERE, base::Bind(&DeleteFilesOnFileThread, files_to_remove, reason)); + FROM_HERE, + base::BindOnce(&DeleteFilesOnFileThread, files_to_remove, reason)); } void FileMonitorImpl::HardRecover(const InitCallback& callback) {
diff --git a/components/download/internal/background_service/model_impl.cc b/components/download/internal/background_service/model_impl.cc index d8f8ce6..3beabb3 100644 --- a/components/download/internal/background_service/model_impl.cc +++ b/components/download/internal/background_service/model_impl.cc
@@ -27,8 +27,8 @@ DCHECK(client_); DCHECK(!store_->IsInitialized()); - store_->Initialize(base::Bind(&ModelImpl::OnInitializedFinished, - weak_ptr_factory_.GetWeakPtr())); + store_->Initialize(base::BindOnce(&ModelImpl::OnInitializedFinished, + weak_ptr_factory_.GetWeakPtr())); } void ModelImpl::HardRecover() {
diff --git a/components/download/internal/background_service/navigation_monitor_impl_unittests.cc b/components/download/internal/background_service/navigation_monitor_impl_unittests.cc index dbd8ff6..0b23cef 100644 --- a/components/download/internal/background_service/navigation_monitor_impl_unittests.cc +++ b/components/download/internal/background_service/navigation_monitor_impl_unittests.cc
@@ -37,8 +37,8 @@ void VerifyNavigationStateAt(bool expected, int millis) { task_runner_->PostDelayedTask( FROM_HERE, - base::Bind(&TestNavigationMonitorObserver::VerifyNavigationState, - weak_ptr_factory_.GetWeakPtr(), expected), + base::BindOnce(&TestNavigationMonitorObserver::VerifyNavigationState, + weak_ptr_factory_.GetWeakPtr(), expected), base::TimeDelta::FromMilliseconds(millis)); } @@ -81,8 +81,8 @@ void SendNavigationEventAt(NavigationEvent event, int millis) { task_runner_->PostDelayedTask( FROM_HERE, - base::Bind(&NavigationMonitorImplTest::SendNavigationEvent, - weak_ptr_factory_.GetWeakPtr(), event), + base::BindOnce(&NavigationMonitorImplTest::SendNavigationEvent, + weak_ptr_factory_.GetWeakPtr(), event), base::TimeDelta::FromMilliseconds(millis)); }
diff --git a/components/download/internal/background_service/scheduler/device_status_listener.cc b/components/download/internal/background_service/scheduler/device_status_listener.cc index b277fd01..116c5b8 100644 --- a/components/download/internal/background_service/scheduler/device_status_listener.cc +++ b/components/download/internal/background_service/scheduler/device_status_listener.cc
@@ -125,8 +125,8 @@ // Network stack may shake off all connections after getting the IP address, // use a delay to wait for potential network setup. timer_.Start(FROM_HERE, startup_delay_, - base::Bind(&DeviceStatusListener::StartAfterDelay, - base::Unretained(this))); + base::BindOnce(&DeviceStatusListener::StartAfterDelay, + base::Unretained(this))); } void DeviceStatusListener::StartAfterDelay() { @@ -190,8 +190,8 @@ if (change_to_online) { is_valid_state_ = false; timer_.Start(FROM_HERE, online_delay_, - base::Bind(&DeviceStatusListener::NotifyNetworkChange, - base::Unretained(this))); + base::BindOnce(&DeviceStatusListener::NotifyNetworkChange, + base::Unretained(this))); } else { timer_.Stop(); NotifyNetworkChange();
diff --git a/components/download/internal/background_service/test/test_device_status_listener.cc b/components/download/internal/background_service/test/test_device_status_listener.cc index 6c01d71..f6b1920 100644 --- a/components/download/internal/background_service/test/test_device_status_listener.cc +++ b/components/download/internal/background_service/test/test_device_status_listener.cc
@@ -50,8 +50,8 @@ // Simulates the delay after start up. base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&TestDeviceStatusListener::StartAfterDelay, - weak_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&TestDeviceStatusListener::StartAfterDelay, + weak_ptr_factory_.GetWeakPtr())); } void TestDeviceStatusListener::StartAfterDelay() {
diff --git a/components/download/public/background_service/test/test_download_service.cc b/components/download/public/background_service/test/test_download_service.cc index b2cd8516..28a8301 100644 --- a/components/download/public/background_service/test/test_download_service.cc +++ b/components/download/public/background_service/test/test_download_service.cc
@@ -80,8 +80,8 @@ return; base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&TestDownloadService::ProcessDownload, - base::Unretained(this))); + FROM_HERE, base::BindOnce(&TestDownloadService::ProcessDownload, + base::Unretained(this))); } void TestDownloadService::PauseDownload(const std::string& guid) {}
diff --git a/components/drive/chromeos/change_list_loader.cc b/components/drive/chromeos/change_list_loader.cc index 2ba3e49..049250c 100644 --- a/components/drive/chromeos/change_list_loader.cc +++ b/components/drive/chromeos/change_list_loader.cc
@@ -286,7 +286,7 @@ Load(callback); else base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, FILE_ERROR_OK)); + FROM_HERE, base::BindOnce(callback, FILE_ERROR_OK)); } void ChangeListLoader::Load(const FileOperationCallback& callback) { @@ -390,8 +390,8 @@ } for (auto& callback : pending_load_callback_) { - base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, - base::Bind(callback, error)); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(callback, error)); } pending_load_callback_.clear();
diff --git a/components/drive/chromeos/file_cache.cc b/components/drive/chromeos/file_cache.cc index e8aa3c5..8410895 100644 --- a/components/drive/chromeos/file_cache.cc +++ b/components/drive/chromeos/file_cache.cc
@@ -695,8 +695,8 @@ // Note that base::DeletePointer<> cannot be used as the destructor of this // class is private. blocking_task_runner_->PostTask( - FROM_HERE, - base::Bind(&FileCache::DestroyOnBlockingPool, base::Unretained(this))); + FROM_HERE, base::BindOnce(&FileCache::DestroyOnBlockingPool, + base::Unretained(this))); } void FileCache::DestroyOnBlockingPool() {
diff --git a/components/drive/chromeos/file_system.cc b/components/drive/chromeos/file_system.cc index 0a51341..857a41cb 100644 --- a/components/drive/chromeos/file_system.cc +++ b/components/drive/chromeos/file_system.cc
@@ -913,10 +913,9 @@ void FileSystem::OnInitialLoadComplete() { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - blocking_task_runner_->PostTask(FROM_HERE, - base::Bind(&internal::RemoveStaleCacheFiles, - cache_, - resource_metadata_)); + blocking_task_runner_->PostTask( + FROM_HERE, base::BindOnce(&internal::RemoveStaleCacheFiles, cache_, + resource_metadata_)); sync_client_->StartProcessingBacklog(); }
diff --git a/components/drive/chromeos/file_system/download_operation.cc b/components/drive/chromeos/file_system/download_operation.cc index 0d6ba75..d6084b1 100644 --- a/components/drive/chromeos/file_system/download_operation.cc +++ b/components/drive/chromeos/file_system/download_operation.cc
@@ -223,9 +223,9 @@ DCHECK(cache); // Downloaded file should be deleted on errors. - base::ScopedClosureRunner file_deleter(base::Bind( - base::IgnoreResult(&base::DeleteFile), - downloaded_file_path, false /* recursive */)); + base::ScopedClosureRunner file_deleter( + base::BindOnce(base::IgnoreResult(&base::DeleteFile), + downloaded_file_path, false /* recursive */)); FileError error = GDataToFileError(gdata_error); if (error != FILE_ERROR_OK)
diff --git a/components/drive/chromeos/file_system/get_file_for_saving_operation.cc b/components/drive/chromeos/file_system/get_file_for_saving_operation.cc index ac84f7bf..6c88c860 100644 --- a/components/drive/chromeos/file_system/get_file_for_saving_operation.cc +++ b/components/drive/chromeos/file_system/get_file_for_saving_operation.cc
@@ -188,11 +188,9 @@ // Clients may have enlarged the file. By FreeDiskpSpaceIfNeededFor(0), // we try to ensure (0 + the-minimum-safe-margin = 512MB as of now) space. blocking_task_runner_->PostTask( - FROM_HERE, - base::Bind(base::IgnoreResult( - base::Bind(&internal::FileCache::FreeDiskSpaceIfNeededFor, - base::Unretained(cache_), - 0)))); + FROM_HERE, base::BindOnce(base::IgnoreResult( + base::Bind(&internal::FileCache::FreeDiskSpaceIfNeededFor, + base::Unretained(cache_), 0)))); } } // namespace file_system
diff --git a/components/drive/chromeos/file_system/open_file_operation.cc b/components/drive/chromeos/file_system/open_file_operation.cc index 10e699b..43b01e0 100644 --- a/components/drive/chromeos/file_system/open_file_operation.cc +++ b/components/drive/chromeos/file_system/open_file_operation.cc
@@ -172,11 +172,9 @@ // Clients may have enlarged the file. By FreeDiskpSpaceIfNeededFor(0), // we try to ensure (0 + the-minimum-safe-margin = 512MB as of now) space. blocking_task_runner_->PostTask( - FROM_HERE, - base::Bind(base::IgnoreResult( - base::Bind(&internal::FileCache::FreeDiskSpaceIfNeededFor, - base::Unretained(cache_), - 0)))); + FROM_HERE, base::BindOnce(base::IgnoreResult(base::Bind( + &internal::FileCache::FreeDiskSpaceIfNeededFor, + base::Unretained(cache_), 0)))); } }
diff --git a/components/drive/chromeos/file_system/truncate_operation.cc b/components/drive/chromeos/file_system/truncate_operation.cc index c981e892..201aca7 100644 --- a/components/drive/chromeos/file_system/truncate_operation.cc +++ b/components/drive/chromeos/file_system/truncate_operation.cc
@@ -81,8 +81,7 @@ if (length < 0) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(callback, FILE_ERROR_INVALID_OPERATION)); + FROM_HERE, base::BindOnce(callback, FILE_ERROR_INVALID_OPERATION)); return; }
diff --git a/components/drive/chromeos/resource_metadata.cc b/components/drive/chromeos/resource_metadata.cc index 7a37a4f..cc84d9a 100644 --- a/components/drive/chromeos/resource_metadata.cc +++ b/components/drive/chromeos/resource_metadata.cc
@@ -88,9 +88,8 @@ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); blocking_task_runner_->PostTask( - FROM_HERE, - base::Bind(&ResourceMetadata::DestroyOnBlockingPool, - base::Unretained(this))); + FROM_HERE, base::BindOnce(&ResourceMetadata::DestroyOnBlockingPool, + base::Unretained(this))); } FileError ResourceMetadata::Reset() {
diff --git a/components/drive/chromeos/sync_client.cc b/components/drive/chromeos/sync_client.cc index 235495c..5d59647c 100644 --- a/components/drive/chromeos/sync_client.cc +++ b/components/drive/chromeos/sync_client.cc
@@ -178,11 +178,10 @@ std::vector<std::string>* to_update = new std::vector<std::string>; blocking_task_runner_->PostTaskAndReply( FROM_HERE, - base::Bind(&CollectBacklog, metadata_, to_fetch, to_update), - base::Bind(&SyncClient::OnGetLocalIdsOfBacklog, - weak_ptr_factory_.GetWeakPtr(), - base::Owned(to_fetch), - base::Owned(to_update))); + base::BindOnce(&CollectBacklog, metadata_, to_fetch, to_update), + base::BindOnce(&SyncClient::OnGetLocalIdsOfBacklog, + weak_ptr_factory_.GetWeakPtr(), base::Owned(to_fetch), + base::Owned(to_update))); } void SyncClient::StartCheckingExistingPinnedFiles() { @@ -191,13 +190,9 @@ std::vector<std::string>* local_ids = new std::vector<std::string>; blocking_task_runner_->PostTaskAndReply( FROM_HERE, - base::Bind(&CheckExistingPinnedFiles, - metadata_, - cache_, - local_ids), - base::Bind(&SyncClient::AddFetchTasks, - weak_ptr_factory_.GetWeakPtr(), - base::Owned(local_ids))); + base::BindOnce(&CheckExistingPinnedFiles, metadata_, cache_, local_ids), + base::BindOnce(&SyncClient::AddFetchTasks, weak_ptr_factory_.GetWeakPtr(), + base::Owned(local_ids))); } void SyncClient::AddFetchTask(const std::string& local_id) { @@ -324,7 +319,8 @@ DCHECK_EQ(PENDING, task.state); base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::Bind(&SyncClient::StartTask, weak_ptr_factory_.GetWeakPtr(), key), + base::BindOnce(&SyncClient::StartTask, weak_ptr_factory_.GetWeakPtr(), + key), delay); } @@ -458,7 +454,7 @@ for (size_t i = 0; i < it->second.waiting_callbacks.size(); ++i) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(it->second.waiting_callbacks[i], error)); + FROM_HERE, base::BindOnce(it->second.waiting_callbacks[i], error)); } it->second.waiting_callbacks.clear(); @@ -468,7 +464,8 @@ it->second.should_run_again = false; base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::Bind(&SyncClient::StartTask, weak_ptr_factory_.GetWeakPtr(), key), + base::BindOnce(&SyncClient::StartTask, weak_ptr_factory_.GetWeakPtr(), + key), retry_delay); } else { for (size_t i = 0; i < it->second.dependent_tasks.size(); ++i)
diff --git a/components/drive/drive_notification_manager.cc b/components/drive/drive_notification_manager.cc index e9c5483..a8b675b 100644 --- a/components/drive/drive_notification_manager.cc +++ b/components/drive/drive_notification_manager.cc
@@ -99,11 +99,9 @@ kFastPollingIntervalInSecs); polling_timer_.Stop(); polling_timer_.Start( - FROM_HERE, - base::TimeDelta::FromSeconds(interval_secs), - base::Bind(&DriveNotificationManager::NotifyObserversToUpdate, - weak_ptr_factory_.GetWeakPtr(), - NOTIFICATION_POLLING)); + FROM_HERE, base::TimeDelta::FromSeconds(interval_secs), + base::BindOnce(&DriveNotificationManager::NotifyObserversToUpdate, + weak_ptr_factory_.GetWeakPtr(), NOTIFICATION_POLLING)); } void DriveNotificationManager::NotifyObserversToUpdate(
diff --git a/components/drive/drive_uploader_unittest.cc b/components/drive/drive_uploader_unittest.cc index 9f7836e4..41d1912 100644 --- a/components/drive/drive_uploader_unittest.cc +++ b/components/drive/drive_uploader_unittest.cc
@@ -67,7 +67,7 @@ // whole file uploading. base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(progress_callback, content_length, content_length)); + base::BindOnce(progress_callback, content_length, content_length)); } // MultipartUploadXXXFile is an asynchronous function, so don't callback @@ -122,8 +122,9 @@ // Calls back the upload URL for subsequent ResumeUpload requests. // InitiateUpload is an asynchronous function, so don't callback directly. - base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, - base::Bind(callback, HTTP_SUCCESS, GURL(kTestUploadNewFileURL))); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, + base::BindOnce(callback, HTTP_SUCCESS, GURL(kTestUploadNewFileURL))); return CancelCallback(); } @@ -138,15 +139,16 @@ EXPECT_EQ(kTestInitiateUploadResourceId, resource_id); if (!options.etag.empty() && options.etag != kTestETag) { - base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, - base::Bind(callback, HTTP_PRECONDITION, GURL())); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(callback, HTTP_PRECONDITION, GURL())); return CancelCallback(); } // Calls back the upload URL for subsequent ResumeUpload requests. // InitiateUpload is an asynchronous function, so don't callback directly. - base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, - base::Bind(callback, HTTP_SUCCESS, GURL(kTestUploadExistingFileURL))); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(callback, HTTP_SUCCESS, + GURL(kTestUploadExistingFileURL))); return CancelCallback(); } @@ -186,8 +188,8 @@ // For the testing purpose, it always notifies the progress at the end of // each chunk uploading. int64_t chunk_size = end_position - start_position; - base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, - base::Bind(progress_callback, chunk_size, chunk_size)); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(progress_callback, chunk_size, chunk_size)); } SendUploadRangeResponse(upload_location, callback); @@ -293,8 +295,8 @@ const std::string& title, const UploadNewFileOptions& options, const InitiateUploadCallback& callback) override { - base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, - base::Bind(callback, DRIVE_NO_CONNECTION, GURL())); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(callback, DRIVE_NO_CONNECTION, GURL())); return CancelCallback(); } @@ -304,8 +306,8 @@ const std::string& resource_id, const UploadExistingFileOptions& options, const InitiateUploadCallback& callback) override { - base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, - base::Bind(callback, DRIVE_NO_CONNECTION, GURL())); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(callback, DRIVE_NO_CONNECTION, GURL())); return CancelCallback(); } @@ -361,8 +363,9 @@ const std::string& title, const UploadNewFileOptions& options, const InitiateUploadCallback& callback) override { - base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, - base::Bind(callback, HTTP_SUCCESS, GURL(kTestUploadNewFileURL))); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, + base::BindOnce(callback, HTTP_SUCCESS, GURL(kTestUploadNewFileURL))); return CancelCallback(); } @@ -372,8 +375,9 @@ const std::string& resource_id, const UploadExistingFileOptions& options, const InitiateUploadCallback& callback) override { - base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, - base::Bind(callback, HTTP_SUCCESS, GURL(kTestUploadExistingFileURL))); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(callback, HTTP_SUCCESS, + GURL(kTestUploadExistingFileURL))); return CancelCallback(); }
diff --git a/components/drive/file_write_watcher.cc b/components/drive/file_write_watcher.cc index 91e502a..976f706 100644 --- a/components/drive/file_write_watcher.cc +++ b/components/drive/file_write_watcher.cc
@@ -92,8 +92,8 @@ // Just forwarding the call to FILE thread. blocking_task_runner_->PostTask( - FROM_HERE, base::Bind(&FileWriteWatcherImpl::DestroyOnBlockingThread, - base::Unretained(this))); + FROM_HERE, base::BindOnce(&FileWriteWatcherImpl::DestroyOnBlockingThread, + base::Unretained(this))); } void FileWriteWatcher::FileWriteWatcherImpl::StartWatch( @@ -105,10 +105,10 @@ // Forwarding the call to FILE thread and relaying the |callback|. blocking_task_runner_->PostTask( FROM_HERE, - base::Bind(&FileWriteWatcherImpl::StartWatchOnBlockingThread, - base::Unretained(this), path, - google_apis::CreateRelayCallback(on_start_callback), - google_apis::CreateRelayCallback(on_write_callback))); + base::BindOnce(&FileWriteWatcherImpl::StartWatchOnBlockingThread, + base::Unretained(this), path, + google_apis::CreateRelayCallback(on_start_callback), + google_apis::CreateRelayCallback(on_write_callback))); } FileWriteWatcher::FileWriteWatcherImpl::~FileWriteWatcherImpl() = default; @@ -154,11 +154,9 @@ // Delay running on_write_event_callback by |delay_| time, and if OnWriteEvent // is called again in the period, the timer is reset. In other words, we // invoke callback when |delay_| has passed after the last OnWriteEvent(). - it->second->timer.Start(FROM_HERE, - delay_, - base::Bind(&FileWriteWatcherImpl::InvokeCallback, - weak_ptr_factory_.GetWeakPtr(), - path)); + it->second->timer.Start(FROM_HERE, delay_, + base::BindOnce(&FileWriteWatcherImpl::InvokeCallback, + weak_ptr_factory_.GetWeakPtr(), path)); } void FileWriteWatcher::FileWriteWatcherImpl::InvokeCallback(
diff --git a/components/drive/job_scheduler.cc b/components/drive/job_scheduler.cc index 97b2c77..a88243e7 100644 --- a/components/drive/job_scheduler.cc +++ b/components/drive/job_scheduler.cc
@@ -860,9 +860,8 @@ if (now < wait_until_) { base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::Bind(&JobScheduler::DoJobLoop, - weak_ptr_factory_.GetWeakPtr(), - queue_type), + base::BindOnce(&JobScheduler::DoJobLoop, weak_ptr_factory_.GetWeakPtr(), + queue_type), wait_until_ - now); return; } @@ -990,10 +989,8 @@ // Post a task to continue the job loop. This allows us to finish handling // the current job before starting the next one. base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(&JobScheduler::DoJobLoop, - weak_ptr_factory_.GetWeakPtr(), - queue_type)); + FROM_HERE, base::BindOnce(&JobScheduler::DoJobLoop, + weak_ptr_factory_.GetWeakPtr(), queue_type)); return !should_retry; } @@ -1257,8 +1254,8 @@ queue_[GetJobQueueType(job->job_info.job_type)]->Remove(job->job_info.job_id); NotifyJobDone(job->job_info, error); job_map_.Remove(job->job_info.job_id); - base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, - base::Bind(callback, error)); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(callback, error)); } void JobScheduler::NotifyJobAdded(const JobInfo& job_info) {
diff --git a/components/drive/local_file_reader.cc b/components/drive/local_file_reader.cc index b4bcd3b4..24297ce 100644 --- a/components/drive/local_file_reader.cc +++ b/components/drive/local_file_reader.cc
@@ -29,10 +29,10 @@ int flags = base::File::FLAG_OPEN | base::File::FLAG_READ | base::File::FLAG_ASYNC; - int rv = file_stream_.Open(file_path, flags, - Bind(&LocalFileReader::DidOpen, - weak_ptr_factory_.GetWeakPtr(), - callback, offset)); + int rv = file_stream_.Open( + file_path, flags, + BindOnce(&LocalFileReader::DidOpen, weak_ptr_factory_.GetWeakPtr(), + callback, offset)); DCHECK_EQ(rv, net::ERR_IO_PENDING); } @@ -52,8 +52,8 @@ return callback.Run(error); int rv = file_stream_.Seek( - offset, Bind(&LocalFileReader::DidSeek, weak_ptr_factory_.GetWeakPtr(), - callback, offset)); + offset, BindOnce(&LocalFileReader::DidSeek, + weak_ptr_factory_.GetWeakPtr(), callback, offset)); DCHECK_EQ(rv, net::ERR_IO_PENDING); }
diff --git a/components/drive/resource_metadata_storage.cc b/components/drive/resource_metadata_storage.cc index 56cd94c..0f831cec 100644 --- a/components/drive/resource_metadata_storage.cc +++ b/components/drive/resource_metadata_storage.cc
@@ -759,8 +759,8 @@ void ResourceMetadataStorage::Destroy() { blocking_task_runner_->PostTask( - FROM_HERE, base::Bind(&ResourceMetadataStorage::DestroyOnBlockingPool, - base::Unretained(this))); + FROM_HERE, base::BindOnce(&ResourceMetadataStorage::DestroyOnBlockingPool, + base::Unretained(this))); } void ResourceMetadataStorage::RecoverCacheInfoFromTrashedResourceMap(
diff --git a/components/drive/service/fake_drive_service.cc b/components/drive/service/fake_drive_service.cc index 7707b5d9..8df5fb0 100644 --- a/components/drive/service/fake_drive_service.cc +++ b/components/drive/service/fake_drive_service.cc
@@ -711,24 +711,19 @@ if (offline_) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(callback, - DRIVE_NO_CONNECTION, - GURL())); + FROM_HERE, base::BindOnce(callback, DRIVE_NO_CONNECTION, GURL())); return CancelCallback(); } EntryInfo* entry = FindEntryByResourceId(resource_id); if (entry) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(callback, HTTP_SUCCESS, entry->share_url)); + FROM_HERE, base::BindOnce(callback, HTTP_SUCCESS, entry->share_url)); return CancelCallback(); } base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(callback, HTTP_NOT_FOUND, GURL())); + FROM_HERE, base::BindOnce(callback, HTTP_NOT_FOUND, GURL())); return CancelCallback(); } @@ -812,34 +807,34 @@ if (offline_) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, DRIVE_NO_CONNECTION)); + FROM_HERE, base::BindOnce(callback, DRIVE_NO_CONNECTION)); return CancelCallback(); } EntryInfo* entry = FindEntryByResourceId(resource_id); if (!entry) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, HTTP_NOT_FOUND)); + FROM_HERE, base::BindOnce(callback, HTTP_NOT_FOUND)); return CancelCallback(); } ChangeResource* change = &entry->change_resource; if (change->is_deleted()) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, HTTP_NOT_FOUND)); + FROM_HERE, base::BindOnce(callback, HTTP_NOT_FOUND)); return CancelCallback(); } const FileResource* file = change->file(); if (!etag.empty() && etag != file->etag()) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, HTTP_PRECONDITION)); + FROM_HERE, base::BindOnce(callback, HTTP_PRECONDITION)); return CancelCallback(); } if (entry->user_permission != google_apis::drive::PERMISSION_ROLE_OWNER) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, HTTP_FORBIDDEN)); + FROM_HERE, base::BindOnce(callback, HTTP_FORBIDDEN)); return CancelCallback(); } @@ -847,11 +842,10 @@ AddNewChangestamp(change, file->team_drive_id()); change->set_file(std::unique_ptr<FileResource>()); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, HTTP_NO_CONTENT)); + FROM_HERE, base::BindOnce(callback, HTTP_NO_CONTENT)); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(&FakeDriveService::NotifyObservers, - weak_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&FakeDriveService::NotifyObservers, + weak_ptr_factory_.GetWeakPtr())); return CancelCallback(); } @@ -863,14 +857,14 @@ if (offline_) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, DRIVE_NO_CONNECTION)); + FROM_HERE, base::BindOnce(callback, DRIVE_NO_CONNECTION)); return CancelCallback(); } EntryInfo* entry = FindEntryByResourceId(resource_id); if (!entry) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, HTTP_NOT_FOUND)); + FROM_HERE, base::BindOnce(callback, HTTP_NOT_FOUND)); return CancelCallback(); } @@ -878,24 +872,23 @@ FileResource* file = change->mutable_file(); if (change->is_deleted() || file->labels().is_trashed()) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, HTTP_NOT_FOUND)); + FROM_HERE, base::BindOnce(callback, HTTP_NOT_FOUND)); return CancelCallback(); } if (entry->user_permission != google_apis::drive::PERMISSION_ROLE_OWNER) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, HTTP_FORBIDDEN)); + FROM_HERE, base::BindOnce(callback, HTTP_FORBIDDEN)); return CancelCallback(); } file->mutable_labels()->set_trashed(true); AddNewChangestamp(change, file->team_drive_id()); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, HTTP_SUCCESS)); + FROM_HERE, base::BindOnce(callback, HTTP_SUCCESS)); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(&FakeDriveService::NotifyObservers, - weak_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&FakeDriveService::NotifyObservers, + weak_ptr_factory_.GetWeakPtr())); return CancelCallback(); } @@ -911,18 +904,16 @@ if (offline_) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(download_action_callback, - DRIVE_NO_CONNECTION, - base::FilePath())); + FROM_HERE, base::BindOnce(download_action_callback, DRIVE_NO_CONNECTION, + base::FilePath())); return CancelCallback(); } EntryInfo* entry = FindEntryByResourceId(resource_id); if (!entry || entry->change_resource.file()->IsHostedDocument()) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(download_action_callback, HTTP_NOT_FOUND, base::FilePath())); + FROM_HERE, base::BindOnce(download_action_callback, HTTP_NOT_FOUND, + base::FilePath())); return CancelCallback(); } @@ -946,9 +937,8 @@ if (!test_util::WriteStringToFile(local_cache_path, content_data)) { // Failed to write the content. base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(download_action_callback, - DRIVE_FILE_ERROR, base::FilePath())); + FROM_HERE, base::BindOnce(download_action_callback, DRIVE_FILE_ERROR, + base::FilePath())); return CancelCallback(); } @@ -957,17 +947,13 @@ // can handle the case progress_callback is called multiple times, // here we invoke the callback twice. base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(progress_callback, file_size / 2, file_size)); + FROM_HERE, base::BindOnce(progress_callback, file_size / 2, file_size)); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(progress_callback, file_size, file_size)); + FROM_HERE, base::BindOnce(progress_callback, file_size, file_size)); } base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(download_action_callback, - HTTP_SUCCESS, - local_cache_path)); + base::BindOnce(download_action_callback, HTTP_SUCCESS, local_cache_path)); return CancelCallback(); } @@ -1041,9 +1027,8 @@ FROM_HERE, base::BindOnce(callback, HTTP_SUCCESS, std::make_unique<FileResource>(*new_file))); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(&FakeDriveService::NotifyObservers, - weak_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&FakeDriveService::NotifyObservers, + weak_ptr_factory_.GetWeakPtr())); return CancelCallback(); } @@ -1111,9 +1096,8 @@ FROM_HERE, base::BindOnce(callback, HTTP_SUCCESS, std::make_unique<FileResource>(*file))); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(&FakeDriveService::NotifyObservers, - weak_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&FakeDriveService::NotifyObservers, + weak_ptr_factory_.GetWeakPtr())); return CancelCallback(); } @@ -1126,14 +1110,14 @@ if (offline_) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, DRIVE_NO_CONNECTION)); + FROM_HERE, base::BindOnce(callback, DRIVE_NO_CONNECTION)); return CancelCallback(); } EntryInfo* entry = FindEntryByResourceId(resource_id); if (!entry) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, HTTP_NOT_FOUND)); + FROM_HERE, base::BindOnce(callback, HTTP_NOT_FOUND)); return CancelCallback(); } @@ -1148,11 +1132,10 @@ AddNewChangestamp(change, change->file()->team_drive_id()); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, HTTP_SUCCESS)); + FROM_HERE, base::BindOnce(callback, HTTP_SUCCESS)); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(&FakeDriveService::NotifyObservers, - weak_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&FakeDriveService::NotifyObservers, + weak_ptr_factory_.GetWeakPtr())); return CancelCallback(); } @@ -1165,14 +1148,14 @@ if (offline_) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, DRIVE_NO_CONNECTION)); + FROM_HERE, base::BindOnce(callback, DRIVE_NO_CONNECTION)); return CancelCallback(); } EntryInfo* entry = FindEntryByResourceId(resource_id); if (!entry) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, HTTP_NOT_FOUND)); + FROM_HERE, base::BindOnce(callback, HTTP_NOT_FOUND)); return CancelCallback(); } @@ -1184,17 +1167,16 @@ parents->erase(parents->begin() + i); AddNewChangestamp(change, file->team_drive_id()); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, HTTP_NO_CONTENT)); + FROM_HERE, base::BindOnce(callback, HTTP_NO_CONTENT)); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(&FakeDriveService::NotifyObservers, - weak_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&FakeDriveService::NotifyObservers, + weak_ptr_factory_.GetWeakPtr())); return CancelCallback(); } } base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, HTTP_NOT_FOUND)); + FROM_HERE, base::BindOnce(callback, HTTP_NOT_FOUND)); return CancelCallback(); } @@ -1223,16 +1205,14 @@ if (offline_) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(callback, DRIVE_NO_CONNECTION, GURL())); + FROM_HERE, base::BindOnce(callback, DRIVE_NO_CONNECTION, GURL())); return CancelCallback(); } if (parent_resource_id != GetRootResourceId() && !entries_.count(parent_resource_id)) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(callback, HTTP_NOT_FOUND, GURL())); + FROM_HERE, base::BindOnce(callback, HTTP_NOT_FOUND, GURL())); return CancelCallback(); } @@ -1245,8 +1225,7 @@ title); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(callback, HTTP_SUCCESS, session_url)); + FROM_HERE, base::BindOnce(callback, HTTP_SUCCESS, session_url)); return CancelCallback(); } @@ -1261,31 +1240,27 @@ if (offline_) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(callback, DRIVE_NO_CONNECTION, GURL())); + FROM_HERE, base::BindOnce(callback, DRIVE_NO_CONNECTION, GURL())); return CancelCallback(); } EntryInfo* entry = FindEntryByResourceId(resource_id); if (!entry) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(callback, HTTP_NOT_FOUND, GURL())); + FROM_HERE, base::BindOnce(callback, HTTP_NOT_FOUND, GURL())); return CancelCallback(); } if (!UserHasWriteAccess(entry->user_permission)) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(callback, HTTP_FORBIDDEN, GURL())); + FROM_HERE, base::BindOnce(callback, HTTP_FORBIDDEN, GURL())); return CancelCallback(); } FileResource* file = entry->change_resource.mutable_file(); if (!options.etag.empty() && options.etag != file->etag()) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(callback, HTTP_PRECONDITION, GURL())); + FROM_HERE, base::BindOnce(callback, HTTP_PRECONDITION, GURL())); return CancelCallback(); } // TODO(hashimoto): Update |file|'s metadata with |options|. @@ -1299,8 +1274,7 @@ "" /* title */); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(callback, HTTP_SUCCESS, session_url)); + FROM_HERE, base::BindOnce(callback, HTTP_SUCCESS, session_url)); return CancelCallback(); } @@ -1358,9 +1332,10 @@ // Note that progress is notified in the relative offset in each chunk. const int64_t chunk_size = end_position - start_position; base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(progress_callback, chunk_size / 2, chunk_size)); + FROM_HERE, + base::BindOnce(progress_callback, chunk_size / 2, chunk_size)); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(progress_callback, chunk_size, chunk_size)); + FROM_HERE, base::BindOnce(progress_callback, chunk_size, chunk_size)); } if (content_length != end_position) { @@ -1398,9 +1373,8 @@ HTTP_CREATED, std::make_unique<FileResource>(*new_entry->change_resource.file())); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(&FakeDriveService::NotifyObservers, - weak_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&FakeDriveService::NotifyObservers, + weak_ptr_factory_.GetWeakPtr())); return CancelCallback(); } @@ -1425,9 +1399,8 @@ completion_callback.Run(HTTP_SUCCESS, std::make_unique<FileResource>(*file)); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(&FakeDriveService::NotifyObservers, - weak_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&FakeDriveService::NotifyObservers, + weak_ptr_factory_.GetWeakPtr())); return CancelCallback(); } @@ -1508,8 +1481,7 @@ if (offline_) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(callback, google_apis::DRIVE_NO_CONNECTION)); + FROM_HERE, base::BindOnce(callback, google_apis::DRIVE_NO_CONNECTION)); return CancelCallback(); } @@ -1517,8 +1489,7 @@ base::ListValue* items = nullptr; if (!app_info_value_->GetList("items", &items)) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(callback, google_apis::HTTP_NOT_FOUND)); + FROM_HERE, base::BindOnce(callback, google_apis::HTTP_NOT_FOUND)); return CancelCallback(); } @@ -1528,16 +1499,16 @@ if (items->GetDictionary(i, &item) && item->GetString("id", &id) && id == app_id) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, items->Remove(i, nullptr) - ? google_apis::HTTP_NO_CONTENT - : google_apis::HTTP_NOT_FOUND)); + FROM_HERE, + base::BindOnce(callback, items->Remove(i, nullptr) + ? google_apis::HTTP_NO_CONTENT + : google_apis::HTTP_NOT_FOUND)); return CancelCallback(); } } base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(callback, google_apis::HTTP_NOT_FOUND)); + FROM_HERE, base::BindOnce(callback, google_apis::HTTP_NOT_FOUND)); return CancelCallback(); } @@ -1587,9 +1558,8 @@ std::make_unique<FileResource>( *new_entry->change_resource.file()))); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(&FakeDriveService::NotifyObservers, - weak_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&FakeDriveService::NotifyObservers, + weak_ptr_factory_.GetWeakPtr())); } CancelCallback FakeDriveService::AddNewDirectoryWithResourceId( @@ -1631,9 +1601,8 @@ std::make_unique<FileResource>( *new_entry->change_resource.file()))); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(&FakeDriveService::NotifyObservers, - weak_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&FakeDriveService::NotifyObservers, + weak_ptr_factory_.GetWeakPtr())); return CancelCallback(); }
diff --git a/components/drive/sync_client_unittest.cc b/components/drive/sync_client_unittest.cc index 050f1471..782885dc 100644 --- a/components/drive/sync_client_unittest.cc +++ b/components/drive/sync_client_unittest.cc
@@ -66,9 +66,8 @@ if (resource_id == resource_id_to_be_cancelled_) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(download_action_callback, - google_apis::DRIVE_CANCELLED, - base::FilePath())); + base::BindOnce(download_action_callback, google_apis::DRIVE_CANCELLED, + base::FilePath())); return google_apis::CancelCallback(); } if (resource_id == resource_id_to_be_paused_) { @@ -398,9 +397,9 @@ // will receive no error. base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::Bind(&test_util::FakeNetworkChangeNotifier::SetConnectionType, - base::Unretained(fake_network_change_notifier_.get()), - net::NetworkChangeNotifier::CONNECTION_NONE), + base::BindOnce(&test_util::FakeNetworkChangeNotifier::SetConnectionType, + base::Unretained(fake_network_change_notifier_.get()), + net::NetworkChangeNotifier::CONNECTION_NONE), TestTimeouts::tiny_timeout()); // Try fetch and upload.
diff --git a/components/exo/buffer.cc b/components/exo/buffer.cc index e18f661..5c71e22 100644 --- a/components/exo/buffer.cc +++ b/components/exo/buffer.cc
@@ -334,8 +334,8 @@ TRACE_EVENT_ASYNC_STEP_INTO0("exo", "BufferInUse", gpu_memory_buffer_, "pending_query"); context_provider_->ContextSupport()->SignalQuery( - query_id_, - base::Bind(&Buffer::Texture::Released, weak_ptr_factory_.GetWeakPtr())); + query_id_, base::BindOnce(&Buffer::Texture::Released, + weak_ptr_factory_.GetWeakPtr())); } void Buffer::Texture::Released() { @@ -349,8 +349,9 @@ wait_for_release_pending_ = true; base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, base::Bind(&Buffer::Texture::WaitForRelease, - weak_ptr_factory_.GetWeakPtr()), + FROM_HERE, + base::BindOnce(&Buffer::Texture::WaitForRelease, + weak_ptr_factory_.GetWeakPtr()), delay); } @@ -468,11 +469,11 @@ // compositor. layer_tree_frame_sink_holder->SetResourceReleaseCallback( resource->id, - base::Bind(&Buffer::Texture::ReleaseTexImage, - base::Unretained(contents_texture), - base::Bind(&Buffer::ReleaseContentsTexture, AsWeakPtr(), - base::Passed(&contents_texture_), - release_contents_callback_.callback()))); + base::BindOnce(&Buffer::Texture::ReleaseTexImage, + base::Unretained(contents_texture), + base::Bind(&Buffer::ReleaseContentsTexture, AsWeakPtr(), + base::Passed(&contents_texture_), + release_contents_callback_.callback()))); return true; } @@ -498,9 +499,9 @@ // compositor. layer_tree_frame_sink_holder->SetResourceReleaseCallback( resource->id, - base::Bind(&Buffer::Texture::Release, base::Unretained(texture), - base::Bind(&Buffer::ReleaseTexture, AsWeakPtr(), - base::Passed(&texture_)))); + base::BindOnce(&Buffer::Texture::Release, base::Unretained(texture), + base::Bind(&Buffer::ReleaseTexture, AsWeakPtr(), + base::Passed(&texture_)))); return true; }
diff --git a/components/exo/seat.cc b/components/exo/seat.cc index eae1f60..dc186e5 100644 --- a/components/exo/seat.cc +++ b/components/exo/seat.cc
@@ -85,7 +85,7 @@ selection_source_ = std::make_unique<ScopedDataSource>(source, this); // Unretained is safe as Seat always outlives DataSource. - source->ReadData(base::Bind(&Seat::OnDataRead, base::Unretained(this))); + source->ReadData(base::BindOnce(&Seat::OnDataRead, base::Unretained(this))); } void Seat::OnDataRead(const std::vector<uint8_t>& data) {
diff --git a/components/exo/shell_surface_unittest.cc b/components/exo/shell_surface_unittest.cc index 9f30ff9..938e911 100644 --- a/components/exo/shell_surface_unittest.cc +++ b/components/exo/shell_surface_unittest.cc
@@ -433,7 +433,7 @@ std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); shell_surface->set_surface_destroyed_callback( - base::Bind(&DestroyShellSurface, base::Unretained(&shell_surface))); + base::BindOnce(&DestroyShellSurface, base::Unretained(&shell_surface))); surface->Commit();
diff --git a/components/exo/test/run_all_unittests.cc b/components/exo/test/run_all_unittests.cc index 5fd0905..761a359 100644 --- a/components/exo/test/run_all_unittests.cc +++ b/components/exo/test/run_all_unittests.cc
@@ -19,5 +19,5 @@ return base::LaunchUnitTestsSerially( argc, argv, - base::Bind(&ash::AshTestSuite::Run, base::Unretained(&test_suite))); + base::BindOnce(&ash::AshTestSuite::Run, base::Unretained(&test_suite))); }
diff --git a/components/exo/wayland/clients/test/run_all_client_perftests.cc b/components/exo/wayland/clients/test/run_all_client_perftests.cc index 1f523c8..c944937 100644 --- a/components/exo/wayland/clients/test/run_all_client_perftests.cc +++ b/components/exo/wayland/clients/test/run_all_client_perftests.cc
@@ -38,8 +38,8 @@ base::RunLoop run_loop; client_thread.message_loop()->task_runner()->PostTask( FROM_HERE, - base::Bind(&ExoClientPerfTestSuite::RunTestsOnClientThread, - base::Unretained(this), run_loop.QuitWhenIdleClosure())); + base::BindOnce(&ExoClientPerfTestSuite::RunTestsOnClientThread, + base::Unretained(this), run_loop.QuitWhenIdleClosure())); run_loop.Run(); Shutdown(); @@ -113,6 +113,6 @@ return base::LaunchUnitTestsSerially( argc, argv, - base::Bind(&exo::ExoClientPerfTestSuite::Run, - base::Unretained(&test_suite))); + base::BindOnce(&exo::ExoClientPerfTestSuite::Run, + base::Unretained(&test_suite))); }
diff --git a/components/exo/wayland/clients/test/wayland_client_test.cc b/components/exo/wayland/clients/test/wayland_client_test.cc index 46739b1..47fcf5a 100644 --- a/components/exo/wayland/clients/test/wayland_client_test.cc +++ b/components/exo/wayland/clients/test/wayland_client_test.cc
@@ -92,8 +92,8 @@ base::WaitableEvent event(base::WaitableEvent::ResetPolicy::MANUAL, base::WaitableEvent::InitialState::NOT_SIGNALED); ui_message_loop_->task_runner()->PostTask( - FROM_HERE, base::Bind(&WaylandClientTest::SetUpOnUIThread, - base::Unretained(this), &event)); + FROM_HERE, base::BindOnce(&WaylandClientTest::SetUpOnUIThread, + base::Unretained(this), &event)); event.Wait(); } @@ -107,8 +107,8 @@ base::WaitableEvent event(base::WaitableEvent::ResetPolicy::MANUAL, base::WaitableEvent::InitialState::NOT_SIGNALED); ui_message_loop_->task_runner()->PostTask( - FROM_HERE, base::Bind(&WaylandClientTest::TearDownOnUIThread, - base::Unretained(this), &event)); + FROM_HERE, base::BindOnce(&WaylandClientTest::TearDownOnUIThread, + base::Unretained(this), &event)); event.Wait(); }
diff --git a/components/exo/wayland/server.cc b/components/exo/wayland/server.cc index 419c059..6b0ef7ac 100644 --- a/components/exo/wayland/server.cc +++ b/components/exo/wayland/server.cc
@@ -1216,7 +1216,7 @@ base::Bind(&HandleShellSurfaceConfigureCallback, base::Unretained(shell_surface_resource))); - shell_surface->set_surface_destroyed_callback(base::Bind( + shell_surface->set_surface_destroyed_callback(base::BindOnce( &wl_resource_destroy, base::Unretained(shell_surface_resource))); SetImplementation(shell_surface_resource, &shell_surface_implementation, @@ -2618,8 +2618,9 @@ void ScheduleSendDisplayMetrics(int delay_ms) { needs_send_display_metrics_ = true; base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, base::Bind(&WaylandRemoteShell::SendDisplayMetrics, - weak_ptr_factory_.GetWeakPtr()), + FROM_HERE, + base::BindOnce(&WaylandRemoteShell::SendDisplayMetrics, + weak_ptr_factory_.GetWeakPtr()), base::TimeDelta::FromMilliseconds(delay_ms)); }
diff --git a/components/exo/wayland/server_unittest.cc b/components/exo/wayland/server_unittest.cc index 13d4486..dfac846 100644 --- a/components/exo/wayland/server_unittest.cc +++ b/components/exo/wayland/server_unittest.cc
@@ -94,9 +94,9 @@ bool connected_to_server = false; base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC, base::WaitableEvent::InitialState::NOT_SIGNALED); - client.task_runner()->PostTask( - FROM_HERE, - base::Bind(&ConnectToServer, socket_name, &connected_to_server, &event)); + client.task_runner()->PostTask(FROM_HERE, + base::BindOnce(&ConnectToServer, socket_name, + &connected_to_server, &event)); // Call Dispatch() with a 5 second timeout. server->Dispatch(base::TimeDelta::FromSeconds(5));
diff --git a/components/favicon/core/large_icon_service.cc b/components/favicon/core/large_icon_service.cc index 7990fdba..0cad5b0 100644 --- a/components/favicon/core/large_icon_service.cc +++ b/components/favicon/core/large_icon_service.cc
@@ -350,13 +350,13 @@ LogSuspiciousURLMismatches(page_url, db_result); tracker_->PostTaskAndReply( background_task_runner_.get(), FROM_HERE, - base::Bind(&ProcessIconOnBackgroundThread, db_result, - min_source_size_in_pixel_, desired_size_in_pixel_, - raw_bitmap_callback_ ? &raw_bitmap_result_ : nullptr, - image_callback_ ? &bitmap_result_ : nullptr, - image_callback_ ? &icon_url_ : nullptr, - fallback_icon_style_.get()), - base::Bind(&LargeIconWorker::OnIconProcessingComplete, this)); + base::BindOnce(&ProcessIconOnBackgroundThread, db_result, + min_source_size_in_pixel_, desired_size_in_pixel_, + raw_bitmap_callback_ ? &raw_bitmap_result_ : nullptr, + image_callback_ ? &bitmap_result_ : nullptr, + image_callback_ ? &icon_url_ : nullptr, + fallback_icon_style_.get()), + base::BindOnce(&LargeIconWorker::OnIconProcessingComplete, this)); } void LargeIconWorker::OnIconProcessingComplete() {
diff --git a/components/favicon/core/test/mock_favicon_service.h b/components/favicon/core/test/mock_favicon_service.h index b76b01eb..d7146cb0 100644 --- a/components/favicon/core/test/mock_favicon_service.h +++ b/components/favicon/core/test/mock_favicon_service.h
@@ -23,7 +23,7 @@ auto callback = ::testing::get<K - 2>(args); base::CancelableTaskTracker* tracker = ::testing::get<K - 1>(args); return tracker->PostTask(base::ThreadTaskRunnerHandle::Get().get(), FROM_HERE, - base::Bind(callback, p0)); + base::BindOnce(callback, p0)); } class MockFaviconService : public FaviconService {
diff --git a/components/feature_engagement/internal/persistent_event_store.cc b/components/feature_engagement/internal/persistent_event_store.cc index 2d11b2cb..a744ced1 100644 --- a/components/feature_engagement/internal/persistent_event_store.cc +++ b/components/feature_engagement/internal/persistent_event_store.cc
@@ -39,8 +39,8 @@ db_->Init(kDatabaseUMAName, storage_dir_, leveldb_proto::CreateSimpleOptions(), - base::Bind(&PersistentEventStore::OnInitComplete, - weak_ptr_factory_.GetWeakPtr(), callback)); + base::BindOnce(&PersistentEventStore::OnInitComplete, + weak_ptr_factory_.GetWeakPtr(), callback)); } bool PersistentEventStore::IsReady() const { @@ -54,7 +54,7 @@ db_->UpdateEntries(std::move(entries), std::make_unique<std::vector<std::string>>(), - base::Bind(&NoopUpdateCallback)); + base::BindOnce(&NoopUpdateCallback)); } void PersistentEventStore::DeleteEvent(const std::string& event_name) { @@ -63,7 +63,7 @@ deletes->push_back(event_name); db_->UpdateEntries(std::make_unique<KeyEventList>(), std::move(deletes), - base::Bind(&NoopUpdateCallback)); + base::BindOnce(&NoopUpdateCallback)); } void PersistentEventStore::OnInitComplete(const OnLoadedCallback& callback, @@ -75,8 +75,8 @@ return; } - db_->LoadEntries(base::Bind(&PersistentEventStore::OnLoadComplete, - weak_ptr_factory_.GetWeakPtr(), callback)); + db_->LoadEntries(base::BindOnce(&PersistentEventStore::OnLoadComplete, + weak_ptr_factory_.GetWeakPtr(), callback)); } void PersistentEventStore::OnLoadComplete(
diff --git a/components/feature_engagement/internal/tracker_impl.cc b/components/feature_engagement/internal/tracker_impl.cc index 457030ed3..0e4f568 100644 --- a/components/feature_engagement/internal/tracker_impl.cc +++ b/components/feature_engagement/internal/tracker_impl.cc
@@ -160,8 +160,8 @@ time_provider_->GetCurrentDay()); availability_model_->Initialize( - base::Bind(&TrackerImpl::OnAvailabilityModelInitializationFinished, - weak_ptr_factory_.GetWeakPtr()), + base::BindOnce(&TrackerImpl::OnAvailabilityModelInitializationFinished, + weak_ptr_factory_.GetWeakPtr()), time_provider_->GetCurrentDay()); }
diff --git a/components/feedback/system_logs/system_logs_fetcher.cc b/components/feedback/system_logs/system_logs_fetcher.cc index dbeb475..db8474c 100644 --- a/components/feedback/system_logs/system_logs_fetcher.cc +++ b/components/feedback/system_logs/system_logs_fetcher.cc
@@ -79,9 +79,9 @@ callback_ = std::move(callback); for (size_t i = 0; i < data_sources_.size(); ++i) { VLOG(1) << "Fetching SystemLogSource: " << data_sources_[i]->source_name(); - data_sources_[i]->Fetch(base::Bind(&SystemLogsFetcher::OnFetched, - weak_ptr_factory_.GetWeakPtr(), - data_sources_[i]->source_name())); + data_sources_[i]->Fetch(base::BindOnce(&SystemLogsFetcher::OnFetched, + weak_ptr_factory_.GetWeakPtr(), + data_sources_[i]->source_name())); } }
diff --git a/components/feedback/tracing_manager.cc b/components/feedback/tracing_manager.cc index 0342f00..d5c3fc70 100644 --- a/components/feedback/tracing_manager.cc +++ b/components/feedback/tracing_manager.cc
@@ -69,7 +69,7 @@ // Always return the data asychronously, so the behavior is consistant. base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, data->second)); + FROM_HERE, base::BindOnce(callback, data->second)); return true; } } @@ -120,8 +120,8 @@ // Tracing has to be restarted asynchronous, so the TracingController can // clean up. base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&TracingManager::StartTracing, - weak_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&TracingManager::StartTracing, + weak_ptr_factory_.GetWeakPtr())); } // static
diff --git a/components/gcm_driver/crypto/gcm_encryption_provider_unittest.cc b/components/gcm_driver/crypto/gcm_encryption_provider_unittest.cc index 0811d18..f196052f 100644 --- a/components/gcm_driver/crypto/gcm_encryption_provider_unittest.cc +++ b/components/gcm_driver/crypto/gcm_encryption_provider_unittest.cc
@@ -287,8 +287,8 @@ std::string public_key, auth_secret; encryption_provider()->GetEncryptionInfo( kExampleAppId, "" /* empty authorized entity for non-InstanceID */, - base::Bind(&GCMEncryptionProviderTest::DidGetEncryptionInfo, - base::Unretained(this), &public_key, &auth_secret)); + base::BindOnce(&GCMEncryptionProviderTest::DidGetEncryptionInfo, + base::Unretained(this), &public_key, &auth_secret)); // Getting (or creating) the public key will be done asynchronously. base::RunLoop().RunUntilIdle(); @@ -313,8 +313,8 @@ std::string public_key, auth_secret; encryption_provider()->GetEncryptionInfo( kExampleAppId, authorized_entity_gcm, - base::Bind(&GCMEncryptionProviderTest::DidGetEncryptionInfo, - base::Unretained(this), &public_key, &auth_secret)); + base::BindOnce(&GCMEncryptionProviderTest::DidGetEncryptionInfo, + base::Unretained(this), &public_key, &auth_secret)); base::RunLoop().RunUntilIdle(); @@ -322,8 +322,9 @@ std::string read_public_key, read_auth_secret; encryption_provider()->GetEncryptionInfo( kExampleAppId, authorized_entity_gcm, - base::Bind(&GCMEncryptionProviderTest::DidGetEncryptionInfo, - base::Unretained(this), &read_public_key, &read_auth_secret)); + base::BindOnce(&GCMEncryptionProviderTest::DidGetEncryptionInfo, + base::Unretained(this), &read_public_key, + &read_auth_secret)); base::RunLoop().RunUntilIdle(); @@ -368,8 +369,8 @@ std::string public_key_1, auth_secret_1; encryption_provider()->GetEncryptionInfo( kExampleAppId, authorized_entity_1, - base::Bind(&GCMEncryptionProviderTest::DidGetEncryptionInfo, - base::Unretained(this), &public_key_1, &auth_secret_1)); + base::BindOnce(&GCMEncryptionProviderTest::DidGetEncryptionInfo, + base::Unretained(this), &public_key_1, &auth_secret_1)); base::RunLoop().RunUntilIdle(); @@ -382,8 +383,8 @@ std::string public_key_2, auth_secret_2; encryption_provider()->GetEncryptionInfo( kExampleAppId, authorized_entity_2, - base::Bind(&GCMEncryptionProviderTest::DidGetEncryptionInfo, - base::Unretained(this), &public_key_2, &auth_secret_2)); + base::BindOnce(&GCMEncryptionProviderTest::DidGetEncryptionInfo, + base::Unretained(this), &public_key_2, &auth_secret_2)); base::RunLoop().RunUntilIdle(); @@ -398,9 +399,9 @@ std::string read_public_key_1, read_auth_secret_1; encryption_provider()->GetEncryptionInfo( kExampleAppId, authorized_entity_1, - base::Bind(&GCMEncryptionProviderTest::DidGetEncryptionInfo, - base::Unretained(this), &read_public_key_1, - &read_auth_secret_1)); + base::BindOnce(&GCMEncryptionProviderTest::DidGetEncryptionInfo, + base::Unretained(this), &read_public_key_1, + &read_auth_secret_1)); base::RunLoop().RunUntilIdle(); @@ -427,9 +428,9 @@ std::string public_key_1_refreshed, auth_secret_1_refreshed; encryption_provider()->GetEncryptionInfo( kExampleAppId, authorized_entity_1, - base::Bind(&GCMEncryptionProviderTest::DidGetEncryptionInfo, - base::Unretained(this), &public_key_1_refreshed, - &auth_secret_1_refreshed)); + base::BindOnce(&GCMEncryptionProviderTest::DidGetEncryptionInfo, + base::Unretained(this), &public_key_1_refreshed, + &auth_secret_1_refreshed)); base::RunLoop().RunUntilIdle();
diff --git a/components/gcm_driver/fake_gcm_client.cc b/components/gcm_driver/fake_gcm_client.cc index adbb8f9..87e2bf9e 100644 --- a/components/gcm_driver/fake_gcm_client.cc +++ b/components/gcm_driver/fake_gcm_client.cc
@@ -105,7 +105,7 @@ started_ = true; base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(&FakeGCMClient::Started, weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&FakeGCMClient::Started, weak_ptr_factory_.GetWeakPtr())); } void FakeGCMClient::Stop() { @@ -136,9 +136,9 @@ } base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&FakeGCMClient::RegisterFinished, - weak_ptr_factory_.GetWeakPtr(), registration_info, - registration_id)); + FROM_HERE, base::BindOnce(&FakeGCMClient::RegisterFinished, + weak_ptr_factory_.GetWeakPtr(), + registration_info, registration_id)); } bool FakeGCMClient::ValidateRegistration( @@ -152,8 +152,9 @@ DCHECK(io_thread_->RunsTasksInCurrentSequence()); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&FakeGCMClient::UnregisterFinished, - weak_ptr_factory_.GetWeakPtr(), registration_info)); + FROM_HERE, + base::BindOnce(&FakeGCMClient::UnregisterFinished, + weak_ptr_factory_.GetWeakPtr(), registration_info)); } void FakeGCMClient::Send(const std::string& app_id, @@ -162,8 +163,9 @@ DCHECK(io_thread_->RunsTasksInCurrentSequence()); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&FakeGCMClient::SendFinished, - weak_ptr_factory_.GetWeakPtr(), app_id, message)); + FROM_HERE, + base::BindOnce(&FakeGCMClient::SendFinished, + weak_ptr_factory_.GetWeakPtr(), app_id, message)); } void FakeGCMClient::RecordDecryptionFailure(const std::string& app_id, @@ -240,7 +242,7 @@ io_thread_->PostTask( FROM_HERE, - base::Bind(&FakeGCMClient::DoStart, weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&FakeGCMClient::DoStart, weak_ptr_factory_.GetWeakPtr())); } void FakeGCMClient::ReceiveMessage(const std::string& app_id, @@ -249,20 +251,16 @@ io_thread_->PostTask( FROM_HERE, - base::Bind(&FakeGCMClient::MessageReceived, - weak_ptr_factory_.GetWeakPtr(), - app_id, - message)); + base::BindOnce(&FakeGCMClient::MessageReceived, + weak_ptr_factory_.GetWeakPtr(), app_id, message)); } void FakeGCMClient::DeleteMessages(const std::string& app_id) { DCHECK(ui_thread_->RunsTasksInCurrentSequence()); - io_thread_->PostTask( - FROM_HERE, - base::Bind(&FakeGCMClient::MessagesDeleted, - weak_ptr_factory_.GetWeakPtr(), - app_id)); + io_thread_->PostTask(FROM_HERE, + base::BindOnce(&FakeGCMClient::MessagesDeleted, + weak_ptr_factory_.GetWeakPtr(), app_id)); } void FakeGCMClient::Started() { @@ -296,14 +294,15 @@ send_error_details.additional_data = message.data; base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::Bind(&FakeGCMClient::MessageSendError, - weak_ptr_factory_.GetWeakPtr(), app_id, send_error_details), + base::BindOnce(&FakeGCMClient::MessageSendError, + weak_ptr_factory_.GetWeakPtr(), app_id, + send_error_details), base::TimeDelta::FromMilliseconds(200)); } else if(message.id.find("ack") != std::string::npos) { base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::Bind(&FakeGCMClient::SendAcknowledgement, - weak_ptr_factory_.GetWeakPtr(), app_id, message.id), + base::BindOnce(&FakeGCMClient::SendAcknowledgement, + weak_ptr_factory_.GetWeakPtr(), app_id, message.id), base::TimeDelta::FromMilliseconds(200)); } }
diff --git a/components/gcm_driver/fake_gcm_driver.cc b/components/gcm_driver/fake_gcm_driver.cc index edd26fd..fb75bedd 100644 --- a/components/gcm_driver/fake_gcm_driver.cc +++ b/components/gcm_driver/fake_gcm_driver.cc
@@ -28,7 +28,7 @@ const std::string& registration_id, const ValidateRegistrationCallback& callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, true /* is_valid */)); + FROM_HERE, base::BindOnce(callback, true /* is_valid */)); } void FakeGCMDriver::OnSignedIn() {
diff --git a/components/gcm_driver/gcm_account_tracker.cc b/components/gcm_driver/gcm_account_tracker.cc index 814eb20d8..bf13a09 100644 --- a/components/gcm_driver/gcm_account_tracker.cc +++ b/components/gcm_driver/gcm_account_tracker.cc
@@ -98,8 +98,9 @@ reporting_weak_ptr_factory_.InvalidateWeakPtrs(); base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, base::Bind(&GCMAccountTracker::ReportTokens, - reporting_weak_ptr_factory_.GetWeakPtr()), + FROM_HERE, + base::BindOnce(&GCMAccountTracker::ReportTokens, + reporting_weak_ptr_factory_.GetWeakPtr()), GetTimeToNextTokenReporting()); }
diff --git a/components/gcm_driver/gcm_channel_status_request.cc b/components/gcm_driver/gcm_channel_status_request.cc index 7e53c74..15d16e0 100644 --- a/components/gcm_driver/gcm_channel_status_request.cc +++ b/components/gcm_driver/gcm_channel_status_request.cc
@@ -200,8 +200,9 @@ << backoff_entry_.GetTimeUntilRelease().InMilliseconds() << " ms."; base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, base::Bind(&GCMChannelStatusRequest::RetryWithBackoff, - weak_ptr_factory_.GetWeakPtr(), false), + FROM_HERE, + base::BindOnce(&GCMChannelStatusRequest::RetryWithBackoff, + weak_ptr_factory_.GetWeakPtr(), false), backoff_entry_.GetTimeUntilRelease()); return; }
diff --git a/components/gcm_driver/gcm_channel_status_syncer.cc b/components/gcm_driver/gcm_channel_status_syncer.cc index 93a34c2..31ed9a1 100644 --- a/components/gcm_driver/gcm_channel_status_syncer.cc +++ b/components/gcm_driver/gcm_channel_status_syncer.cc
@@ -187,8 +187,9 @@ void GCMChannelStatusSyncer::ScheduleRequest() { current_request_delay_interval_ = GetRequestDelayInterval(); base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, base::Bind(&GCMChannelStatusSyncer::StartRequest, - weak_ptr_factory_.GetWeakPtr()), + FROM_HERE, + base::BindOnce(&GCMChannelStatusSyncer::StartRequest, + weak_ptr_factory_.GetWeakPtr()), current_request_delay_interval_); if (custom_poll_interval_use_count_)
diff --git a/components/gcm_driver/gcm_client_impl.cc b/components/gcm_driver/gcm_client_impl.cc index 45c5cb4..c30c7dcb 100644 --- a/components/gcm_driver/gcm_client_impl.cc +++ b/components/gcm_driver/gcm_client_impl.cc
@@ -459,8 +459,9 @@ // to have the store wiped out. if (device_checkin_info_.android_id) { base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, base::Bind(&GCMClientImpl::DestroyStoreWhenNotNeeded, - destroying_gcm_store_ptr_factory_.GetWeakPtr()), + FROM_HERE, + base::BindOnce(&GCMClientImpl::DestroyStoreWhenNotNeeded, + destroying_gcm_store_ptr_factory_.GetWeakPtr()), base::TimeDelta::FromMilliseconds(kDestroyGCMStoreDelayMS)); } @@ -772,8 +773,9 @@ time_to_next_checkin = base::TimeDelta(); base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, base::Bind(&GCMClientImpl::StartCheckin, - periodic_checkin_ptr_factory_.GetWeakPtr()), + FROM_HERE, + base::BindOnce(&GCMClientImpl::StartCheckin, + periodic_checkin_ptr_factory_.GetWeakPtr()), time_to_next_checkin); }
diff --git a/components/gcm_driver/gcm_driver_desktop.cc b/components/gcm_driver/gcm_driver_desktop.cc index c8f6908a..864e3cd 100644 --- a/components/gcm_driver/gcm_driver_desktop.cc +++ b/components/gcm_driver/gcm_driver_desktop.cc
@@ -171,25 +171,19 @@ if (gcm_registration_info) { ui_thread_->PostTask( FROM_HERE, - base::Bind(&GCMDriverDesktop::RegisterFinished, - service_, - gcm_registration_info->app_id, - registration_id, - result)); + base::BindOnce(&GCMDriverDesktop::RegisterFinished, service_, + gcm_registration_info->app_id, registration_id, result)); } const InstanceIDTokenInfo* instance_id_token_info = InstanceIDTokenInfo::FromRegistrationInfo(registration_info.get()); if (instance_id_token_info) { ui_thread_->PostTask( - FROM_HERE, - base::Bind(&GCMDriverDesktop::GetTokenFinished, - service_, - instance_id_token_info->app_id, - instance_id_token_info->authorized_entity, - instance_id_token_info->scope, - registration_id, - result)); + FROM_HERE, + base::BindOnce(&GCMDriverDesktop::GetTokenFinished, service_, + instance_id_token_info->app_id, + instance_id_token_info->authorized_entity, + instance_id_token_info->scope, registration_id, result)); } } @@ -203,23 +197,18 @@ if (gcm_registration_info) { ui_thread_->PostTask( FROM_HERE, - base::Bind(&GCMDriverDesktop::RemoveEncryptionInfoAfterUnregister, - service_, - gcm_registration_info->app_id, - result)); + base::BindOnce(&GCMDriverDesktop::RemoveEncryptionInfoAfterUnregister, + service_, gcm_registration_info->app_id, result)); } const InstanceIDTokenInfo* instance_id_token_info = InstanceIDTokenInfo::FromRegistrationInfo(registration_info.get()); if (instance_id_token_info) { ui_thread_->PostTask( - FROM_HERE, - base::Bind(&GCMDriverDesktop::DeleteTokenFinished, - service_, - instance_id_token_info->app_id, - instance_id_token_info->authorized_entity, - instance_id_token_info->scope, - result)); + FROM_HERE, base::BindOnce(&GCMDriverDesktop::DeleteTokenFinished, + service_, instance_id_token_info->app_id, + instance_id_token_info->authorized_entity, + instance_id_token_info->scope, result)); } } @@ -228,10 +217,9 @@ GCMClient::Result result) { DCHECK(io_thread_->RunsTasksInCurrentSequence()); - ui_thread_->PostTask( - FROM_HERE, - base::Bind(&GCMDriverDesktop::SendFinished, service_, app_id, message_id, - result)); + ui_thread_->PostTask(FROM_HERE, + base::BindOnce(&GCMDriverDesktop::SendFinished, service_, + app_id, message_id, result)); } void GCMDriverDesktop::IOWorker::OnMessageReceived( @@ -240,11 +228,8 @@ DCHECK(io_thread_->RunsTasksInCurrentSequence()); ui_thread_->PostTask( - FROM_HERE, - base::Bind(&GCMDriverDesktop::MessageReceived, - service_, - app_id, - message)); + FROM_HERE, base::BindOnce(&GCMDriverDesktop::MessageReceived, service_, + app_id, message)); } void GCMDriverDesktop::IOWorker::OnMessagesDeleted(const std::string& app_id) { @@ -252,7 +237,7 @@ ui_thread_->PostTask( FROM_HERE, - base::Bind(&GCMDriverDesktop::MessagesDeleted, service_, app_id)); + base::BindOnce(&GCMDriverDesktop::MessagesDeleted, service_, app_id)); } void GCMDriverDesktop::IOWorker::OnMessageSendError( @@ -261,9 +246,8 @@ DCHECK(io_thread_->RunsTasksInCurrentSequence()); ui_thread_->PostTask( - FROM_HERE, - base::Bind(&GCMDriverDesktop::MessageSendError, service_, app_id, - send_error_details)); + FROM_HERE, base::BindOnce(&GCMDriverDesktop::MessageSendError, service_, + app_id, send_error_details)); } void GCMDriverDesktop::IOWorker::OnSendAcknowledged( @@ -272,19 +256,16 @@ DCHECK(io_thread_->RunsTasksInCurrentSequence()); ui_thread_->PostTask( - FROM_HERE, - base::Bind( - &GCMDriverDesktop::SendAcknowledged, service_, app_id, message_id)); + FROM_HERE, base::BindOnce(&GCMDriverDesktop::SendAcknowledged, service_, + app_id, message_id)); } void GCMDriverDesktop::IOWorker::OnGCMReady( const std::vector<AccountMapping>& account_mappings, const base::Time& last_token_fetch_time) { - ui_thread_->PostTask(FROM_HERE, - base::Bind(&GCMDriverDesktop::GCMClientReady, - service_, - account_mappings, - last_token_fetch_time)); + ui_thread_->PostTask( + FROM_HERE, base::BindOnce(&GCMDriverDesktop::GCMClientReady, service_, + account_mappings, last_token_fetch_time)); } void GCMDriverDesktop::IOWorker::OnActivityRecorded() { @@ -296,20 +277,18 @@ void GCMDriverDesktop::IOWorker::OnConnected( const net::IPEndPoint& ip_endpoint) { - ui_thread_->PostTask(FROM_HERE, - base::Bind(&GCMDriverDesktop::OnConnected, - service_, - ip_endpoint)); + ui_thread_->PostTask(FROM_HERE, base::BindOnce(&GCMDriverDesktop::OnConnected, + service_, ip_endpoint)); } void GCMDriverDesktop::IOWorker::OnDisconnected() { - ui_thread_->PostTask(FROM_HERE, - base::Bind(&GCMDriverDesktop::OnDisconnected, service_)); + ui_thread_->PostTask( + FROM_HERE, base::BindOnce(&GCMDriverDesktop::OnDisconnected, service_)); } void GCMDriverDesktop::IOWorker::OnStoreReset() { - ui_thread_->PostTask(FROM_HERE, - base::Bind(&GCMDriverDesktop::OnStoreReset, service_)); + ui_thread_->PostTask( + FROM_HERE, base::BindOnce(&GCMDriverDesktop::OnStoreReset, service_)); } void GCMDriverDesktop::IOWorker::Start( @@ -376,8 +355,8 @@ } ui_thread_->PostTask( - FROM_HERE, - base::Bind(&GCMDriverDesktop::GetGCMStatisticsFinished, service_, stats)); + FROM_HERE, base::BindOnce(&GCMDriverDesktop::GetGCMStatisticsFinished, + service_, stats)); } void GCMDriverDesktop::IOWorker::SetGCMRecording(bool recording) { @@ -391,8 +370,8 @@ } ui_thread_->PostTask( - FROM_HERE, - base::Bind(&GCMDriverDesktop::GetGCMStatisticsFinished, service_, stats)); + FROM_HERE, base::BindOnce(&GCMDriverDesktop::GetGCMStatisticsFinished, + service_, stats)); } void GCMDriverDesktop::IOWorker::SetAccountTokens( @@ -454,9 +433,8 @@ gcm_client_->GetInstanceIDData(app_id, &instance_id, &extra_data); ui_thread_->PostTask( - FROM_HERE, - base::Bind(&GCMDriverDesktop::GetInstanceIDDataFinished, - service_, app_id, instance_id, extra_data)); + FROM_HERE, base::BindOnce(&GCMDriverDesktop::GetInstanceIDDataFinished, + service_, app_id, instance_id, extra_data)); } void GCMDriverDesktop::IOWorker::GetToken( @@ -704,10 +682,9 @@ RemoveCachedData(); - io_thread_->PostTask( - FROM_HERE, - base::Bind(&GCMDriverDesktop::IOWorker::Stop, - base::Unretained(io_worker_.get()))); + io_thread_->PostTask(FROM_HERE, + base::BindOnce(&GCMDriverDesktop::IOWorker::Stop, + base::Unretained(io_worker_.get()))); } void GCMDriverDesktop::RegisterImpl( @@ -735,10 +712,8 @@ io_thread_->PostTask( FROM_HERE, - base::Bind(&GCMDriverDesktop::IOWorker::Register, - base::Unretained(io_worker_.get()), - app_id, - sender_ids)); + base::BindOnce(&GCMDriverDesktop::IOWorker::Register, + base::Unretained(io_worker_.get()), app_id, sender_ids)); } void GCMDriverDesktop::UnregisterImpl(const std::string& app_id) { @@ -761,10 +736,8 @@ // unregister request fails. If this occurs, it does not bring any harm since // we simply reject the messages/events received from the server. io_thread_->PostTask( - FROM_HERE, - base::Bind(&GCMDriverDesktop::IOWorker::Unregister, - base::Unretained(io_worker_.get()), - app_id)); + FROM_HERE, base::BindOnce(&GCMDriverDesktop::IOWorker::Unregister, + base::Unretained(io_worker_.get()), app_id)); } void GCMDriverDesktop::SendImpl(const std::string& app_id, @@ -788,12 +761,9 @@ const OutgoingMessage& message) { DCHECK(ui_thread_->RunsTasksInCurrentSequence()); io_thread_->PostTask( - FROM_HERE, - base::Bind(&GCMDriverDesktop::IOWorker::Send, - base::Unretained(io_worker_.get()), - app_id, - receiver_id, - message)); + FROM_HERE, base::BindOnce(&GCMDriverDesktop::IOWorker::Send, + base::Unretained(io_worker_.get()), app_id, + receiver_id, message)); } void GCMDriverDesktop::RecordDecryptionFailure(const std::string& app_id, @@ -801,9 +771,8 @@ DCHECK(ui_thread_->RunsTasksInCurrentSequence()); io_thread_->PostTask( FROM_HERE, - base::Bind(&GCMDriverDesktop::IOWorker::RecordDecryptionFailure, - base::Unretained(io_worker_.get()), - app_id, result)); + base::BindOnce(&GCMDriverDesktop::IOWorker::RecordDecryptionFailure, + base::Unretained(io_worker_.get()), app_id, result)); } GCMClient* GCMDriverDesktop::GetGCMClientForTesting() const { @@ -829,9 +798,8 @@ request_gcm_statistics_callback_ = callback; io_thread_->PostTask( FROM_HERE, - base::Bind(&GCMDriverDesktop::IOWorker::GetGCMStatistics, - base::Unretained(io_worker_.get()), - clear_logs)); + base::BindOnce(&GCMDriverDesktop::IOWorker::GetGCMStatistics, + base::Unretained(io_worker_.get()), clear_logs)); } void GCMDriverDesktop::SetGCMRecording(const GetGCMStatisticsCallback& callback, @@ -840,10 +808,8 @@ request_gcm_statistics_callback_ = callback; io_thread_->PostTask( - FROM_HERE, - base::Bind(&GCMDriverDesktop::IOWorker::SetGCMRecording, - base::Unretained(io_worker_.get()), - recording)); + FROM_HERE, base::BindOnce(&GCMDriverDesktop::IOWorker::SetGCMRecording, + base::Unretained(io_worker_.get()), recording)); } void GCMDriverDesktop::UpdateAccountMapping( @@ -852,9 +818,8 @@ io_thread_->PostTask( FROM_HERE, - base::Bind(&GCMDriverDesktop::IOWorker::UpdateAccountMapping, - base::Unretained(io_worker_.get()), - account_mapping)); + base::BindOnce(&GCMDriverDesktop::IOWorker::UpdateAccountMapping, + base::Unretained(io_worker_.get()), account_mapping)); } void GCMDriverDesktop::RemoveAccountMapping(const std::string& account_id) { @@ -862,9 +827,8 @@ io_thread_->PostTask( FROM_HERE, - base::Bind(&GCMDriverDesktop::IOWorker::RemoveAccountMapping, - base::Unretained(io_worker_.get()), - account_id)); + base::BindOnce(&GCMDriverDesktop::IOWorker::RemoveAccountMapping, + base::Unretained(io_worker_.get()), account_id)); } base::Time GCMDriverDesktop::GetLastTokenFetchTime() { @@ -878,9 +842,8 @@ io_thread_->PostTask( FROM_HERE, - base::Bind(&GCMDriverDesktop::IOWorker::SetLastTokenFetchTime, - base::Unretained(io_worker_.get()), - time)); + base::BindOnce(&GCMDriverDesktop::IOWorker::SetLastTokenFetchTime, + base::Unretained(io_worker_.get()), time)); } InstanceIDHandler* GCMDriverDesktop::GetInstanceIDHandlerInternal() { @@ -944,13 +907,9 @@ } io_thread_->PostTask( - FROM_HERE, - base::Bind(&GCMDriverDesktop::IOWorker::GetToken, - base::Unretained(io_worker_.get()), - app_id, - authorized_entity, - scope, - options)); + FROM_HERE, base::BindOnce(&GCMDriverDesktop::IOWorker::GetToken, + base::Unretained(io_worker_.get()), app_id, + authorized_entity, scope, options)); } void GCMDriverDesktop::ValidateToken(const std::string& app_id, @@ -1036,12 +995,9 @@ DCHECK(ui_thread_->RunsTasksInCurrentSequence()); io_thread_->PostTask( - FROM_HERE, - base::Bind(&GCMDriverDesktop::IOWorker::DeleteToken, - base::Unretained(io_worker_.get()), - app_id, - authorized_entity, - scope)); + FROM_HERE, base::BindOnce(&GCMDriverDesktop::IOWorker::DeleteToken, + base::Unretained(io_worker_.get()), app_id, + authorized_entity, scope)); } void GCMDriverDesktop::AddInstanceIDData( @@ -1073,12 +1029,9 @@ const std::string& instance_id, const std::string& extra_data) { io_thread_->PostTask( - FROM_HERE, - base::Bind(&GCMDriverDesktop::IOWorker::AddInstanceIDData, - base::Unretained(io_worker_.get()), - app_id, - instance_id, - extra_data)); + FROM_HERE, base::BindOnce(&GCMDriverDesktop::IOWorker::AddInstanceIDData, + base::Unretained(io_worker_.get()), app_id, + instance_id, extra_data)); } void GCMDriverDesktop::RemoveInstanceIDData(const std::string& app_id) { @@ -1103,9 +1056,8 @@ void GCMDriverDesktop::DoRemoveInstanceIDData(const std::string& app_id) { io_thread_->PostTask( FROM_HERE, - base::Bind(&GCMDriverDesktop::IOWorker::RemoveInstanceIDData, - base::Unretained(io_worker_.get()), - app_id)); + base::BindOnce(&GCMDriverDesktop::IOWorker::RemoveInstanceIDData, + base::Unretained(io_worker_.get()), app_id)); } void GCMDriverDesktop::GetInstanceIDData( @@ -1117,7 +1069,7 @@ GCMClient::Result result = EnsureStarted(GCMClient::IMMEDIATE_START); if (result != GCMClient::SUCCESS) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, std::string(), std::string())); + FROM_HERE, base::BindOnce(callback, std::string(), std::string())); return; } @@ -1137,10 +1089,8 @@ void GCMDriverDesktop::DoGetInstanceIDData(const std::string& app_id) { io_thread_->PostTask( - FROM_HERE, - base::Bind(&GCMDriverDesktop::IOWorker::GetInstanceIDData, - base::Unretained(io_worker_.get()), - app_id)); + FROM_HERE, base::BindOnce(&GCMDriverDesktop::IOWorker::GetInstanceIDData, + base::Unretained(io_worker_.get()), app_id)); } void GCMDriverDesktop::GetInstanceIDDataFinished( @@ -1207,9 +1157,9 @@ // IOWorker. io_thread_->PostTask( FROM_HERE, - base::Bind(&GCMDriverDesktop::IOWorker::WakeFromSuspendForHeartbeat, - base::Unretained(io_worker_.get()), - wake_from_suspend_enabled_)); + base::BindOnce(&GCMDriverDesktop::IOWorker::WakeFromSuspendForHeartbeat, + base::Unretained(io_worker_.get()), + wake_from_suspend_enabled_)); } void GCMDriverDesktop::AddHeartbeatInterval(const std::string& scope, @@ -1230,8 +1180,8 @@ io_thread_->PostTask( FROM_HERE, - base::Bind(&GCMDriverDesktop::IOWorker::AddHeartbeatInterval, - base::Unretained(io_worker_.get()), scope, interval_ms)); + base::BindOnce(&GCMDriverDesktop::IOWorker::AddHeartbeatInterval, + base::Unretained(io_worker_.get()), scope, interval_ms)); } void GCMDriverDesktop::RemoveHeartbeatInterval(const std::string& scope) { @@ -1251,8 +1201,8 @@ io_thread_->PostTask( FROM_HERE, - base::Bind(&GCMDriverDesktop::IOWorker::RemoveHeartbeatInterval, - base::Unretained(io_worker_.get()), scope)); + base::BindOnce(&GCMDriverDesktop::IOWorker::RemoveHeartbeatInterval, + base::Unretained(io_worker_.get()), scope)); } void GCMDriverDesktop::SetAccountTokens( @@ -1263,9 +1213,8 @@ io_thread_->PostTask( FROM_HERE, - base::Bind(&GCMDriverDesktop::IOWorker::SetAccountTokens, - base::Unretained(io_worker_.get()), - account_tokens)); + base::BindOnce(&GCMDriverDesktop::IOWorker::SetAccountTokens, + base::Unretained(io_worker_.get()), account_tokens)); } GCMClient::Result GCMDriverDesktop::EnsureStarted( @@ -1292,11 +1241,9 @@ // Note that we need to pass weak pointer again since the existing weak // pointer in IOWorker might have been invalidated when GCM is stopped. io_thread_->PostTask( - FROM_HERE, - base::Bind(&GCMDriverDesktop::IOWorker::Start, - base::Unretained(io_worker_.get()), - start_mode, - weak_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&GCMDriverDesktop::IOWorker::Start, + base::Unretained(io_worker_.get()), start_mode, + weak_ptr_factory_.GetWeakPtr())); return GCMClient::SUCCESS; }
diff --git a/components/gcm_driver/gcm_driver_desktop_unittest.cc b/components/gcm_driver/gcm_driver_desktop_unittest.cc index 3b90067..c31e7437 100644 --- a/components/gcm_driver/gcm_driver_desktop_unittest.cc +++ b/components/gcm_driver/gcm_driver_desktop_unittest.cc
@@ -216,7 +216,7 @@ void GCMDriverTest::PumpIOLoop() { base::RunLoop run_loop; io_thread_.task_runner()->PostTaskAndReply( - FROM_HERE, base::Bind(&PumpCurrentLoop), run_loop.QuitClosure()); + FROM_HERE, base::BindOnce(&PumpCurrentLoop), run_loop.QuitClosure()); run_loop.Run(); }
diff --git a/components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.cc b/components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.cc index ae3359d1..1d79cf5 100644 --- a/components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.cc +++ b/components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.cc
@@ -53,7 +53,7 @@ extra_data = iter->second.second; } base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, instance_id, extra_data)); + FROM_HERE, base::BindOnce(callback, instance_id, extra_data)); } void FakeGCMDriverForInstanceID::GetToken( @@ -76,7 +76,7 @@ last_gettoken_authorized_entity_ = authorized_entity; base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, token, gcm::GCMClient::SUCCESS)); + FROM_HERE, base::BindOnce(callback, token, gcm::GCMClient::SUCCESS)); } void FakeGCMDriverForInstanceID::ValidateToken( @@ -86,7 +86,7 @@ const std::string& token, const ValidateTokenCallback& callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, true /* is_valid */)); + FROM_HERE, base::BindOnce(callback, true /* is_valid */)); } void FakeGCMDriverForInstanceID::DeleteToken( @@ -114,7 +114,7 @@ last_deletetoken_app_id_ = app_id; base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, gcm::GCMClient::SUCCESS)); + FROM_HERE, base::BindOnce(callback, gcm::GCMClient::SUCCESS)); } } // namespace instance_id
diff --git a/components/guest_view/browser/guest_view_base.cc b/components/guest_view/browser/guest_view_base.cc index 7b1a30f..d73e439f 100644 --- a/components/guest_view/browser/guest_view_base.cc +++ b/components/guest_view/browser/guest_view_base.cc
@@ -204,7 +204,7 @@ CreateWebContents(create_params, base::BindOnce(&GuestViewBase::CompleteInit, weak_ptr_factory_.GetWeakPtr(), - base::Passed(¶ms), std::move(callback))); + std::move(params), std::move(callback))); } void GuestViewBase::InitWithWebContents(
diff --git a/components/guest_view/renderer/guest_view_container.cc b/components/guest_view/renderer/guest_view_container.cc index 38a0724a..4fcc45c 100644 --- a/components/guest_view/renderer/guest_view_container.cc +++ b/components/guest_view/renderer/guest_view_container.cc
@@ -247,9 +247,8 @@ return; base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(&GuestViewContainer::CallElementResizeCallback, - weak_ptr_factory_.GetWeakPtr(), new_size)); + FROM_HERE, base::BindOnce(&GuestViewContainer::CallElementResizeCallback, + weak_ptr_factory_.GetWeakPtr(), new_size)); } void GuestViewContainer::CallElementResizeCallback(
diff --git a/components/heap_profiling/client_connection_manager.cc b/components/heap_profiling/client_connection_manager.cc index cecb5c27..4d998d3d 100644 --- a/components/heap_profiling/client_connection_manager.cc +++ b/components/heap_profiling/client_connection_manager.cc
@@ -165,7 +165,7 @@ for (content::BrowserChildProcessHostIterator browser_child_iter; !browser_child_iter.Done(); ++browser_child_iter) { const content::ChildProcessData& data = browser_child_iter.GetData(); - if (base::GetProcId(data.handle) == pid) { + if (base::GetProcId(data.GetHandle()) == pid) { StartProfilingNonRendererChildOnIOThread(controller, data, pid); return; } @@ -188,9 +188,9 @@ !browser_child_iter.Done(); ++browser_child_iter) { const content::ChildProcessData& data = browser_child_iter.GetData(); if (ShouldProfileNonRendererProcessType(mode, data.process_type) && - data.handle != base::kNullProcessHandle) { - StartProfilingNonRendererChildOnIOThread(controller, data, - base::GetProcId(data.handle)); + data.IsHandleValid()) { + StartProfilingNonRendererChildOnIOThread( + controller, data, base::GetProcId(data.GetHandle())); } } } @@ -303,7 +303,7 @@ ->PostTask( FROM_HERE, base::BindOnce(&StartProfilingNonRendererChildOnIOThread, controller_, - data, base::GetProcId(data.handle))); + data.Duplicate(), base::GetProcId(data.GetHandle()))); } void ClientConnectionManager::Observe(
diff --git a/components/heap_profiling/test_driver.cc b/components/heap_profiling/test_driver.cc index cf978596..2585d549 100644 --- a/components/heap_profiling/test_driver.cc +++ b/components/heap_profiling/test_driver.cc
@@ -572,8 +572,8 @@ } else { content::BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE, - base::Bind(&TestDriver::GetHasStartedOnUIThread, - base::Unretained(this))); + base::BindOnce(&TestDriver::GetHasStartedOnUIThread, + base::Unretained(this))); wait_for_ui_thread_.Wait(); } if (has_started_) { @@ -595,20 +595,20 @@ } else { content::BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE, - base::Bind(&TestDriver::CheckOrStartProfilingOnUIThreadAndSignal, - base::Unretained(this))); + base::BindOnce(&TestDriver::CheckOrStartProfilingOnUIThreadAndSignal, + base::Unretained(this))); wait_for_ui_thread_.Wait(); if (!initialization_success_) return false; content::BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE, - base::Bind(&TestDriver::SetKeepSmallAllocationsOnUIThreadAndSignal, - base::Unretained(this))); + base::BindOnce(&TestDriver::SetKeepSmallAllocationsOnUIThreadAndSignal, + base::Unretained(this))); wait_for_ui_thread_.Wait(); if (ShouldProfileRenderer()) { content::BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE, - base::Bind( + base::BindOnce( &TestDriver:: WaitForProfilingToStartForAllRenderersUIThreadAndSignal, base::Unretained(this))); @@ -617,11 +617,13 @@ if (ShouldProfileBrowser()) { content::BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE, - base::Bind(&TestDriver::MakeTestAllocations, base::Unretained(this))); + base::BindOnce(&TestDriver::MakeTestAllocations, + base::Unretained(this))); } content::BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE, - base::Bind(&TestDriver::CollectResults, base::Unretained(this), false)); + base::BindOnce(&TestDriver::CollectResults, base::Unretained(this), + false)); wait_for_ui_thread_.Wait(); } @@ -681,8 +683,8 @@ // has not yet been initialized. Wait for it. if (ShouldProfileBrowser()) { bool already_initialized = SetOnInitAllocatorShimCallbackForTesting( - base::Bind(&base::WaitableEvent::Signal, - base::Unretained(&wait_for_ui_thread_)), + base::BindOnce(&base::WaitableEvent::Signal, + base::Unretained(&wait_for_ui_thread_)), base::ThreadTaskRunnerHandle::Get()); if (!already_initialized) { wait_for_profiling_to_start_ = true; @@ -706,8 +708,8 @@ // start. Otherwise, wait for the Supervisor to start. if (ShouldProfileBrowser()) { SetOnInitAllocatorShimCallbackForTesting( - base::Bind(&base::WaitableEvent::Signal, - base::Unretained(&wait_for_ui_thread_)), + base::BindOnce(&base::WaitableEvent::Signal, + base::Unretained(&wait_for_ui_thread_)), base::ThreadTaskRunnerHandle::Get()); } else { start_callback = base::BindOnce(&base::WaitableEvent::Signal, @@ -846,8 +848,8 @@ } Supervisor::GetInstance()->RequestTraceWithHeapDump( - base::Bind(&TestDriver::TraceFinished, base::Unretained(this), - std::move(finish_tracing_closure)), + base::BindOnce(&TestDriver::TraceFinished, base::Unretained(this), + std::move(finish_tracing_closure)), /* anonymize= */ true); if (synchronous)
diff --git a/components/history/core/browser/browsing_history_service.cc b/components/history/core/browser/browsing_history_service.cc index 7371ab1..a789d0f3 100644 --- a/components/history/core/browser/browsing_history_service.cc +++ b/components/history/core/browser/browsing_history_service.cc
@@ -269,8 +269,8 @@ // tests get confused when completion callback is run synchronously. web_history_timer_->Start( FROM_HERE, base::TimeDelta::FromSeconds(kWebHistoryTimeoutSeconds), - base::Bind(&BrowsingHistoryService::WebHistoryTimeout, - weak_factory_.GetWeakPtr(), state)); + base::BindOnce(&BrowsingHistoryService::WebHistoryTimeout, + weak_factory_.GetWeakPtr(), state)); net::PartialNetworkTrafficAnnotationTag partial_traffic_annotation = net::DefinePartialNetworkTrafficAnnotation("web_history_query", @@ -603,8 +603,8 @@ info.has_synced_results = state->remote_status == MORE_RESULTS || state->remote_status == REACHED_BEGINNING; base::OnceClosure continuation = - base::Bind(&BrowsingHistoryService::QueryHistoryInternal, - weak_factory_.GetWeakPtr(), std::move(state)); + base::BindOnce(&BrowsingHistoryService::QueryHistoryInternal, + weak_factory_.GetWeakPtr(), std::move(state)); driver_->OnQueryComplete(results, info, std::move(continuation)); driver_->HasOtherFormsOfBrowsingHistory(has_other_forms_of_browsing_history_, has_synced_results_);
diff --git a/components/history/core/browser/expire_history_backend.cc b/components/history/core/browser/expire_history_backend.cc index ef0b2e3..bcb5fdc 100644 --- a/components/history/core/browser/expire_history_backend.cc +++ b/components/history/core/browser/expire_history_backend.cc
@@ -533,8 +533,8 @@ expected_expiration_time_ = base::Time::Now() + delay; task_runner_->PostDelayedTask( FROM_HERE, - base::Bind(&ExpireHistoryBackend::DoExpireIteration, - weak_factory_.GetWeakPtr()), + base::BindOnce(&ExpireHistoryBackend::DoExpireIteration, + weak_factory_.GetWeakPtr()), delay); } @@ -550,8 +550,8 @@ kExpirationSleepWakeupThreshold) { task_runner_->PostDelayedTask( FROM_HERE, - base::Bind(&ExpireHistoryBackend::ScheduleExpire, - weak_factory_.GetWeakPtr()), + base::BindOnce(&ExpireHistoryBackend::ScheduleExpire, + weak_factory_.GetWeakPtr()), base::TimeDelta::FromMinutes(kExpirationEmptyDelayMin)); return; }
diff --git a/components/history/core/browser/history_backend.cc b/components/history/core/browser/history_backend.cc index 6e54197..fca62b1 100644 --- a/components/history/core/browser/history_backend.cc +++ b/components/history/core/browser/history_backend.cc
@@ -147,8 +147,8 @@ QueuedHistoryDBTask::~QueuedHistoryDBTask() { // Ensure that |task_| is destroyed on its origin thread. origin_loop_->PostTask(FROM_HERE, - base::Bind(&base::DeletePointer<HistoryDBTask>, - base::Unretained(task_.release()))); + base::BindOnce(&base::DeletePointer<HistoryDBTask>, + base::Unretained(task_.release()))); } bool QueuedHistoryDBTask::is_canceled() { @@ -161,10 +161,10 @@ void QueuedHistoryDBTask::DoneRun() { origin_loop_->PostTask( - FROM_HERE, base::Bind(&RunUnlessCanceled, - base::Bind(&HistoryDBTask::DoneRunOnMainThread, - base::Unretained(task_.get())), - is_canceled_)); + FROM_HERE, base::BindOnce(&RunUnlessCanceled, + base::Bind(&HistoryDBTask::DoneRunOnMainThread, + base::Unretained(task_.get())), + is_canceled_)); } // HistoryBackendHelper -------------------------------------------------------- @@ -2451,7 +2451,7 @@ // tasks, and process it after an invoke later. queued_history_db_tasks_.push_back(std::move(task)); task_runner_->PostTask( - FROM_HERE, base::Bind(&HistoryBackend::ProcessDBTaskImpl, this)); + FROM_HERE, base::BindOnce(&HistoryBackend::ProcessDBTaskImpl, this)); } } @@ -2610,7 +2610,7 @@ // the DB or consider changing KillHistoryDatabase() to use RazeAndClose() // (then it can be cleared immediately). task_runner_->PostTask( - FROM_HERE, base::Bind(&HistoryBackend::KillHistoryDatabase, this)); + FROM_HERE, base::BindOnce(&HistoryBackend::KillHistoryDatabase, this)); } }
diff --git a/components/history/core/browser/history_model_worker_unittest.cc b/components/history/core/browser/history_model_worker_unittest.cc index 7fd78410..fc5aa08 100644 --- a/components/history/core/browser/history_model_worker_unittest.cc +++ b/components/history/core/browser/history_model_worker_unittest.cc
@@ -49,7 +49,7 @@ }; syncer::WorkCallback ClosureToWorkCallback(base::Closure work) { - return base::Bind( + return base::BindOnce( [](base::Closure work) { work.Run(); return syncer::SYNCER_OK; @@ -90,8 +90,8 @@ base::IgnoreResult(&HistoryModelWorker::DoWorkAndWaitUntilDone), worker_, ClosureToWorkCallback(work))); sync_thread_.task_runner()->PostTask( - FROM_HERE, base::Bind(&base::AtomicFlag::Set, - base::Unretained(&sync_thread_unblocked_))); + FROM_HERE, base::BindOnce(&base::AtomicFlag::Set, + base::Unretained(&sync_thread_unblocked_))); } const scoped_refptr<base::TestSimpleTaskRunner> ui_thread_ =
diff --git a/components/history/core/browser/history_service.cc b/components/history/core/browser/history_service.cc index 6f48ce8..c77dfbf4 100644 --- a/components/history/core/browser/history_service.cc +++ b/components/history/core/browser/history_service.cc
@@ -117,8 +117,8 @@ const std::string& diagnostics) override { // Send to the history service on the main thread. service_task_runner_->PostTask( - FROM_HERE, base::Bind(&HistoryService::NotifyProfileError, - history_service_, init_status, diagnostics)); + FROM_HERE, base::BindOnce(&HistoryService::NotifyProfileError, + history_service_, init_status, diagnostics)); } void SetInMemoryBackend( @@ -133,8 +133,8 @@ const GURL& icon_url) override { // Send the notification to the history service on the main thread. service_task_runner_->PostTask( - FROM_HERE, base::Bind(&HistoryService::NotifyFaviconsChanged, - history_service_, page_urls, icon_url)); + FROM_HERE, base::BindOnce(&HistoryService::NotifyFaviconsChanged, + history_service_, page_urls, icon_url)); } void NotifyURLVisited(ui::PageTransition transition, @@ -143,14 +143,14 @@ base::Time visit_time) override { service_task_runner_->PostTask( FROM_HERE, - base::Bind(&HistoryService::NotifyURLVisited, history_service_, - transition, row, redirects, visit_time)); + base::BindOnce(&HistoryService::NotifyURLVisited, history_service_, + transition, row, redirects, visit_time)); } void NotifyURLsModified(const URLRows& changed_urls) override { service_task_runner_->PostTask( - FROM_HERE, base::Bind(&HistoryService::NotifyURLsModified, - history_service_, changed_urls)); + FROM_HERE, base::BindOnce(&HistoryService::NotifyURLsModified, + history_service_, changed_urls)); } void NotifyURLsDeleted(DeletionInfo deletion_info) override { @@ -163,19 +163,22 @@ KeywordID keyword_id, const base::string16& term) override { service_task_runner_->PostTask( - FROM_HERE, base::Bind(&HistoryService::NotifyKeywordSearchTermUpdated, - history_service_, row, keyword_id, term)); + FROM_HERE, + base::BindOnce(&HistoryService::NotifyKeywordSearchTermUpdated, + history_service_, row, keyword_id, term)); } void NotifyKeywordSearchTermDeleted(URLID url_id) override { service_task_runner_->PostTask( - FROM_HERE, base::Bind(&HistoryService::NotifyKeywordSearchTermDeleted, - history_service_, url_id)); + FROM_HERE, + base::BindOnce(&HistoryService::NotifyKeywordSearchTermDeleted, + history_service_, url_id)); } void DBLoaded() override { service_task_runner_->PostTask( - FROM_HERE, base::Bind(&HistoryService::OnDBLoaded, history_service_)); + FROM_HERE, + base::BindOnce(&HistoryService::OnDBLoaded, history_service_)); } private: @@ -223,8 +226,8 @@ DCHECK(backend_task_runner_) << "History service being called after cleanup"; DCHECK(thread_checker_.CalledOnValidThread()); ScheduleTask(PRIORITY_NORMAL, - base::Bind(&HistoryBackend::ClearCachedDataForContextID, - history_backend_, context_id)); + base::BindOnce(&HistoryBackend::ClearCachedDataForContextID, + history_backend_, context_id)); } URLDatabase* HistoryService::InMemoryDatabase() { @@ -243,8 +246,8 @@ DCHECK(backend_task_runner_) << "History service being called after cleanup"; DCHECK(thread_checker_.CalledOnValidThread()); ScheduleTask(PRIORITY_UI, - base::Bind(&HistoryBackend::SetKeywordSearchTermsForURL, - history_backend_, url, keyword_id, term)); + base::BindOnce(&HistoryBackend::SetKeywordSearchTermsForURL, + history_backend_, url, keyword_id, term)); } void HistoryService::DeleteAllSearchTermsForKeyword(KeywordID keyword_id) { @@ -255,16 +258,16 @@ in_memory_backend_->DeleteAllSearchTermsForKeyword(keyword_id); ScheduleTask(PRIORITY_UI, - base::Bind(&HistoryBackend::DeleteAllSearchTermsForKeyword, - history_backend_, keyword_id)); + base::BindOnce(&HistoryBackend::DeleteAllSearchTermsForKeyword, + history_backend_, keyword_id)); } void HistoryService::DeleteKeywordSearchTermForURL(const GURL& url) { DCHECK(backend_task_runner_) << "History service being called after cleanup"; DCHECK(thread_checker_.CalledOnValidThread()); ScheduleTask(PRIORITY_UI, - base::Bind(&HistoryBackend::DeleteKeywordSearchTermForURL, - history_backend_, url)); + base::BindOnce(&HistoryBackend::DeleteKeywordSearchTermForURL, + history_backend_, url)); } void HistoryService::DeleteMatchingURLsForKeyword(KeywordID keyword_id, @@ -272,16 +275,16 @@ DCHECK(backend_task_runner_) << "History service being called after cleanup"; DCHECK(thread_checker_.CalledOnValidThread()); ScheduleTask(PRIORITY_UI, - base::Bind(&HistoryBackend::DeleteMatchingURLsForKeyword, - history_backend_, keyword_id, term)); + base::BindOnce(&HistoryBackend::DeleteMatchingURLsForKeyword, + history_backend_, keyword_id, term)); } void HistoryService::URLsNoLongerBookmarked(const std::set<GURL>& urls) { DCHECK(backend_task_runner_) << "History service being called after cleanup"; DCHECK(thread_checker_.CalledOnValidThread()); ScheduleTask(PRIORITY_NORMAL, - base::Bind(&HistoryBackend::URLsNoLongerBookmarked, - history_backend_, urls)); + base::BindOnce(&HistoryBackend::URLsNoLongerBookmarked, + history_backend_, urls)); } void HistoryService::AddObserver(HistoryServiceObserver* observer) { @@ -323,8 +326,8 @@ DCHECK(thread_checker_.CalledOnValidThread()); ScheduleTask( PRIORITY_NORMAL, - base::Bind(&HistoryBackend::SetOnBackendDestroyTask, history_backend_, - base::ThreadTaskRunnerHandle::Get(), task)); + base::BindOnce(&HistoryBackend::SetOnBackendDestroyTask, history_backend_, + base::ThreadTaskRunnerHandle::Get(), task)); } void HistoryService::TopHosts(size_t num_hosts, @@ -407,8 +410,8 @@ } ScheduleTask(PRIORITY_NORMAL, - base::Bind(&HistoryBackend::AddPage, history_backend_, - add_page_args)); + base::BindOnce(&HistoryBackend::AddPage, history_backend_, + add_page_args)); } void HistoryService::AddPageNoVisitForBookmark(const GURL& url, @@ -419,16 +422,16 @@ return; ScheduleTask(PRIORITY_NORMAL, - base::Bind(&HistoryBackend::AddPageNoVisitForBookmark, - history_backend_, url, title)); + base::BindOnce(&HistoryBackend::AddPageNoVisitForBookmark, + history_backend_, url, title)); } void HistoryService::SetPageTitle(const GURL& url, const base::string16& title) { DCHECK(backend_task_runner_) << "History service being called after cleanup"; DCHECK(thread_checker_.CalledOnValidThread()); - ScheduleTask(PRIORITY_NORMAL, base::Bind(&HistoryBackend::SetPageTitle, - history_backend_, url, title)); + ScheduleTask(PRIORITY_NORMAL, base::BindOnce(&HistoryBackend::SetPageTitle, + history_backend_, url, title)); } void HistoryService::UpdateWithPageEndTime(ContextID context_id, @@ -439,8 +442,8 @@ DCHECK(thread_checker_.CalledOnValidThread()); ScheduleTask( PRIORITY_NORMAL, - base::Bind(&HistoryBackend::UpdateWithPageEndTime, history_backend_, - context_id, nav_entry_id, url, end_ts)); + base::BindOnce(&HistoryBackend::UpdateWithPageEndTime, history_backend_, + context_id, nav_entry_id, url, end_ts)); } void HistoryService::AddPageWithDetails(const GURL& url, @@ -471,8 +474,8 @@ rows.push_back(row); ScheduleTask(PRIORITY_NORMAL, - base::Bind(&HistoryBackend::AddPagesWithDetails, - history_backend_, rows, visit_source)); + base::BindOnce(&HistoryBackend::AddPagesWithDetails, + history_backend_, rows, visit_source)); } void HistoryService::AddPagesWithDetails(const URLRows& info, @@ -490,8 +493,8 @@ } ScheduleTask(PRIORITY_NORMAL, - base::Bind(&HistoryBackend::AddPagesWithDetails, - history_backend_, info, visit_source)); + base::BindOnce(&HistoryBackend::AddPagesWithDetails, + history_backend_, info, visit_source)); } base::CancelableTaskTracker::TaskId HistoryService::GetFavicon( @@ -507,9 +510,9 @@ new std::vector<favicon_base::FaviconRawBitmapResult>(); return tracker->PostTaskAndReply( backend_task_runner_.get(), FROM_HERE, - base::Bind(&HistoryBackend::GetFavicon, history_backend_, icon_url, - icon_type, desired_sizes, results), - base::Bind(&RunWithFaviconResults, callback, base::Owned(results))); + base::BindOnce(&HistoryBackend::GetFavicon, history_backend_, icon_url, + icon_type, desired_sizes, results), + base::BindOnce(&RunWithFaviconResults, callback, base::Owned(results))); } base::CancelableTaskTracker::TaskId HistoryService::GetFaviconsForURL( @@ -526,9 +529,10 @@ new std::vector<favicon_base::FaviconRawBitmapResult>(); return tracker->PostTaskAndReply( backend_task_runner_.get(), FROM_HERE, - base::Bind(&HistoryBackend::GetFaviconsForURL, history_backend_, page_url, - icon_types, desired_sizes, fallback_to_host, results), - base::Bind(&RunWithFaviconResults, callback, base::Owned(results))); + base::BindOnce(&HistoryBackend::GetFaviconsForURL, history_backend_, + page_url, icon_types, desired_sizes, fallback_to_host, + results), + base::BindOnce(&RunWithFaviconResults, callback, base::Owned(results))); } base::CancelableTaskTracker::TaskId HistoryService::GetLargestFaviconForURL( @@ -543,9 +547,9 @@ new favicon_base::FaviconRawBitmapResult(); return tracker->PostTaskAndReply( backend_task_runner_.get(), FROM_HERE, - base::Bind(&HistoryBackend::GetLargestFaviconForURL, history_backend_, - page_url, icon_types, minimum_size_in_pixels, result), - base::Bind(&RunWithFaviconResult, callback, base::Owned(result))); + base::BindOnce(&HistoryBackend::GetLargestFaviconForURL, history_backend_, + page_url, icon_types, minimum_size_in_pixels, result), + base::BindOnce(&RunWithFaviconResult, callback, base::Owned(result))); } base::CancelableTaskTracker::TaskId HistoryService::GetFaviconForID( @@ -560,9 +564,9 @@ new std::vector<favicon_base::FaviconRawBitmapResult>(); return tracker->PostTaskAndReply( backend_task_runner_.get(), FROM_HERE, - base::Bind(&HistoryBackend::GetFaviconForID, history_backend_, favicon_id, - desired_size, results), - base::Bind(&RunWithFaviconResults, callback, base::Owned(results))); + base::BindOnce(&HistoryBackend::GetFaviconForID, history_backend_, + favicon_id, desired_size, results), + base::BindOnce(&RunWithFaviconResults, callback, base::Owned(results))); } base::CancelableTaskTracker::TaskId @@ -580,10 +584,10 @@ new std::vector<favicon_base::FaviconRawBitmapResult>(); return tracker->PostTaskAndReply( backend_task_runner_.get(), FROM_HERE, - base::Bind(&HistoryBackend::UpdateFaviconMappingsAndFetch, - history_backend_, page_urls, icon_url, icon_type, - desired_sizes, results), - base::Bind(&RunWithFaviconResults, callback, base::Owned(results))); + base::BindOnce(&HistoryBackend::UpdateFaviconMappingsAndFetch, + history_backend_, page_urls, icon_url, icon_type, + desired_sizes, results), + base::BindOnce(&RunWithFaviconResults, callback, base::Owned(results))); } void HistoryService::DeleteFaviconMappings( @@ -594,8 +598,8 @@ DCHECK(thread_checker_.CalledOnValidThread()); ScheduleTask(PRIORITY_NORMAL, - base::Bind(&HistoryBackend::DeleteFaviconMappings, - history_backend_, page_urls, icon_type)); + base::BindOnce(&HistoryBackend::DeleteFaviconMappings, + history_backend_, page_urls, icon_type)); } void HistoryService::MergeFavicon( @@ -612,8 +616,8 @@ ScheduleTask( PRIORITY_NORMAL, - base::Bind(&HistoryBackend::MergeFavicon, history_backend_, - page_url, icon_url, icon_type, bitmap_data, pixel_size)); + base::BindOnce(&HistoryBackend::MergeFavicon, history_backend_, page_url, + icon_url, icon_type, bitmap_data, pixel_size)); } void HistoryService::SetFavicons(const base::flat_set<GURL>& page_urls, @@ -634,8 +638,8 @@ return; ScheduleTask(PRIORITY_NORMAL, - base::Bind(&HistoryBackend::SetFavicons, history_backend_, - page_urls_to_save, icon_type, icon_url, bitmaps)); + base::BindOnce(&HistoryBackend::SetFavicons, history_backend_, + page_urls_to_save, icon_type, icon_url, bitmaps)); } void HistoryService::CloneFaviconMappingsForPages( @@ -646,9 +650,9 @@ DCHECK(thread_checker_.CalledOnValidThread()); ScheduleTask(PRIORITY_NORMAL, - base::Bind(&HistoryBackend::CloneFaviconMappingsForPages, - history_backend_, page_url_to_read, icon_types, - page_urls_to_write)); + base::BindOnce(&HistoryBackend::CloneFaviconMappingsForPages, + history_backend_, page_url_to_read, icon_types, + page_urls_to_write)); } void HistoryService::CanSetOnDemandFavicons( @@ -693,16 +697,16 @@ DCHECK(backend_task_runner_) << "History service being called after cleanup"; DCHECK(thread_checker_.CalledOnValidThread()); ScheduleTask(PRIORITY_NORMAL, - base::Bind(&HistoryBackend::SetFaviconsOutOfDateForPage, - history_backend_, page_url)); + base::BindOnce(&HistoryBackend::SetFaviconsOutOfDateForPage, + history_backend_, page_url)); } void HistoryService::TouchOnDemandFavicon(const GURL& icon_url) { DCHECK(backend_task_runner_) << "History service being called after cleanup"; DCHECK(thread_checker_.CalledOnValidThread()); ScheduleTask(PRIORITY_NORMAL, - base::Bind(&HistoryBackend::TouchOnDemandFavicon, - history_backend_, icon_url)); + base::BindOnce(&HistoryBackend::TouchOnDemandFavicon, + history_backend_, icon_url)); } void HistoryService::SetImportedFavicons( @@ -710,8 +714,8 @@ DCHECK(backend_task_runner_) << "History service being called after cleanup"; DCHECK(thread_checker_.CalledOnValidThread()); ScheduleTask(PRIORITY_NORMAL, - base::Bind(&HistoryBackend::SetImportedFavicons, - history_backend_, favicon_usage)); + base::BindOnce(&HistoryBackend::SetImportedFavicons, + history_backend_, favicon_usage)); } base::CancelableTaskTracker::TaskId HistoryService::QueryURL( @@ -724,8 +728,8 @@ QueryURLResult* query_url_result = new QueryURLResult(); return tracker->PostTaskAndReply( backend_task_runner_.get(), FROM_HERE, - base::Bind(&HistoryBackend::QueryURL, history_backend_, url, want_visits, - base::Unretained(query_url_result)), + base::BindOnce(&HistoryBackend::QueryURL, history_backend_, url, + want_visits, base::Unretained(query_url_result)), base::BindOnce(&RunWithQueryURLResult, std::move(callback), base::Owned(query_url_result))); } @@ -795,16 +799,16 @@ bool should_commit_immediately) { DCHECK(backend_task_runner_) << "History service being called after cleanup"; DCHECK(thread_checker_.CalledOnValidThread()); - ScheduleTask(PRIORITY_NORMAL, base::Bind(&HistoryBackend::UpdateDownload, - history_backend_, data, - should_commit_immediately)); + ScheduleTask(PRIORITY_NORMAL, + base::BindOnce(&HistoryBackend::UpdateDownload, history_backend_, + data, should_commit_immediately)); } void HistoryService::RemoveDownloads(const std::set<uint32_t>& ids) { DCHECK(backend_task_runner_) << "History service being called after cleanup"; DCHECK(thread_checker_.CalledOnValidThread()); - ScheduleTask(PRIORITY_NORMAL, base::Bind(&HistoryBackend::RemoveDownloads, - history_backend_, ids)); + ScheduleTask(PRIORITY_NORMAL, base::BindOnce(&HistoryBackend::RemoveDownloads, + history_backend_, ids)); } base::CancelableTaskTracker::TaskId HistoryService::QueryHistory( @@ -817,9 +821,9 @@ QueryResults* query_results = new QueryResults(); return tracker->PostTaskAndReply( backend_task_runner_.get(), FROM_HERE, - base::Bind(&HistoryBackend::QueryHistory, history_backend_, text_query, - options, base::Unretained(query_results)), - base::Bind(callback, base::Owned(query_results))); + base::BindOnce(&HistoryBackend::QueryHistory, history_backend_, + text_query, options, base::Unretained(query_results)), + base::BindOnce(callback, base::Owned(query_results))); } base::CancelableTaskTracker::TaskId HistoryService::QueryRedirectsFrom( @@ -831,9 +835,9 @@ RedirectList* result = new RedirectList(); return tracker->PostTaskAndReply( backend_task_runner_.get(), FROM_HERE, - base::Bind(&HistoryBackend::QueryRedirectsFrom, history_backend_, - from_url, base::Unretained(result)), - base::Bind(callback, base::Owned(result))); + base::BindOnce(&HistoryBackend::QueryRedirectsFrom, history_backend_, + from_url, base::Unretained(result)), + base::BindOnce(callback, base::Owned(result))); } base::CancelableTaskTracker::TaskId HistoryService::QueryRedirectsTo( @@ -845,9 +849,9 @@ RedirectList* result = new RedirectList(); return tracker->PostTaskAndReply( backend_task_runner_.get(), FROM_HERE, - base::Bind(&HistoryBackend::QueryRedirectsTo, history_backend_, to_url, - base::Unretained(result)), - base::Bind(callback, base::Owned(result))); + base::BindOnce(&HistoryBackend::QueryRedirectsTo, history_backend_, + to_url, base::Unretained(result)), + base::BindOnce(callback, base::Owned(result))); } base::CancelableTaskTracker::TaskId HistoryService::GetVisibleVisitCountToHost( @@ -859,10 +863,10 @@ VisibleVisitCountToHostResult* result = new VisibleVisitCountToHostResult(); return tracker->PostTaskAndReply( backend_task_runner_.get(), FROM_HERE, - base::Bind(&HistoryBackend::GetVisibleVisitCountToHost, history_backend_, - url, base::Unretained(result)), - base::Bind(&RunWithVisibleVisitCountToHostResult, callback, - base::Owned(result))); + base::BindOnce(&HistoryBackend::GetVisibleVisitCountToHost, + history_backend_, url, base::Unretained(result)), + base::BindOnce(&RunWithVisibleVisitCountToHostResult, callback, + base::Owned(result))); } base::CancelableTaskTracker::TaskId HistoryService::QueryMostVisitedURLs( @@ -875,9 +879,9 @@ MostVisitedURLList* result = new MostVisitedURLList(); return tracker->PostTaskAndReply( backend_task_runner_.get(), FROM_HERE, - base::Bind(&HistoryBackend::QueryMostVisitedURLs, history_backend_, - result_count, days_back, base::Unretained(result)), - base::Bind(callback, base::Owned(result))); + base::BindOnce(&HistoryBackend::QueryMostVisitedURLs, history_backend_, + result_count, days_back, base::Unretained(result)), + base::BindOnce(callback, base::Owned(result))); } void HistoryService::Cleanup() { @@ -969,8 +973,8 @@ history_backend_.swap(backend); ScheduleTask(PRIORITY_UI, - base::Bind(&HistoryBackend::Init, history_backend_, - no_db, history_database_params)); + base::BindOnce(&HistoryBackend::Init, history_backend_, no_db, + history_database_params)); if (visit_delegate_ && !visit_delegate_->Init(this)) return false; @@ -984,8 +988,9 @@ void HistoryService::ScheduleAutocomplete( const base::Callback<void(HistoryBackend*, URLDatabase*)>& callback) { DCHECK(thread_checker_.CalledOnValidThread()); - ScheduleTask(PRIORITY_UI, base::Bind(&HistoryBackend::ScheduleAutocomplete, - history_backend_, callback)); + ScheduleTask(PRIORITY_UI, + base::BindOnce(&HistoryBackend::ScheduleAutocomplete, + history_backend_, callback)); } void HistoryService::ScheduleTask(SchedulePriority priority, @@ -1079,8 +1084,8 @@ DCHECK(backend_task_runner_) << "History service being called after cleanup"; DCHECK(thread_checker_.CalledOnValidThread()); // We will update the visited links when we observe the delete notifications. - ScheduleTask(PRIORITY_NORMAL, base::Bind(&HistoryBackend::DeleteURL, - history_backend_, url)); + ScheduleTask(PRIORITY_NORMAL, base::BindOnce(&HistoryBackend::DeleteURL, + history_backend_, url)); } void HistoryService::DeleteURLsForTest(const std::vector<GURL>& urls) { @@ -1088,8 +1093,8 @@ DCHECK(thread_checker_.CalledOnValidThread()); // We will update the visited links when we observe the delete // notifications. - ScheduleTask(PRIORITY_NORMAL, base::Bind(&HistoryBackend::DeleteURLs, - history_backend_, urls)); + ScheduleTask(PRIORITY_NORMAL, base::BindOnce(&HistoryBackend::DeleteURLs, + history_backend_, urls)); } void HistoryService::ExpireHistoryBetween( @@ -1102,8 +1107,8 @@ DCHECK(thread_checker_.CalledOnValidThread()); tracker->PostTaskAndReply( backend_task_runner_.get(), FROM_HERE, - base::Bind(&HistoryBackend::ExpireHistoryBetween, history_backend_, - restrict_urls, begin_time, end_time), + base::BindOnce(&HistoryBackend::ExpireHistoryBetween, history_backend_, + restrict_urls, begin_time, end_time), callback); } @@ -1113,10 +1118,10 @@ base::CancelableTaskTracker* tracker) { DCHECK(backend_task_runner_) << "History service being called after cleanup"; DCHECK(thread_checker_.CalledOnValidThread()); - tracker->PostTaskAndReply( - backend_task_runner_.get(), FROM_HERE, - base::Bind(&HistoryBackend::ExpireHistory, history_backend_, expire_list), - callback); + tracker->PostTaskAndReply(backend_task_runner_.get(), FROM_HERE, + base::BindOnce(&HistoryBackend::ExpireHistory, + history_backend_, expire_list), + callback); } void HistoryService::ExpireHistoryBeforeForTesting(
diff --git a/components/history/core/browser/history_service_unittest.cc b/components/history/core/browser/history_service_unittest.cc index c68c6ab..b5cfe96b6 100644 --- a/components/history/core/browser/history_service_unittest.cc +++ b/components/history/core/browser/history_service_unittest.cc
@@ -721,8 +721,8 @@ base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(100)); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&CheckDirectiveProcessingResult, timeout, - change_processor, num_changes)); + FROM_HERE, base::BindOnce(&CheckDirectiveProcessingResult, timeout, + change_processor, num_changes)); } // Create a delete directive for a few specific history entries, @@ -781,9 +781,9 @@ // processing finishes. base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(&CheckDirectiveProcessingResult, - base::Time::Now() + base::TimeDelta::FromSeconds(10), - &change_processor, 2)); + base::BindOnce(&CheckDirectiveProcessingResult, + base::Time::Now() + base::TimeDelta::FromSeconds(10), + &change_processor, 2)); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(QueryURL(history_service_.get(), test_url)); ASSERT_EQ(5, query_url_row_.visit_count()); @@ -856,9 +856,9 @@ // directive processing finishes. base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(&CheckDirectiveProcessingResult, - base::Time::Now() + base::TimeDelta::FromSeconds(10), - &change_processor, 2)); + base::BindOnce(&CheckDirectiveProcessingResult, + base::Time::Now() + base::TimeDelta::FromSeconds(10), + &change_processor, 2)); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(QueryURL(history_service_.get(), test_url)); ASSERT_EQ(3, query_url_row_.visit_count());
diff --git a/components/history/core/browser/top_sites_backend.cc b/components/history/core/browser/top_sites_backend.cc index 66ddfc7..25870cf2 100644 --- a/components/history/core/browser/top_sites_backend.cc +++ b/components/history/core/browser/top_sites_backend.cc
@@ -34,12 +34,13 @@ void TopSitesBackend::Init(const base::FilePath& path) { db_path_ = path; db_task_runner_->PostTask( - FROM_HERE, base::Bind(&TopSitesBackend::InitDBOnDBThread, this, path)); + FROM_HERE, + base::BindOnce(&TopSitesBackend::InitDBOnDBThread, this, path)); } void TopSitesBackend::Shutdown() { db_task_runner_->PostTask( - FROM_HERE, base::Bind(&TopSitesBackend::ShutdownDBOnDBThread, this)); + FROM_HERE, base::BindOnce(&TopSitesBackend::ShutdownDBOnDBThread, this)); } void TopSitesBackend::GetMostVisitedThumbnails( @@ -48,31 +49,30 @@ scoped_refptr<MostVisitedThumbnails> thumbnails = new MostVisitedThumbnails(); tracker->PostTaskAndReply( db_task_runner_.get(), FROM_HERE, - base::Bind(&TopSitesBackend::GetMostVisitedThumbnailsOnDBThread, this, - thumbnails), - base::Bind(callback, thumbnails)); + base::BindOnce(&TopSitesBackend::GetMostVisitedThumbnailsOnDBThread, this, + thumbnails), + base::BindOnce(callback, thumbnails)); } void TopSitesBackend::UpdateTopSites(const TopSitesDelta& delta, const RecordHistogram record_or_not) { db_task_runner_->PostTask( - FROM_HERE, - base::Bind(&TopSitesBackend::UpdateTopSitesOnDBThread, this, delta, - record_or_not)); + FROM_HERE, base::BindOnce(&TopSitesBackend::UpdateTopSitesOnDBThread, + this, delta, record_or_not)); } void TopSitesBackend::SetPageThumbnail(const MostVisitedURL& url, int url_rank, const Images& thumbnail) { db_task_runner_->PostTask( - FROM_HERE, base::Bind(&TopSitesBackend::SetPageThumbnailOnDBThread, this, - url, url_rank, thumbnail)); + FROM_HERE, base::BindOnce(&TopSitesBackend::SetPageThumbnailOnDBThread, + this, url, url_rank, thumbnail)); } void TopSitesBackend::ResetDatabase() { db_task_runner_->PostTask( - FROM_HERE, - base::Bind(&TopSitesBackend::ResetDatabaseOnDBThread, this, db_path_)); + FROM_HERE, base::BindOnce(&TopSitesBackend::ResetDatabaseOnDBThread, this, + db_path_)); } void TopSitesBackend::DoEmptyRequest(const base::Closure& reply,
diff --git a/components/history/core/browser/top_sites_impl.cc b/components/history/core/browser/top_sites_impl.cc index eba874f..7b0e530 100644 --- a/components/history/core/browser/top_sites_impl.cc +++ b/components/history/core/browser/top_sites_impl.cc
@@ -55,7 +55,7 @@ if (task_runner->RunsTasksInCurrentSequence()) callback.Run(urls); else - task_runner->PostTask(FROM_HERE, base::Bind(callback, urls)); + task_runner->PostTask(FROM_HERE, base::BindOnce(callback, urls)); } // Compares two MostVisitedURL having a non-null |last_forced_time|.
diff --git a/components/history/core/browser/typed_url_sync_bridge_unittest.cc b/components/history/core/browser/typed_url_sync_bridge_unittest.cc index 8fbf197..e2ceafc 100644 --- a/components/history/core/browser/typed_url_sync_bridge_unittest.cc +++ b/components/history/core/browser/typed_url_sync_bridge_unittest.cc
@@ -389,13 +389,13 @@ void VerifyAllLocalHistoryData( const std::vector<TypedUrlSpecifics>& expected) { bridge()->GetAllDataForDebugging( - base::Bind(&VerifyDataBatch, ExpectedMap(expected))); + base::BindOnce(&VerifyDataBatch, ExpectedMap(expected))); } void VerifyGetData(TypedURLSyncBridge::StorageKeyList storage_keys, const std::vector<TypedUrlSpecifics>& expected) { bridge()->GetData(storage_keys, - base::Bind(&VerifyDataBatch, ExpectedMap(expected))); + base::BindOnce(&VerifyDataBatch, ExpectedMap(expected))); } void VerifyProcessorReceivedValidEntityData() {
diff --git a/components/history/core/browser/web_history_service_unittest.cc b/components/history/core/browser/web_history_service_unittest.cc index e029ae37..b61d71b 100644 --- a/components/history/core/browser/web_history_service_unittest.cc +++ b/components/history/core/browser/web_history_service_unittest.cc
@@ -137,8 +137,8 @@ void Start() override { is_pending_ = true; base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(&TestRequest::MimicReturnFromFetch, base::Unretained(this))); + FROM_HERE, base::BindOnce(&TestRequest::MimicReturnFromFetch, + base::Unretained(this))); } void MimicReturnFromFetch() { @@ -254,8 +254,8 @@ PARTIAL_TRAFFIC_ANNOTATION_FOR_TESTS); base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(&TestingWebHistoryService::EnsureNoPendingRequestsRemain, - base::Unretained(web_history_service()))); + base::BindOnce(&TestingWebHistoryService::EnsureNoPendingRequestsRemain, + base::Unretained(web_history_service()))); } TEST_F(WebHistoryServiceTest, SetAudioHistoryEnabledTrue) { @@ -271,8 +271,8 @@ PARTIAL_TRAFFIC_ANNOTATION_FOR_TESTS); base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(&TestingWebHistoryService::EnsureNoPendingRequestsRemain, - base::Unretained(web_history_service()))); + base::BindOnce(&TestingWebHistoryService::EnsureNoPendingRequestsRemain, + base::Unretained(web_history_service()))); } TEST_F(WebHistoryServiceTest, SetAudioHistoryEnabledFalse) { @@ -288,8 +288,8 @@ PARTIAL_TRAFFIC_ANNOTATION_FOR_TESTS); base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(&TestingWebHistoryService::EnsureNoPendingRequestsRemain, - base::Unretained(web_history_service()))); + base::BindOnce(&TestingWebHistoryService::EnsureNoPendingRequestsRemain, + base::Unretained(web_history_service()))); } TEST_F(WebHistoryServiceTest, MultipleRequests) { @@ -315,8 +315,8 @@ // Check that both requests are no longer pending. base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(&TestingWebHistoryService::EnsureNoPendingRequestsRemain, - base::Unretained(web_history_service()))); + base::BindOnce(&TestingWebHistoryService::EnsureNoPendingRequestsRemain, + base::Unretained(web_history_service()))); } TEST_F(WebHistoryServiceTest, VerifyReadResponse) {
diff --git a/components/image_fetcher/core/image_fetcher_impl.cc b/components/image_fetcher/core/image_fetcher_impl.cc index 3b1615f..6e1acc45 100644 --- a/components/image_fetcher/core/image_fetcher_impl.cc +++ b/components/image_fetcher/core/image_fetcher_impl.cc
@@ -64,8 +64,8 @@ image_data_fetcher_->FetchImageData( image_url, - base::Bind(&ImageFetcherImpl::OnImageURLFetched, base::Unretained(this), - image_url), + base::BindOnce(&ImageFetcherImpl::OnImageURLFetched, + base::Unretained(this), image_url), traffic_annotation); } else { ImageRequest* request = &it->second;
diff --git a/components/invalidation/impl/gcm_invalidation_bridge.cc b/components/invalidation/impl/gcm_invalidation_bridge.cc index c9f7847d..33db59d 100644 --- a/components/invalidation/impl/gcm_invalidation_bridge.cc +++ b/components/invalidation/impl/gcm_invalidation_bridge.cc
@@ -98,40 +98,38 @@ // Pass core WeapPtr and TaskRunner to GCMInvalidationBridge for it to be able // to post back. ui_thread_task_runner_->PostTask( - FROM_HERE, - base::Bind(&GCMInvalidationBridge::CoreInitializationDone, - bridge_, - weak_factory_.GetWeakPtr(), - base::ThreadTaskRunnerHandle::Get())); + FROM_HERE, base::BindOnce(&GCMInvalidationBridge::CoreInitializationDone, + bridge_, weak_factory_.GetWeakPtr(), + base::ThreadTaskRunnerHandle::Get())); } void GCMInvalidationBridge::Core::RequestToken(RequestTokenCallback callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); ui_thread_task_runner_->PostTask( FROM_HERE, - base::Bind(&GCMInvalidationBridge::RequestToken, bridge_, callback)); + base::BindOnce(&GCMInvalidationBridge::RequestToken, bridge_, callback)); } void GCMInvalidationBridge::Core::InvalidateToken(const std::string& token) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); ui_thread_task_runner_->PostTask( FROM_HERE, - base::Bind(&GCMInvalidationBridge::InvalidateToken, bridge_, token)); + base::BindOnce(&GCMInvalidationBridge::InvalidateToken, bridge_, token)); } void GCMInvalidationBridge::Core::Register(RegisterCallback callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); ui_thread_task_runner_->PostTask( FROM_HERE, - base::Bind(&GCMInvalidationBridge::Register, bridge_, callback)); + base::BindOnce(&GCMInvalidationBridge::Register, bridge_, callback)); } void GCMInvalidationBridge::Core::SetMessageReceiver(MessageCallback callback) { message_callback_ = callback; ui_thread_task_runner_->PostTask( FROM_HERE, - base::Bind(&GCMInvalidationBridge::SubscribeForIncomingMessages, - bridge_)); + base::BindOnce(&GCMInvalidationBridge::SubscribeForIncomingMessages, + bridge_)); } void GCMInvalidationBridge::Core::RequestTokenFinished( @@ -209,11 +207,8 @@ std::string access_token; core_thread_task_runner_->PostTask( FROM_HERE, - base::Bind(&GCMInvalidationBridge::Core::RequestTokenFinished, - core_, - request_token_callback_, - error, - access_token)); + base::BindOnce(&GCMInvalidationBridge::Core::RequestTokenFinished, + core_, request_token_callback_, error, access_token)); } request_token_callback_ = callback; OAuth2TokenService::ScopeSet scopes; @@ -230,8 +225,8 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); core_thread_task_runner_->PostTask( FROM_HERE, - base::Bind(&GCMInvalidationBridge::Core::RequestTokenFinished, core_, - request_token_callback_, error, access_token)); + base::BindOnce(&GCMInvalidationBridge::Core::RequestTokenFinished, core_, + request_token_callback_, error, access_token)); request_token_callback_.Reset(); access_token_fetcher_.reset(); } @@ -265,12 +260,8 @@ gcm::GCMClient::Result result) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); core_thread_task_runner_->PostTask( - FROM_HERE, - base::Bind(&GCMInvalidationBridge::Core::RegisterFinished, - core_, - callback, - registration_id, - result)); + FROM_HERE, base::BindOnce(&GCMInvalidationBridge::Core::RegisterFinished, + core_, callback, registration_id, result)); } void GCMInvalidationBridge::Unregister() { @@ -292,9 +283,8 @@ gcm_driver_->AddConnectionObserver(this); core_thread_task_runner_->PostTask( FROM_HERE, - base::Bind(&GCMInvalidationBridge::Core::OnConnectionStateChanged, - core_, - gcm_driver_->IsConnected())); + base::BindOnce(&GCMInvalidationBridge::Core::OnConnectionStateChanged, + core_, gcm_driver_->IsConnected())); subscribed_for_incoming_messages_ = true; } @@ -305,7 +295,8 @@ void GCMInvalidationBridge::OnStoreReset() { core_thread_task_runner_->PostTask( - FROM_HERE, base::Bind(&GCMInvalidationBridge::Core::OnStoreReset, core_)); + FROM_HERE, + base::BindOnce(&GCMInvalidationBridge::Core::OnStoreReset, core_)); } void GCMInvalidationBridge::OnMessage(const std::string& app_id, @@ -321,11 +312,8 @@ echo_token = it->second; core_thread_task_runner_->PostTask( - FROM_HERE, - base::Bind(&GCMInvalidationBridge::Core::OnIncomingMessage, - core_, - content, - echo_token)); + FROM_HERE, base::BindOnce(&GCMInvalidationBridge::Core::OnIncomingMessage, + core_, content, echo_token)); } void GCMInvalidationBridge::OnMessagesDeleted(const std::string& app_id) { @@ -351,16 +339,15 @@ void GCMInvalidationBridge::OnConnected(const net::IPEndPoint& ip_endpoint) { core_thread_task_runner_->PostTask( FROM_HERE, - base::Bind( - &GCMInvalidationBridge::Core::OnConnectionStateChanged, core_, true)); + base::BindOnce(&GCMInvalidationBridge::Core::OnConnectionStateChanged, + core_, true)); } void GCMInvalidationBridge::OnDisconnected() { core_thread_task_runner_->PostTask( FROM_HERE, - base::Bind(&GCMInvalidationBridge::Core::OnConnectionStateChanged, - core_, - false)); + base::BindOnce(&GCMInvalidationBridge::Core::OnConnectionStateChanged, + core_, false)); } } // namespace invalidation
diff --git a/components/invalidation/impl/gcm_invalidation_bridge_unittest.cc b/components/invalidation/impl/gcm_invalidation_bridge_unittest.cc index 08e94d0a..40ce4a4 100644 --- a/components/invalidation/impl/gcm_invalidation_bridge_unittest.cc +++ b/components/invalidation/impl/gcm_invalidation_bridge_unittest.cc
@@ -37,10 +37,10 @@ void RegisterImpl(const std::string& app_id, const std::vector<std::string>& sender_ids) override { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(&CustomFakeGCMDriver::RegisterFinished, - base::Unretained(this), app_id, - std::string("registration.id"), gcm::GCMClient::SUCCESS)); + FROM_HERE, base::BindOnce(&CustomFakeGCMDriver::RegisterFinished, + base::Unretained(this), app_id, + std::string("registration.id"), + gcm::GCMClient::SUCCESS)); } private:
diff --git a/components/invalidation/impl/gcm_network_channel.cc b/components/invalidation/impl/gcm_network_channel.cc index 7137da9..01924ce 100644 --- a/components/invalidation/impl/gcm_network_channel.cc +++ b/components/invalidation/impl/gcm_network_channel.cc
@@ -162,8 +162,9 @@ case gcm::GCMClient::UNKNOWN_ERROR: { register_backoff_entry_->InformOfRequest(false); base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, base::Bind(&GCMNetworkChannel::Register, - weak_factory_.GetWeakPtr()), + FROM_HERE, + base::BindOnce(&GCMNetworkChannel::Register, + weak_factory_.GetWeakPtr()), register_backoff_entry_->GetTimeUntilRelease()); break; }
diff --git a/components/invalidation/impl/non_blocking_invalidator.cc b/components/invalidation/impl/non_blocking_invalidator.cc index def0460..c800d42d 100644 --- a/components/invalidation/impl/non_blocking_invalidator.cc +++ b/components/invalidation/impl/non_blocking_invalidator.cc
@@ -199,19 +199,16 @@ DCHECK(network_task_runner_->BelongsToCurrentThread()); delegate_observer_task_runner_->PostTask( FROM_HERE, - base::Bind(&NonBlockingInvalidator::OnInvalidatorStateChange, - delegate_observer_, - reason)); + base::BindOnce(&NonBlockingInvalidator::OnInvalidatorStateChange, + delegate_observer_, reason)); } void NonBlockingInvalidator::Core::OnIncomingInvalidation( const ObjectIdInvalidationMap& invalidation_map) { DCHECK(network_task_runner_->BelongsToCurrentThread()); delegate_observer_task_runner_->PostTask( - FROM_HERE, - base::Bind(&NonBlockingInvalidator::OnIncomingInvalidation, - delegate_observer_, - invalidation_map)); + FROM_HERE, base::BindOnce(&NonBlockingInvalidator::OnIncomingInvalidation, + delegate_observer_, invalidation_map)); } std::string NonBlockingInvalidator::Core::GetOwnerName() const { @@ -242,11 +239,8 @@ base::ThreadTaskRunnerHandle::Get(), client_info, request_context_getter); if (!network_task_runner_->PostTask( - FROM_HERE, - base::Bind( - &NonBlockingInvalidator::Core::Initialize, - core_, - initialize_options))) { + FROM_HERE, base::BindOnce(&NonBlockingInvalidator::Core::Initialize, + core_, initialize_options))) { NOTREACHED(); } } @@ -255,8 +249,7 @@ DCHECK(parent_task_runner_->BelongsToCurrentThread()); if (!network_task_runner_->PostTask( FROM_HERE, - base::Bind(&NonBlockingInvalidator::Core::Teardown, - core_))) { + base::BindOnce(&NonBlockingInvalidator::Core::Teardown, core_))) { DVLOG(1) << "Network thread stopped before invalidator is destroyed."; } } @@ -273,10 +266,8 @@ return false; if (!network_task_runner_->PostTask( FROM_HERE, - base::Bind( - &NonBlockingInvalidator::Core::UpdateRegisteredIds, - core_, - registrar_.GetAllRegisteredIds()))) { + base::BindOnce(&NonBlockingInvalidator::Core::UpdateRegisteredIds, + core_, registrar_.GetAllRegisteredIds()))) { NOTREACHED(); } return true; @@ -297,8 +288,8 @@ DCHECK(parent_task_runner_->BelongsToCurrentThread()); if (!network_task_runner_->PostTask( FROM_HERE, - base::Bind(&NonBlockingInvalidator::Core::UpdateCredentials, - core_, email, token))) { + base::BindOnce(&NonBlockingInvalidator::Core::UpdateCredentials, + core_, email, token))) { NOTREACHED(); } } @@ -310,9 +301,8 @@ base::Bind(&CallbackProxy::Run, base::Owned(new CallbackProxy(callback))); if (!network_task_runner_->PostTask( FROM_HERE, - base::Bind(&NonBlockingInvalidator::Core::RequestDetailedStatus, - core_, - proxy_callback))) { + base::BindOnce(&NonBlockingInvalidator::Core::RequestDetailedStatus, + core_, proxy_callback))) { NOTREACHED(); } }
diff --git a/components/invalidation/impl/sync_invalidation_listener.cc b/components/invalidation/impl/sync_invalidation_listener.cc index 84229a9..deff38b 100644 --- a/components/invalidation/impl/sync_invalidation_listener.cc +++ b/components/invalidation/impl/sync_invalidation_listener.cc
@@ -215,9 +215,8 @@ invalidation_state_tracker_task_runner_->PostTask( FROM_HERE, - base::Bind(&InvalidationStateTracker::SetSavedInvalidations, - invalidation_state_tracker_, - unacked_invalidations_map_)); + base::BindOnce(&InvalidationStateTracker::SetSavedInvalidations, + invalidation_state_tracker_, unacked_invalidations_map_)); } void SyncInvalidationListener::EmitSavedInvalidations( @@ -308,9 +307,8 @@ lookup->second.Acknowledge(handle); invalidation_state_tracker_task_runner_->PostTask( FROM_HERE, - base::Bind(&InvalidationStateTracker::SetSavedInvalidations, - invalidation_state_tracker_, - unacked_invalidations_map_)); + base::BindOnce(&InvalidationStateTracker::SetSavedInvalidations, + invalidation_state_tracker_, unacked_invalidations_map_)); } void SyncInvalidationListener::Drop( @@ -325,19 +323,16 @@ lookup->second.Drop(handle); invalidation_state_tracker_task_runner_->PostTask( FROM_HERE, - base::Bind(&InvalidationStateTracker::SetSavedInvalidations, - invalidation_state_tracker_, - unacked_invalidations_map_)); + base::BindOnce(&InvalidationStateTracker::SetSavedInvalidations, + invalidation_state_tracker_, unacked_invalidations_map_)); } void SyncInvalidationListener::WriteState(const std::string& state) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DVLOG(1) << "WriteState"; invalidation_state_tracker_task_runner_->PostTask( - FROM_HERE, - base::Bind(&InvalidationStateTracker::SetBootstrapData, - invalidation_state_tracker_, - state)); + FROM_HERE, base::BindOnce(&InvalidationStateTracker::SetBootstrapData, + invalidation_state_tracker_, state)); } void SyncInvalidationListener::DoRegistrationUpdate() { @@ -350,9 +345,8 @@ } invalidation_state_tracker_task_runner_->PostTask( FROM_HERE, - base::Bind(&InvalidationStateTracker::SetSavedInvalidations, - invalidation_state_tracker_, - unacked_invalidations_map_)); + base::BindOnce(&InvalidationStateTracker::SetSavedInvalidations, + invalidation_state_tracker_, unacked_invalidations_map_)); ObjectIdInvalidationMap object_id_invalidation_map; for (UnackedInvalidationsMap::iterator map_it =
diff --git a/components/invalidation/impl/sync_system_resources.cc b/components/invalidation/impl/sync_system_resources.cc index cf24cb896..700f90f 100644 --- a/components/invalidation/impl/sync_system_resources.cc +++ b/components/invalidation/impl/sync_system_resources.cc
@@ -110,8 +110,9 @@ posted_tasks_.insert(base::WrapUnique(task)); base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, base::Bind(&SyncInvalidationScheduler::RunPostedTask, - weak_factory_.GetWeakPtr(), task), + FROM_HERE, + base::BindOnce(&SyncInvalidationScheduler::RunPostedTask, + weak_factory_.GetWeakPtr(), task), delay); }
diff --git a/components/invalidation/impl/ticl_invalidation_service.cc b/components/invalidation/impl/ticl_invalidation_service.cc index 03b9d445..3fda079 100644 --- a/components/invalidation/impl/ticl_invalidation_service.cc +++ b/components/invalidation/impl/ticl_invalidation_service.cc
@@ -231,10 +231,9 @@ // Transient error. Retry after some time. request_access_token_backoff_.InformOfRequest(false); request_access_token_retry_timer_.Start( - FROM_HERE, - request_access_token_backoff_.GetTimeUntilRelease(), - base::Bind(&TiclInvalidationService::RequestAccessToken, - base::Unretained(this))); + FROM_HERE, request_access_token_backoff_.GetTimeUntilRelease(), + base::BindOnce(&TiclInvalidationService::RequestAccessToken, + base::Unretained(this))); break; } case GoogleServiceAuthError::SERVICE_ERROR:
diff --git a/components/invalidation/public/invalidation.cc b/components/invalidation/public/invalidation.cc index b1674de..78a665d 100644 --- a/components/invalidation/public/invalidation.cc +++ b/components/invalidation/public/invalidation.cc
@@ -120,8 +120,8 @@ void Invalidation::Acknowledge() const { if (SupportsAcknowledgement()) { ack_handler_task_runner_->PostTask( - FROM_HERE, - base::Bind(&AckHandler::Acknowledge, ack_handler_, id_, ack_handle_)); + FROM_HERE, base::BindOnce(&AckHandler::Acknowledge, ack_handler_, id_, + ack_handle_)); } } @@ -129,7 +129,7 @@ if (SupportsAcknowledgement()) { ack_handler_task_runner_->PostTask( FROM_HERE, - base::Bind(&AckHandler::Drop, ack_handler_, id_, ack_handle_)); + base::BindOnce(&AckHandler::Drop, ack_handler_, id_, ack_handle_)); } }
diff --git a/components/leveldb_proto/proto_database_impl.h b/components/leveldb_proto/proto_database_impl.h index a96ec1fa..ddacbe4 100644 --- a/components/leveldb_proto/proto_database_impl.h +++ b/components/leveldb_proto/proto_database_impl.h
@@ -288,8 +288,8 @@ bool* success = new bool(false); task_runner_->PostTaskAndReply( FROM_HERE, - base::Bind(InitFromTaskRunner, base::Unretained(db_.get()), database_dir, - options, success), + base::BindOnce(InitFromTaskRunner, base::Unretained(db_.get()), + database_dir, options, success), base::BindOnce(RunInitCallback<T>, std::move(callback), base::Owned(success))); }
diff --git a/components/leveldb_proto/proto_database_impl_unittest.cc b/components/leveldb_proto/proto_database_impl_unittest.cc index 4b03fb45..9fd1a2eb 100644 --- a/components/leveldb_proto/proto_database_impl_unittest.cc +++ b/components/leveldb_proto/proto_database_impl_unittest.cc
@@ -185,9 +185,9 @@ MockDatabaseCaller caller; EXPECT_CALL(caller, InitCallback(true)); - db_->InitWithDatabase( - base::WrapUnique(mock_db), path, CreateSimpleOptions(), - base::Bind(&MockDatabaseCaller::InitCallback, base::Unretained(&caller))); + db_->InitWithDatabase(base::WrapUnique(mock_db), path, CreateSimpleOptions(), + base::BindOnce(&MockDatabaseCaller::InitCallback, + base::Unretained(&caller))); base::RunLoop().RunUntilIdle(); } @@ -203,9 +203,9 @@ MockDatabaseCaller caller; EXPECT_CALL(caller, InitCallback(false)); - db_->InitWithDatabase( - base::WrapUnique(mock_db), path, options, - base::Bind(&MockDatabaseCaller::InitCallback, base::Unretained(&caller))); + db_->InitWithDatabase(base::WrapUnique(mock_db), path, options, + base::BindOnce(&MockDatabaseCaller::InitCallback, + base::Unretained(&caller))); base::RunLoop().RunUntilIdle(); } @@ -219,13 +219,13 @@ MockDatabaseCaller caller; EXPECT_CALL(caller, InitCallback(true)); - db_->InitWithDatabase( - base::WrapUnique(mock_db), path, CreateSimpleOptions(), - base::Bind(&MockDatabaseCaller::InitCallback, base::Unretained(&caller))); + db_->InitWithDatabase(base::WrapUnique(mock_db), path, CreateSimpleOptions(), + base::BindOnce(&MockDatabaseCaller::InitCallback, + base::Unretained(&caller))); EXPECT_CALL(caller, DestroyCallback(true)); - db_->Destroy(base::Bind(&MockDatabaseCaller::DestroyCallback, - base::Unretained(&caller))); + db_->Destroy(base::BindOnce(&MockDatabaseCaller::DestroyCallback, + base::Unretained(&caller))); EXPECT_CALL(*mock_db, Destroy()).WillOnce(Return(true)); base::RunLoop().RunUntilIdle(); @@ -240,13 +240,13 @@ MockDatabaseCaller caller; EXPECT_CALL(caller, InitCallback(true)); - db_->InitWithDatabase( - base::WrapUnique(mock_db), path, CreateSimpleOptions(), - base::Bind(&MockDatabaseCaller::InitCallback, base::Unretained(&caller))); + db_->InitWithDatabase(base::WrapUnique(mock_db), path, CreateSimpleOptions(), + base::BindOnce(&MockDatabaseCaller::InitCallback, + base::Unretained(&caller))); EXPECT_CALL(caller, DestroyCallback(false)); - db_->Destroy(base::Bind(&MockDatabaseCaller::DestroyCallback, - base::Unretained(&caller))); + db_->Destroy(base::BindOnce(&MockDatabaseCaller::DestroyCallback, + base::Unretained(&caller))); EXPECT_CALL(*mock_db, Destroy()).WillOnce(Return(false)); base::RunLoop().RunUntilIdle(); @@ -278,16 +278,16 @@ EXPECT_CALL(*mock_db, Init(_, options_)); EXPECT_CALL(caller, InitCallback(_)); - db_->InitWithDatabase( - base::WrapUnique(mock_db), path, CreateSimpleOptions(), - base::Bind(&MockDatabaseCaller::InitCallback, base::Unretained(&caller))); + db_->InitWithDatabase(base::WrapUnique(mock_db), path, CreateSimpleOptions(), + base::BindOnce(&MockDatabaseCaller::InitCallback, + base::Unretained(&caller))); EXPECT_CALL(*mock_db, LoadWithFilter(_, _)) .WillOnce(AppendLoadEntries(model)); EXPECT_CALL(caller, LoadCallback1(true, _)) .WillOnce(VerifyLoadEntries(testing::ByRef(model))); - db_->LoadEntries( - base::Bind(&MockDatabaseCaller::LoadCallback, base::Unretained(&caller))); + db_->LoadEntries(base::BindOnce(&MockDatabaseCaller::LoadCallback, + base::Unretained(&caller))); base::RunLoop().RunUntilIdle(); } @@ -300,14 +300,14 @@ EXPECT_CALL(*mock_db, Init(_, options_)); EXPECT_CALL(caller, InitCallback(_)); - db_->InitWithDatabase( - base::WrapUnique(mock_db), path, CreateSimpleOptions(), - base::Bind(&MockDatabaseCaller::InitCallback, base::Unretained(&caller))); + db_->InitWithDatabase(base::WrapUnique(mock_db), path, CreateSimpleOptions(), + base::BindOnce(&MockDatabaseCaller::InitCallback, + base::Unretained(&caller))); EXPECT_CALL(*mock_db, LoadWithFilter(_, _)).WillOnce(Return(false)); EXPECT_CALL(caller, LoadCallback1(false, _)); - db_->LoadEntries( - base::Bind(&MockDatabaseCaller::LoadCallback, base::Unretained(&caller))); + db_->LoadEntries(base::BindOnce(&MockDatabaseCaller::LoadCallback, + base::Unretained(&caller))); base::RunLoop().RunUntilIdle(); } @@ -340,17 +340,17 @@ EXPECT_CALL(*mock_db, Init(_, options_)); EXPECT_CALL(caller, InitCallback(_)); - db_->InitWithDatabase( - base::WrapUnique(mock_db), path, CreateSimpleOptions(), - base::Bind(&MockDatabaseCaller::InitCallback, base::Unretained(&caller))); + db_->InitWithDatabase(base::WrapUnique(mock_db), path, CreateSimpleOptions(), + base::BindOnce(&MockDatabaseCaller::InitCallback, + base::Unretained(&caller))); std::string key("1"); ASSERT_TRUE(model.count(key)); EXPECT_CALL(*mock_db, Get(key, _, _)).WillOnce(SetGetEntry(model)); EXPECT_CALL(caller, GetCallback1(true, _)) .WillOnce(VerifyGetEntry(model[key])); - db_->GetEntry(key, base::Bind(&MockDatabaseCaller::GetCallback, - base::Unretained(&caller))); + db_->GetEntry(key, base::BindOnce(&MockDatabaseCaller::GetCallback, + base::Unretained(&caller))); base::RunLoop().RunUntilIdle(); } @@ -426,16 +426,16 @@ EXPECT_CALL(*mock_db, Init(_, options_)); EXPECT_CALL(caller, InitCallback(_)); - db_->InitWithDatabase( - base::WrapUnique(mock_db), path, CreateSimpleOptions(), - base::Bind(&MockDatabaseCaller::InitCallback, base::Unretained(&caller))); + db_->InitWithDatabase(base::WrapUnique(mock_db), path, CreateSimpleOptions(), + base::BindOnce(&MockDatabaseCaller::InitCallback, + base::Unretained(&caller))); std::string key("does_not_exist"); ASSERT_FALSE(model.count(key)); EXPECT_CALL(*mock_db, Get(key, _, _)).WillOnce(SetGetEntry(model)); EXPECT_CALL(caller, GetCallback1(true, nullptr)); - db_->GetEntry(key, base::Bind(&MockDatabaseCaller::GetCallback, - base::Unretained(&caller))); + db_->GetEntry(key, base::BindOnce(&MockDatabaseCaller::GetCallback, + base::Unretained(&caller))); base::RunLoop().RunUntilIdle(); } @@ -449,16 +449,16 @@ EXPECT_CALL(*mock_db, Init(_, options_)); EXPECT_CALL(caller, InitCallback(_)); - db_->InitWithDatabase( - base::WrapUnique(mock_db), path, CreateSimpleOptions(), - base::Bind(&MockDatabaseCaller::InitCallback, base::Unretained(&caller))); + db_->InitWithDatabase(base::WrapUnique(mock_db), path, CreateSimpleOptions(), + base::BindOnce(&MockDatabaseCaller::InitCallback, + base::Unretained(&caller))); std::string key("does_not_exist"); ASSERT_FALSE(model.count(key)); EXPECT_CALL(*mock_db, Get(key, _, _)).WillOnce(Return(false)); EXPECT_CALL(caller, GetCallback1(false, nullptr)); - db_->GetEntry(key, base::Bind(&MockDatabaseCaller::GetCallback, - base::Unretained(&caller))); + db_->GetEntry(key, base::BindOnce(&MockDatabaseCaller::GetCallback, + base::Unretained(&caller))); base::RunLoop().RunUntilIdle(); } @@ -494,9 +494,9 @@ EXPECT_CALL(*mock_db, Init(_, options_)); EXPECT_CALL(caller, InitCallback(_)); - db_->InitWithDatabase( - base::WrapUnique(mock_db), path, CreateSimpleOptions(), - base::Bind(&MockDatabaseCaller::InitCallback, base::Unretained(&caller))); + db_->InitWithDatabase(base::WrapUnique(mock_db), path, CreateSimpleOptions(), + base::BindOnce(&MockDatabaseCaller::InitCallback, + base::Unretained(&caller))); std::unique_ptr<ProtoDatabase<TestProto>::KeyEntryVector> entries( new ProtoDatabase<TestProto>::KeyEntryVector()); @@ -507,9 +507,9 @@ EXPECT_CALL(*mock_db, Save(_, _)).WillOnce(VerifyUpdateEntries(model)); EXPECT_CALL(caller, SaveCallback(true)); - db_->UpdateEntries( - std::move(entries), std::move(keys_to_remove), - base::Bind(&MockDatabaseCaller::SaveCallback, base::Unretained(&caller))); + db_->UpdateEntries(std::move(entries), std::move(keys_to_remove), + base::BindOnce(&MockDatabaseCaller::SaveCallback, + base::Unretained(&caller))); base::RunLoop().RunUntilIdle(); } @@ -525,15 +525,15 @@ EXPECT_CALL(*mock_db, Init(_, options_)); EXPECT_CALL(caller, InitCallback(_)); - db_->InitWithDatabase( - base::WrapUnique(mock_db), path, CreateSimpleOptions(), - base::Bind(&MockDatabaseCaller::InitCallback, base::Unretained(&caller))); + db_->InitWithDatabase(base::WrapUnique(mock_db), path, CreateSimpleOptions(), + base::BindOnce(&MockDatabaseCaller::InitCallback, + base::Unretained(&caller))); EXPECT_CALL(*mock_db, Save(_, _)).WillOnce(Return(false)); EXPECT_CALL(caller, SaveCallback(false)); - db_->UpdateEntries( - std::move(entries), std::move(keys_to_remove), - base::Bind(&MockDatabaseCaller::SaveCallback, base::Unretained(&caller))); + db_->UpdateEntries(std::move(entries), std::move(keys_to_remove), + base::BindOnce(&MockDatabaseCaller::SaveCallback, + base::Unretained(&caller))); base::RunLoop().RunUntilIdle(); } @@ -550,9 +550,9 @@ EXPECT_CALL(*mock_db, Init(_, options_)); EXPECT_CALL(caller, InitCallback(_)); - db_->InitWithDatabase( - base::WrapUnique(mock_db), path, CreateSimpleOptions(), - base::Bind(&MockDatabaseCaller::InitCallback, base::Unretained(&caller))); + db_->InitWithDatabase(base::WrapUnique(mock_db), path, CreateSimpleOptions(), + base::BindOnce(&MockDatabaseCaller::InitCallback, + base::Unretained(&caller))); std::unique_ptr<ProtoDatabase<TestProto>::KeyEntryVector> entries( new ProtoDatabase<TestProto>::KeyEntryVector()); @@ -563,9 +563,9 @@ KeyVector keys_copy(*keys_to_remove.get()); EXPECT_CALL(*mock_db, Save(_, keys_copy)).WillOnce(Return(true)); EXPECT_CALL(caller, SaveCallback(true)); - db_->UpdateEntries( - std::move(entries), std::move(keys_to_remove), - base::Bind(&MockDatabaseCaller::SaveCallback, base::Unretained(&caller))); + db_->UpdateEntries(std::move(entries), std::move(keys_to_remove), + base::BindOnce(&MockDatabaseCaller::SaveCallback, + base::Unretained(&caller))); base::RunLoop().RunUntilIdle(); } @@ -581,15 +581,15 @@ EXPECT_CALL(*mock_db, Init(_, options_)); EXPECT_CALL(caller, InitCallback(_)); - db_->InitWithDatabase( - base::WrapUnique(mock_db), path, CreateSimpleOptions(), - base::Bind(&MockDatabaseCaller::InitCallback, base::Unretained(&caller))); + db_->InitWithDatabase(base::WrapUnique(mock_db), path, CreateSimpleOptions(), + base::BindOnce(&MockDatabaseCaller::InitCallback, + base::Unretained(&caller))); EXPECT_CALL(*mock_db, Save(_, _)).WillOnce(Return(false)); EXPECT_CALL(caller, SaveCallback(false)); - db_->UpdateEntries( - std::move(entries), std::move(keys_to_remove), - base::Bind(&MockDatabaseCaller::SaveCallback, base::Unretained(&caller))); + db_->UpdateEntries(std::move(entries), std::move(keys_to_remove), + base::BindOnce(&MockDatabaseCaller::SaveCallback, + base::Unretained(&caller))); base::RunLoop().RunUntilIdle(); } @@ -610,9 +610,9 @@ MockDatabaseCaller caller; EXPECT_CALL(caller, InitCallback(_)); - db->Init( - kTestLevelDBClientName, temp_dir.GetPath(), CreateSimpleOptions(), - base::Bind(&MockDatabaseCaller::InitCallback, base::Unretained(&caller))); + db->Init(kTestLevelDBClientName, temp_dir.GetPath(), CreateSimpleOptions(), + base::BindOnce(&MockDatabaseCaller::InitCallback, + base::Unretained(&caller))); db.reset(); @@ -638,13 +638,13 @@ MockDatabaseCaller caller; EXPECT_CALL(caller, InitCallback(_)); - db->Init( - kTestLevelDBClientName, temp_dir.GetPath(), CreateSimpleOptions(), - base::Bind(&MockDatabaseCaller::InitCallback, base::Unretained(&caller))); + db->Init(kTestLevelDBClientName, temp_dir.GetPath(), CreateSimpleOptions(), + base::BindOnce(&MockDatabaseCaller::InitCallback, + base::Unretained(&caller))); EXPECT_CALL(caller, DestroyCallback(_)); - db->Destroy(base::Bind(&MockDatabaseCaller::DestroyCallback, - base::Unretained(&caller))); + db->Destroy(base::BindOnce(&MockDatabaseCaller::DestroyCallback, + base::Unretained(&caller))); db.reset();
diff --git a/components/metrics/file_metrics_provider.cc b/components/metrics/file_metrics_provider.cc index 189d673..e44fd3bc 100644 --- a/components/metrics/file_metrics_provider.cc +++ b/components/metrics/file_metrics_provider.cc
@@ -629,10 +629,11 @@ std::swap(sources_to_check_, *check_list); task_runner_->PostTaskAndReply( FROM_HERE, - base::Bind(&FileMetricsProvider::CheckAndMergeMetricSourcesOnTaskRunner, - base::Unretained(check_list)), - base::Bind(&FileMetricsProvider::RecordSourcesChecked, - weak_factory_.GetWeakPtr(), base::Owned(check_list))); + base::BindOnce( + &FileMetricsProvider::CheckAndMergeMetricSourcesOnTaskRunner, + base::Unretained(check_list)), + base::BindOnce(&FileMetricsProvider::RecordSourcesChecked, + weak_factory_.GetWeakPtr(), base::Owned(check_list))); } void FileMetricsProvider::RecordSourcesChecked(SourceInfoList* checked) { @@ -673,7 +674,8 @@ } void FileMetricsProvider::DeleteFileAsync(const base::FilePath& path) { - task_runner_->PostTask(FROM_HERE, base::Bind(DeleteFileWhenPossible, path)); + task_runner_->PostTask(FROM_HERE, + base::BindOnce(DeleteFileWhenPossible, path)); } void FileMetricsProvider::RecordSourceAsRead(SourceInfo* source) {
diff --git a/components/metrics/metrics_service.cc b/components/metrics/metrics_service.cc index b800b64..bfa17fe 100644 --- a/components/metrics/metrics_service.cc +++ b/components/metrics/metrics_service.cc
@@ -607,14 +607,14 @@ base::SequencedTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::Bind(&MetricsService::StartInitTask, - self_ptr_factory_.GetWeakPtr()), + base::BindOnce(&MetricsService::StartInitTask, + self_ptr_factory_.GetWeakPtr()), base::TimeDelta::FromSeconds(kInitializationDelaySeconds)); base::SequencedTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::Bind(&MetricsService::PrepareProviderMetricsTask, - self_ptr_factory_.GetWeakPtr()), + base::BindOnce(&MetricsService::PrepareProviderMetricsTask, + self_ptr_factory_.GetWeakPtr()), base::TimeDelta::FromSeconds(2 * kInitializationDelaySeconds)); } } @@ -895,8 +895,8 @@ : base::TimeDelta::FromMinutes(15); base::SequencedTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::Bind(&MetricsService::PrepareProviderMetricsTask, - self_ptr_factory_.GetWeakPtr()), + base::BindOnce(&MetricsService::PrepareProviderMetricsTask, + self_ptr_factory_.GetWeakPtr()), next_check); }
diff --git a/components/metrics/net/network_metrics_provider.cc b/components/metrics/net/network_metrics_provider.cc index 0e345db9..32baa60 100644 --- a/components/metrics/net/network_metrics_provider.cc +++ b/components/metrics/net/network_metrics_provider.cc
@@ -94,7 +94,7 @@ void OnEffectiveConnectionTypeChanged( net::EffectiveConnectionType type) override { DCHECK(thread_checker_.CalledOnValidThread()); - callback_task_runner_->PostTask(FROM_HERE, base::Bind(callback_, type)); + callback_task_runner_->PostTask(FROM_HERE, base::BindOnce(callback_, type)); } // Notifies |this| when there is a change in the effective connection type.
diff --git a/components/metrics/single_sample_metrics_factory_impl_unittest.cc b/components/metrics/single_sample_metrics_factory_impl_unittest.cc index cec7c86..7362085 100644 --- a/components/metrics/single_sample_metrics_factory_impl_unittest.cc +++ b/components/metrics/single_sample_metrics_factory_impl_unittest.cc
@@ -45,8 +45,9 @@ void ShutdownThread() { thread_.task_runner()->PostTask( FROM_HERE, - base::Bind(&SingleSampleMetricsFactoryImpl::DestroyProviderForTesting, - base::Unretained(factory_))); + base::BindOnce( + &SingleSampleMetricsFactoryImpl::DestroyProviderForTesting, + base::Unretained(factory_))); thread_.Stop(); } @@ -60,8 +61,9 @@ base::RunLoop run_loop; thread_.task_runner()->PostTaskAndReply( FROM_HERE, - base::Bind(&SingleSampleMetricsFactoryImplTest::CreateAndStoreMetric, - base::Unretained(this), &metric), + base::BindOnce( + &SingleSampleMetricsFactoryImplTest::CreateAndStoreMetric, + base::Unretained(this), &metric), run_loop.QuitClosure()); run_loop.Run(); return metric; @@ -163,8 +165,8 @@ base::RunLoop run_loop; thread_.task_runner()->PostTaskAndReply( FROM_HERE, - base::Bind(&base::SingleSampleMetric::SetSample, - base::Unretained(threaded_metric.get()), kSample), + base::BindOnce(&base::SingleSampleMetric::SetSample, + base::Unretained(threaded_metric.get()), kSample), run_loop.QuitClosure()); run_loop.Run(); }
diff --git a/components/nacl/browser/nacl_broker_host_win.cc b/components/nacl/browser/nacl_broker_host_win.cc index fd6e1d1e..3f36568 100644 --- a/components/nacl/browser/nacl_broker_host_win.cc +++ b/components/nacl/browser/nacl_broker_host_win.cc
@@ -103,7 +103,7 @@ int32_t pid, base::ProcessHandle process_handle, const std::string& startup_info) { - base::ProcessHandle broker_process = process_->GetData().handle; + base::ProcessHandle broker_process = process_->GetData().GetHandle(); base::ProcessHandle handle_in_broker_process; if (!DuplicateHandle(::GetCurrentProcess(), process_handle, broker_process, &handle_in_broker_process,
diff --git a/components/nacl/browser/nacl_browser.cc b/components/nacl/browser/nacl_browser.cc index cad5b43..b262ab0 100644 --- a/components/nacl/browser/nacl_browser.cc +++ b/components/nacl/browser/nacl_browser.cc
@@ -287,8 +287,8 @@ base::FileProxy* proxy = file_proxy.get(); if (!proxy->CreateOrOpen( irt_filepath_, base::File::FLAG_OPEN | base::File::FLAG_READ, - base::Bind(&NaClBrowser::OnIrtOpened, base::Unretained(this), - base::Passed(&file_proxy)))) { + base::BindOnce(&NaClBrowser::OnIrtOpened, base::Unretained(this), + std::move(file_proxy)))) { LOG(ERROR) << "Internal error, NaCl disabled."; MarkAsFailed(); } @@ -317,9 +317,8 @@ if (port != kGdbDebugStubPortUnknown && !debug_stub_port_listener_.is_null()) { content::BrowserThread::PostTask( - content::BrowserThread::IO, - FROM_HERE, - base::Bind(debug_stub_port_listener_, port)); + content::BrowserThread::IO, FROM_HERE, + base::BindOnce(debug_stub_port_listener_, port)); } } @@ -377,9 +376,9 @@ // response. base::PostTaskWithTraitsAndReply( FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT}, - base::Bind(ReadCache, validation_cache_file_path_, data), - base::Bind(&NaClBrowser::OnValidationCacheLoaded, - base::Unretained(this), base::Owned(data))); + base::BindOnce(ReadCache, validation_cache_file_path_, data), + base::BindOnce(&NaClBrowser::OnValidationCacheLoaded, + base::Unretained(this), base::Owned(data))); } else { RunWithoutValidationCache(); } @@ -538,7 +537,7 @@ // invoking the callback to meet the implicit guarantees of the UI. file_task_runner_->PostTask( FROM_HERE, - base::Bind(RemoveCache, validation_cache_file_path_, callback)); + base::BindOnce(RemoveCache, validation_cache_file_path_, callback)); } // Make sure any delayed tasks to persist the cache to the filesystem are @@ -559,8 +558,9 @@ // Wait before persisting to disk. This can coalesce multiple cache // modifications info a single disk write. base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, base::Bind(&NaClBrowser::PersistValidationCache, - base::Unretained(this)), + FROM_HERE, + base::BindOnce(&NaClBrowser::PersistValidationCache, + base::Unretained(this)), base::TimeDelta::FromMilliseconds(kValidationCacheCoalescingTimeMS)); validation_cache_is_modified_ = true; } @@ -581,8 +581,8 @@ // because it can degrade the responsiveness of the browser. // The task is sequenced so that multiple writes happen in order. file_task_runner_->PostTask( - FROM_HERE, base::Bind(WriteCache, validation_cache_file_path_, - base::Owned(pickle))); + FROM_HERE, base::BindOnce(WriteCache, validation_cache_file_path_, + base::Owned(pickle))); } validation_cache_is_modified_ = false; }
diff --git a/components/nacl/browser/nacl_file_host.cc b/components/nacl/browser/nacl_file_host.cc index e674a2e20..48ef63cb 100644 --- a/components/nacl/browser/nacl_file_host.cc +++ b/components/nacl/browser/nacl_file_host.cc
@@ -103,11 +103,11 @@ if (is_executable) { BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, - base::Bind(&DoRegisterOpenedNaClExecutableFile, - nacl_host_message_filter, Passed(std::move(file_to_open)), - full_filepath, reply_msg, - static_cast<WriteFileInfoReply>( - NaClHostMsg_GetReadonlyPnaclFD::WriteReplyParams))); + base::BindOnce(&DoRegisterOpenedNaClExecutableFile, + nacl_host_message_filter, std::move(file_to_open), + full_filepath, reply_msg, + static_cast<WriteFileInfoReply>( + NaClHostMsg_GetReadonlyPnaclFD::WriteReplyParams))); } else { IPC::PlatformFileForTransit target_desc = IPC::TakePlatformFileForTransit(std::move(file_to_open)); @@ -149,11 +149,11 @@ // registered in a structure owned by the IO thread. BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, - base::Bind(&DoRegisterOpenedNaClExecutableFile, - nacl_host_message_filter, Passed(std::move(file)), - file_path, reply_msg, - static_cast<WriteFileInfoReply>( - NaClHostMsg_OpenNaClExecutable::WriteReplyParams))); + base::BindOnce( + &DoRegisterOpenedNaClExecutableFile, nacl_host_message_filter, + std::move(file), file_path, reply_msg, + static_cast<WriteFileInfoReply>( + NaClHostMsg_OpenNaClExecutable::WriteReplyParams))); } else { IPC::PlatformFileForTransit file_desc = IPC::TakePlatformFileForTransit(std::move(file)); @@ -179,8 +179,8 @@ IPC::Message* reply_msg) { base::PostTaskWithTraits( FROM_HERE, {base::MayBlock()}, - base::Bind(&DoOpenPnaclFile, nacl_host_message_filter, filename, - is_executable, reply_msg)); + base::BindOnce(&DoOpenPnaclFile, nacl_host_message_filter, filename, + is_executable, reply_msg)); } // This function is security sensitive. Be sure to check with a security @@ -225,13 +225,9 @@ if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - base::Bind( - &OpenNaClExecutable, - nacl_host_message_filter, - render_view_id, - file_url, - enable_validation_caching, - reply_msg)); + base::BindOnce(&OpenNaClExecutable, nacl_host_message_filter, + render_view_id, file_url, enable_validation_caching, + reply_msg)); return; } @@ -260,8 +256,9 @@ // blocking pool thread. base::PostTaskWithTraits( FROM_HERE, {base::MayBlock()}, - base::Bind(&DoOpenNaClExecutableOnThreadPool, nacl_host_message_filter, - file_url, enable_validation_caching, reply_msg)); + base::BindOnce(&DoOpenNaClExecutableOnThreadPool, + nacl_host_message_filter, file_url, + enable_validation_caching, reply_msg)); } } // namespace nacl_file_host
diff --git a/components/nacl/browser/nacl_host_message_filter.cc b/components/nacl/browser/nacl_host_message_filter.cc index 603fdad6..19635b81 100644 --- a/components/nacl/browser/nacl_host_message_filter.cc +++ b/components/nacl/browser/nacl_host_message_filter.cc
@@ -133,12 +133,9 @@ return; } content::BrowserThread::PostTask( - content::BrowserThread::UI, - FROM_HERE, - base::Bind(&NaClHostMessageFilter::LaunchNaClContinuation, - this, - launch_params, - reply_msg)); + content::BrowserThread::UI, FROM_HERE, + base::BindOnce(&NaClHostMessageFilter::LaunchNaClContinuation, this, + launch_params, reply_msg)); } void NaClHostMessageFilter::LaunchNaClContinuation( @@ -190,8 +187,8 @@ FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_BLOCKING, base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}, - base::Bind(&NaClHostMessageFilter::BatchOpenResourceFiles, this, - safe_launch_params, reply_msg, permissions)); + base::BindOnce(&NaClHostMessageFilter::BatchOpenResourceFiles, this, + safe_launch_params, reply_msg, permissions)); } void NaClHostMessageFilter::BatchOpenResourceFiles( @@ -225,14 +222,10 @@ } content::BrowserThread::PostTask( - content::BrowserThread::IO, - FROM_HERE, - base::Bind(&NaClHostMessageFilter::LaunchNaClContinuationOnIOThread, - this, - launch_params, - reply_msg, - prefetched_resource_files, - permissions)); + content::BrowserThread::IO, FROM_HERE, + base::BindOnce(&NaClHostMessageFilter::LaunchNaClContinuationOnIOThread, + this, launch_params, reply_msg, prefetched_resource_files, + permissions)); } void NaClHostMessageFilter::LaunchNaClContinuationOnIOThread(
diff --git a/components/nacl/browser/nacl_process_host.cc b/components/nacl/browser/nacl_process_host.cc index c2423f4..844bf5a1 100644 --- a/components/nacl/browser/nacl_process_host.cc +++ b/components/nacl/browser/nacl_process_host.cc
@@ -250,7 +250,7 @@ NaClProcessHost::~NaClProcessHost() { // Report exit status only if the process was successfully started. - if (process_->GetData().handle != base::kNullProcessHandle) { + if (!process_->GetData().IsHandleValid()) { content::ChildProcessTerminationInfo info = process_->GetTerminationInfo(false /* known_dead */); std::string message = @@ -644,8 +644,7 @@ NaClLaunchResult(ppapi_channel_handle.release(), trusted_channel_handle.release(), manifest_service_channel_handle.release(), - base::GetProcId(data.handle), - data.id, + base::GetProcId(data.GetHandle()), data.id, crash_info_shmem_renderer_handle), error_message); @@ -764,7 +763,7 @@ if (uses_nonsfi_mode_) { // Currently, non-SFI mode is supported only on Linux. if (enable_nacl_debug) { - base::ProcessId pid = base::GetProcId(process_->GetData().handle); + base::ProcessId pid = base::GetProcId(process_->GetData().GetHandle()); LOG(WARNING) << "nonsfi nacl plugin running in " << pid; } } else { @@ -911,11 +910,8 @@ // browser process. ppapi_host_.reset(content::BrowserPpapiHost::CreateExternalPluginProcess( ipc_proxy_channel_.get(), // sender - permissions_, - process_->GetData().handle, - ipc_proxy_channel_.get(), - nacl_host_message_filter_->render_process_id(), - render_view_id_, + permissions_, process_->GetData().GetHandle(), ipc_proxy_channel_.get(), + nacl_host_message_filter_->render_process_id(), render_view_id_, profile_directory_)); ppapi::PpapiNaClPluginArgs args; @@ -1110,7 +1106,7 @@ } debug_exception_handler_requested_ = true; - base::ProcessId nacl_pid = base::GetProcId(process_->GetData().handle); + base::ProcessId nacl_pid = base::GetProcId(process_->GetData().GetHandle()); // We cannot use process_->GetData().handle because it does not have // the necessary access rights. We open the new handle here rather // than in the NaCl broker process in case the NaCl loader process
diff --git a/components/nacl/browser/pnacl_host.cc b/components/nacl/browser/pnacl_host.cc index 9e7e155..6f8b954 100644 --- a/components/nacl/browser/pnacl_host.cc +++ b/components/nacl/browser/pnacl_host.cc
@@ -199,13 +199,13 @@ PLOG(ERROR) << "Temp file open failed: " << file.error_details(); } BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, - base::Bind(cb, Passed(std::move(file)))); + base::BindOnce(cb, std::move(file))); } void PnaclHost::CreateTemporaryFile(TempFileCallback cb) { if (!file_task_runner_->PostTask( FROM_HERE, - base::Bind(&PnaclHost::DoCreateTemporaryFile, temp_dir_, cb))) { + base::BindOnce(&PnaclHost::DoCreateTemporaryFile, temp_dir_, cb))) { DCHECK(thread_checker_.CalledOnValidThread()); cb.Run(base::File()); } @@ -226,18 +226,13 @@ } if (cache_state_ != CacheReady) { // If the backend hasn't yet initialized, try the request again later. - BrowserThread::PostDelayedTask(BrowserThread::IO, - FROM_HERE, - base::Bind(&PnaclHost::GetNexeFd, - base::Unretained(this), - render_process_id, - render_view_id, - pp_instance, - is_incognito, - cache_info, - cb), - base::TimeDelta::FromMilliseconds( - kTranslationCacheInitializationDelayMs)); + BrowserThread::PostDelayedTask( + BrowserThread::IO, FROM_HERE, + base::BindOnce(&PnaclHost::GetNexeFd, base::Unretained(this), + render_process_id, render_view_id, pp_instance, + is_incognito, cache_info, cb), + base::TimeDelta::FromMilliseconds( + kTranslationCacheInitializationDelayMs)); return; } @@ -581,7 +576,7 @@ } BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, - base::Bind(&PnaclHost::DeInitIfSafe, base::Unretained(this))); + base::BindOnce(&PnaclHost::DeInitIfSafe, base::Unretained(this))); } ////////////////// Cache data removal @@ -597,8 +592,9 @@ // If the backend hasn't yet initialized, try the request again later. BrowserThread::PostDelayedTask( BrowserThread::IO, FROM_HERE, - base::Bind(&PnaclHost::ClearTranslationCacheEntriesBetween, - base::Unretained(this), initial_time, end_time, callback), + base::BindOnce(&PnaclHost::ClearTranslationCacheEntriesBetween, + base::Unretained(this), initial_time, end_time, + callback), base::TimeDelta::FromMilliseconds( kTranslationCacheInitializationDelayMs)); return; @@ -620,7 +616,7 @@ // instead of calling DeInitIfSafe directly, post it for later. BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, - base::Bind(&PnaclHost::DeInitIfSafe, base::Unretained(this))); + base::BindOnce(&PnaclHost::DeInitIfSafe, base::Unretained(this))); } // Destroying the cache backend causes it to post tasks to the cache thread to
diff --git a/components/nacl/browser/pnacl_translation_cache.cc b/components/nacl/browser/pnacl_translation_cache.cc index 4e7d34f..fc6870fe 100644 --- a/components/nacl/browser/pnacl_translation_cache.cc +++ b/components/nacl/browser/pnacl_translation_cache.cc
@@ -150,16 +150,14 @@ if (step_ != FINISHED) { if (!read_callback_.is_null()) { BrowserThread::PostTask( - BrowserThread::IO, - FROM_HERE, - base::Bind(read_callback_, - net::ERR_ABORTED, - scoped_refptr<net::DrainableIOBuffer>())); + BrowserThread::IO, FROM_HERE, + base::BindOnce(read_callback_, net::ERR_ABORTED, + scoped_refptr<net::DrainableIOBuffer>())); } if (!write_callback_.is_null()) { - BrowserThread::PostTask(BrowserThread::IO, - FROM_HERE, - base::Bind(write_callback_, net::ERR_ABORTED)); + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, + base::BindOnce(write_callback_, net::ERR_ABORTED)); } } } @@ -175,7 +173,7 @@ void PnaclTranslationCacheEntry::OpenEntry() { int rv = cache_->backend()->OpenEntry( key_, net::HIGHEST, &entry_, - base::Bind(&PnaclTranslationCacheEntry::DispatchNext, this)); + base::BindOnce(&PnaclTranslationCacheEntry::DispatchNext, this)); if (rv != net::ERR_IO_PENDING) DispatchNext(rv); } @@ -183,7 +181,7 @@ void PnaclTranslationCacheEntry::CreateEntry() { int rv = cache_->backend()->CreateEntry( key_, net::HIGHEST, &entry_, - base::Bind(&PnaclTranslationCacheEntry::DispatchNext, this)); + base::BindOnce(&PnaclTranslationCacheEntry::DispatchNext, this)); if (rv != net::ERR_IO_PENDING) DispatchNext(rv); } @@ -191,23 +189,16 @@ void PnaclTranslationCacheEntry::WriteEntry(int offset, int len) { DCHECK(io_buf_->BytesRemaining() == len); int rv = entry_->WriteData( - 1, - offset, - io_buf_.get(), - len, - base::Bind(&PnaclTranslationCacheEntry::DispatchNext, this), - false); + 1, offset, io_buf_.get(), len, + base::BindOnce(&PnaclTranslationCacheEntry::DispatchNext, this), false); if (rv != net::ERR_IO_PENDING) DispatchNext(rv); } void PnaclTranslationCacheEntry::ReadEntry(int offset, int len) { int rv = entry_->ReadData( - 1, - offset, - io_buf_.get(), - len, - base::Bind(&PnaclTranslationCacheEntry::DispatchNext, this)); + 1, offset, io_buf_.get(), len, + base::BindOnce(&PnaclTranslationCacheEntry::DispatchNext, this)); if (rv != net::ERR_IO_PENDING) DispatchNext(rv); } @@ -218,8 +209,8 @@ LOG(ERROR) << "Failed to close entry: " << net::ErrorToString(rv); entry_->Doom(); } - BrowserThread::PostTask( - BrowserThread::IO, FROM_HERE, base::Bind(&CloseDiskCacheEntry, entry_)); + BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, + base::BindOnce(&CloseDiskCacheEntry, entry_)); Finish(rv); } @@ -227,14 +218,13 @@ step_ = FINISHED; if (is_read_) { if (!read_callback_.is_null()) { - BrowserThread::PostTask(BrowserThread::IO, - FROM_HERE, - base::Bind(read_callback_, rv, io_buf_)); + BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, + base::BindOnce(read_callback_, rv, io_buf_)); } } else { if (!write_callback_.is_null()) { - BrowserThread::PostTask( - BrowserThread::IO, FROM_HERE, base::Bind(write_callback_, rv)); + BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, + base::BindOnce(write_callback_, rv)); } } cache_->OpComplete(this); @@ -337,10 +327,10 @@ const CompletionCallback& callback) { int rv = disk_cache::CreateCacheBackend( cache_type, net::CACHE_BACKEND_DEFAULT, cache_dir, cache_size, - true /* force_initialize */, - NULL, /* dummy net log */ + true /* force_initialize */, NULL, /* dummy net log */ &disk_cache_, - base::Bind(&PnaclTranslationCache::OnCreateBackendComplete, AsWeakPtr())); + base::BindOnce(&PnaclTranslationCache::OnCreateBackendComplete, + AsWeakPtr())); if (rv == net::ERR_IO_PENDING) { init_callback_ = callback; } @@ -353,8 +343,8 @@ } // Invoke our client's callback function. if (!init_callback_.is_null()) { - BrowserThread::PostTask( - BrowserThread::IO, FROM_HERE, base::Bind(init_callback_, rv)); + BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, + base::BindOnce(init_callback_, rv)); } }
diff --git a/components/nacl/loader/nacl_ipc_adapter.cc b/components/nacl/loader/nacl_ipc_adapter.cc index 4c884f9..d979e42f 100644 --- a/components/nacl/loader/nacl_ipc_adapter.cc +++ b/components/nacl/loader/nacl_ipc_adapter.cc
@@ -392,8 +392,9 @@ } void NaClIPCAdapter::ConnectChannel() { - task_runner_->PostTask(FROM_HERE, - base::Bind(&NaClIPCAdapter::ConnectChannelOnIOThread, this)); + task_runner_->PostTask( + FROM_HERE, + base::BindOnce(&NaClIPCAdapter::ConnectChannelOnIOThread, this)); } // Note that this message is controlled by the untrusted code. So we should be @@ -494,8 +495,8 @@ cond_var_.Signal(); } - task_runner_->PostTask(FROM_HERE, - base::Bind(&NaClIPCAdapter::CloseChannelOnIOThread, this)); + task_runner_->PostTask( + FROM_HERE, base::BindOnce(&NaClIPCAdapter::CloseChannelOnIOThread, this)); } NaClDesc* NaClIPCAdapter::MakeNaClDesc() { @@ -732,8 +733,9 @@ NaClIPCAdapter::~NaClIPCAdapter() { // Make sure the channel is deleted on the IO thread. - task_runner_->PostTask(FROM_HERE, - base::Bind(&DeleteChannel, io_thread_data_.channel_.release())); + task_runner_->PostTask( + FROM_HERE, + base::BindOnce(&DeleteChannel, io_thread_data_.channel_.release())); } int NaClIPCAdapter::LockedReceive(NaClImcTypedMsgHdr* msg) {
diff --git a/components/nacl/loader/run_all_unittests.cc b/components/nacl/loader/run_all_unittests.cc index 555da28e..a223cf77 100644 --- a/components/nacl/loader/run_all_unittests.cc +++ b/components/nacl/loader/run_all_unittests.cc
@@ -8,8 +8,7 @@ int main(int argc, char** argv) { base::TestSuite test_suite(argc, argv); - return base::LaunchUnitTests(argc, - argv, - base::Bind(&base::TestSuite::Run, - base::Unretained(&test_suite))); + return base::LaunchUnitTests( + argc, argv, + base::BindOnce(&base::TestSuite::Run, base::Unretained(&test_suite))); }
diff --git a/components/nacl/renderer/pnacl_translation_resource_host.cc b/components/nacl/renderer/pnacl_translation_resource_host.cc index 03b65a5..1ffcb62 100644 --- a/components/nacl/renderer/pnacl_translation_resource_host.cc +++ b/components/nacl/renderer/pnacl_translation_resource_host.cc
@@ -56,8 +56,8 @@ GetMainThreadMessageLoop()->BelongsToCurrentThread()); io_task_runner_->PostTask( FROM_HERE, - base::Bind(&PnaclTranslationResourceHost::SendRequestNexeFd, this, - render_view_id, instance, cache_info, callback)); + base::BindOnce(&PnaclTranslationResourceHost::SendRequestNexeFd, this, + render_view_id, instance, cache_info, callback)); return; } @@ -71,10 +71,8 @@ render_view_id, instance, cache_info))) { PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( FROM_HERE, - base::Bind(callback, - static_cast<int32_t>(PP_ERROR_FAILED), - false, - PP_kInvalidFileHandle)); + base::BindOnce(callback, static_cast<int32_t>(PP_ERROR_FAILED), false, + PP_kInvalidFileHandle)); return; } pending_cache_requests_.insert(std::make_pair(instance, callback)); @@ -87,8 +85,9 @@ GetMainThreadMessageLoop()->BelongsToCurrentThread()); io_task_runner_->PostTask( FROM_HERE, - base::Bind(&PnaclTranslationResourceHost::SendReportTranslationFinished, - this, instance, success)); + base::BindOnce( + &PnaclTranslationResourceHost::SendReportTranslationFinished, this, + instance, success)); return; } @@ -123,8 +122,7 @@ status = PP_OK; } PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( - FROM_HERE, - base::Bind(it->second, status, is_hit, file_handle)); + FROM_HERE, base::BindOnce(it->second, status, is_hit, file_handle)); pending_cache_requests_.erase(it); } else { DLOG(ERROR) << "Could not find pending request for reply"; @@ -138,10 +136,8 @@ ++it) { PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( FROM_HERE, - base::Bind(it->second, - static_cast<int32_t>(PP_ERROR_ABORTED), - false, - PP_kInvalidFileHandle)); + base::BindOnce(it->second, static_cast<int32_t>(PP_ERROR_ABORTED), + false, PP_kInvalidFileHandle)); } pending_cache_requests_.clear(); }
diff --git a/components/nacl/renderer/ppb_nacl_private_impl.cc b/components/nacl/renderer/ppb_nacl_private_impl.cc index ba72c55..91766270c 100644 --- a/components/nacl/renderer/ppb_nacl_private_impl.cc +++ b/components/nacl/renderer/ppb_nacl_private_impl.cc
@@ -200,8 +200,7 @@ void PostPPCompletionCallback(PP_CompletionCallback callback, int32_t status) { ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( - FROM_HERE, - base::Bind(callback.func, callback.user_data, status)); + FROM_HERE, base::BindOnce(callback.func, callback.user_data, status)); } bool ManifestResolveKey(PP_Instance instance, @@ -420,8 +419,8 @@ base::File closer(nexe_file_info->handle); } ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( - FROM_HERE, base::Bind(callback.func, callback.user_data, - static_cast<int32_t>(PP_ERROR_FAILED))); + FROM_HERE, base::BindOnce(callback.func, callback.user_data, + static_cast<int32_t>(PP_ERROR_FAILED))); return; } @@ -476,9 +475,8 @@ &launch_result, &error_message_string))) { ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( - FROM_HERE, - base::Bind(callback.func, callback.user_data, - static_cast<int32_t>(PP_ERROR_FAILED))); + FROM_HERE, base::BindOnce(callback.func, callback.user_data, + static_cast<int32_t>(PP_ERROR_FAILED))); return; } @@ -498,9 +496,8 @@ error_message_string); } ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( - FROM_HERE, - base::Bind(callback.func, callback.user_data, - static_cast<int32_t>(PP_ERROR_FAILED))); + FROM_HERE, base::BindOnce(callback.func, callback.user_data, + static_cast<int32_t>(PP_ERROR_FAILED))); return; } @@ -698,10 +695,8 @@ if (!InitializePnaclResourceHost()) { ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( FROM_HERE, - base::Bind(callback, - static_cast<int32_t>(PP_ERROR_FAILED), - false, - PP_kInvalidFileHandle)); + base::BindOnce(callback, static_cast<int32_t>(PP_ERROR_FAILED), false, + PP_kInvalidFileHandle)); return; } @@ -935,18 +930,16 @@ DCHECK(load_manager); if (!load_manager) { ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( - FROM_HERE, - base::Bind(callback.func, callback.user_data, - static_cast<int32_t>(PP_ERROR_FAILED))); + FROM_HERE, base::BindOnce(callback.func, callback.user_data, + static_cast<int32_t>(PP_ERROR_FAILED))); return; } std::string url = load_manager->GetManifestURLArgument(); if (url.empty() || !load_manager->RequestNaClManifest(url)) { ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( - FROM_HERE, - base::Bind(callback.func, callback.user_data, - static_cast<int32_t>(PP_ERROR_FAILED))); + FROM_HERE, base::BindOnce(callback.func, callback.user_data, + static_cast<int32_t>(PP_ERROR_FAILED))); return; } @@ -970,8 +963,7 @@ "could not load manifest url."); } ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( - FROM_HERE, - base::Bind(callback.func, callback.user_data, error)); + FROM_HERE, base::BindOnce(callback.func, callback.user_data, error)); } else { DownloadManifestToBuffer(instance, callback); } @@ -1013,9 +1005,8 @@ content::PepperPluginInstance::Get(instance); if (!load_manager || !plugin_instance) { ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( - FROM_HERE, - base::Bind(callback.func, callback.user_data, - static_cast<int32_t>(PP_ERROR_FAILED))); + FROM_HERE, base::BindOnce(callback.func, callback.user_data, + static_cast<int32_t>(PP_ERROR_FAILED))); return; } const blink::WebDocument& document = @@ -1373,9 +1364,8 @@ content::PepperPluginInstance::Get(instance); if (!plugin_instance) { ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( - FROM_HERE, - base::Bind(callback.func, callback.user_data, - static_cast<int32_t>(PP_ERROR_FAILED))); + FROM_HERE, base::BindOnce(callback.func, callback.user_data, + static_cast<int32_t>(PP_ERROR_FAILED))); return; } const blink::WebDocument& document = @@ -1463,8 +1453,9 @@ DCHECK(load_manager); if (!load_manager) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, static_cast<int32_t>(PP_ERROR_FAILED), - kInvalidNaClFileInfo)); + FROM_HERE, + base::BindOnce(callback, static_cast<int32_t>(PP_ERROR_FAILED), + kInvalidNaClFileInfo)); return; } @@ -1479,14 +1470,15 @@ &file_info.token_hi); if (handle == PP_kInvalidFileHandle) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, static_cast<int32_t>(PP_ERROR_FAILED), - kInvalidNaClFileInfo)); + FROM_HERE, + base::BindOnce(callback, static_cast<int32_t>(PP_ERROR_FAILED), + kInvalidNaClFileInfo)); return; } file_info.handle = handle; base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(callback, static_cast<int32_t>(PP_OK), file_info)); + base::BindOnce(callback, static_cast<int32_t>(PP_OK), file_info)); return; } @@ -1495,8 +1487,9 @@ const GURL& test_gurl = load_manager->plugin_base_url().Resolve(url); if (!test_gurl.is_valid()) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, static_cast<int32_t>(PP_ERROR_FAILED), - kInvalidNaClFileInfo)); + FROM_HERE, + base::BindOnce(callback, static_cast<int32_t>(PP_ERROR_FAILED), + kInvalidNaClFileInfo)); return; } @@ -1514,7 +1507,7 @@ file_info.token_hi = file_token_hi; base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(callback, static_cast<int32_t>(PP_OK), file_info)); + base::BindOnce(callback, static_cast<int32_t>(PP_OK), file_info)); return; } @@ -1527,8 +1520,9 @@ content::PepperPluginInstance::Get(instance); if (!plugin_instance) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, static_cast<int32_t>(PP_ERROR_FAILED), - kInvalidNaClFileInfo)); + FROM_HERE, + base::BindOnce(callback, static_cast<int32_t>(PP_ERROR_FAILED), + kInvalidNaClFileInfo)); return; } const blink::WebDocument& document = @@ -1555,9 +1549,8 @@ int64_t time_in_us) { ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( FROM_HERE, - base::Bind(&HistogramTimeTranslation, - std::string(histogram_name), - time_in_us / 1000)); + base::BindOnce(&HistogramTimeTranslation, std::string(histogram_name), + time_in_us / 1000)); } // static @@ -1727,8 +1720,8 @@ content::PepperPluginInstance::Get(instance); if (!plugin_instance) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(handler->DidFinishStream, handler_user_data, - static_cast<int32_t>(PP_ERROR_FAILED))); + FROM_HERE, base::BindOnce(handler->DidFinishStream, handler_user_data, + static_cast<int32_t>(PP_ERROR_FAILED))); return; }
diff --git a/components/nacl/renderer/progress_event.cc b/components/nacl/renderer/progress_event.cc index ed317c8..6e1d21b 100644 --- a/components/nacl/renderer/progress_event.cc +++ b/components/nacl/renderer/progress_event.cc
@@ -63,7 +63,7 @@ void DispatchProgressEvent(PP_Instance instance, const ProgressEvent& event) { ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( FROM_HERE, - base::Bind(&DispatchProgressEventOnMainThread, instance, event)); + base::BindOnce(&DispatchProgressEventOnMainThread, instance, event)); } } // namespace nacl
diff --git a/components/nacl/renderer/trusted_plugin_channel.cc b/components/nacl/renderer/trusted_plugin_channel.cc index 696137b9..5867376 100644 --- a/components/nacl/renderer/trusted_plugin_channel.cc +++ b/components/nacl/renderer/trusted_plugin_channel.cc
@@ -20,7 +20,7 @@ : nexe_load_manager_(nexe_load_manager), binding_(this, std::move(request)), is_helper_nexe_(is_helper_nexe) { - binding_.set_connection_error_handler(base::Bind( + binding_.set_connection_error_handler(base::BindOnce( &TrustedPluginChannel::OnChannelError, base::Unretained(this))); }
diff --git a/components/net_log/net_export_file_writer.cc b/components/net_log/net_export_file_writer.cc index 6f3597f..649e805 100644 --- a/components/net_log/net_export_file_writer.cc +++ b/components/net_log/net_export_file_writer.cc
@@ -276,7 +276,7 @@ DCHECK(thread_checker_.CalledOnValidThread()); if (!(log_exists_ && state_ == STATE_NOT_LOGGING)) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(path_callback, base::FilePath())); + FROM_HERE, base::BindOnce(path_callback, base::FilePath())); return; } @@ -328,8 +328,8 @@ void NetExportFileWriter::NotifyStateObserversAsync() { DCHECK(thread_checker_.CalledOnValidThread()); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&NetExportFileWriter::NotifyStateObservers, - weak_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&NetExportFileWriter::NotifyStateObservers, + weak_ptr_factory_.GetWeakPtr())); } void NetExportFileWriter::SetStateAfterSetUpDefaultLogPath(
diff --git a/components/network_hints/renderer/renderer_dns_prefetch.cc b/components/network_hints/renderer/renderer_dns_prefetch.cc index bc49b08..1352ee8 100644 --- a/components/network_hints/renderer/renderer_dns_prefetch.cc +++ b/components/network_hints/renderer/renderer_dns_prefetch.cc
@@ -55,8 +55,9 @@ return; // Overkill safety net: Don't send too many InvokeLater's. weak_factory_.InvalidateWeakPtrs(); base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, base::Bind(&RendererDnsPrefetch::SubmitHostnames, - weak_factory_.GetWeakPtr()), + FROM_HERE, + base::BindOnce(&RendererDnsPrefetch::SubmitHostnames, + weak_factory_.GetWeakPtr()), base::TimeDelta::FromMilliseconds(10)); } return; @@ -91,8 +92,9 @@ if (new_name_count_ > 0 || 0 < c_string_queue_.Size()) { weak_factory_.InvalidateWeakPtrs(); base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, base::Bind(&RendererDnsPrefetch::SubmitHostnames, - weak_factory_.GetWeakPtr()), + FROM_HERE, + base::BindOnce(&RendererDnsPrefetch::SubmitHostnames, + weak_factory_.GetWeakPtr()), base::TimeDelta::FromMilliseconds(10)); } else { // TODO(JAR): Should we only clear the map when we navigate, or reload?
diff --git a/components/ntp_snippets/content_suggestions_service_unittest.cc b/components/ntp_snippets/content_suggestions_service_unittest.cc index 8df09e4..b913cbc 100644 --- a/components/ntp_snippets/content_suggestions_service_unittest.cc +++ b/components/ntp_snippets/content_suggestions_service_unittest.cc
@@ -284,8 +284,9 @@ EXPECT_CALL(*provider1, FetchSuggestionImageMock(suggestion_id, _)); EXPECT_CALL(*provider2, FetchSuggestionImageMock(_, _)).Times(0); service()->FetchSuggestionImage( - suggestion_id, base::Bind(&ContentSuggestionsServiceTest::OnImageFetched, - base::Unretained(this))); + suggestion_id, + base::BindOnce(&ContentSuggestionsServiceTest::OnImageFetched, + base::Unretained(this))); } TEST_F(ContentSuggestionsServiceTest, @@ -299,8 +300,9 @@ EXPECT_CALL(*this, OnImageFetched(Property(&gfx::Image::IsEmpty, Eq(true)))) .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); service()->FetchSuggestionImage( - suggestion_id, base::Bind(&ContentSuggestionsServiceTest::OnImageFetched, - base::Unretained(this))); + suggestion_id, + base::BindOnce(&ContentSuggestionsServiceTest::OnImageFetched, + base::Unretained(this))); run_loop.Run(); }
diff --git a/components/ntp_snippets/remote/cached_image_fetcher.cc b/components/ntp_snippets/remote/cached_image_fetcher.cc index 4c7cf077..afbdf6f6 100644 --- a/components/ntp_snippets/remote/cached_image_fetcher.cc +++ b/components/ntp_snippets/remote/cached_image_fetcher.cc
@@ -144,9 +144,9 @@ // Image decoding callback only set when requested. image_fetcher::ImageFetcherCallback decode_callback; if (image_callback) { - decode_callback = base::BindOnce(&CachedImageFetcher::OnImageDecodingDone, - base::Unretained(this), - base::Passed(std::move(image_callback))); + decode_callback = + base::BindOnce(&CachedImageFetcher::OnImageDecodingDone, + base::Unretained(this), std::move(image_callback)); } image_fetcher_->FetchImageAndData(
diff --git a/components/ntp_snippets/remote/remote_suggestions_database.cc b/components/ntp_snippets/remote/remote_suggestions_database.cc index f856d04a..1c3a13c 100644 --- a/components/ntp_snippets/remote/remote_suggestions_database.cc +++ b/components/ntp_snippets/remote/remote_suggestions_database.cc
@@ -62,14 +62,14 @@ options.write_buffer_size = kDatabaseWriteBufferSizeBytes; database_->Init(kDatabaseUMAClientName, snippet_dir, options, - base::Bind(&RemoteSuggestionsDatabase::OnDatabaseInited, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&RemoteSuggestionsDatabase::OnDatabaseInited, + weak_ptr_factory_.GetWeakPtr())); base::FilePath image_dir = database_dir.AppendASCII(kImageDatabaseFolder); image_database_->Init( kImageDatabaseUMAClientName, image_dir, options, - base::Bind(&RemoteSuggestionsDatabase::OnImageDatabaseInited, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&RemoteSuggestionsDatabase::OnImageDatabaseInited, + weak_ptr_factory_.GetWeakPtr())); } RemoteSuggestionsDatabase::~RemoteSuggestionsDatabase() = default; @@ -128,8 +128,8 @@ std::unique_ptr<KeyEntryVector> entries_to_save(new KeyEntryVector()); database_->UpdateEntries( std::move(entries_to_save), std::move(snippet_ids), - base::Bind(&RemoteSuggestionsDatabase::OnDatabaseSaved, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&RemoteSuggestionsDatabase::OnDatabaseSaved, + weak_ptr_factory_.GetWeakPtr())); } void RemoteSuggestionsDatabase::LoadImage(const std::string& snippet_id, @@ -154,8 +154,8 @@ image_database_->UpdateEntries( std::move(entries_to_save), std::make_unique<std::vector<std::string>>(), - base::Bind(&RemoteSuggestionsDatabase::OnImageDatabaseSaved, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&RemoteSuggestionsDatabase::OnImageDatabaseSaved, + weak_ptr_factory_.GetWeakPtr())); } void RemoteSuggestionsDatabase::DeleteImage(const std::string& snippet_id) { @@ -167,8 +167,8 @@ DCHECK(IsInitialized()); image_database_->UpdateEntries( std::make_unique<ImageKeyEntryVector>(), std::move(snippet_ids), - base::Bind(&RemoteSuggestionsDatabase::OnImageDatabaseSaved, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&RemoteSuggestionsDatabase::OnImageDatabaseSaved, + weak_ptr_factory_.GetWeakPtr())); } void RemoteSuggestionsDatabase::GarbageCollectImages( @@ -314,8 +314,8 @@ new std::vector<std::string>()); database_->UpdateEntries( std::move(entries_to_save), std::move(keys_to_remove), - base::Bind(&RemoteSuggestionsDatabase::OnDatabaseSaved, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&RemoteSuggestionsDatabase::OnDatabaseSaved, + weak_ptr_factory_.GetWeakPtr())); } void RemoteSuggestionsDatabase::LoadImageImpl(const std::string& snippet_id,
diff --git a/components/ntp_snippets/remote/remote_suggestions_database_unittest.cc b/components/ntp_snippets/remote/remote_suggestions_database_unittest.cc index ab24690..422406e 100644 --- a/components/ntp_snippets/remote/remote_suggestions_database_unittest.cc +++ b/components/ntp_snippets/remote/remote_suggestions_database_unittest.cc
@@ -126,11 +126,11 @@ // Start a snippet and image load before the DB is initialized. db()->LoadSnippets( - base::Bind(&RemoteSuggestionsDatabaseTest::OnSnippetsLoaded, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsDatabaseTest::OnSnippetsLoaded, + base::Unretained(this))); db()->LoadImage("id", - base::Bind(&RemoteSuggestionsDatabaseTest::OnImageLoaded, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsDatabaseTest::OnImageLoaded, + base::Unretained(this))); suggestion_db()->InitCallback(true); image_db()->InitCallback(true); @@ -161,14 +161,14 @@ EXPECT_CALL(*this, OnSnippetsLoadedImpl(_)); db()->LoadSnippets( - base::Bind(&RemoteSuggestionsDatabaseTest::OnSnippetsLoaded, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsDatabaseTest::OnSnippetsLoaded, + base::Unretained(this))); suggestion_db()->LoadCallback(true); EXPECT_CALL(*this, OnImageLoaded(_)); db()->LoadImage("id", - base::Bind(&RemoteSuggestionsDatabaseTest::OnImageLoaded, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsDatabaseTest::OnImageLoaded, + base::Unretained(this))); image_db()->GetCallback(true); } @@ -191,16 +191,16 @@ EXPECT_CALL(*this, OnSnippetsLoadedImpl(ElementsAre(PointeeEq(snippet.get())))); db()->LoadSnippets( - base::Bind(&RemoteSuggestionsDatabaseTest::OnSnippetsLoaded, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsDatabaseTest::OnSnippetsLoaded, + base::Unretained(this))); suggestion_db()->LoadCallback(true); Mock::VerifyAndClearExpectations(this); EXPECT_CALL(*this, OnImageLoaded(image_data)); db()->LoadImage(snippet->id(), - base::Bind(&RemoteSuggestionsDatabaseTest::OnImageLoaded, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsDatabaseTest::OnImageLoaded, + base::Unretained(this))); image_db()->GetCallback(true); } @@ -228,14 +228,14 @@ EXPECT_CALL(*this, OnSnippetsLoadedImpl(ElementsAre(PointeeEq(snippet.get())))); db()->LoadSnippets( - base::Bind(&RemoteSuggestionsDatabaseTest::OnSnippetsLoaded, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsDatabaseTest::OnSnippetsLoaded, + base::Unretained(this))); suggestion_db()->LoadCallback(true); EXPECT_CALL(*this, OnImageLoaded(image_data)); db()->LoadImage(snippet->id(), - base::Bind(&RemoteSuggestionsDatabaseTest::OnImageLoaded, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsDatabaseTest::OnImageLoaded, + base::Unretained(this))); image_db()->GetCallback(true); } @@ -260,8 +260,8 @@ EXPECT_CALL(*this, OnSnippetsLoadedImpl(ElementsAre(PointeeEq(snippet.get())))); db()->LoadSnippets( - base::Bind(&RemoteSuggestionsDatabaseTest::OnSnippetsLoaded, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsDatabaseTest::OnSnippetsLoaded, + base::Unretained(this))); suggestion_db()->LoadCallback(true); } @@ -281,8 +281,8 @@ EXPECT_CALL(*this, OnSnippetsLoadedImpl(ElementsAre(PointeeEq(snippet.get())))); db()->LoadSnippets( - base::Bind(&RemoteSuggestionsDatabaseTest::OnSnippetsLoaded, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsDatabaseTest::OnSnippetsLoaded, + base::Unretained(this))); suggestion_db()->LoadCallback(true); Mock::VerifyAndClearExpectations(this); @@ -294,8 +294,8 @@ // Make sure it's gone. EXPECT_CALL(*this, OnSnippetsLoadedImpl(IsEmpty())); db()->LoadSnippets( - base::Bind(&RemoteSuggestionsDatabaseTest::OnSnippetsLoaded, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsDatabaseTest::OnSnippetsLoaded, + base::Unretained(this))); suggestion_db()->LoadCallback(true); } @@ -318,14 +318,14 @@ EXPECT_CALL(*this, OnSnippetsLoadedImpl(ElementsAre(PointeeEq(snippet.get())))); db()->LoadSnippets( - base::Bind(&RemoteSuggestionsDatabaseTest::OnSnippetsLoaded, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsDatabaseTest::OnSnippetsLoaded, + base::Unretained(this))); suggestion_db()->LoadCallback(true); EXPECT_CALL(*this, OnImageLoaded(image_data)); db()->LoadImage(snippet->id(), - base::Bind(&RemoteSuggestionsDatabaseTest::OnImageLoaded, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsDatabaseTest::OnImageLoaded, + base::Unretained(this))); image_db()->GetCallback(true); Mock::VerifyAndClearExpectations(this); @@ -337,8 +337,8 @@ // Make sure the image is still there. EXPECT_CALL(*this, OnImageLoaded(image_data)); db()->LoadImage(snippet->id(), - base::Bind(&RemoteSuggestionsDatabaseTest::OnImageLoaded, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsDatabaseTest::OnImageLoaded, + base::Unretained(this))); image_db()->GetCallback(true); } @@ -358,8 +358,8 @@ // Make sure the image is there. EXPECT_CALL(*this, OnImageLoaded(image_data)); db()->LoadImage(snippet->id(), - base::Bind(&RemoteSuggestionsDatabaseTest::OnImageLoaded, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsDatabaseTest::OnImageLoaded, + base::Unretained(this))); image_db()->GetCallback(true); Mock::VerifyAndClearExpectations(this); @@ -371,8 +371,8 @@ // Make sure the image is gone. EXPECT_CALL(*this, OnImageLoaded(std::string())); db()->LoadImage(snippet->id(), - base::Bind(&RemoteSuggestionsDatabaseTest::OnImageLoaded, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsDatabaseTest::OnImageLoaded, + base::Unretained(this))); image_db()->GetCallback(true); } @@ -393,14 +393,14 @@ // Make sure the to-be-garbage collected images are there. EXPECT_CALL(*this, OnImageLoaded("pretty-image-1")); db()->LoadImage("snippet-id-1", - base::Bind(&RemoteSuggestionsDatabaseTest::OnImageLoaded, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsDatabaseTest::OnImageLoaded, + base::Unretained(this))); image_db()->GetCallback(true); EXPECT_CALL(*this, OnImageLoaded("pretty-image-3")); db()->LoadImage("snippet-id-3", - base::Bind(&RemoteSuggestionsDatabaseTest::OnImageLoaded, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsDatabaseTest::OnImageLoaded, + base::Unretained(this))); image_db()->GetCallback(true); // Garbage collect all except the second. @@ -413,21 +413,21 @@ // Make sure the images are gone. EXPECT_CALL(*this, OnImageLoaded(std::string())); db()->LoadImage("snippet-id-1", - base::Bind(&RemoteSuggestionsDatabaseTest::OnImageLoaded, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsDatabaseTest::OnImageLoaded, + base::Unretained(this))); image_db()->GetCallback(true); EXPECT_CALL(*this, OnImageLoaded(std::string())); db()->LoadImage("snippet-id-3", - base::Bind(&RemoteSuggestionsDatabaseTest::OnImageLoaded, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsDatabaseTest::OnImageLoaded, + base::Unretained(this))); image_db()->GetCallback(true); // Make sure the second still exists. EXPECT_CALL(*this, OnImageLoaded("pretty-image-2")); db()->LoadImage("snippet-id-2", - base::Bind(&RemoteSuggestionsDatabaseTest::OnImageLoaded, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsDatabaseTest::OnImageLoaded, + base::Unretained(this))); image_db()->GetCallback(true); }
diff --git a/components/ntp_snippets/remote/remote_suggestions_fetcher_impl_unittest.cc b/components/ntp_snippets/remote/remote_suggestions_fetcher_impl_unittest.cc index a1bb5f4..82d627d 100644 --- a/components/ntp_snippets/remote/remote_suggestions_fetcher_impl_unittest.cc +++ b/components/ntp_snippets/remote/remote_suggestions_fetcher_impl_unittest.cc
@@ -157,8 +157,8 @@ const ErrorCallback& error_callback) { base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::Bind(&ParseJson, json, std::move(success_callback), - std::move(error_callback)), + base::BindOnce(&ParseJson, json, std::move(success_callback), + std::move(error_callback)), base::TimeDelta::FromMilliseconds(kTestJsonParsingLatencyMs)); }
diff --git a/components/ntp_snippets/remote/remote_suggestions_provider_impl.cc b/components/ntp_snippets/remote/remote_suggestions_provider_impl.cc index 25e7edb4..b476666 100644 --- a/components/ntp_snippets/remote/remote_suggestions_provider_impl.cc +++ b/components/ntp_snippets/remote/remote_suggestions_provider_impl.cc
@@ -535,9 +535,9 @@ // any). fetch_timeout_timer_->Start( FROM_HERE, GetTimeoutForLoadingIndicator(), - base::Bind(&RemoteSuggestionsProviderImpl:: - NotifyFetchWithLoadingIndicatorFailedOrTimeouted, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsProviderImpl:: + NotifyFetchWithLoadingIndicatorFailedOrTimeouted, + base::Unretained(this))); } FetchStatusCallback callback_wrapped =
diff --git a/components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc b/components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc index 27861fc1..d5d0365e9 100644 --- a/components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc +++ b/components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc
@@ -180,7 +180,7 @@ gfx::Image result; base::RunLoop run_loop; provider->FetchSuggestionImage( - suggestion_id, base::Bind( + suggestion_id, base::BindOnce( [](base::Closure signal, gfx::Image* output, const gfx::Image& loaded) { *output = loaded; @@ -1611,7 +1611,7 @@ EXPECT_CALL(loaded, Call(Field(&Status::code, StatusCode::TEMPORARY_ERROR), IsEmpty())); provider->Fetch(articles_category(), std::set<std::string>(), - base::Bind(&SuggestionsLoaded, &loaded)); + base::BindOnce(&SuggestionsLoaded, &loaded)); RunUntilIdle(); } @@ -1623,8 +1623,8 @@ EXPECT_CALL(*mock_suggestions_fetcher(), FetchSnippets(_, _)).Times(0); MockFunction<void(Status)> loaded; EXPECT_CALL(loaded, Call(Field(&Status::code, StatusCode::TEMPORARY_ERROR))); - provider->RefetchInTheBackground( - base::Bind(&MockFunction<void(Status)>::Call, base::Unretained(&loaded))); + provider->RefetchInTheBackground(base::BindOnce( + &MockFunction<void(Status)>::Call, base::Unretained(&loaded))); RunUntilIdle(); } @@ -1655,7 +1655,7 @@ .RetiresOnSaturation(); provider->Fetch(articles_category(), /*known_ids=*/std::set<std::string>(), - base::Bind(&SuggestionsLoaded, &loaded)); + base::BindOnce(&SuggestionsLoaded, &loaded)); EXPECT_CALL(loaded, Call(Field(&Status::code, StatusCode::TEMPORARY_ERROR), IsEmpty())); @@ -1810,7 +1810,7 @@ provider->GetDismissedSuggestionsForDebugging( articles_category(), - base::Bind( + base::BindOnce( [](RemoteSuggestionsProviderImpl* provider, RemoteSuggestionsProviderImplTest* test, std::vector<ContentSuggestion> dismissed_suggestions) { @@ -1827,7 +1827,7 @@ provider->ClearDismissedSuggestionsForDebugging(articles_category()); provider->GetDismissedSuggestionsForDebugging( articles_category(), - base::Bind( + base::BindOnce( [](RemoteSuggestionsProviderImpl* provider, RemoteSuggestionsProviderImplTest* test, std::vector<ContentSuggestion> dismissed_suggestions) { @@ -2130,8 +2130,8 @@ provider->FetchSuggestionImage( MakeArticleID(kSuggestionUrl), - base::Bind(&MockFunction<void(const gfx::Image&)>::Call, - base::Unretained(&image_fetched))); + base::BindOnce(&MockFunction<void(const gfx::Image&)>::Call, + base::Unretained(&image_fetched))); RunUntilIdle(); // Check that the image by ServeOneByOneImage is really served. EXPECT_EQ(1, image.Width()); @@ -2150,8 +2150,8 @@ provider->FetchSuggestionImage( MakeArticleID("nonexistent"), - base::Bind(&MockFunction<void(const gfx::Image&)>::Call, - base::Unretained(&image_fetched))); + base::BindOnce(&MockFunction<void(const gfx::Image&)>::Call, + base::Unretained(&image_fetched))); RunUntilIdle(); EXPECT_TRUE(image.IsEmpty()); @@ -2179,8 +2179,8 @@ provider->FetchSuggestionImage( MakeArticleID(kSuggestionUrl2), - base::Bind(&MockFunction<void(const gfx::Image&)>::Call, - base::Unretained(&image_fetched))); + base::BindOnce(&MockFunction<void(const gfx::Image&)>::Call, + base::Unretained(&image_fetched))); RunUntilIdle(); EXPECT_TRUE(image.IsEmpty()) << "got image with width: " << image.Width(); @@ -2508,8 +2508,8 @@ FetchSnippets(Field(&RequestParams::excluded_ids, known_ids), _)); provider->Fetch( articles_category(), known_ids, - base::Bind([](Status status_code, - std::vector<ContentSuggestion> suggestions) {})); + base::BindOnce([](Status status_code, + std::vector<ContentSuggestion> suggestions) {})); } TEST_F(RemoteSuggestionsProviderImplTest, @@ -2542,8 +2542,8 @@ _)); provider->Fetch( articles_category(), std::set<std::string>(), - base::Bind([](Status status_code, - std::vector<ContentSuggestion> suggestions) {})); + base::BindOnce([](Status status_code, + std::vector<ContentSuggestion> suggestions) {})); } TEST_F(RemoteSuggestionsProviderImplTest, @@ -2580,8 +2580,8 @@ _)); provider->Fetch( articles_category(), std::set<std::string>(), - base::Bind([](Status status_code, - std::vector<ContentSuggestion> suggestions) {})); + base::BindOnce([](Status status_code, + std::vector<ContentSuggestion> suggestions) {})); } TEST_F(RemoteSuggestionsProviderImplTest, @@ -2625,8 +2625,8 @@ _)); provider->Fetch( articles_category(), std::set<std::string>(), - base::Bind([](Status status_code, - std::vector<ContentSuggestion> suggestions) {})); + base::BindOnce([](Status status_code, + std::vector<ContentSuggestion> suggestions) {})); } TEST_F(RemoteSuggestionsProviderImplTest, @@ -2653,9 +2653,10 @@ provider.get(), articles_category(), /*known_suggestion_ids=*/std::set<std::string>(), /*fetch_done_callback=*/ - base::Bind([](Status status, std::vector<ContentSuggestion> suggestions) { - ASSERT_THAT(suggestions, SizeIs(5)); - }), + base::BindOnce( + [](Status status, std::vector<ContentSuggestion> suggestions) { + ASSERT_THAT(suggestions, SizeIs(5)); + }), Status::Success(), std::move(fetched_categories)); // Dismiss them. @@ -2676,8 +2677,8 @@ _)); provider->Fetch( articles_category(), std::set<std::string>(), - base::Bind([](Status status_code, - std::vector<ContentSuggestion> suggestions) {})); + base::BindOnce([](Status status_code, + std::vector<ContentSuggestion> suggestions) {})); } TEST_F(RemoteSuggestionsProviderImplTest, ClearDismissedAfterFetchMore) { @@ -2696,7 +2697,7 @@ provider.get(), articles_category(), /*known_suggestion_ids=*/std::set<std::string>(), /*fetch_done_callback=*/ - base::Bind( + base::BindOnce( [](Status status, std::vector<ContentSuggestion> suggestions) {}), Status::Success(), std::move(fetched_categories)); @@ -2713,8 +2714,8 @@ _)); provider->Fetch( articles_category(), std::set<std::string>(), - base::Bind([](Status status_code, - std::vector<ContentSuggestion> suggestions) {})); + base::BindOnce([](Status status_code, + std::vector<ContentSuggestion> suggestions) {})); // Clear dismissals. provider->ClearDismissedSuggestionsForDebugging(articles_category()); @@ -2724,8 +2725,8 @@ FetchSnippets(Field(&RequestParams::excluded_ids, IsEmpty()), _)); provider->Fetch( articles_category(), std::set<std::string>(), - base::Bind([](Status status_code, - std::vector<ContentSuggestion> suggestions) {})); + base::BindOnce([](Status status_code, + std::vector<ContentSuggestion> suggestions) {})); } TEST_F(RemoteSuggestionsProviderImplTest, @@ -2781,8 +2782,8 @@ _)); provider->Fetch( articles_category(), std::set<std::string>(), - base::Bind([](Status status_code, - std::vector<ContentSuggestion> suggestions) {})); + base::BindOnce([](Status status_code, + std::vector<ContentSuggestion> suggestions) {})); } TEST_F(RemoteSuggestionsProviderImplTest, @@ -2835,8 +2836,8 @@ _)); provider->Fetch( articles_category(), std::set<std::string>(), - base::Bind([](Status status_code, - std::vector<ContentSuggestion> suggestions) {})); + base::BindOnce([](Status status_code, + std::vector<ContentSuggestion> suggestions) {})); } TEST_F(RemoteSuggestionsProviderImplTest, @@ -4412,8 +4413,9 @@ provider->Fetch( articles_category(), /*known_suggestion_ids=*/std::set<std::string>(), /*fetch_done_callback=*/ - base::Bind([](Status status_code, - std::vector<ContentSuggestion> suggestions) -> void {})); + base::BindOnce( + [](Status status_code, + std::vector<ContentSuggestion> suggestions) -> void {})); ASSERT_TRUE(params.exclusive_category.has_value()); EXPECT_EQ(*params.exclusive_category, articles_category());
diff --git a/components/ntp_snippets/remote/remote_suggestions_scheduler_impl.cc b/components/ntp_snippets/remote/remote_suggestions_scheduler_impl.cc index 4f0777a..2469b87e 100644 --- a/components/ntp_snippets/remote/remote_suggestions_scheduler_impl.cc +++ b/components/ntp_snippets/remote/remote_suggestions_scheduler_impl.cc
@@ -776,14 +776,14 @@ trigger == TriggerType::SURFACE_OPENED) && IsLastSuccessfulFetchStale()) { provider_->RefetchWhileDisplaying( - base::Bind(&RemoteSuggestionsSchedulerImpl::RefetchFinished, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsSchedulerImpl::RefetchFinished, + base::Unretained(this))); return; } provider_->RefetchInTheBackground( - base::Bind(&RemoteSuggestionsSchedulerImpl::RefetchFinished, - base::Unretained(this))); + base::BindOnce(&RemoteSuggestionsSchedulerImpl::RefetchFinished, + base::Unretained(this))); } bool RemoteSuggestionsSchedulerImpl::ShouldRefetchNow(
diff --git a/components/ntp_tiles/icon_cacher_impl.cc b/components/ntp_tiles/icon_cacher_impl.cc index 2b5853e..47ce15e 100644 --- a/components/ntp_tiles/icon_cacher_impl.cc +++ b/components/ntp_tiles/icon_cacher_impl.cc
@@ -139,9 +139,9 @@ })"); image_fetcher_->FetchImage( std::string(), IconURL(site), - base::Bind(&IconCacherImpl::OnPopularSitesFaviconDownloaded, - base::Unretained(this), site, - base::Passed(std::move(preliminary_callback))), + base::BindOnce(&IconCacherImpl::OnPopularSitesFaviconDownloaded, + base::Unretained(this), site, + std::move(preliminary_callback)), traffic_annotation); }
diff --git a/components/ntp_tiles/icon_cacher_impl_unittest.cc b/components/ntp_tiles/icon_cacher_impl_unittest.cc index d67de38c..4f9a846 100644 --- a/components/ntp_tiles/icon_cacher_impl_unittest.cc +++ b/components/ntp_tiles/icon_cacher_impl_unittest.cc
@@ -89,7 +89,7 @@ ACTION_P2(DecodeSuccessfully, width, height) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(arg2, gfx::test::CreateImage(width, height))); + FROM_HERE, base::BindOnce(arg2, gfx::test::CreateImage(width, height))); } ACTION_P2(PassFetch, width, height) {
diff --git a/components/ntp_tiles/json_unsafe_parser.cc b/components/ntp_tiles/json_unsafe_parser.cc index dc00533..863aa5c 100644 --- a/components/ntp_tiles/json_unsafe_parser.cc +++ b/components/ntp_tiles/json_unsafe_parser.cc
@@ -18,7 +18,7 @@ const ErrorCallback& error_callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind( + base::BindOnce( [](const std::string& unsafe_json, const SuccessCallback& success_callback, const ErrorCallback& error_callback) {
diff --git a/components/offline_items_collection/core/offline_content_aggregator.cc b/components/offline_items_collection/core/offline_content_aggregator.cc index fd2f96c..d55c746 100644 --- a/components/offline_items_collection/core/offline_content_aggregator.cc +++ b/components/offline_items_collection/core/offline_content_aggregator.cc
@@ -178,7 +178,7 @@ if (it == providers_.end()) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, id, nullptr)); + FROM_HERE, base::BindOnce(callback, id, nullptr)); return; }
diff --git a/components/offline_items_collection/core/throttled_offline_content_provider.cc b/components/offline_items_collection/core/throttled_offline_content_provider.cc index 95a22d9..d712f78 100644 --- a/components/offline_items_collection/core/throttled_offline_content_provider.cc +++ b/components/offline_items_collection/core/throttled_offline_content_provider.cc
@@ -143,8 +143,8 @@ update_queued_ = true; base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::Bind(&ThrottledOfflineContentProvider::FlushUpdates, - weak_ptr_factory_.GetWeakPtr()), + base::BindOnce(&ThrottledOfflineContentProvider::FlushUpdates, + weak_ptr_factory_.GetWeakPtr()), delay_between_updates_ - current_delay); }
diff --git a/components/offline_pages/core/prefetch/generate_page_bundle_task.cc b/components/offline_pages/core/prefetch/generate_page_bundle_task.cc index 624b963..fbb5ff2e 100644 --- a/components/offline_pages/core/prefetch/generate_page_bundle_task.cc +++ b/components/offline_pages/core/prefetch/generate_page_bundle_task.cc
@@ -181,9 +181,9 @@ DCHECK(!url_and_ids->urls.empty()); DCHECK_EQ(url_and_ids->urls.size(), url_and_ids->ids.size()); - gcm_handler_->GetGCMToken(base::AdaptCallbackForRepeating(base::BindOnce( - &GeneratePageBundleTask::GotRegistrationId, weak_factory_.GetWeakPtr(), - base::Passed(std::move(url_and_ids))))); + gcm_handler_->GetGCMToken(base::AdaptCallbackForRepeating( + base::BindOnce(&GeneratePageBundleTask::GotRegistrationId, + weak_factory_.GetWeakPtr(), std::move(url_and_ids)))); } void GeneratePageBundleTask::GotRegistrationId(
diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/omnibox/browser/autocomplete_controller.cc index 7865d5b..099237d 100644 --- a/components/omnibox/browser/autocomplete_controller.cc +++ b/components/omnibox/browser/autocomplete_controller.cc
@@ -719,11 +719,9 @@ } void AutocompleteController::StartStopTimer() { - stop_timer_.Start(FROM_HERE, - stop_timer_duration_, - base::Bind(&AutocompleteController::StopHelper, - base::Unretained(this), - false, true)); + stop_timer_.Start(FROM_HERE, stop_timer_duration_, + base::BindOnce(&AutocompleteController::StopHelper, + base::Unretained(this), false, true)); } void AutocompleteController::StopHelper(bool clear_result,
diff --git a/components/omnibox/browser/autocomplete_provider_unittest.cc b/components/omnibox/browser/autocomplete_provider_unittest.cc index 09c7020..8ec9119 100644 --- a/components/omnibox/browser/autocomplete_provider_unittest.cc +++ b/components/omnibox/browser/autocomplete_provider_unittest.cc
@@ -152,7 +152,7 @@ if (input.want_asynchronous_matches()) { done_ = false; base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&TestProvider::Run, this)); + FROM_HERE, base::BindOnce(&TestProvider::Run, this)); } }
diff --git a/components/omnibox/browser/history_url_provider.cc b/components/omnibox/browser/history_url_provider.cc index be13c13..eeef414 100644 --- a/components/omnibox/browser/history_url_provider.cc +++ b/components/omnibox/browser/history_url_provider.cc
@@ -685,7 +685,8 @@ // Return the results (if any) to the originating sequence. params->origin_task_runner->PostTask( - FROM_HERE, base::Bind(&HistoryURLProvider::QueryComplete, this, params)); + FROM_HERE, + base::BindOnce(&HistoryURLProvider::QueryComplete, this, params)); } HistoryURLProvider::~HistoryURLProvider() {
diff --git a/components/omnibox/browser/in_memory_url_index.cc b/components/omnibox/browser/in_memory_url_index.cc index bfdb8f8..7e0904f4 100644 --- a/components/omnibox/browser/in_memory_url_index.cc +++ b/components/omnibox/browser/in_memory_url_index.cc
@@ -202,7 +202,7 @@ if (needs_to_be_cached_ && GetCacheFilePath(&path)) task_runner_->PostTask( FROM_HERE, - base::Bind(base::IgnoreResult(base::DeleteFile), path, false)); + base::BindOnce(base::IgnoreResult(base::DeleteFile), path, false)); } void InMemoryURLIndex::OnHistoryServiceLoaded( @@ -270,7 +270,7 @@ return; task_runner_->PostTask( FROM_HERE, - base::Bind(base::IgnoreResult(base::DeleteFile), path, false)); + base::BindOnce(base::IgnoreResult(base::DeleteFile), path, false)); if (history_service_->backend_loaded()) { ScheduleRebuildFromHistory(); } else { @@ -294,10 +294,9 @@ private_data_tracker_.TryCancelAll(); task_runner_->PostTask( FROM_HERE, - base::Bind( - base::IgnoreResult( - &URLIndexPrivateData::WritePrivateDataToCacheFileTask), - private_data_, path)); + base::BindOnce(base::IgnoreResult( + &URLIndexPrivateData::WritePrivateDataToCacheFileTask), + private_data_, path)); needs_to_be_cached_ = false; } @@ -361,7 +360,7 @@ // If there is no data in our index then delete any existing cache file. task_runner_->PostTask( FROM_HERE, - base::Bind(base::IgnoreResult(base::DeleteFile), path, false)); + base::BindOnce(base::IgnoreResult(base::DeleteFile), path, false)); } }
diff --git a/components/omnibox/browser/omnibox_popup_model.cc b/components/omnibox/browser/omnibox_popup_model.cc index 668edbe0..e026795 100644 --- a/components/omnibox/browser/omnibox_popup_model.cc +++ b/components/omnibox/browser/omnibox_popup_model.cc
@@ -302,8 +302,8 @@ // costly, we can optimize away the redundant extra callbacks. gfx::Image favicon = edit_model_->client()->GetFaviconForPageUrl( match.destination_url, - base::Bind(&OmniboxPopupModel::OnFaviconFetched, - weak_factory_.GetWeakPtr(), match.destination_url)); + base::BindOnce(&OmniboxPopupModel::OnFaviconFetched, + weak_factory_.GetWeakPtr(), match.destination_url)); // Extension icons are the correct size for non-touch UI but need to be // adjusted to be the correct size for touch mode.
diff --git a/components/omnibox/browser/search_provider.cc b/components/omnibox/browser/search_provider.cc index 834de6f..501f846 100644 --- a/components/omnibox/browser/search_provider.cc +++ b/components/omnibox/browser/search_provider.cc
@@ -741,11 +741,9 @@ Run(query_is_private); return; } - timer_.Start(FROM_HERE, - delay, - base::Bind(&SearchProvider::Run, - base::Unretained(this), - query_is_private)); + timer_.Start(FROM_HERE, delay, + base::BindOnce(&SearchProvider::Run, base::Unretained(this), + query_is_private)); } void SearchProvider::CancelLoader(
diff --git a/components/omnibox/browser/shortcuts_backend.cc b/components/omnibox/browser/shortcuts_backend.cc index cb36287..5855237d 100644 --- a/components/omnibox/browser/shortcuts_backend.cc +++ b/components/omnibox/browser/shortcuts_backend.cc
@@ -99,7 +99,7 @@ current_state_ = INITIALIZING; return db_runner_->PostTask( - FROM_HERE, base::Bind(&ShortcutsBackend::InitInternal, this)); + FROM_HERE, base::BindOnce(&ShortcutsBackend::InitInternal, this)); } bool ShortcutsBackend::DeleteShortcutsWithURL(const GURL& shortcut_url) { @@ -227,8 +227,8 @@ (*temp_guid_map_)[it->first] = temp_shortcuts_map_->insert( std::make_pair(base::i18n::ToLower(it->second.text), it->second)); } - main_runner_->PostTask(FROM_HERE, - base::Bind(&ShortcutsBackend::InitCompleted, this)); + main_runner_->PostTask( + FROM_HERE, base::BindOnce(&ShortcutsBackend::InitCompleted, this)); } void ShortcutsBackend::InitCompleted() { @@ -255,8 +255,8 @@ return no_db_access_ || db_runner_->PostTask( FROM_HERE, - base::Bind(base::IgnoreResult(&ShortcutsDatabase::AddShortcut), - db_.get(), shortcut)); + base::BindOnce(base::IgnoreResult(&ShortcutsDatabase::AddShortcut), + db_.get(), shortcut)); } bool ShortcutsBackend::UpdateShortcut( @@ -272,9 +272,9 @@ observer.OnShortcutsChanged(); return no_db_access_ || db_runner_->PostTask( - FROM_HERE, - base::Bind(base::IgnoreResult(&ShortcutsDatabase::UpdateShortcut), - db_.get(), shortcut)); + FROM_HERE, base::BindOnce(base::IgnoreResult( + &ShortcutsDatabase::UpdateShortcut), + db_.get(), shortcut)); } bool ShortcutsBackend::DeleteShortcutsWithIDs( @@ -293,7 +293,7 @@ return no_db_access_ || db_runner_->PostTask( FROM_HERE, - base::Bind( + base::BindOnce( base::IgnoreResult(&ShortcutsDatabase::DeleteShortcutsWithIDs), db_.get(), shortcut_ids)); } @@ -319,7 +319,7 @@ return no_db_access_ || db_runner_->PostTask( FROM_HERE, - base::Bind( + base::BindOnce( base::IgnoreResult(&ShortcutsDatabase::DeleteShortcutsWithURL), db_.get(), url_spec)); } @@ -333,7 +333,8 @@ observer.OnShortcutsChanged(); return no_db_access_ || db_runner_->PostTask( - FROM_HERE, base::Bind(base::IgnoreResult( - &ShortcutsDatabase::DeleteAllShortcuts), - db_.get())); + FROM_HERE, + base::BindOnce( + base::IgnoreResult(&ShortcutsDatabase::DeleteAllShortcuts), + db_.get())); }
diff --git a/components/optimization_guide/optimization_guide_service.cc b/components/optimization_guide/optimization_guide_service.cc index b922fa7..3ffe8f2 100644 --- a/components/optimization_guide/optimization_guide_service.cc +++ b/components/optimization_guide/optimization_guide_service.cc
@@ -57,8 +57,9 @@ AddObserverOnIOThread(observer); } else { io_thread_task_runner_->PostTask( - FROM_HERE, base::Bind(&OptimizationGuideService::AddObserverOnIOThread, - base::Unretained(this), observer)); + FROM_HERE, + base::BindOnce(&OptimizationGuideService::AddObserverOnIOThread, + base::Unretained(this), observer)); } } @@ -75,8 +76,8 @@ } else { io_thread_task_runner_->PostTask( FROM_HERE, - base::Bind(&OptimizationGuideService::RemoveObserverOnIOThread, - base::Unretained(this), observer)); + base::BindOnce(&OptimizationGuideService::RemoveObserverOnIOThread, + base::Unretained(this), observer)); } }
diff --git a/components/os_crypt/BUILD.gn b/components/os_crypt/BUILD.gn index 4f1d855..1445076 100644 --- a/components/os_crypt/BUILD.gn +++ b/components/os_crypt/BUILD.gn
@@ -30,7 +30,7 @@ } } -static_library("os_crypt") { +component("os_crypt") { sources = [ "ie7_password_win.cc", "ie7_password_win.h", @@ -51,6 +51,8 @@ "//crypto:platform", ] + defines = [ "IS_OS_CRYPT_IMPL" ] + if ((is_posix || is_fuchsia) && !is_mac && !is_ios && (!is_desktop_linux || is_chromecast)) { sources += [ "os_crypt_posix.cc" ] @@ -80,7 +82,6 @@ "key_storage_util_linux.h", "os_crypt_linux.cc", ] - defines = [] if (use_gnome_keyring) { sources += [
diff --git a/components/os_crypt/ie7_password_win.h b/components/os_crypt/ie7_password_win.h index 07e2f2e4..d3f48b0 100644 --- a/components/os_crypt/ie7_password_win.h +++ b/components/os_crypt/ie7_password_win.h
@@ -9,10 +9,11 @@ #include <string> #include <vector> +#include "base/component_export.h" #include "base/time/time.h" // Contains the information read from the IE7/IE8 Storage2 key in the registry. -struct IE7PasswordInfo { +struct COMPONENT_EXPORT(OS_CRYPT) IE7PasswordInfo { IE7PasswordInfo(); IE7PasswordInfo(const IE7PasswordInfo& other); ~IE7PasswordInfo(); @@ -30,7 +31,7 @@ namespace ie7_password { -struct DecryptedCredentials { +struct COMPONENT_EXPORT(OS_CRYPT) DecryptedCredentials { std::wstring username; std::wstring password; }; @@ -39,18 +40,20 @@ // The collection of bytes in |data| is interpreted as a special PasswordEntry // structure. IE saves the login information as a binary dump of this structure. // Credentials extracted from |data| end up in |credentials|. +COMPONENT_EXPORT(OS_CRYPT) bool GetUserPassFromData(const std::vector<unsigned char>& data, std::vector<DecryptedCredentials>* credentials); // Decrypts usernames and passwords for a given data vector using the url as // the key. // Output ends up in |credentials|. +COMPONENT_EXPORT(OS_CRYPT) bool DecryptPasswords(const std::wstring& url, const std::vector<unsigned char>& data, std::vector<DecryptedCredentials>* credentials); // Returns the hash of a url. -std::wstring GetUrlHash(const std::wstring& url); +COMPONENT_EXPORT(OS_CRYPT) std::wstring GetUrlHash(const std::wstring& url); } // namespace ie7_password
diff --git a/components/os_crypt/key_storage_config_linux.h b/components/os_crypt/key_storage_config_linux.h index 6199cbd..a8566047 100644 --- a/components/os_crypt/key_storage_config_linux.h +++ b/components/os_crypt/key_storage_config_linux.h
@@ -8,6 +8,7 @@ #include <memory> #include <string> +#include "base/component_export.h" #include "base/files/file_path.h" #include "base/macros.h" #include "base/memory/ref_counted.h" @@ -16,7 +17,7 @@ namespace os_crypt { // A container for all the initialisation parameters for OSCrypt. -struct Config { +struct COMPONENT_EXPORT(OS_CRYPT) Config { public: Config(); ~Config();
diff --git a/components/os_crypt/key_storage_keyring.h b/components/os_crypt/key_storage_keyring.h index fb41a708..0c521f9 100644 --- a/components/os_crypt/key_storage_keyring.h +++ b/components/os_crypt/key_storage_keyring.h
@@ -7,6 +7,7 @@ #include <string> +#include "base/component_export.h" #include "base/macros.h" #include "base/memory/ref_counted.h" #include "components/os_crypt/key_storage_linux.h" @@ -16,7 +17,7 @@ } // namespace base // Specialisation of KeyStorageLinux that uses Libsecret. -class KeyStorageKeyring : public KeyStorageLinux { +class COMPONENT_EXPORT(OS_CRYPT) KeyStorageKeyring : public KeyStorageLinux { public: explicit KeyStorageKeyring( scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner);
diff --git a/components/os_crypt/key_storage_kwallet.h b/components/os_crypt/key_storage_kwallet.h index 3be64d8..6a185be 100644 --- a/components/os_crypt/key_storage_kwallet.h +++ b/components/os_crypt/key_storage_kwallet.h
@@ -8,11 +8,12 @@ #include <memory> #include <string> +#include "base/component_export.h" #include "base/macros.h" #include "components/os_crypt/key_storage_linux.h" #include "components/os_crypt/kwallet_dbus.h" -class KeyStorageKWallet : public KeyStorageLinux { +class COMPONENT_EXPORT(OS_CRYPT) KeyStorageKWallet : public KeyStorageLinux { public: KeyStorageKWallet(base::nix::DesktopEnvironment desktop_env, std::string app_name);
diff --git a/components/os_crypt/key_storage_libsecret.h b/components/os_crypt/key_storage_libsecret.h index 617c38f..31cf0c7 100644 --- a/components/os_crypt/key_storage_libsecret.h +++ b/components/os_crypt/key_storage_libsecret.h
@@ -7,11 +7,12 @@ #include <string> +#include "base/component_export.h" #include "base/macros.h" #include "components/os_crypt/key_storage_linux.h" // Specialisation of KeyStorageLinux that uses Libsecret. -class KeyStorageLibsecret : public KeyStorageLinux { +class COMPONENT_EXPORT(OS_CRYPT) KeyStorageLibsecret : public KeyStorageLinux { public: KeyStorageLibsecret() = default; ~KeyStorageLibsecret() override = default;
diff --git a/components/os_crypt/key_storage_linux.h b/components/os_crypt/key_storage_linux.h index c8fd4e9..e4acd264 100644 --- a/components/os_crypt/key_storage_linux.h +++ b/components/os_crypt/key_storage_linux.h
@@ -8,6 +8,7 @@ #include <memory> #include <string> +#include "base/component_export.h" #include "base/macros.h" namespace base { @@ -21,14 +22,15 @@ // An API for retrieving OSCrypt's password from the system's password storage // service. -class KeyStorageLinux { +class COMPONENT_EXPORT(OS_CRYPT) KeyStorageLinux { public: KeyStorageLinux() = default; virtual ~KeyStorageLinux() = default; // Tries to load the appropriate key storage. Returns null if none succeed. - static std::unique_ptr<KeyStorageLinux> CreateService( - const os_crypt::Config& config); + static COMPONENT_EXPORT(OS_CRYPT) + std::unique_ptr<KeyStorageLinux> CreateService( + const os_crypt::Config& config); // Gets the encryption key from the OS password-managing library. If a key is // not found, a new key will be generated, stored and returned.
diff --git a/components/os_crypt/key_storage_util_linux.h b/components/os_crypt/key_storage_util_linux.h index f91bfc68..14a35902 100644 --- a/components/os_crypt/key_storage_util_linux.h +++ b/components/os_crypt/key_storage_util_linux.h
@@ -7,6 +7,7 @@ #include <string> +#include "base/component_export.h" #include "base/nix/xdg_util.h" namespace base { @@ -32,16 +33,19 @@ // TODO(crbug/571003): This is exposed as a utility only for password manager to // use. It should be merged into key_storage_linux, once no longer needed in // password manager. -SelectedLinuxBackend SelectBackend(const std::string& type, - bool use_backend, - base::nix::DesktopEnvironment desktop_env); +SelectedLinuxBackend COMPONENT_EXPORT(OS_CRYPT) + SelectBackend(const std::string& type, + bool use_backend, + base::nix::DesktopEnvironment desktop_env); // Set the setting that disables using OS-level encryption. If |use| is true, // a backend will be used. -bool WriteBackendUse(const base::FilePath& user_data_dir, bool use); +bool COMPONENT_EXPORT(OS_CRYPT) + WriteBackendUse(const base::FilePath& user_data_dir, bool use); // Decide whether the backend should be used based on the setting. -bool GetBackendUse(const base::FilePath& user_data_dir); +bool COMPONENT_EXPORT(OS_CRYPT) + GetBackendUse(const base::FilePath& user_data_dir); } // namespace os_crypt
diff --git a/components/os_crypt/keychain_password_mac.h b/components/os_crypt/keychain_password_mac.h index 2de865114..b7e54bd 100644 --- a/components/os_crypt/keychain_password_mac.h +++ b/components/os_crypt/keychain_password_mac.h
@@ -7,13 +7,14 @@ #include <string> +#include "base/component_export.h" #include "base/macros.h" namespace crypto { class AppleKeychain; } -class KeychainPassword { +class COMPONENT_EXPORT(OS_CRYPT) KeychainPassword { public: explicit KeychainPassword(const crypto::AppleKeychain& keychain) : keychain_(keychain) { @@ -28,8 +29,8 @@ std::string GetPassword() const; // The service and account names used in Chrome's Safe Storage keychain item. - static const char service_name[]; - static const char account_name[]; + static COMPONENT_EXPORT(OS_CRYPT) const char service_name[]; + static COMPONENT_EXPORT(OS_CRYPT) const char account_name[]; private: const crypto::AppleKeychain& keychain_;
diff --git a/components/os_crypt/keyring_util_linux.h b/components/os_crypt/keyring_util_linux.h index fccde49f..e7fd4b8 100644 --- a/components/os_crypt/keyring_util_linux.h +++ b/components/os_crypt/keyring_util_linux.h
@@ -17,6 +17,7 @@ #define GNOME_KEYRING_DEPRECATED_FOR(x) #include <gnome-keyring.h> +#include "base/component_export.h" #include "base/macros.h" // Many of the gnome_keyring_* functions use variable arguments, which makes @@ -28,40 +29,46 @@ // functions. Note that it has only static fields. class GnomeKeyringLoader { public: - static bool LoadGnomeKeyring(); + static COMPONENT_EXPORT(OS_CRYPT) bool LoadGnomeKeyring(); // Declare the actual function pointers that we'll use in client code. // These functions will contact the service. - static decltype(&::gnome_keyring_is_available) gnome_keyring_is_available_ptr; - static decltype( - &::gnome_keyring_store_password) gnome_keyring_store_password_ptr; - static decltype( - &::gnome_keyring_delete_password) gnome_keyring_delete_password_ptr; - static decltype(&::gnome_keyring_find_items) gnome_keyring_find_items_ptr; - static decltype( + static COMPONENT_EXPORT(OS_CRYPT) decltype(&::gnome_keyring_is_available) + gnome_keyring_is_available_ptr; + static COMPONENT_EXPORT(OS_CRYPT) decltype(&::gnome_keyring_store_password) + gnome_keyring_store_password_ptr; + static COMPONENT_EXPORT(OS_CRYPT) decltype(&::gnome_keyring_delete_password) + gnome_keyring_delete_password_ptr; + static COMPONENT_EXPORT(OS_CRYPT) decltype(&::gnome_keyring_find_items) + gnome_keyring_find_items_ptr; + static COMPONENT_EXPORT(OS_CRYPT) decltype( &::gnome_keyring_find_password_sync) gnome_keyring_find_password_sync_ptr; - static decltype(&::gnome_keyring_store_password_sync) + static COMPONENT_EXPORT(OS_CRYPT) decltype( + &::gnome_keyring_store_password_sync) gnome_keyring_store_password_sync_ptr; // These functions do not contact the service. - static decltype( - &::gnome_keyring_result_to_message) gnome_keyring_result_to_message_ptr; - static decltype(&::gnome_keyring_attribute_list_free) + static COMPONENT_EXPORT(OS_CRYPT) decltype(&::gnome_keyring_result_to_message) + gnome_keyring_result_to_message_ptr; + static COMPONENT_EXPORT(OS_CRYPT) decltype( + &::gnome_keyring_attribute_list_free) gnome_keyring_attribute_list_free_ptr; - static decltype( + static COMPONENT_EXPORT(OS_CRYPT) decltype( &::gnome_keyring_attribute_list_new) gnome_keyring_attribute_list_new_ptr; - static decltype(&::gnome_keyring_attribute_list_append_string) + static COMPONENT_EXPORT(OS_CRYPT) decltype( + &::gnome_keyring_attribute_list_append_string) gnome_keyring_attribute_list_append_string_ptr; - static decltype(&::gnome_keyring_attribute_list_append_uint32) + static COMPONENT_EXPORT(OS_CRYPT) decltype( + &::gnome_keyring_attribute_list_append_uint32) gnome_keyring_attribute_list_append_uint32_ptr; - static decltype( - &::gnome_keyring_free_password) gnome_keyring_free_password_ptr; + static COMPONENT_EXPORT(OS_CRYPT) decltype(&::gnome_keyring_free_password) + gnome_keyring_free_password_ptr; // We also use gnome_keyring_attribute_list_index(), which is a macro and // can't be referenced. protected: // Set to true if LoadGnomeKeyring() has already succeeded. - static bool keyring_loaded; + static COMPONENT_EXPORT(OS_CRYPT) bool keyring_loaded; private: struct FunctionInfo {
diff --git a/components/os_crypt/kwallet_dbus.h b/components/os_crypt/kwallet_dbus.h index e5366ecb..1518e3f 100644 --- a/components/os_crypt/kwallet_dbus.h +++ b/components/os_crypt/kwallet_dbus.h
@@ -8,6 +8,7 @@ #include <string> #include <vector> +#include "base/component_export.h" #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/nix/xdg_util.h" @@ -18,7 +19,7 @@ } // Contains wrappers for dbus invocations related to KWallet. -class KWalletDBus { +class COMPONENT_EXPORT(OS_CRYPT) KWalletDBus { public: // Error code for dbus calls to kwallet. enum Error { SUCCESS = 0, CANNOT_CONTACT, CANNOT_READ };
diff --git a/components/os_crypt/libsecret_util_linux.h b/components/os_crypt/libsecret_util_linux.h index 6711340d0..256d50f 100644 --- a/components/os_crypt/libsecret_util_linux.h +++ b/components/os_crypt/libsecret_util_linux.h
@@ -10,23 +10,32 @@ #include <list> #include <string> +#include "base/component_export.h" #include "base/macros.h" // Utility for dynamically loading libsecret. class LibsecretLoader { public: - static decltype(&::secret_item_get_attributes) secret_item_get_attributes; - static decltype(&::secret_item_get_secret) secret_item_get_secret; - static decltype(&::secret_item_load_secret_sync) secret_item_load_secret_sync; - static decltype(&::secret_password_clear_sync) secret_password_clear_sync; - static decltype(&::secret_password_store_sync) secret_password_store_sync; - static decltype(&::secret_service_search_sync) secret_service_search_sync; - static decltype(&::secret_value_get_text) secret_value_get_text; - static decltype(&::secret_value_unref) secret_value_unref; + static COMPONENT_EXPORT(OS_CRYPT) decltype(&::secret_item_get_attributes) + secret_item_get_attributes; + static COMPONENT_EXPORT(OS_CRYPT) decltype(&::secret_item_get_secret) + secret_item_get_secret; + static COMPONENT_EXPORT(OS_CRYPT) decltype(&::secret_item_load_secret_sync) + secret_item_load_secret_sync; + static COMPONENT_EXPORT(OS_CRYPT) decltype(&::secret_password_clear_sync) + secret_password_clear_sync; + static COMPONENT_EXPORT(OS_CRYPT) decltype(&::secret_password_store_sync) + secret_password_store_sync; + static COMPONENT_EXPORT(OS_CRYPT) decltype(&::secret_service_search_sync) + secret_service_search_sync; + static COMPONENT_EXPORT(OS_CRYPT) decltype(&::secret_value_get_text) + secret_value_get_text; + static COMPONENT_EXPORT(OS_CRYPT) decltype(&::secret_value_unref) + secret_value_unref; // Wrapper for secret_service_search_sync that prevents common leaks. See // https://crbug.com/393395. - class SearchHelper { + class COMPONENT_EXPORT(OS_CRYPT) SearchHelper { public: SearchHelper(); ~SearchHelper(); @@ -51,14 +60,14 @@ // Returns false if either step fails. // Repeated calls check the responsiveness every time, but do not load the // the library again if already successful. - static bool EnsureLibsecretLoaded(); + static COMPONENT_EXPORT(OS_CRYPT) bool EnsureLibsecretLoaded(); // Ensure that the default keyring is accessible. This won't prevent the user // from locking their keyring while Chrome is running. - static void EnsureKeyringUnlocked(); + static COMPONENT_EXPORT(OS_CRYPT) void EnsureKeyringUnlocked(); protected: - static bool libsecret_loaded_; + static COMPONENT_EXPORT(OS_CRYPT) bool libsecret_loaded_; private: struct FunctionInfo { @@ -82,7 +91,7 @@ DISALLOW_IMPLICIT_CONSTRUCTORS(LibsecretLoader); }; -class LibsecretAttributesBuilder { +class COMPONENT_EXPORT(OS_CRYPT) LibsecretAttributesBuilder { public: LibsecretAttributesBuilder(); ~LibsecretAttributesBuilder();
diff --git a/components/os_crypt/os_crypt.h b/components/os_crypt/os_crypt.h index 4881a93d..6cde7ca 100644 --- a/components/os_crypt/os_crypt.h +++ b/components/os_crypt/os_crypt.h
@@ -8,15 +8,16 @@ #include <memory> #include <string> +#include "base/component_export.h" #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/single_thread_task_runner.h" #include "base/strings/string16.h" #include "build/build_config.h" -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(UNIT_TEST) +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) class KeyStorageLinux; -#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(UNIT_TEST) +#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) namespace os_crypt { struct Config; @@ -30,7 +31,8 @@ public: #if defined(OS_LINUX) && !defined(OS_CHROMEOS) // Set the configuration of OSCrypt. - static void SetConfig(std::unique_ptr<os_crypt::Config> config); + static COMPONENT_EXPORT(OS_CRYPT) void SetConfig( + std::unique_ptr<os_crypt::Config> config); #endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) #if defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) @@ -38,60 +40,67 @@ // available. On MacOS returns true if Keychain is available (for mock // Keychain it returns true if not using locked Keychain, false if using // locked mock Keychain). - static bool IsEncryptionAvailable(); + static COMPONENT_EXPORT(OS_CRYPT) bool IsEncryptionAvailable(); #endif // Encrypt a string16. The output (second argument) is really an array of // bytes, but we're passing it back as a std::string. - static bool EncryptString16(const base::string16& plaintext, - std::string* ciphertext); + static COMPONENT_EXPORT(OS_CRYPT) bool EncryptString16( + const base::string16& plaintext, + std::string* ciphertext); // Decrypt an array of bytes obtained with EncryptString16 back into a // string16. Note that the input (first argument) is a std::string, so you // need to first get your (binary) data into a string. - static bool DecryptString16(const std::string& ciphertext, - base::string16* plaintext); + static COMPONENT_EXPORT(OS_CRYPT) bool DecryptString16( + const std::string& ciphertext, + base::string16* plaintext); // Encrypt a string. - static bool EncryptString(const std::string& plaintext, - std::string* ciphertext); + static COMPONENT_EXPORT(OS_CRYPT) bool EncryptString( + const std::string& plaintext, + std::string* ciphertext); // Decrypt an array of bytes obtained with EnctryptString back into a string. // Note that the input (first argument) is a std::string, so you need to first // get your (binary) data into a string. - static bool DecryptString(const std::string& ciphertext, - std::string* plaintext); + static COMPONENT_EXPORT(OS_CRYPT) bool DecryptString( + const std::string& ciphertext, + std::string* plaintext); #if defined(OS_MACOSX) // For unit testing purposes we instruct the Encryptor to use a mock Keychain // on the Mac. The default is to use the real Keychain. Use OSCryptMocker, // instead of calling this method directly. - static void UseMockKeychainForTesting(bool use_mock); + static COMPONENT_EXPORT(OS_CRYPT) void UseMockKeychainForTesting( + bool use_mock); // When Keychain is locked, it's not possible to get the encryption key. This // is used only for testing purposes. Enabling locked Keychain also enables // mock Keychain. Use OSCryptMocker, instead of calling this method directly. - static void UseLockedMockKeychainForTesting(bool use_locked); + static COMPONENT_EXPORT(OS_CRYPT) void UseLockedMockKeychainForTesting( + bool use_locked); #endif private: DISALLOW_IMPLICIT_CONSTRUCTORS(OSCrypt); }; -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(UNIT_TEST) +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) // For unit testing purposes, inject methods to be used. // |get_key_storage_mock| provides the desired |KeyStorage| implementation. // If the provider returns |nullptr|, a hardcoded password will be used. // |get_password_v11_mock| provides a password to derive the encryption key from // If one parameter is |nullptr|, the function will be not be replaced. // If all parameters are |nullptr|, the real implementation is restored. +COMPONENT_EXPORT(OS_CRYPT) void UseMockKeyStorageForTesting( std::unique_ptr<KeyStorageLinux> (*get_key_storage_mock)(), std::string* (*get_password_v11_mock)()); // Clears any caching and most lazy initialisations performed by the production // code. Should be used after any test which required a password. -void ClearCacheForTesting(); -#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(UNIT_TEST) +COMPONENT_EXPORT(OS_CRYPT) void ClearCacheForTesting(); +#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) #endif // COMPONENTS_OS_CRYPT_OS_CRYPT_H_
diff --git a/components/os_crypt/os_crypt_switches.h b/components/os_crypt/os_crypt_switches.h index 55294469..e442890 100644 --- a/components/os_crypt/os_crypt_switches.h +++ b/components/os_crypt/os_crypt_switches.h
@@ -7,6 +7,7 @@ // Defines all the command-line switches used by the encryptor component. +#include "base/component_export.h" #include "build/build_config.h" namespace os_crypt { @@ -16,7 +17,7 @@ // Uses mock keychain for testing purposes, which prevents blocking dialogs // from causing timeouts. -extern const char kUseMockKeychain[]; +COMPONENT_EXPORT(OS_CRYPT) extern const char kUseMockKeychain[]; #endif // OS_MACOSX
diff --git a/components/os_crypt/os_crypt_unittest.cc b/components/os_crypt/os_crypt_unittest.cc index f3ef01fe..753d3fc 100644 --- a/components/os_crypt/os_crypt_unittest.cc +++ b/components/os_crypt/os_crypt_unittest.cc
@@ -170,7 +170,7 @@ // Make calls. for (base::Thread* thread : threads) { ASSERT_TRUE(thread->task_runner()->PostTask( - FROM_HERE, base::Bind([]() -> void { + FROM_HERE, base::BindOnce([]() -> void { std::string plaintext = "secrets"; std::string encrypted; std::string decrypted;
diff --git a/components/ownership/owner_settings_service.cc b/components/ownership/owner_settings_service.cc index 49b0b3aa..5ecbe42 100644 --- a/components/ownership/owner_settings_service.cc +++ b/components/ownership/owner_settings_service.cc
@@ -97,7 +97,7 @@ DCHECK(thread_checker_.CalledOnValidThread()); if (private_key_.get()) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, IsOwner())); + FROM_HERE, base::BindOnce(callback, IsOwner())); } else { pending_is_owner_callbacks_.push_back(callback); }
diff --git a/components/pairing/fake_controller_pairing_controller.cc b/components/pairing/fake_controller_pairing_controller.cc index 2eca750..d72f2f1 100644 --- a/components/pairing/fake_controller_pairing_controller.cc +++ b/components/pairing/fake_controller_pairing_controller.cc
@@ -239,8 +239,9 @@ void FakeControllerPairingController::ChangeStageLater(Stage new_stage) { base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, base::Bind(&FakeControllerPairingController::ChangeStage, - base::Unretained(this), new_stage), + FROM_HERE, + base::BindOnce(&FakeControllerPairingController::ChangeStage, + base::Unretained(this), new_stage), async_duration_); } @@ -269,8 +270,8 @@ } base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::Bind(&FakeControllerPairingController::ExecuteDiscoveryEvent, - base::Unretained(this), event_position), + base::BindOnce(&FakeControllerPairingController::ExecuteDiscoveryEvent, + base::Unretained(this), event_position), async_duration_); } @@ -296,8 +297,9 @@ discovered_devices_.clear(); base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::Bind(&FakeControllerPairingController::ExecuteDiscoveryEvent, - base::Unretained(this), 0), + base::BindOnce( + &FakeControllerPairingController::ExecuteDiscoveryEvent, + base::Unretained(this), 0), async_duration_); break; }
diff --git a/components/pairing/fake_host_pairing_controller.cc b/components/pairing/fake_host_pairing_controller.cc index b6bfc5c..fef253cb5 100644 --- a/components/pairing/fake_host_pairing_controller.cc +++ b/components/pairing/fake_host_pairing_controller.cc
@@ -86,8 +86,9 @@ void FakeHostPairingController::ChangeStageLater(Stage new_stage) { base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, base::Bind(&FakeHostPairingController::ChangeStage, - base::Unretained(this), new_stage), + FROM_HERE, + base::BindOnce(&FakeHostPairingController::ChangeStage, + base::Unretained(this), new_stage), async_duration_); }
diff --git a/components/password_manager/content/browser/DEPS b/components/password_manager/content/browser/DEPS index 8f2c2b7..5227e41 100644 --- a/components/password_manager/content/browser/DEPS +++ b/components/password_manager/content/browser/DEPS
@@ -7,4 +7,5 @@ "+content/public/browser", "+net", "+services/service_manager/public/cpp", + "+third_party/blink/public/common", ]
diff --git a/components/password_manager/content/browser/content_credential_manager.cc b/components/password_manager/content/browser/content_credential_manager.cc index 99aa19e..16f49f4 100644 --- a/components/password_manager/content/browser/content_credential_manager.cc +++ b/components/password_manager/content/browser/content_credential_manager.cc
@@ -29,7 +29,7 @@ // case the renderer will try to reconnect when the next call to the API is // made. Make sure this implementation will no longer be bound to a broken // pipe once that happens, so the DCHECK above will succeed. - binding_.set_connection_error_handler(base::Bind( + binding_.set_connection_error_handler(base::BindOnce( &ContentCredentialManager::DisconnectBinding, base::Unretained(this))); }
diff --git a/components/password_manager/content/browser/content_password_manager_driver.cc b/components/password_manager/content/browser/content_password_manager_driver.cc index ddd9ca6c..01e47dd0 100644 --- a/components/password_manager/content/browser/content_password_manager_driver.cc +++ b/components/password_manager/content/browser/content_password_manager_driver.cc
@@ -22,7 +22,7 @@ #include "content/public/browser/ssl_status.h" #include "content/public/browser/web_contents.h" #include "net/cert/cert_status_flags.h" -#include "services/service_manager/public/cpp/interface_provider.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" namespace password_manager { @@ -130,8 +130,8 @@ void ContentPasswordManagerDriver::ForceSavePassword() { GetPasswordAutofillAgent()->FindFocusedPasswordForm( - base::Bind(&ContentPasswordManagerDriver::OnFocusedPasswordFormFound, - weak_factory_.GetWeakPtr())); + base::BindOnce(&ContentPasswordManagerDriver::OnFocusedPasswordFormFound, + weak_factory_.GetWeakPtr())); } void ContentPasswordManagerDriver::GeneratePassword() { @@ -185,7 +185,7 @@ GetPasswordManager()->OnPasswordFormForceSaveRequested(this, password_form); } -const autofill::mojom::AutofillAgentPtr& +const autofill::mojom::AutofillAgentAssociatedPtr& ContentPasswordManagerDriver::GetAutofillAgent() { autofill::ContentAutofillDriver* autofill_driver = autofill::ContentAutofillDriver::GetForRenderFrameHost( @@ -194,13 +194,13 @@ return autofill_driver->GetAutofillAgent(); } -const autofill::mojom::PasswordAutofillAgentPtr& +const autofill::mojom::PasswordAutofillAgentAssociatedPtr& ContentPasswordManagerDriver::GetPasswordAutofillAgent() { if (!password_autofill_agent_) { auto request = mojo::MakeRequest(&password_autofill_agent_); // Some test environments may have no remote interface support. - if (render_frame_host_->GetRemoteInterfaces()) { - render_frame_host_->GetRemoteInterfaces()->GetInterface( + if (render_frame_host_->GetRemoteAssociatedInterfaces()) { + render_frame_host_->GetRemoteAssociatedInterfaces()->GetInterface( std::move(request)); } } @@ -208,10 +208,10 @@ return password_autofill_agent_; } -const autofill::mojom::PasswordGenerationAgentPtr& +const autofill::mojom::PasswordGenerationAgentAssociatedPtr& ContentPasswordManagerDriver::GetPasswordGenerationAgent() { if (!password_gen_agent_) { - render_frame_host_->GetRemoteInterfaces()->GetInterface( + render_frame_host_->GetRemoteAssociatedInterfaces()->GetInterface( mojo::MakeRequest(&password_gen_agent_)); }
diff --git a/components/password_manager/content/browser/content_password_manager_driver.h b/components/password_manager/content/browser/content_password_manager_driver.h index 6e85cdc..54ed37fe 100644 --- a/components/password_manager/content/browser/content_password_manager_driver.h +++ b/components/password_manager/content/browser/content_password_manager_driver.h
@@ -82,11 +82,12 @@ private: void OnFocusedPasswordFormFound(const autofill::PasswordForm& password_form); - const autofill::mojom::AutofillAgentPtr& GetAutofillAgent(); + const autofill::mojom::AutofillAgentAssociatedPtr& GetAutofillAgent(); - const autofill::mojom::PasswordAutofillAgentPtr& GetPasswordAutofillAgent(); + const autofill::mojom::PasswordAutofillAgentAssociatedPtr& + GetPasswordAutofillAgent(); - const autofill::mojom::PasswordGenerationAgentPtr& + const autofill::mojom::PasswordGenerationAgentAssociatedPtr& GetPasswordGenerationAgent(); // Returns the next key to be used for PasswordFormFillData sent to @@ -111,9 +112,9 @@ // frame. const bool is_main_frame_; - autofill::mojom::PasswordAutofillAgentPtr password_autofill_agent_; + autofill::mojom::PasswordAutofillAgentAssociatedPtr password_autofill_agent_; - autofill::mojom::PasswordGenerationAgentPtr password_gen_agent_; + autofill::mojom::PasswordGenerationAgentAssociatedPtr password_gen_agent_; base::WeakPtrFactory<ContentPasswordManagerDriver> weak_factory_;
diff --git a/components/password_manager/content/browser/content_password_manager_driver_unittest.cc b/components/password_manager/content/browser/content_password_manager_driver_unittest.cc index 428462db..765a9ad 100644 --- a/components/password_manager/content/browser/content_password_manager_driver_unittest.cc +++ b/components/password_manager/content/browser/content_password_manager_driver_unittest.cc
@@ -19,10 +19,11 @@ #include "content/public/browser/web_contents.h" #include "content/public/test/test_renderer_host.h" #include "content/public/test/web_contents_tester.h" -#include "mojo/public/cpp/bindings/binding.h" +#include "mojo/public/cpp/bindings/associated_binding.h" #include "services/service_manager/public/cpp/interface_provider.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" using autofill::PasswordForm; using autofill::PasswordFormFillData; @@ -63,9 +64,9 @@ ~FakePasswordAutofillAgent() override {} - void BindRequest(mojo::ScopedMessagePipeHandle handle) { - binding_.Bind( - autofill::mojom::PasswordAutofillAgentRequest(std::move(handle))); + void BindRequest(mojo::ScopedInterfaceEndpointHandle handle) { + binding_.Bind(autofill::mojom::PasswordAutofillAgentAssociatedRequest( + std::move(handle))); } bool called_set_logging_state() { return called_set_logging_state_; } @@ -102,7 +103,7 @@ // Records data received via SetLoggingState() call. bool logging_state_active_; - mojo::Binding<autofill::mojom::PasswordAutofillAgent> binding_; + mojo::AssociatedBinding<autofill::mojom::PasswordAutofillAgent> binding_; }; PasswordFormFillData GetTestPasswordFormFillData() { @@ -155,10 +156,9 @@ ON_CALL(password_manager_client_, GetLogManager()) .WillByDefault(Return(&log_manager_)); - service_manager::InterfaceProvider* remote_interfaces = - web_contents()->GetMainFrame()->GetRemoteInterfaces(); - service_manager::InterfaceProvider::TestApi test_api(remote_interfaces); - test_api.SetBinderForName( + blink::AssociatedInterfaceProvider* remote_interfaces = + web_contents()->GetMainFrame()->GetRemoteAssociatedInterfaces(); + remote_interfaces->OverrideBinderForTesting( autofill::mojom::PasswordAutofillAgent::Name_, base::Bind(&FakePasswordAutofillAgent::BindRequest, base::Unretained(&fake_agent_))); @@ -229,10 +229,11 @@ new ContentPasswordManagerDriver(main_rfh(), &password_manager_client_, &autofill_client_)); - PasswordFormFillData fill_data = GetTestPasswordFormFillData(); - fill_data.wait_for_username = true; - EXPECT_CALL(fake_agent_, FillPasswordForm(_, WerePasswordsCleared())); - driver->FillPasswordForm(fill_data); + PasswordFormFillData fill_data = GetTestPasswordFormFillData(); + fill_data.wait_for_username = true; + EXPECT_CALL(fake_agent_, FillPasswordForm(_, WerePasswordsCleared())); + driver->FillPasswordForm(fill_data); + base::RunLoop().RunUntilIdle(); } TEST_F(ContentPasswordManagerDriverTest, NotInformAboutBlacklistedForm) {
diff --git a/components/password_manager/core/browser/android_affiliation/affiliated_match_helper.cc b/components/password_manager/core/browser/android_affiliation/affiliated_match_helper.cc index 7737748..fbef010d 100644 --- a/components/password_manager/core/browser/android_affiliation/affiliated_match_helper.cc +++ b/components/password_manager/core/browser/android_affiliation/affiliated_match_helper.cc
@@ -52,8 +52,8 @@ DCHECK(affiliation_service_); base::SequencedTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::Bind(&AffiliatedMatchHelper::DoDeferredInitialization, - weak_ptr_factory_.GetWeakPtr()), + base::BindOnce(&AffiliatedMatchHelper::DoDeferredInitialization, + weak_ptr_factory_.GetWeakPtr()), kInitializationDelayOnStartup); }
diff --git a/components/password_manager/core/browser/android_affiliation/affiliation_backend.cc b/components/password_manager/core/browser/android_affiliation/affiliation_backend.cc index 4d6014e..0fd98427 100644 --- a/components/password_manager/core/browser/android_affiliation/affiliation_backend.cc +++ b/components/password_manager/core/browser/android_affiliation/affiliation_backend.cc
@@ -171,8 +171,8 @@ // callback. crbug.com/437865. task_runner_->PostDelayedTask( FROM_HERE, - base::Bind(&AffiliationBackend::OnSendNotification, - weak_ptr_factory_.GetWeakPtr(), facet_uri), + base::BindOnce(&AffiliationBackend::OnSendNotification, + weak_ptr_factory_.GetWeakPtr(), facet_uri), time - clock_->Now()); }
diff --git a/components/password_manager/core/browser/android_affiliation/affiliation_fetch_throttler.cc b/components/password_manager/core/browser/android_affiliation/affiliation_fetch_throttler.cc index 0f797e4..c2a1565 100644 --- a/components/password_manager/core/browser/android_affiliation/affiliation_fetch_throttler.cc +++ b/components/password_manager/core/browser/android_affiliation/affiliation_fetch_throttler.cc
@@ -97,8 +97,8 @@ is_fetch_scheduled_ = true; task_runner_->PostDelayedTask( FROM_HERE, - base::Bind(&AffiliationFetchThrottler::OnBackoffDelayExpiredCallback, - weak_ptr_factory_.GetWeakPtr()), + base::BindOnce(&AffiliationFetchThrottler::OnBackoffDelayExpiredCallback, + weak_ptr_factory_.GetWeakPtr()), exponential_backoff_->GetTimeUntilRelease()); }
diff --git a/components/password_manager/core/browser/android_affiliation/affiliation_service.cc b/components/password_manager/core/browser/android_affiliation/affiliation_service.cc index 0b469df..5e1b1cd 100644 --- a/components/password_manager/core/browser/android_affiliation/affiliation_service.cc +++ b/components/password_manager/core/browser/android_affiliation/affiliation_service.cc
@@ -56,9 +56,9 @@ DCHECK(backend_); backend_task_runner_->PostTask( FROM_HERE, - base::Bind(&AffiliationBackend::GetAffiliationsAndBranding, - base::Unretained(backend_), facet_uri, cache_miss_strategy, - result_callback, base::SequencedTaskRunnerHandle::Get())); + base::BindOnce(&AffiliationBackend::GetAffiliationsAndBranding, + base::Unretained(backend_), facet_uri, cache_miss_strategy, + result_callback, base::SequencedTaskRunnerHandle::Get())); } void AffiliationService::Prefetch(const FacetURI& facet_uri, @@ -67,8 +67,8 @@ DCHECK(backend_); backend_task_runner_->PostTask( FROM_HERE, - base::Bind(&AffiliationBackend::Prefetch, base::Unretained(backend_), - facet_uri, keep_fresh_until)); + base::BindOnce(&AffiliationBackend::Prefetch, base::Unretained(backend_), + facet_uri, keep_fresh_until)); } void AffiliationService::CancelPrefetch(const FacetURI& facet_uri, @@ -77,16 +77,16 @@ DCHECK(backend_); backend_task_runner_->PostTask( FROM_HERE, - base::Bind(&AffiliationBackend::CancelPrefetch, - base::Unretained(backend_), facet_uri, keep_fresh_until)); + base::BindOnce(&AffiliationBackend::CancelPrefetch, + base::Unretained(backend_), facet_uri, keep_fresh_until)); } void AffiliationService::TrimCacheForFacetURI(const FacetURI& facet_uri) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(backend_); backend_task_runner_->PostTask( - FROM_HERE, base::Bind(&AffiliationBackend::TrimCacheForFacetURI, - base::Unretained(backend_), facet_uri)); + FROM_HERE, base::BindOnce(&AffiliationBackend::TrimCacheForFacetURI, + base::Unretained(backend_), facet_uri)); } } // namespace password_manager
diff --git a/components/password_manager/core/browser/android_affiliation/facet_manager.cc b/components/password_manager/core/browser/android_affiliation/facet_manager.cc index af4c891..6a76789 100644 --- a/components/password_manager/core/browser/android_affiliation/facet_manager.cc +++ b/components/password_manager/core/browser/android_affiliation/facet_manager.cc
@@ -239,13 +239,14 @@ const RequestInfo& request_info, const AffiliatedFacets& affiliation) { request_info.callback_task_runner->PostTask( - FROM_HERE, base::Bind(request_info.callback, affiliation, true)); + FROM_HERE, base::BindOnce(request_info.callback, affiliation, true)); } // static void FacetManager::ServeRequestWithFailure(const RequestInfo& request_info) { request_info.callback_task_runner->PostTask( - FROM_HERE, base::Bind(request_info.callback, AffiliatedFacets(), false)); + FROM_HERE, + base::BindOnce(request_info.callback, AffiliatedFacets(), false)); } } // namespace password_manager
diff --git a/components/password_manager/core/browser/android_affiliation/facet_manager_unittest.cc b/components/password_manager/core/browser/android_affiliation/facet_manager_unittest.cc index 95b2e07..4a3269e 100644 --- a/components/password_manager/core/browser/android_affiliation/facet_manager_unittest.cc +++ b/components/password_manager/core/browser/android_affiliation/facet_manager_unittest.cc
@@ -59,8 +59,9 @@ return; } task_runner_->PostDelayedTask( - FROM_HERE, base::Bind(&FacetManager::NotifyAtRequestedTime, - base::Unretained(facet_manager_)), + FROM_HERE, + base::BindOnce(&FacetManager::NotifyAtRequestedTime, + base::Unretained(facet_manager_)), delay); } @@ -274,8 +275,9 @@ void SchedulePrefetch(base::Time start, base::Time end) { main_task_runner_->PostDelayedTask( - FROM_HERE, base::Bind(&FacetManager::Prefetch, - base::Unretained(facet_manager()), end), + FROM_HERE, + base::BindOnce(&FacetManager::Prefetch, + base::Unretained(facet_manager()), end), start - Now()); } @@ -283,8 +285,9 @@ base::Time original_end_of_prefetch) { main_task_runner_->PostDelayedTask( FROM_HERE, - base::Bind(&FacetManager::CancelPrefetch, - base::Unretained(facet_manager()), original_end_of_prefetch), + base::BindOnce(&FacetManager::CancelPrefetch, + base::Unretained(facet_manager()), + original_end_of_prefetch), cancellation_time - Now()); }
diff --git a/components/password_manager/core/browser/credential_manager_impl_unittest.cc b/components/password_manager/core/browser/credential_manager_impl_unittest.cc index c0daf53..4de1873 100644 --- a/components/password_manager/core/browser/credential_manager_impl_unittest.cc +++ b/components/password_manager/core/browser/credential_manager_impl_unittest.cc
@@ -102,7 +102,8 @@ const autofill::PasswordForm* form = local_forms[0].get(); base::SequencedTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(callback, base::Owned(new autofill::PasswordForm(*form)))); + base::BindOnce(callback, + base::Owned(new autofill::PasswordForm(*form)))); std::vector<autofill::PasswordForm*> raw_forms(local_forms.size()); std::transform(local_forms.begin(), local_forms.end(), raw_forms.begin(), [](const std::unique_ptr<autofill::PasswordForm>& form) { @@ -258,8 +259,9 @@ EXPECT_CALL(*client_, PromptUserToChooseCredentialsPtr(_, _, _)) .Times(testing::Exactly(0)); EXPECT_CALL(*client_, NotifyUserAutoSigninPtr()).Times(testing::Exactly(0)); - CallGet(mediation, include_passwords, federations, - base::Bind(&GetCredentialCallback, &called, &error, &credential)); + CallGet( + mediation, include_passwords, federations, + base::BindOnce(&GetCredentialCallback, &called, &error, &credential)); RunAllPendingTasks(); @@ -278,8 +280,9 @@ EXPECT_CALL(*client_, PromptUserToChooseCredentialsPtr(_, _, _)) .Times(testing::Exactly(0)); EXPECT_CALL(*client_, NotifyUserAutoSigninPtr()).Times(testing::Exactly(1)); - CallGet(mediation, include_passwords, federations, - base::Bind(&GetCredentialCallback, &called, &error, &credential)); + CallGet( + mediation, include_passwords, federations, + base::BindOnce(&GetCredentialCallback, &called, &error, &credential)); RunAllPendingTasks(); @@ -295,8 +298,9 @@ bool called = false; CredentialManagerError error; base::Optional<CredentialInfo> credential; - CallGet(mediation, include_passwords, federations, - base::Bind(&GetCredentialCallback, &called, &error, &credential)); + CallGet( + mediation, include_passwords, federations, + base::BindOnce(&GetCredentialCallback, &called, &error, &credential)); RunAllPendingTasks(); @@ -365,7 +369,7 @@ EXPECT_CALL(*client_, NotifyStorePasswordCalled()); bool called = false; - CallStore(info, base::Bind(&RespondCallback, &called)); + CallStore(info, base::BindOnce(&RespondCallback, &called)); // Allow the PasswordFormManager to talk to the password store, determine // that the form is new, and set it as pending. @@ -398,7 +402,7 @@ form_.password_value = base::string16(); form_.signon_realm = "federation://example.com/google.com"; CredentialInfo info(form_, CredentialType::CREDENTIAL_TYPE_FEDERATED); - CallStore(info, base::Bind(&RespondCallback, &called)); + CallStore(info, base::BindOnce(&RespondCallback, &called)); // Allow the PasswordFormManager to talk to the password store, determine // that the form is new, and set it as pending. @@ -437,7 +441,7 @@ EXPECT_CALL(*client_, NotifyStorePasswordCalled()); bool called = false; - CallStore(info, base::Bind(&RespondCallback, &called)); + CallStore(info, base::BindOnce(&RespondCallback, &called)); // Allow the PasswordFormManager to talk to the password store, determine // that the form is new, and set it as pending. @@ -477,7 +481,7 @@ EXPECT_CALL(*client_, PromptUserToSavePasswordPtr(_)).Times(0); EXPECT_CALL(*client_, NotifyStorePasswordCalled()); bool called = false; - CallStore(info, base::Bind(&RespondCallback, &called)); + CallStore(info, base::BindOnce(&RespondCallback, &called)); // Allow the PasswordFormManager to talk to the password store, determine // the form is a match for an existing form, and update the PasswordStore. @@ -513,7 +517,7 @@ .Times(testing::Exactly(0)); EXPECT_CALL(*client_, NotifyStorePasswordCalled()); bool called = false; - CallStore(info, base::Bind(&RespondCallback, &called)); + CallStore(info, base::BindOnce(&RespondCallback, &called)); RunAllPendingTasks(); EXPECT_TRUE(called); @@ -540,7 +544,7 @@ .Times(testing::Exactly(1)); EXPECT_CALL(*client_, NotifyStorePasswordCalled()); bool called = false; - CallStore(info, base::Bind(&RespondCallback, &called)); + CallStore(info, base::BindOnce(&RespondCallback, &called)); RunAllPendingTasks(); EXPECT_TRUE(called); @@ -572,7 +576,7 @@ .Times(testing::Exactly(1)); EXPECT_CALL(*client_, NotifyStorePasswordCalled()); bool called = false; - CallStore(info, base::Bind(&RespondCallback, &called)); + CallStore(info, base::BindOnce(&RespondCallback, &called)); RunAllPendingTasks(); EXPECT_TRUE(called); @@ -598,7 +602,7 @@ CredentialInfo info(form_, CredentialType::CREDENTIAL_TYPE_PASSWORD); bool called = false; EXPECT_CALL(*client_, NotifyStorePasswordCalled()); - CallStore(info, base::Bind(&RespondCallback, &called)); + CallStore(info, base::BindOnce(&RespondCallback, &called)); // Allow the PasswordFormManager to talk to the password store, determine // the form is a match for an existing form, and update the PasswordStore. @@ -623,7 +627,7 @@ CredentialInfo info(form_, CredentialType::CREDENTIAL_TYPE_FEDERATED); bool called = false; EXPECT_CALL(*client_, NotifyStorePasswordCalled()); - CallStore(info, base::Bind(&RespondCallback, &called)); + CallStore(info, base::BindOnce(&RespondCallback, &called)); // Allow the PasswordFormManager to talk to the password store, determine // the form is a match for an existing form, and update the PasswordStore. @@ -655,7 +659,7 @@ CredentialManagerError error; base::Optional<CredentialInfo> credential; CallGet(CredentialMediationRequirement::kOptional, true, federations, - base::Bind(&GetCredentialCallback, &called, &error, &credential)); + base::BindOnce(&GetCredentialCallback, &called, &error, &credential)); RunAllPendingTasks(); @@ -677,7 +681,7 @@ EXPECT_CALL(*client_, NotifyStorePasswordCalled()).Times(0); bool called = false; - CallStore(info, base::Bind(&RespondCallback, &called)); + CallStore(info, base::BindOnce(&RespondCallback, &called)); RunAllPendingTasks(); @@ -701,7 +705,7 @@ EXPECT_FALSE(passwords[cross_origin_form_.signon_realm][0].skip_zero_click); bool called = false; - CallPreventSilentAccess(base::Bind(&RespondCallback, &called)); + CallPreventSilentAccess(base::BindOnce(&RespondCallback, &called)); RunAllPendingTasks(); @@ -730,7 +734,7 @@ EXPECT_FALSE(passwords[form_.signon_realm][0].skip_zero_click); bool called = false; - CallPreventSilentAccess(base::Bind(&RespondCallback, &called)); + CallPreventSilentAccess(base::BindOnce(&RespondCallback, &called)); RunAllPendingTasks(); EXPECT_TRUE(called); @@ -767,7 +771,7 @@ EXPECT_FALSE(passwords[affiliated_form2_.signon_realm][0].skip_zero_click); bool called = false; - CallPreventSilentAccess(base::Bind(&RespondCallback, &called)); + CallPreventSilentAccess(base::BindOnce(&RespondCallback, &called)); RunAllPendingTasks(); passwords = store_->stored_passwords(); @@ -891,7 +895,7 @@ std::vector<GURL> federations; federations.push_back(GURL("https://google.com/")); CallGet(CredentialMediationRequirement::kOptional, true, federations, - base::Bind(&GetCredentialCallback, &called, &error, &credential)); + base::BindOnce(&GetCredentialCallback, &called, &error, &credential)); RunAllPendingTasks(); } @@ -925,7 +929,7 @@ CredentialManagerError error; base::Optional<CredentialInfo> credential; CallGet(CredentialMediationRequirement::kOptional, true, federations, - base::Bind(&GetCredentialCallback, &called, &error, &credential)); + base::BindOnce(&GetCredentialCallback, &called, &error, &credential)); RunAllPendingTasks(); @@ -1212,16 +1216,16 @@ bool called_1 = false; CredentialManagerError error_1; base::Optional<CredentialInfo> credential_1; - CallGet( - CredentialMediationRequirement::kOptional, true, federations, - base::Bind(&GetCredentialCallback, &called_1, &error_1, &credential_1)); + CallGet(CredentialMediationRequirement::kOptional, true, federations, + base::BindOnce(&GetCredentialCallback, &called_1, &error_1, + &credential_1)); // 2nd request. bool called_2 = false; CredentialManagerError error_2; base::Optional<CredentialInfo> credential_2; - CallGet( - CredentialMediationRequirement::kOptional, true, federations, - base::Bind(&GetCredentialCallback, &called_2, &error_2, &credential_2)); + CallGet(CredentialMediationRequirement::kOptional, true, federations, + base::BindOnce(&GetCredentialCallback, &called_2, &error_2, + &credential_2)); EXPECT_CALL(*client_, PromptUserToChooseCredentialsPtr(_, _, _)) .Times(testing::Exactly(1)); @@ -1278,7 +1282,7 @@ CredentialManagerError error; base::Optional<CredentialInfo> credential; CallGet(CredentialMediationRequirement::kOptional, true, federations, - base::Bind(&GetCredentialCallback, &called, &error, &credential)); + base::BindOnce(&GetCredentialCallback, &called, &error, &credential)); RunAllPendingTasks(); @@ -1314,7 +1318,7 @@ CredentialManagerError error; base::Optional<CredentialInfo> credential; CallGet(CredentialMediationRequirement::kOptional, true, std::vector<GURL>(), - base::Bind(&GetCredentialCallback, &called, &error, &credential)); + base::BindOnce(&GetCredentialCallback, &called, &error, &credential)); RunAllPendingTasks(); @@ -1490,7 +1494,7 @@ .Times(testing::Exactly(1)); EXPECT_CALL(*client_, NotifyUserAutoSigninPtr()).Times(testing::Exactly(0)); CallGet(CredentialMediationRequirement::kRequired, true, federations, - base::Bind(&GetCredentialCallback, &called, &error, &credential)); + base::BindOnce(&GetCredentialCallback, &called, &error, &credential)); RunAllPendingTasks(); @@ -1530,7 +1534,7 @@ CredentialInfo info(form_, CredentialType::CREDENTIAL_TYPE_PASSWORD); bool called = false; - CallStore(info, base::Bind(&RespondCallback, &called)); + CallStore(info, base::BindOnce(&RespondCallback, &called)); // Allow the PasswordFormManager to talk to the password store RunAllPendingTasks(); @@ -1558,7 +1562,7 @@ EXPECT_CALL(*client_, PromptUserToSavePasswordPtr(_)); CredentialInfo info(form_, CredentialType::CREDENTIAL_TYPE_FEDERATED); bool called = false; - CallStore(info, base::Bind(&RespondCallback, &called)); + CallStore(info, base::BindOnce(&RespondCallback, &called)); // Allow the PasswordFormManager to talk to the password store RunAllPendingTasks(); @@ -1591,7 +1595,7 @@ CredentialInfo info(form_, CredentialType::CREDENTIAL_TYPE_PASSWORD); bool called = false; EXPECT_CALL(*client_, PromptUserToSavePasswordPtr(_)); - CallStore(info, base::Bind(&RespondCallback, &called)); + CallStore(info, base::BindOnce(&RespondCallback, &called)); // Allow the PasswordFormManager to talk to the password store RunAllPendingTasks(); @@ -1612,7 +1616,7 @@ CredentialInfo info(form_, CredentialType::CREDENTIAL_TYPE_FEDERATED); bool called = false; EXPECT_CALL(*client_, PromptUserToSavePasswordPtr(_)); - CallStore(info, base::Bind(&RespondCallback, &called)); + CallStore(info, base::BindOnce(&RespondCallback, &called)); // Allow the PasswordFormManager to talk to the password store RunAllPendingTasks();
diff --git a/components/password_manager/core/browser/credential_manager_password_form_manager.cc b/components/password_manager/core/browser/credential_manager_password_form_manager.cc index db5408e5..e1bdd71 100644 --- a/components/password_manager/core/browser/credential_manager_password_form_manager.cc +++ b/components/password_manager/core/browser/credential_manager_password_form_manager.cc
@@ -63,8 +63,8 @@ // used after free. Therefore the call is posted to a separate task. base::SequencedTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(&CredentialManagerPasswordFormManager::NotifyDelegate, - weak_factory_.GetWeakPtr())); + base::BindOnce(&CredentialManagerPasswordFormManager::NotifyDelegate, + weak_factory_.GetWeakPtr())); } metrics_util::CredentialSourceType
diff --git a/components/password_manager/core/browser/password_manager_constants.cc b/components/password_manager/core/browser/password_manager_constants.cc index cf38361e..33e45e58 100644 --- a/components/password_manager/core/browser/password_manager_constants.cc +++ b/components/password_manager/core/browser/password_manager_constants.cc
@@ -10,6 +10,10 @@ FILE_PATH_LITERAL("Affiliation Database"); const base::FilePath::CharType kLoginDataFileName[] = FILE_PATH_LITERAL("Login Data"); +#if defined(USE_X11) +const base::FilePath::CharType kSecondLoginDataFileName[] = + FILE_PATH_LITERAL("Login Data 2"); +#endif // defined(USE_X11) const char kPasswordManagerAccountDashboardURL[] = "https://passwords.google.com";
diff --git a/components/password_manager/core/browser/password_manager_constants.h b/components/password_manager/core/browser/password_manager_constants.h index 9fc4211..c78965e 100644 --- a/components/password_manager/core/browser/password_manager_constants.h +++ b/components/password_manager/core/browser/password_manager_constants.h
@@ -11,6 +11,9 @@ extern const base::FilePath::CharType kAffiliationDatabaseFileName[]; extern const base::FilePath::CharType kLoginDataFileName[]; +#if defined(USE_X11) +extern const base::FilePath::CharType kSecondLoginDataFileName[]; +#endif // defined(USE_X11) // URL to the password manager account dashboard. // TODO(crbug.com/862269): remove when "Smart Lock" is completely gone.
diff --git a/components/password_manager/core/browser/password_store.cc b/components/password_manager/core/browser/password_store.cc index 9c03765..3fb29bf 100644 --- a/components/password_manager/core/browser/password_store.cc +++ b/components/password_manager/core/browser/password_store.cc
@@ -82,10 +82,10 @@ const std::vector<std::string>& matching_domains, int saved_passwords) { origin_task_runner_->PostTask( - FROM_HERE, - base::Bind(&PasswordReuseDetectorConsumer::OnReuseFound, consumer_weak_, - password_length, reused_protected_password_hash, - matching_domains, saved_passwords)); + FROM_HERE, base::BindOnce(&PasswordReuseDetectorConsumer::OnReuseFound, + consumer_weak_, password_length, + reused_protected_password_hash, + matching_domains, saved_passwords)); } #endif @@ -804,8 +804,9 @@ void PasswordStore::ScheduleFindAndUpdateAffiliatedWebLogins( const PasswordForm& added_or_updated_android_form) { main_task_runner_->PostTask( - FROM_HERE, base::Bind(&PasswordStore::FindAndUpdateAffiliatedWebLogins, - this, added_or_updated_android_form)); + FROM_HERE, + base::BindOnce(&PasswordStore::FindAndUpdateAffiliatedWebLogins, this, + added_or_updated_android_form)); } void PasswordStore::UpdateAffiliatedWebLoginsImpl(
diff --git a/components/password_manager/core/browser/password_store_default.cc b/components/password_manager/core/browser/password_store_default.cc index 1e83accf7..2eea96be 100644 --- a/components/password_manager/core/browser/password_store_default.cc +++ b/components/password_manager/core/browser/password_store_default.cc
@@ -226,4 +226,11 @@ login_db_.reset(); } +#if defined(USE_X11) +void PasswordStoreDefault::SetLoginDB(std::unique_ptr<LoginDatabase> login_db) { + DCHECK(background_task_runner()->RunsTasksInCurrentSequence()); + login_db_ = std::move(login_db); +} +#endif // defined(USE_X11) + } // namespace password_manager
diff --git a/components/password_manager/core/browser/password_store_default.h b/components/password_manager/core/browser/password_store_default.h index 876bfbab..1d4cf69 100644 --- a/components/password_manager/core/browser/password_store_default.h +++ b/components/password_manager/core/browser/password_store_default.h
@@ -25,6 +25,15 @@ void ShutdownOnUIThread() override; +#if defined(USE_X11) + // Dispose the current |login_db_| and use |login_db|. |login_db| is expected + // to have been initialised. A null value is equivalent to a database which + // can't be opened. + // TODO(crbug.com/571003) This is only used to migrate Linux to an encrypted + // LoginDatabase. + void SetLoginDB(std::unique_ptr<LoginDatabase> login_db); +#endif // defined(USE_X11) + // To be used only for testing or in subclasses. LoginDatabase* login_db() const { return login_db_.get(); }
diff --git a/components/password_manager/core/common/password_manager_features.cc b/components/password_manager/core/common/password_manager_features.cc index 7322313..1849ecd 100644 --- a/components/password_manager/core/common/password_manager_features.cc +++ b/components/password_manager/core/common/password_manager_features.cc
@@ -82,6 +82,11 @@ const base::Feature kNewPasswordFormParsingForSaving = { "new-password-form-parsing-for-saving", base::FEATURE_DISABLED_BY_DEFAULT}; +// Performs a one-off migration (with retries) from a native backend into +// logindb. Passwords are served from the new location. +const base::Feature kMigrateLinuxToLoginDB = { + "migrate-linux-to-logindb", base::FEATURE_DISABLED_BY_DEFAULT}; + // Field trial identifier for password generation requirements. const char* kGenerationRequirementsFieldTrial = "PasswordGenerationRequirements";
diff --git a/components/password_manager/core/common/password_manager_features.h b/components/password_manager/core/common/password_manager_features.h index 7eb1bf2..0cf462bd 100644 --- a/components/password_manager/core/common/password_manager_features.h +++ b/components/password_manager/core/common/password_manager_features.h
@@ -25,6 +25,7 @@ extern const base::Feature kPasswordForceSaving; extern const base::Feature kShowAllSavedPasswordsContextMenu; extern const base::Feature kFillOnAccountSelect; +extern const base::Feature kMigrateLinuxToLoginDB; extern const base::Feature kNewPasswordFormParsing; extern const base::Feature kNewPasswordFormParsingForSaving; extern const base::Feature kPasswordExport;
diff --git a/components/password_manager/core/common/password_manager_pref_names.cc b/components/password_manager/core/common/password_manager_pref_names.cc index 914e6cc..bddb4499 100644 --- a/components/password_manager/core/common/password_manager_pref_names.cc +++ b/components/password_manager/core/common/password_manager_pref_names.cc
@@ -13,6 +13,7 @@ #if !defined(OS_MACOSX) && !defined(OS_CHROMEOS) && defined(OS_POSIX) const char kLocalProfileId[] = "profile.local_profile_id"; +const char kMigrationToLoginDBStep[] = "profile.migration_to_logindb_step"; #endif #if defined(OS_WIN)
diff --git a/components/password_manager/core/common/password_manager_pref_names.h b/components/password_manager/core/common/password_manager_pref_names.h index 16f581a..ff8bbbf 100644 --- a/components/password_manager/core/common/password_manager_pref_names.h +++ b/components/password_manager/core/common/password_manager_pref_names.h
@@ -27,6 +27,9 @@ #if !defined(OS_MACOSX) && !defined(OS_CHROMEOS) && defined(OS_POSIX) // The local profile id for this profile. extern const char kLocalProfileId[]; + +// The current state of the migration to LoginDB from Keyring/Kwallet on Linux. +extern const char kMigrationToLoginDBStep[]; #endif #if defined(OS_WIN)
diff --git a/components/payments/content/payment_request.cc b/components/payments/content/payment_request.cc index 32464225..9ee12bf 100644 --- a/components/payments/content/payment_request.cc +++ b/components/payments/content/payment_request.cc
@@ -57,7 +57,7 @@ // erroneous in nature). // TODO(crbug.com/683636): Investigate using // set_connection_error_with_reason_handler with Binding::CloseWithReason. - binding_.set_connection_error_handler(base::Bind( + binding_.set_connection_error_handler(base::BindOnce( &PaymentRequest::OnConnectionTerminated, weak_ptr_factory_.GetWeakPtr())); }
diff --git a/components/payments/core/can_make_payment_query.cc b/components/payments/core/can_make_payment_query.cc index 5f4f66d..66b5d75 100644 --- a/components/payments/core/can_make_payment_query.cc +++ b/components/payments/core/can_make_payment_query.cc
@@ -29,8 +29,8 @@ std::unique_ptr<base::OneShotTimer> timer = std::make_unique<base::OneShotTimer>(); timer->Start(FROM_HERE, base::TimeDelta::FromMinutes(30), - base::Bind(&CanMakePaymentQuery::ExpireQuotaForFrameOrigin, - base::Unretained(this), id)); + base::BindOnce(&CanMakePaymentQuery::ExpireQuotaForFrameOrigin, + base::Unretained(this), id)); timers_.insert(std::make_pair(id, std::move(timer))); queries_.insert(std::make_pair(id, query)); return true;
diff --git a/components/plugins/renderer/webview_plugin.cc b/components/plugins/renderer/webview_plugin.cc index 94b96f5..6a416f0 100644 --- a/components/plugins/renderer/webview_plugin.cc +++ b/components/plugins/renderer/webview_plugin.cc
@@ -194,8 +194,8 @@ // UpdatePluginForNewGeometry must be posted to a task to run asynchronously. base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(&WebViewPlugin::UpdatePluginForNewGeometry, - weak_factory_.GetWeakPtr(), window_rect, unobscured_rect)); + base::BindOnce(&WebViewPlugin::UpdatePluginForNewGeometry, + weak_factory_.GetWeakPtr(), window_rect, unobscured_rect)); } void WebViewPlugin::UpdateFocus(bool focused, blink::WebFocusType focus_type) {
diff --git a/components/policy/core/browser/url_blacklist_manager.cc b/components/policy/core/browser/url_blacklist_manager.cc index aa3cb90..1e3c2d8 100644 --- a/components/policy/core/browser/url_blacklist_manager.cc +++ b/components/policy/core/browser/url_blacklist_manager.cc
@@ -466,10 +466,9 @@ // change the blacklist are updated in one message loop cycle. In those cases, // only rebuild the blacklist after all the preference updates are processed. ui_weak_ptr_factory_.InvalidateWeakPtrs(); - ui_task_runner_->PostTask( - FROM_HERE, - base::Bind(&URLBlacklistManager::Update, - ui_weak_ptr_factory_.GetWeakPtr())); + ui_task_runner_->PostTask(FROM_HERE, + base::BindOnce(&URLBlacklistManager::Update, + ui_weak_ptr_factory_.GetWeakPtr())); } void URLBlacklistManager::Update() {
diff --git a/components/policy/core/common/async_policy_loader.cc b/components/policy/core/common/async_policy_loader.cc index b0edee2e..833fe8e6 100644 --- a/components/policy/core/common/async_policy_loader.cc +++ b/components/policy/core/common/async_policy_loader.cc
@@ -104,11 +104,11 @@ void AsyncPolicyLoader::ScheduleNextReload(TimeDelta delay) { DCHECK(task_runner_->RunsTasksInCurrentSequence()); weak_factory_.InvalidateWeakPtrs(); - task_runner_->PostDelayedTask(FROM_HERE, - base::Bind(&AsyncPolicyLoader::Reload, - weak_factory_.GetWeakPtr(), - false /* force */), - delay); + task_runner_->PostDelayedTask( + FROM_HERE, + base::BindOnce(&AsyncPolicyLoader::Reload, weak_factory_.GetWeakPtr(), + false /* force */), + delay); } bool AsyncPolicyLoader::IsSafeToReload(const Time& now, TimeDelta* delay) {
diff --git a/components/policy/core/common/async_policy_provider.cc b/components/policy/core/common/async_policy_provider.cc index 9fe41532..8c9b025 100644 --- a/components/policy/core/common/async_policy_provider.cc +++ b/components/policy/core/common/async_policy_provider.cc
@@ -42,10 +42,8 @@ base::ThreadTaskRunnerHandle::Get(), weak_factory_.GetWeakPtr()); bool post = loader_->task_runner()->PostTask( - FROM_HERE, - base::Bind(&AsyncPolicyLoader::Init, - base::Unretained(loader_.get()), - callback)); + FROM_HERE, base::BindOnce(&AsyncPolicyLoader::Init, + base::Unretained(loader_.get()), callback)); DCHECK(post) << "AsyncPolicyProvider::Init() called with threads not running"; } @@ -103,10 +101,8 @@ return; loader_->task_runner()->PostTask( - FROM_HERE, - base::Bind(&AsyncPolicyLoader::RefreshPolicies, - base::Unretained(loader_.get()), - schema_map())); + FROM_HERE, base::BindOnce(&AsyncPolicyLoader::RefreshPolicies, + base::Unretained(loader_.get()), schema_map())); } void AsyncPolicyProvider::OnLoaderReloaded(
diff --git a/components/policy/core/common/cloud/component_cloud_policy_service.cc b/components/policy/core/common/cloud/component_cloud_policy_service.cc index 43217fc5..6bd6d8670 100644 --- a/components/policy/core/common/cloud/component_cloud_policy_service.cc +++ b/components/policy/core/common/cloud/component_cloud_policy_service.cc
@@ -343,7 +343,7 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); backend_task_runner_->PostTask( FROM_HERE, - base::Bind(&Backend::ClearCache, base::Unretained(backend_.get()))); + base::BindOnce(&Backend::ClearCache, base::Unretained(backend_.get()))); } void ComponentCloudPolicyService::OnSchemaRegistryReady() { @@ -418,7 +418,7 @@ // e.g. when the user signs out. backend_task_runner_->PostTask( FROM_HERE, - base::Bind(&Backend::ClearCache, base::Unretained(backend_.get()))); + base::BindOnce(&Backend::ClearCache, base::Unretained(backend_.get()))); } else { // Send the current credentials to the backend; do this whenever the store // updates, to handle the case of the user registering for policy after the @@ -435,17 +435,17 @@ int public_key_version = policy->has_public_key_version() ? policy->public_key_version() : -1; backend_task_runner_->PostTask( - FROM_HERE, - base::Bind(&Backend::SetCredentials, base::Unretained(backend_.get()), - account_id, request_token, device_id, public_key, - public_key_version)); + FROM_HERE, base::BindOnce(&Backend::SetCredentials, + base::Unretained(backend_.get()), account_id, + request_token, device_id, public_key, + public_key_version)); } // Initialize the backend to load the initial policy if not done yet, // regardless of the signin state. backend_task_runner_->PostTask( FROM_HERE, - base::Bind(&Backend::InitIfNeeded, base::Unretained(backend_.get()))); + base::BindOnce(&Backend::InitIfNeeded, base::Unretained(backend_.get()))); } void ComponentCloudPolicyService::UpdateFromClient() {
diff --git a/components/policy/core/common/cloud/device_management_service.cc b/components/policy/core/common/cloud/device_management_service.cc index bed68ec..1974e4d 100644 --- a/components/policy/core/common/cloud/device_management_service.cc +++ b/components/policy/core/common/cloud/device_management_service.cc
@@ -566,8 +566,9 @@ if (initialized_) return; task_runner_->PostDelayedTask( - FROM_HERE, base::Bind(&DeviceManagementService::Initialize, - weak_ptr_factory_.GetWeakPtr()), + FROM_HERE, + base::BindOnce(&DeviceManagementService::Initialize, + weak_ptr_factory_.GetWeakPtr()), base::TimeDelta::FromMilliseconds(delay_milliseconds)); } @@ -727,8 +728,8 @@ << "s."; task_runner_->PostDelayedTask( FROM_HERE, - base::Bind(&DeviceManagementService::StartJobAfterDelay, - weak_ptr_factory_.GetWeakPtr(), job->GetWeakPtr()), + base::BindOnce(&DeviceManagementService::StartJobAfterDelay, + weak_ptr_factory_.GetWeakPtr(), job->GetWeakPtr()), base::TimeDelta::FromMilliseconds(delay)); } else { job->HandleResponse(net_error, response_code, response_body);
diff --git a/components/policy/core/common/cloud/external_policy_data_fetcher.cc b/components/policy/core/common/cloud/external_policy_data_fetcher.cc index 08de99a..04ba897 100644 --- a/components/policy/core/common/cloud/external_policy_data_fetcher.cc +++ b/components/policy/core/common/cloud/external_policy_data_fetcher.cc
@@ -98,8 +98,8 @@ callback))); jobs_.insert(job); io_task_runner_->PostTask( - FROM_HERE, - base::Bind(&ExternalPolicyDataFetcherBackend::StartJob, backend_, job)); + FROM_HERE, base::BindOnce(&ExternalPolicyDataFetcherBackend::StartJob, + backend_, job)); return job; } @@ -115,10 +115,11 @@ // still be pending for the canceled |job|. io_task_runner_->PostTask( FROM_HERE, - base::Bind(&ExternalPolicyDataFetcherBackend::CancelJob, backend_, job, - base::Bind(&ForwardJobCanceled, task_runner_, - base::Bind(base::DoNothing::Repeatedly<Job*>(), - base::Owned(job))))); + base::BindOnce(&ExternalPolicyDataFetcherBackend::CancelJob, backend_, + job, + base::Bind(&ForwardJobCanceled, task_runner_, + base::Bind(base::DoNothing::Repeatedly<Job*>(), + base::Owned(job))))); } void ExternalPolicyDataFetcher::OnJobFinished(
diff --git a/components/policy/core/common/cloud/external_policy_data_updater.cc b/components/policy/core/common/cloud/external_policy_data_updater.cc index 99b691f..effd1e99 100644 --- a/components/policy/core/common/cloud/external_policy_data_updater.cc +++ b/components/policy/core/common/cloud/external_policy_data_updater.cc
@@ -285,7 +285,7 @@ // in the process of being deleted. If this is the case, the WeakPtr will // become invalid and the delayed task will never run. updater_->task_runner_->PostDelayedTask( - FROM_HERE, base::Bind(&FetchJob::Reschedule, AsWeakPtr()), delay); + FROM_HERE, base::BindOnce(&FetchJob::Reschedule, AsWeakPtr()), delay); } updater_->OnJobFailed(this);
diff --git a/components/policy/core/common/fake_async_policy_loader.cc b/components/policy/core/common/fake_async_policy_loader.cc index efa9f7b6..31a00d2 100644 --- a/components/policy/core/common/fake_async_policy_loader.cc +++ b/components/policy/core/common/fake_async_policy_loader.cc
@@ -30,8 +30,9 @@ } void FakeAsyncPolicyLoader::PostReloadOnBackgroundThread(bool force) { - task_runner()->PostTask(FROM_HERE, base::Bind(&AsyncPolicyLoader::Reload, - base::Unretained(this), force)); + task_runner()->PostTask(FROM_HERE, + base::BindOnce(&AsyncPolicyLoader::Reload, + base::Unretained(this), force)); } } // namespace policy
diff --git a/components/policy/core/common/policy_service_impl.cc b/components/policy/core/common/policy_service_impl.cc index dd555a14..5e163d3 100644 --- a/components/policy/core/common/policy_service_impl.cc +++ b/components/policy/core/common/policy_service_impl.cc
@@ -141,8 +141,8 @@ // on OnUpdatePolicy() about why this is a posted task. update_task_ptr_factory_.InvalidateWeakPtrs(); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&PolicyServiceImpl::MergeAndTriggerUpdates, - update_task_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&PolicyServiceImpl::MergeAndTriggerUpdates, + update_task_ptr_factory_.GetWeakPtr())); } else { // Some providers might invoke OnUpdatePolicy synchronously while handling // RefreshPolicies. Mark all as pending before refreshing. @@ -167,8 +167,8 @@ // since both will produce the same PolicyBundle. update_task_ptr_factory_.InvalidateWeakPtrs(); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&PolicyServiceImpl::MergeAndTriggerUpdates, - update_task_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&PolicyServiceImpl::MergeAndTriggerUpdates, + update_task_ptr_factory_.GetWeakPtr())); } void PolicyServiceImpl::NotifyNamespaceUpdated(
diff --git a/components/policy/core/common/remote_commands/testing_remote_commands_server.cc b/components/policy/core/common/remote_commands/testing_remote_commands_server.cc index 7690d6af..b9af56f 100644 --- a/components/policy/core/common/remote_commands/testing_remote_commands_server.cc +++ b/components/policy/core/common/remote_commands/testing_remote_commands_server.cc
@@ -110,8 +110,8 @@ // Post task to the original thread which will report the result. task_runner_->PostTask( FROM_HERE, - base::Bind(&TestingRemoteCommandsServer::ReportJobResult, - weak_ptr_to_this_, reported_callback, job_result)); + base::BindOnce(&TestingRemoteCommandsServer::ReportJobResult, + weak_ptr_to_this_, reported_callback, job_result)); } }
diff --git a/components/prefs/json_pref_store.cc b/components/prefs/json_pref_store.cc index 1de2186..c7a6e144 100644 --- a/components/prefs/json_pref_store.cc +++ b/components/prefs/json_pref_store.cc
@@ -336,8 +336,8 @@ // We can't run |on_next_write_reply| on the current thread. Bounce back to // the |reply_task_runner| which is the correct sequenced thread. - reply_task_runner->PostTask(FROM_HERE, - base::Bind(on_next_write_reply, write_success)); + reply_task_runner->PostTask( + FROM_HERE, base::BindOnce(on_next_write_reply, write_success)); } void JsonPrefStore::RegisterOnNextSuccessfulWriteReply(
diff --git a/components/prefs/pref_member_unittest.cc b/components/prefs/pref_member_unittest.cc index 6208698..abdfeab 100644 --- a/components/prefs/pref_member_unittest.cc +++ b/components/prefs/pref_member_unittest.cc
@@ -54,7 +54,7 @@ base::WaitableEvent::InitialState::NOT_SIGNALED); ASSERT_TRUE(pref_thread_.task_runner()->PostTask( FROM_HERE, - base::Bind(&GetPrefValueHelper::GetPrefValue, this, &event))); + base::BindOnce(&GetPrefValueHelper::GetPrefValue, this, &event))); event.Wait(); }
diff --git a/components/prefs/pref_notifier_impl_unittest.cc b/components/prefs/pref_notifier_impl_unittest.cc index a76c933..c69bece86 100644 --- a/components/prefs/pref_notifier_impl_unittest.cc +++ b/components/prefs/pref_notifier_impl_unittest.cc
@@ -105,8 +105,8 @@ MockPrefNotifier notifier(&pref_service_); MockPrefInitObserver observer; notifier.AddInitObserver( - base::Bind(&MockPrefInitObserver::OnInitializationCompleted, - base::Unretained(&observer))); + base::BindOnce(&MockPrefInitObserver::OnInitializationCompleted, + base::Unretained(&observer))); EXPECT_CALL(observer, OnInitializationCompleted(true)); notifier.OnInitializationCompleted(true); }
diff --git a/components/prefs/pref_service.cc b/components/prefs/pref_service.cc index afd66ba..97e9a69 100644 --- a/components/prefs/pref_service.cc +++ b/components/prefs/pref_service.cc
@@ -92,8 +92,8 @@ // Guarantee that initialization happens after this function returned. base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(&PersistentPrefStore::ReadPrefsAsync, user_pref_store_, - new ReadErrorHandler(read_error_callback_))); + base::BindOnce(&PersistentPrefStore::ReadPrefsAsync, user_pref_store_, + new ReadErrorHandler(read_error_callback_))); } }
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc index 028de5b..89d54c4 100644 --- a/components/printing/renderer/print_render_frame_helper.cc +++ b/components/printing/renderer/print_render_frame_helper.cc
@@ -880,8 +880,8 @@ // Don't call callback here, because it can delete |this| and WebView that is // called didStopLoading. base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&PrepareFrameAndViewForPrint::CallOnReady, - weak_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&PrepareFrameAndViewForPrint::CallOnReady, + weak_ptr_factory_.GetWeakPtr())); } blink::WebLocalFrame* PrepareFrameAndViewForPrint::CreateChildFrame( @@ -2095,8 +2095,8 @@ } else { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(&PrintRenderFrameHelper::ShowScriptedPrintPreview, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&PrintRenderFrameHelper::ShowScriptedPrintPreview, + weak_ptr_factory_.GetWeakPtr())); } auto msg = std::make_unique<PrintHostMsg_SetupScriptedPrintPreview>( routing_id());
diff --git a/components/proxy_config/pref_proxy_config_tracker_impl.cc b/components/proxy_config/pref_proxy_config_tracker_impl.cc index e28e5b9..924105e 100644 --- a/components/proxy_config/pref_proxy_config_tracker_impl.cc +++ b/components/proxy_config/pref_proxy_config_tracker_impl.cc
@@ -320,9 +320,9 @@ } proxy_config_service_task_runner_->PostTask( - FROM_HERE, base::Bind(&ProxyConfigServiceImpl::UpdateProxyConfig, - base::Unretained(proxy_config_service_impl_), - config_state, config)); + FROM_HERE, base::BindOnce(&ProxyConfigServiceImpl::UpdateProxyConfig, + base::Unretained(proxy_config_service_impl_), + config_state, config)); } bool PrefProxyConfigTrackerImpl::PrefConfigToNetConfig(
diff --git a/components/reading_list/core/reading_list_store.cc b/components/reading_list/core/reading_list_store.cc index 0ce991f3..537199d9 100644 --- a/components/reading_list/core/reading_list_store.cc +++ b/components/reading_list/core/reading_list_store.cc
@@ -72,8 +72,8 @@ pending_transaction_count_--; if (pending_transaction_count_ == 0) { store_->CommitWriteBatch(std::move(batch_), - base::Bind(&ReadingListStore::OnDatabaseSave, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&ReadingListStore::OnDatabaseSave, + weak_ptr_factory_.GetWeakPtr())); batch_.reset(); } } @@ -144,8 +144,8 @@ delegate_->StoreLoaded(std::move(loaded_entries)); - store_->ReadAllMetadata(base::Bind(&ReadingListStore::OnReadAllMetadata, - weak_ptr_factory_.GetWeakPtr())); + store_->ReadAllMetadata(base::BindOnce(&ReadingListStore::OnReadAllMetadata, + weak_ptr_factory_.GetWeakPtr())); } void ReadingListStore::OnReadAllMetadata( @@ -173,8 +173,8 @@ return; } store_ = std::move(store); - store_->ReadAllData(base::Bind(&ReadingListStore::OnDatabaseLoad, - weak_ptr_factory_.GetWeakPtr())); + store_->ReadAllData(base::BindOnce(&ReadingListStore::OnDatabaseLoad, + weak_ptr_factory_.GetWeakPtr())); return; }
diff --git a/components/rlz/rlz_tracker.cc b/components/rlz/rlz_tracker.cc index 1f59d585..ac24775 100644 --- a/components/rlz/rlz_tracker.cc +++ b/components/rlz/rlz_tracker.cc
@@ -288,8 +288,8 @@ // The RLZTracker is a singleton object that outlives any runnable tasks // that will be queued up. background_task_runner_->PostDelayedTask( - FROM_HERE, base::Bind(&RLZTracker::DelayedInit, base::Unretained(this)), - delay); + FROM_HERE, + base::BindOnce(&RLZTracker::DelayedInit, base::Unretained(this)), delay); } void RLZTracker::DelayedInit() { @@ -327,7 +327,8 @@ void RLZTracker::ScheduleFinancialPing() { DCHECK(delegate_) << "RLZTracker used before initialization"; background_task_runner_->PostTask( - FROM_HERE, base::Bind(&RLZTracker::PingNowImpl, base::Unretained(this))); + FROM_HERE, + base::BindOnce(&RLZTracker::PingNowImpl, base::Unretained(this))); } void RLZTracker::PingNowImpl() { @@ -412,8 +413,9 @@ return false; background_task_runner_->PostTask( - FROM_HERE, base::Bind(base::IgnoreResult(&RLZTracker::RecordProductEvent), - product, point, event_id)); + FROM_HERE, + base::BindOnce(base::IgnoreResult(&RLZTracker::RecordProductEvent), + product, point, event_id)); return true; } @@ -441,9 +443,9 @@ DCHECK(delegate_) << "RLZTracker used before initialization"; if (!delegate_->IsOnUIThread()) return false; - background_task_runner_->PostTask(FROM_HERE, - base::Bind(&RLZTracker::RecordFirstSearch, - base::Unretained(this), point)); + background_task_runner_->PostTask( + FROM_HERE, base::BindOnce(&RLZTracker::RecordFirstSearch, + base::Unretained(this), point)); return true; } @@ -531,8 +533,9 @@ base::string16* not_used = nullptr; background_task_runner_->PostTask( - FROM_HERE, base::Bind(base::IgnoreResult(&RLZTracker::GetAccessPointRlz), - point, not_used)); + FROM_HERE, + base::BindOnce(base::IgnoreResult(&RLZTracker::GetAccessPointRlz), point, + not_used)); return true; } @@ -560,7 +563,7 @@ background_task_runner_->PostTask( FROM_HERE, - base::Bind(&RLZTracker::ClearRlzStateImpl, base::Unretained(this))); + base::BindOnce(&RLZTracker::ClearRlzStateImpl, base::Unretained(this))); return true; } #endif
diff --git a/components/safe_browsing/base_blocking_page.cc b/components/safe_browsing/base_blocking_page.cc index 1e84e464..8062424 100644 --- a/components/safe_browsing/base_blocking_page.cc +++ b/components/safe_browsing/base_blocking_page.cc
@@ -239,6 +239,9 @@ return primary_subresource ? "malware_subresource" : "malware"; case BaseSafeBrowsingErrorUI::SB_REASON_HARMFUL: return primary_subresource ? "harmful_subresource" : "harmful"; + case BaseSafeBrowsingErrorUI::SB_REASON_TRICK_TO_BILL: + return primary_subresource ? "trick_to_bill_subresource" + : "trick_to_bill"; case BaseSafeBrowsingErrorUI::SB_REASON_PHISHING: ThreatPatternType threat_pattern_type = unsafe_resources[0].threat_metadata.threat_pattern_type; @@ -291,10 +294,15 @@ iter != unsafe_resources.end(); ++iter) { const BaseUIManager::UnsafeResource& resource = *iter; safe_browsing::SBThreatType threat_type = resource.threat_type; + if (threat_type == SB_THREAT_TYPE_TRICK_TO_BILL) + return BaseSafeBrowsingErrorUI::SB_REASON_TRICK_TO_BILL; + if (threat_type == SB_THREAT_TYPE_URL_MALWARE || threat_type == SB_THREAT_TYPE_URL_CLIENT_SIDE_MALWARE) { return BaseSafeBrowsingErrorUI::SB_REASON_MALWARE; - } else if (threat_type == SB_THREAT_TYPE_URL_UNWANTED) { + } + + if (threat_type == SB_THREAT_TYPE_URL_UNWANTED) { harmful = true; } else { DCHECK(threat_type == SB_THREAT_TYPE_URL_PHISHING ||
diff --git a/components/safe_browsing/base_ui_manager.cc b/components/safe_browsing/base_ui_manager.cc index 04cd59e..127a842 100644 --- a/components/safe_browsing/base_ui_manager.cc +++ b/components/safe_browsing/base_ui_manager.cc
@@ -164,7 +164,7 @@ if (!resource.callback.is_null()) { DCHECK(resource.callback_thread); resource.callback_thread->PostTask( - FROM_HERE, base::Bind(resource.callback, proceed)); + FROM_HERE, base::BindOnce(resource.callback, proceed)); } GURL whitelist_url = GetWhitelistUrl( @@ -197,8 +197,8 @@ ThreatPatternType::MALWARE_LANDING)) { if (!resource.callback.is_null()) { DCHECK(resource.callback_thread); - resource.callback_thread->PostTask(FROM_HERE, - base::Bind(resource.callback, true)); + resource.callback_thread->PostTask( + FROM_HERE, base::BindOnce(resource.callback, true)); } return; @@ -221,8 +221,8 @@ if (IsWhitelisted(resource)) { if (!resource.callback.is_null()) { DCHECK(resource.callback_thread); - resource.callback_thread->PostTask(FROM_HERE, - base::Bind(resource.callback, true)); + resource.callback_thread->PostTask( + FROM_HERE, base::BindOnce(resource.callback, true)); } return; }
diff --git a/components/safe_browsing/browser/safe_browsing_url_checker_impl.cc b/components/safe_browsing/browser/safe_browsing_url_checker_impl.cc index f857f36..5a51c24 100644 --- a/components/safe_browsing/browser/safe_browsing_url_checker_impl.cc +++ b/components/safe_browsing/browser/safe_browsing_url_checker_impl.cc
@@ -257,9 +257,9 @@ content::BrowserThread::PostTask( content::BrowserThread::IO, FROM_HERE, - base::Bind(&SafeBrowsingUrlCheckerImpl::OnCheckBrowseUrlResult, - weak_factory_.GetWeakPtr(), url, threat_type, - ThreatMetadata())); + base::BindOnce(&SafeBrowsingUrlCheckerImpl::OnCheckBrowseUrlResult, + weak_factory_.GetWeakPtr(), url, threat_type, + ThreatMetadata())); break; }
diff --git a/components/safe_browsing/browser/threat_details.cc b/components/safe_browsing/browser/threat_details.cc index 5a5dee7..450e2e3 100644 --- a/components/safe_browsing/browser/threat_details.cc +++ b/components/safe_browsing/browser/threat_details.cc
@@ -583,7 +583,7 @@ pending_render_frame_hosts_.insert(frame); raw_threat_report->GetThreatDOMDetails( base::BindOnce(&ThreatDetails::OnReceivedThreatDOMDetails, this, - base::Passed(&threat_reporter), frame)); + std::move(threat_reporter), frame)); } // When the renderer is done, this is called. @@ -811,7 +811,7 @@ is_all_done_ = true; BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE, - base::Bind(done_callback_, base::Unretained(web_contents()))); + base::BindOnce(done_callback_, base::Unretained(web_contents()))); } void ThreatDetails::FrameDeleted(RenderFrameHost* render_frame_host) {
diff --git a/components/safe_browsing/db/v4_database.cc b/components/safe_browsing/db/v4_database.cc index 3e77977f..3523a2a 100644 --- a/components/safe_browsing/db/v4_database.cc +++ b/components/safe_browsing/db/v4_database.cc
@@ -68,9 +68,9 @@ const scoped_refptr<base::SingleThreadTaskRunner> callback_task_runner = base::ThreadTaskRunnerHandle::Get(); db_task_runner->PostTask( - FROM_HERE, base::Bind(&V4Database::CreateOnTaskRunner, db_task_runner, - base_path, list_infos, callback_task_runner, - new_db_callback, TimeTicks::Now())); + FROM_HERE, base::BindOnce(&V4Database::CreateOnTaskRunner, db_task_runner, + base_path, list_infos, callback_task_runner, + new_db_callback, TimeTicks::Now())); } // static
diff --git a/components/safe_browsing/db/v4_local_database_manager.cc b/components/safe_browsing/db/v4_local_database_manager.cc index f3c5b58..dab714c 100644 --- a/components/safe_browsing/db/v4_local_database_manager.cc +++ b/components/safe_browsing/db/v4_local_database_manager.cc
@@ -588,9 +588,9 @@ if (!path_exists) { continue; } - task_runner_->PostTask( - FROM_HERE, base::Bind(base::IgnoreResult(&base::DeleteFile), store_path, - false /* recursive */)); + task_runner_->PostTask(FROM_HERE, + base::BindOnce(base::IgnoreResult(&base::DeleteFile), + store_path, false /* recursive */)); } } @@ -611,9 +611,9 @@ if (!path_exists) { continue; } - task_runner_->PostTask(FROM_HERE, - base::Bind(base::IgnoreResult(&base::DeleteFile), - store_path, false /* recursive */)); + task_runner_->PostTask( + FROM_HERE, base::BindOnce(base::IgnoreResult(&base::DeleteFile), + store_path, false /* recursive */)); } else { NOTREACHED() << "Trying to delete a store file that's in use: " << store_filename_to_delete;
diff --git a/components/safe_browsing/db/v4_local_database_manager_unittest.cc b/components/safe_browsing/db/v4_local_database_manager_unittest.cc index 76099d70..f6a2f7a 100644 --- a/components/safe_browsing/db/v4_local_database_manager_unittest.cc +++ b/components/safe_browsing/db/v4_local_database_manager_unittest.cc
@@ -55,7 +55,7 @@ FullHashCallback callback) override { // Async, since the real manager might use a fetcher. base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, full_hash_infos_)); + FROM_HERE, base::BindOnce(callback, full_hash_infos_)); } private:
diff --git a/components/safe_browsing/db/v4_protocol_manager_util.h b/components/safe_browsing/db/v4_protocol_manager_util.h index e89a204..36004b92 100644 --- a/components/safe_browsing/db/v4_protocol_manager_util.h +++ b/components/safe_browsing/db/v4_protocol_manager_util.h
@@ -140,6 +140,9 @@ // Enterprise password reuse detected on low reputation page, SB_THREAT_TYPE_ENTERPRISE_PASSWORD_REUSE, + + // Deceptive mobile billing practice detected. + SB_THREAT_TYPE_TRICK_TO_BILL, }; using SBThreatTypeSet = base::flat_set<SBThreatType>;
diff --git a/components/safe_browsing/password_protection/password_protection_request.cc b/components/safe_browsing/password_protection/password_protection_request.cc index ff90313..8a9d3f4a 100644 --- a/components/safe_browsing/password_protection/password_protection_request.cc +++ b/components/safe_browsing/password_protection/password_protection_request.cc
@@ -88,9 +88,9 @@ auto result_callback = base::Bind(&OnWhitelistCheckDoneOnIO, GetWeakPtr()); tracker_.PostTask( BrowserThread::GetTaskRunnerForThread(BrowserThread::IO).get(), FROM_HERE, - base::Bind(&WhitelistCheckerClient::StartCheckCsdWhitelist, - password_protection_service_->database_manager(), - main_frame_url_, result_callback)); + base::BindOnce(&WhitelistCheckerClient::StartCheckCsdWhitelist, + password_protection_service_->database_manager(), + main_frame_url_, result_callback)); } // static @@ -100,8 +100,8 @@ // Don't access weak_request on IO thread. Move it back to UI thread first. BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - base::Bind(&PasswordProtectionRequest::OnWhitelistCheckDone, weak_request, - match_whitelist)); + base::BindOnce(&PasswordProtectionRequest::OnWhitelistCheckDone, + weak_request, match_whitelist)); } void PasswordProtectionRequest::OnWhitelistCheckDone(bool match_whitelist) { @@ -270,7 +270,7 @@ // execution reaches Finish(). BrowserThread::PostDelayedTask( BrowserThread::UI, FROM_HERE, - base::Bind(&PasswordProtectionRequest::Cancel, GetWeakPtr(), true), + base::BindOnce(&PasswordProtectionRequest::Cancel, GetWeakPtr(), true), base::TimeDelta::FromMilliseconds(request_timeout_in_ms_)); }
diff --git a/components/search/OWNERS b/components/search/OWNERS index b15621a5..021e5e3 100644 --- a/components/search/OWNERS +++ b/components/search/OWNERS
@@ -1,6 +1,7 @@ +kristipark@chromium.org mathp@chromium.org -treib@chromium.org sfiera@chromium.org +treib@chromium.org # Original implementors of most of the code, but not active in Chromium anymore: # - jered@chromium.org
diff --git a/components/search_provider_logos/logo_service_impl.cc b/components/search_provider_logos/logo_service_impl.cc index 6dc0027..35fc619 100644 --- a/components/search_provider_logos/logo_service_impl.cc +++ b/components/search_provider_logos/logo_service_impl.cc
@@ -49,8 +49,8 @@ auto* handler = new ImageDecodedHandlerWithTimeout(image_decoded_callback); base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::Bind(&ImageDecodedHandlerWithTimeout::OnImageDecoded, - handler->weak_ptr_factory_.GetWeakPtr(), gfx::Image()), + base::BindOnce(&ImageDecodedHandlerWithTimeout::OnImageDecoded, + handler->weak_ptr_factory_.GetWeakPtr(), gfx::Image()), base::TimeDelta::FromSeconds(kDecodeLogoTimeoutSeconds)); return base::Bind(&ImageDecodedHandlerWithTimeout::OnImageDecoded, handler->weak_ptr_factory_.GetWeakPtr());
diff --git a/components/search_provider_logos/logo_service_impl_unittest.cc b/components/search_provider_logos/logo_service_impl_unittest.cc index 9ea86f4b..71beb72a0 100644 --- a/components/search_provider_logos/logo_service_impl_unittest.cc +++ b/components/search_provider_logos/logo_service_impl_unittest.cc
@@ -272,8 +272,8 @@ const image_fetcher::ImageDecodedCallback& callback) override { gfx::Image image = gfx::Image::CreateFrom1xPNGBytes( reinterpret_cast<const uint8_t*>(image_data.data()), image_data.size()); - base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, - base::Bind(callback, image)); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(callback, image)); } }; @@ -936,8 +936,9 @@ std::move((*fresh_callbacks)[start_index]); logo_service->GetLogo(std::move(callbacks)); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&EnqueueCallbacks, logo_service, cached_callbacks, - fresh_callbacks, start_index + 1)); + FROM_HERE, + base::BindOnce(&EnqueueCallbacks, logo_service, cached_callbacks, + fresh_callbacks, start_index + 1)); } TEST_F(LogoServiceImplTest, SupportOverlappingLogoRequests) {
diff --git a/components/search_provider_logos/logo_tracker.cc b/components/search_provider_logos/logo_tracker.cc index f8e50cd..cbb38c59 100644 --- a/components/search_provider_logos/logo_tracker.cc +++ b/components/search_provider_logos/logo_tracker.cc
@@ -223,15 +223,15 @@ void LogoTracker::SetCachedLogo(std::unique_ptr<EncodedLogo> logo) { cache_task_runner_->PostTask( - FROM_HERE, - base::Bind(&LogoCache::SetCachedLogo, base::Unretained(logo_cache_.get()), - base::Owned(logo.release()))); + FROM_HERE, base::BindOnce(&LogoCache::SetCachedLogo, + base::Unretained(logo_cache_.get()), + base::Owned(logo.release()))); } void LogoTracker::SetCachedMetadata(const LogoMetadata& metadata) { cache_task_runner_->PostTask( - FROM_HERE, base::Bind(&LogoCache::UpdateCachedLogoMetadata, - base::Unretained(logo_cache_.get()), metadata)); + FROM_HERE, base::BindOnce(&LogoCache::UpdateCachedLogoMetadata, + base::Unretained(logo_cache_.get()), metadata)); } void LogoTracker::FetchLogo() {
diff --git a/components/security_interstitials/core/base_safe_browsing_error_ui.h b/components/security_interstitials/core/base_safe_browsing_error_ui.h index a7faf19..ff74c5a 100644 --- a/components/security_interstitials/core/base_safe_browsing_error_ui.h +++ b/components/security_interstitials/core/base_safe_browsing_error_ui.h
@@ -23,6 +23,7 @@ SB_REASON_MALWARE, SB_REASON_HARMFUL, SB_REASON_PHISHING, + SB_REASON_TRICK_TO_BILL, }; struct SBErrorDisplayOptions {
diff --git a/components/security_interstitials/core/browser/resources/extended_reporting.js b/components/security_interstitials/core/browser/resources/extended_reporting.js index 8acc16a..96da18e 100644 --- a/components/security_interstitials/core/browser/resources/extended_reporting.js +++ b/components/security_interstitials/core/browser/resources/extended_reporting.js
@@ -26,9 +26,14 @@ $('opt-in-checkbox').checked = loadTimeData.getBoolean(SB_BOX_CHECKED); $('extended-reporting-opt-in').classList.remove('hidden'); - var className = interstitialType == 'SAFEBROWSING' ? - 'safe-browsing-opt-in' : - 'ssl-opt-in'; + var trickToBill = interstitialType == 'SAFEBROWSING' && + loadTimeData.getBoolean('trick_to_bill'); + + var className = 'ssl-opt-in'; + if (interstitialType == 'SAFEBROWSING' && !trickToBill) { + className = 'safe-browsing-opt-in'; + } + $('extended-reporting-opt-in').classList.add(className); $('body').classList.add('extended-reporting-has-checkbox');
diff --git a/components/security_interstitials/core/browser/resources/interstitial_large.html b/components/security_interstitials/core/browser/resources/interstitial_large.html index cdb7392a..d5c9989 100644 --- a/components/security_interstitials/core/browser/resources/interstitial_large.html +++ b/components/security_interstitials/core/browser/resources/interstitial_large.html
@@ -47,6 +47,7 @@ </div> <div class="nav-wrapper"> <button id="primary-button">$i18n{primaryButtonText}</button> + <button id="proceed-button" class="small-link hidden"></button> <button id="details-button" class="small-link"> $i18n{openDetails} </button>
diff --git a/components/security_interstitials/core/browser/resources/interstitial_large.js b/components/security_interstitials/core/browser/resources/interstitial_large.js index d57ec694..ffa979b 100644 --- a/components/security_interstitials/core/browser/resources/interstitial_large.js +++ b/components/security_interstitials/core/browser/resources/interstitial_large.js
@@ -68,6 +68,8 @@ var ssl = interstitialType == 'SSL'; var captivePortal = interstitialType == 'CAPTIVE_PORTAL'; var badClock = ssl && loadTimeData.getBoolean('bad_clock'); + var trickToBill = interstitialType == 'SAFEBROWSING' && + loadTimeData.getBoolean('trick_to_bill'); var hidePrimaryButton = loadTimeData.getBoolean('hide_primary_button'); var showRecurrentErrorParagraph = loadTimeData.getBoolean( 'show_recurrent_error_paragraph'); @@ -78,6 +80,8 @@ $('error-code').classList.remove(HIDDEN_CLASS); } else if (captivePortal) { $('body').classList.add('captive-portal'); + } else if (trickToBill) { + $('body').classList.add('safe-browsing-trick-to-bill'); } else { $('body').classList.add('safe-browsing'); // Override the default theme color. @@ -116,17 +120,23 @@ } if (overridable) { + var overrideElement = trickToBill ? 'proceed-button' : 'proceed-link'; // Captive portal page isn't overridable. - $('proceed-link').addEventListener('click', function(event) { + $(overrideElement).addEventListener('click', function(event) { sendCommand(SecurityInterstitialCommandId.CMD_PROCEED); }); + + if (ssl) { + $(overrideElement).classList.add('small-link'); + } else if (trickToBill) { + $(overrideElement).classList.remove(HIDDEN_CLASS); + $(overrideElement).textContent = + loadTimeData.getString('proceedButtonText'); + } } else if (!ssl) { $('final-paragraph').classList.add(HIDDEN_CLASS); } - if (ssl && overridable) { - $('proceed-link').classList.add('small-link'); - } if (!ssl || !showRecurrentErrorParagraph) { $('recurrent-error-message').classList.add(HIDDEN_CLASS); @@ -146,8 +156,8 @@ }); } - if (captivePortal) { - // Captive portal page doesn't have details button. + if (captivePortal || trickToBill) { + // Captive portal and trick-to-bill pages don't have details button. $('details-button').classList.add('hidden'); } else { $('details-button').addEventListener('click', function(event) {
diff --git a/components/security_interstitials/core/browser/resources/interstitial_safebrowsing.css b/components/security_interstitials/core/browser/resources/interstitial_safebrowsing.css index c274cd4..77d1e8e8 100644 --- a/components/security_interstitials/core/browser/resources/interstitial_safebrowsing.css +++ b/components/security_interstitials/core/browser/resources/interstitial_safebrowsing.css
@@ -42,4 +42,22 @@ background: rgb(206, 52, 38); box-shadow: 0 -22px 40px rgb(206, 52, 38); } -} \ No newline at end of file +} + +.safe-browsing-trick-to-bill .small-link { + background-color: white; + border:none; + float: none; +} + +.safe-browsing-trick-to-bill .small-link:hover { + box-shadow: none; +} + +.safe-browsing-trick-to-bill .icon { + background-image: -webkit-image-set( + url(images/1x/triangle_red.png) 1x, + url(images/2x/triangle_red.png) 2x); +} + +
diff --git a/components/security_interstitials/core/browser/resources/list_of_interstitials.html b/components/security_interstitials/core/browser/resources/list_of_interstitials.html index 6da45f27..2826628 100644 --- a/components/security_interstitials/core/browser/resources/list_of_interstitials.html +++ b/components/security_interstitials/core/browser/resources/list_of_interstitials.html
@@ -71,6 +71,9 @@ <li> <a href="safebrowsing?type=clientside_phishing">Client Side Phishing</a> </li> + <li> + <a href="safebrowsing?type=trick_to_bill">Trick To Bill</a> + </li> </ul> <h4>Quiet (WebView)</h4> <ul>
diff --git a/components/security_interstitials/core/common/resources/interstitial_common.css b/components/security_interstitials/core/common/resources/interstitial_common.css index 7fd721d..b624669 100644 --- a/components/security_interstitials/core/common/resources/interstitial_common.css +++ b/components/security_interstitials/core/common/resources/interstitial_common.css
@@ -26,7 +26,8 @@ .neterror button, .offline button, .pdf button, -.ssl button { +.ssl button, +.safe-browsing-trick-to-bill button { background: rgb(66, 133, 244); }
diff --git a/components/security_interstitials/core/safe_browsing_loud_error_ui.cc b/components/security_interstitials/core/safe_browsing_loud_error_ui.cc index 2003d5d..2251a97c 100644 --- a/components/security_interstitials/core/safe_browsing_loud_error_ui.cc +++ b/components/security_interstitials/core/safe_browsing_loud_error_ui.cc
@@ -93,6 +93,10 @@ "hide_primary_button", always_show_back_to_safety() ? false : !controller()->CanGoBack()); + load_time_data->SetBoolean( + "trick_to_bill", interstitial_reason() == + BaseSafeBrowsingErrorUI::SB_REASON_TRICK_TO_BILL); + switch (interstitial_reason()) { case BaseSafeBrowsingErrorUI::SB_REASON_MALWARE: PopulateMalwareLoadTimeData(load_time_data); @@ -103,6 +107,9 @@ case BaseSafeBrowsingErrorUI::SB_REASON_PHISHING: PopulatePhishingLoadTimeData(load_time_data); break; + case BaseSafeBrowsingErrorUI::SB_REASON_TRICK_TO_BILL: + PopulateTrickToBillLoadTimeData(load_time_data); + break; } // Not used by this interstitial. @@ -309,6 +316,31 @@ is_extended_reporting_enabled()); } +void SafeBrowsingLoudErrorUI::PopulateTrickToBillLoadTimeData( + base::DictionaryValue* load_time_data) { + load_time_data->SetBoolean("phishing", false); + load_time_data->SetBoolean("overridable", true); + load_time_data->SetBoolean("hide_primary_button", false); + + load_time_data->SetString( + "heading", l10n_util::GetStringUTF16(IDS_TRICK_TO_BILL_HEADING)); + load_time_data->SetString( + "primaryParagraph", + l10n_util::GetStringUTF16(IDS_TRICK_TO_BILL_PRIMARY_PARAGRAPH)); + + load_time_data->SetString( + "primaryButtonText", + l10n_util::GetStringUTF16(IDS_TRICK_TO_BILL_PRIMARY_BUTTON)); + load_time_data->SetString( + "proceedButtonText", + l10n_util::GetStringUTF16(IDS_TRICK_TO_BILL_PROCEED_BUTTON)); + + load_time_data->SetString("openDetails", ""); + load_time_data->SetString("closeDetails", ""); + load_time_data->SetString("explanationParagraph", ""); + load_time_data->SetString("finalParagraph", ""); +} + int SafeBrowsingLoudErrorUI::GetHTMLTemplateId() const { return IDR_SECURITY_INTERSTITIAL_HTML; };
diff --git a/components/security_interstitials/core/safe_browsing_loud_error_ui.h b/components/security_interstitials/core/safe_browsing_loud_error_ui.h index db4cdbf..46e92ac 100644 --- a/components/security_interstitials/core/safe_browsing_loud_error_ui.h +++ b/components/security_interstitials/core/safe_browsing_loud_error_ui.h
@@ -47,6 +47,7 @@ void PopulateMalwareLoadTimeData(base::DictionaryValue* load_time_data); void PopulateHarmfulLoadTimeData(base::DictionaryValue* load_time_data); void PopulatePhishingLoadTimeData(base::DictionaryValue* load_time_data); + void PopulateTrickToBillLoadTimeData(base::DictionaryValue* load_time_data); DISALLOW_COPY_AND_ASSIGN(SafeBrowsingLoudErrorUI); };
diff --git a/components/security_interstitials_strings.grdp b/components/security_interstitials_strings.grdp index c372493..96bc094 100644 --- a/components/security_interstitials_strings.grdp +++ b/components/security_interstitials_strings.grdp
@@ -381,4 +381,18 @@ </ol> </message> </if> + + <!-- Trick to Bill interstitial --> + <message name="IDS_TRICK_TO_BILL_HEADING" desc="The large heading at the top of the trick to bill interstitial."> + The page ahead may try to charge you money + </message> + <message name="IDS_TRICK_TO_BILL_PRIMARY_PARAGRAPH" desc="The primary explanatory paragraph for the trick to bill interstitial."> + These charges could be one-time or recurring and may not be obvious. + </message> + <message name="IDS_TRICK_TO_BILL_PRIMARY_BUTTON" desc="The text for the trick to bill interstitial primary button."> + Go Back + </message> + <message name="IDS_TRICK_TO_BILL_PROCEED_BUTTON" desc="The text for the trick to bill interstitial proceed button."> + Proceed + </message> </grit-part>
diff --git a/components/security_interstitials_strings_grdp/IDS_TRICK_TO_BILL_HEADING.png.sha1 b/components/security_interstitials_strings_grdp/IDS_TRICK_TO_BILL_HEADING.png.sha1 new file mode 100644 index 0000000..840018ae --- /dev/null +++ b/components/security_interstitials_strings_grdp/IDS_TRICK_TO_BILL_HEADING.png.sha1
@@ -0,0 +1 @@ +daf13e4d1d9d61fd9c357af7b52e3fb52c02e7f8 \ No newline at end of file
diff --git a/components/security_interstitials_strings_grdp/IDS_TRICK_TO_BILL_PRIMARY_BUTTON.png.sha1 b/components/security_interstitials_strings_grdp/IDS_TRICK_TO_BILL_PRIMARY_BUTTON.png.sha1 new file mode 100644 index 0000000..840018ae --- /dev/null +++ b/components/security_interstitials_strings_grdp/IDS_TRICK_TO_BILL_PRIMARY_BUTTON.png.sha1
@@ -0,0 +1 @@ +daf13e4d1d9d61fd9c357af7b52e3fb52c02e7f8 \ No newline at end of file
diff --git a/components/security_interstitials_strings_grdp/IDS_TRICK_TO_BILL_PRIMARY_PARAGRAPH.png.sha1 b/components/security_interstitials_strings_grdp/IDS_TRICK_TO_BILL_PRIMARY_PARAGRAPH.png.sha1 new file mode 100644 index 0000000..840018ae --- /dev/null +++ b/components/security_interstitials_strings_grdp/IDS_TRICK_TO_BILL_PRIMARY_PARAGRAPH.png.sha1
@@ -0,0 +1 @@ +daf13e4d1d9d61fd9c357af7b52e3fb52c02e7f8 \ No newline at end of file
diff --git a/components/security_interstitials_strings_grdp/IDS_TRICK_TO_BILL_PROCEED_BUTTON.png.sha1 b/components/security_interstitials_strings_grdp/IDS_TRICK_TO_BILL_PROCEED_BUTTON.png.sha1 new file mode 100644 index 0000000..840018ae --- /dev/null +++ b/components/security_interstitials_strings_grdp/IDS_TRICK_TO_BILL_PROCEED_BUTTON.png.sha1
@@ -0,0 +1 @@ +daf13e4d1d9d61fd9c357af7b52e3fb52c02e7f8 \ No newline at end of file
diff --git a/components/services/heap_profiling/connection_manager.cc b/components/services/heap_profiling/connection_manager.cc index 265db1b..2a115e1 100644 --- a/components/services/heap_profiling/connection_manager.cc +++ b/components/services/heap_profiling/connection_manager.cc
@@ -169,7 +169,8 @@ new_pipe->SetReceiver(connection->thread.task_runner(), connection->parser); connection->thread.task_runner()->PostTask( - FROM_HERE, base::Bind(&ReceiverPipe::StartReadingOnIOThread, new_pipe)); + FROM_HERE, + base::BindOnce(&ReceiverPipe::StartReadingOnIOThread, new_pipe)); // Request the client start sending us data. connection->client->StartProfiling(std::move(params));
diff --git a/components/services/heap_profiling/public/cpp/allocator_shim.cc b/components/services/heap_profiling/public/cpp/allocator_shim.cc index ee956609..41cf928 100644 --- a/components/services/heap_profiling/public/cpp/allocator_shim.cc +++ b/components/services/heap_profiling/public/cpp/allocator_shim.cc
@@ -154,6 +154,28 @@ const bool allowed_; }; +// Realloc triggers both a free and an alloc. +class ScopedAllowRealloc { + public: + ScopedAllowRealloc() + : allow_free_(LIKELY(CanEnterAllocatorShim())), + allow_alloc_(LIKELY(allow_free_ && + (!base::ThreadLocalStorage::HasBeenDestroyed()))) { + if (allow_free_) + SetEnteringAllocatorShim(true); + } + ~ScopedAllowRealloc() { + if (allow_free_) + SetEnteringAllocatorShim(false); + } + bool allow_free() { return allow_free_; } + bool allow_alloc() { return allow_alloc_; } + + private: + const bool allow_free_; + const bool allow_alloc_; +}; + namespace { using base::allocator::AllocatorDispatch; @@ -436,14 +458,16 @@ void* address, size_t size, void* context) { - ScopedAllowAlloc allow_logging; + ScopedAllowRealloc allow_logging; const AllocatorDispatch* const next = self->next; void* ptr = next->realloc_function(next, address, size, context); - if (LIKELY(allow_logging)) { + if (LIKELY(allow_logging.allow_free())) { AllocatorShimLogFree(address); - if (size > 0) // realloc(size == 0) means free() + + // realloc(size == 0) means free() + if (size > 0 && LIKELY(allow_logging.allow_alloc())) AllocatorShimLogAlloc(AllocatorType::kMalloc, ptr, size, nullptr); }
diff --git a/components/services/leveldb/env_mojo.cc b/components/services/leveldb/env_mojo.cc index 2985805..ec715a45 100644 --- a/components/services/leveldb/env_mojo.cc +++ b/components/services/leveldb/env_mojo.cc
@@ -515,7 +515,7 @@ base::PostTaskWithTraits(FROM_HERE, {base::MayBlock(), base::WithBaseSyncPrimitives(), base::TaskShutdownBehavior::BLOCK_SHUTDOWN}, - base::Bind(function, arg)); + base::BindOnce(function, arg)); } void MojoEnv::StartThread(void (*function)(void* arg), void* arg) {
diff --git a/components/services/leveldb/leveldb_mojo_proxy.cc b/components/services/leveldb/leveldb_mojo_proxy.cc index fb579ae7..19f289a 100644 --- a/components/services/leveldb/leveldb_mojo_proxy.cc +++ b/components/services/leveldb/leveldb_mojo_proxy.cc
@@ -147,8 +147,8 @@ base::WaitableEvent::ResetPolicy::AUTOMATIC, base::WaitableEvent::InitialState::NOT_SIGNALED); task_runner_->PostTask( - FROM_HERE, base::Bind(&LevelDBMojoProxy::DoOnOtherThread, this, task, - base::Unretained(&done_event))); + FROM_HERE, base::BindOnce(&LevelDBMojoProxy::DoOnOtherThread, this, + task, base::Unretained(&done_event))); base::ScopedAllowBaseSyncPrimitives allow_base_sync_primitives; done_event.Wait(); }
diff --git a/components/services/patch/public/cpp/patch.cc b/components/services/patch/public/cpp/patch.cc index 49991f7b..ff63ec6 100644 --- a/components/services/patch/public/cpp/patch.cc +++ b/components/services/patch/public/cpp/patch.cc
@@ -90,18 +90,18 @@ new PatchParams(std::move(file_patcher), std::move(callback)); patch_params->file_patcher()->set_connection_error_handler( - base::Bind(&PatchDone, patch_params, /*result=*/-1)); + base::BindOnce(&PatchDone, patch_params, /*result=*/-1)); if (operation == update_client::kBsdiff) { (*patch_params->file_patcher()) ->PatchFileBsdiff(std::move(input_file), std::move(patch_file), std::move(output_file), - base::Bind(&PatchDone, patch_params)); + base::BindOnce(&PatchDone, patch_params)); } else if (operation == update_client::kCourgette) { (*patch_params->file_patcher()) ->PatchFileCourgette(std::move(input_file), std::move(patch_file), std::move(output_file), - base::Bind(&PatchDone, patch_params)); + base::BindOnce(&PatchDone, patch_params)); } else { NOTREACHED(); }
diff --git a/components/sessions/core/base_session_service.cc b/components/sessions/core/base_session_service.cc index df7d44b..b490698 100644 --- a/components/sessions/core/base_session_service.cc +++ b/components/sessions/core/base_session_service.cc
@@ -123,7 +123,7 @@ base::ThreadTaskRunnerHandle::IsSet() && !weak_factory_.HasWeakPtrs()) { base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::Bind(&BaseSessionService::Save, weak_factory_.GetWeakPtr()), + base::BindOnce(&BaseSessionService::Save, weak_factory_.GetWeakPtr()), base::TimeDelta::FromMilliseconds(kSaveDelayMS)); } }
diff --git a/components/signin/core/browser/account_reconcilor.cc b/components/signin/core/browser/account_reconcilor.cc index 813cdab..5e9e7ff 100644 --- a/components/signin/core/browser/account_reconcilor.cc +++ b/components/signin/core/browser/account_reconcilor.cc
@@ -331,8 +331,8 @@ // Keep using base::Bind() until base::OnceCallback get supported by // base::OneShotTimer. timer_->Start(FROM_HERE, timeout_, - base::Bind(&AccountReconcilor::HandleReconcileTimeout, - base::Unretained(this))); + base::BindOnce(&AccountReconcilor::HandleReconcileTimeout, + base::Unretained(this))); } const std::string& account_id = signin_manager_->GetAuthenticatedAccountId(); @@ -595,8 +595,8 @@ if (chrome_accounts_changed_) { chrome_accounts_changed_ = false; base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(&AccountReconcilor::StartReconcile, base::Unretained(this))); + FROM_HERE, base::BindOnce(&AccountReconcilor::StartReconcile, + base::Unretained(this))); } }
diff --git a/components/signin/core/browser/gaia_cookie_manager_service.cc b/components/signin/core/browser/gaia_cookie_manager_service.cc index eea70aeb..bf09a8f7 100644 --- a/components/signin/core/browser/gaia_cookie_manager_service.cc +++ b/components/signin/core/browser/gaia_cookie_manager_service.cc
@@ -662,10 +662,9 @@ error.state(), GoogleServiceAuthError::NUM_STATES); fetcher_timer_.Start( FROM_HERE, fetcher_backoff_.GetTimeUntilRelease(), - base::Bind(&SigninClient::DelayNetworkCall, - base::Unretained(signin_client_), - base::Bind( - &GaiaCookieManagerService::StartFetchingMergeSession, + base::BindOnce( + &SigninClient::DelayNetworkCall, base::Unretained(signin_client_), + base::Bind(&GaiaCookieManagerService::StartFetchingMergeSession, base::Unretained(this)))); return; } @@ -724,10 +723,9 @@ error.state(), GoogleServiceAuthError::NUM_STATES); fetcher_timer_.Start( FROM_HERE, fetcher_backoff_.GetTimeUntilRelease(), - base::Bind(&SigninClient::DelayNetworkCall, - base::Unretained(signin_client_), - base::Bind( - &GaiaCookieManagerService::StartFetchingListAccounts, + base::BindOnce( + &SigninClient::DelayNetworkCall, base::Unretained(signin_client_), + base::Bind(&GaiaCookieManagerService::StartFetchingListAccounts, base::Unretained(this)))); return; } @@ -763,10 +761,10 @@ fetcher_backoff_.InformOfRequest(false); fetcher_timer_.Start( FROM_HERE, fetcher_backoff_.GetTimeUntilRelease(), - base::Bind(&SigninClient::DelayNetworkCall, - base::Unretained(signin_client_), - base::Bind(&GaiaCookieManagerService::StartGaiaLogOut, - base::Unretained(this)))); + base::BindOnce(&SigninClient::DelayNetworkCall, + base::Unretained(signin_client_), + base::Bind(&GaiaCookieManagerService::StartGaiaLogOut, + base::Unretained(this)))); return; }
diff --git a/components/storage_monitor/media_storage_util.cc b/components/storage_monitor/media_storage_util.cc index db447e6..210e04c 100644 --- a/components/storage_monitor/media_storage_util.cc +++ b/components/storage_monitor/media_storage_util.cc
@@ -112,7 +112,8 @@ FROM_HERE, {base::TaskPriority::BEST_EFFORT, base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, - base::Bind(&FilterAttachedDevicesOnBackgroundSequence, devices), done); + base::BindOnce(&FilterAttachedDevicesOnBackgroundSequence, devices), + done); } // TODO(kmadhusu) Write unit tests for GetDeviceInfoFromPath().
diff --git a/components/storage_monitor/storage_monitor_chromeos.cc b/components/storage_monitor/storage_monitor_chromeos.cc index 2eaafc2..34b8788 100644 --- a/components/storage_monitor/storage_monitor_chromeos.cc +++ b/components/storage_monitor/storage_monitor_chromeos.cc
@@ -158,8 +158,8 @@ blocking_task_runner->PostTaskAndReply( FROM_HERE, base::DoNothing(), - base::Bind(&StorageMonitorCros::MarkInitialized, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&StorageMonitorCros::MarkInitialized, + weak_ptr_factory_.GetWeakPtr())); } void StorageMonitorCros::OnBootDeviceDiskEvent(
diff --git a/components/subresource_filter/content/browser/fake_safe_browsing_database_manager.cc b/components/subresource_filter/content/browser/fake_safe_browsing_database_manager.cc index 4cd1617..585ef1a 100644 --- a/components/subresource_filter/content/browser/fake_safe_browsing_database_manager.cc +++ b/components/subresource_filter/content/browser/fake_safe_browsing_database_manager.cc
@@ -58,9 +58,10 @@ return false; content::BrowserThread::PostTask( content::BrowserThread::IO, FROM_HERE, - base::Bind(&FakeSafeBrowsingDatabaseManager:: - OnCheckUrlForSubresourceFilterComplete, - weak_factory_.GetWeakPtr(), base::Unretained(client), url)); + base::BindOnce(&FakeSafeBrowsingDatabaseManager:: + OnCheckUrlForSubresourceFilterComplete, + weak_factory_.GetWeakPtr(), base::Unretained(client), + url)); return false; }
diff --git a/components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle.cc b/components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle.cc index 1b50578..e706f400 100644 --- a/components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle.cc +++ b/components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle.cc
@@ -125,9 +125,10 @@ check_results_.emplace_back(); size_t id = check_results_.size() - 1; io_task_runner_->PostTask( - FROM_HERE, base::Bind(&SubresourceFilterSafeBrowsingClient::CheckUrlOnIO, - base::Unretained(database_client_.get()), - navigation_handle()->GetURL(), id)); + FROM_HERE, + base::BindOnce(&SubresourceFilterSafeBrowsingClient::CheckUrlOnIO, + base::Unretained(database_client_.get()), + navigation_handle()->GetURL(), id)); } void SubresourceFilterSafeBrowsingActivationThrottle::NotifyResult() {
diff --git a/components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle_unittest.cc b/components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle_unittest.cc index 7c71e86..18b9003 100644 --- a/components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle_unittest.cc +++ b/components/subresource_filter/content/browser/subresource_filter_safe_browsing_activation_throttle_unittest.cc
@@ -283,8 +283,9 @@ // NavigationSimulator by giving it an option to be driven by a // TestMockTimeTaskRunner. Also see https://crbug.com/703346. base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&base::TestMockTimeTaskRunner::RunUntilIdle, - base::Unretained(test_io_task_runner_.get()))); + FROM_HERE, + base::BindOnce(&base::TestMockTimeTaskRunner::RunUntilIdle, + base::Unretained(test_io_task_runner_.get()))); simulator->Commit(); return simulator->GetLastThrottleCheckResult(); }
diff --git a/components/subresource_filter/content/browser/subresource_filter_safe_browsing_client.cc b/components/subresource_filter/content/browser/subresource_filter_safe_browsing_client.cc index 5d45004d..2ad490a 100644 --- a/components/subresource_filter/content/browser/subresource_filter_safe_browsing_client.cc +++ b/components/subresource_filter/content/browser/subresource_filter_safe_browsing_client.cc
@@ -69,9 +69,10 @@ "SubresourceFilterSBCheck", request, "check_result", check_result.ToTracedValue()); throttle_task_runner_->PostTask( - FROM_HERE, base::Bind(&SubresourceFilterSafeBrowsingActivationThrottle:: - OnCheckUrlResultOnUI, - throttle_, check_result)); + FROM_HERE, + base::BindOnce(&SubresourceFilterSafeBrowsingActivationThrottle:: + OnCheckUrlResultOnUI, + throttle_, check_result)); DCHECK(requests_.find(request) != requests_.end()); requests_.erase(request);
diff --git a/components/subresource_filter/content/browser/subresource_filter_safe_browsing_client_request.cc b/components/subresource_filter/content/browser/subresource_filter_safe_browsing_client_request.cc index ecd2d28..60c6771853 100644 --- a/components/subresource_filter/content/browser/subresource_filter_safe_browsing_client_request.cc +++ b/components/subresource_filter/content/browser/subresource_filter_safe_browsing_client_request.cc
@@ -60,8 +60,9 @@ } timer_.Start( FROM_HERE, kCheckURLTimeout, - base::Bind(&SubresourceFilterSafeBrowsingClientRequest::OnCheckUrlTimeout, - base::Unretained(this))); + base::BindOnce( + &SubresourceFilterSafeBrowsingClientRequest::OnCheckUrlTimeout, + base::Unretained(this))); } void SubresourceFilterSafeBrowsingClientRequest::OnCheckBrowseUrlResult(
diff --git a/components/subresource_filter/content/browser/verified_ruleset_dealer.cc b/components/subresource_filter/content/browser/verified_ruleset_dealer.cc index 4cd8a8b..e6f7a02 100644 --- a/components/subresource_filter/content/browser/verified_ruleset_dealer.cc +++ b/components/subresource_filter/content/browser/verified_ruleset_dealer.cc
@@ -91,7 +91,7 @@ // corresponding task will be posted *before* a task to delete the pointer // upon destruction of |this| Handler. task_runner_->PostTask(FROM_HERE, - base::Bind(std::move(callback), dealer_.get())); + base::BindOnce(std::move(callback), dealer_.get())); } void VerifiedRulesetDealer::Handle::TryOpenAndSetRulesetFile( @@ -138,7 +138,7 @@ void VerifiedRuleset::Handle::GetRulesetAsync( base::Callback<void(VerifiedRuleset*)> callback) { DCHECK(sequence_checker_.CalledOnValidSequence()); - task_runner_->PostTask(FROM_HERE, base::Bind(callback, ruleset_.get())); + task_runner_->PostTask(FROM_HERE, base::BindOnce(callback, ruleset_.get())); } } // namespace subresource_filter
diff --git a/components/subresource_filter/core/browser/ruleset_service.cc b/components/subresource_filter/core/browser/ruleset_service.cc index 408febf..b40a5214 100644 --- a/components/subresource_filter/core/browser/ruleset_service.cc +++ b/components/subresource_filter/core/browser/ruleset_service.cc
@@ -447,8 +447,8 @@ most_recently_indexed_version.ReadFromPrefs(local_state_); background_task_runner_->PostTask( FROM_HERE, - base::Bind(&IndexedRulesetLocator::DeleteObsoleteRulesets, - indexed_ruleset_base_dir_, most_recently_indexed_version)); + base::BindOnce(&IndexedRulesetLocator::DeleteObsoleteRulesets, + indexed_ruleset_base_dir_, most_recently_indexed_version)); if (!queued_unindexed_ruleset_info_.content_version.empty()) { IndexAndStoreRuleset(
diff --git a/components/suggestions/image_manager.cc b/components/suggestions/image_manager.cc index d8f1007e..223700086 100644 --- a/components/suggestions/image_manager.cc +++ b/components/suggestions/image_manager.cc
@@ -83,8 +83,8 @@ weak_ptr_factory_(this) { database_->Init(kDatabaseUMAClientName, database_dir, leveldb_proto::CreateSimpleOptions(), - base::Bind(&ImageManager::OnDatabaseInit, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&ImageManager::OnDatabaseInit, + weak_ptr_factory_.GetWeakPtr())); } ImageManager::~ImageManager() {} @@ -241,8 +241,8 @@ entries_to_save->push_back(std::make_pair(data.url(), data)); database_->UpdateEntries(std::move(entries_to_save), std::move(keys_to_remove), - base::Bind(&ImageManager::OnDatabaseSave, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&ImageManager::OnDatabaseSave, + weak_ptr_factory_.GetWeakPtr())); } void ImageManager::OnDatabaseInit(bool success) { @@ -252,8 +252,8 @@ ServePendingCacheRequests(); return; } - database_->LoadEntries(base::Bind(&ImageManager::OnDatabaseLoad, - weak_ptr_factory_.GetWeakPtr())); + database_->LoadEntries(base::BindOnce(&ImageManager::OnDatabaseLoad, + weak_ptr_factory_.GetWeakPtr())); } void ImageManager::OnDatabaseLoad(bool success,
diff --git a/components/suggestions/suggestions_service_impl.cc b/components/suggestions/suggestions_service_impl.cc index 78ef389..1c3678c 100644 --- a/components/suggestions/suggestions_service_impl.cc +++ b/components/suggestions/suggestions_service_impl.cc
@@ -575,11 +575,10 @@ TimeDelta time_delta; if (blacklist_store_->GetTimeUntilReadyForUpload(&time_delta)) { // Blacklist cache is not empty: schedule. - // TODO: Use BindOnce when OnceTimer supports it. blacklist_upload_timer_.Start( FROM_HERE, time_delta + blacklist_upload_backoff_.GetTimeUntilRelease(), - base::BindRepeating(&SuggestionsServiceImpl::UploadOneFromBlacklist, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&SuggestionsServiceImpl::UploadOneFromBlacklist, + weak_ptr_factory_.GetWeakPtr())); } }
diff --git a/components/sync/base/cancelation_signal_unittest.cc b/components/sync/base/cancelation_signal_unittest.cc index 3729d53a..a1fc5d1 100644 --- a/components/sync/base/cancelation_signal_unittest.cc +++ b/components/sync/base/cancelation_signal_unittest.cc
@@ -65,9 +65,9 @@ base::WaitableEvent* task_done_signal) { exec_thread_.Start(); exec_thread_.task_runner()->PostTask( - FROM_HERE, base::Bind(&BlockingTask::Run, base::Unretained(this), - base::Unretained(task_start_signal), - base::Unretained(task_done_signal))); + FROM_HERE, base::BindOnce(&BlockingTask::Run, base::Unretained(this), + base::Unretained(task_start_signal), + base::Unretained(task_done_signal))); } void BlockingTask::Run(base::WaitableEvent* task_start_signal,
diff --git a/components/sync/base/weak_handle_unittest.cc b/components/sync/base/weak_handle_unittest.cc index 7b27850..0f744ccd 100644 --- a/components/sync/base/weak_handle_unittest.cc +++ b/components/sync/base/weak_handle_unittest.cc
@@ -54,7 +54,7 @@ base::Thread t("Test thread"); ASSERT_TRUE(t.Start()); t.task_runner()->PostTask( - from_here, base::Bind(&WeakHandleTest::CallTest, from_here, h)); + from_here, base::BindOnce(&WeakHandleTest::CallTest, from_here, h)); } private: @@ -211,8 +211,8 @@ { base::Thread t("Test thread"); ASSERT_TRUE(t.Start()); - t.task_runner()->PostTask(FROM_HERE, - base::Bind(&CallTestWithSelf, b1.AsWeakHandle())); + t.task_runner()->PostTask( + FROM_HERE, base::BindOnce(&CallTestWithSelf, b1.AsWeakHandle())); } // Calls b1.TestWithSelf().
diff --git a/components/sync/driver/async_directory_type_controller_unittest.cc b/components/sync/driver/async_directory_type_controller_unittest.cc index f22493b..e9cb497 100644 --- a/components/sync/driver/async_directory_type_controller_unittest.cc +++ b/components/sync/driver/async_directory_type_controller_unittest.cc
@@ -197,7 +197,8 @@ base::WaitableEvent::InitialState::NOT_SIGNALED); backend_thread_.task_runner()->PostTask( FROM_HERE, - base::Bind(&SyncAsyncDirectoryTypeControllerTest::SignalDone, &done)); + base::BindOnce(&SyncAsyncDirectoryTypeControllerTest::SignalDone, + &done)); done.TimedWait(TestTimeouts::action_timeout()); if (!done.IsSignaled()) { ADD_FAILURE() << "Timed out waiting for DB thread to finish.";
diff --git a/components/sync/driver/backend_migrator.cc b/components/sync/driver/backend_migrator.cc index 731c0d6..618a36d 100644 --- a/components/sync/driver/backend_migrator.cc +++ b/components/sync/driver/backend_migrator.cc
@@ -108,8 +108,8 @@ // them, so post a task to avoid problems. SDVLOG(1) << "Posting OnConfigureDoneImpl"; base::SequencedTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&BackendMigrator::OnConfigureDoneImpl, - weak_ptr_factory_.GetWeakPtr(), result)); + FROM_HERE, base::BindOnce(&BackendMigrator::OnConfigureDoneImpl, + weak_ptr_factory_.GetWeakPtr(), result)); } namespace {
diff --git a/components/sync/driver/data_type_manager_impl.cc b/components/sync/driver/data_type_manager_impl.cc index 42dc14f1..dd5fb53 100644 --- a/components/sync/driver/data_type_manager_impl.cc +++ b/components/sync/driver/data_type_manager_impl.cc
@@ -673,8 +673,8 @@ // finish stopping this type, otherwise DeactivateDataType() and Stop() // end up getting called twice on the controller. base::SequencedTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&DataTypeManagerImpl::ProcessReconfigure, - weak_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&DataTypeManagerImpl::ProcessReconfigure, + weak_ptr_factory_.GetWeakPtr())); } } }
diff --git a/components/sync/driver/frontend_data_type_controller.cc b/components/sync/driver/frontend_data_type_controller.cc index a189c3a..73cf5ab4 100644 --- a/components/sync/driver/frontend_data_type_controller.cc +++ b/components/sync/driver/frontend_data_type_controller.cc
@@ -72,8 +72,8 @@ state_ = ASSOCIATING; base::SequencedTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&FrontendDataTypeController::Associate, - base::AsWeakPtr(this))); + FROM_HERE, base::BindOnce(&FrontendDataTypeController::Associate, + base::AsWeakPtr(this))); } // For directory datatypes metadata clears by SyncManager::PurgeDisabledTypes().
diff --git a/components/sync/driver/glue/sync_backend_host_core.cc b/components/sync/driver/glue/sync_backend_host_core.cc index b3af3f5..dbfa6e9 100644 --- a/components/sync/driver/glue/sync_backend_host_core.cc +++ b/components/sync/driver/glue/sync_backend_host_core.cc
@@ -120,8 +120,8 @@ // Sync manager initialization is complete, so we can schedule recurring // SaveChanges. base::SequencedTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&SyncBackendHostCore::StartSavingChanges, - weak_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&SyncBackendHostCore::StartSavingChanges, + weak_ptr_factory_.GetWeakPtr())); // Hang on to these for a while longer. We're not ready to hand them back to // the UI thread yet.
diff --git a/components/sync/driver/glue/sync_backend_host_impl.cc b/components/sync/driver/glue/sync_backend_host_impl.cc index 7830d31..249f897 100644 --- a/components/sync/driver/glue/sync_backend_host_impl.cc +++ b/components/sync/driver/glue/sync_backend_host_impl.cc
@@ -78,14 +78,14 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); sync_task_runner_->PostTask( FROM_HERE, - base::Bind(&SyncBackendHostCore::DoRefreshTypes, core_, types)); + base::BindOnce(&SyncBackendHostCore::DoRefreshTypes, core_, types)); } void SyncBackendHostImpl::UpdateCredentials( const SyncCredentials& credentials) { sync_task_runner_->PostTask( - FROM_HERE, base::Bind(&SyncBackendHostCore::DoUpdateCredentials, core_, - credentials)); + FROM_HERE, base::BindOnce(&SyncBackendHostCore::DoUpdateCredentials, + core_, credentials)); } void SyncBackendHostImpl::InvalidateCredentials() { @@ -96,7 +96,8 @@ void SyncBackendHostImpl::StartConfiguration() { sync_task_runner_->PostTask( - FROM_HERE, base::Bind(&SyncBackendHostCore::DoStartConfiguration, core_)); + FROM_HERE, + base::BindOnce(&SyncBackendHostCore::DoStartConfiguration, core_)); } void SyncBackendHostImpl::StartSyncingWithServer() { @@ -117,16 +118,16 @@ bool is_explicit) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); sync_task_runner_->PostTask( - FROM_HERE, base::Bind(&SyncBackendHostCore::DoSetEncryptionPassphrase, - core_, passphrase, is_explicit)); + FROM_HERE, base::BindOnce(&SyncBackendHostCore::DoSetEncryptionPassphrase, + core_, passphrase, is_explicit)); } void SyncBackendHostImpl::SetDecryptionPassphrase( const std::string& passphrase) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); sync_task_runner_->PostTask( - FROM_HERE, base::Bind(&SyncBackendHostCore::DoSetDecryptionPassphrase, - core_, passphrase)); + FROM_HERE, base::BindOnce(&SyncBackendHostCore::DoSetDecryptionPassphrase, + core_, passphrase)); } void SyncBackendHostImpl::StopSyncingForShutdown() { @@ -162,7 +163,8 @@ // |registrar_| so its destruction must be sequenced before the destruction of // |registrar_|. sync_task_runner_->PostTask( - FROM_HERE, base::Bind(&SyncBackendHostCore::DoShutdown, core_, reason)); + FROM_HERE, + base::BindOnce(&SyncBackendHostCore::DoShutdown, core_, reason)); core_ = nullptr; registrar_ = nullptr; } @@ -170,8 +172,8 @@ void SyncBackendHostImpl::ConfigureDataTypes(ConfigureParams params) { sync_task_runner_->PostTask( FROM_HERE, - base::Bind(&SyncBackendHostCore::DoPurgeDisabledTypes, core_, - params.to_purge, params.to_journal, params.to_unapply)); + base::BindOnce(&SyncBackendHostCore::DoPurgeDisabledTypes, core_, + params.to_purge, params.to_journal, params.to_unapply)); sync_task_runner_->PostTask( FROM_HERE, base::BindOnce(&SyncBackendHostCore::DoConfigureSyncer, core_, std::move(params))); @@ -189,7 +191,7 @@ void SyncBackendHostImpl::EnableEncryptEverything() { sync_task_runner_->PostTask( FROM_HERE, - base::Bind(&SyncBackendHostCore::DoEnableEncryptEverything, core_)); + base::BindOnce(&SyncBackendHostCore::DoEnableEncryptEverything, core_)); } void SyncBackendHostImpl::ActivateDirectoryDataType( @@ -253,13 +255,13 @@ void SyncBackendHostImpl::FlushDirectory() const { DCHECK(initialized()); sync_task_runner_->PostTask( - FROM_HERE, base::Bind(&SyncBackendHostCore::SaveChanges, core_)); + FROM_HERE, base::BindOnce(&SyncBackendHostCore::SaveChanges, core_)); } void SyncBackendHostImpl::RequestBufferedProtocolEventsAndEnableForwarding() { sync_task_runner_->PostTask( FROM_HERE, - base::Bind( + base::BindOnce( &SyncBackendHostCore::SendBufferedProtocolEventsAndEnableForwarding, core_)); } @@ -267,23 +269,25 @@ void SyncBackendHostImpl::DisableProtocolEventForwarding() { sync_task_runner_->PostTask( FROM_HERE, - base::Bind(&SyncBackendHostCore::DisableProtocolEventForwarding, core_)); + base::BindOnce(&SyncBackendHostCore::DisableProtocolEventForwarding, + core_)); } void SyncBackendHostImpl::EnableDirectoryTypeDebugInfoForwarding() { DCHECK(initialized()); sync_task_runner_->PostTask( FROM_HERE, - base::Bind(&SyncBackendHostCore::EnableDirectoryTypeDebugInfoForwarding, - core_)); + base::BindOnce( + &SyncBackendHostCore::EnableDirectoryTypeDebugInfoForwarding, core_)); } void SyncBackendHostImpl::DisableDirectoryTypeDebugInfoForwarding() { DCHECK(initialized()); sync_task_runner_->PostTask( FROM_HERE, - base::Bind(&SyncBackendHostCore::DisableDirectoryTypeDebugInfoForwarding, - core_)); + base::BindOnce( + &SyncBackendHostCore::DisableDirectoryTypeDebugInfoForwarding, + core_)); } void SyncBackendHostImpl::FinishConfigureDataTypesOnFrontendLoop( @@ -376,15 +380,16 @@ void SyncBackendHostImpl::OnInvalidatorStateChange(InvalidatorState state) { sync_task_runner_->PostTask( - FROM_HERE, base::Bind(&SyncBackendHostCore::DoOnInvalidatorStateChange, - core_, state)); + FROM_HERE, + base::BindOnce(&SyncBackendHostCore::DoOnInvalidatorStateChange, core_, + state)); } void SyncBackendHostImpl::OnIncomingInvalidation( const ObjectIdInvalidationMap& invalidation_map) { sync_task_runner_->PostTask( - FROM_HERE, base::Bind(&SyncBackendHostCore::DoOnIncomingInvalidation, - core_, invalidation_map)); + FROM_HERE, base::BindOnce(&SyncBackendHostCore::DoOnIncomingInvalidation, + core_, invalidation_map)); } std::string SyncBackendHostImpl::GetOwnerName() const { @@ -435,7 +440,7 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); sync_task_runner_->PostTask( FROM_HERE, - base::Bind(&SyncBackendHostCore::DoClearServerData, core_, callback)); + base::BindOnce(&SyncBackendHostCore::DoClearServerData, core_, callback)); } void SyncBackendHostImpl::OnCookieJarChanged(bool account_mismatch, @@ -443,8 +448,8 @@ const base::Closure& callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); sync_task_runner_->PostTask( - FROM_HERE, base::Bind(&SyncBackendHostCore::DoOnCookieJarChanged, core_, - account_mismatch, empty_jar, callback)); + FROM_HERE, base::BindOnce(&SyncBackendHostCore::DoOnCookieJarChanged, + core_, account_mismatch, empty_jar, callback)); } void SyncBackendHostImpl::ClearServerDataDoneOnFrontendLoop(
diff --git a/components/sync/driver/model_association_manager.cc b/components/sync/driver/model_association_manager.cc index c9d74c9..3a25984 100644 --- a/components/sync/driver/model_association_manager.cc +++ b/components/sync/driver/model_association_manager.cc
@@ -227,8 +227,8 @@ timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(kAssociationTimeOutInSeconds), - base::Bind(&ModelAssociationManager::ModelAssociationDone, - weak_ptr_factory_.GetWeakPtr(), INITIALIZED)); + base::BindOnce(&ModelAssociationManager::ModelAssociationDone, + weak_ptr_factory_.GetWeakPtr(), INITIALIZED)); // Start association of types that are loaded in specified order. for (size_t i = 0; i < arraysize(kStartOrder); i++) {
diff --git a/components/sync/driver/model_type_controller.cc b/components/sync/driver/model_type_controller.cc index 272e59b..c63ed5e 100644 --- a/components/sync/driver/model_type_controller.cc +++ b/components/sync/driver/model_type_controller.cc
@@ -32,7 +32,7 @@ UMA_HISTOGRAM_ENUMERATION("Sync.DataTypeRunFailures", ModelTypeToHistogramInt(model_type), static_cast<int>(MODEL_TYPE_COUNT)); - ui_thread->PostTask(error.location(), base::Bind(error_handler, error)); + ui_thread->PostTask(error.location(), base::BindOnce(error_handler, error)); } // Takes the strictest policy for clearing sync metadata.
diff --git a/components/sync/driver/model_type_controller_unittest.cc b/components/sync/driver/model_type_controller_unittest.cc index cae0180f..3d23ac2 100644 --- a/components/sync/driver/model_type_controller_unittest.cc +++ b/components/sync/driver/model_type_controller_unittest.cc
@@ -260,8 +260,8 @@ } else { model_thread_.task_runner()->PostTask( FROM_HERE, - base::Bind(&ModelTypeControllerTest::ExpectProcessorConnected, - base::Unretained(this), is_connected)); + base::BindOnce(&ModelTypeControllerTest::ExpectProcessorConnected, + base::Unretained(this), is_connected)); PumpModelThread(); } }
diff --git a/components/sync/driver/shared_change_processor_unittest.cc b/components/sync/driver/shared_change_processor_unittest.cc index b78c3338..c2051c55 100644 --- a/components/sync/driver/shared_change_processor_unittest.cc +++ b/components/sync/driver/shared_change_processor_unittest.cc
@@ -58,15 +58,16 @@ ASSERT_TRUE(model_thread_.Start()); ASSERT_TRUE(model_thread_.task_runner()->PostTask( FROM_HERE, - base::Bind(&SyncSharedChangeProcessorTest::SetUpDBSyncableService, - base::Unretained(this)))); + base::BindOnce(&SyncSharedChangeProcessorTest::SetUpDBSyncableService, + base::Unretained(this)))); } void TearDown() override { EXPECT_TRUE(model_thread_.task_runner()->PostTask( FROM_HERE, - base::Bind(&SyncSharedChangeProcessorTest::TearDownDBSyncableService, - base::Unretained(this)))); + base::BindOnce( + &SyncSharedChangeProcessorTest::TearDownDBSyncableService, + base::Unretained(this)))); // This must happen before the DB thread is stopped since // |shared_change_processor_| may post tasks to delete its members // on the correct thread. @@ -88,8 +89,8 @@ void Connect() { EXPECT_TRUE(model_thread_.task_runner()->PostTask( FROM_HERE, - base::Bind(&SyncSharedChangeProcessorTest::ConnectOnDBThread, - base::Unretained(this), shared_change_processor_))); + base::BindOnce(&SyncSharedChangeProcessorTest::ConnectOnDBThread, + base::Unretained(this), shared_change_processor_))); } private:
diff --git a/components/sync/driver/sync_service_crypto.cc b/components/sync/driver/sync_service_crypto.cc index fc75d96..7efff172 100644 --- a/components/sync/driver/sync_service_crypto.cc +++ b/components/sync/driver/sync_service_crypto.cc
@@ -35,44 +35,46 @@ const sync_pb::EncryptedData& pending_keys) override { task_runner_->PostTask( FROM_HERE, - base::Bind(&SyncEncryptionHandler::Observer::OnPassphraseRequired, - observer_, reason, pending_keys)); + base::BindOnce(&SyncEncryptionHandler::Observer::OnPassphraseRequired, + observer_, reason, pending_keys)); } void OnPassphraseAccepted() override { task_runner_->PostTask( FROM_HERE, - base::Bind(&SyncEncryptionHandler::Observer::OnPassphraseAccepted, - observer_)); + base::BindOnce(&SyncEncryptionHandler::Observer::OnPassphraseAccepted, + observer_)); } void OnBootstrapTokenUpdated(const std::string& bootstrap_token, BootstrapTokenType type) override { task_runner_->PostTask( FROM_HERE, - base::Bind(&SyncEncryptionHandler::Observer::OnBootstrapTokenUpdated, - observer_, bootstrap_token, type)); + base::BindOnce( + &SyncEncryptionHandler::Observer::OnBootstrapTokenUpdated, + observer_, bootstrap_token, type)); } void OnEncryptedTypesChanged(ModelTypeSet encrypted_types, bool encrypt_everything) override { task_runner_->PostTask( FROM_HERE, - base::Bind(&SyncEncryptionHandler::Observer::OnEncryptedTypesChanged, - observer_, encrypted_types, encrypt_everything)); + base::BindOnce( + &SyncEncryptionHandler::Observer::OnEncryptedTypesChanged, + observer_, encrypted_types, encrypt_everything)); } void OnEncryptionComplete() override { task_runner_->PostTask( FROM_HERE, - base::Bind(&SyncEncryptionHandler::Observer::OnEncryptionComplete, - observer_)); + base::BindOnce(&SyncEncryptionHandler::Observer::OnEncryptionComplete, + observer_)); } void OnCryptographerStateChanged(Cryptographer* cryptographer) override { task_runner_->PostTask( FROM_HERE, - base::Bind( + base::BindOnce( &SyncEncryptionHandler::Observer::OnCryptographerStateChanged, observer_, cryptographer)); } @@ -81,15 +83,16 @@ base::Time passphrase_time) override { task_runner_->PostTask( FROM_HERE, - base::Bind(&SyncEncryptionHandler::Observer::OnPassphraseTypeChanged, - observer_, type, passphrase_time)); + base::BindOnce( + &SyncEncryptionHandler::Observer::OnPassphraseTypeChanged, + observer_, type, passphrase_time)); } void OnLocalSetPassphraseEncryption( const SyncEncryptionHandler::NigoriState& nigori_state) override { task_runner_->PostTask( FROM_HERE, - base::Bind( + base::BindOnce( &SyncEncryptionHandler::Observer::OnLocalSetPassphraseEncryption, observer_, nigori_state)); }
diff --git a/components/sync/driver/sync_stopped_reporter.cc b/components/sync/driver/sync_stopped_reporter.cc index fae2763..917145b 100644 --- a/components/sync/driver/sync_stopped_reporter.cc +++ b/components/sync/driver/sync_stopped_reporter.cc
@@ -120,7 +120,7 @@ timer_.Stop(); if (!callback_.is_null()) { base::SequencedTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback_, result)); + FROM_HERE, base::BindOnce(callback_, result)); } } @@ -128,7 +128,7 @@ simple_url_loader_.reset(); if (!callback_.is_null()) { base::SequencedTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback_, RESULT_TIMEOUT)); + FROM_HERE, base::BindOnce(callback_, RESULT_TIMEOUT)); } }
diff --git a/components/sync/engine/model_safe_worker_unittest.cc b/components/sync/engine/model_safe_worker_unittest.cc index 5836150c..06e675e 100644 --- a/components/sync/engine/model_safe_worker_unittest.cc +++ b/components/sync/engine/model_safe_worker_unittest.cc
@@ -20,7 +20,7 @@ namespace { syncer::WorkCallback ClosureToWorkCallback(base::Closure work) { - return base::Bind( + return base::BindOnce( [](base::Closure work) { work.Run(); return syncer::SYNCER_OK;
diff --git a/components/sync/engine/model_type_processor_proxy.cc b/components/sync/engine/model_type_processor_proxy.cc index 10e5e29..2956d23 100644 --- a/components/sync/engine/model_type_processor_proxy.cc +++ b/components/sync/engine/model_type_processor_proxy.cc
@@ -27,7 +27,8 @@ void ModelTypeProcessorProxy::DisconnectSync() { task_runner_->PostTask( - FROM_HERE, base::Bind(&ModelTypeProcessor::DisconnectSync, processor_)); + FROM_HERE, + base::BindOnce(&ModelTypeProcessor::DisconnectSync, processor_)); } void ForwardGetLocalChangesCall( @@ -54,17 +55,17 @@ void ModelTypeProcessorProxy::OnCommitCompleted( const sync_pb::ModelTypeState& type_state, const CommitResponseDataList& response_list) { - task_runner_->PostTask( - FROM_HERE, base::Bind(&ModelTypeProcessor::OnCommitCompleted, processor_, - type_state, response_list)); + task_runner_->PostTask(FROM_HERE, + base::BindOnce(&ModelTypeProcessor::OnCommitCompleted, + processor_, type_state, response_list)); } void ModelTypeProcessorProxy::OnUpdateReceived( const sync_pb::ModelTypeState& type_state, const UpdateResponseDataList& updates) { - task_runner_->PostTask( - FROM_HERE, base::Bind(&ModelTypeProcessor::OnUpdateReceived, processor_, - type_state, updates)); + task_runner_->PostTask(FROM_HERE, + base::BindOnce(&ModelTypeProcessor::OnUpdateReceived, + processor_, type_state, updates)); } } // namespace syncer
diff --git a/components/sync/engine/net/http_bridge.cc b/components/sync/engine/net/http_bridge.cc index 299265a..39ff53d 100644 --- a/components/sync/engine/net/http_bridge.cc +++ b/components/sync/engine/net/http_bridge.cc
@@ -201,7 +201,8 @@ #endif if (!network_task_runner_->PostTask( - FROM_HERE, base::Bind(&HttpBridge::CallMakeAsynchronousPost, this))) { + FROM_HERE, + base::BindOnce(&HttpBridge::CallMakeAsynchronousPost, this))) { // This usually happens when we're in a unit test. LOG(WARNING) << "Could not post CallMakeAsynchronousPost task"; return false; @@ -233,7 +234,7 @@ std::make_unique<base::OneShotTimer>(); fetch_state_.http_request_timeout_timer->Start( FROM_HERE, base::TimeDelta::FromSeconds(kMaxHttpRequestTimeSeconds), - base::Bind(&HttpBridge::OnURLFetchTimedOut, this)); + base::BindOnce(&HttpBridge::OnURLFetchTimedOut, this)); DCHECK(request_context_getter_); fetch_state_.start_time = base::Time::Now(); @@ -328,9 +329,9 @@ fetch_state_.aborted = true; if (!network_task_runner_->PostTask( FROM_HERE, - base::Bind(&HttpBridge::DestroyURLFetcherOnIOThread, this, - fetch_state_.url_poster, - fetch_state_.http_request_timeout_timer.release()))) { + base::BindOnce(&HttpBridge::DestroyURLFetcherOnIOThread, this, + fetch_state_.url_poster, + fetch_state_.http_request_timeout_timer.release()))) { // Madness ensues. NOTREACHED() << "Could not post task to delete URLFetcher"; }
diff --git a/components/sync/engine/net/http_bridge_unittest.cc b/components/sync/engine/net/http_bridge_unittest.cc index 7207e757..6ad4c1e 100644 --- a/components/sync/engine/net/http_bridge_unittest.cc +++ b/components/sync/engine/net/http_bridge_unittest.cc
@@ -152,7 +152,7 @@ // as if it completed. test_->GetIOThreadLoop()->task_runner()->PostTask( FROM_HERE, - base::Bind(&ShuntedHttpBridge::CallOnURLFetchComplete, this)); + base::BindOnce(&ShuntedHttpBridge::CallOnURLFetchComplete, this)); } private: @@ -203,8 +203,8 @@ // URLRequestContextGetter::GetURLRequestContext on the IO thread. io_thread()->task_runner()->PostTask( FROM_HERE, - base::Bind(&MAYBE_SyncHttpBridgeTest::TestSameHttpNetworkSession, - run_loop.QuitWhenIdleClosure(), this)); + base::BindOnce(&MAYBE_SyncHttpBridgeTest::TestSameHttpNetworkSession, + run_loop.QuitWhenIdleClosure(), this)); run_loop.Run(); } @@ -355,8 +355,8 @@ int response_code = 0; io_thread()->task_runner()->PostTask( - FROM_HERE, base::Bind(&MAYBE_SyncHttpBridgeTest::Abort, - base::RetainedRef(http_bridge))); + FROM_HERE, base::BindOnce(&MAYBE_SyncHttpBridgeTest::Abort, + base::RetainedRef(http_bridge))); bool success = http_bridge->MakeSynchronousPost(&os_error, &response_code); EXPECT_FALSE(success); EXPECT_EQ(net::ERR_ABORTED, os_error); @@ -396,17 +396,17 @@ base::WaitableEvent::InitialState::NOT_SIGNALED); sync_thread.task_runner()->PostTask( FROM_HERE, - base::Bind(&MAYBE_SyncHttpBridgeTest::RunSyncThreadBridgeUseTest, - base::Unretained(this), &signal_when_created, - &signal_when_released)); + base::BindOnce(&MAYBE_SyncHttpBridgeTest::RunSyncThreadBridgeUseTest, + base::Unretained(this), &signal_when_created, + &signal_when_released)); // Stop IO so we can control order of operations. base::WaitableEvent io_waiter( base::WaitableEvent::ResetPolicy::AUTOMATIC, base::WaitableEvent::InitialState::NOT_SIGNALED); ASSERT_TRUE(io_thread()->task_runner()->PostTask( - FROM_HERE, - base::Bind(&base::WaitableEvent::Wait, base::Unretained(&io_waiter)))); + FROM_HERE, base::BindOnce(&base::WaitableEvent::Wait, + base::Unretained(&io_waiter)))); signal_when_created.Wait(); // Wait till we have a bridge to abort. ASSERT_TRUE(bridge_for_race_test()); @@ -420,8 +420,8 @@ fetcher.set_response_code(200); fetcher.SetResponseString(response_content); ASSERT_TRUE(io_thread()->task_runner()->PostTask( - FROM_HERE, base::Bind(&net::URLFetcherDelegate::OnURLFetchComplete, - base::Unretained(delegate), &fetcher))); + FROM_HERE, base::BindOnce(&net::URLFetcherDelegate::OnURLFetchComplete, + base::Unretained(delegate), &fetcher))); // Abort the fetch. This should be smart enough to handle the case where // the bridge is destroyed before the callback scheduled above completes. @@ -493,10 +493,11 @@ // Create bridge factory and factory on sync thread and wait for the creation // to finish. sync_thread.task_runner()->PostTask( - FROM_HERE, base::Bind(&HttpBridgeRunOnSyncThread, - base::Unretained(baseline_context_getter.get()), - &release_request_context_signal, &factory, &bridge, - &signal_when_created, &wait_for_shutdown)); + FROM_HERE, + base::BindOnce(&HttpBridgeRunOnSyncThread, + base::Unretained(baseline_context_getter.get()), + &release_request_context_signal, &factory, &bridge, + &signal_when_created, &wait_for_shutdown)); signal_when_created.Wait(); // Simulate sync shutdown by aborting bridge and shutting down factory on @@ -513,7 +514,8 @@ base::WaitableEvent::ResetPolicy::AUTOMATIC, base::WaitableEvent::InitialState::NOT_SIGNALED); io_thread()->task_runner()->PostTask( - FROM_HERE, base::Bind(&WaitOnIOThread, &signal_wait_start, &wait_done)); + FROM_HERE, + base::BindOnce(&WaitOnIOThread, &signal_wait_start, &wait_done)); signal_wait_start.Wait(); // |baseline_context_getter| should have only one reference from local // variable.
diff --git a/components/sync/engine/sequenced_model_worker_unittest.cc b/components/sync/engine/sequenced_model_worker_unittest.cc index 593ad745..e77dcd5e 100644 --- a/components/sync/engine/sequenced_model_worker_unittest.cc +++ b/components/sync/engine/sequenced_model_worker_unittest.cc
@@ -82,8 +82,8 @@ TEST_F(SequencedModelWorkerTest, DoesWorkOnDatabaseSequence) { base::SequencedTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&SequencedModelWorkerTest::ScheduleWork, - factory()->GetWeakPtr())); + FROM_HERE, base::BindOnce(&SequencedModelWorkerTest::ScheduleWork, + factory()->GetWeakPtr())); run_loop_.Run(); EXPECT_TRUE(did_do_work()); }
diff --git a/components/sync/engine/sync_backend_registrar_unittest.cc b/components/sync/engine/sync_backend_registrar_unittest.cc index b883921..0e0899e 100644 --- a/components/sync/engine/sync_backend_registrar_unittest.cc +++ b/components/sync/engine/sync_backend_registrar_unittest.cc
@@ -231,8 +231,9 @@ base::WaitableEvent::InitialState::NOT_SIGNALED); db_task_runner()->PostTask( FROM_HERE, - base::Bind(&SyncBackendRegistrarTest::TestNonUIDataTypeActivationAsync, - base::Unretained(this), &change_processor_mock, &done)); + base::BindOnce( + &SyncBackendRegistrarTest::TestNonUIDataTypeActivationAsync, + base::Unretained(this), &change_processor_mock, &done)); done.Wait(); registrar()->DeactivateDataType(AUTOFILL);
diff --git a/components/sync/engine/ui_model_worker_unittest.cc b/components/sync/engine/ui_model_worker_unittest.cc index 49f7a39..6fc7914d 100644 --- a/components/sync/engine/ui_model_worker_unittest.cc +++ b/components/sync/engine/ui_model_worker_unittest.cc
@@ -33,7 +33,7 @@ // Converts |work| to a WorkCallback that will verify that it's run on the // thread it was constructed on. WorkCallback ClosureToWorkCallback(base::Closure work) { - return base::Bind(&DoWork, base::ThreadTaskRunnerHandle::Get(), work); + return base::BindOnce(&DoWork, base::ThreadTaskRunnerHandle::Get(), work); } // Increments |counter|.
diff --git a/components/sync/engine_impl/directory_update_handler.cc b/components/sync/engine_impl/directory_update_handler.cc index 7983307..37d1817 100644 --- a/components/sync/engine_impl/directory_update_handler.cc +++ b/components/sync/engine_impl/directory_update_handler.cc
@@ -119,11 +119,11 @@ if (IsApplyUpdatesRequired()) { // This will invoke handlers that belong to the model and its thread, so we // switch to the appropriate thread before we start this work. - WorkCallback c = - base::Bind(&DirectoryUpdateHandler::ApplyUpdatesImpl, - // We wait until the callback is executed. We can safely use - // Unretained. - base::Unretained(this), base::Unretained(status)); + WorkCallback c = base::BindOnce( + &DirectoryUpdateHandler::ApplyUpdatesImpl, + // We wait until the callback is executed. We can safely use + // Unretained. + base::Unretained(this), base::Unretained(status)); worker_->DoWorkAndWaitUntilDone(std::move(c)); debug_info_emitter_->EmitUpdateCountersUpdate();
diff --git a/components/sync/engine_impl/model_type_connector_proxy.cc b/components/sync/engine_impl/model_type_connector_proxy.cc index 4998b53..1f7d730 100644 --- a/components/sync/engine_impl/model_type_connector_proxy.cc +++ b/components/sync/engine_impl/model_type_connector_proxy.cc
@@ -30,21 +30,21 @@ void ModelTypeConnectorProxy::DisconnectNonBlockingType(ModelType type) { task_runner_->PostTask( - FROM_HERE, base::Bind(&ModelTypeConnector::DisconnectNonBlockingType, - model_type_connector_, type)); + FROM_HERE, base::BindOnce(&ModelTypeConnector::DisconnectNonBlockingType, + model_type_connector_, type)); } void ModelTypeConnectorProxy::RegisterDirectoryType(ModelType type, ModelSafeGroup group) { - task_runner_->PostTask(FROM_HERE, - base::Bind(&ModelTypeConnector::RegisterDirectoryType, - model_type_connector_, type, group)); + task_runner_->PostTask( + FROM_HERE, base::BindOnce(&ModelTypeConnector::RegisterDirectoryType, + model_type_connector_, type, group)); } void ModelTypeConnectorProxy::UnregisterDirectoryType(ModelType type) { task_runner_->PostTask( - FROM_HERE, base::Bind(&ModelTypeConnector::UnregisterDirectoryType, - model_type_connector_, type)); + FROM_HERE, base::BindOnce(&ModelTypeConnector::UnregisterDirectoryType, + model_type_connector_, type)); } } // namespace syncer
diff --git a/components/sync/engine_impl/model_type_registry.cc b/components/sync/engine_impl/model_type_registry.cc index f577db2..e01ec62 100644 --- a/components/sync/engine_impl/model_type_registry.cc +++ b/components/sync/engine_impl/model_type_registry.cc
@@ -50,7 +50,7 @@ void CommitQueueProxy::NudgeForCommit() { sync_thread_->PostTask(FROM_HERE, - base::Bind(&CommitQueue::NudgeForCommit, worker_)); + base::BindOnce(&CommitQueue::NudgeForCommit, worker_)); } } // namespace
diff --git a/components/sync/engine_impl/model_type_worker.cc b/components/sync/engine_impl/model_type_worker.cc index 481b569..412aaed 100644 --- a/components/sync/engine_impl/model_type_worker.cc +++ b/components/sync/engine_impl/model_type_worker.cc
@@ -276,7 +276,8 @@ base::MakeRefCounted<GetLocalChangesRequest>(cancelation_signal_); // TODO(mamir): do we need to make this async? model_type_processor_->GetLocalChanges( - max_entries, base::Bind(&GetLocalChangesRequest::SetResponse, request)); + max_entries, + base::BindOnce(&GetLocalChangesRequest::SetResponse, request)); request->WaitForResponse(); CommitRequestDataList response; if (!request->WasCancelled())
diff --git a/components/sync/engine_impl/model_type_worker_unittest.cc b/components/sync/engine_impl/model_type_worker_unittest.cc index 7164b7ae..f6a7405 100644 --- a/components/sync/engine_impl/model_type_worker_unittest.cc +++ b/components/sync/engine_impl/model_type_worker_unittest.cc
@@ -1249,8 +1249,8 @@ scoped_refptr<GetLocalChangesRequest> request) { blocking_thread_.task_runner()->PostTask( FROM_HERE, - base::Bind(&GetLocalChangesRequestTest::BlockingWaitForResponse, - base::Unretained(this), request)); + base::BindOnce(&GetLocalChangesRequestTest::BlockingWaitForResponse, + base::Unretained(this), request)); } // Tests that request doesn't block when cancelation signal is already signaled.
diff --git a/components/sync/engine_impl/net/sync_server_connection_manager.cc b/components/sync/engine_impl/net/sync_server_connection_manager.cc index 550c1cf..2ba9ebbc 100644 --- a/components/sync/engine_impl/net/sync_server_connection_manager.cc +++ b/components/sync/engine_impl/net/sync_server_connection_manager.cc
@@ -62,7 +62,7 @@ response->server_status = HttpResponse::CONNECTION_UNAVAILABLE; return false; } - base::ScopedClosureRunner auto_unregister(base::Bind( + base::ScopedClosureRunner auto_unregister(base::BindOnce( &CancelationSignal::UnregisterHandler, base::Unretained(cancelation_signal_), base::Unretained(this)));
diff --git a/components/sync/engine_impl/net/sync_server_connection_manager_unittest.cc b/components/sync/engine_impl/net/sync_server_connection_manager_unittest.cc index da8febb..fd410e216 100644 --- a/components/sync/engine_impl/net/sync_server_connection_manager_unittest.cc +++ b/components/sync/engine_impl/net/sync_server_connection_manager_unittest.cc
@@ -111,7 +111,7 @@ ASSERT_TRUE(abort_thread.Start()); abort_thread.task_runner()->PostDelayedTask( FROM_HERE, - base::Bind(&CancelationSignal::Signal, base::Unretained(&signal)), + base::BindOnce(&CancelationSignal::Signal, base::Unretained(&signal)), TestTimeouts::tiny_timeout()); bool result = server.PostBufferToPath(¶ms, "/testpath", "testauth");
diff --git a/components/sync/engine_impl/sync_encryption_handler_impl.cc b/components/sync/engine_impl/sync_encryption_handler_impl.cc index 6650fea..df09440 100644 --- a/components/sync/engine_impl/sync_encryption_handler_impl.cc +++ b/components/sync/engine_impl/sync_encryption_handler_impl.cc
@@ -640,8 +640,8 @@ DCHECK(trans); if (!ApplyNigoriUpdateImpl(nigori, trans)) { base::SequencedTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&SyncEncryptionHandlerImpl::RewriteNigori, - weak_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&SyncEncryptionHandlerImpl::RewriteNigori, + weak_ptr_factory_.GetWeakPtr())); } for (auto& observer : observers_) { @@ -722,8 +722,8 @@ if (ShouldTriggerMigration(nigori, *cryptographer, GetPassphraseType(trans))) { base::SequencedTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&SyncEncryptionHandlerImpl::RewriteNigori, - weak_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&SyncEncryptionHandlerImpl::RewriteNigori, + weak_ptr_factory_.GetWeakPtr())); } return true;
diff --git a/components/sync/engine_impl/sync_scheduler_impl.cc b/components/sync/engine_impl/sync_scheduler_impl.cc index 65ff361c..062c919d 100644 --- a/components/sync/engine_impl/sync_scheduler_impl.cc +++ b/components/sync/engine_impl/sync_scheduler_impl.cc
@@ -440,8 +440,9 @@ SDVLOG_LOC(nudge_location, 2) << "Scheduling a nudge with " << delay.InMilliseconds() << " ms delay"; pending_wakeup_timer_.Start( - nudge_location, delay, base::Bind(&SyncSchedulerImpl::PerformDelayedNudge, - weak_ptr_factory_.GetWeakPtr())); + nudge_location, delay, + base::BindOnce(&SyncSchedulerImpl::PerformDelayedNudge, + weak_ptr_factory_.GetWeakPtr())); } const char* SyncSchedulerImpl::GetModeString(SyncScheduler::Mode mode) { @@ -652,14 +653,15 @@ SDVLOG(2) << "Starting WaitInterval timer of length " << wait_interval_->length.InMilliseconds() << "ms."; if (wait_interval_->mode == WaitInterval::THROTTLED) { - pending_wakeup_timer_.Start(FROM_HERE, wait_interval_->length, - base::Bind(&SyncSchedulerImpl::Unthrottle, - weak_ptr_factory_.GetWeakPtr())); + pending_wakeup_timer_.Start( + FROM_HERE, wait_interval_->length, + base::BindOnce(&SyncSchedulerImpl::Unthrottle, + weak_ptr_factory_.GetWeakPtr())); } else { pending_wakeup_timer_.Start( FROM_HERE, wait_interval_->length, - base::Bind(&SyncSchedulerImpl::ExponentialBackoffRetry, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&SyncSchedulerImpl::ExponentialBackoffRetry, + weak_ptr_factory_.GetWeakPtr())); } } else if (nudge_tracker_.IsAnyTypeBlocked()) { // Per-datatype throttled or backed off. @@ -669,9 +671,10 @@ return; } NotifyRetryTime(base::Time::Now() + time_until_next_unblock); - pending_wakeup_timer_.Start(FROM_HERE, time_until_next_unblock, - base::Bind(&SyncSchedulerImpl::OnTypesUnblocked, - weak_ptr_factory_.GetWeakPtr())); + pending_wakeup_timer_.Start( + FROM_HERE, time_until_next_unblock, + base::BindOnce(&SyncSchedulerImpl::OnTypesUnblocked, + weak_ptr_factory_.GetWeakPtr())); } else { NotifyRetryTime(base::Time()); } @@ -705,8 +708,8 @@ // Post call to TrySyncCycleJobImpl on current sequence. Later request for // access token will be here. base::SequencedTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&SyncSchedulerImpl::TrySyncCycleJobImpl, - weak_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&SyncSchedulerImpl::TrySyncCycleJobImpl, + weak_ptr_factory_.GetWeakPtr())); } void SyncSchedulerImpl::TrySyncCycleJobImpl() {
diff --git a/components/sync/engine_impl/sync_scheduler_impl_unittest.cc b/components/sync/engine_impl/sync_scheduler_impl_unittest.cc index 43e9892..77dd8b5 100644 --- a/components/sync/engine_impl/sync_scheduler_impl_unittest.cc +++ b/components/sync/engine_impl/sync_scheduler_impl_unittest.cc
@@ -89,7 +89,7 @@ void PumpLoopFor(TimeDelta time) { // Allow the loop to run for the specified amount of time. base::SequencedTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, base::Bind(&QuitLoopNow), time); + FROM_HERE, base::BindOnce(&QuitLoopNow), time); RunLoop(); } @@ -203,8 +203,8 @@ // This stops the scheduler synchronously. void StopSyncScheduler() { base::SequencedTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&SyncSchedulerImplTest::DoQuitLoopNow, - weak_ptr_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&SyncSchedulerImplTest::DoQuitLoopNow, + weak_ptr_factory_.GetWeakPtr())); RunLoop(); }
diff --git a/components/sync/model/data_type_error_handler_impl.cc b/components/sync/model/data_type_error_handler_impl.cc index ba1385f..25a0e0d 100644 --- a/components/sync/model/data_type_error_handler_impl.cc +++ b/components/sync/model/data_type_error_handler_impl.cc
@@ -26,7 +26,7 @@ UMA_HISTOGRAM_ENUMERATION("Sync.DataTypeRunFailures", ModelTypeToHistogramInt(error.model_type()), static_cast<int>(MODEL_TYPE_COUNT)); - ui_thread_->PostTask(error.location(), base::Bind(sync_callback_, error)); + ui_thread_->PostTask(error.location(), base::BindOnce(sync_callback_, error)); } SyncError DataTypeErrorHandlerImpl::CreateAndUploadError(
diff --git a/components/sync/model_impl/client_tag_based_model_type_processor_unittest.cc b/components/sync/model_impl/client_tag_based_model_type_processor_unittest.cc index 8e764ded..6c40bb7 100644 --- a/components/sync/model_impl/client_tag_based_model_type_processor_unittest.cc +++ b/components/sync/model_impl/client_tag_based_model_type_processor_unittest.cc
@@ -214,8 +214,8 @@ request.authenticated_account_id = "SomeAccountId"; type_processor()->OnSyncStarting( request, - base::Bind(&ClientTagBasedModelTypeProcessorTest::OnReadyToConnect, - base::Unretained(this))); + base::BindOnce(&ClientTagBasedModelTypeProcessorTest::OnReadyToConnect, + base::Unretained(this))); } void DisconnectSync() { @@ -1039,14 +1039,14 @@ // Entity is sent to server. Processor shouldn't include it in local changes. CommitRequestDataList commit_request; type_processor()->GetLocalChanges( - INT_MAX, base::Bind(&CaptureCommitRequest, &commit_request)); + INT_MAX, base::BindOnce(&CaptureCommitRequest, &commit_request)); EXPECT_TRUE(commit_request.empty()); // Fail commit from worker side indicating this entity was not committed. // Processor should include it in consecutive GetLocalChanges responses. worker()->FailOneCommit(); type_processor()->GetLocalChanges( - INT_MAX, base::Bind(&CaptureCommitRequest, &commit_request)); + INT_MAX, base::BindOnce(&CaptureCommitRequest, &commit_request)); EXPECT_EQ(1U, commit_request.size()); EXPECT_EQ(kHash1, commit_request[0].entity->client_tag_hash); } @@ -1060,7 +1060,7 @@ // Reqeust at most one intity per batch, ensure that only one was returned. CommitRequestDataList commit_request; type_processor()->GetLocalChanges( - 1, base::Bind(&CaptureCommitRequest, &commit_request)); + 1, base::BindOnce(&CaptureCommitRequest, &commit_request)); EXPECT_EQ(1U, commit_request.size()); }
diff --git a/components/sync/test/fake_server/fake_server_http_post_provider.cc b/components/sync/test/fake_server/fake_server_http_post_provider.cc index 0b3cd65..c023861 100644 --- a/components/sync/test/fake_server/fake_server_http_post_provider.cc +++ b/components/sync/test/fake_server/fake_server_http_post_provider.cc
@@ -6,7 +6,9 @@ #include "base/bind.h" #include "base/location.h" +#include "base/time/time.h" #include "components/sync/test/fake_server/fake_server.h" +#include "net/base/net_errors.h" using syncer::HttpPostProviderInterface; @@ -76,15 +78,25 @@ base::Unretained(&post_complete)); bool result = fake_server_task_runner_->PostTask( - FROM_HERE, base::Bind(&FakeServer::HandleCommand, fake_server_, - base::ConstRef(request_content_), - base::ConstRef(signal_closure), &post_error_code, - &post_response_code, &post_response)); + FROM_HERE, + base::BindOnce(&FakeServer::HandleCommand, fake_server_, + base::ConstRef(request_content_), + base::ConstRef(signal_closure), &post_error_code, + &post_response_code, &post_response)); if (!result) return false; - post_complete.Wait(); + // Note: This is a potential deadlock. Here we're on the sync thread, and + // we're waiting for something to happen on the UI thread (where the + // FakeServer lives). If at the same time, ProfileSyncService is trying to + // Stop() the sync thread, we're deadlocked. For a lack of better ideas, let's + // just give up after a few seconds. + // TODO(crbug.com/869404): Maybe the FakeServer should live on its own thread. + if (!post_complete.TimedWait(base::TimeDelta::FromSeconds(5))) { + *error_code = net::ERR_TIMED_OUT; + return false; + } post_error_code_ = post_error_code; post_response_code_ = post_response_code; response_ = post_response;
diff --git a/components/sync/user_events/user_event_sync_bridge.cc b/components/sync/user_events/user_event_sync_bridge.cc index 846356c..01dd46e 100644 --- a/components/sync/user_events/user_event_sync_bridge.cc +++ b/components/sync/user_events/user_event_sync_bridge.cc
@@ -118,8 +118,8 @@ batch->TakeMetadataChangesFrom(std::move(metadata_change_list)); store_->CommitWriteBatch(std::move(batch), - base::Bind(&UserEventSyncBridge::OnCommit, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&UserEventSyncBridge::OnCommit, + weak_ptr_factory_.GetWeakPtr())); return {}; } @@ -283,8 +283,8 @@ change_processor()->Put(storage_key, MoveToEntityData(std::move(specifics)), batch->GetMetadataChangeList()); store_->CommitWriteBatch(std::move(batch), - base::Bind(&UserEventSyncBridge::OnCommit, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&UserEventSyncBridge::OnCommit, + weak_ptr_factory_.GetWeakPtr())); } void UserEventSyncBridge::ProcessQueuedEvents() {
diff --git a/components/sync_bookmarks/bookmark_model_associator.cc b/components/sync_bookmarks/bookmark_model_associator.cc index 2281404..53adf4d 100644 --- a/components/sync_bookmarks/bookmark_model_associator.cc +++ b/components/sync_bookmarks/bookmark_model_associator.cc
@@ -888,8 +888,8 @@ if (weak_factory_.HasWeakPtrs()) return; base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&BookmarkModelAssociator::PersistAssociations, - weak_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&BookmarkModelAssociator::PersistAssociations, + weak_factory_.GetWeakPtr())); } void BookmarkModelAssociator::PersistAssociations() {
diff --git a/components/test/components_test_suite.cc b/components/test/components_test_suite.cc index f21e491b..678bc35 100644 --- a/components/test/components_test_suite.cc +++ b/components/test/components_test_suite.cc
@@ -146,7 +146,8 @@ listeners.Append(new ComponentsUnitTestEventListener()); #if !defined(OS_IOS) - return base::Bind(&content::UnitTestTestSuite::Run, std::move(test_suite)); + return base::BindOnce(&content::UnitTestTestSuite::Run, + std::move(test_suite)); #else return base::Bind(&base::TestSuite::Run, std::move(test_suite)); #endif
diff --git a/components/tracing/child/child_trace_message_filter.cc b/components/tracing/child/child_trace_message_filter.cc index ab61795..4e45bee1 100644 --- a/components/tracing/child/child_trace_message_filter.cc +++ b/components/tracing/child/child_trace_message_filter.cc
@@ -71,7 +71,7 @@ if (!repeat) { ipc_task_runner_->PostTask( FROM_HERE, - base::Bind( + base::BindOnce( &ChildTraceMessageFilter::SendAbortBackgroundTracingMessage, this)); } @@ -79,8 +79,8 @@ } ipc_task_runner_->PostTask( - FROM_HERE, base::Bind(&ChildTraceMessageFilter::SendTriggerMessage, this, - histogram_name)); + FROM_HERE, base::BindOnce(&ChildTraceMessageFilter::SendTriggerMessage, + this, histogram_name)); } void ChildTraceMessageFilter::SendTriggerMessage( @@ -137,13 +137,14 @@ if (min >= histogram_lower_value && max <= histogram_upper_value) { ipc_task_runner_->PostTask( - FROM_HERE, base::Bind(&ChildTraceMessageFilter::SendTriggerMessage, - this, histogram_name)); + FROM_HERE, + base::BindOnce(&ChildTraceMessageFilter::SendTriggerMessage, this, + histogram_name)); break; } else if (!repeat) { ipc_task_runner_->PostTask( FROM_HERE, - base::Bind( + base::BindOnce( &ChildTraceMessageFilter::SendAbortBackgroundTracingMessage, this)); break;
diff --git a/components/tracing/test/trace_event_perftest.cc b/components/tracing/test/trace_event_perftest.cc index 97cb099..9090b63 100644 --- a/components/tracing/test/trace_event_perftest.cc +++ b/components/tracing/test/trace_event_perftest.cc
@@ -19,16 +19,16 @@ namespace tracing { namespace { -using base::Bind; +using base::BindOnce; using base::Closure; using base::RunLoop; using base::Thread; using base::Unretained; using base::WaitableEvent; using base::trace_event::TraceConfig; +using base::trace_event::TracedValue; using base::trace_event::TraceLog; using base::trace_event::TraceRecordMode; -using base::trace_event::TracedValue; const int kNumRuns = 10; @@ -159,8 +159,8 @@ ScopedStopwatch stopwatch("events_over_multiple_threads"); for (int i = 0; i < kNumThreads; i++) { threads[i]->task_runner()->PostTask( - FROM_HERE, - base::Bind(&SubmitTraceEventsAndSignal, complete_events[i].get())); + FROM_HERE, base::BindOnce(&SubmitTraceEventsAndSignal, + complete_events[i].get())); } for (int i = 0; i < kNumThreads; i++) { complete_events[i]->Wait(); @@ -177,7 +177,8 @@ BeginTrace(); IterableStopwatch task_sw("events_in_task"); for (int i = 0; i < 100; i++) { - base::PendingTask pending_task(FROM_HERE, Bind(&SubmitTraceEvents, 10000)); + base::PendingTask pending_task(FROM_HERE, + BindOnce(&SubmitTraceEvents, 10000)); TRACE_TASK_EXECUTION("TraceEventPerfTest::PendingTask", pending_task); std::move(pending_task.task).Run(); task_sw.NextLap();
diff --git a/components/translate/content/browser/content_translate_driver.cc b/components/translate/content/browser/content_translate_driver.cc index cbf7f84..cec9442 100644 --- a/components/translate/content/browser/content_translate_driver.cc +++ b/components/translate/content/browser/content_translate_driver.cc
@@ -67,8 +67,9 @@ int backoff = attempt * kMaxTranslateLoadCheckAttempts; base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, - base::Bind(&ContentTranslateDriver::InitiateTranslation, - weak_pointer_factory_.GetWeakPtr(), page_lang, attempt + 1), + base::BindOnce(&ContentTranslateDriver::InitiateTranslation, + weak_pointer_factory_.GetWeakPtr(), page_lang, + attempt + 1), base::TimeDelta::FromMilliseconds(backoff)); return; } @@ -108,9 +109,10 @@ if (it == pages_.end()) return; // This page has navigated away. - it->second->Translate(translate_script, source_lang, target_lang, - base::Bind(&ContentTranslateDriver::OnPageTranslated, - base::Unretained(this))); + it->second->Translate( + translate_script, source_lang, target_lang, + base::BindOnce(&ContentTranslateDriver::OnPageTranslated, + base::Unretained(this))); } void ContentTranslateDriver::RevertTranslation(int page_seq_no) { @@ -201,10 +203,10 @@ // an infobar, it must be done after that. base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(&ContentTranslateDriver::InitiateTranslation, - weak_pointer_factory_.GetWeakPtr(), - translate_manager_->GetLanguageState().original_language(), - 0)); + base::BindOnce(&ContentTranslateDriver::InitiateTranslation, + weak_pointer_factory_.GetWeakPtr(), + translate_manager_->GetLanguageState().original_language(), + 0)); } void ContentTranslateDriver::DidFinishNavigation( @@ -231,8 +233,8 @@ bool page_needs_translation) { pages_[++next_page_seq_no_] = std::move(page); pages_[next_page_seq_no_].set_connection_error_handler( - base::Bind(&ContentTranslateDriver::OnPageAway, base::Unretained(this), - next_page_seq_no_)); + base::BindOnce(&ContentTranslateDriver::OnPageAway, + base::Unretained(this), next_page_seq_no_)); translate_manager_->set_current_seq_no(next_page_seq_no_); translate_manager_->GetLanguageState().LanguageDetermined(
diff --git a/components/translate/content/renderer/translate_helper.cc b/components/translate/content/renderer/translate_helper.cc index a36cfabf..c2e18c8 100644 --- a/components/translate/content/renderer/translate_helper.cc +++ b/components/translate/content/renderer/translate_helper.cc
@@ -387,8 +387,9 @@ // The translation is still pending, check again later. base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, base::Bind(&TranslateHelper::CheckTranslateStatus, - weak_method_factory_.GetWeakPtr()), + FROM_HERE, + base::BindOnce(&TranslateHelper::CheckTranslateStatus, + weak_method_factory_.GetWeakPtr()), AdjustDelay(kTranslateStatusCheckDelayMs)); } @@ -410,8 +411,9 @@ return; } base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, base::Bind(&TranslateHelper::TranslatePageImpl, - weak_method_factory_.GetWeakPtr(), count), + FROM_HERE, + base::BindOnce(&TranslateHelper::TranslatePageImpl, + weak_method_factory_.GetWeakPtr(), count), AdjustDelay(count * kTranslateInitCheckDelayMs)); return; } @@ -429,8 +431,9 @@ } // Check the status of the translation. base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, base::Bind(&TranslateHelper::CheckTranslateStatus, - weak_method_factory_.GetWeakPtr()), + FROM_HERE, + base::BindOnce(&TranslateHelper::CheckTranslateStatus, + weak_method_factory_.GetWeakPtr()), AdjustDelay(kTranslateStatusCheckDelayMs)); }
diff --git a/components/translate/core/browser/translate_language_list.cc b/components/translate/core/browser/translate_language_list.cc index e879969..69618a4 100644 --- a/components/translate/core/browser/translate_language_list.cc +++ b/components/translate/core/browser/translate_language_list.cc
@@ -227,9 +227,8 @@ NotifyEvent(__LINE__, message); bool result = language_list_fetcher_->Request( - url, - base::Bind(&TranslateLanguageList::OnLanguageListFetchComplete, - base::Unretained(this))); + url, base::BindOnce(&TranslateLanguageList::OnLanguageListFetchComplete, + base::Unretained(this))); if (!result) NotifyEvent(__LINE__, "Request is omitted due to retry limit"); }
diff --git a/components/upload_list/upload_list.cc b/components/upload_list/upload_list.cc index 3c8d947..7d814cf 100644 --- a/components/upload_list/upload_list.cc +++ b/components/upload_list/upload_list.cc
@@ -66,7 +66,7 @@ DCHECK(sequence_checker_.CalledOnValidSequence()); base::PostTaskWithTraits( FROM_HERE, LoadingTaskTraits(), - base::Bind(&UploadList::RequestSingleUpload, this, local_id)); + base::BindOnce(&UploadList::RequestSingleUpload, this, local_id)); } void UploadList::GetUploads(size_t max_count,
diff --git a/components/vector_icons/location_on.icon b/components/vector_icons/location_on.icon index 5e1228d..32880a9d 100644 --- a/components/vector_icons/location_on.icon +++ b/components/vector_icons/location_on.icon
@@ -9,3 +9,17 @@ R_CUBIC_TO, 0, -7.73f, -6.27f, -14, -14, -14, CLOSE, CIRCLE, 24, 18, 5 + +CANVAS_DIMENSIONS, 16, +MOVE_TO, 8, 1, +CUBIC_TO, 5.24f, 1, 3, 3.19f, 3, 5.9f, +CUBIC_TO, 3, 9.57f, 8, 15, 8, 15, +CUBIC_TO, 8, 15, 13, 9.57f, 13, 5.9f, +CUBIC_TO, 13, 3.19f, 10.76f, 1, 8, 1, +CLOSE, +MOVE_TO, 8, 8, +CUBIC_TO, 6.9f, 8, 6, 7.1f, 6, 6, +CUBIC_TO, 6, 4.9f, 6.9f, 4, 8, 4, +CUBIC_TO, 9.1f, 4, 10, 4.9f, 10, 6, +CUBIC_TO, 10, 7.1f, 9.1f, 8, 8, 8, +CLOSE
diff --git a/components/visitedlink/browser/visitedlink_event_listener.cc b/components/visitedlink/browser/visitedlink_event_listener.cc index 8fb86c8..75621da 100644 --- a/components/visitedlink/browser/visitedlink_event_listener.cc +++ b/components/visitedlink/browser/visitedlink_event_listener.cc
@@ -158,8 +158,8 @@ if (!coalesce_timer_->IsRunning()) { coalesce_timer_->Start( FROM_HERE, TimeDelta::FromMilliseconds(kCommitIntervalMs), - base::Bind(&VisitedLinkEventListener::CommitVisitedLinks, - base::Unretained(this))); + base::BindOnce(&VisitedLinkEventListener::CommitVisitedLinks, + base::Unretained(this))); } }
diff --git a/components/visitedlink/browser/visitedlink_master.cc b/components/visitedlink/browser/visitedlink_master.cc index 56149328..2f34399a 100644 --- a/components/visitedlink/browser/visitedlink_master.cc +++ b/components/visitedlink/browser/visitedlink_master.cc
@@ -620,8 +620,9 @@ scoped_refptr<LoadFromFileResult> load_from_file_result; bool success = LoadApartFromFile(filename, &load_from_file_result); - BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, - base::Bind(callback, success, load_from_file_result)); + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, + base::BindOnce(callback, success, load_from_file_result)); } // static @@ -1145,7 +1146,7 @@ // rebuild is complete. BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - base::Bind(&TableBuilder::OnCompleteMainThread, this)); + base::BindOnce(&TableBuilder::OnCompleteMainThread, this)); } void VisitedLinkMaster::TableBuilder::OnCompleteMainThread() {
diff --git a/components/viz/common/gl_helper.cc b/components/viz/common/gl_helper.cc index d8f2952..34ea8dd 100644 --- a/components/viz/common/gl_helper.cc +++ b/components/viz/common/gl_helper.cc
@@ -487,8 +487,8 @@ gl_->EndQueryEXT(GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM); gl_->BindBuffer(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, 0); context_support_->SignalQuery( - request->query, base::Bind(&CopyTextureToImpl::ReadbackDone, AsWeakPtr(), - request, bytes_per_pixel)); + request->query, base::BindOnce(&CopyTextureToImpl::ReadbackDone, + AsWeakPtr(), request, bytes_per_pixel)); } void GLHelper::CopyTextureToImpl::CropScaleReadbackAndCleanTexture(
diff --git a/components/viz/service/display/gl_renderer.cc b/components/viz/service/display/gl_renderer.cc index 043b723..a9ba5ca 100644 --- a/components/viz/service/display/gl_renderer.cc +++ b/components/viz/service/display/gl_renderer.cc
@@ -3574,7 +3574,7 @@ gl_->EndQueryEXT(GL_SAMPLES_PASSED_ARB); context_support_->SignalQuery( query, - base::Bind(overdraw_feedback_callback, query, test.multiplier)); + base::BindOnce(overdraw_feedback_callback, query, test.multiplier)); } } }
diff --git a/components/viz/service/display/gl_renderer_copier.cc b/components/viz/service/display/gl_renderer_copier.cc index ec6e7575..fb9d3b6b 100644 --- a/components/viz/service/display/gl_renderer_copier.cc +++ b/components/viz/service/display/gl_renderer_copier.cc
@@ -633,7 +633,7 @@ gl->EndQueryEXT(GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM); context_provider_->ContextSupport()->SignalQuery( queries_[plane], - base::Bind(&ReadI420PlanesWorkflow::OnFinishedPlane, this, plane)); + base::BindOnce(&ReadI420PlanesWorkflow::OnFinishedPlane, this, plane)); } void UnbindTransferBuffer() {
diff --git a/components/viz/service/display/gl_renderer_unittest.cc b/components/viz/service/display/gl_renderer_unittest.cc index 448dbfe..82dc33d 100644 --- a/components/viz/service/display/gl_renderer_unittest.cc +++ b/components/viz/service/display/gl_renderer_unittest.cc
@@ -2223,7 +2223,7 @@ gpu::Mailbox::Generate(), GL_LINEAR, GL_TEXTURE_2D, gpu::SyncToken(), gfx::Size(256, 256), true); auto release_callback = - SingleReleaseCallback::Create(base::Bind(&MailboxReleased)); + SingleReleaseCallback::Create(base::BindOnce(&MailboxReleased)); ResourceId resource_id = child_resource_provider->ImportResource( transfer_resource, std::move(release_callback)); @@ -2432,7 +2432,7 @@ gpu::Mailbox::Generate(), GL_LINEAR, GL_TEXTURE_2D, sync_token, gfx::Size(256, 256), true); auto release_callback = - SingleReleaseCallback::Create(base::Bind(&MailboxReleased)); + SingleReleaseCallback::Create(base::BindOnce(&MailboxReleased)); ResourceId resource_id = child_resource_provider->ImportResource( transfer_resource, std::move(release_callback)); @@ -2817,7 +2817,7 @@ gpu::Mailbox::Generate(), GL_LINEAR, GL_TEXTURE_2D, gpu::SyncToken(), gfx::Size(256, 256), true); auto release_callback = - SingleReleaseCallback::Create(base::Bind(&MailboxReleased)); + SingleReleaseCallback::Create(base::BindOnce(&MailboxReleased)); ResourceId resource_id = child_resource_provider->ImportResource( transfer_resource, std::move(release_callback));
diff --git a/components/viz/service/display/surface_aggregator.cc b/components/viz/service/display/surface_aggregator.cc index ee77a50..da35a4e 100644 --- a/components/viz/service/display/surface_aggregator.cc +++ b/components/viz/service/display/surface_aggregator.cc
@@ -211,8 +211,8 @@ Surface* latest_surface = nullptr; if (surface_quad->surface_range.start()) { - latest_surface = manager_->GetLatestInFlightSurface( - primary_surface_id, *surface_quad->surface_range.start()); + latest_surface = + manager_->GetLatestInFlightSurface(surface_quad->surface_range); } // If there's no fallback surface ID available, then simply emit a @@ -1006,9 +1006,8 @@ if (surface_info.surface_range.start()) { // TODO(fsamuel): Consider caching this value somewhere so that // HandleSurfaceQuad doesn't need to call it again. - Surface* fallback_surface = manager_->GetLatestInFlightSurface( - surface_info.surface_range.end(), - *surface_info.surface_range.start()); + Surface* fallback_surface = + manager_->GetLatestInFlightSurface(surface_info.surface_range); if (fallback_surface && fallback_surface->HasActiveFrame()) child_surface = fallback_surface; }
diff --git a/components/viz/service/display/texture_deleter.cc b/components/viz/service/display/texture_deleter.cc index 32416c4..714441f 100644 --- a/components/viz/service/display/texture_deleter.cc +++ b/components/viz/service/display/texture_deleter.cc
@@ -57,7 +57,7 @@ // thread. Upon destruction of this class, the callback must immediately be // destroyed. std::unique_ptr<SingleReleaseCallback> impl_callback = - SingleReleaseCallback::Create(base::Bind( + SingleReleaseCallback::Create(base::BindOnce( &DeleteTextureOnImplThread, std::move(context_provider), texture_id)); impl_callbacks_.push_back(std::move(impl_callback));
diff --git a/components/viz/service/display_embedder/viz_process_context_provider.cc b/components/viz/service/display_embedder/viz_process_context_provider.cc index 7ad0bae..6360100 100644 --- a/components/viz/service/display_embedder/viz_process_context_provider.cc +++ b/components/viz/service/display_embedder/viz_process_context_provider.cc
@@ -43,11 +43,21 @@ gpu::ContextCreationAttribs attributes; attributes.alpha_size = -1; attributes.depth_size = 0; +#if defined(OS_CHROMEOS) + // Chrome OS uses surfaceless when running on a real device and stencil + // buffers can then be added dynamically so supporting them does not have an + // impact on normal usage. If we are not running on a real Chrome OS device + // but instead on a workstation for development, then stencil support is + // useful as it allows the overdraw feedback debugging feature to be used. attributes.stencil_size = 8; +#else + attributes.stencil_size = 0; +#endif attributes.samples = 0; attributes.sample_buffers = 0; - attributes.fail_if_major_perf_caveat = false; attributes.bind_generates_resource = false; + attributes.fail_if_major_perf_caveat = false; + attributes.lose_context_when_out_of_memory = true; return attributes; }
diff --git a/components/viz/service/frame_sinks/compositor_frame_sink_impl.cc b/components/viz/service/frame_sinks/compositor_frame_sink_impl.cc index b55a624..67f27f4 100644 --- a/components/viz/service/frame_sinks/compositor_frame_sink_impl.cc +++ b/components/viz/service/frame_sinks/compositor_frame_sink_impl.cc
@@ -24,8 +24,8 @@ false /* is_root */, true /* needs_sync_points */)) { compositor_frame_sink_binding_.set_connection_error_handler( - base::Bind(&CompositorFrameSinkImpl::OnClientConnectionLost, - base::Unretained(this))); + base::BindOnce(&CompositorFrameSinkImpl::OnClientConnectionLost, + base::Unretained(this))); } CompositorFrameSinkImpl::~CompositorFrameSinkImpl() = default;
diff --git a/components/viz/service/frame_sinks/surface_synchronization_unittest.cc b/components/viz/service/frame_sinks/surface_synchronization_unittest.cc index 81218655..7da14049 100644 --- a/components/viz/service/frame_sinks/surface_synchronization_unittest.cc +++ b/components/viz/service/frame_sinks/surface_synchronization_unittest.cc
@@ -156,7 +156,7 @@ Surface* GetLatestInFlightSurface(const SurfaceId& primary_surface_id, const SurfaceId& fallback_surface_id) { return frame_sink_manager().surface_manager()->GetLatestInFlightSurface( - primary_surface_id, fallback_surface_id); + SurfaceRange(fallback_surface_id, primary_surface_id)); } FakeExternalBeginFrameSource* begin_frame_source() { @@ -2192,6 +2192,88 @@ EXPECT_EQ(nullptr, GetLatestInFlightSurface(child_id1, bogus_child_id)); } +// This test verifies that GetLatestInFlightSurface will not return null if the +// fallback is garbage collected, but instead returns the latest surface older +// than primary if that exists. +TEST_F(SurfaceSynchronizationTest, LatestInFlightSurfaceWithGarbageFallback) { + SetFrameSinkHierarchy(kParentFrameSink, kChildFrameSink1); + + const SurfaceId parent_id = MakeSurfaceId(kParentFrameSink, 1); + const SurfaceId child_id1 = MakeSurfaceId(kChildFrameSink1, 1); + const SurfaceId child_id2 = MakeSurfaceId(kChildFrameSink1, 2); + const SurfaceId child_id3 = MakeSurfaceId(kChildFrameSink1, 3); + const SurfaceId child_id4 = MakeSurfaceId(kChildFrameSink1, 4); + + // Activate |child_id1|. + child_support1().SubmitCompositorFrame(child_id1.local_surface_id(), + MakeDefaultCompositorFrame()); + + // Verify that |child_id1| CompositorFrames is active. + EXPECT_TRUE(child_surface1()->HasActiveFrame()); + EXPECT_FALSE(child_surface1()->HasPendingFrame()); + EXPECT_THAT(child_surface1()->activation_dependencies(), IsEmpty()); + EXPECT_TRUE(HasTemporaryReference(child_id1)); + + parent_support().SubmitCompositorFrame( + parent_id.local_surface_id(), + MakeCompositorFrame(empty_surface_ids(), {SurfaceRange(child_id1)}, + std::vector<TransferableResource>())); + + // Verify that parent is referencing |child_id1|. + EXPECT_TRUE(parent_surface()->HasActiveFrame()); + EXPECT_FALSE(parent_surface()->HasPendingFrame()); + EXPECT_THAT(parent_surface()->activation_dependencies(), IsEmpty()); + EXPECT_THAT(parent_surface()->active_referenced_surfaces(), + UnorderedElementsAre(child_id1)); + EXPECT_FALSE(HasTemporaryReference(child_id1)); + + // Activate |child_id2|. + child_support1().SubmitCompositorFrame(child_id2.local_surface_id(), + MakeDefaultCompositorFrame()); + + // Verify that |child_id2| CompositorFrames is active and it has a temporary + // reference. + EXPECT_TRUE(child_surface1()->HasActiveFrame()); + EXPECT_FALSE(child_surface1()->HasPendingFrame()); + EXPECT_THAT(child_surface1()->activation_dependencies(), IsEmpty()); + EXPECT_TRUE(HasTemporaryReference(child_id2)); + + // Activate |child_id3|. + child_support1().SubmitCompositorFrame(child_id3.local_surface_id(), + MakeDefaultCompositorFrame()); + + // Verify that |child_id3| CompositorFrames is active. + EXPECT_TRUE(child_surface1()->HasActiveFrame()); + EXPECT_FALSE(child_surface1()->HasPendingFrame()); + EXPECT_THAT(child_surface1()->activation_dependencies(), IsEmpty()); + EXPECT_TRUE(HasTemporaryReference(child_id3)); + + parent_support().SubmitCompositorFrame( + parent_id.local_surface_id(), + MakeCompositorFrame(empty_surface_ids(), {SurfaceRange(child_id2)}, + std::vector<TransferableResource>())); + + // Verify that parent is referencing |child_id2| which lost its temporary + // reference, but |child_id3| still has a temporary reference. + EXPECT_TRUE(parent_surface()->HasActiveFrame()); + EXPECT_FALSE(parent_surface()->HasPendingFrame()); + EXPECT_THAT(parent_surface()->activation_dependencies(), IsEmpty()); + EXPECT_THAT(parent_surface()->active_referenced_surfaces(), + UnorderedElementsAre(child_id2)); + EXPECT_FALSE(HasTemporaryReference(child_id2)); + EXPECT_TRUE(HasTemporaryReference(child_id3)); + + // Garbage collect |child_id1|. + frame_sink_manager().surface_manager()->GarbageCollectSurfaces(); + + // Make sure |child_id1| is garbage collected. + EXPECT_EQ(frame_sink_manager().surface_manager()->GetSurfaceForId(child_id1), + nullptr); + + EXPECT_EQ(GetSurfaceForId(child_id3), + GetLatestInFlightSurface(child_id4, child_id1)); +} + // This test verifies that GetLatestInFlightSurface will return the fallback // surface if the primary and fallback SurfaceIds have different FrameSinkIds. // This is important to preserve the property that that latest in-flight surface
diff --git a/components/viz/service/gl/gpu_service_impl.cc b/components/viz/service/gl/gpu_service_impl.cc index 25816b7..9a63b8d 100644 --- a/components/viz/service/gl/gpu_service_impl.cc +++ b/components/viz/service/gl/gpu_service_impl.cc
@@ -182,7 +182,7 @@ base::Callback<void(int, size_t, const std::string&)>(); base::WaitableEvent wait; if (io_runner_->PostTask( - FROM_HERE, base::Bind(&DestroyBinding, bindings_.get(), &wait))) { + FROM_HERE, base::BindOnce(&DestroyBinding, bindings_.get(), &wait))) { wait.Wait(); } @@ -495,9 +495,9 @@ int client_id, const gpu::SyncToken& sync_token) { if (io_runner_->BelongsToCurrentThread()) { - main_runner_->PostTask(FROM_HERE, - base::Bind(&GpuServiceImpl::DestroyGpuMemoryBuffer, - weak_ptr_, id, client_id, sync_token)); + main_runner_->PostTask( + FROM_HERE, base::BindOnce(&GpuServiceImpl::DestroyGpuMemoryBuffer, + weak_ptr_, id, client_id, sync_token)); return; } gpu_channel_manager_->DestroyGpuMemoryBuffer(id, client_id, sync_token); @@ -744,8 +744,9 @@ void GpuServiceImpl::CloseChannel(int32_t client_id) { if (io_runner_->BelongsToCurrentThread()) { - main_runner_->PostTask(FROM_HERE, base::Bind(&GpuServiceImpl::CloseChannel, - weak_ptr_, client_id)); + main_runner_->PostTask( + FROM_HERE, + base::BindOnce(&GpuServiceImpl::CloseChannel, weak_ptr_, client_id)); return; } gpu_channel_manager_->RemoveChannel(client_id); @@ -755,9 +756,9 @@ const std::string& key, const std::string& data) { if (io_runner_->BelongsToCurrentThread()) { - main_runner_->PostTask(FROM_HERE, - base::Bind(&GpuServiceImpl::LoadedShader, weak_ptr_, - client_id, key, data)); + main_runner_->PostTask( + FROM_HERE, base::BindOnce(&GpuServiceImpl::LoadedShader, weak_ptr_, + client_id, key, data)); return; } gpu_channel_manager_->PopulateShaderCache(client_id, key, data); @@ -765,8 +766,8 @@ void GpuServiceImpl::WakeUpGpu() { if (io_runner_->BelongsToCurrentThread()) { - main_runner_->PostTask(FROM_HERE, - base::Bind(&GpuServiceImpl::WakeUpGpu, weak_ptr_)); + main_runner_->PostTask( + FROM_HERE, base::BindOnce(&GpuServiceImpl::WakeUpGpu, weak_ptr_)); return; } #if defined(OS_ANDROID) @@ -785,7 +786,8 @@ void GpuServiceImpl::DestroyAllChannels() { if (io_runner_->BelongsToCurrentThread()) { main_runner_->PostTask( - FROM_HERE, base::Bind(&GpuServiceImpl::DestroyAllChannels, weak_ptr_)); + FROM_HERE, + base::BindOnce(&GpuServiceImpl::DestroyAllChannels, weak_ptr_)); return; } DVLOG(1) << "GPU: Removing all contexts"; @@ -850,7 +852,7 @@ void GpuServiceImpl::Hang() { DCHECK(io_runner_->BelongsToCurrentThread()); - main_runner_->PostTask(FROM_HERE, base::Bind([] { + main_runner_->PostTask(FROM_HERE, base::BindOnce([] { DVLOG(1) << "GPU: Simulating GPU hang"; for (;;) { // Do not sleep here. The GPU watchdog timer tracks
diff --git a/components/viz/service/gl/gpu_service_impl_unittest.cc b/components/viz/service/gl/gpu_service_impl_unittest.cc index e988567..ac88289 100644 --- a/components/viz/service/gl/gpu_service_impl_unittest.cc +++ b/components/viz/service/gl/gpu_service_impl_unittest.cc
@@ -33,8 +33,8 @@ void BlockIOThread() { wait_.Reset(); - io_runner()->PostTask(FROM_HERE, base::Bind(&base::WaitableEvent::Wait, - base::Unretained(&wait_))); + io_runner()->PostTask(FROM_HERE, base::BindOnce(&base::WaitableEvent::Wait, + base::Unretained(&wait_))); } void UnblockIOThread() { @@ -90,8 +90,8 @@ gpu_service()->Bind(mojo::MakeRequest(&ptr)); base::WaitableEvent wait(base::WaitableEvent::ResetPolicy::MANUAL, base::WaitableEvent::InitialState::NOT_SIGNALED); - io_runner()->PostTask(FROM_HERE, base::Bind(&base::WaitableEvent::Signal, - base::Unretained(&wait))); + io_runner()->PostTask(FROM_HERE, base::BindOnce(&base::WaitableEvent::Signal, + base::Unretained(&wait))); wait.Wait(); DestroyService(); }
diff --git a/components/viz/service/surfaces/surface.cc b/components/viz/service/surfaces/surface.cc index 813bd4a8..1ecfad1 100644 --- a/components/viz/service/surfaces/surface.cc +++ b/components/viz/service/surfaces/surface.cc
@@ -133,8 +133,8 @@ surface_range.end().frame_sink_id()) { continue; } - Surface* fallback_surface = surface_manager_->GetLatestInFlightSurface( - surface_range.end(), *surface_range.start()); + Surface* fallback_surface = + surface_manager_->GetLatestInFlightSurface(surface_range); // A misbehaving client may report a non-existent surface ID as a // |referenced_surface|. In that case, |surface| would be nullptr, and
diff --git a/components/viz/service/surfaces/surface_manager.cc b/components/viz/service/surfaces/surface_manager.cc index a5e2ba4..11af09c 100644 --- a/components/viz/service/surfaces/surface_manager.cc +++ b/components/viz/service/surfaces/surface_manager.cc
@@ -442,23 +442,19 @@ } Surface* SurfaceManager::GetLatestInFlightSurface( - const SurfaceId& primary_surface_id, - const SurfaceId& fallback_surface_id) { - // The fallback surface must exist before we begin looking for more recent - // surfaces. This guarantees that the |parent| is allowed to embed the - // |fallback_surface_id| and is not guessing surface IDs. - Surface* fallback_surface = GetSurfaceForId(fallback_surface_id); - if (!fallback_surface || !fallback_surface->HasActiveFrame()) + const SurfaceRange& surface_range) { + const SurfaceId& primary_surface_id = surface_range.end(); + const base::Optional<SurfaceId>& fallback_surface_id = surface_range.start(); + + if (!fallback_surface_id) return nullptr; - // If the FrameSinkId of the primary and the fallback surface IDs do not - // match then we should avoid presenting a fallback newer than intended by - // |parent|. - if (primary_surface_id.frame_sink_id() != fallback_surface_id.frame_sink_id()) - return fallback_surface; + DCHECK(fallback_surface_id->is_valid()); + + Surface* fallback_surface = GetSurfaceForId(*fallback_surface_id); auto it = - temporary_reference_ranges_.find(fallback_surface_id.frame_sink_id()); + temporary_reference_ranges_.find(fallback_surface_id->frame_sink_id()); if (it == temporary_reference_ranges_.end()) return fallback_surface; @@ -476,13 +472,14 @@ // If the embed_token doesn't match the primary or fallback's then the // parent does not have permission to embed this surface. if (local_surface_id.embed_token() != - fallback_surface_id.local_surface_id().embed_token() && + fallback_surface_id->local_surface_id().embed_token() && local_surface_id.embed_token() != primary_surface_id.local_surface_id().embed_token()) { continue; } - SurfaceId surface_id(fallback_surface_id.frame_sink_id(), local_surface_id); + SurfaceId surface_id(fallback_surface_id->frame_sink_id(), + local_surface_id); Surface* surface = GetSurfaceForId(surface_id); if (surface && surface->HasActiveFrame()) return surface;
diff --git a/components/viz/service/surfaces/surface_manager.h b/components/viz/service/surfaces/surface_manager.h index 2d9ee50..848f179 100644 --- a/components/viz/service/surfaces/surface_manager.h +++ b/components/viz/service/surfaces/surface_manager.h
@@ -188,12 +188,8 @@ // Returns the most recent surface associated with the |fallback_surface_id|'s // FrameSinkId that was created prior to the current primary surface and // verified by the viz host to be owned by the fallback surface's parent. If - // the FrameSinkId of the |primary_surface_id| does not match the - // |fallback_surface_id|'s then this method will always return the fallback - // surface because we cannot guarantee the latest in flight surface from the - // fallback frame sink is older than the primary surface. - Surface* GetLatestInFlightSurface(const SurfaceId& primary_surface_id, - const SurfaceId& fallback_surface_id); + // |fallback_surface_id| doesn't exist then this method will return nullptr. + Surface* GetLatestInFlightSurface(const SurfaceRange& surface_range); // Called by SurfaceAggregator notifying us that it will use |surface| in the // next display frame. We will notify SurfaceObservers accordingly.
diff --git a/components/viz/test/run_all_perftests.cc b/components/viz/test/run_all_perftests.cc index 8f0aae4..2b4ee9a 100644 --- a/components/viz/test/run_all_perftests.cc +++ b/components/viz/test/run_all_perftests.cc
@@ -14,5 +14,5 @@ // in parallel. return base::LaunchUnitTestsSerially( argc, argv, - base::Bind(&viz::VizTestSuite::Run, base::Unretained(&test_suite))); + base::BindOnce(&viz::VizTestSuite::Run, base::Unretained(&test_suite))); }
diff --git a/components/viz/test/run_all_unittests.cc b/components/viz/test/run_all_unittests.cc index 78d4353..8d4798ad 100644 --- a/components/viz/test/run_all_unittests.cc +++ b/components/viz/test/run_all_unittests.cc
@@ -14,5 +14,5 @@ return base::LaunchUnitTests( argc, argv, - base::Bind(&viz::VizTestSuite::Run, base::Unretained(&test_suite))); + base::BindOnce(&viz::VizTestSuite::Run, base::Unretained(&test_suite))); }
diff --git a/components/web_cache/browser/web_cache_manager.cc b/components/web_cache/browser/web_cache_manager.cc index 77b1c1ee..2f730197 100644 --- a/components/web_cache/browser/web_cache_manager.cc +++ b/components/web_cache/browser/web_cache_manager.cc
@@ -407,8 +407,9 @@ // Ask to be called back in a few milliseconds to actually recompute our // allocation. base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, base::Bind(&WebCacheManager::ReviseAllocationStrategy, - weak_factory_.GetWeakPtr()), + FROM_HERE, + base::BindOnce(&WebCacheManager::ReviseAllocationStrategy, + weak_factory_.GetWeakPtr()), base::TimeDelta::FromMilliseconds(kReviseAllocationDelayMS)); }
diff --git a/components/web_resource/web_resource_service.cc b/components/web_resource/web_resource_service.cc index 0767fdb..5680024 100644 --- a/components/web_resource/web_resource_service.cc +++ b/components/web_resource/web_resource_service.cc
@@ -105,8 +105,9 @@ return; fetch_scheduled_ = true; base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, base::Bind(&WebResourceService::StartFetch, - weak_ptr_factory_.GetWeakPtr()), + FROM_HERE, + base::BindOnce(&WebResourceService::StartFetch, + weak_ptr_factory_.GetWeakPtr()), base::TimeDelta::FromMilliseconds(delay_ms)); }
diff --git a/components/webdata/common/web_database_service.cc b/components/webdata/common/web_database_service.cc index 7948b185..cd188cb 100644 --- a/components/webdata/common/web_database_service.cc +++ b/components/webdata/common/web_database_service.cc
@@ -30,8 +30,8 @@ void DBLoaded(sql::InitStatus status, const std::string& diagnostics) override { callback_task_runner_->PostTask( - FROM_HERE, base::Bind(&WebDatabaseService::OnDatabaseLoadDone, - web_database_service_, status, diagnostics)); + FROM_HERE, base::BindOnce(&WebDatabaseService::OnDatabaseLoadDone, + web_database_service_, status, diagnostics)); } private: const base::WeakPtr<WebDatabaseService> web_database_service_; @@ -66,7 +66,7 @@ void WebDatabaseService::LoadDatabase() { DCHECK(web_db_backend_); db_task_runner_->PostTask( - FROM_HERE, Bind(&WebDatabaseBackend::InitDatabase, web_db_backend_)); + FROM_HERE, BindOnce(&WebDatabaseBackend::InitDatabase, web_db_backend_)); } void WebDatabaseService::ShutdownDatabase() { @@ -77,7 +77,8 @@ if (!web_db_backend_) return; db_task_runner_->PostTask( - FROM_HERE, Bind(&WebDatabaseBackend::ShutdownDatabase, web_db_backend_)); + FROM_HERE, + BindOnce(&WebDatabaseBackend::ShutdownDatabase, web_db_backend_)); } WebDatabase* WebDatabaseService::GetDatabaseOnDB() const {
diff --git a/content/browser/background_fetch/background_fetch_context.cc b/content/browser/background_fetch/background_fetch_context.cc index bf049b8e..05ec7b52 100644 --- a/content/browser/background_fetch/background_fetch_context.cc +++ b/content/browser/background_fetch/background_fetch_context.cc
@@ -219,6 +219,12 @@ .service_worker_registration_id() == service_worker_registration_id) { DCHECK(saved_iter->second); + + // TODO(peter): Temporary work-around for a crash where fetches for a + // given Service Worker registration are abandoned twice. + if (saved_iter->second->aborted()) + continue; + saved_iter->second->Abort( BackgroundFetchReasonToAbort::SERVICE_WORKER_UNAVAILABLE); }
diff --git a/content/browser/background_fetch/background_fetch_delegate_proxy.cc b/content/browser/background_fetch/background_fetch_delegate_proxy.cc index 999bea3..d56f151 100644 --- a/content/browser/background_fetch/background_fetch_delegate_proxy.cc +++ b/content/browser/background_fetch/background_fetch_delegate_proxy.cc
@@ -333,7 +333,7 @@ BrowserThread::UI, FROM_HERE, base::BindOnce(&Core::Abort, ui_core_ptr_, job_unique_id)); - job_details_map_.erase(job_details_map_.find(job_unique_id)); + job_details_map_.erase(job_unique_id); } void BackgroundFetchDelegateProxy::OnJobCancelled(
diff --git a/content/browser/browser_child_process_host_impl.cc b/content/browser/browser_child_process_host_impl.cc index 3fc3aa2..b41adf0b 100644 --- a/content/browser/browser_child_process_host_impl.cc +++ b/content/browser/browser_child_process_host_impl.cc
@@ -186,7 +186,7 @@ if (notify_child_disconnected_) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - base::BindOnce(&NotifyProcessHostDisconnected, data_)); + base::BindOnce(&NotifyProcessHostDisconnected, data_.Duplicate())); } } @@ -316,7 +316,7 @@ void BrowserChildProcessHostImpl::SetHandle(base::ProcessHandle handle) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - data_.handle = handle; + data_.SetHandle(handle); } service_manager::mojom::ServiceRequest @@ -358,7 +358,8 @@ if (!child_process_) { // If the delegate doesn't use Launch() helper. ChildProcessTerminationInfo info; - info.status = base::GetTerminationStatus(data_.handle, &info.exit_code); + info.status = + base::GetTerminationStatus(data_.GetHandle(), &info.exit_code); return info; } return child_process_->GetChildTerminationInfo(known_dead); @@ -381,8 +382,9 @@ early_exit_watcher_.StopWatching(); #endif - BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, - base::BindOnce(&NotifyProcessHostConnected, data_)); + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, + base::BindOnce(&NotifyProcessHostConnected, data_.Duplicate())); delegate_->OnChannelConnected(peer_pid); @@ -390,7 +392,7 @@ ShareMetricsAllocatorToProcess(); BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - base::BindOnce(&NotifyProcessLaunchedAndConnected, data_)); + base::BindOnce(&NotifyProcessLaunchedAndConnected, data_.Duplicate())); } } @@ -435,13 +437,14 @@ // early exit watcher so GetTerminationStatus can close the process handle. early_exit_watcher_.StopWatching(); #endif - if (child_process_.get() || data_.handle) { + if (child_process_.get() || data_.GetHandle()) { ChildProcessTerminationInfo info = GetTerminationInfo(true /* known_dead */); #if defined(OS_ANDROID) delegate_->OnProcessCrashed(info.exit_code); - BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, - base::BindOnce(&NotifyProcessKilled, data_, info)); + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, + base::BindOnce(&NotifyProcessKilled, data_.Duplicate(), info)); #else // OS_ANDROID switch (info.status) { case base::TERMINATION_STATUS_PROCESS_CRASHED: @@ -449,7 +452,7 @@ delegate_->OnProcessCrashed(info.exit_code); BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - base::BindOnce(&NotifyProcessCrashed, data_, info)); + base::BindOnce(&NotifyProcessCrashed, data_.Duplicate(), info)); UMA_HISTOGRAM_ENUMERATION("ChildProcess.Crashed2", static_cast<ProcessType>(data_.process_type), PROCESS_TYPE_MAX); @@ -462,7 +465,7 @@ delegate_->OnProcessCrashed(info.exit_code); BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - base::BindOnce(&NotifyProcessKilled, data_, info)); + base::BindOnce(&NotifyProcessKilled, data_.Duplicate(), info)); // Report that this child process was killed. UMA_HISTOGRAM_ENUMERATION("ChildProcess.Killed2", static_cast<ProcessType>(data_.process_type), @@ -600,15 +603,14 @@ early_exit_watcher_.StartWatchingOnce(process.Handle(), this); #endif - // TODO(rvargas) crbug.com/417532: Don't store a handle. - data_.handle = process.Handle(); + data_.SetHandle(process.Handle()); delegate_->OnProcessLaunched(); if (is_channel_connected_) { ShareMetricsAllocatorToProcess(); BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - base::BindOnce(&NotifyProcessLaunchedAndConnected, data_)); + base::BindOnce(&NotifyProcessLaunchedAndConnected, data_.Duplicate())); } }
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index 611c1d6..eb942391 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc
@@ -1712,9 +1712,20 @@ } if (base::FeatureList::IsEnabled(features::kAudioServiceLaunchOnStartup)) { - content::ServiceManagerConnection::GetForProcess() - ->GetConnector() - ->StartService(audio::mojom::kServiceName); + // Schedule the audio service startup on the main thread. + BrowserThread::PostAfterStartupTask( + FROM_HERE, BrowserThread::GetTaskRunnerForThread(BrowserThread::UI), + base::BindOnce([]() { + TRACE_EVENT0("audio", "Starting audio service"); + ServiceManagerConnection* connection = + content::ServiceManagerConnection::GetForProcess(); + if (connection) { + // The browser is not shutting down: |connection| would be null + // otherwise. + connection->GetConnector()->StartService( + audio::mojom::kServiceName); + } + })); } audio_system_ = audio::CreateAudioSystem(
diff --git a/content/browser/compositor/reflector_impl_unittest.cc b/content/browser/compositor/reflector_impl_unittest.cc index fd673e05..40a83a8 100644 --- a/content/browser/compositor/reflector_impl_unittest.cc +++ b/content/browser/compositor/reflector_impl_unittest.cc
@@ -5,10 +5,12 @@ #include "content/browser/compositor/reflector_impl.h" #include "base/callback.h" +#include "base/feature_list.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/single_thread_task_runner.h" #include "build/build_config.h" +#include "components/viz/common/features.h" #include "components/viz/common/frame_sinks/begin_frame_source.h" #include "components/viz/common/frame_sinks/delay_based_time_source.h" #include "components/viz/service/display/output_surface_frame.h" @@ -202,6 +204,10 @@ namespace { TEST_F(ReflectorImplTest, CheckNormalOutputSurface) { + // TODO(jonross): Re-enable once Reflector is re-written to work with + // VizDisplayCompositor. https://crbug.com/601869 + if (base::FeatureList::IsEnabled(features::kVizDisplayCompositor)) + return; output_surface_->SetFlip(false); SetUpReflector(); UpdateTexture(); @@ -212,6 +218,10 @@ } TEST_F(ReflectorImplTest, CheckInvertedOutputSurface) { + // TODO(jonross): Re-enable once Reflector is re-written to work with + // VizDisplayCompositor. https://crbug.com/601869 + if (base::FeatureList::IsEnabled(features::kVizDisplayCompositor)) + return; output_surface_->SetFlip(true); SetUpReflector(); UpdateTexture(); @@ -221,6 +231,10 @@ #if defined(USE_OZONE) TEST_F(ReflectorImplTest, CheckOverlayNoReflector) { + // TODO(jonross): Re-enable once Reflector is re-written to work with + // VizDisplayCompositor. https://crbug.com/601869 + if (base::FeatureList::IsEnabled(features::kVizDisplayCompositor)) + return; viz::OverlayCandidateList list; viz::OverlayCandidate plane_1, plane_2; plane_1.plane_z_order = 0; @@ -232,6 +246,10 @@ } TEST_F(ReflectorImplTest, CheckOverlaySWMirroring) { + // TODO(jonross): Re-enable once Reflector is re-written to work with + // VizDisplayCompositor. https://crbug.com/601869 + if (base::FeatureList::IsEnabled(features::kVizDisplayCompositor)) + return; SetUpReflector(); viz::OverlayCandidateList list; viz::OverlayCandidate plane_1, plane_2;
diff --git a/content/browser/devtools/devtools_http_handler_unittest.cc b/content/browser/devtools/devtools_http_handler_unittest.cc index 3222803..97ac6d5 100644 --- a/content/browser/devtools/devtools_http_handler_unittest.cc +++ b/content/browser/devtools/devtools_http_handler_unittest.cc
@@ -24,6 +24,7 @@ #include "content/public/browser/devtools_socket_factory.h" #include "content/public/test/test_browser_thread_bundle.h" #include "content/public/test/test_utils.h" +#include "net/base/completion_once_callback.h" #include "net/base/ip_address.h" #include "net/base/ip_endpoint.h" #include "net/base/net_errors.h" @@ -52,7 +53,7 @@ } int Accept(std::unique_ptr<net::StreamSocket>* socket, - const net::CompletionCallback& callback) override { + net::CompletionOnceCallback callback) override { return net::ERR_IO_PENDING; } };
diff --git a/content/browser/display_cutout/display_cutout_host_impl.cc b/content/browser/display_cutout/display_cutout_host_impl.cc index 4785df22..5d61832f 100644 --- a/content/browser/display_cutout/display_cutout_host_impl.cc +++ b/content/browser/display_cutout/display_cutout_host_impl.cc
@@ -12,12 +12,8 @@ namespace content { -DisplayCutoutHostImpl::DisplayCutoutHostImpl( - WebContentsImpl* web_contents, - ViewportFitChangedCallback callback) - : WebContentsObserver(web_contents), - viewport_fit_changed_callback_(callback), - bindings_(web_contents, this) {} +DisplayCutoutHostImpl::DisplayCutoutHostImpl(WebContentsImpl* web_contents) + : bindings_(web_contents, this), web_contents_impl_(web_contents) {} DisplayCutoutHostImpl::~DisplayCutoutHostImpl() = default; @@ -37,7 +33,7 @@ // If we are the current |RenderFrameHost| frame then notify // WebContentsObservers about the new value. if (current_rfh_ == rfh) - viewport_fit_changed_callback_.Run(value); + web_contents_impl_->NotifyViewportFitChanged(value); MaybeQueueUKMEvent(rfh); } @@ -46,11 +42,8 @@ SetCurrentRenderFrameHost(rfh); } -void DisplayCutoutHostImpl::DidToggleFullscreenModeForTab( - bool entered_fullscreen, - bool will_cause_resize) { - if (!entered_fullscreen) - SetCurrentRenderFrameHost(nullptr); +void DisplayCutoutHostImpl::DidExitFullscreen() { + SetCurrentRenderFrameHost(nullptr); } void DisplayCutoutHostImpl::DidStartNavigation( @@ -78,11 +71,10 @@ // fullscreen then we should make the main frame the current // |RenderFrameHost|. RenderWidgetHostImpl* rwh = - web_contents_impl()->GetRenderViewHost()->GetWidget(); - blink::WebDisplayMode mode = web_contents_impl()->GetDisplayMode(rwh); - if (mode == blink::WebDisplayMode::kWebDisplayModeFullscreen) { - SetCurrentRenderFrameHost(web_contents_impl()->GetMainFrame()); - } + web_contents_impl_->GetRenderViewHost()->GetWidget(); + blink::WebDisplayMode mode = web_contents_impl_->GetDisplayMode(rwh); + if (mode == blink::WebDisplayMode::kWebDisplayModeFullscreen) + SetCurrentRenderFrameHost(web_contents_impl_->GetMainFrame()); } void DisplayCutoutHostImpl::RenderFrameDeleted(RenderFrameHost* rfh) { @@ -132,7 +124,8 @@ // If the new RenderFrameHost is nullptr we should stop here and notify // observers that the new viewport fit is kAuto (the default). if (!rfh) { - viewport_fit_changed_callback_.Run(blink::mojom::ViewportFit::kAuto); + web_contents_impl_->NotifyViewportFitChanged( + blink::mojom::ViewportFit::kAuto); return; } @@ -143,7 +136,7 @@ SendSafeAreaToFrame(rfh, insets_); // Notify the WebContentsObservers that the viewport fit value has changed. - viewport_fit_changed_callback_.Run(GetValueOrDefault(rfh)); + web_contents_impl_->NotifyViewportFitChanged(GetValueOrDefault(rfh)); } void DisplayCutoutHostImpl::SendSafeAreaToFrame(RenderFrameHost* rfh, @@ -167,10 +160,6 @@ return blink::mojom::ViewportFit::kAuto; } -WebContentsImpl* DisplayCutoutHostImpl::web_contents_impl() { - return static_cast<WebContentsImpl*>(web_contents()); -} - void DisplayCutoutHostImpl::MaybeQueueUKMEvent(RenderFrameHost* frame) { if (!frame) return; @@ -206,7 +195,7 @@ void DisplayCutoutHostImpl::RecordPendingUKMEvents() { for (const auto& event : pending_ukm_events_) { ukm::builders::Layout_DisplayCutout_StateChanged builder( - web_contents_impl()->GetUkmSourceIdForLastCommittedSource()); + web_contents_impl_->GetUkmSourceIdForLastCommittedSource()); builder.SetIsMainFrame(event.is_main_frame); builder.SetViewportFit_Applied(static_cast<int>(event.applied_value)); builder.SetViewportFit_Supplied(static_cast<int>(event.supplied_value));
diff --git a/content/browser/display_cutout/display_cutout_host_impl.h b/content/browser/display_cutout/display_cutout_host_impl.h index eba70e2..3c24e13 100644 --- a/content/browser/display_cutout/display_cutout_host_impl.h +++ b/content/browser/display_cutout/display_cutout_host_impl.h
@@ -11,14 +11,9 @@ namespace content { -class DisplayCutoutHostImpl : public blink::mojom::DisplayCutoutHost, - public WebContentsObserver { +class DisplayCutoutHostImpl : public blink::mojom::DisplayCutoutHost { public: - // Called when the effective viewport fit value has changed. - using ViewportFitChangedCallback = - base::RepeatingCallback<void(blink::mojom::ViewportFit)>; - - DisplayCutoutHostImpl(WebContentsImpl*, ViewportFitChangedCallback); + explicit DisplayCutoutHostImpl(WebContentsImpl*); ~DisplayCutoutHostImpl() override; // blink::mojom::DisplayCutoutHost @@ -29,15 +24,14 @@ void ViewportFitChangedForFrame(RenderFrameHost* rfh, blink::mojom::ViewportFit value); - // WebContentsObserver override. - void DidAcquireFullscreen(RenderFrameHost* rfh) override; - void DidToggleFullscreenModeForTab(bool entered_fullscreen, - bool will_cause_resize) override; - void DidStartNavigation(NavigationHandle* navigation_handle) override; - void DidFinishNavigation(NavigationHandle* navigation_handle) override; - void RenderFrameDeleted(RenderFrameHost* rfh) override; - void RenderFrameCreated(RenderFrameHost* rfh) override; - void WebContentsDestroyed() override; + // Called by WebContents when various events occur. + void DidAcquireFullscreen(RenderFrameHost* rfh); + void DidExitFullscreen(); + void DidStartNavigation(NavigationHandle* navigation_handle); + void DidFinishNavigation(NavigationHandle* navigation_handle); + void RenderFrameDeleted(RenderFrameHost* rfh); + void RenderFrameCreated(RenderFrameHost* rfh); + void WebContentsDestroyed(); // Updates the safe area insets on the current frame. void SetDisplayCutoutSafeArea(gfx::Insets insets); @@ -63,8 +57,6 @@ // stored value. blink::mojom::ViewportFit GetValueOrDefault(RenderFrameHost* rfh) const; - WebContentsImpl* web_contents_impl(); - // Builds and records a Layout.DisplayCutout.StateChanged UKM event for the // provided |frame|. The event will be added to the list of pending events. void MaybeQueueUKMEvent(RenderFrameHost* frame); @@ -88,11 +80,13 @@ // Stores a map of RenderFrameHosts and their current viewport fit values. std::map<RenderFrameHost*, blink::mojom::ViewportFit> values_; - // Stores the callback for when the effective viewport fit value has changed. - ViewportFitChangedCallback viewport_fit_changed_callback_; - // Holds WebContents associated mojo bindings. WebContentsFrameBindingSet<blink::mojom::DisplayCutoutHost> bindings_; + + // Weak pointer to the owning |WebContentsImpl| instance. + WebContentsImpl* web_contents_impl_; + + DISALLOW_COPY_AND_ASSIGN(DisplayCutoutHostImpl); }; } // namespace content
diff --git a/content/browser/find_request_manager.cc b/content/browser/find_request_manager.cc index d76e984..b9dc318 100644 --- a/content/browser/find_request_manager.cc +++ b/content/browser/find_request_manager.cc
@@ -10,7 +10,6 @@ #include "content/browser/find_in_page_client.h" #include "content/browser/frame_host/render_frame_host_impl.h" #include "content/browser/web_contents/web_contents_impl.h" -#include "content/common/associated_interface_provider_impl.h" #include "content/common/frame_messages.h" #include "content/public/browser/guest_mode.h" #include "third_party/blink/public/mojom/frame/find_in_page.mojom.h"
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc index e2d0e8b3..b97d550 100644 --- a/content/browser/frame_host/render_frame_host_impl.cc +++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -98,8 +98,6 @@ #include "content/browser/webui/web_ui_controller_factory_registry.h" #include "content/browser/webui/web_ui_url_loader_factory_internal.h" #include "content/common/accessibility_messages.h" -#include "content/common/associated_interface_provider_impl.h" -#include "content/common/associated_interface_registry_impl.h" #include "content/common/associated_interfaces.mojom.h" #include "content/common/content_security_policy/content_security_policy.h" #include "content/common/frame_messages.h" @@ -163,6 +161,8 @@ #include "services/service_manager/public/cpp/connector.h" #include "services/service_manager/public/cpp/interface_provider.h" #include "storage/browser/blob/blob_storage_context.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" #include "third_party/blink/public/common/blob/blob_utils.h" #include "third_party/blink/public/common/feature_policy/feature_policy.h" #include "third_party/blink/public/common/frame/frame_policy.h" @@ -963,7 +963,7 @@ blink::AssociatedInterfaceProvider* RenderFrameHostImpl::GetRemoteAssociatedInterfaces() { if (!remote_associated_interfaces_) { - mojom::AssociatedInterfaceProviderAssociatedPtr remote_interfaces; + blink::mojom::AssociatedInterfaceProviderAssociatedPtr remote_interfaces; IPC::ChannelProxy* channel = GetProcess()->GetChannel(); if (channel) { RenderProcessHostImpl* process = @@ -975,8 +975,9 @@ // case we set up a dummy interface provider. mojo::MakeRequestAssociatedWithDedicatedPipe(&remote_interfaces); } - remote_associated_interfaces_.reset(new AssociatedInterfaceProviderImpl( - std::move(remote_interfaces))); + remote_associated_interfaces_ = + std::make_unique<blink::AssociatedInterfaceProvider>( + std::move(remote_interfaces)); } return remote_associated_interfaces_.get(); } @@ -1140,10 +1141,9 @@ const std::string& interface_name, mojo::ScopedInterfaceEndpointHandle handle) { ContentBrowserClient* browser_client = GetContentClient()->browser(); - if (associated_registry_->CanBindRequest(interface_name)) { - associated_registry_->BindRequest(interface_name, std::move(handle)); - } else if (!browser_client->BindAssociatedInterfaceRequestFromFrame( - this, interface_name, &handle)) { + if (!associated_registry_->TryBindInterface(interface_name, &handle) && + !browser_client->BindAssociatedInterfaceRequestFromFrame( + this, interface_name, &handle)) { delegate_->OnAssociatedInterfaceRequest(this, interface_name, std::move(handle)); } @@ -4204,15 +4204,15 @@ if (registry_.get()) return; - associated_registry_ = std::make_unique<AssociatedInterfaceRegistryImpl>(); + associated_registry_ = std::make_unique<blink::AssociatedInterfaceRegistry>(); registry_ = std::make_unique<service_manager::BinderRegistry>(); auto make_binding = [](RenderFrameHostImpl* impl, mojom::FrameHostAssociatedRequest request) { impl->frame_host_associated_binding_.Bind(std::move(request)); }; - static_cast<blink::AssociatedInterfaceRegistry*>(associated_registry_.get()) - ->AddInterface(base::Bind(make_binding, base::Unretained(this))); + associated_registry_->AddInterface( + base::BindRepeating(make_binding, base::Unretained(this))); RegisterMojoInterfaces(); mojom::FrameFactoryPtr frame_factory;
diff --git a/content/browser/frame_host/render_frame_host_impl.h b/content/browser/frame_host/render_frame_host_impl.h index 285742afa7..2192894 100644 --- a/content/browser/frame_host/render_frame_host_impl.h +++ b/content/browser/frame_host/render_frame_host_impl.h
@@ -103,6 +103,8 @@ } namespace blink { +class AssociatedInterfaceProvider; +class AssociatedInterfaceRegistry; struct FramePolicy; struct WebFullscreenOptions; struct WebScrollIntoViewParams; @@ -118,8 +120,6 @@ } // namespace network namespace content { -class AssociatedInterfaceProviderImpl; -class AssociatedInterfaceRegistryImpl; class AuthenticatorImpl; class FrameTree; class FrameTreeNode; @@ -1411,7 +1411,7 @@ // SensorProvider proxy which acts as a gatekeeper to the real SensorProvider. std::unique_ptr<SensorProviderProxyImpl> sensor_provider_proxy_; - std::unique_ptr<AssociatedInterfaceRegistryImpl> associated_registry_; + std::unique_ptr<blink::AssociatedInterfaceRegistry> associated_registry_; std::unique_ptr<service_manager::BinderRegistry> registry_; std::unique_ptr<service_manager::InterfaceProvider> remote_interfaces_; @@ -1583,7 +1583,7 @@ std::unique_ptr<AuthenticatorImpl> authenticator_impl_; #endif - std::unique_ptr<AssociatedInterfaceProviderImpl> + std::unique_ptr<blink::AssociatedInterfaceProvider> remote_associated_interfaces_; // A bitwise OR of bindings types that have been enabled for this RenderFrame.
diff --git a/content/browser/histogram_controller.cc b/content/browser/histogram_controller.cc index 100d8863..7d1c110 100644 --- a/content/browser/histogram_controller.cc +++ b/content/browser/histogram_controller.cc
@@ -153,7 +153,7 @@ // example, the GPU process may not exist and there may instead just be a // GPU thread in the browser process). If that's the case, then the process // handle will be base::kNullProcessHandle and we shouldn't ask it for data. - if (data.handle == base::kNullProcessHandle) + if (!data.IsHandleValid()) continue; if (auto* child_histogram_fetcher =
diff --git a/content/browser/loader/resource_dispatcher_host_unittest.cc b/content/browser/loader/resource_dispatcher_host_unittest.cc index a6d33ec2..6c0ec74 100644 --- a/content/browser/loader/resource_dispatcher_host_unittest.cc +++ b/content/browser/loader/resource_dispatcher_host_unittest.cc
@@ -59,6 +59,7 @@ #include "content/test/test_navigation_url_loader_delegate.h" #include "mojo/public/cpp/system/data_pipe_utils.h" #include "net/base/chunked_upload_data_stream.h" +#include "net/base/completion_once_callback.h" #include "net/base/elements_upload_data_stream.h" #include "net/base/load_flags.h" #include "net/base/net_errors.h" @@ -312,7 +313,7 @@ int GetData(std::string* mime_type, std::string* charset, std::string* data, - const net::CompletionCallback& callback) const override { + net::CompletionOnceCallback callback) const override { *mime_type = "text/plain"; *charset = "UTF-8";
diff --git a/content/browser/media/media_web_contents_observer.cc b/content/browser/media/media_web_contents_observer.cc index 0fba3f8..8f9321e 100644 --- a/content/browser/media/media_web_contents_observer.cc +++ b/content/browser/media/media_web_contents_observer.cc
@@ -159,6 +159,10 @@ UpdateVideoLock(); } +void MediaWebContentsObserver::DidUpdateAudioMutingState(bool muted) { + session_controllers_manager_.WebContentsMutedStateChanged(muted); +} + void MediaWebContentsObserver::RequestPersistentVideo(bool value) { if (!fullscreen_player_) return;
diff --git a/content/browser/media/media_web_contents_observer.h b/content/browser/media/media_web_contents_observer.h index 67d25de..d927824 100644 --- a/content/browser/media/media_web_contents_observer.h +++ b/content/browser/media/media_web_contents_observer.h
@@ -79,6 +79,7 @@ bool OnMessageReceived(const IPC::Message& message, RenderFrameHost* render_frame_host) override; void OnVisibilityChanged(content::Visibility visibility) override; + void DidUpdateAudioMutingState(bool muted) override; // TODO(zqzhang): this method is temporarily in MediaWebContentsObserver as // the effectively fullscreen video code is also here. We need to consider
diff --git a/content/browser/media/session/media_session_browsertest.cc b/content/browser/media/session/media_session_browsertest.cc index fb669cc..9d060b81 100644 --- a/content/browser/media/session/media_session_browsertest.cc +++ b/content/browser/media/session/media_session_browsertest.cc
@@ -176,6 +176,27 @@ EXPECT_TRUE(IsPlaying(shell(), "long-audio")); } +IN_PROC_BROWSER_TEST_F(MediaSessionBrowserTest, WebContents_Muted) { + EnableInternalMediaSesion(); + + NavigateToURL(shell(), GetTestUrl("media/session", "media-session.html")); + + shell()->web_contents()->SetAudioMuted(true); + MediaSession* media_session = MediaSession::Get(shell()->web_contents()); + ASSERT_NE(nullptr, media_session); + + StartPlaybackAndWait(shell(), "long-video"); + EXPECT_FALSE(media_session->IsControllable()); + + // Unmute the web contents and the player should be created. + shell()->web_contents()->SetAudioMuted(false); + EXPECT_TRUE(media_session->IsControllable()); + + // Now mute it again and the player should be removed. + shell()->web_contents()->SetAudioMuted(true); + EXPECT_FALSE(media_session->IsControllable()); +} + #if !defined(OS_ANDROID) // On Android, System Audio Focus would break this test. IN_PROC_BROWSER_TEST_F(MediaSessionBrowserTest, MultipleTabsPlayPause) {
diff --git a/content/browser/media/session/media_session_controller.cc b/content/browser/media/session/media_session_controller.cc index 69df8da..fa1a8a5 100644 --- a/content/browser/media/session/media_session_controller.cc +++ b/content/browser/media/session/media_session_controller.cc
@@ -32,6 +32,11 @@ bool has_audio, bool is_remote, media::MediaContentType media_content_type) { + // Store these as we will need them later. + is_remote_ = is_remote; + has_audio_ = has_audio; + media_content_type_ = media_content_type; + // Don't generate a new id if one has already been set. if (!has_session_) { // These objects are only created on the UI thread, so this is safe. @@ -50,12 +55,13 @@ // // TODO(dalecurtis): Delete sticky audio once we're no longer using WMPA and // the BrowserMediaPlayerManagers. Tracked by http://crbug.com/580626 - has_audio = true; + has_audio_ = true; } // Don't bother with a MediaSession for remote players or without audio. If // we already have a session from a previous call, release it. - if (!has_audio || is_remote) { + if (!has_audio_ || is_remote || + media_web_contents_observer_->web_contents()->IsAudioMuted()) { if (has_session_) { has_session_ = false; media_session_->RemovePlayer(this, player_id_); @@ -120,4 +126,19 @@ media_session_->OnPlayerPaused(this, player_id_); } +void MediaSessionController::WebContentsMutedStateChanged(bool muted) { + if (!has_audio_ || is_remote_) + return; + + // We want to make sure we do not request audio focus on a muted tab as it + // would break user expectations by pausing/ducking other playbacks. + if (!muted && !has_session_) { + if (media_session_->AddPlayer(this, player_id_, media_content_type_)) + has_session_ = true; + } else if (muted && has_session_) { + has_session_ = false; + media_session_->RemovePlayer(this, player_id_); + } +} + } // namespace content
diff --git a/content/browser/media/session/media_session_controller.h b/content/browser/media/session/media_session_controller.h index 3a9ea7c..cff0dc7 100644 --- a/content/browser/media/session/media_session_controller.h +++ b/content/browser/media/session/media_session_controller.h
@@ -10,10 +10,7 @@ #include "content/browser/media/session/media_session_player_observer.h" #include "content/common/content_export.h" #include "content/public/browser/web_contents_observer.h" - -namespace media { -enum class MediaContentType; -} // namespace media +#include "media/base/media_content_type.h" namespace content { @@ -57,6 +54,9 @@ // Test helpers. int get_player_id_for_testing() const { return player_id_; } + // Called when the WebContents is either muted or unmuted. + void WebContentsMutedStateChanged(bool muted); + private: const WebContentsObserver::MediaPlayerId id_; @@ -68,6 +68,10 @@ int player_id_ = 0; bool has_session_ = false; + bool has_audio_ = false; + bool is_remote_ = false; + media::MediaContentType media_content_type_ = + media::MediaContentType::Persistent; DISALLOW_COPY_AND_ASSIGN(MediaSessionController); };
diff --git a/content/browser/media/session/media_session_controllers_manager.cc b/content/browser/media/session/media_session_controllers_manager.cc index 33947c0d..84d7222c 100644 --- a/content/browser/media/session/media_session_controllers_manager.cc +++ b/content/browser/media/session/media_session_controllers_manager.cc
@@ -94,4 +94,12 @@ controllers_map_.erase(id); } +void MediaSessionControllersManager::WebContentsMutedStateChanged(bool muted) { + if (!IsMediaSessionEnabled()) + return; + + for (auto& entry : controllers_map_) + entry.second->WebContentsMutedStateChanged(muted); +} + } // namespace content
diff --git a/content/browser/media/session/media_session_controllers_manager.h b/content/browser/media/session/media_session_controllers_manager.h index cf991cc..f15c96e1 100644 --- a/content/browser/media/session/media_session_controllers_manager.h +++ b/content/browser/media/session/media_session_controllers_manager.h
@@ -54,6 +54,9 @@ // Called when the given player |id| has ended. void OnEnd(const MediaPlayerId& id); + // Called when the WebContents was muted or unmuted. + void WebContentsMutedStateChanged(bool muted); + private: friend class MediaSessionControllersManagerTest;
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc index 3cf4e5d1..1df1149 100644 --- a/content/browser/ppapi_plugin_process_host.cc +++ b/content/browser/ppapi_plugin_process_host.cc
@@ -509,8 +509,8 @@ sent_requests_.pop(); const ChildProcessData& data = process_->GetData(); - client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), - data.id); + client->OnPpapiChannelOpened(channel_handle, + base::GetProcId(data.GetHandle()), data.id); } } // namespace content
diff --git a/content/browser/renderer_host/media/audio_service_listener.cc b/content/browser/renderer_host/media/audio_service_listener.cc index a9737789..2a7a25a 100644 --- a/content/browser/renderer_host/media/audio_service_listener.cc +++ b/content/browser/renderer_host/media/audio_service_listener.cc
@@ -182,7 +182,7 @@ void AudioServiceListener::BrowserChildProcessHostDisconnected( const ChildProcessData& data) { DCHECK_CALLED_ON_VALID_SEQUENCE(owning_sequence_); - if (base::GetProcId(data.handle) != process_id_) + if (base::GetProcId(data.GetHandle()) != process_id_) return; process_id_ = base::kNullProcessId; metrics_.ServiceProcessTerminated( @@ -193,7 +193,7 @@ const ChildProcessData& data, const ChildProcessTerminationInfo& info) { DCHECK_CALLED_ON_VALID_SEQUENCE(owning_sequence_); - if (base::GetProcId(data.handle) != process_id_) + if (base::GetProcId(data.GetHandle()) != process_id_) return; process_id_ = base::kNullProcessId; metrics_.ServiceProcessTerminated( @@ -204,7 +204,7 @@ const ChildProcessData& data, const ChildProcessTerminationInfo& info) { DCHECK_CALLED_ON_VALID_SEQUENCE(owning_sequence_); - if (base::GetProcId(data.handle) != process_id_) + if (base::GetProcId(data.GetHandle()) != process_id_) return; process_id_ = base::kNullProcessId; metrics_.ServiceProcessTerminated(
diff --git a/content/browser/renderer_host/media/audio_service_listener_unittest.cc b/content/browser/renderer_host/media/audio_service_listener_unittest.cc index d6a66a9d..d43d254 100644 --- a/content/browser/renderer_host/media/audio_service_listener_unittest.cc +++ b/content/browser/renderer_host/media/audio_service_listener_unittest.cc
@@ -194,7 +194,7 @@ MakeTestServiceInfo(audio_service_identity, pid)); audio_service_listener.OnServiceStarted(audio_service_identity, pid); ChildProcessData data(content::ProcessType::PROCESS_TYPE_UTILITY); - data.handle = handle; + data.SetHandle(handle); audio_service_listener.BrowserChildProcessHostDisconnected(data); histogram_tester.ExpectUniqueSample( "Media.AudioService.ObservedProcessTerminationStatus", @@ -215,7 +215,7 @@ MakeTestServiceInfo(audio_service_identity, pid)); audio_service_listener.OnServiceStarted(audio_service_identity, pid); ChildProcessData data(content::ProcessType::PROCESS_TYPE_UTILITY); - data.handle = handle; + data.SetHandle(handle); audio_service_listener.BrowserChildProcessCrashed( data, content::ChildProcessTerminationInfo()); histogram_tester.ExpectUniqueSample( @@ -236,7 +236,7 @@ MakeTestServiceInfo(audio_service_identity, pid)); audio_service_listener.OnServiceStarted(audio_service_identity, pid); ChildProcessData data(content::ProcessType::PROCESS_TYPE_UTILITY); - data.handle = handle; + data.SetHandle(handle); audio_service_listener.BrowserChildProcessKilled( data, content::ChildProcessTerminationInfo()); histogram_tester.ExpectUniqueSample(
diff --git a/content/browser/renderer_host/p2p/socket_host_tcp_server.cc b/content/browser/renderer_host/p2p/socket_host_tcp_server.cc index 628b90de..a6c8195 100644 --- a/content/browser/renderer_host/p2p/socket_host_tcp_server.cc +++ b/content/browser/renderer_host/p2p/socket_host_tcp_server.cc
@@ -4,6 +4,8 @@ #include "content/browser/renderer_host/p2p/socket_host_tcp_server.h" +#include <utility> + #include "base/bind.h" #include "base/bind_helpers.h" #include "content/browser/renderer_host/p2p/socket_host_tcp.h" @@ -25,9 +27,8 @@ : P2PSocketHost(message_sender, socket_id, P2PSocketHost::TCP), client_type_(client_type), socket_(new net::TCPServerSocket(nullptr, net::NetLogSource())), - accept_callback_(base::Bind(&P2PSocketHostTcpServer::OnAccepted, - base::Unretained(this))) { -} + accept_callback_(base::BindRepeating(&P2PSocketHostTcpServer::OnAccepted, + base::Unretained(this))) {} P2PSocketHostTcpServer::~P2PSocketHostTcpServer() { if (state_ == STATE_OPEN) {
diff --git a/content/browser/renderer_host/p2p/socket_host_tcp_server.h b/content/browser/renderer_host/p2p/socket_host_tcp_server.h index 9b24946..5c7b5c9 100644 --- a/content/browser/renderer_host/p2p/socket_host_tcp_server.h +++ b/content/browser/renderer_host/p2p/socket_host_tcp_server.h
@@ -17,7 +17,7 @@ #include "content/common/content_export.h" #include "content/common/p2p_socket_type.h" #include "ipc/ipc_sender.h" -#include "net/base/completion_callback.h" +#include "net/base/completion_repeating_callback.h" #include "net/socket/tcp_server_socket.h" #include "net/traffic_annotation/network_traffic_annotation.h" @@ -68,7 +68,7 @@ std::map<net::IPEndPoint, std::unique_ptr<net::StreamSocket>> accepted_sockets_; - net::CompletionCallback accept_callback_; + const net::CompletionRepeatingCallback accept_callback_; DISALLOW_COPY_AND_ASSIGN(P2PSocketHostTcpServer); };
diff --git a/content/browser/renderer_host/p2p/socket_host_tcp_server_unittest.cc b/content/browser/renderer_host/p2p/socket_host_tcp_server_unittest.cc index ca1ea461..e2c2443 100644 --- a/content/browser/renderer_host/p2p/socket_host_tcp_server_unittest.cc +++ b/content/browser/renderer_host/p2p/socket_host_tcp_server_unittest.cc
@@ -7,10 +7,11 @@ #include <stdint.h> #include <list> +#include <utility> #include "content/browser/renderer_host/p2p/socket_host_tcp.h" #include "content/browser/renderer_host/p2p/socket_host_test_utils.h" -#include "net/base/completion_callback.h" +#include "net/base/completion_once_callback.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -35,12 +36,7 @@ accept_socket_->reset(socket); accept_socket_ = nullptr; - // This copy is necessary because this implementation of ServerSocket - // bases logic on the null-ness of |accept_callback_| in the bound - // callback. - net::CompletionCallback cb = accept_callback_; - accept_callback_.Reset(); - std::move(cb).Run(net::OK); + std::move(accept_callback_).Run(net::OK); } else { incoming_sockets_.push_back(socket); } @@ -58,7 +54,7 @@ } int Accept(std::unique_ptr<net::StreamSocket>* socket, - const net::CompletionCallback& callback) override { + net::CompletionOnceCallback callback) override { DCHECK(socket); if (!incoming_sockets_.empty()) { socket->reset(incoming_sockets_.front()); @@ -66,7 +62,7 @@ return net::OK; } else { accept_socket_ = socket; - accept_callback_ = callback; + accept_callback_ = std::move(callback); return net::ERR_IO_PENDING; } } @@ -77,7 +73,7 @@ net::IPEndPoint local_address_; std::unique_ptr<net::StreamSocket>* accept_socket_; - net::CompletionCallback accept_callback_; + net::CompletionOnceCallback accept_callback_; std::list<net::StreamSocket*> incoming_sockets_; };
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 23f6b88..eef4e56 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -2035,7 +2035,8 @@ AddUIThreadInterface(registry.get(), base::Bind(&FieldTrialRecorder::Create)); - associated_interfaces_ = std::make_unique<AssociatedInterfaceRegistryImpl>(); + associated_interfaces_ = + std::make_unique<blink::AssociatedInterfaceRegistry>(); blink::AssociatedInterfaceRegistry* associated_registry = associated_interfaces_.get(); associated_registry->AddInterface(base::Bind( @@ -2104,7 +2105,7 @@ void RenderProcessHostImpl::GetRoute( int32_t routing_id, - mojom::AssociatedInterfaceProviderAssociatedRequest request) { + blink::mojom::AssociatedInterfaceProviderAssociatedRequest request) { DCHECK(request.is_pending()); associated_interface_provider_bindings_.AddBinding( this, std::move(request), routing_id); @@ -2112,7 +2113,7 @@ void RenderProcessHostImpl::GetAssociatedInterface( const std::string& name, - mojom::AssociatedInterfaceAssociatedRequest request) { + blink::mojom::AssociatedInterfaceAssociatedRequest request) { int32_t routing_id = associated_interface_provider_bindings_.dispatch_context(); IPC::Listener* listener = listeners_.Lookup(routing_id); @@ -3118,9 +3119,7 @@ const std::string& interface_name, mojo::ScopedInterfaceEndpointHandle handle) { if (associated_interfaces_ && - associated_interfaces_->CanBindRequest(interface_name)) { - associated_interfaces_->BindRequest(interface_name, std::move(handle)); - } else { + !associated_interfaces_->TryBindInterface(interface_name, &handle)) { LOG(ERROR) << "Request for unknown Channel-associated interface: " << interface_name; }
diff --git a/content/browser/renderer_host/render_process_host_impl.h b/content/browser/renderer_host/render_process_host_impl.h index 05b64a5..562e020 100644 --- a/content/browser/renderer_host/render_process_host_impl.h +++ b/content/browser/renderer_host/render_process_host_impl.h
@@ -31,7 +31,6 @@ #include "content/browser/renderer_host/embedded_frame_sink_provider_impl.h" #include "content/browser/renderer_host/frame_sink_provider_impl.h" #include "content/browser/renderer_host/media/renderer_audio_output_stream_factory_context_impl.h" -#include "content/common/associated_interface_registry_impl.h" #include "content/common/associated_interfaces.mojom.h" #include "content/common/child_control.mojom.h" #include "content/common/content_export.h" @@ -55,6 +54,8 @@ #include "services/service_manager/public/mojom/service.mojom.h" #include "services/ui/public/interfaces/gpu.mojom.h" #include "services/viz/public/interfaces/compositing/compositing_mode_watcher.mojom.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" +#include "third_party/blink/public/mojom/associated_interfaces/associated_interfaces.mojom.h" #include "third_party/blink/public/mojom/dom_storage/storage_partition_service.mojom.h" #include "ui/gfx/gpu_memory_buffer.h" #include "ui/gl/gpu_switching_observer.h" @@ -121,7 +122,7 @@ public ChildProcessLauncher::Client, public ui::GpuSwitchingObserver, public mojom::RouteProvider, - public mojom::AssociatedInterfaceProvider, + public blink::mojom::AssociatedInterfaceProvider, public mojom::RendererHost { public: // Special depth used when there are no PriorityClients. @@ -462,14 +463,14 @@ void RegisterMojoInterfaces(); // mojom::RouteProvider: - void GetRoute( - int32_t routing_id, - mojom::AssociatedInterfaceProviderAssociatedRequest request) override; + void GetRoute(int32_t routing_id, + blink::mojom::AssociatedInterfaceProviderAssociatedRequest + request) override; - // mojom::AssociatedInterfaceProvider: + // blink::mojom::AssociatedInterfaceProvider: void GetAssociatedInterface( const std::string& name, - mojom::AssociatedInterfaceAssociatedRequest request) override; + blink::mojom::AssociatedInterfaceAssociatedRequest request) override; // mojom::RendererHost using BrowserHistogramCallback = @@ -647,10 +648,10 @@ // Mojo interfaces provided to the child process are registered here if they // need consistent delivery ordering with legacy IPC, and are process-wide in // nature (e.g. metrics, memory usage). - std::unique_ptr<AssociatedInterfaceRegistryImpl> associated_interfaces_; + std::unique_ptr<blink::AssociatedInterfaceRegistry> associated_interfaces_; mojo::AssociatedBinding<mojom::RouteProvider> route_provider_binding_; - mojo::AssociatedBindingSet<mojom::AssociatedInterfaceProvider, int32_t> + mojo::AssociatedBindingSet<blink::mojom::AssociatedInterfaceProvider, int32_t> associated_interface_provider_bindings_; // These fields are cached values that are updated in
diff --git a/content/browser/service_manager/service_manager_context.cc b/content/browser/service_manager/service_manager_context.cc index 7833cf07..8db80531 100644 --- a/content/browser/service_manager/service_manager_context.cc +++ b/content/browser/service_manager/service_manager_context.cc
@@ -721,7 +721,7 @@ auto iter = g_active_process_groups.Get().find(process_group_name); if (iter == g_active_process_groups.Get().end() || !iter->second) return false; - return iter->second->GetData().handle != base::kNullProcessHandle; + return iter->second->GetData().IsHandleValid(); } // static
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index ccde2311..904109b0 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc
@@ -572,11 +572,8 @@ #endif // !defined(OS_ANDROID) #if defined(OS_ANDROID) - if (base::FeatureList::IsEnabled(features::kDisplayCutoutAPI)) { - display_cutout_host_impl_ = std::make_unique<DisplayCutoutHostImpl>( - this, base::BindRepeating(&WebContentsImpl::NotifyViewportFitChanged, - base::Unretained(this))); - } + if (base::FeatureList::IsEnabled(features::kDisplayCutoutAPI)) + display_cutout_host_impl_ = std::make_unique<DisplayCutoutHostImpl>(this); #endif registry_.AddInterface(base::BindRepeating( @@ -684,6 +681,9 @@ for (auto& observer : observers_) observer.WebContentsDestroyed(); + if (display_cutout_host_impl_) + display_cutout_host_impl_->WebContentsDestroyed(); + for (auto& observer : observers_) observer.ResetWebContents(); @@ -2330,6 +2330,9 @@ observer.DidToggleFullscreenModeForTab(IsFullscreenForCurrentTab(), will_cause_resize); } + + if (display_cutout_host_impl_) + display_cutout_host_impl_->DidExitFullscreen(); } void WebContentsImpl::FullscreenStateChanged(RenderFrameHost* rfh, @@ -2394,6 +2397,9 @@ for (auto& observer : observers_) observer.DidAcquireFullscreen(max_depth_rfh); + + if (display_cutout_host_impl_) + display_cutout_host_impl_->DidAcquireFullscreen(max_depth_rfh); } else if (fullscreen_frame_tree_nodes_.size() == 0) { current_fullscreen_frame_tree_node_id_ = RenderFrameHost::kNoFrameTreeNodeId; @@ -4026,6 +4032,9 @@ "navigation_handle", navigation_handle); for (auto& observer : observers_) observer.DidStartNavigation(navigation_handle); + + if (display_cutout_host_impl_) + display_cutout_host_impl_->DidStartNavigation(navigation_handle); } void WebContentsImpl::DidRedirectNavigation( @@ -4093,6 +4102,9 @@ for (auto& observer : observers_) observer.DidFinishNavigation(navigation_handle); + if (display_cutout_host_impl_) + display_cutout_host_impl_->DidFinishNavigation(navigation_handle); + if (navigation_handle->HasCommitted()) { BrowserAccessibilityManager* manager = static_cast<RenderFrameHostImpl*>( @@ -4991,6 +5003,9 @@ observer.RenderFrameCreated(render_frame_host); UpdateAccessibilityModeOnFrame(render_frame_host); + if (display_cutout_host_impl_) + display_cutout_host_impl_->RenderFrameCreated(render_frame_host); + if (!render_frame_host->IsRenderFrameLive() || render_frame_host->GetParent()) return; @@ -5011,6 +5026,9 @@ pepper_playback_observer_->RenderFrameDeleted(render_frame_host); #endif + if (display_cutout_host_impl_) + display_cutout_host_impl_->RenderFrameDeleted(render_frame_host); + // Remove any fullscreen state that the frame has stored. FullscreenStateChanged(render_frame_host, false /* is_fullscreen */); }
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h index b3a9426..ad8f130 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h
@@ -968,6 +968,10 @@ void SetDisplayCutoutSafeArea(gfx::Insets insets); #endif + // Notify observers that the viewport fit value changed. This is called by + // |DisplayCutoutHostImpl|. + void NotifyViewportFitChanged(blink::mojom::ViewportFit value); + private: friend class WebContentsObserver; friend class WebContents; // To implement factory methods. @@ -1391,10 +1395,6 @@ AXTreeSnapshotCombiner* combiner, ui::AXMode ax_mode); - // Notify observers that the viewport fit value changed. This is called by - // |DisplayCutoutHostImpl|. - void NotifyViewportFitChanged(blink::mojom::ViewportFit value); - // Data for core operation --------------------------------------------------- // Delegate for notifying our owner about stuff. Not owned by us.
diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc index 53f41fc..408e3795 100644 --- a/content/child/child_thread_impl.cc +++ b/content/child/child_thread_impl.cc
@@ -844,14 +844,14 @@ void ChildThreadImpl::GetRoute( int32_t routing_id, - mojom::AssociatedInterfaceProviderAssociatedRequest request) { + blink::mojom::AssociatedInterfaceProviderAssociatedRequest request) { associated_interface_provider_bindings_.AddBinding( this, std::move(request), routing_id); } void ChildThreadImpl::GetAssociatedInterface( const std::string& name, - mojom::AssociatedInterfaceAssociatedRequest request) { + blink::mojom::AssociatedInterfaceAssociatedRequest request) { int32_t routing_id = associated_interface_provider_bindings_.dispatch_context(); Listener* route = router_.GetRoute(routing_id);
diff --git a/content/child/child_thread_impl.h b/content/child/child_thread_impl.h index d44813ed..3155e44 100644 --- a/content/child/child_thread_impl.h +++ b/content/child/child_thread_impl.h
@@ -32,6 +32,7 @@ #include "mojo/public/cpp/bindings/associated_binding.h" #include "mojo/public/cpp/bindings/associated_binding_set.h" #include "services/tracing/public/cpp/trace_event_agent.h" +#include "third_party/blink/public/mojom/associated_interfaces/associated_interfaces.mojom.h" #if defined(OS_WIN) #include "content/public/common/font_cache_win.mojom.h" @@ -63,7 +64,7 @@ private base::FieldTrialList::Observer, public ChildMemoryCoordinatorDelegate, public mojom::RouteProvider, - public mojom::AssociatedInterfaceProvider, + public blink::mojom::AssociatedInterfaceProvider, public mojom::ChildControl { public: struct CONTENT_EXPORT Options; @@ -209,14 +210,14 @@ void EnsureConnected(); // mojom::RouteProvider: - void GetRoute( - int32_t routing_id, - mojom::AssociatedInterfaceProviderAssociatedRequest request) override; + void GetRoute(int32_t routing_id, + blink::mojom::AssociatedInterfaceProviderAssociatedRequest + request) override; - // mojom::AssociatedInterfaceProvider: + // blink::mojom::AssociatedInterfaceProvider: void GetAssociatedInterface( const std::string& name, - mojom::AssociatedInterfaceAssociatedRequest request) override; + blink::mojom::AssociatedInterfaceAssociatedRequest request) override; #if defined(OS_WIN) mojom::FontCacheWin* GetFontCacheWin(); @@ -227,7 +228,7 @@ mojo::BindingSet<mojom::ChildControl> child_control_bindings_; mojo::AssociatedBinding<mojom::RouteProvider> route_provider_binding_; - mojo::AssociatedBindingSet<mojom::AssociatedInterfaceProvider, int32_t> + mojo::AssociatedBindingSet<blink::mojom::AssociatedInterfaceProvider, int32_t> associated_interface_provider_bindings_; mojom::RouteProviderAssociatedPtr remote_route_provider_; #if defined(OS_WIN)
diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn index cf983f0..d21b170 100644 --- a/content/common/BUILD.gn +++ b/content/common/BUILD.gn
@@ -49,10 +49,6 @@ "android/use_zoom_for_dsf_policy_android.cc", "appcache_interfaces.cc", "appcache_interfaces.h", - "associated_interface_provider_impl.cc", - "associated_interface_provider_impl.h", - "associated_interface_registry_impl.cc", - "associated_interface_registry_impl.h", "ax_content_node_data.cc", "ax_content_node_data.h", "background_fetch/background_fetch_struct_traits.cc",
diff --git a/content/common/associated_interface_provider_impl.h b/content/common/associated_interface_provider_impl.h deleted file mode 100644 index a46b657..0000000 --- a/content/common/associated_interface_provider_impl.h +++ /dev/null
@@ -1,61 +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 CONTENT_COMMON_ASSOCIATED_INTERFACE_PROVIDER_IMPL_H_ -#define CONTENT_COMMON_ASSOCIATED_INTERFACE_PROVIDER_IMPL_H_ - -#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" - -#include <stdint.h> -#include <memory> - -#include "base/macros.h" -#include "base/single_thread_task_runner.h" -#include "content/common/associated_interfaces.mojom.h" - -namespace content { - -class AssociatedInterfaceProviderImpl - : public blink::AssociatedInterfaceProvider { - public: - // Binds this to a remote mojom::AssociatedInterfaceProvider. - // - // |task_runner| must belong to the same thread. It will be used to dispatch - // all callbacks and connection error notification. - explicit AssociatedInterfaceProviderImpl( - mojom::AssociatedInterfaceProviderAssociatedPtr proxy, - scoped_refptr<base::SingleThreadTaskRunner> task_runner = nullptr); - - // Constructs a local provider with no remote interfaces. This is useful in - // conjunction with OverrideBinderForTesting(), in test environments where - // there may not be a remote |mojom::AssociatedInterfaceProvider| available. - // - // |task_runner| must belong to the same thread. It will be used to dispatch - // all callbacks and connection error notification. - explicit AssociatedInterfaceProviderImpl( - scoped_refptr<base::SingleThreadTaskRunner> task_runner); - ~AssociatedInterfaceProviderImpl() override; - - // AssociatedInterfaceProvider: - void GetInterface(const std::string& name, - mojo::ScopedInterfaceEndpointHandle handle) override; - void OverrideBinderForTesting( - const std::string& name, - const base::Callback<void(mojo::ScopedInterfaceEndpointHandle)>& binder) - override; - - private: - class LocalProvider; - - mojom::AssociatedInterfaceProviderAssociatedPtr proxy_; - - std::unique_ptr<LocalProvider> local_provider_; - scoped_refptr<base::SingleThreadTaskRunner> task_runner_; - - DISALLOW_COPY_AND_ASSIGN(AssociatedInterfaceProviderImpl); -}; - -} // namespace content - -#endif // CONTENT_COMMON_ASSOCIATED_INTERFACE_PROVIDER_IMPL_H_
diff --git a/content/common/associated_interface_registry_impl.cc b/content/common/associated_interface_registry_impl.cc deleted file mode 100644 index b10d08d2..0000000 --- a/content/common/associated_interface_registry_impl.cc +++ /dev/null
@@ -1,49 +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 "content/common/associated_interface_registry_impl.h" - -#include <utility> - -#include "base/logging.h" - -namespace content { - -AssociatedInterfaceRegistryImpl::AssociatedInterfaceRegistryImpl() - : weak_factory_(this) {} - -AssociatedInterfaceRegistryImpl::~AssociatedInterfaceRegistryImpl() {} - -bool AssociatedInterfaceRegistryImpl::CanBindRequest( - const std::string& interface_name) const { - return interfaces_.find(interface_name) != interfaces_.end(); -} - -void AssociatedInterfaceRegistryImpl::BindRequest( - const std::string& interface_name, - mojo::ScopedInterfaceEndpointHandle handle) { - auto it = interfaces_.find(interface_name); - if (it == interfaces_.end()) - return; - it->second.Run(std::move(handle)); -} - -void AssociatedInterfaceRegistryImpl::AddInterface(const std::string& name, - const Binder& binder) { - auto result = interfaces_.insert(std::make_pair(name, binder)); - DCHECK(result.second); -} - -void AssociatedInterfaceRegistryImpl::RemoveInterface(const std::string& name) { - auto it = interfaces_.find(name); - DCHECK(it != interfaces_.end()); - interfaces_.erase(it); -} - -base::WeakPtr<AssociatedInterfaceRegistryImpl> -AssociatedInterfaceRegistryImpl::GetWeakPtr() { - return weak_factory_.GetWeakPtr(); -} - -} // namespace content
diff --git a/content/common/associated_interface_registry_impl.h b/content/common/associated_interface_registry_impl.h deleted file mode 100644 index 4ee97c1b..0000000 --- a/content/common/associated_interface_registry_impl.h +++ /dev/null
@@ -1,43 +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 CONTENT_COMMON_ASSOCIATED_INTERFACE_REGISTRY_IMPL_H_ -#define CONTENT_COMMON_ASSOCIATED_INTERFACE_REGISTRY_IMPL_H_ - -#include <map> -#include <string> - -#include "base/macros.h" -#include "base/memory/weak_ptr.h" -#include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" -#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" - -namespace content { - -class AssociatedInterfaceRegistryImpl - : public blink::AssociatedInterfaceRegistry { - public: - AssociatedInterfaceRegistryImpl(); - ~AssociatedInterfaceRegistryImpl() override; - - bool CanBindRequest(const std::string& interface_name) const; - void BindRequest(const std::string& interface_name, - mojo::ScopedInterfaceEndpointHandle handle); - - // AssociatedInterfaceRegistry: - void AddInterface(const std::string& name, const Binder& binder) override; - void RemoveInterface(const std::string& name) override; - - base::WeakPtr<AssociatedInterfaceRegistryImpl> GetWeakPtr(); - - private: - std::map<std::string, Binder> interfaces_; - base::WeakPtrFactory<AssociatedInterfaceRegistryImpl> weak_factory_; - - DISALLOW_COPY_AND_ASSIGN(AssociatedInterfaceRegistryImpl); -}; - -} // namespace content - -#endif // CONTENT_COMMON_ASSOCIATED_INTERFACE_REGISTRY_IMPL_H_
diff --git a/content/common/associated_interfaces.mojom b/content/common/associated_interfaces.mojom index f6b871a..cc8bdcb 100644 --- a/content/common/associated_interfaces.mojom +++ b/content/common/associated_interfaces.mojom
@@ -4,18 +4,11 @@ module content.mojom; -// A generic, nominal interface to support transitional Channel-associated -// interfaces at or above the content layer. -interface AssociatedInterface {}; - -// Analogous to the generic InterfaceProvider interface, but for content -// AssociatedInterfaces. -interface AssociatedInterfaceProvider { - GetAssociatedInterface(string name, associated AssociatedInterface& request); -}; +import "third_party/blink/public/mojom/associated_interfaces/associated_interfaces.mojom"; // Implemented by anything which manages one or more routes, to map a routing // ID to an AssociatedInterfaceProvider. interface RouteProvider { - GetRoute(int32 routing_id, associated AssociatedInterfaceProvider& request); + GetRoute(int32 routing_id, + associated blink.mojom.AssociatedInterfaceProvider& request); };
diff --git a/content/common/content_param_traits.cc b/content/common/content_param_traits.cc index 450aaaf0..ad9a9821 100644 --- a/content/common/content_param_traits.cc +++ b/content/common/content_param_traits.cc
@@ -211,6 +211,11 @@ WriteParam(m, p->data.stack_trace_debugger_id_second); WriteParam(m, p->data.ports); WriteParam(m, p->data.has_user_gesture); + WriteParam(m, !!p->data.user_activation); + if (p->data.user_activation) { + WriteParam(m, p->data.user_activation->has_been_active); + WriteParam(m, p->data.user_activation->was_active); + } } bool ParamTraits< @@ -229,14 +234,27 @@ // returned message. (*r)->data.encoded_message = base::make_span(reinterpret_cast<const uint8_t*>(data), length); + bool has_activation = false; if (!ReadParam(m, iter, &(*r)->data.blobs) || !ReadParam(m, iter, &(*r)->data.stack_trace_id) || !ReadParam(m, iter, &(*r)->data.stack_trace_debugger_id_first) || !ReadParam(m, iter, &(*r)->data.stack_trace_debugger_id_second) || !ReadParam(m, iter, &(*r)->data.ports) || - !ReadParam(m, iter, &(*r)->data.has_user_gesture)) { + !ReadParam(m, iter, &(*r)->data.has_user_gesture) || + !ReadParam(m, iter, &has_activation)) { return false; } + + if (has_activation) { + bool has_been_active; + bool was_active; + if (!ReadParam(m, iter, &has_been_active) || + !ReadParam(m, iter, &was_active)) { + return false; + } + (*r)->data.user_activation = + blink::mojom::UserActivationSnapshot::New(has_been_active, was_active); + } return true; }
diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc index aa8847f9..fdcef72 100644 --- a/content/gpu/gpu_child_thread.cc +++ b/content/gpu/gpu_child_thread.cc
@@ -251,9 +251,7 @@ void GpuChildThread::OnAssociatedInterfaceRequest( const std::string& name, mojo::ScopedInterfaceEndpointHandle handle) { - if (associated_interfaces_.CanBindRequest(name)) - associated_interfaces_.BindRequest(name, std::move(handle)); - else + if (!associated_interfaces_.TryBindInterface(name, &handle)) ChildThreadImpl::OnAssociatedInterfaceRequest(name, std::move(handle)); }
diff --git a/content/gpu/gpu_child_thread.h b/content/gpu/gpu_child_thread.h index 6e0481e..e3b0094 100644 --- a/content/gpu/gpu_child_thread.h +++ b/content/gpu/gpu_child_thread.h
@@ -22,7 +22,6 @@ #include "components/viz/service/gl/gpu_service_impl.h" #include "components/viz/service/main/viz_main_impl.h" #include "content/child/child_thread_impl.h" -#include "content/common/associated_interface_registry_impl.h" #include "gpu/config/gpu_feature_info.h" #include "gpu/config/gpu_info.h" #include "gpu/config/gpu_preferences.h" @@ -37,6 +36,7 @@ #include "services/service_manager/public/cpp/service_context_ref.h" #include "services/service_manager/public/mojom/service_factory.mojom.h" #include "services/viz/privileged/interfaces/viz_main.mojom.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" #include "ui/gfx/native_widget_types.h" namespace content { @@ -108,7 +108,7 @@ mojo::BindingSet<service_manager::mojom::ServiceFactory> service_factory_bindings_; - AssociatedInterfaceRegistryImpl associated_interfaces_; + blink::AssociatedInterfaceRegistry associated_interfaces_; // Holds a closure that releases pending interface requests on the IO thread. base::Closure release_pending_requests_closure_;
diff --git a/content/public/browser/BUILD.gn b/content/public/browser/BUILD.gn index 6173906c..f550de4 100644 --- a/content/public/browser/BUILD.gn +++ b/content/public/browser/BUILD.gn
@@ -87,6 +87,7 @@ "cache_storage_usage_info.h", "cdm_registry.h", "certificate_request_result_type.h", + "child_process_data.cc", "child_process_data.h", "child_process_launcher_utils.h", "child_process_security_policy.h",
diff --git a/content/public/browser/child_process_data.cc b/content/public/browser/child_process_data.cc new file mode 100644 index 0000000..f536482 --- /dev/null +++ b/content/public/browser/child_process_data.cc
@@ -0,0 +1,60 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/public/browser/child_process_data.h" + +#if defined(OS_WIN) +#include <Windows.h> +#endif + +namespace content { + +#if defined(OS_WIN) +void ChildProcessData::SetHandle(base::ProcessHandle process) { + HANDLE handle_to_set; + if (process == base::kNullProcessHandle) { + handle_to_set = base::kNullProcessHandle; + } else { + BOOL result = + ::DuplicateHandle(::GetCurrentProcess(), process, ::GetCurrentProcess(), + &handle_to_set, PROCESS_QUERY_INFORMATION, FALSE, 0); + auto err = GetLastError(); + CHECK(result) << process << " " << err; + } + handle_ = base::win::ScopedHandle(handle_to_set); +} +#endif + +ChildProcessData::ChildProcessData(int process_type) + : process_type(process_type), id(0), handle_(base::kNullProcessHandle) {} + +ChildProcessData::ChildProcessData(ChildProcessData&& rhs) + : process_type(rhs.process_type), + name(rhs.name), + metrics_name(rhs.metrics_name), + id(rhs.id) { +#if defined(OS_WIN) + handle_.Set(rhs.handle_.Take()); +#else + handle_ = rhs.handle_; + rhs.handle_ = base::kNullProcessHandle; +#endif +} + +ChildProcessData::~ChildProcessData() {} + +ChildProcessData ChildProcessData::Duplicate() const { + ChildProcessData result(process_type); + result.name = name; + result.metrics_name = metrics_name; + result.id = id; +#if defined(OS_WIN) + result.SetHandle(handle_.Get()); +#else + result.SetHandle(handle_); +#endif + return result; +} + +} // namespace content
diff --git a/content/public/browser/child_process_data.h b/content/public/browser/child_process_data.h index 887d06dd..3e8d6760 100644 --- a/content/public/browser/child_process_data.h +++ b/content/public/browser/child_process_data.h
@@ -7,12 +7,17 @@ #include "base/process/process.h" #include "base/strings/string16.h" +#include "build/build_config.h" #include "content/common/content_export.h" +#if defined(OS_WIN) +#include "base/win/scoped_handle.h" +#endif + namespace content { // Holds information about a child process. -struct ChildProcessData { +struct CONTENT_EXPORT ChildProcessData { // The type of the process. See the content::ProcessType enum for the // well-known process types. int process_type; @@ -29,15 +34,37 @@ // one run of the browser. int id; - // The handle to the process. May have value kNullProcessHandle if no process - // exists - either because it hasn't been started yet or it's running in the - // current process. - base::ProcessHandle handle; +#if defined(OS_WIN) + base::ProcessHandle GetHandle() const { return handle_.Get(); } + // Will duplicate the handle and assume ownership of the duplicate. + void SetHandle(base::ProcessHandle process); +#else + base::ProcessHandle GetHandle() const { return handle_; } + void SetHandle(base::ProcessHandle process) { handle_ = process; } +#endif - explicit ChildProcessData(int process_type) - : process_type(process_type), - id(0), - handle(base::kNullProcessHandle) {} + bool IsHandleValid() const { return GetHandle() != base::kNullProcessHandle; } + + explicit ChildProcessData(int process_type); + ~ChildProcessData(); + + ChildProcessData(ChildProcessData&& rhs); + + // Copying these objects requires duplicating the handle which is moderately + // expensive, so make it an explicit action. + ChildProcessData Duplicate() const; + + private: +// The handle to the process. May have value kNullProcessHandle if no process +// exists - either because it hasn't been started yet or it's running in the +// current process. +#if defined(OS_WIN) + // Must be a scoped handle on Windows holding a duplicated handle or else + // there are no guarantees the handle will still be valid when used. + base::win::ScopedHandle handle_; +#else + base::ProcessHandle handle_; +#endif }; } // namespace content
diff --git a/content/public/renderer/render_frame_observer.cc b/content/public/renderer/render_frame_observer.cc index 6b7909b4..556e5ee 100644 --- a/content/public/renderer/render_frame_observer.cc +++ b/content/public/renderer/render_frame_observer.cc
@@ -29,6 +29,12 @@ } } +bool RenderFrameObserver::OnAssociatedInterfaceRequestForFrame( + const std::string& interface_name, + mojo::ScopedInterfaceEndpointHandle* handle) { + return false; +} + bool RenderFrameObserver::OnMessageReceived(const IPC::Message& message) { return false; }
diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h index 2f1f460..88efca34 100644 --- a/content/public/renderer/render_frame_observer.h +++ b/content/public/renderer/render_frame_observer.h
@@ -14,6 +14,7 @@ #include "content/public/common/resource_type.h" #include "ipc/ipc_listener.h" #include "ipc/ipc_sender.h" +#include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" #include "mojo/public/cpp/system/message_pipe.h" #include "third_party/blink/public/platform/web_client_hints_types.mojom.h" #include "third_party/blink/public/platform/web_feature.mojom.h" @@ -169,6 +170,14 @@ const std::string& interface_name, mojo::ScopedMessagePipeHandle* interface_pipe) {} + // Similar to above but for handling Channel-associated interface requests. + // Returns |true| if the request is handled by the implementation (taking + // ownership of |*handle|) and |false| otherwise (leaving |*handle| + // unmodified). + virtual bool OnAssociatedInterfaceRequestForFrame( + const std::string& interface_name, + mojo::ScopedInterfaceEndpointHandle* handle); + // IPC::Listener implementation. bool OnMessageReceived(const IPC::Message& message) override;
diff --git a/content/renderer/loader/resource_dispatcher.cc b/content/renderer/loader/resource_dispatcher.cc index 3d5bd290..dbff474 100644 --- a/content/renderer/loader/resource_dispatcher.cc +++ b/content/renderer/loader/resource_dispatcher.cc
@@ -275,6 +275,18 @@ &renderer_response_info); request_info->load_timing_info = renderer_response_info.load_timing; + if (renderer_response_info.network_accessed) { + if (request_info->resource_type == RESOURCE_TYPE_MAIN_FRAME) { + UMA_HISTOGRAM_ENUMERATION("Net.ConnectionInfo.MainFrame", + renderer_response_info.connection_info, + net::HttpResponseInfo::NUM_OF_CONNECTION_INFOS); + } else { + UMA_HISTOGRAM_ENUMERATION("Net.ConnectionInfo.SubResource", + renderer_response_info.connection_info, + net::HttpResponseInfo::NUM_OF_CONNECTION_INFOS); + } + } + network::ResourceResponseHead response_head; std::unique_ptr<NavigationResponseOverrideParameters> response_override = std::move(request_info->navigation_response_override);
diff --git a/content/renderer/mojo/blink_interface_registry_impl.cc b/content/renderer/mojo/blink_interface_registry_impl.cc index 34113b8..36d10c45 100644 --- a/content/renderer/mojo/blink_interface_registry_impl.cc +++ b/content/renderer/mojo/blink_interface_registry_impl.cc
@@ -13,7 +13,7 @@ BlinkInterfaceRegistryImpl::BlinkInterfaceRegistryImpl( base::WeakPtr<service_manager::BinderRegistry> interface_registry, - base::WeakPtr<AssociatedInterfaceRegistryImpl> + base::WeakPtr<blink::AssociatedInterfaceRegistry> associated_interface_registry) : interface_registry_(interface_registry), associated_interface_registry_(associated_interface_registry) {}
diff --git a/content/renderer/mojo/blink_interface_registry_impl.h b/content/renderer/mojo/blink_interface_registry_impl.h index fbee923..4a5c0d35 100644 --- a/content/renderer/mojo/blink_interface_registry_impl.h +++ b/content/renderer/mojo/blink_interface_registry_impl.h
@@ -8,8 +8,8 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/single_thread_task_runner.h" -#include "content/common/associated_interface_registry_impl.h" #include "services/service_manager/public/cpp/binder_registry.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" #include "third_party/blink/public/platform/interface_registry.h" namespace content { @@ -18,7 +18,7 @@ public: BlinkInterfaceRegistryImpl( base::WeakPtr<service_manager::BinderRegistry> interface_registry, - base::WeakPtr<AssociatedInterfaceRegistryImpl> + base::WeakPtr<blink::AssociatedInterfaceRegistry> associated_interface_registry); ~BlinkInterfaceRegistryImpl(); @@ -33,7 +33,7 @@ private: const base::WeakPtr<service_manager::BinderRegistry> interface_registry_; - const base::WeakPtr<AssociatedInterfaceRegistryImpl> + const base::WeakPtr<blink::AssociatedInterfaceRegistry> associated_interface_registry_; DISALLOW_COPY_AND_ASSIGN(BlinkInterfaceRegistryImpl);
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index 1d1d155..4562cbbd59 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc
@@ -46,7 +46,6 @@ #include "build/build_config.h" #include "cc/base/switches.h" #include "content/common/accessibility_messages.h" -#include "content/common/associated_interface_provider_impl.h" #include "content/common/associated_interfaces.mojom.h" #include "content/common/content_constants_internal.h" #include "content/common/content_security_policy/content_security_policy.h" @@ -1964,7 +1963,14 @@ void RenderFrameImpl::OnAssociatedInterfaceRequest( const std::string& interface_name, mojo::ScopedInterfaceEndpointHandle handle) { - associated_interfaces_.BindRequest(interface_name, std::move(handle)); + if (!associated_interfaces_.TryBindInterface(interface_name, &handle)) { + for (auto& observer : observers_) { + if (observer.OnAssociatedInterfaceRequestForFrame(interface_name, + &handle)) { + return; + } + } + } } void RenderFrameImpl::BindEngagement( @@ -2889,17 +2895,19 @@ if (!remote_associated_interfaces_) { ChildThreadImpl* thread = ChildThreadImpl::current(); if (thread) { - mojom::AssociatedInterfaceProviderAssociatedPtr remote_interfaces; + blink::mojom::AssociatedInterfaceProviderAssociatedPtr remote_interfaces; thread->GetRemoteRouteProvider()->GetRoute( routing_id_, mojo::MakeRequest(&remote_interfaces)); - remote_associated_interfaces_.reset(new AssociatedInterfaceProviderImpl( - std::move(remote_interfaces), - GetTaskRunner(blink::TaskType::kInternalIPC))); + remote_associated_interfaces_ = + std::make_unique<blink::AssociatedInterfaceProvider>( + std::move(remote_interfaces), + GetTaskRunner(blink::TaskType::kInternalIPC)); } else { // In some tests the thread may be null, // so set up a self-contained interface provider instead. - remote_associated_interfaces_.reset(new AssociatedInterfaceProviderImpl( - GetTaskRunner(blink::TaskType::kInternalIPC))); + remote_associated_interfaces_ = + std::make_unique<blink::AssociatedInterfaceProvider>( + GetTaskRunner(blink::TaskType::kInternalIPC)); } } return remote_associated_interfaces_.get();
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h index 44ae01c63..c3574fec 100644 --- a/content/renderer/render_frame_impl.h +++ b/content/renderer/render_frame_impl.h
@@ -29,7 +29,6 @@ #include "base/single_thread_task_runner.h" #include "base/unguessable_token.h" #include "build/build_config.h" -#include "content/common/associated_interface_registry_impl.h" #include "content/common/buildflags.h" #include "content/common/download/mhtml_save_status.h" #include "content/common/frame.mojom.h" @@ -71,6 +70,8 @@ #include "services/service_manager/public/cpp/interface_provider.h" #include "services/service_manager/public/mojom/connector.mojom.h" #include "services/service_manager/public/mojom/interface_provider.mojom.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" #include "third_party/blink/public/common/feature_policy/feature_policy.h" #include "third_party/blink/public/mojom/manifest/manifest_manager.mojom.h" #include "third_party/blink/public/mojom/page/page_visibility_state.mojom.h" @@ -150,7 +151,6 @@ namespace content { -class AssociatedInterfaceProviderImpl; class BlinkInterfaceRegistryImpl; class CompositorDependencies; class ExternalPopupMenu; @@ -1564,8 +1564,8 @@ // Creates various media clients. MediaFactory media_factory_; - AssociatedInterfaceRegistryImpl associated_interfaces_; - std::unique_ptr<AssociatedInterfaceProviderImpl> + blink::AssociatedInterfaceRegistry associated_interfaces_; + std::unique_ptr<blink::AssociatedInterfaceProvider> remote_associated_interfaces_; // TODO(dcheng): Remove these members.
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index ace2680..1f10000 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc
@@ -1570,9 +1570,7 @@ void RenderThreadImpl::OnAssociatedInterfaceRequest( const std::string& name, mojo::ScopedInterfaceEndpointHandle handle) { - if (associated_interfaces_.CanBindRequest(name)) - associated_interfaces_.BindRequest(name, std::move(handle)); - else + if (!associated_interfaces_.TryBindInterface(name, &handle)) ChildThreadImpl::OnAssociatedInterfaceRequest(name, std::move(handle)); }
diff --git a/content/renderer/render_thread_impl.h b/content/renderer/render_thread_impl.h index 4ee9778..f69aed6 100644 --- a/content/renderer/render_thread_impl.h +++ b/content/renderer/render_thread_impl.h
@@ -30,7 +30,6 @@ #include "build/build_config.h" #include "content/child/child_thread_impl.h" #include "content/child/memory/child_memory_coordinator_impl.h" -#include "content/common/associated_interface_registry_impl.h" #include "content/common/content_export.h" #include "content/common/frame.mojom.h" #include "content/common/frame_replication_state.h" @@ -58,6 +57,7 @@ #include "services/service_manager/public/cpp/bind_source_info.h" #include "services/service_manager/public/cpp/binder_registry.h" #include "services/viz/public/interfaces/compositing/compositing_mode_watcher.mojom.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" #include "third_party/blink/public/mojom/dom_storage/storage_partition_service.mojom.h" #include "third_party/blink/public/platform/scheduler/web_rail_mode_observer.h" #include "third_party/blink/public/platform/web_connection_type.h" @@ -782,7 +782,7 @@ blink::mojom::StoragePartitionServicePtr storage_partition_service_; mojom::RendererHostAssociatedPtr renderer_host_; - AssociatedInterfaceRegistryImpl associated_interfaces_; + blink::AssociatedInterfaceRegistry associated_interfaces_; mojo::AssociatedBinding<mojom::Renderer> renderer_binding_;
diff --git a/content/shell/test_runner/test_runner.cc b/content/shell/test_runner/test_runner.cc index 2ecbe903..b4390b7 100644 --- a/content/shell/test_runner/test_runner.cc +++ b/content/shell/test_runner/test_runner.cc
@@ -88,6 +88,53 @@ return 1.f; } +void ConvertAndSet(gin::Arguments* args, int* set_param) { + v8::Local<v8::Value> value = args->PeekNext(); + v8::Maybe<int> result = value->Int32Value(args->GetHolderCreationContext()); + + if (result.IsNothing()) { + // Skip so the error is thrown for the correct argument as PeekNext doesn't + // update the current argument pointer. + args->Skip(); + args->ThrowError(); + return; + } + + *set_param = result.ToChecked(); +} + +void ConvertAndSet(gin::Arguments* args, bool* set_param) { + v8::Local<v8::Value> value = args->PeekNext(); + v8::Maybe<bool> result = + value->BooleanValue(args->GetHolderCreationContext()); + + if (result.IsNothing()) { + // Skip so the error is thrown for the correct argument as PeekNext doesn't + // update the current argument pointer. + args->Skip(); + args->ThrowError(); + return; + } + + *set_param = result.ToChecked(); +} + +void ConvertAndSet(gin::Arguments* args, blink::WebString* set_param) { + v8::Local<v8::Value> value = args->PeekNext(); + v8::MaybeLocal<v8::String> result = + value->ToString(args->GetHolderCreationContext()); + + if (result.IsEmpty()) { + // Skip so the error is thrown for the correct argument as PeekNext doesn't + // update the current argument pointer. + args->Skip(); + args->ThrowError(); + return; + } + + *set_param = V8StringToWebString(args->isolate(), result.ToLocalChecked()); +} + } // namespace class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> { @@ -2161,64 +2208,56 @@ } void TestRunner::OverridePreference(gin::Arguments* args) { - v8::Local<v8::Context> context = args->GetHolderCreationContext(); - std::string key; - CHECK(args->GetNext(&key)); + if (args->Length() != 2) { + args->ThrowTypeError("overridePreference expects 2 arguments"); + return; + } - v8::Local<v8::Value> value = args->PeekNext(); - CHECK(!value.IsEmpty()); + std::string key; + if (!args->GetNext(&key)) { + args->ThrowError(); + return; + } + TestPreferences* prefs = delegate_->Preferences(); if (key == "WebKitDefaultFontSize") { - prefs->default_font_size = value->Int32Value(context).ToChecked(); + ConvertAndSet(args, &prefs->default_font_size); } else if (key == "WebKitMinimumFontSize") { - prefs->minimum_font_size = value->Int32Value(context).ToChecked(); + ConvertAndSet(args, &prefs->minimum_font_size); } else if (key == "WebKitDefaultTextEncodingName") { - v8::Isolate* isolate = blink::MainThreadIsolate(); - prefs->default_text_encoding_name = - V8StringToWebString(isolate, value->ToString(isolate)); + ConvertAndSet(args, &prefs->default_text_encoding_name); } else if (key == "WebKitJavaScriptEnabled") { - prefs->java_script_enabled = value->BooleanValue(context).ToChecked(); + ConvertAndSet(args, &prefs->java_script_enabled); } else if (key == "WebKitSupportsMultipleWindows") { - prefs->supports_multiple_windows = value->BooleanValue(context).ToChecked(); + ConvertAndSet(args, &prefs->supports_multiple_windows); } else if (key == "WebKitDisplayImagesKey") { - prefs->loads_images_automatically = - value->BooleanValue(context).ToChecked(); + ConvertAndSet(args, &prefs->loads_images_automatically); } else if (key == "WebKitPluginsEnabled") { - prefs->plugins_enabled = value->BooleanValue(context).ToChecked(); + ConvertAndSet(args, &prefs->plugins_enabled); } else if (key == "WebKitTabToLinksPreferenceKey") { - prefs->tabs_to_links = value->BooleanValue(context).ToChecked(); + ConvertAndSet(args, &prefs->tabs_to_links); } else if (key == "WebKitCSSGridLayoutEnabled") { - prefs->experimental_css_grid_layout_enabled = - value->BooleanValue(context).ToChecked(); + ConvertAndSet(args, &prefs->experimental_css_grid_layout_enabled); } else if (key == "WebKitHyperlinkAuditingEnabled") { - prefs->hyperlink_auditing_enabled = - value->BooleanValue(context).ToChecked(); + ConvertAndSet(args, &prefs->hyperlink_auditing_enabled); } else if (key == "WebKitEnableCaretBrowsing") { - prefs->caret_browsing_enabled = value->BooleanValue(context).ToChecked(); + ConvertAndSet(args, &prefs->caret_browsing_enabled); } else if (key == "WebKitAllowRunningInsecureContent") { - prefs->allow_running_of_insecure_content = - value->BooleanValue(context).ToChecked(); + ConvertAndSet(args, &prefs->allow_running_of_insecure_content); } else if (key == "WebKitDisableReadingFromCanvas") { - prefs->disable_reading_from_canvas = - value->BooleanValue(context).ToChecked(); + ConvertAndSet(args, &prefs->disable_reading_from_canvas); } else if (key == "WebKitStrictMixedContentChecking") { - prefs->strict_mixed_content_checking = - value->BooleanValue(context).ToChecked(); + ConvertAndSet(args, &prefs->strict_mixed_content_checking); } else if (key == "WebKitStrictPowerfulFeatureRestrictions") { - prefs->strict_powerful_feature_restrictions = - value->BooleanValue(context).ToChecked(); + ConvertAndSet(args, &prefs->strict_powerful_feature_restrictions); } else if (key == "WebKitShouldRespectImageOrientation") { - prefs->should_respect_image_orientation = - value->BooleanValue(context).ToChecked(); + ConvertAndSet(args, &prefs->should_respect_image_orientation); } else if (key == "WebKitWebSecurityEnabled") { - prefs->web_security_enabled = value->BooleanValue(context).ToChecked(); + ConvertAndSet(args, &prefs->web_security_enabled); } else if (key == "WebKitSpatialNavigationEnabled") { - prefs->spatial_navigation_enabled = - value->BooleanValue(context).ToChecked(); + ConvertAndSet(args, &prefs->spatial_navigation_enabled); } else { - std::string message("Invalid name for preference: "); - message.append(key); - delegate_->PrintMessage(std::string("CONSOLE MESSAGE: ") + message + "\n"); + args->ThrowTypeError("Invalid name for preference: " + key); } delegate_->ApplyPreferences(); }
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index db6d5241..389cd6c 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -1903,7 +1903,6 @@ data_deps = [ "//components/services/filesystem:filesystem", - "//testing/buildbot/filters:content_unittests_filters", "//third_party/mesa:osmesa", ]
diff --git a/content/test/test_render_frame_host.cc b/content/test/test_render_frame_host.cc index 98a99a7..d155b82 100644 --- a/content/test/test_render_frame_host.cc +++ b/content/test/test_render_frame_host.cc
@@ -16,7 +16,6 @@ #include "content/browser/frame_host/navigator_impl.h" #include "content/browser/frame_host/render_frame_host_delegate.h" #include "content/browser/web_contents/web_contents_impl.h" -#include "content/common/associated_interface_provider_impl.h" #include "content/common/frame_messages.h" #include "content/common/frame_owner_properties.h" #include "content/public/browser/navigation_throttle.h" @@ -30,6 +29,7 @@ #include "mojo/public/cpp/bindings/interface_request.h" #include "net/base/load_flags.h" #include "net/http/http_response_headers.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" #include "third_party/blink/public/common/frame/frame_policy.h" #include "third_party/blink/public/platform/modules/bluetooth/web_bluetooth.mojom.h" #include "third_party/blink/public/platform/web_mixed_content_context_type.h"
diff --git a/docs/graphical_debugging_aid_chromium_views.md b/docs/graphical_debugging_aid_chromium_views.md index 1bdd52642..b36b5636 100644 --- a/docs/graphical_debugging_aid_chromium_views.md +++ b/docs/graphical_debugging_aid_chromium_views.md
@@ -7,7 +7,11 @@ 1. The function `views::PrintViewGraph()` (in the file `ui/views/debug_utils.h`), -1. a gdb script file `viewg.gdb` (see below), +1. a custom debugger command + - For GDB, use `tools/gdb/viewg.gdb` + - For LLDB, use `tools/lldb/lldb_viewg.py` + - For other debuggers, it should be relatively easy to adapt the + above scripts. 1. the graphViz package (http://www.graphviz.org/ - downloadable for Linux, Windows and Mac), and 1. an SVG viewer (_e.g._ Chrome). @@ -17,8 +21,11 @@ To use the tool, 1. Make sure you have 'dot' installed (part of graphViz), -1. run gdb on your build and -1. `source viewg.gdb` (this can be done automatically in `.gdbinit`), +1. run gdb/lldb on your build and + 1. For GDB `source tools/gdb/viewg.gdb` (this can be done automatically + in `.gdbinit`), + 1. For LLDB `command script import tools/lldb/lldb_viewg.py` (this can + be done automatically in `.lldbinit`), 1. stop at any breakpoint inside class `View` (or any derived class), and 1. type `viewg` at the gdb prompt. @@ -31,32 +38,10 @@ It is easy to modify the gdb script to generate PDF in case viewing with evince (or other PDF viewer) is preferred. -If you don't use gdb, you may be able to adapt the script to work with your -favorite debugger. The gdb script invokes +If you don't use gdb or lldb, you may be able to adapt the script to work with +your favorite debugger. The gdb script invokes views::PrintViewGraph(this) on the current object, returning `std::string`, whose contents must then be saved to a file in order to be processed by dot. - -## viewg.gdb - -``` -define viewg - if $argc != 0 - echo Usage: viewg - else - set pagination off - set print elements 0 - set logging off - set logging file ~/state.dot - set logging overwrite on - set logging redirect on - set logging on - printf "%s\n", view::PrintViewGraph(this).c_str() - set logging off - shell dot -Tsvg -o ~/state.svg ~/state.dot - set pagination on - end -end -```
diff --git a/docs/linux_build_instructions.md b/docs/linux_build_instructions.md index f7dc410..3fbfa37 100644 --- a/docs/linux_build_instructions.md +++ b/docs/linux_build_instructions.md
@@ -15,7 +15,7 @@ * A 64-bit Intel machine with at least 8GB of RAM. More than 16GB is highly recommended. * At least 100GB of free disk space. -* You must have Git and Python installed already. +* You must have Git and Python v2 installed already. Most development is done on Ubuntu (currently 14.04, Trusty Tahr). There are some instructions for other distros below, but they are mostly unsupported.
diff --git a/extensions/browser/extension_protocols.cc b/extensions/browser/extension_protocols.cc index 81819a7..50bde06 100644 --- a/extensions/browser/extension_protocols.cc +++ b/extensions/browser/extension_protocols.cc
@@ -123,7 +123,7 @@ int GetData(std::string* mime_type, std::string* charset, std::string* data, - const net::CompletionCallback& callback) const override { + net::CompletionOnceCallback callback) const override { GenerateBackgroundPageContents(extension_.get(), mime_type, charset, data); return net::OK; }
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater.mm index ced62780..fb0423a 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater.mm +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_updater.mm
@@ -336,9 +336,6 @@ for (NSInteger i = 0; i < numberOfItems; i++) { [oldItems addObject:[NSIndexPath indexPathForItem:i inSection:section]]; } - [self.collectionViewController - collectionView:self.collectionViewController.collectionView - willDeleteItemsAtIndexPaths:oldItems]; // Reset collection model data for |sectionIdentifier| [self.collectionViewController.collectionViewModel @@ -349,11 +346,30 @@ forSectionWithIdentifier:sectionIdentifier]; [self.sectionIdentifiersFromContentSuggestions removeObject:@(sectionIdentifier)]; - [self.collectionViewController.collectionViewModel - removeSectionWithIdentifier:sectionIdentifier]; - [self addSectionsForSectionInfoToModel:@[ sectionInfo ]]; - [self addSuggestionsToModel:[self.dataSource itemsForSectionInfo:sectionInfo] + + // Update the section and the other ones. + auto addSectionBlock = ^{ + [self.collectionViewController.collectionViewModel + removeSectionWithIdentifier:sectionIdentifier]; + [self.collectionViewController.collectionView + deleteSections:[NSIndexSet indexSetWithIndex:section]]; + + NSIndexSet* addedSections = + [self addSectionsForSectionInfoToModel:@[ sectionInfo ]]; + [self.collectionViewController.collectionView insertSections:addedSections]; + + NSArray<NSIndexPath*>* addedItems = [self + addSuggestionsToModel:[self.dataSource itemsForSectionInfo:sectionInfo] withSectionInfo:sectionInfo]; + [self.collectionViewController.collectionView + insertItemsAtIndexPaths:addedItems]; + }; + [self.collectionViewController.collectionView + performBatchUpdates:addSectionBlock + completion:nil]; + + // Make sure we get the right index for the section. + section = [model sectionForSectionIdentifier:sectionIdentifier]; [self.collectionViewController.collectionView reloadSections:[NSIndexSet indexSetWithIndex:section]];
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_egtest.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_egtest.mm index 66500a8..adef86e 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_egtest.mm +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_egtest.mm
@@ -794,8 +794,10 @@ // Check the tile is back. [[EarlGrey selectElementWithMatcher: - chrome_test_util::StaticTextWithAccessibilityLabel(pageTitle)] - assertWithMatcher:grey_sufficientlyVisible()]; + grey_allOf(chrome_test_util::StaticTextWithAccessibilityLabel( + pageTitle), + grey_sufficientlyVisible(), nil)] + assertWithMatcher:grey_notNil()]; } // Tests that the context menu has the correct actions.
diff --git a/ios/chrome/browser/ui/settings/BUILD.gn b/ios/chrome/browser/ui/settings/BUILD.gn index 8ac0e2d..96712f5 100644 --- a/ios/chrome/browser/ui/settings/BUILD.gn +++ b/ios/chrome/browser/ui/settings/BUILD.gn
@@ -42,6 +42,7 @@ "dataplan_usage_collection_view_controller.mm", "do_not_track_collection_view_controller.h", "do_not_track_collection_view_controller.mm", + "google_services_settings_command_handler.h", "google_services_settings_consumer.h", "google_services_settings_coordinator.h", "google_services_settings_coordinator.mm",
diff --git a/ios/chrome/browser/ui/settings/cells/sync_switch_item.h b/ios/chrome/browser/ui/settings/cells/sync_switch_item.h index ed7be424..224ebfe0 100644 --- a/ios/chrome/browser/ui/settings/cells/sync_switch_item.h +++ b/ios/chrome/browser/ui/settings/cells/sync_switch_item.h
@@ -28,6 +28,9 @@ // SyncSetupService::SyncableDatatype value for the item. @property(nonatomic, assign) NSInteger dataType; +// Command to trigger when the switch is toggled. The default value is 0. +@property(nonatomic, assign) NSInteger commandID; + @end // Cell representation for AccountSignInItem.
diff --git a/ios/chrome/browser/ui/settings/cells/sync_switch_item.mm b/ios/chrome/browser/ui/settings/cells/sync_switch_item.mm index ec9604a9..901e1e4 100644 --- a/ios/chrome/browser/ui/settings/cells/sync_switch_item.mm +++ b/ios/chrome/browser/ui/settings/cells/sync_switch_item.mm
@@ -38,6 +38,7 @@ @synthesize on = _on; @synthesize enabled = _enabled; @synthesize dataType = _dataType; +@synthesize commandID = _commandID; - (instancetype)initWithType:(NSInteger)type { self = [super initWithType:type];
diff --git a/ios/chrome/browser/ui/settings/google_services_settings_command_handler.h b/ios/chrome/browser/ui/settings/google_services_settings_command_handler.h new file mode 100644 index 0000000..c3c623b --- /dev/null +++ b/ios/chrome/browser/ui/settings/google_services_settings_command_handler.h
@@ -0,0 +1,80 @@ +// Copyright 2018 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 IOS_CHROME_BROWSER_UI_SETTINGS_GOOGLE_SERVICES_SETTINGS_COMMAND_HANDLER_H_ +#define IOS_CHROME_BROWSER_UI_SETTINGS_GOOGLE_SERVICES_SETTINGS_COMMAND_HANDLER_H_ + +// List of Google Services Settings commands. +typedef NS_ENUM(NSInteger, GoogleServicesSettingsCommandID) { + // Does nothing. + GoogleServicesSettingsCommandIDNoOp, + // Enabble/disable all the Google services. + GoogleServicesSettingsCommandIDToggleSyncEverything, + // Enable/disabble bookmark sync. + GoogleServicesSettingsCommandIDToggleBookmarkSync, + // Enable/disabble history sync. + GoogleServicesSettingsCommandIDToggleHistorySync, + // Enable/disabble passwords sync. + GoogleServicesSettingsCommandIDTogglePasswordsSync, + // Enable/disabble open tabs sync. + GoogleServicesSettingsCommandIDToggleOpenTabsSync, + // Enable/disabble autofill sync. + GoogleServicesSettingsCommandIDToggleAutofillSync, + // Enable/disabble settings sync. + GoogleServicesSettingsCommandIDToggleSettingsSync, + // Enable/disabble reading list sync. + GoogleServicesSettingsCommandIDToggleReadingListSync, + // Enable/disable activity and interactions service. + GoogleServicesSettingsCommandIDToggleActivityAndInteractionsService, + // Enable/disabble autocomplete searches service. + GoogleServicesSettingsCommandIDToggleAutocompleteSearchesService, + // Enable/disabble preload pages service. + GoogleServicesSettingsCommandIDTogglePreloadPagesService, + // Enable/disabble improve chrome service. + GoogleServicesSettingsCommandIDToggleImproveChromeService, + // Enable/disabble better search and browsing service. + GoogleServicesSettingsCommandIDToggleBetterSearchAndBrowsingService, +}; + +// Protocol to handle Google services settings commands. +@protocol GoogleServicesSettingsCommandHandler<NSObject> + +// Called when GoogleServicesSettingsCommandIDToggleSyncEverything is triggered. +- (void)toggleSyncEverythingWithValue:(BOOL)on; +// Called when GoogleServicesSettingsCommandIDToggleBookmarkSync is triggered. +- (void)toggleBookmarksSyncWithValue:(BOOL)on; +// Called when GoogleServicesSettingsCommandIDToggleHistorySync is triggered. +- (void)toggleHistorySyncWithValue:(BOOL)on; +// Called when GoogleServicesSettingsCommandIDTogglePasswordsSync is triggered. +- (void)togglePasswordsSyncWithValue:(BOOL)on; +// Called when GoogleServicesSettingsCommandIDToggleOpenTabsSync is triggered. +- (void)toggleOpenTabSyncWithValue:(BOOL)on; +// Called when GoogleServicesSettingsCommandIDToggleAutofillSync is triggered. +- (void)toggleAutofillWithValue:(BOOL)on; +// Called when GoogleServicesSettingsCommandIDToggleSettingsSync is triggered. +- (void)toggleSettingsWithValue:(BOOL)on; +// Called when GoogleServicesSettingsCommandIDToggleReadingListSync is +// triggered. +- (void)toggleReadingListWithValue:(BOOL)on; +// Called when +// GoogleServicesSettingsCommandIDToggleActivityAndInteractionsService is +// triggered. +- (void)toggleActivityAndInteractionsServiceWithValue:(BOOL)on; +// Called when GoogleServicesSettingsCommandIDToggleAutocompleteSearchesService +// is triggered. +- (void)toggleAutocompleteSearchesServiceWithValue:(BOOL)on; +// Called when GoogleServicesSettingsCommandIDTogglePreloadPagesService is +// triggered. +- (void)togglePreloadPagesServiceWithValue:(BOOL)on; +// Called when GoogleServicesSettingsCommandIDToggleImproveChromeService is +// triggered. +- (void)toggleImproveChromeServiceWithValue:(BOOL)on; +// Called when +// GoogleServicesSettingsCommandIDToggleBetterSearchAndBrowsingService is +// triggered. +- (void)toggleBetterSearchAndBrowsingServiceWithValue:(BOOL)on; + +@end + +#endif // IOS_CHROME_BROWSER_UI_SETTINGS_GOOGLE_SERVICES_SETTINGS_COMMAND_HANDLER_H_
diff --git a/ios/chrome/browser/ui/settings/google_services_settings_coordinator.mm b/ios/chrome/browser/ui/settings/google_services_settings_coordinator.mm index c87770c..c309ecdb 100644 --- a/ios/chrome/browser/ui/settings/google_services_settings_coordinator.mm +++ b/ios/chrome/browser/ui/settings/google_services_settings_coordinator.mm
@@ -41,6 +41,7 @@ self.mediator.authService = AuthenticationServiceFactory::GetForBrowserState(self.browserState); controller.modelDelegate = self.mediator; + controller.commandHandler = self.mediator; DCHECK(self.navigationController); [self.navigationController pushViewController:self.viewController animated:YES];
diff --git a/ios/chrome/browser/ui/settings/google_services_settings_mediator.h b/ios/chrome/browser/ui/settings/google_services_settings_mediator.h index 89e9f1a..b58219a 100644 --- a/ios/chrome/browser/ui/settings/google_services_settings_mediator.h +++ b/ios/chrome/browser/ui/settings/google_services_settings_mediator.h
@@ -7,6 +7,7 @@ #import <UIKit/UIKit.h> +#import "ios/chrome/browser/ui/settings/google_services_settings_command_handler.h" #import "ios/chrome/browser/ui/settings/google_services_settings_consumer.h" #import "ios/chrome/browser/ui/settings/google_services_settings_view_controller.h" #import "ios/chrome/browser/ui/settings/google_services_settings_view_controller_model_delegate.h" @@ -17,7 +18,8 @@ // Mediator for the Google services settings. @interface GoogleServicesSettingsMediator - : NSObject<GoogleServicesSettingsViewControllerModelDelegate> + : NSObject<GoogleServicesSettingsCommandHandler, + GoogleServicesSettingsViewControllerModelDelegate> // Designated initializer. |prefService| should not be null. - (instancetype)initWithPrefService:(PrefService*)prefService
diff --git a/ios/chrome/browser/ui/settings/google_services_settings_mediator.mm b/ios/chrome/browser/ui/settings/google_services_settings_mediator.mm index 26484ee..e59bb01 100644 --- a/ios/chrome/browser/ui/settings/google_services_settings_mediator.mm +++ b/ios/chrome/browser/ui/settings/google_services_settings_mediator.mm
@@ -107,6 +107,7 @@ item.text = GetNSString(IDS_IOS_GOOGLE_SERVICES_SETTINGS_SYNC_EVERYTHING); item.enabled = YES; item.on = [self isConsentGiven]; + item.commandID = GoogleServicesSettingsCommandIDToggleSyncEverything; return item; } @@ -166,6 +167,7 @@ [[SyncSwitchItem alloc] initWithType:SyncBookmarksItemType]; item.text = GetNSString(IDS_IOS_GOOGLE_SERVICES_SETTINGS_BOOKMARKS_TEXT); item.enabled = self.isAuthenticated; + item.commandID = GoogleServicesSettingsCommandIDToggleBookmarkSync; return item; } @@ -175,6 +177,7 @@ [[SyncSwitchItem alloc] initWithType:SyncHistoryItemType]; item.text = GetNSString(IDS_IOS_GOOGLE_SERVICES_SETTINGS_HISTORY_TEXT); item.enabled = self.isAuthenticated; + item.commandID = GoogleServicesSettingsCommandIDToggleHistorySync; return item; } @@ -184,6 +187,7 @@ [[SyncSwitchItem alloc] initWithType:SyncPasswordsItemType]; item.text = GetNSString(IDS_IOS_GOOGLE_SERVICES_SETTINGS_PASSWORD_TEXT); item.enabled = self.isAuthenticated; + item.commandID = GoogleServicesSettingsCommandIDTogglePasswordsSync; return item; } @@ -193,6 +197,7 @@ [[SyncSwitchItem alloc] initWithType:SyncOpenTabsItemType]; item.text = GetNSString(IDS_IOS_GOOGLE_SERVICES_SETTINGS_OPENTABS_TEXT); item.enabled = self.isAuthenticated; + item.commandID = GoogleServicesSettingsCommandIDToggleOpenTabsSync; return item; } @@ -202,6 +207,7 @@ [[SyncSwitchItem alloc] initWithType:SyncAutofillItemType]; item.text = GetNSString(IDS_IOS_GOOGLE_SERVICES_SETTINGS_AUTOFILL_TEXT); item.enabled = self.isAuthenticated; + item.commandID = GoogleServicesSettingsCommandIDToggleAutofillSync; return item; } @@ -211,6 +217,7 @@ [[SyncSwitchItem alloc] initWithType:SyncReadingListItemType]; item.text = GetNSString(IDS_IOS_GOOGLE_SERVICES_SETTINGS_READING_LIST_TEXT); item.enabled = self.isAuthenticated; + item.commandID = GoogleServicesSettingsCommandIDToggleReadingListSync; return item; } @@ -223,6 +230,8 @@ item.detailText = GetNSString( IDS_IOS_GOOGLE_SERVICES_SETTINGS_ACTIVITY_AND_INTERACTIONS_DETAIL); item.enabled = self.isAuthenticated; + item.commandID = + GoogleServicesSettingsCommandIDToggleActivityAndInteractionsService; return item; } @@ -311,6 +320,8 @@ IDS_IOS_GOOGLE_SERVICES_SETTINGS_AUTOCOMPLETE_SEARCHES_AND_URLS_TEXT); item.detailText = GetNSString( IDS_IOS_GOOGLE_SERVICES_SETTINGS_AUTOCOMPLETE_SEARCHES_AND_URLS_DETAIL); + item.commandID = + GoogleServicesSettingsCommandIDToggleAutocompleteSearchesService; item.enabled = YES; return item; } @@ -323,6 +334,7 @@ item.detailText = GetNSString(IDS_IOS_GOOGLE_SERVICES_SETTINGS_PRELOAD_PAGES_DETAIL); item.enabled = YES; + item.commandID = GoogleServicesSettingsCommandIDTogglePreloadPagesService; return item; } @@ -334,6 +346,7 @@ item.detailText = GetNSString(IDS_IOS_GOOGLE_SERVICES_SETTINGS_IMPROVE_CHROME_DETAIL); item.enabled = YES; + item.commandID = GoogleServicesSettingsCommandIDToggleImproveChromeService; return item; } @@ -346,6 +359,8 @@ item.detailText = GetNSString( IDS_IOS_GOOGLE_SERVICES_SETTINGS_BETTER_SEARCH_AND_BROWSING_DETAIL); item.enabled = YES; + item.commandID = + GoogleServicesSettingsCommandIDToggleBetterSearchAndBrowsingService; return item; } @@ -372,4 +387,58 @@ [self loadNonPersonalizedSection]; } +#pragma mark - GoogleServicesSettingsCommandHandler + +- (void)toggleSyncEverythingWithValue:(BOOL)on { + // Needs to be implemented. +} + +- (void)toggleBookmarksSyncWithValue:(BOOL)on { + // Needs to be implemented. +} + +- (void)toggleHistorySyncWithValue:(BOOL)on { + // Needs to be implemented. +} + +- (void)togglePasswordsSyncWithValue:(BOOL)on { + // Needs to be implemented. +} + +- (void)toggleOpenTabSyncWithValue:(BOOL)on { + // Needs to be implemented. +} + +- (void)toggleAutofillWithValue:(BOOL)on { + // Needs to be implemented. +} + +- (void)toggleSettingsWithValue:(BOOL)on { + // Needs to be implemented. +} + +- (void)toggleReadingListWithValue:(BOOL)on { + // Needs to be implemented. +} + +- (void)toggleActivityAndInteractionsServiceWithValue:(BOOL)on { + // Needs to be implemented. +} + +- (void)toggleAutocompleteSearchesServiceWithValue:(BOOL)on { + // Needs to be implemented. +} + +- (void)togglePreloadPagesServiceWithValue:(BOOL)on { + // Needs to be implemented. +} + +- (void)toggleImproveChromeServiceWithValue:(BOOL)on { + // Needs to be implemented. +} + +- (void)toggleBetterSearchAndBrowsingServiceWithValue:(BOOL)on { + // Needs to be implemented. +} + @end
diff --git a/ios/chrome/browser/ui/settings/google_services_settings_view_controller.h b/ios/chrome/browser/ui/settings/google_services_settings_view_controller.h index 94a9ab1..0b86104 100644 --- a/ios/chrome/browser/ui/settings/google_services_settings_view_controller.h +++ b/ios/chrome/browser/ui/settings/google_services_settings_view_controller.h
@@ -10,6 +10,7 @@ #import "ios/chrome/browser/ui/settings/google_services_settings_consumer.h" @class GoogleServicesSettingsViewController; +@protocol GoogleServicesSettingsCommandHandler; @protocol GoogleServicesSettingsViewControllerModelDelegate; // Delegate for presentation events related to @@ -34,6 +35,10 @@ @property(nonatomic, weak) id<GoogleServicesSettingsViewControllerModelDelegate> modelDelegate; +// Handler for GoogleServicesSettingsCommand. +@property(nonatomic, weak) id<GoogleServicesSettingsCommandHandler> + commandHandler; + @end #endif // IOS_CHROME_BROWSER_UI_SETTINGS_GOOGLE_SERVICES_SETTINGS_VIEW_CONTROLLER_H_
diff --git a/ios/chrome/browser/ui/settings/google_services_settings_view_controller.mm b/ios/chrome/browser/ui/settings/google_services_settings_view_controller.mm index 7b5b7a8a..d289f6e 100644 --- a/ios/chrome/browser/ui/settings/google_services_settings_view_controller.mm +++ b/ios/chrome/browser/ui/settings/google_services_settings_view_controller.mm
@@ -4,11 +4,13 @@ #import "ios/chrome/browser/ui/settings/google_services_settings_view_controller.h" +#include "base/mac/foundation_util.h" #import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrome.h" #import "ios/chrome/browser/ui/collection_view/cells/collection_view_switch_item.h" #import "ios/chrome/browser/ui/collection_view/cells/collection_view_text_item.h" #import "ios/chrome/browser/ui/settings/cells/settings_collapsible_item.h" #import "ios/chrome/browser/ui/settings/cells/sync_switch_item.h" +#import "ios/chrome/browser/ui/settings/google_services_settings_command_handler.h" #import "ios/chrome/browser/ui/settings/google_services_settings_view_controller_model_delegate.h" #include "ios/chrome/grit/ios_strings.h" #include "ui/base/l10n/l10n_util_mac.h" @@ -17,10 +19,19 @@ #error "This file requires ARC support." #endif +namespace { + +// Constants used to convert NSIndexPath into a tag. Used as: +// item + section * kSectionOffset +constexpr NSInteger kSectionOffset = 1000; + +} // namespace + @implementation GoogleServicesSettingsViewController -@synthesize modelDelegate = _modelDelegate; @synthesize presentationDelegate = _presentationDelegate; +@synthesize modelDelegate = _modelDelegate; +@synthesize commandHandler = _commandHandler; - (instancetype)initWithLayout:(UICollectionViewLayout*)layout style:(CollectionViewControllerStyle)style { @@ -70,6 +81,87 @@ cellForItemAtIndexPath:indexPath]; [cell setCollapsed:shouldCollapse animated:YES]; } +#pragma mark - Private + +- (NSInteger)tagForIndexPath:(NSIndexPath*)indexPath { + return indexPath.item + indexPath.section * kSectionOffset; +} + +- (NSIndexPath*)indexPathForTag:(NSInteger)tag { + NSInteger section = tag / kSectionOffset; + NSInteger item = tag - (section * kSectionOffset); + return [NSIndexPath indexPathForItem:item inSection:section]; +} + +- (void)switchAction:(UISwitch*)sender { + NSIndexPath* indexPath = [self indexPathForTag:sender.tag]; + SyncSwitchItem* syncSwitchItem = base::mac::ObjCCastStrict<SyncSwitchItem>( + [self.collectionViewModel itemAtIndexPath:indexPath]); + BOOL isOn = sender.isOn; + GoogleServicesSettingsCommandID commandID = + static_cast<GoogleServicesSettingsCommandID>(syncSwitchItem.commandID); + switch (commandID) { + case GoogleServicesSettingsCommandIDNoOp: + NOTREACHED(); + break; + case GoogleServicesSettingsCommandIDToggleSyncEverything: + [self.commandHandler toggleSyncEverythingWithValue:isOn]; + break; + case GoogleServicesSettingsCommandIDToggleBookmarkSync: + [self.commandHandler toggleBookmarksSyncWithValue:isOn]; + break; + case GoogleServicesSettingsCommandIDToggleHistorySync: + [self.commandHandler toggleHistorySyncWithValue:isOn]; + break; + case GoogleServicesSettingsCommandIDTogglePasswordsSync: + [self.commandHandler togglePasswordsSyncWithValue:isOn]; + break; + case GoogleServicesSettingsCommandIDToggleOpenTabsSync: + [self.commandHandler toggleOpenTabSyncWithValue:isOn]; + break; + case GoogleServicesSettingsCommandIDToggleAutofillSync: + [self.commandHandler toggleAutofillWithValue:isOn]; + break; + case GoogleServicesSettingsCommandIDToggleSettingsSync: + [self.commandHandler toggleSettingsWithValue:isOn]; + break; + case GoogleServicesSettingsCommandIDToggleReadingListSync: + [self.commandHandler toggleReadingListWithValue:isOn]; + break; + case GoogleServicesSettingsCommandIDToggleActivityAndInteractionsService: + [self.commandHandler toggleActivityAndInteractionsServiceWithValue:isOn]; + break; + case GoogleServicesSettingsCommandIDToggleAutocompleteSearchesService: + [self.commandHandler toggleAutocompleteSearchesServiceWithValue:isOn]; + break; + case GoogleServicesSettingsCommandIDTogglePreloadPagesService: + [self.commandHandler togglePreloadPagesServiceWithValue:isOn]; + break; + case GoogleServicesSettingsCommandIDToggleImproveChromeService: + [self.commandHandler toggleImproveChromeServiceWithValue:isOn]; + break; + case GoogleServicesSettingsCommandIDToggleBetterSearchAndBrowsingService: + [self.commandHandler toggleBetterSearchAndBrowsingServiceWithValue:isOn]; + break; + } +} + +#pragma mark - UICollectionViewDataSource + +- (UICollectionViewCell*)collectionView:(UICollectionView*)collectionView + cellForItemAtIndexPath:(NSIndexPath*)indexPath { + UICollectionViewCell* cell = + [super collectionView:collectionView cellForItemAtIndexPath:indexPath]; + if ([cell isKindOfClass:[SyncSwitchCell class]]) { + SyncSwitchCell* switchCell = + base::mac::ObjCCastStrict<SyncSwitchCell>(cell); + [switchCell.switchView addTarget:self + action:@selector(switchAction:) + forControlEvents:UIControlEventValueChanged]; + switchCell.switchView.tag = [self tagForIndexPath:indexPath]; + } + return cell; +} #pragma mark - CollectionViewController
diff --git a/media/base/BUILD.gn b/media/base/BUILD.gn index b5c09187..2c57eaf 100644 --- a/media/base/BUILD.gn +++ b/media/base/BUILD.gn
@@ -294,13 +294,13 @@ ":video_facing", "//media:media_buildflags", "//media:shared_memory_support", + "//third_party/libaom:av1_buildflags", "//ui/gfx:color_space", ] deps = [ "//base/allocator:buildflags", "//gpu/command_buffer/common", "//skia", - "//third_party/libaom:av1_buildflags", "//third_party/libyuv", "//third_party/widevine/cdm:headers", "//ui/display:display",
diff --git a/media/capture/video/win/video_capture_device_factory_win.cc b/media/capture/video/win/video_capture_device_factory_win.cc index 275f7560..cd27e1df 100644 --- a/media/capture/video/win/video_capture_device_factory_win.cc +++ b/media/capture/video/win/video_capture_device_factory_win.cc
@@ -30,11 +30,6 @@ #include "media/capture/video/win/video_capture_device_mf_win.h" #include "media/capture/video/win/video_capture_device_win.h" -using namespace ABI::Windows::Devices::Enumeration; -using namespace ABI::Windows::Foundation; -using namespace ABI::Windows::Foundation::Collections; -using namespace Microsoft::WRL; - using Descriptor = media::VideoCaptureDeviceDescriptor; using Descriptors = media::VideoCaptureDeviceDescriptors; using base::win::GetActivationFactory; @@ -454,7 +449,9 @@ base::Unretained(factory), base::Passed(&device_descriptors), base::Passed(&result_callback)); auto callback = - Callback<IAsyncOperationCompletedHandler<DeviceInformationCollection*>>( + Microsoft::WRL::Callback< + ABI::Windows::Foundation::IAsyncOperationCompletedHandler< + DeviceInformationCollection*>>( [factory, com_thread_runner, device_info_callback]( IAsyncOperation<DeviceInformationCollection*>* operation, AsyncStatus status) -> HRESULT { @@ -464,9 +461,10 @@ return S_OK; }); - ComPtr<IDeviceInformationStatics> dev_info_statics; + ComPtr<ABI::Windows::Devices::Enumeration::IDeviceInformationStatics> + dev_info_statics; HRESULT hr = GetActivationFactory< - IDeviceInformationStatics, + ABI::Windows::Devices::Enumeration::IDeviceInformationStatics, RuntimeClass_Windows_Devices_Enumeration_DeviceInformation>( &dev_info_statics); if (FAILED(hr)) { @@ -475,8 +473,8 @@ } IAsyncOperation<DeviceInformationCollection*>* async_op; - hr = dev_info_statics->FindAllAsyncDeviceClass(DeviceClass_VideoCapture, - &async_op); + hr = dev_info_statics->FindAllAsyncDeviceClass( + ABI::Windows::Devices::Enumeration::DeviceClass_VideoCapture, &async_op); if (FAILED(hr)) { UWP_ENUM_ERROR_HANDLER(hr, "Find all devices asynchronously failed: "); return; @@ -506,14 +504,16 @@ return; } - ComPtr<IVectorView<DeviceInformation*>> devices; + ComPtr<ABI::Windows::Foundation::Collections::IVectorView< + ABI::Windows::Devices::Enumeration::DeviceInformation*>> + devices; operation->GetResults(devices.GetAddressOf()); unsigned int count = 0; devices->get_Size(&count); for (unsigned int j = 0; j < count; ++j) { - ComPtr<IDeviceInformation> device_info; + ComPtr<ABI::Windows::Devices::Enumeration::IDeviceInformation> device_info; HRESULT hr = devices->GetAt(j, device_info.GetAddressOf()); if (SUCCEEDED(hr)) { HSTRING id; @@ -524,7 +524,8 @@ ::tolower); const std::string model_id = GetDeviceModelId(device_id); - ComPtr<IEnclosureLocation> enclosure_location; + ComPtr<ABI::Windows::Devices::Enumeration::IEnclosureLocation> + enclosure_location; hr = device_info->get_EnclosureLocation(enclosure_location.GetAddressOf()); if (FAILED(hr)) { @@ -533,16 +534,16 @@ VideoFacingMode facing = VideoFacingMode::MEDIA_VIDEO_FACING_NONE; if (enclosure_location) { - Panel panel; + ABI::Windows::Devices::Enumeration::Panel panel; enclosure_location->get_Panel(&panel); switch (panel) { - case Panel_Unknown: + case ABI::Windows::Devices::Enumeration::Panel_Unknown: facing = VideoFacingMode::MEDIA_VIDEO_FACING_NONE; break; - case Panel_Front: + case ABI::Windows::Devices::Enumeration::Panel_Front: facing = VideoFacingMode::MEDIA_VIDEO_FACING_USER; break; - case Panel_Back: + case ABI::Windows::Devices::Enumeration::Panel_Back: facing = VideoFacingMode::MEDIA_VIDEO_FACING_ENVIRONMENT; break; default:
diff --git a/net/dns/dns_transaction.cc b/net/dns/dns_transaction.cc index 6d42c35..d3d4849 100644 --- a/net/dns/dns_transaction.cc +++ b/net/dns/dns_transaction.cc
@@ -1238,11 +1238,10 @@ session_->RecordServerFailure(result.attempt->server_index()); return AttemptResult(ERR_IO_PENDING, NULL); } - if (MoreAttemptsAllowed()) { - result = MakeAttempt(); - } else { - return AttemptResult(result.rv, NULL); + if (!MoreAttemptsAllowed()) { + return result; } + result = MakeAttempt(); break; } }
diff --git a/net/dns/dns_transaction_unittest.cc b/net/dns/dns_transaction_unittest.cc index f1084784..90d4d1ed 100644 --- a/net/dns/dns_transaction_unittest.cc +++ b/net/dns/dns_transaction_unittest.cc
@@ -266,6 +266,7 @@ int expected_answer_count) : hostname_(hostname), qtype_(qtype), + response_(nullptr), expected_answer_count_(expected_answer_count), cancel_in_callback_(false), completed_(false) {} @@ -299,6 +300,7 @@ EXPECT_EQ(transaction_.get(), t); completed_ = true; + response_ = response; if (transaction_complete_run_loop_) transaction_complete_run_loop_->QuitWhenIdle(); @@ -308,6 +310,9 @@ return; } + if (response) + EXPECT_TRUE(response->IsValid()); + if (expected_answer_count_ >= 0) { ASSERT_THAT(rv, IsOk()); ASSERT_TRUE(response != NULL); @@ -326,6 +331,7 @@ } bool has_completed() const { return completed_; } + const DnsResponse* response() const { return response_; } // Shorthands for commonly used commands. @@ -352,6 +358,7 @@ std::string hostname_; uint16_t qtype_; std::unique_ptr<DnsTransaction> transaction_; + const DnsResponse* response_; int expected_answer_count_; bool cancel_in_callback_; TestURLRequestContext request_context_; @@ -1011,6 +1018,8 @@ TransactionHelper helper0(kT0HostName, kT0Qtype, ERR_DNS_SERVER_FAILED); EXPECT_TRUE(helper0.Run(transaction_factory_.get())); + ASSERT_NE(helper0.response(), nullptr); + EXPECT_EQ(helper0.response()->rcode(), dns_protocol::kRcodeSERVFAIL); } TEST_F(DnsTransactionTest, NoDomain) { @@ -1304,6 +1313,8 @@ TransactionHelper helper0(kT0HostName, kT0Qtype, ERR_DNS_SERVER_FAILED); EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get())); + ASSERT_NE(helper0.response(), nullptr); + EXPECT_EQ(helper0.response()->rcode(), dns_protocol::kRcodeSERVFAIL); } TEST_F(DnsTransactionTest, HttpsGetMalformed) { @@ -1338,6 +1349,8 @@ TransactionHelper helper0(kT0HostName, kT0Qtype, ERR_DNS_SERVER_FAILED); EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get())); + ASSERT_NE(helper0.response(), nullptr); + EXPECT_EQ(helper0.response()->rcode(), dns_protocol::kRcodeSERVFAIL); } TEST_F(DnsTransactionTest, HttpsPostMalformed) { @@ -1884,6 +1897,8 @@ TransactionHelper helper0(kT0HostName, kT0Qtype, ERR_DNS_SERVER_FAILED); EXPECT_TRUE(helper0.Run(transaction_factory_.get())); + ASSERT_NE(helper0.response(), nullptr); + EXPECT_EQ(helper0.response()->rcode(), dns_protocol::kRcodeSERVFAIL); } TEST_F(DnsTransactionTest, TCPMalformed) {
diff --git a/net/http/http_response_info.h b/net/http/http_response_info.h index 94642e37..0c7e4a4b 100644 --- a/net/http/http_response_info.h +++ b/net/http/http_response_info.h
@@ -28,8 +28,8 @@ public: // Describes the kind of connection used to fetch this response. // - // NOTE: Please keep in sync with Net.HttpResponseInfo.ConnectionInfo - // histogram in tools/metrics/histograms/histograms.xml. + // NOTE: Please keep in sync with ConnectionInfo enum in + // tools/metrics/histograms/enum.xml. // Because of that, and also because these values are persisted to // the cache, please make sure not to delete or reorder values. enum ConnectionInfo {
diff --git a/net/socket/fuzzed_server_socket.cc b/net/socket/fuzzed_server_socket.cc index d2b84f5..cffa433d 100644 --- a/net/socket/fuzzed_server_socket.cc +++ b/net/socket/fuzzed_server_socket.cc
@@ -4,6 +4,8 @@ #include "net/socket/fuzzed_server_socket.h" +#include <utility> + #include "base/bind.h" #include "base/location.h" #include "base/threading/thread_task_runner_handle.h" @@ -34,11 +36,12 @@ } int FuzzedServerSocket::Accept(std::unique_ptr<StreamSocket>* socket, - const CompletionCallback& callback) { + CompletionOnceCallback callback) { if (first_accept_) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&FuzzedServerSocket::DispatchAccept, - weak_factory_.GetWeakPtr(), socket, callback)); + FROM_HERE, base::BindOnce(&FuzzedServerSocket::DispatchAccept, + weak_factory_.GetWeakPtr(), socket, + std::move(callback))); } first_accept_ = false; @@ -46,15 +49,15 @@ } void FuzzedServerSocket::DispatchAccept(std::unique_ptr<StreamSocket>* socket, - const CompletionCallback& callback) { + CompletionOnceCallback callback) { std::unique_ptr<FuzzedSocket> connected_socket( std::make_unique<FuzzedSocket>(data_provider_, net_log_)); // The Connect call should always succeed synchronously, without using the // callback, since connected_socket->set_fuzz_connect_result(true) has not // been called. - CHECK_EQ(net::OK, connected_socket->Connect(callback)); + CHECK_EQ(net::OK, connected_socket->Connect(CompletionOnceCallback())); *socket = std::move(connected_socket); - callback.Run(OK); + std::move(callback).Run(OK); } } // namespace net
diff --git a/net/socket/fuzzed_server_socket.h b/net/socket/fuzzed_server_socket.h index ba1b0794..0d9cd16 100644 --- a/net/socket/fuzzed_server_socket.h +++ b/net/socket/fuzzed_server_socket.h
@@ -12,6 +12,7 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" +#include "net/base/completion_once_callback.h" #include "net/base/ip_endpoint.h" #include "net/socket/server_socket.h" @@ -41,11 +42,11 @@ int GetLocalAddress(IPEndPoint* address) const override; int Accept(std::unique_ptr<StreamSocket>* socket, - const CompletionCallback& callback) override; + CompletionOnceCallback callback) override; private: void DispatchAccept(std::unique_ptr<StreamSocket>* socket, - const CompletionCallback& callback); + CompletionOnceCallback callback); base::FuzzedDataProvider* data_provider_; net::NetLog* net_log_;
diff --git a/net/socket/server_socket.h b/net/socket/server_socket.h index 9ad5cf81..7bb0820 100644 --- a/net/socket/server_socket.h +++ b/net/socket/server_socket.h
@@ -11,7 +11,7 @@ #include <string> #include "base/macros.h" -#include "net/base/completion_callback.h" +#include "net/base/completion_once_callback.h" #include "net/base/net_export.h" namespace net { @@ -40,7 +40,7 @@ // Accepts connection. Callback is called when new connection is // accepted. virtual int Accept(std::unique_ptr<StreamSocket>* socket, - const CompletionCallback& callback) = 0; + CompletionOnceCallback callback) = 0; private: DISALLOW_COPY_AND_ASSIGN(ServerSocket);
diff --git a/net/socket/tcp_server_socket.cc b/net/socket/tcp_server_socket.cc index 2d9c5fd..93d56c47 100644 --- a/net/socket/tcp_server_socket.cc +++ b/net/socket/tcp_server_socket.cc
@@ -55,7 +55,7 @@ } int TCPServerSocket::Accept(std::unique_ptr<StreamSocket>* socket, - const CompletionCallback& callback) { + CompletionOnceCallback callback) { DCHECK(socket); DCHECK(!callback.is_null()); @@ -66,11 +66,11 @@ // It is safe to use base::Unretained(this). |socket_| is owned by this class, // and the callback won't be run after |socket_| is destroyed. - CompletionCallback accept_callback = - base::Bind(&TCPServerSocket::OnAcceptCompleted, base::Unretained(this), - socket, callback); + CompletionOnceCallback accept_callback = + base::BindOnce(&TCPServerSocket::OnAcceptCompleted, + base::Unretained(this), socket, std::move(callback)); int result = socket_.Accept(&accepted_socket_, &accepted_address_, - accept_callback); + std::move(accept_callback)); if (result != ERR_IO_PENDING) { // |accept_callback| won't be called so we need to run // ConvertAcceptedSocket() ourselves in order to do the conversion from @@ -103,11 +103,11 @@ void TCPServerSocket::OnAcceptCompleted( std::unique_ptr<StreamSocket>* output_accepted_socket, - const CompletionCallback& forward_callback, + CompletionOnceCallback forward_callback, int result) { result = ConvertAcceptedSocket(result, output_accepted_socket); pending_accept_ = false; - forward_callback.Run(result); + std::move(forward_callback).Run(result); } } // namespace net
diff --git a/net/socket/tcp_server_socket.h b/net/socket/tcp_server_socket.h index 58f3a44..96a0bad 100644 --- a/net/socket/tcp_server_socket.h +++ b/net/socket/tcp_server_socket.h
@@ -8,6 +8,7 @@ #include <memory> #include "base/macros.h" +#include "net/base/completion_once_callback.h" #include "net/base/ip_endpoint.h" #include "net/base/net_export.h" #include "net/socket/server_socket.h" @@ -35,7 +36,7 @@ int Listen(const IPEndPoint& address, int backlog) override; int GetLocalAddress(IPEndPoint* address) const override; int Accept(std::unique_ptr<StreamSocket>* socket, - const CompletionCallback& callback) override; + CompletionOnceCallback callback) override; // Detachs from the current thread, to allow the socket to be transferred to // a new thread. Should only be called when the object is no longer used by @@ -52,7 +53,7 @@ std::unique_ptr<StreamSocket>* output_accepted_socket); // Completion callback for calling TCPSocket::Accept(). void OnAcceptCompleted(std::unique_ptr<StreamSocket>* output_accepted_socket, - const CompletionCallback& forward_callback, + CompletionOnceCallback forward_callback, int result); TCPSocket socket_;
diff --git a/net/socket/tcp_socket_win.cc b/net/socket/tcp_socket_win.cc index 2edf932..e243102 100644 --- a/net/socket/tcp_socket_win.cc +++ b/net/socket/tcp_socket_win.cc
@@ -384,7 +384,7 @@ int TCPSocketWin::Accept(std::unique_ptr<TCPSocketWin>* socket, IPEndPoint* address, - const CompletionCallback& callback) { + CompletionOnceCallback callback) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK(socket); DCHECK(address); @@ -402,7 +402,7 @@ accept_socket_ = socket; accept_address_ = address; - accept_callback_ = callback; + accept_callback_ = std::move(callback); } return result;
diff --git a/net/socket/tcp_socket_win.h b/net/socket/tcp_socket_win.h index 6b4594c..45189f54 100644 --- a/net/socket/tcp_socket_win.h +++ b/net/socket/tcp_socket_win.h
@@ -16,7 +16,6 @@ #include "base/threading/thread_checker.h" #include "base/win/object_watcher.h" #include "net/base/address_family.h" -#include "net/base/completion_callback.h" #include "net/base/completion_once_callback.h" #include "net/base/net_export.h" #include "net/log/net_log_with_source.h" @@ -59,7 +58,7 @@ int Listen(int backlog); int Accept(std::unique_ptr<TCPSocketWin>* socket, IPEndPoint* address, - const CompletionCallback& callback); + CompletionOnceCallback callback); int Connect(const IPEndPoint& address, CompletionOnceCallback callback); bool IsConnected() const; @@ -162,7 +161,7 @@ std::unique_ptr<TCPSocketWin>* accept_socket_; IPEndPoint* accept_address_; - CompletionCallback accept_callback_; + CompletionOnceCallback accept_callback_; // The various states that the socket could be in. bool waiting_connect_;
diff --git a/net/socket/unix_domain_server_socket_posix.cc b/net/socket/unix_domain_server_socket_posix.cc index 2bea30e..7fa3b56 100644 --- a/net/socket/unix_domain_server_socket_posix.cc +++ b/net/socket/unix_domain_server_socket_posix.cc
@@ -119,36 +119,42 @@ } int UnixDomainServerSocket::Accept(std::unique_ptr<StreamSocket>* socket, - const CompletionCallback& callback) { + CompletionOnceCallback callback) { DCHECK(socket); + DCHECK(callback); + DCHECK(!callback_); SetterCallback setter_callback = base::Bind(&SetStreamSocket, socket); - return DoAccept(setter_callback, callback); + int rv = DoAccept(setter_callback); + if (rv == ERR_IO_PENDING) + callback_ = std::move(callback); + return rv; } int UnixDomainServerSocket::AcceptSocketDescriptor( SocketDescriptor* socket, - const CompletionCallback& callback) { + CompletionOnceCallback callback) { DCHECK(socket); + DCHECK(callback); + DCHECK(!callback_); SetterCallback setter_callback = base::Bind(&SetSocketDescriptor, socket); - return DoAccept(setter_callback, callback); + int rv = DoAccept(setter_callback); + if (rv == ERR_IO_PENDING) + callback_ = std::move(callback); + return rv; } -int UnixDomainServerSocket::DoAccept(const SetterCallback& setter_callback, - const CompletionCallback& callback) { +int UnixDomainServerSocket::DoAccept(const SetterCallback& setter_callback) { DCHECK(!setter_callback.is_null()); - DCHECK(!callback.is_null()); DCHECK(listen_socket_); DCHECK(!accept_socket_); while (true) { int rv = listen_socket_->Accept( &accept_socket_, - base::Bind(&UnixDomainServerSocket::AcceptCompleted, - base::Unretained(this), - setter_callback, - callback)); + base::BindOnce(&UnixDomainServerSocket::AcceptCompleted, + base::Unretained(this), setter_callback)); if (rv != OK) return rv; if (AuthenticateAndGetStreamSocket(setter_callback)) @@ -160,23 +166,24 @@ void UnixDomainServerSocket::AcceptCompleted( const SetterCallback& setter_callback, - const CompletionCallback& callback, int rv) { + DCHECK(!callback_.is_null()); + if (rv != OK) { - callback.Run(rv); + std::move(callback_).Run(rv); return; } if (AuthenticateAndGetStreamSocket(setter_callback)) { - callback.Run(OK); + std::move(callback_).Run(OK); return; } // Accept another socket because authentication error should be transparent // to the caller. - rv = DoAccept(setter_callback, callback); + rv = DoAccept(setter_callback); if (rv != ERR_IO_PENDING) - callback.Run(rv); + std::move(callback_).Run(rv); } bool UnixDomainServerSocket::AuthenticateAndGetStreamSocket(
diff --git a/net/socket/unix_domain_server_socket_posix.h b/net/socket/unix_domain_server_socket_posix.h index e5a81d31..8bccc06 100644 --- a/net/socket/unix_domain_server_socket_posix.h +++ b/net/socket/unix_domain_server_socket_posix.h
@@ -14,7 +14,7 @@ #include "base/callback.h" #include "base/macros.h" #include "build/build_config.h" - +#include "net/base/completion_once_callback.h" #include "net/base/net_export.h" #include "net/socket/server_socket.h" #include "net/socket/socket_descriptor.h" @@ -59,7 +59,7 @@ int backlog) override; int GetLocalAddress(IPEndPoint* address) const override; int Accept(std::unique_ptr<StreamSocket>* socket, - const CompletionCallback& callback) override; + CompletionOnceCallback callback) override; // Creates a server socket, binds it to the specified |socket_path| and // starts listening for incoming connections with the specified |backlog|. @@ -68,7 +68,7 @@ // Accepts an incoming connection on |listen_socket_|, but passes back // a raw SocketDescriptor instead of a StreamSocket. int AcceptSocketDescriptor(SocketDescriptor* socket_descriptor, - const CompletionCallback& callback); + CompletionOnceCallback callback); private: // A callback to wrap the setting of the out-parameter to Accept(). @@ -76,15 +76,14 @@ // a manner that's agnostic to the caller's desired output. typedef base::Callback<void(std::unique_ptr<SocketPosix>)> SetterCallback; - int DoAccept(const SetterCallback& setter_callback, - const CompletionCallback& callback); + int DoAccept(const SetterCallback& setter_callback); void AcceptCompleted(const SetterCallback& setter_callback, - const CompletionCallback& callback, int rv); bool AuthenticateAndGetStreamSocket(const SetterCallback& setter_callback); std::unique_ptr<SocketPosix> listen_socket_; const AuthCallback auth_callback_; + CompletionOnceCallback callback_; const bool use_abstract_namespace_; std::unique_ptr<SocketPosix> accept_socket_;
diff --git a/net/socket/websocket_transport_client_socket_pool.cc b/net/socket/websocket_transport_client_socket_pool.cc index 49a45bc..cdf411a 100644 --- a/net/socket/websocket_transport_client_socket_pool.cc +++ b/net/socket/websocket_transport_client_socket_pool.cc
@@ -450,13 +450,11 @@ // anyway. flushing_ = true; for (PendingConnectsMap::iterator it = pending_connects_.begin(); - it != pending_connects_.end(); - ++it) { + it != pending_connects_.end();) { InvokeUserCallbackLater(it->second->handle(), it->second->release_callback(), error); - delete it->second, it->second = nullptr; + it = pending_connects_.erase(it); } - pending_connects_.clear(); for (StalledRequestQueue::iterator it = stalled_request_queue_.begin(); it != stalled_request_queue_.end(); ++it) { @@ -638,9 +636,10 @@ void WebSocketTransportClientSocketPool::AddJob( ClientSocketHandle* handle, std::unique_ptr<WebSocketTransportConnectJob> connect_job) { - bool inserted = - pending_connects_.insert(PendingConnectsMap::value_type( - handle, connect_job.release())).second; + bool inserted = pending_connects_ + .insert(PendingConnectsMap::value_type( + handle, std::move(connect_job))) + .second; DCHECK(inserted); } @@ -651,10 +650,7 @@ // Deleting a ConnectJob which holds an endpoint lock can lead to a different // ConnectJob proceeding to connect. If the connect proceeds synchronously // (usually because of a failure) then it can trigger that job to be - // deleted. |it| remains valid because std::map guarantees that erase() does - // not invalid iterators to other entries. - delete it->second, it->second = nullptr; - DCHECK(pending_connects_.find(handle) == it); + // deleted. pending_connects_.erase(it); return true; } @@ -664,7 +660,7 @@ const ClientSocketHandle* handle) const { PendingConnectsMap::const_iterator it = pending_connects_.find(handle); CHECK(it != pending_connects_.end()); - return it->second; + return it->second.get(); } void WebSocketTransportClientSocketPool::ActivateStalledRequest() {
diff --git a/net/socket/websocket_transport_client_socket_pool.h b/net/socket/websocket_transport_client_socket_pool.h index e8bcc89..7262aa0b 100644 --- a/net/socket/websocket_transport_client_socket_pool.h +++ b/net/socket/websocket_transport_client_socket_pool.h
@@ -228,7 +228,8 @@ friend class ConnectJobDelegate; - typedef std::map<const ClientSocketHandle*, WebSocketTransportConnectJob*> + typedef std::map<const ClientSocketHandle*, + std::unique_ptr<WebSocketTransportConnectJob>> PendingConnectsMap; // This is a list so that we can remove requests from the middle, and also // so that iterators are not invalidated unless the corresponding request is
diff --git a/net/url_request/url_request_data_job.cc b/net/url_request/url_request_data_job.cc index a3c7b7b..5cbb837 100644 --- a/net/url_request/url_request_data_job.cc +++ b/net/url_request/url_request_data_job.cc
@@ -51,7 +51,7 @@ int URLRequestDataJob::GetData(std::string* mime_type, std::string* charset, std::string* data, - const CompletionCallback& callback) const { + CompletionOnceCallback callback) const { // Check if data URL is valid. If not, don't bother to try to extract data. // Otherwise, parse the data from the data URL. const GURL& url = request_->url();
diff --git a/net/url_request/url_request_data_job.h b/net/url_request/url_request_data_job.h index 7fa311f..c754770 100644 --- a/net/url_request/url_request_data_job.h +++ b/net/url_request/url_request_data_job.h
@@ -8,6 +8,7 @@ #include <string> #include "base/macros.h" +#include "net/base/completion_once_callback.h" #include "net/base/net_export.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_simple_job.h" @@ -35,7 +36,7 @@ int GetData(std::string* mime_type, std::string* charset, std::string* data, - const CompletionCallback& callback) const override; + CompletionOnceCallback callback) const override; private: ~URLRequestDataJob() override;
diff --git a/net/url_request/url_request_simple_job.cc b/net/url_request/url_request_simple_job.cc index 3e1dec95..ffb2f8f 100644 --- a/net/url_request/url_request_simple_job.cc +++ b/net/url_request/url_request_simple_job.cc
@@ -4,6 +4,7 @@ #include "net/url_request/url_request_simple_job.h" +#include <utility> #include <vector> #include "base/bind.h" @@ -85,7 +86,7 @@ int URLRequestSimpleJob::GetData(std::string* mime_type, std::string* charset, std::string* data, - const CompletionCallback& callback) const { + CompletionOnceCallback callback) const { NOTREACHED(); return ERR_UNEXPECTED; } @@ -94,9 +95,10 @@ std::string* mime_type, std::string* charset, scoped_refptr<base::RefCountedMemory>* data, - const CompletionCallback& callback) const { + CompletionOnceCallback callback) const { scoped_refptr<base::RefCountedString> str_data(new base::RefCountedString()); - int result = GetData(mime_type, charset, &str_data->data(), callback); + int result = + GetData(mime_type, charset, &str_data->data(), std::move(callback)); *data = str_data; return result; }
diff --git a/net/url_request/url_request_simple_job.h b/net/url_request/url_request_simple_job.h index 1b59384..55950c8 100644 --- a/net/url_request/url_request_simple_job.h +++ b/net/url_request/url_request_simple_job.h
@@ -13,6 +13,7 @@ #include "base/memory/weak_ptr.h" #include "base/strings/string_piece.h" #include "net/base/completion_callback.h" +#include "net/base/completion_once_callback.h" #include "net/base/net_export.h" #include "net/url_request/url_range_request_job.h" @@ -51,14 +52,14 @@ virtual int GetData(std::string* mime_type, std::string* charset, std::string* data, - const CompletionCallback& callback) const; + CompletionOnceCallback callback) const; // Similar to GetData(), except |*data| can share ownership of the bytes // instead of copying them into a std::string. virtual int GetRefCountedData(std::string* mime_type, std::string* charset, scoped_refptr<base::RefCountedMemory>* data, - const CompletionCallback& callback) const; + CompletionOnceCallback callback) const; void StartAsync();
diff --git a/net/url_request/url_request_simple_job_unittest.cc b/net/url_request/url_request_simple_job_unittest.cc index 44804b41..02638c9 100644 --- a/net/url_request/url_request_simple_job_unittest.cc +++ b/net/url_request/url_request_simple_job_unittest.cc
@@ -53,7 +53,7 @@ int GetData(std::string* mime_type, std::string* charset, std::string* data, - const CompletionCallback& callback) const override { + CompletionOnceCallback callback) const override { mime_type->assign("text/plain"); charset->assign("US-ASCII"); data->assign(data_);
diff --git a/services/network/network_context.cc b/services/network/network_context.cc index ca4635b..0c59764 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc
@@ -64,6 +64,7 @@ #include "net/url_request/static_http_user_agent_settings.h" #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_builder.h" +#include "services/network/cookie_manager.h" #include "services/network/cors/cors_url_loader_factory.h" #include "services/network/expect_ct_reporter.h" #include "services/network/http_server_properties_pref_delegate.h" @@ -340,10 +341,7 @@ params_(std::move(params)), on_connection_close_callback_(std::move(on_connection_close_callback)), binding_(this, std::move(request)) { - SessionCleanupCookieStore* session_cleanup_cookie_store = nullptr; - SessionCleanupChannelIDStore* session_cleanup_channel_id_store = nullptr; - url_request_context_owner_ = MakeURLRequestContext( - &session_cleanup_cookie_store, &session_cleanup_channel_id_store); + url_request_context_owner_ = MakeURLRequestContext(); url_request_context_ = url_request_context_owner_.url_request_context.get(); network_service_->RegisterNetworkContext(this); @@ -355,10 +353,6 @@ binding_.set_connection_error_handler(base::BindOnce( &NetworkContext::OnConnectionError, base::Unretained(this))); - cookie_manager_ = std::make_unique<CookieManager>( - url_request_context_->cookie_store(), session_cleanup_cookie_store, - session_cleanup_channel_id_store, - std::move(params_->cookie_manager_params)); socket_factory_ = std::make_unique<SocketFactory>(network_service_->net_log(), url_request_context_); resource_scheduler_ = @@ -380,9 +374,6 @@ url_request_context_ = url_request_context_owner_.url_request_context.get(); network_service_->RegisterNetworkContext(this); - cookie_manager_ = std::make_unique<CookieManager>( - url_request_context_->cookie_store(), nullptr, nullptr, - std::move(params_->cookie_manager_params)); socket_factory_ = std::make_unique<SocketFactory>(network_service_->net_log(), url_request_context_); resource_scheduler_ = @@ -866,6 +857,61 @@ network_service_->network_quality_estimator()); } + scoped_refptr<network::SessionCleanupCookieStore> + session_cleanup_cookie_store; + scoped_refptr<SessionCleanupChannelIDStore> session_cleanup_channel_id_store; + if (params_->cookie_path) { + scoped_refptr<base::SequencedTaskRunner> client_task_runner = + base::MessageLoopCurrent::Get()->task_runner(); + scoped_refptr<base::SequencedTaskRunner> background_task_runner = + base::CreateSequencedTaskRunnerWithTraits( + {base::MayBlock(), base::TaskPriority::BEST_EFFORT, + base::TaskShutdownBehavior::BLOCK_SHUTDOWN}); + + std::unique_ptr<net::ChannelIDService> channel_id_service; + if (params_->channel_id_path) { + session_cleanup_channel_id_store = + base::MakeRefCounted<SessionCleanupChannelIDStore>( + params_->channel_id_path.value(), background_task_runner); + channel_id_service = std::make_unique<net::ChannelIDService>( + new net::DefaultChannelIDStore( + session_cleanup_channel_id_store.get())); + } + + net::CookieCryptoDelegate* crypto_delegate = nullptr; + if (params_->enable_encrypted_cookies) { +#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(IS_CHROMECAST) + DCHECK(network_service_->os_crypt_config_set()) + << "NetworkService::SetCryptConfig must be called before creating a " + "NetworkContext with encrypted cookies."; +#endif + crypto_delegate = cookie_config::GetCookieCryptoDelegate(); + } + scoped_refptr<net::SQLitePersistentCookieStore> sqlite_store( + new net::SQLitePersistentCookieStore( + params_->cookie_path.value(), client_task_runner, + background_task_runner, params_->restore_old_session_cookies, + crypto_delegate)); + + session_cleanup_cookie_store = + base::MakeRefCounted<network::SessionCleanupCookieStore>(sqlite_store); + + std::unique_ptr<net::CookieMonster> cookie_store = + std::make_unique<net::CookieMonster>(session_cleanup_cookie_store.get(), + channel_id_service.get()); + if (params_->persist_session_cookies) + cookie_store->SetPersistSessionCookies(true); + + if (channel_id_service) { + cookie_store->SetChannelIDServiceID(channel_id_service->GetUniqueID()); + } + builder->SetCookieAndChannelIdStores(std::move(cookie_store), + std::move(channel_id_service)); + } else { + DCHECK(!params_->restore_old_session_cookies); + DCHECK(!params_->persist_session_cookies); + } + std::unique_ptr<net::StaticHttpUserAgentSettings> user_agent_settings = std::make_unique<net::StaticHttpUserAgentSettings>( params_->accept_language, params_->user_agent); @@ -1114,6 +1160,12 @@ #endif } + cookie_manager_ = std::make_unique<CookieManager>( + result.url_request_context->cookie_store(), + std::move(session_cleanup_cookie_store), + std::move(session_cleanup_channel_id_store), + std::move(params_->cookie_manager_params)); + return result; } @@ -1147,71 +1199,11 @@ std::move(on_connection_close_callback_).Run(this); } -URLRequestContextOwner NetworkContext::MakeURLRequestContext( - SessionCleanupCookieStore** session_cleanup_cookie_store, - SessionCleanupChannelIDStore** session_cleanup_channel_id_store) { +URLRequestContextOwner NetworkContext::MakeURLRequestContext() { URLRequestContextBuilderMojo builder; const base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); - // The cookie configuration is in this method, which is only used by the - // network process, and not ApplyContextParamsToBuilder which is used by the - // browser as well. This is because this code path doesn't handle encryption - // and other configuration done in QuotaPolicyCookieStore yet (and we still - // have to figure out which of the latter needs to move to the network - // process). TODO: http://crbug.com/789644 - if (params_->cookie_path) { - scoped_refptr<base::SequencedTaskRunner> client_task_runner = - base::MessageLoopCurrent::Get()->task_runner(); - scoped_refptr<base::SequencedTaskRunner> background_task_runner = - base::CreateSequencedTaskRunnerWithTraits( - {base::MayBlock(), base::TaskPriority::BEST_EFFORT, - base::TaskShutdownBehavior::BLOCK_SHUTDOWN}); - - std::unique_ptr<net::ChannelIDService> channel_id_service; - if (params_->channel_id_path) { - auto channel_id_db = base::MakeRefCounted<SessionCleanupChannelIDStore>( - params_->channel_id_path.value(), background_task_runner); - *session_cleanup_channel_id_store = channel_id_db.get(); - channel_id_service = std::make_unique<net::ChannelIDService>( - new net::DefaultChannelIDStore(channel_id_db.get())); - } - - net::CookieCryptoDelegate* crypto_delegate = nullptr; - if (params_->enable_encrypted_cookies) { -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(IS_CHROMECAST) - DCHECK(network_service_->os_crypt_config_set()) - << "NetworkService::SetCryptConfig must be called before creating a " - "NetworkContext with encrypted cookies."; -#endif - crypto_delegate = cookie_config::GetCookieCryptoDelegate(); - } - scoped_refptr<net::SQLitePersistentCookieStore> sqlite_store( - new net::SQLitePersistentCookieStore( - params_->cookie_path.value(), client_task_runner, - background_task_runner, params_->restore_old_session_cookies, - crypto_delegate)); - - scoped_refptr<network::SessionCleanupCookieStore> cleanup_store( - base::MakeRefCounted<network::SessionCleanupCookieStore>(sqlite_store)); - *session_cleanup_cookie_store = cleanup_store.get(); - - std::unique_ptr<net::CookieMonster> cookie_store = - std::make_unique<net::CookieMonster>(cleanup_store.get(), - channel_id_service.get()); - if (params_->persist_session_cookies) - cookie_store->SetPersistSessionCookies(true); - - if (channel_id_service) { - cookie_store->SetChannelIDServiceID(channel_id_service->GetUniqueID()); - } - builder.SetCookieAndChannelIdStores(std::move(cookie_store), - std::move(channel_id_service)); - } else { - DCHECK(!params_->restore_old_session_cookies); - DCHECK(!params_->persist_session_cookies); - } - if (g_cert_verifier_for_testing) { builder.SetCertVerifier(std::make_unique<WrappedTestingCertVerifier>()); } else {
diff --git a/services/network/network_context.h b/services/network/network_context.h index 7a29ed10..bbc506e 100644 --- a/services/network/network_context.h +++ b/services/network/network_context.h
@@ -21,7 +21,6 @@ #include "build/build_config.h" #include "mojo/public/cpp/bindings/binding.h" #include "mojo/public/cpp/bindings/strong_binding_set.h" -#include "services/network/cookie_manager.h" #include "services/network/http_cache_data_counter.h" #include "services/network/http_cache_data_remover.h" #include "services/network/public/mojom/network_context.mojom.h" @@ -51,6 +50,7 @@ } // namespace certificate_transparency namespace network { +class CookieManager; class ExpectCTReporter; class NetworkService; class ResourceScheduler; @@ -239,9 +239,7 @@ // On connection errors the NetworkContext destroys itself. void OnConnectionError(); - URLRequestContextOwner MakeURLRequestContext( - SessionCleanupCookieStore** session_cleanup_cookie_store, - SessionCleanupChannelIDStore** session_cleanup_channel_id_store); + URLRequestContextOwner MakeURLRequestContext(); NetworkService* const network_service_;
diff --git a/services/network/network_context_unittest.cc b/services/network/network_context_unittest.cc index a3585e47..00ff468 100644 --- a/services/network/network_context_unittest.cc +++ b/services/network/network_context_unittest.cc
@@ -72,6 +72,7 @@ #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_builder.h" #include "net/url_request/url_request_job_factory.h" +#include "services/network/cookie_manager.h" #include "services/network/mojo_net_log.h" #include "services/network/network_context.h" #include "services/network/network_service.h"
diff --git a/services/network/network_service.cc b/services/network/network_service.cc index c4df8ec..a91a9f4 100644 --- a/services/network/network_service.cc +++ b/services/network/network_service.cc
@@ -169,6 +169,10 @@ DCHECK(network_contexts_.empty()); } +void NetworkService::set_os_crypt_is_configured() { + os_crypt_config_set_ = true; +} + std::unique_ptr<NetworkService> NetworkService::Create( mojom::NetworkServiceRequest request, net::NetLog* net_log) { @@ -370,6 +374,7 @@ #if defined(OS_LINUX) && !defined(OS_CHROMEOS) void NetworkService::SetCryptConfig(mojom::CryptConfigPtr crypt_config) { #if !defined(IS_CHROMECAST) + DCHECK(!os_crypt_config_set_); auto config = std::make_unique<os_crypt::Config>(); config->store = crypt_config->store; config->product_name = crypt_config->product_name;
diff --git a/services/network/network_service.h b/services/network/network_service.h index 839a5da9..a686fd8 100644 --- a/services/network/network_service.h +++ b/services/network/network_service.h
@@ -62,6 +62,11 @@ ~NetworkService() override; + // Call to inform the NetworkService that OSCrypt::SetConfig() has already + // been invoked, so OSCrypt::SetConfig() does not need to be called before + // encrypted storage can be used. + void set_os_crypt_is_configured(); + // Can be used to seed a NetworkContext with a consumer-configured // URLRequestContextBuilder, which |params| will then be applied to. The // results URLRequestContext will be written to |url_request_context|, which
diff --git a/services/network/tcp_socket_unittest.cc b/services/network/tcp_socket_unittest.cc index c387ffe0..eae58e4e 100644 --- a/services/network/tcp_socket_unittest.cc +++ b/services/network/tcp_socket_unittest.cc
@@ -17,7 +17,6 @@ #include "base/threading/thread.h" #include "mojo/public/cpp/system/data_pipe_utils.h" #include "mojo/public/cpp/system/simple_watcher.h" -#include "net/base/completion_callback.h" #include "net/base/completion_once_callback.h" #include "net/base/net_errors.h" #include "net/base/test_completion_callback.h" @@ -57,13 +56,13 @@ } int Accept(std::unique_ptr<net::StreamSocket>* socket, - const net::CompletionCallback& callback) override { + net::CompletionOnceCallback callback) override { DCHECK(accept_callback_.is_null()); if (accept_result_ == net::OK && mode_ == net::SYNCHRONOUS) *socket = CreateMockAcceptSocket(); if (mode_ == net::ASYNC || accept_result_ == net::ERR_IO_PENDING) { accept_socket_ = socket; - accept_callback_ = callback; + accept_callback_ = std::move(callback); } run_loop_.Quit(); @@ -108,7 +107,7 @@ net::IoMode mode_ = net::SYNCHRONOUS; int accept_result_ = net::OK; - net::CompletionCallback accept_callback_; + net::CompletionOnceCallback accept_callback_; std::unique_ptr<net::StreamSocket>* accept_socket_; base::RunLoop run_loop_; std::vector<std::unique_ptr<net::StaticSocketDataProvider>> data_providers_;
diff --git a/storage/browser/blob/view_blob_internals_job.cc b/storage/browser/blob/view_blob_internals_job.cc index e18a815..00e9e051 100644 --- a/storage/browser/blob/view_blob_internals_job.cc +++ b/storage/browser/blob/view_blob_internals_job.cc
@@ -180,11 +180,10 @@ weak_factory_.InvalidateWeakPtrs(); } -int ViewBlobInternalsJob::GetData( - std::string* mime_type, - std::string* charset, - std::string* data, - const net::CompletionCallback& callback) const { +int ViewBlobInternalsJob::GetData(std::string* mime_type, + std::string* charset, + std::string* data, + net::CompletionOnceCallback callback) const { mime_type->assign("text/html"); charset->assign("UTF-8");
diff --git a/storage/browser/blob/view_blob_internals_job.h b/storage/browser/blob/view_blob_internals_job.h index 746361c..4ad9a2b5 100644 --- a/storage/browser/blob/view_blob_internals_job.h +++ b/storage/browser/blob/view_blob_internals_job.h
@@ -9,6 +9,7 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" +#include "net/base/completion_once_callback.h" #include "net/url_request/url_request_simple_job.h" #include "storage/browser/storage_browser_export.h" @@ -34,7 +35,7 @@ int GetData(std::string* mime_type, std::string* charset, std::string* data, - const net::CompletionCallback& callback) const override; + net::CompletionOnceCallback callback) const override; bool IsRedirectResponse(GURL* location, int* http_status_code, bool* insecure_scheme_was_upgraded) override;
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index 553ec25..14cebf0 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -492,8 +492,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -1105,8 +1104,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": {
diff --git a/testing/buildbot/chromium.clang.json b/testing/buildbot/chromium.clang.json index 2243bab..51d8cc37 100644 --- a/testing/buildbot/chromium.clang.json +++ b/testing/buildbot/chromium.clang.json
@@ -257,8 +257,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -968,8 +967,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -1806,8 +1804,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -2966,8 +2963,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -4114,8 +4110,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -5114,8 +5109,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -5781,8 +5775,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -6448,8 +6441,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -7115,8 +7107,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -13019,8 +13010,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -13726,8 +13716,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -14403,8 +14392,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -15090,8 +15078,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -15787,8 +15774,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -16365,8 +16351,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -16944,8 +16929,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -17503,8 +17487,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -18170,8 +18153,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -18837,8 +18819,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -19504,8 +19485,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -20171,8 +20151,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -20838,8 +20817,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -21505,8 +21483,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -22172,8 +22149,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -22839,8 +22815,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -23506,8 +23481,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -24206,8 +24180,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -25015,8 +24988,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": {
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index c319d4d9..7400c4cf 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -464,8 +464,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -1015,8 +1014,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -1453,8 +1451,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -1634,8 +1631,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -2126,8 +2122,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -4265,8 +4260,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -5030,8 +5024,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor,ViewsBrowserWindows", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor,ViewsBrowserWindows" ], "name": "viz_content_unittests", "swarming": {
diff --git a/testing/buildbot/chromium.linux.json b/testing/buildbot/chromium.linux.json index 4f55a25..d34c4a3 100644 --- a/testing/buildbot/chromium.linux.json +++ b/testing/buildbot/chromium.linux.json
@@ -1083,8 +1083,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -1923,8 +1922,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -2664,8 +2662,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -3558,8 +3555,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": {
diff --git a/testing/buildbot/chromium.mac.json b/testing/buildbot/chromium.mac.json index 5908e7b..637de4dd 100644 --- a/testing/buildbot/chromium.mac.json +++ b/testing/buildbot/chromium.mac.json
@@ -147,8 +147,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -745,8 +744,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -1476,8 +1474,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -2466,8 +2463,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -3059,8 +3055,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": {
diff --git a/testing/buildbot/chromium.memory.json b/testing/buildbot/chromium.memory.json index f8b0cd8..0d7954c 100644 --- a/testing/buildbot/chromium.memory.json +++ b/testing/buildbot/chromium.memory.json
@@ -2825,7 +2825,6 @@ { "args": [ "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter", "--test-launcher-batch-limit=1", "--test-launcher-print-test-stdio=always" ], @@ -3717,8 +3716,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -4407,8 +4405,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -5019,8 +5016,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -5664,8 +5660,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -6249,8 +6244,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -6759,8 +6753,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": {
diff --git a/testing/buildbot/chromium.win.json b/testing/buildbot/chromium.win.json index c70b406..3466317 100644 --- a/testing/buildbot/chromium.win.json +++ b/testing/buildbot/chromium.win.json
@@ -213,8 +213,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -950,8 +949,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -1560,8 +1558,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -2296,8 +2293,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": { @@ -3032,8 +3028,7 @@ }, { "args": [ - "--enable-features=VizDisplayCompositor", - "--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter" + "--enable-features=VizDisplayCompositor" ], "name": "viz_content_unittests", "swarming": {
diff --git a/testing/buildbot/filters/BUILD.gn b/testing/buildbot/filters/BUILD.gn index d21a5271..705430e 100644 --- a/testing/buildbot/filters/BUILD.gn +++ b/testing/buildbot/filters/BUILD.gn
@@ -42,14 +42,6 @@ ] } -source_set("content_unittests_filters") { - testonly = true - - data = [ - "//testing/buildbot/filters/viz.content_unittests.filter", - ] -} - source_set("fuchsia_filters") { data = [ "//testing/buildbot/filters/fuchsia.content_unittests.filter",
diff --git a/testing/buildbot/filters/viz.content_unittests.filter b/testing/buildbot/filters/viz.content_unittests.filter deleted file mode 100644 index 66f4142..0000000 --- a/testing/buildbot/filters/viz.content_unittests.filter +++ /dev/null
@@ -1,2 +0,0 @@ -# TODO(crbug.com/601869): Reflector needs to be rewritten for viz. --ReflectorImplTest.*
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index 59072ccf4..e900605 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -1891,7 +1891,6 @@ 'viz_content_unittests': { 'args': [ '--enable-features=VizDisplayCompositor', - '--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter', ], 'test': 'content_unittests', } @@ -2076,7 +2075,6 @@ 'viz_content_unittests': { 'args': [ '--enable-features=VizDisplayCompositor', - '--test-launcher-filter-file=../../testing/buildbot/filters/viz.content_unittests.filter', ], 'test': 'content_unittests', },
diff --git a/third_party/WebKit/LayoutTests/SlowTests b/third_party/WebKit/LayoutTests/SlowTests index d9a0ca8..620c5c9 100644 --- a/third_party/WebKit/LayoutTests/SlowTests +++ b/third_party/WebKit/LayoutTests/SlowTests
@@ -407,6 +407,7 @@ crbug.com/866850 [ Linux Mac ] virtual/gpu/fast/canvas/canvas-blend-image.html [ Slow ] crbug.com/866850 [ Linux Mac ] virtual/gpu/fast/canvas/canvas-blending-color-over-image.html [ Slow ] crbug.com/866850 [ Linux Mac ] virtual/gpu/fast/canvas/canvas-blending-gradient-over-image.html [ Slow ] +crbug.com/866850 [ Linux Mac ] virtual/gpu/fast/canvas/canvas-blending-gradient-over-pattern.html [ Slow ] crbug.com/866850 [ Linux Mac ] virtual/gpu/fast/canvas/canvas-blending-image-over-gradient.html [ Slow ] crbug.com/866850 [ Linux Mac ] virtual/gpu/fast/canvas/canvas-blending-image-over-image.html [ Slow ] crbug.com/866850 [ Linux Mac ] virtual/gpu/fast/canvas/canvas-blending-image-over-pattern.html [ Slow ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index fa6ce33..870cbfc 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -4783,7 +4783,7 @@ crbug.com/824539 [ Android ] editing/selection/leave-requested-block.html [ Failure ] crbug.com/824539 [ Android ] editing/selection/previous-line-position.html [ Failure ] crbug.com/824539 [ Android ] editing/style/block-styles-007.html [ Failure ] -crbug.com/824539 [ Android ] external/wpt/bluetooth/requestDevice/canonicalizeFilter/no-arguments.https.html [ Failure ] +crbug.com/824539 [ Android ] external/wpt/bluetooth/requestDevice/canonicalizeFilter/no-arguments.https.html [ Crash Failure ] crbug.com/824539 [ Android ] external/wpt/dom/historical.html [ Failure ] crbug.com/824539 [ Android ] external/wpt/gamepad/idlharness.html [ Failure ] crbug.com/824539 [ Android ] external/wpt/input-events/idlharness.html [ Failure ] @@ -4817,7 +4817,7 @@ crbug.com/824539 [ Android ] fast/css3-text/css3-text-decoration/text-decoration-style-inherit.html [ Failure ] crbug.com/824539 [ Android ] fast/css3-text/css3-text-decoration/text-decoration-style.html [ Failure ] crbug.com/824539 [ Android ] fast/events/reveal-link-when-focused.html [ Failure ] -crbug.com/824539 [ Android ] fast/events/wheel/wheelevent-in-text-node.html [ Failure ] +crbug.com/824539 [ Android ] fast/events/wheel/wheelevent-in-text-node.html [ Crash Failure ] crbug.com/824539 [ Android ] fast/forms/date/date-chooseronly-defaultValue.html [ Failure ] crbug.com/824539 [ Android ] fast/forms/date-multiple-fields/date-multiple-fields-ax-value-changed-notification.html [ Failure ] crbug.com/824539 [ Android ] fast/harness/perftests/perf-runner-compute-statistics.html [ Failure ] @@ -4837,6 +4837,7 @@ crbug.com/824539 [ Android ] fast/replaced/selection-rect-transform.html [ Failure ] crbug.com/824539 [ Android ] fast/selectors/018.html [ Failure ] crbug.com/824539 [ Android ] fast/selectors/061.html [ Failure ] +crbug.com/824539 [ Android ] fast/shapes/crash-caused-by-dirtying-a-shape-while-computing-it-requires-a-long-filename-to-crash.html [ Crash Failure ] crbug.com/824539 [ Android ] fast/speech/scripted/speechrecognition-re-restart.html [ Failure ] crbug.com/824539 [ Android ] fast/table/border-collapsing/004-vertical.html [ Failure ] crbug.com/824539 [ Android ] fast/table/border-collapsing/004.html [ Failure ] @@ -4849,7 +4850,7 @@ crbug.com/824539 [ Android ] fast/writing-mode/english-lr-text.html [ Failure ] crbug.com/824539 [ Android ] fast/xmlhttprequest/xmlhttprequest-missing-file-exception.html [ Failure ] crbug.com/824539 [ Android ] http/tests/plugins/navigator-plugins-in-cross-origin-frame.html [ Failure ] -crbug.com/824539 [ Android ] http/tests/security/local-JavaScript-from-remote.html [ Failure ] +crbug.com/824539 [ Android ] http/tests/security/local-JavaScript-from-remote.html [ Crash Failure ] crbug.com/824539 [ Android ] images/imagemap-focus-ring-outline-color-not-inherited-from-map.html [ Failure ] crbug.com/824539 [ Android ] images/size-failure.html [ Failure ] crbug.com/824539 [ Android ] paint/invalidation/shadow-multiple.html [ Failure ] @@ -4871,7 +4872,7 @@ crbug.com/824539 [ Android ] tables/mozilla_expected_failures/bugs/bug1055-2.html [ Failure ] crbug.com/824539 [ Android ] tables/mozilla_expected_failures/bugs/bug2479-5.html [ Failure ] crbug.com/824539 [ Android ] transforms/transformed-caret.html [ Failure ] -crbug.com/824539 [ Android ] virtual/layout_ng/fast/block/margin-collapse/019.html [ Failure ] +crbug.com/824539 [ Android ] virtual/layout_ng/fast/block/margin-collapse/019.html [ Crash Failure ] # Sheriff 2018-07-30 crbug.com/866166 virtual/gpu-rasterization/images/color-profile-image-filter-all.html [ Pass Timeout ]
diff --git a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json index 6e964bf..5daa56a 100644 --- a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json +++ b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json
@@ -103669,11 +103669,6 @@ {} ] ], - "background-fetch/get-ids.https.js": [ - [ - {} - ] - ], "background-fetch/idlharness.any-expected.txt": [ [ {} @@ -103694,31 +103689,6 @@ {} ] ], - "background-fetch/interfaces-worker.https-expected.txt": [ - [ - {} - ] - ], - "background-fetch/interfaces.https-expected.txt": [ - [ - {} - ] - ], - "background-fetch/interfaces.https.any-expected.txt": [ - [ - {} - ] - ], - "background-fetch/interfaces.https.any.worker-expected.txt": [ - [ - {} - ] - ], - "background-fetch/interfaces.https.worker-expected.txt": [ - [ - {} - ] - ], "background-fetch/resources/feature-name.txt": [ [ {} @@ -123379,11 +123349,6 @@ {} ] ], - "css/css-images/idlharness-expected.txt": [ - [ - {} - ] - ], "css/css-images/linear-gradient-ref.html": [ [ {} @@ -125304,11 +125269,6 @@ {} ] ], - "css/css-properties-values-api/idlharness-expected.txt": [ - [ - {} - ] - ], "css/css-properties-values-api/register-property-syntax-parsing-expected.txt": [ [ {} @@ -157729,6 +157689,11 @@ {} ] ], + "html/user-activation/resources/child-three.html": [ + [ + {} + ] + ], "html/user-activation/resources/child-two.html": [ [ {} @@ -184076,12 +184041,6 @@ {} ] ], - "background-fetch/credentials-in-url.https.window.js": [ - [ - "/background-fetch/credentials-in-url.https.window.html", - {} - ] - ], "background-fetch/dangling-markup.https.window.js": [ [ "/background-fetch/dangling-markup.https.window.html", @@ -184094,6 +184053,18 @@ {} ] ], + "background-fetch/get-ids.https.window.js": [ + [ + "/background-fetch/get-ids.https.window.html", + {} + ] + ], + "background-fetch/get.https.window.js": [ + [ + "/background-fetch/get.https.window.html", + {} + ] + ], "background-fetch/idlharness.any.js": [ [ "/background-fetch/idlharness.any.html", @@ -224362,6 +224333,20 @@ } ] ], + "html/user-activation/message-event-activation-api-iframe-cross-origin.sub.tentative.html": [ + [ + "/html/user-activation/message-event-activation-api-iframe-cross-origin.sub.tentative.html", + { + "testdriver": true + } + ] + ], + "html/user-activation/message-event-init.tentative.html": [ + [ + "/html/user-activation/message-event-init.tentative.html", + {} + ] + ], "html/webappapis/animation-frames/callback-exception.html": [ [ "/html/webappapis/animation-frames/callback-exception.html", @@ -272296,7 +272281,7 @@ "support" ], "BackgroundSync/interfaces.https.any.js": [ - "de3e6c1617c46a6c2c6142537ed2d0e1bcd953e2", + "983e811220ed51fe3be8ce5408bf74f3c3ff03a0", "testharness" ], "FileAPI/BlobURL/support/file_test2.txt": [ @@ -275647,21 +275632,21 @@ "c697f5804fd7f706ccc227cc93d0c4e895d7f067", "testharness" ], - "background-fetch/credentials-in-url.https.window.js": [ - "945d9713c5695072dc5b94f1671eed53d66005e1", - "testharness" - ], "background-fetch/dangling-markup.https.window.js": [ "63049632a7ddca3eac182885b516471dcb85e75b", "testharness" ], "background-fetch/fetch.https.window.js": [ - "a62e7ea112a381f24dd2c9cdec6a012dec9e41c3", + "dbf69eee810fa5fba92477761c0d328a2bdf8da8", "testharness" ], - "background-fetch/get-ids.https.js": [ - "6177ea08e069fd1aca85fd3d772a53022b07f519", - "support" + "background-fetch/get-ids.https.window.js": [ + "b14290f113e0f7a932de0f72acf410f8ec15563a", + "testharness" + ], + "background-fetch/get.https.window.js": [ + "9e67d998589db7661b347ba500b9633717bbc75c", + "testharness" ], "background-fetch/idlharness.any-expected.txt": [ "6d0c8ed4939faa52b94fede0968b379edca7daa5", @@ -275683,26 +275668,6 @@ "bc0333837b7e504edcc444ef0e41fcf6d97d6baf", "support" ], - "background-fetch/interfaces-worker.https-expected.txt": [ - "88211a0d44012d229af146366440ced5d12b0988", - "support" - ], - "background-fetch/interfaces.https-expected.txt": [ - "145c69b2dffb9739c14693f8aa2ab2226a16a565", - "support" - ], - "background-fetch/interfaces.https.any-expected.txt": [ - "8a5cf2119205440349c364ccdeaa65ce3cf42791", - "support" - ], - "background-fetch/interfaces.https.any.worker-expected.txt": [ - "66d01d6b1e71e7381f1a1b87b56372ffe850b27f", - "support" - ], - "background-fetch/interfaces.https.worker-expected.txt": [ - "be45725c15e69f8bd48e3f84a965b0347f399c5e", - "support" - ], "background-fetch/mixed-content-and-allowed-schemes.https.window.js": [ "5c8d022ff16664199c2c0f7c33df883653b4f254", "testharness" @@ -279948,7 +279913,7 @@ "testharness" ], "cookie-store/idlharness.tentative.https.html": [ - "043875184fa56ad41cda11e6f84314a7aebdb17f", + "3bb74ba503f22a63f48858609a0603e625bbf330", "testharness" ], "cookie-store/idlharness_serviceworker.js": [ @@ -300392,7 +300357,7 @@ "reftest" ], "css/css-conditional/idlharness-expected.txt": [ - "2f1d5114b539f4802fd053cfdbe29c8da0eed9eb", + "9fdc576b31ff289c6dd4a63d5f884ba9e8a75cb6", "support" ], "css/css-conditional/idlharness.html": [ @@ -314283,10 +314248,6 @@ "4b49a6bc4cfef048f3a4ac1d62feeb604e0d28a5", "reftest" ], - "css/css-images/idlharness-expected.txt": [ - "deb34377105c08e4511c5a4c8b90c58972679287", - "support" - ], "css/css-images/idlharness.html": [ "43a0b8582221d2cd3838fcf6ba93bc7198cbdbf1", "testharness" @@ -316080,11 +316041,11 @@ "support" ], "css/css-masking/idlharness-expected.txt": [ - "9b12d4c19096aabd22c41a794198d6502fa73121", + "b850b49ca285d54efe159eda8178ed06fcebe05d", "support" ], "css/css-masking/idlharness.html": [ - "527fb8b8884e00d898c047f092221af56211bbcd", + "b3db024a7684ed0d84222afaa17a04fd45c85ae3", "testharness" ], "css/css-masking/parsing/clip-invalid.html": [ @@ -317616,7 +317577,7 @@ "reftest" ], "css/css-paint-api/idlharness-expected.txt": [ - "4488d0663b26e9e4680a77f68923654690611129", + "81bf55ee7d1acb44bdb700a78227b14bff523a82", "support" ], "css/css-paint-api/idlharness.html": [ @@ -318215,10 +318176,6 @@ "f909f59cb961ca319c90f95a48ccd07b2b43d653", "support" ], - "css/css-properties-values-api/idlharness-expected.txt": [ - "87c147b50c1c39a5af7264ed70d2f7aa2cd459d2", - "support" - ], "css/css-properties-values-api/idlharness.html": [ "6a0f0abda50488832e11596f0cce2d99fea85403", "testharness" @@ -342736,11 +342693,11 @@ "support" ], "css/cssom-view/interfaces-expected.txt": [ - "44410a59b6c9a8183577a9b0696c0f453fc9b358", + "3bac99fc1c209be756dbb3d7bef14c4b37bfd155", "support" ], "css/cssom-view/interfaces.html": [ - "af6db1b54502f6174c644f06c19f39b8350add8d", + "75f26269a0b198f28bf0f659ada6ef6d104275a0", "testharness" ], "css/cssom-view/matchMedia.xht": [ @@ -343332,11 +343289,11 @@ "testharness" ], "css/cssom/interfaces-expected.txt": [ - "8013e3aad136dc05a1f33317b4e29df05dcd6f8b", + "7062565c01c5a7a8b1ef288f2fb58a9eb656f373", "support" ], "css/cssom/interfaces.html": [ - "42e325d3d7f6be7f557915072f61900ff611cef8", + "033ca163bff6dace55efb791987ee6ba9c9612cd", "testharness" ], "css/cssom/medialist-dynamic-001-ref.html": [ @@ -350624,7 +350581,7 @@ "testharness" ], "dom/nodes/Comment-Text-constructor.js": [ - "8a41979f83f6beb8074681b4b8838cd2b1fc9756", + "e1ab01a5c2c110b911f07991fe1d29bda70f36d5", "support" ], "dom/nodes/Comment-constructor.html": [ @@ -351424,7 +351381,7 @@ "testharness" ], "dom/nodes/Node-textContent.html": [ - "1a2b771be41a1ccb3af93f763d68c2df4007722a", + "3ec86641cefd2ac061b98cf1ae34952be3a5377d", "testharness" ], "dom/nodes/NodeList-Iterable.html": [ @@ -362288,23 +362245,23 @@ "support" ], "html/dom/interfaces.https.html": [ - "74c5559dd2e6ac17ba954943da006fb5fb484719", + "395e9a83ecd7d36d2530e0bc2793afa5369a14f0", "testharness" ], "html/dom/interfaces.https_exclude=(Document_Window_HTML._)-expected.txt": [ - "a8aab1bb62d72a0a5d18f0aacfe6c36177506f81", + "1ac6b25e140e43acb7021c603be92615c73edd61", "support" ], "html/dom/interfaces.https_include=(Document_Window)-expected.txt": [ - "30721287038b85331e3655a215e59106a7a47347", + "7b7a96df98b82ffd3f2e82b5fe33426b11266147", "support" ], "html/dom/interfaces.https_include=HTML._-expected.txt": [ - "add0d4f4fb9712a32d64ab2dd8883c2e5de81659", + "43c1e6241776cbe0b9b2368b95a4b99707146a2d", "support" ], "html/dom/interfaces.worker-expected.txt": [ - "756cb7e7ff6bf84a408b301c5d20cec93a2fecc0", + "ad36b6095529809c4b0a6dee7c752a7b349e069e", "support" ], "html/dom/interfaces.worker.js": [ @@ -376747,10 +376704,22 @@ "6383438f2069930b8f7fe684c5a2850d138e6073", "manual" ], + "html/user-activation/message-event-activation-api-iframe-cross-origin.sub.tentative.html": [ + "ec574e39708e9abd0f170d0f970dd942d2be5d96", + "testharness" + ], + "html/user-activation/message-event-init.tentative.html": [ + "a93ae5cddb67fac749e1f613ff527bf71d487b92", + "testharness" + ], "html/user-activation/resources/child-one.html": [ "9d00ea8b452c936983e9c334bdb9722608807555", "support" ], + "html/user-activation/resources/child-three.html": [ + "9ff9b90778de6f471f771e907f5db9f00313f417", + "support" + ], "html/user-activation/resources/child-two.html": [ "3789d0029711f4333e301955d4ff4b8b35a581b6", "support" @@ -378752,7 +378721,7 @@ "support" ], "interfaces/cssom.idl": [ - "42c8e1cb0e7fbc5bb6f8a811b73554e3b72a6abd", + "27d09c6b0d02ef47b0a2037280a50939188411dd", "support" ], "interfaces/dedicated-workers.idl": [ @@ -405048,7 +405017,7 @@ "support" ], "subresource-integrity/idlharness.window-expected.txt": [ - "851a3e3f16caaecf01070823edb81c315b99ba05", + "b381140811788a04d374a4fc0beea2ac9c222f69", "support" ], "subresource-integrity/idlharness.window.js": [ @@ -410092,7 +410061,7 @@ "support" ], "webrtc/RTCPeerConnection-transceivers.https.html": [ - "3348593a64b85c7fa3778e1862a9aa631615bffd", + "6d9e553a0938aa1525448be0dbf0140a04da3a0a", "testharness" ], "webrtc/RTCPeerConnectionIceEvent-constructor-expected.txt": [
diff --git a/third_party/WebKit/LayoutTests/external/wpt/BackgroundSync/interfaces.https.any.js b/third_party/WebKit/LayoutTests/external/wpt/BackgroundSync/interfaces.https.any.js index aa8ed77b..325bef8e 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/BackgroundSync/interfaces.https.any.js +++ b/third_party/WebKit/LayoutTests/external/wpt/BackgroundSync/interfaces.https.any.js
@@ -5,21 +5,11 @@ // https://wicg.github.io/BackgroundSync/spec/ -promise_test(async () => { - const srcs = [ - 'BackgroundSync', - 'service-workers', - 'html', - 'dom' - ]; - const [idl, sw, html, dom] = await Promise.all( - srcs.map(i => fetch(`/interfaces/${i}.idl`).then(r => r.text()))); - - const idlArray = new IdlArray(); - idlArray.add_idls(idl); - idlArray.add_dependency_idls(sw); - idlArray.add_dependency_idls(html); - idlArray.add_dependency_idls(dom); - idlArray.test(); - done(); -}, 'Background Sync interfaces.'); +idl_test( + ['BackgroundSync'], + ['service-workers', 'html', 'dom'], + idlArray => { + // TODO: Objects + }, + 'Background Sync interfaces.' +);
diff --git a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/credentials-in-url.https.window.js b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/credentials-in-url.https.window.js deleted file mode 100644 index df9a662..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/credentials-in-url.https.window.js +++ /dev/null
@@ -1,32 +0,0 @@ -// META: script=/service-workers/service-worker/resources/test-helpers.sub.js -// META: script=resources/utils.js -'use strict'; - -// "If parsedURL includes credentials, then throw a TypeError." -// https://fetch.spec.whatwg.org/#dom-request -// (Added by https://github.com/whatwg/fetch/issues/26). -// "A URL includes credentials if its username or password is not the empty -// string." -// https://url.spec.whatwg.org/#include-credentials - -backgroundFetchTest((t, bgFetch) => { - return bgFetch.fetch(uniqueId(), 'https://example.com'); -}, 'fetch without credentials in URL should register ok'); - -backgroundFetchTest((t, bgFetch) => { - return promise_rejects( - t, new TypeError(), - bgFetch.fetch(uniqueId(), 'https://username:password@example.com')); -}, 'fetch with username and password in URL should reject'); - -backgroundFetchTest((t, bgFetch) => { - return promise_rejects( - t, new TypeError(), - bgFetch.fetch(uniqueId(), 'https://username:@example.com')); -}, 'fetch with username and empty password in URL should reject'); - -backgroundFetchTest((t, bgFetch) => { - return promise_rejects( - t, new TypeError(), - bgFetch.fetch(uniqueId(), 'https://:password@example.com')); -}, 'fetch with empty username and password in URL should reject');
diff --git a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/fetch.https.window.js b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/fetch.https.window.js index 4cda0efe..cca6328 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/fetch.https.window.js +++ b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/fetch.https.window.js
@@ -5,10 +5,67 @@ // Covers basic functionality provided by BackgroundFetchManager.fetch(). // https://wicg.github.io/background-fetch/#background-fetch-manager-fetch +promise_test(async test => { + // 6.3.1.9.2: If |registration|’s active worker is null, then reject promise + // with a TypeError and abort these steps. + const script = 'resources/sw.js'; + const scope = 'resources/scope' + location.pathname; + + const serviceWorkerRegistration = + await service_worker_unregister_and_register(test, script, scope); + + assert_equals( + serviceWorkerRegistration.active, null, + 'There must not be an activated worker'); + + await promise_rejects( + test, new TypeError(), + serviceWorkerRegistration.backgroundFetch.fetch( + uniqueId(), ['resources/sw.js']), + 'fetch() must reject on pending and installing workers'); + +}, 'Background Fetch requires an activated Service Worker'); + +backgroundFetchTest(async (test, backgroundFetch) => { + // 6.3.1.6: If |requests| is empty, then return a promise rejected with a + // TypeError. + await promise_rejects( + test, new TypeError(), backgroundFetch.fetch(uniqueId(), []), + 'Empty sequences are treated as NULL'); + + // 6.3.1.7.1: Let |internalRequest| be the request of the result of invoking + // the Request constructor with |request|. If this throws an + // exception, return a promise rejected with the exception. + await promise_rejects( + test, new TypeError(), + backgroundFetch.fetch(uniqueId(), 'https://user:pass@domain/secret.txt'), + 'Exceptions thrown in the Request constructor are rethrown'); + + // 6.3.1.7.2: If |internalRequest|’s mode is "no-cors", then return a + // promise rejected with a TypeError. + { + const request = new Request('resources/sw.js', {mode: 'no-cors'}); + await promise_rejects( + test, new TypeError(), backgroundFetch.fetch(uniqueId(), request), + 'Requests must not be in no-cors mode'); + } + +}, 'Argument verification is done for BackgroundFetchManager.fetch()'); + +backgroundFetchTest(async (test, backgroundFetch) => { + // 6.3.1.9.2: If |bgFetchMap[id]| exists, reject |promise| with a TypeError + // and abort these steps. + return promise_rejects(test, new TypeError(), Promise.all([ + backgroundFetch.fetch('my-id', 'resources/sw.js'), + backgroundFetch.fetch('my-id', 'resources/feature-name.txt') + ])); + +}, 'IDs must be unique among active Background Fetch registrations'); + backgroundFetchTest(async (test, backgroundFetch) => { const registrationId = uniqueId(); - const registration = await backgroundFetch.fetch( - registrationId, 'resources/feature-name.txt'); + const registration = + await backgroundFetch.fetch(registrationId, 'resources/feature-name.txt'); assert_equals(registration.id, registrationId); assert_equals(registration.uploadTotal, 0);
diff --git a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/get-ids.https.js b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/get-ids.https.js deleted file mode 100644 index ace782d..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/get-ids.https.js +++ /dev/null
@@ -1,19 +0,0 @@ -// META: script=/service-workers/service-worker/resources/test-helpers.sub.js -// META: script=resources/utils.js -'use strict'; - -// Covers functionality provided by BackgroundFetchManager.getIds(), which -// exposes the keys of active background fetches. -// -// https://wicg.github.io/background-fetch/#background-fetch-manager-getIds - -backgroundFetchTest(async (test, backgroundFetch) => { - const registrationId = uniqueId(); - const registration = await backgroundFetch.fetch( - registrationId, 'resources/feature-name.txt'); - - assert_equals(registration.id, registrationId); - - assert_true((await backgroundFetch.getIds()).includes(registrationId)); - -}, 'The BackgroundFetchManager exposes active fetches');
diff --git a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/get-ids.https.window.js b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/get-ids.https.window.js new file mode 100644 index 0000000..28f5bc3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/get-ids.https.window.js
@@ -0,0 +1,45 @@ +// META: script=/service-workers/service-worker/resources/test-helpers.sub.js +// META: script=resources/utils.js +'use strict'; + +// Covers functionality provided by BackgroundFetchManager.getIds(), which +// exposes the keys of active background fetches. +// +// https://wicg.github.io/background-fetch/#background-fetch-manager-getIds + +promise_test(async test => { + const script = 'resources/sw.js'; + const scope = 'resources/scope' + location.pathname; + + const serviceWorkerRegistration = + await service_worker_unregister_and_register(test, script, scope); + + assert_equals( + serviceWorkerRegistration.active, null, + 'There must not be an activated worker'); + + const ids = await serviceWorkerRegistration.backgroundFetch.getIds(); + assert_equals(ids.length, 0); + +}, 'BackgroundFetchManager.getIds() does not require an activated worker'); + +backgroundFetchTest(async (test, backgroundFetch) => { + // There should not be any active background fetches at this point. + { + const ids = await backgroundFetch.getIds(); + assert_equals(ids.length, 0); + } + + const registrationId = uniqueId(); + const registration = + await backgroundFetch.fetch(registrationId, 'resources/feature-name.txt'); + assert_equals(registration.id, registrationId); + + // The |registrationId| should be active, and thus be included in getIds(). + { + const ids = await backgroundFetch.getIds(); + assert_equals(ids.length, 1); + assert_equals(ids[0], registrationId); + } + +}, 'The BackgroundFetchManager exposes active fetches');
diff --git a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/get.https.window.js b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/get.https.window.js new file mode 100644 index 0000000..0b272db --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/get.https.window.js
@@ -0,0 +1,58 @@ +// META: script=/service-workers/service-worker/resources/test-helpers.sub.js +// META: script=resources/utils.js +'use strict'; + +// Covers functionality provided by BackgroundFetchManager.get(), which +// exposes the keys of active background fetches. +// +// https://wicg.github.io/background-fetch/#background-fetch-manager-get + +promise_test(async test => { + const script = 'resources/sw.js'; + const scope = 'resources/scope' + location.pathname; + + const serviceWorkerRegistration = + await service_worker_unregister_and_register(test, script, scope); + + assert_equals( + serviceWorkerRegistration.active, null, + 'There must not be an activated worker'); + + const registration = await serviceWorkerRegistration.backgroundFetch.get('x'); + assert_equals(registration, undefined); + +}, 'BackgroundFetchManager.get() does not require an activated worker'); + +backgroundFetchTest(async (test, backgroundFetch) => { + // The |id| parameter to the BackgroundFetchManager.get() method is required. + await promise_rejects(test, new TypeError(), backgroundFetch.get()); + + const registration = await backgroundFetch.get('my-id'); + assert_equals(registration, undefined); + +}, 'Getting non-existing registrations yields `undefined`'); + +backgroundFetchTest(async (test, backgroundFetch) => { + const registrationId = uniqueId(); + const registration = await backgroundFetch.fetch( + registrationId, 'resources/feature-name.txt', {downloadTotal: 1234}); + + assert_equals(registration.id, registrationId); + assert_equals(registration.uploadTotal, 0); + assert_equals(registration.uploaded, 0); + assert_equals(registration.downloadTotal, 1234); + // Skip `downloaded`, as the transfer may have started already. + + const secondRegistration = await backgroundFetch.get(registrationId); + assert_not_equals(secondRegistration, null); + + assert_equals(secondRegistration.id, registration.id); + assert_equals(secondRegistration.uploadTotal, registration.uploadTotal); + assert_equals(secondRegistration.uploaded, registration.uploaded); + assert_equals(secondRegistration.downloadTotal, registration.downloadTotal); + + // While the transfer might have started, both BackgroundFetchRegistration + // objects should have the latest progress values. + assert_equals(secondRegistration.downloaded, registration.downloaded); + +}, 'Getting an existing registration has the expected values');
diff --git a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces-worker.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces-worker.https-expected.txt deleted file mode 100644 index 58dcb19..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces-worker.https-expected.txt +++ /dev/null
@@ -1,127 +0,0 @@ -This is a testharness.js-based test. -PASS Service Worker-scoped tests. -PASS Exposed interfaces in a Service Worker. -PASS Partial interface ServiceWorkerGlobalScope: original interface defined -PASS Partial interface ServiceWorkerRegistration: original interface defined -FAIL ServiceWorkerRegistration interface: existence and properties of interface object assert_false: expected false got true -FAIL ServiceWorkerGlobalScope interface: attribute onbackgroundfetched assert_true: The prototype object must have a property "onbackgroundfetched" expected true got false -PASS Unscopable handled correctly for onbackgroundfetched property on ServiceWorkerGlobalScope -FAIL ServiceWorkerGlobalScope interface: attribute onbackgroundfetchfail assert_true: The prototype object must have a property "onbackgroundfetchfail" expected true got false -PASS Unscopable handled correctly for onbackgroundfetchfail property on ServiceWorkerGlobalScope -FAIL ServiceWorkerGlobalScope interface: attribute onbackgroundfetchabort assert_true: The prototype object must have a property "onbackgroundfetchabort" expected true got false -PASS Unscopable handled correctly for onbackgroundfetchabort property on ServiceWorkerGlobalScope -FAIL ServiceWorkerGlobalScope interface: attribute onbackgroundfetchclick assert_true: The prototype object must have a property "onbackgroundfetchclick" expected true got false -PASS Unscopable handled correctly for onbackgroundfetchclick property on ServiceWorkerGlobalScope -FAIL ExtendableEvent interface: existence and properties of interface object assert_false: expected false got true -PASS BackgroundFetchManager interface: existence and properties of interface object -PASS BackgroundFetchManager interface object length -PASS BackgroundFetchManager interface object name -PASS BackgroundFetchManager interface: existence and properties of interface prototype object -PASS BackgroundFetchManager interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchManager interface: existence and properties of interface prototype object's @@unscopables property -PASS BackgroundFetchManager interface: operation fetch(DOMString, [object Object],[object Object], BackgroundFetchOptions) -PASS Unscopable handled correctly for fetch(DOMString, [object Object],[object Object], BackgroundFetchOptions) on BackgroundFetchManager -PASS BackgroundFetchManager interface: operation get(DOMString) -PASS Unscopable handled correctly for get(DOMString) on BackgroundFetchManager -PASS BackgroundFetchManager interface: operation getIds() -PASS Unscopable handled correctly for getIds() on BackgroundFetchManager -PASS BackgroundFetchRegistration interface: existence and properties of interface object -PASS BackgroundFetchRegistration interface object length -PASS BackgroundFetchRegistration interface object name -PASS BackgroundFetchRegistration interface: existence and properties of interface prototype object -PASS BackgroundFetchRegistration interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchRegistration interface: existence and properties of interface prototype object's @@unscopables property -PASS BackgroundFetchRegistration interface: attribute id -PASS Unscopable handled correctly for id property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute uploadTotal -PASS Unscopable handled correctly for uploadTotal property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute uploaded -PASS Unscopable handled correctly for uploaded property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute downloadTotal -PASS Unscopable handled correctly for downloadTotal property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute downloaded -PASS Unscopable handled correctly for downloaded property on BackgroundFetchRegistration -FAIL BackgroundFetchRegistration interface: attribute activeFetches assert_true: The prototype object must have a property "activeFetches" expected true got false -PASS Unscopable handled correctly for activeFetches property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute onprogress -PASS Unscopable handled correctly for onprogress property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: operation abort() -PASS Unscopable handled correctly for abort() on BackgroundFetchRegistration -PASS BackgroundFetchFetch interface: existence and properties of interface object -PASS BackgroundFetchFetch interface object length -PASS BackgroundFetchFetch interface object name -PASS BackgroundFetchFetch interface: existence and properties of interface prototype object -PASS BackgroundFetchFetch interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchFetch interface: existence and properties of interface prototype object's @@unscopables property -PASS BackgroundFetchFetch interface: attribute request -PASS Unscopable handled correctly for request property on BackgroundFetchFetch -FAIL BackgroundFetchActiveFetches interface: existence and properties of interface object assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface object length assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface object name assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface: existence and properties of interface prototype object assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface: operation match(RequestInfo) assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -PASS Unscopable handled correctly for match(RequestInfo) on BackgroundFetchActiveFetches -FAIL BackgroundFetchActiveFetches interface: operation values() assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -PASS Unscopable handled correctly for values() on BackgroundFetchActiveFetches -FAIL BackgroundFetchActiveFetch interface: existence and properties of interface object assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface object length assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface object name assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface: existence and properties of interface prototype object assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface: attribute responseReady assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -PASS Unscopable handled correctly for responseReady property on BackgroundFetchActiveFetch -PASS BackgroundFetchEvent interface: existence and properties of interface object -PASS BackgroundFetchEvent interface object length -PASS BackgroundFetchEvent interface object name -PASS BackgroundFetchEvent interface: existence and properties of interface prototype object -PASS BackgroundFetchEvent interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchEvent interface: existence and properties of interface prototype object's @@unscopables property -PASS BackgroundFetchEvent interface: attribute id -PASS Unscopable handled correctly for id property on BackgroundFetchEvent -PASS BackgroundFetchSettledEvent interface: existence and properties of interface object -PASS BackgroundFetchSettledEvent interface object length -PASS BackgroundFetchSettledEvent interface object name -PASS BackgroundFetchSettledEvent interface: existence and properties of interface prototype object -PASS BackgroundFetchSettledEvent interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchSettledEvent interface: existence and properties of interface prototype object's @@unscopables property -PASS BackgroundFetchSettledEvent interface: attribute fetches -PASS Unscopable handled correctly for fetches property on BackgroundFetchSettledEvent -PASS BackgroundFetchSettledFetches interface: existence and properties of interface object -PASS BackgroundFetchSettledFetches interface object length -PASS BackgroundFetchSettledFetches interface object name -PASS BackgroundFetchSettledFetches interface: existence and properties of interface prototype object -PASS BackgroundFetchSettledFetches interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchSettledFetches interface: existence and properties of interface prototype object's @@unscopables property -PASS BackgroundFetchSettledFetches interface: operation match(RequestInfo) -PASS Unscopable handled correctly for match(RequestInfo) on BackgroundFetchSettledFetches -PASS BackgroundFetchSettledFetches interface: operation values() -PASS Unscopable handled correctly for values() on BackgroundFetchSettledFetches -PASS BackgroundFetchSettledFetch interface: existence and properties of interface object -FAIL BackgroundFetchSettledFetch interface object length assert_equals: wrong value for BackgroundFetchSettledFetch.length expected 0 but got 2 -PASS BackgroundFetchSettledFetch interface object name -PASS BackgroundFetchSettledFetch interface: existence and properties of interface prototype object -PASS BackgroundFetchSettledFetch interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchSettledFetch interface: existence and properties of interface prototype object's @@unscopables property -PASS BackgroundFetchSettledFetch interface: attribute response -PASS Unscopable handled correctly for response property on BackgroundFetchSettledFetch -PASS BackgroundFetchUpdateEvent interface: existence and properties of interface object -PASS BackgroundFetchUpdateEvent interface object length -PASS BackgroundFetchUpdateEvent interface object name -PASS BackgroundFetchUpdateEvent interface: existence and properties of interface prototype object -PASS BackgroundFetchUpdateEvent interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchUpdateEvent interface: existence and properties of interface prototype object's @@unscopables property -PASS BackgroundFetchUpdateEvent interface: operation updateUI(DOMString) -PASS Unscopable handled correctly for updateUI(DOMString) on BackgroundFetchUpdateEvent -PASS BackgroundFetchClickEvent interface: existence and properties of interface object -PASS BackgroundFetchClickEvent interface object length -PASS BackgroundFetchClickEvent interface object name -PASS BackgroundFetchClickEvent interface: existence and properties of interface prototype object -PASS BackgroundFetchClickEvent interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchClickEvent interface: existence and properties of interface prototype object's @@unscopables property -PASS BackgroundFetchClickEvent interface: attribute state -PASS Unscopable handled correctly for state property on BackgroundFetchClickEvent -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces.https-expected.txt deleted file mode 100644 index 9e61c390..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces.https-expected.txt +++ /dev/null
@@ -1,75 +0,0 @@ -This is a testharness.js-based test. -PASS Exposed interfaces in a Document. -PASS Partial interface ServiceWorkerGlobalScope: original interface defined -PASS Partial interface ServiceWorkerRegistration: original interface defined -PASS ServiceWorkerRegistration interface: attribute backgroundFetch -PASS Unscopable handled correctly for backgroundFetch property on ServiceWorkerRegistration -PASS ServiceWorkerGlobalScope interface: existence and properties of interface object -PASS BackgroundFetchManager interface: existence and properties of interface object -PASS BackgroundFetchManager interface object length -PASS BackgroundFetchManager interface object name -PASS BackgroundFetchManager interface: existence and properties of interface prototype object -PASS BackgroundFetchManager interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchManager interface: existence and properties of interface prototype object's @@unscopables property -PASS BackgroundFetchManager interface: operation fetch(DOMString, [object Object],[object Object], BackgroundFetchOptions) -PASS Unscopable handled correctly for fetch(DOMString, [object Object],[object Object], BackgroundFetchOptions) on BackgroundFetchManager -PASS BackgroundFetchManager interface: operation get(DOMString) -PASS Unscopable handled correctly for get(DOMString) on BackgroundFetchManager -PASS BackgroundFetchManager interface: operation getIds() -PASS Unscopable handled correctly for getIds() on BackgroundFetchManager -PASS BackgroundFetchRegistration interface: existence and properties of interface object -PASS BackgroundFetchRegistration interface object length -PASS BackgroundFetchRegistration interface object name -PASS BackgroundFetchRegistration interface: existence and properties of interface prototype object -PASS BackgroundFetchRegistration interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchRegistration interface: existence and properties of interface prototype object's @@unscopables property -PASS BackgroundFetchRegistration interface: attribute id -PASS Unscopable handled correctly for id property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute uploadTotal -PASS Unscopable handled correctly for uploadTotal property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute uploaded -PASS Unscopable handled correctly for uploaded property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute downloadTotal -PASS Unscopable handled correctly for downloadTotal property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute downloaded -PASS Unscopable handled correctly for downloaded property on BackgroundFetchRegistration -FAIL BackgroundFetchRegistration interface: attribute activeFetches assert_true: The prototype object must have a property "activeFetches" expected true got false -PASS Unscopable handled correctly for activeFetches property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute onprogress -PASS Unscopable handled correctly for onprogress property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: operation abort() -PASS Unscopable handled correctly for abort() on BackgroundFetchRegistration -PASS BackgroundFetchFetch interface: existence and properties of interface object -PASS BackgroundFetchFetch interface object length -PASS BackgroundFetchFetch interface object name -PASS BackgroundFetchFetch interface: existence and properties of interface prototype object -PASS BackgroundFetchFetch interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchFetch interface: existence and properties of interface prototype object's @@unscopables property -PASS BackgroundFetchFetch interface: attribute request -PASS Unscopable handled correctly for request property on BackgroundFetchFetch -FAIL BackgroundFetchActiveFetches interface: existence and properties of interface object assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface object length assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface object name assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface: existence and properties of interface prototype object assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface: operation match(RequestInfo) assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -PASS Unscopable handled correctly for match(RequestInfo) on BackgroundFetchActiveFetches -FAIL BackgroundFetchActiveFetches interface: operation values() assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -PASS Unscopable handled correctly for values() on BackgroundFetchActiveFetches -FAIL BackgroundFetchActiveFetch interface: existence and properties of interface object assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface object length assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface object name assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface: existence and properties of interface prototype object assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface: attribute responseReady assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -PASS Unscopable handled correctly for responseReady property on BackgroundFetchActiveFetch -PASS BackgroundFetchEvent interface: existence and properties of interface object -PASS BackgroundFetchSettledEvent interface: existence and properties of interface object -PASS BackgroundFetchSettledFetches interface: existence and properties of interface object -PASS BackgroundFetchSettledFetch interface: existence and properties of interface object -PASS BackgroundFetchUpdateEvent interface: existence and properties of interface object -PASS BackgroundFetchClickEvent interface: existence and properties of interface object -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces.https.any-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces.https.any-expected.txt deleted file mode 100644 index 0ef24b5..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces.https.any-expected.txt +++ /dev/null
@@ -1,77 +0,0 @@ -This is a testharness.js-based test. -PASS background-fetch interfaces -PASS Partial interface ServiceWorkerGlobalScope: original interface defined -PASS Partial interface ServiceWorkerRegistration: original interface defined -PASS BackgroundFetchManager interface: existence and properties of interface object -PASS BackgroundFetchManager interface object length -PASS BackgroundFetchManager interface object name -PASS BackgroundFetchManager interface: existence and properties of interface prototype object -PASS BackgroundFetchManager interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchManager interface: existence and properties of interface prototype object's @@unscopables property -PASS BackgroundFetchManager interface: operation fetch(DOMString, [object Object],[object Object], BackgroundFetchOptions) -PASS Unscopable handled correctly for fetch(DOMString, [object Object],[object Object], BackgroundFetchOptions) on BackgroundFetchManager -PASS BackgroundFetchManager interface: operation get(DOMString) -PASS Unscopable handled correctly for get(DOMString) on BackgroundFetchManager -PASS BackgroundFetchManager interface: operation getIds() -PASS Unscopable handled correctly for getIds() on BackgroundFetchManager -PASS BackgroundFetchRegistration interface: existence and properties of interface object -PASS BackgroundFetchRegistration interface object length -PASS BackgroundFetchRegistration interface object name -PASS BackgroundFetchRegistration interface: existence and properties of interface prototype object -PASS BackgroundFetchRegistration interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchRegistration interface: existence and properties of interface prototype object's @@unscopables property -PASS BackgroundFetchRegistration interface: attribute id -PASS Unscopable handled correctly for id property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute uploadTotal -PASS Unscopable handled correctly for uploadTotal property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute uploaded -PASS Unscopable handled correctly for uploaded property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute downloadTotal -PASS Unscopable handled correctly for downloadTotal property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute downloaded -PASS Unscopable handled correctly for downloaded property on BackgroundFetchRegistration -FAIL BackgroundFetchRegistration interface: attribute activeFetches assert_true: The prototype object must have a property "activeFetches" expected true got false -PASS Unscopable handled correctly for activeFetches property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute onprogress -PASS Unscopable handled correctly for onprogress property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: operation abort() -PASS Unscopable handled correctly for abort() on BackgroundFetchRegistration -PASS BackgroundFetchFetch interface: existence and properties of interface object -PASS BackgroundFetchFetch interface object length -PASS BackgroundFetchFetch interface object name -PASS BackgroundFetchFetch interface: existence and properties of interface prototype object -PASS BackgroundFetchFetch interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchFetch interface: existence and properties of interface prototype object's @@unscopables property -PASS BackgroundFetchFetch interface: attribute request -PASS Unscopable handled correctly for request property on BackgroundFetchFetch -FAIL BackgroundFetchActiveFetches interface: existence and properties of interface object assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface object length assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface object name assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface: existence and properties of interface prototype object assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface: operation match(RequestInfo) assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -PASS Unscopable handled correctly for match(RequestInfo) on BackgroundFetchActiveFetches -FAIL BackgroundFetchActiveFetches interface: operation values() assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -PASS Unscopable handled correctly for values() on BackgroundFetchActiveFetches -FAIL BackgroundFetchActiveFetch interface: existence and properties of interface object assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface object length assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface object name assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface: existence and properties of interface prototype object assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface: attribute responseReady assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -PASS Unscopable handled correctly for responseReady property on BackgroundFetchActiveFetch -PASS BackgroundFetchEvent interface: existence and properties of interface object -PASS BackgroundFetchSettledEvent interface: existence and properties of interface object -PASS BackgroundFetchSettledFetches interface: existence and properties of interface object -PASS BackgroundFetchSettledFetch interface: existence and properties of interface object -PASS BackgroundFetchUpdateEvent interface: existence and properties of interface object -PASS BackgroundFetchClickEvent interface: existence and properties of interface object -PASS ServiceWorkerRegistration interface: attribute backgroundFetch -PASS Unscopable handled correctly for backgroundFetch property on ServiceWorkerRegistration -PASS ServiceWorkerGlobalScope interface: existence and properties of interface object -PASS ExtendableEvent interface: existence and properties of interface object -PASS WorkerGlobalScope interface: existence and properties of interface object -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces.https.any.worker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces.https.any.worker-expected.txt deleted file mode 100644 index 7c6819c2f..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces.https.any.worker-expected.txt +++ /dev/null
@@ -1,76 +0,0 @@ -This is a testharness.js-based test. -PASS background-fetch interfaces -PASS Partial interface ServiceWorkerGlobalScope: original interface defined -PASS Partial interface ServiceWorkerRegistration: original interface defined -PASS BackgroundFetchManager interface: existence and properties of interface object -PASS BackgroundFetchManager interface object length -PASS BackgroundFetchManager interface object name -PASS BackgroundFetchManager interface: existence and properties of interface prototype object -PASS BackgroundFetchManager interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchManager interface: existence and properties of interface prototype object's @@unscopables property -PASS BackgroundFetchManager interface: operation fetch(DOMString, [object Object],[object Object], BackgroundFetchOptions) -PASS Unscopable handled correctly for fetch(DOMString, [object Object],[object Object], BackgroundFetchOptions) on BackgroundFetchManager -PASS BackgroundFetchManager interface: operation get(DOMString) -PASS Unscopable handled correctly for get(DOMString) on BackgroundFetchManager -PASS BackgroundFetchManager interface: operation getIds() -PASS Unscopable handled correctly for getIds() on BackgroundFetchManager -PASS BackgroundFetchRegistration interface: existence and properties of interface object -PASS BackgroundFetchRegistration interface object length -PASS BackgroundFetchRegistration interface object name -PASS BackgroundFetchRegistration interface: existence and properties of interface prototype object -PASS BackgroundFetchRegistration interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchRegistration interface: existence and properties of interface prototype object's @@unscopables property -PASS BackgroundFetchRegistration interface: attribute id -PASS Unscopable handled correctly for id property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute uploadTotal -PASS Unscopable handled correctly for uploadTotal property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute uploaded -PASS Unscopable handled correctly for uploaded property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute downloadTotal -PASS Unscopable handled correctly for downloadTotal property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute downloaded -PASS Unscopable handled correctly for downloaded property on BackgroundFetchRegistration -FAIL BackgroundFetchRegistration interface: attribute activeFetches assert_true: The prototype object must have a property "activeFetches" expected true got false -PASS Unscopable handled correctly for activeFetches property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute onprogress -PASS Unscopable handled correctly for onprogress property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: operation abort() -PASS Unscopable handled correctly for abort() on BackgroundFetchRegistration -PASS BackgroundFetchFetch interface: existence and properties of interface object -PASS BackgroundFetchFetch interface object length -PASS BackgroundFetchFetch interface object name -PASS BackgroundFetchFetch interface: existence and properties of interface prototype object -PASS BackgroundFetchFetch interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchFetch interface: existence and properties of interface prototype object's @@unscopables property -PASS BackgroundFetchFetch interface: attribute request -PASS Unscopable handled correctly for request property on BackgroundFetchFetch -FAIL BackgroundFetchActiveFetches interface: existence and properties of interface object assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface object length assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface object name assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface: existence and properties of interface prototype object assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface: operation match(RequestInfo) assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -PASS Unscopable handled correctly for match(RequestInfo) on BackgroundFetchActiveFetches -FAIL BackgroundFetchActiveFetches interface: operation values() assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -PASS Unscopable handled correctly for values() on BackgroundFetchActiveFetches -FAIL BackgroundFetchActiveFetch interface: existence and properties of interface object assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface object length assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface object name assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface: existence and properties of interface prototype object assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface: attribute responseReady assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -PASS Unscopable handled correctly for responseReady property on BackgroundFetchActiveFetch -PASS BackgroundFetchEvent interface: existence and properties of interface object -PASS BackgroundFetchSettledEvent interface: existence and properties of interface object -PASS BackgroundFetchSettledFetches interface: existence and properties of interface object -PASS BackgroundFetchSettledFetch interface: existence and properties of interface object -PASS BackgroundFetchUpdateEvent interface: existence and properties of interface object -PASS BackgroundFetchClickEvent interface: existence and properties of interface object -PASS ServiceWorkerRegistration interface: attribute backgroundFetch -PASS Unscopable handled correctly for backgroundFetch property on ServiceWorkerRegistration -PASS ServiceWorkerGlobalScope interface: existence and properties of interface object -PASS ExtendableEvent interface: existence and properties of interface object -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces.https.worker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces.https.worker-expected.txt deleted file mode 100644 index 7ab48ed9..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/background-fetch/interfaces.https.worker-expected.txt +++ /dev/null
@@ -1,82 +0,0 @@ -This is a testharness.js-based test. -PASS Exposed interfaces in a Service Worker. -PASS Partial interface ServiceWorkerGlobalScope: original interface defined -PASS Partial interface ServiceWorkerRegistration: original interface defined -FAIL ServiceWorkerRegistration interface: existence and properties of interface object assert_false: expected false got true -FAIL ServiceWorkerGlobalScope interface: attribute onbackgroundfetched assert_own_property: self does not have own property "ServiceWorkerGlobalScope" expected property "ServiceWorkerGlobalScope" missing -PASS Unscopable handled correctly for onbackgroundfetched property on ServiceWorkerGlobalScope -FAIL ServiceWorkerGlobalScope interface: attribute onbackgroundfetchfail assert_own_property: self does not have own property "ServiceWorkerGlobalScope" expected property "ServiceWorkerGlobalScope" missing -PASS Unscopable handled correctly for onbackgroundfetchfail property on ServiceWorkerGlobalScope -FAIL ServiceWorkerGlobalScope interface: attribute onbackgroundfetchabort assert_own_property: self does not have own property "ServiceWorkerGlobalScope" expected property "ServiceWorkerGlobalScope" missing -PASS Unscopable handled correctly for onbackgroundfetchabort property on ServiceWorkerGlobalScope -FAIL ServiceWorkerGlobalScope interface: attribute onbackgroundfetchclick assert_own_property: self does not have own property "ServiceWorkerGlobalScope" expected property "ServiceWorkerGlobalScope" missing -PASS Unscopable handled correctly for onbackgroundfetchclick property on ServiceWorkerGlobalScope -PASS ExtendableEvent interface: existence and properties of interface object -PASS BackgroundFetchManager interface: existence and properties of interface object -PASS BackgroundFetchManager interface object length -PASS BackgroundFetchManager interface object name -PASS BackgroundFetchManager interface: existence and properties of interface prototype object -PASS BackgroundFetchManager interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchManager interface: existence and properties of interface prototype object's @@unscopables property -PASS BackgroundFetchManager interface: operation fetch(DOMString, [object Object],[object Object], BackgroundFetchOptions) -PASS Unscopable handled correctly for fetch(DOMString, [object Object],[object Object], BackgroundFetchOptions) on BackgroundFetchManager -PASS BackgroundFetchManager interface: operation get(DOMString) -PASS Unscopable handled correctly for get(DOMString) on BackgroundFetchManager -PASS BackgroundFetchManager interface: operation getIds() -PASS Unscopable handled correctly for getIds() on BackgroundFetchManager -PASS BackgroundFetchRegistration interface: existence and properties of interface object -PASS BackgroundFetchRegistration interface object length -PASS BackgroundFetchRegistration interface object name -PASS BackgroundFetchRegistration interface: existence and properties of interface prototype object -PASS BackgroundFetchRegistration interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchRegistration interface: existence and properties of interface prototype object's @@unscopables property -PASS BackgroundFetchRegistration interface: attribute id -PASS Unscopable handled correctly for id property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute uploadTotal -PASS Unscopable handled correctly for uploadTotal property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute uploaded -PASS Unscopable handled correctly for uploaded property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute downloadTotal -PASS Unscopable handled correctly for downloadTotal property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute downloaded -PASS Unscopable handled correctly for downloaded property on BackgroundFetchRegistration -FAIL BackgroundFetchRegistration interface: attribute activeFetches assert_true: The prototype object must have a property "activeFetches" expected true got false -PASS Unscopable handled correctly for activeFetches property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: attribute onprogress -PASS Unscopable handled correctly for onprogress property on BackgroundFetchRegistration -PASS BackgroundFetchRegistration interface: operation abort() -PASS Unscopable handled correctly for abort() on BackgroundFetchRegistration -PASS BackgroundFetchFetch interface: existence and properties of interface object -PASS BackgroundFetchFetch interface object length -PASS BackgroundFetchFetch interface object name -PASS BackgroundFetchFetch interface: existence and properties of interface prototype object -PASS BackgroundFetchFetch interface: existence and properties of interface prototype object's "constructor" property -PASS BackgroundFetchFetch interface: existence and properties of interface prototype object's @@unscopables property -PASS BackgroundFetchFetch interface: attribute request -PASS Unscopable handled correctly for request property on BackgroundFetchFetch -FAIL BackgroundFetchActiveFetches interface: existence and properties of interface object assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface object length assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface object name assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface: existence and properties of interface prototype object assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -FAIL BackgroundFetchActiveFetches interface: operation match(RequestInfo) assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -PASS Unscopable handled correctly for match(RequestInfo) on BackgroundFetchActiveFetches -FAIL BackgroundFetchActiveFetches interface: operation values() assert_own_property: self does not have own property "BackgroundFetchActiveFetches" expected property "BackgroundFetchActiveFetches" missing -PASS Unscopable handled correctly for values() on BackgroundFetchActiveFetches -FAIL BackgroundFetchActiveFetch interface: existence and properties of interface object assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface object length assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface object name assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface: existence and properties of interface prototype object assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -FAIL BackgroundFetchActiveFetch interface: attribute responseReady assert_own_property: self does not have own property "BackgroundFetchActiveFetch" expected property "BackgroundFetchActiveFetch" missing -PASS Unscopable handled correctly for responseReady property on BackgroundFetchActiveFetch -PASS BackgroundFetchEvent interface: existence and properties of interface object -PASS BackgroundFetchSettledEvent interface: existence and properties of interface object -PASS BackgroundFetchSettledFetches interface: existence and properties of interface object -PASS BackgroundFetchSettledFetch interface: existence and properties of interface object -PASS BackgroundFetchUpdateEvent interface: existence and properties of interface object -PASS BackgroundFetchClickEvent interface: existence and properties of interface object -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookie-store/idlharness.tentative.https.html b/third_party/WebKit/LayoutTests/external/wpt/cookie-store/idlharness.tentative.https.html index b9cab34..864b699 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/cookie-store/idlharness.tentative.https.html +++ b/third_party/WebKit/LayoutTests/external/wpt/cookie-store/idlharness.tentative.https.html
@@ -9,54 +9,15 @@ <script> 'use strict'; -promise_test(async t => { - const urls = [ - '/interfaces/uievents.idl', - '/interfaces/dom.idl', - '/interfaces/html.idl', - '/interfaces/cookie-store.idl' - ]; - const [uievents, dom, html, cookie_store] = await Promise.all( - urls.map(url => fetch(url).then(r => r.text()))); - - const idl_array = new IdlArray(); - - // Dependencies of HTML - idl_array.add_untested_idls(dom, { only: [ - 'Event', - 'EventInit', - 'EventTarget', - 'HTMLCollection', - 'NodeList', - ] }); - idl_array.add_untested_idls('interface Document {};'); - idl_array.add_untested_idls('interface Element {};'); - idl_array.add_untested_idls('interface LinkStyle {};'); - idl_array.add_untested_idls('interface SVGElement {};'); - idl_array.add_untested_idls(html); - idl_array.add_untested_idls(uievents, { only: [ - 'UIEvent', - 'UIEventInit', - 'MouseEvent', - 'MouseEventInit', - 'EventModifierInit', - ] }); - - idl_array.add_untested_idls( - `dictionary ExtendableEventInit {};`); - idl_array.add_untested_idls( - `[Global=ExtendableEvent, Exposed=ServiceWorker] - interface ExtendableEvent : Event {};`); - idl_array.add_untested_idls( - `[Global=ServiceWorker, Exposed=ServiceWorker] - interface ServiceWorkerGlobalScope {};`); - - idl_array.add_idls(cookie_store); - - idl_array.add_objects({ - CookieStore: ["self.cookieStore"], - CookieChangeEvent: ["new CookieChangeEvent('change')"], - }); - idl_array.test(); -}, 'Interface test'); +idl_test( + ['cookie-store'], + ['SVG', 'service-workers', 'uievents', 'html', 'dom'], + idl_array => { + idl_array.add_objects({ + CookieStore: ['cookieStore'], + CookieChangeEvent: ['new CookieChangeEvent("change")'], + }); + }, + 'Interface test' +); </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-conditional/idlharness-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/css/css-conditional/idlharness-expected.txt index 4dd5d161..a654c2a2c8 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-conditional/idlharness-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-conditional/idlharness-expected.txt
@@ -1,7 +1,7 @@ This is a testharness.js-based test. PASS Test css-conditional IDL implementation PASS Partial interface CSSRule: original interface defined -PASS Partial interface CSS: original interface defined +FAIL Partial interface CSS: original interface defined assert_true: Original CSS definition should have type interface expected true got false PASS CSSGroupingRule interface: existence and properties of interface object PASS CSSGroupingRule interface object length PASS CSSGroupingRule interface object name @@ -38,9 +38,8 @@ PASS CSSSupportsRule interface: existence and properties of interface prototype object's @@unscopables property PASS CSSRule interface: constant SUPPORTS_RULE on interface object PASS CSSRule interface: constant SUPPORTS_RULE on interface prototype object -PASS CSS interface: operation supports(CSSOMString, CSSOMString) -PASS Unscopable handled correctly for supports(CSSOMString, CSSOMString) on CSS -PASS CSS interface: operation supports(CSSOMString) -PASS Unscopable handled correctly for supports(CSSOMString) on CSS +PASS CSS namespace: operation escape(CSSOMString) +PASS CSS namespace: operation supports(CSSOMString, CSSOMString) +PASS CSS namespace: operation supports(CSSOMString) Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/idlharness-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/css/css-images/idlharness-expected.txt deleted file mode 100644 index 594163a..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-images/idlharness-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -This is a testharness.js-based test. -PASS Test IDL implementation of css-masking -FAIL Partial namespace CSS: original namespace defined assert_true: Original CSS definition should have type namespace expected true got false -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/idlharness-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/idlharness-expected.txt index 4b9da1a..1121aac 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/idlharness-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/idlharness-expected.txt
@@ -40,5 +40,6 @@ PASS SVGMaskElement interface: [object SVGMaskElement] must inherit property "y" with the proper type PASS SVGMaskElement interface: [object SVGMaskElement] must inherit property "width" with the proper type PASS SVGMaskElement interface: [object SVGMaskElement] must inherit property "height" with the proper type +PASS WorkerGlobalScope interface: existence and properties of interface object Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/idlharness.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/idlharness.html index 71cca64c..41bab663 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/idlharness.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-masking/idlharness.html
@@ -5,25 +5,21 @@ <script src="/resources/testharnessreport.js"></script> <script src="/resources/WebIDLParser.js"></script> <script src="/resources/idlharness.js"></script> -<script> - "use strict"; - promise_test(async () => { - const idl_array = new IdlArray(); - const idl = await fetch("/interfaces/css-masking.idl").then(r => r.text()); - const dom = await fetch("/interfaces/dom.idl").then(r => r.text()); - idl_array.add_idls(idl); - idl_array.add_untested_idls('interface SVGElement : Element {};'); - idl_array.add_untested_idls('interface SVGAnimatedEnumeration {};'); - idl_array.add_untested_idls('interface SVGAnimatedLength {};'); - idl_array.add_untested_idls('interface SVGAnimatedTransformList {};'); - idl_array.add_dependency_idls(dom); // Needed for Element - idl_array.add_objects({ - SVGClipPathElement: [document.querySelector('#clip1')], - SVGMaskElement: [document.querySelector('#mask1')], - }); - idl_array.test(); - }, "Test IDL implementation of css-masking"); +<script> + 'use strict'; + + idl_test( + ['css-masking'], + ['SVG', 'html', 'dom'], + idl_array => { + idl_array.add_objects({ + SVGClipPathElement: [document.querySelector('#clip1')], + SVGMaskElement: [document.querySelector('#mask1')], + }); + }, + 'Test IDL implementation of css-masking' + ); </script> <svg xmlns="http://www.w3.org/2000/svg" xmlns:html="http://www.w3.org/1999/xhtml">
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-paint-api/idlharness-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/css/css-paint-api/idlharness-expected.txt index e36b945..f20efbb 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-paint-api/idlharness-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-paint-api/idlharness-expected.txt
@@ -1,11 +1,11 @@ This is a testharness.js-based test. PASS Test IDL implementation of CSS Painting API -PASS Partial interface CSS: original interface defined +FAIL Partial interface CSS: original interface defined assert_true: Original CSS definition should have type interface expected true got false PASS PaintWorkletGlobalScope interface: existence and properties of interface object PASS PaintRenderingContext2D interface: existence and properties of interface object PASS PaintSize interface: existence and properties of interface object -FAIL CSS interface: attribute paintWorklet assert_true: The prototype object must have a property "paintWorklet" expected true got false -PASS Unscopable handled correctly for paintWorklet property on CSS +PASS CSS namespace: operation escape(CSSOMString) +FAIL CSS namespace: attribute paintWorklet assert_own_property: CSS does not have property "paintWorklet" expected property "paintWorklet" missing PASS WorkletGlobalScope interface: existence and properties of interface object Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/idlharness-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/idlharness-expected.txt deleted file mode 100644 index f11e036..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/idlharness-expected.txt +++ /dev/null
@@ -1,7 +0,0 @@ -This is a testharness.js-based test. -PASS Test IDL implementation of CSS Properties Values API -FAIL Partial namespace CSS: original namespace defined assert_true: Original CSS definition should have type namespace expected true got false -FAIL CSS interface: operation registerProperty(PropertyDescriptor) assert_own_property: interface prototype object missing non-static operation expected property "registerProperty" missing -PASS Unscopable handled correctly for registerProperty(PropertyDescriptor) on CSS -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/interfaces-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/interfaces-expected.txt index b9bdbc0f..b11003b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/interfaces-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/interfaces-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 391 tests; 316 PASS, 75 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 387 tests; 312 PASS, 75 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Test driver PASS Partial interface Window: original interface defined PASS Partial interface Document: original interface defined @@ -7,6 +7,88 @@ PASS Partial interface HTMLElement: original interface defined PASS Partial interface HTMLImageElement: original interface defined PASS Partial interface Range: original interface defined +PASS MediaQueryList interface: existence and properties of interface object +PASS MediaQueryList interface object length +PASS MediaQueryList interface object name +PASS MediaQueryList interface: existence and properties of interface prototype object +PASS MediaQueryList interface: existence and properties of interface prototype object's "constructor" property +PASS MediaQueryList interface: existence and properties of interface prototype object's @@unscopables property +PASS MediaQueryList interface: attribute media +PASS Unscopable handled correctly for media property on MediaQueryList +PASS MediaQueryList interface: attribute matches +PASS Unscopable handled correctly for matches property on MediaQueryList +PASS MediaQueryList interface: operation addListener(EventListener) +PASS Unscopable handled correctly for addListener(EventListener) on MediaQueryList +PASS MediaQueryList interface: operation removeListener(EventListener) +PASS Unscopable handled correctly for removeListener(EventListener) on MediaQueryList +PASS MediaQueryList interface: attribute onchange +PASS Unscopable handled correctly for onchange property on MediaQueryList +PASS MediaQueryList must be primary interface of matchMedia("all") +PASS Stringification of matchMedia("all") +PASS MediaQueryList interface: matchMedia("all") must inherit property "media" with the proper type +PASS MediaQueryList interface: matchMedia("all") must inherit property "matches" with the proper type +PASS MediaQueryList interface: matchMedia("all") must inherit property "addListener(EventListener)" with the proper type +PASS MediaQueryList interface: calling addListener(EventListener) on matchMedia("all") with too few arguments must throw TypeError +PASS MediaQueryList interface: matchMedia("all") must inherit property "removeListener(EventListener)" with the proper type +PASS MediaQueryList interface: calling removeListener(EventListener) on matchMedia("all") with too few arguments must throw TypeError +PASS MediaQueryList interface: matchMedia("all") must inherit property "onchange" with the proper type +PASS MediaQueryListEvent interface: existence and properties of interface object +PASS MediaQueryListEvent interface object length +PASS MediaQueryListEvent interface object name +PASS MediaQueryListEvent interface: existence and properties of interface prototype object +PASS MediaQueryListEvent interface: existence and properties of interface prototype object's "constructor" property +PASS MediaQueryListEvent interface: existence and properties of interface prototype object's @@unscopables property +PASS MediaQueryListEvent interface: attribute media +PASS Unscopable handled correctly for media property on MediaQueryListEvent +PASS MediaQueryListEvent interface: attribute matches +PASS Unscopable handled correctly for matches property on MediaQueryListEvent +PASS MediaQueryListEvent must be primary interface of new MediaQueryListEvent("change") +PASS Stringification of new MediaQueryListEvent("change") +PASS MediaQueryListEvent interface: new MediaQueryListEvent("change") must inherit property "media" with the proper type +PASS MediaQueryListEvent interface: new MediaQueryListEvent("change") must inherit property "matches" with the proper type +PASS Screen interface: existence and properties of interface object +PASS Screen interface object length +PASS Screen interface object name +PASS Screen interface: existence and properties of interface prototype object +PASS Screen interface: existence and properties of interface prototype object's "constructor" property +PASS Screen interface: existence and properties of interface prototype object's @@unscopables property +PASS Screen interface: attribute availWidth +PASS Unscopable handled correctly for availWidth property on Screen +PASS Screen interface: attribute availHeight +PASS Unscopable handled correctly for availHeight property on Screen +PASS Screen interface: attribute width +PASS Unscopable handled correctly for width property on Screen +PASS Screen interface: attribute height +PASS Unscopable handled correctly for height property on Screen +PASS Screen interface: attribute colorDepth +PASS Unscopable handled correctly for colorDepth property on Screen +PASS Screen interface: attribute pixelDepth +PASS Unscopable handled correctly for pixelDepth property on Screen +PASS Screen must be primary interface of screen +PASS Stringification of screen +PASS Screen interface: screen must inherit property "availWidth" with the proper type +PASS Screen interface: screen must inherit property "availHeight" with the proper type +PASS Screen interface: screen must inherit property "width" with the proper type +PASS Screen interface: screen must inherit property "height" with the proper type +PASS Screen interface: screen must inherit property "colorDepth" with the proper type +PASS Screen interface: screen must inherit property "pixelDepth" with the proper type +FAIL CaretPosition interface: existence and properties of interface object assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing +FAIL CaretPosition interface object length assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing +FAIL CaretPosition interface object name assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing +FAIL CaretPosition interface: existence and properties of interface prototype object assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing +FAIL CaretPosition interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing +FAIL CaretPosition interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing +FAIL CaretPosition interface: attribute offsetNode assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing +PASS Unscopable handled correctly for offsetNode property on CaretPosition +FAIL CaretPosition interface: attribute offset assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing +PASS Unscopable handled correctly for offset property on CaretPosition +FAIL CaretPosition interface: operation getClientRect() assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing +PASS Unscopable handled correctly for getClientRect() on CaretPosition +FAIL CaretPosition must be primary interface of document.caretPositionFromPoint(5, 5) assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: document.caretPositionFromPoint is not a function" +FAIL Stringification of document.caretPositionFromPoint(5, 5) assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: document.caretPositionFromPoint is not a function" +FAIL CaretPosition interface: document.caretPositionFromPoint(5, 5) must inherit property "offsetNode" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: document.caretPositionFromPoint is not a function" +FAIL CaretPosition interface: document.caretPositionFromPoint(5, 5) must inherit property "offset" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: document.caretPositionFromPoint is not a function" +FAIL CaretPosition interface: document.caretPositionFromPoint(5, 5) must inherit property "getClientRect()" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: document.caretPositionFromPoint is not a function" PASS HTMLElement interface: attribute offsetParent PASS Unscopable handled correctly for offsetParent property on HTMLElement PASS HTMLElement interface: attribute offsetTop @@ -17,86 +99,86 @@ PASS Unscopable handled correctly for offsetWidth property on HTMLElement PASS HTMLElement interface: attribute offsetHeight PASS Unscopable handled correctly for offsetHeight property on HTMLElement -PASS HTMLElement interface: document.createElement('div') must inherit property "offsetParent" with the proper type -PASS HTMLElement interface: document.createElement('div') must inherit property "offsetTop" with the proper type -PASS HTMLElement interface: document.createElement('div') must inherit property "offsetLeft" with the proper type -PASS HTMLElement interface: document.createElement('div') must inherit property "offsetWidth" with the proper type -PASS HTMLElement interface: document.createElement('div') must inherit property "offsetHeight" with the proper type -PASS Element interface: document.createElement('div') must inherit property "getClientRects()" with the proper type -PASS Element interface: document.createElement('div') must inherit property "getBoundingClientRect()" with the proper type -PASS Element interface: document.createElement('div') must inherit property "scrollIntoView([object Object],[object Object])" with the proper type -PASS Element interface: calling scrollIntoView([object Object],[object Object]) on document.createElement('div') with too few arguments must throw TypeError -PASS Element interface: document.createElement('div') must inherit property "scroll(ScrollToOptions)" with the proper type -PASS Element interface: calling scroll(ScrollToOptions) on document.createElement('div') with too few arguments must throw TypeError -PASS Element interface: document.createElement('div') must inherit property "scroll(unrestricted double, unrestricted double)" with the proper type -PASS Element interface: calling scroll(unrestricted double, unrestricted double) on document.createElement('div') with too few arguments must throw TypeError -PASS Element interface: document.createElement('div') must inherit property "scrollTo(ScrollToOptions)" with the proper type -PASS Element interface: calling scrollTo(ScrollToOptions) on document.createElement('div') with too few arguments must throw TypeError -PASS Element interface: document.createElement('div') must inherit property "scrollTo(unrestricted double, unrestricted double)" with the proper type -PASS Element interface: calling scrollTo(unrestricted double, unrestricted double) on document.createElement('div') with too few arguments must throw TypeError -PASS Element interface: document.createElement('div') must inherit property "scrollBy(ScrollToOptions)" with the proper type -PASS Element interface: calling scrollBy(ScrollToOptions) on document.createElement('div') with too few arguments must throw TypeError -PASS Element interface: document.createElement('div') must inherit property "scrollBy(unrestricted double, unrestricted double)" with the proper type -PASS Element interface: calling scrollBy(unrestricted double, unrestricted double) on document.createElement('div') with too few arguments must throw TypeError -PASS Element interface: document.createElement('div') must inherit property "scrollTop" with the proper type -PASS Element interface: document.createElement('div') must inherit property "scrollLeft" with the proper type -PASS Element interface: document.createElement('div') must inherit property "scrollWidth" with the proper type -PASS Element interface: document.createElement('div') must inherit property "scrollHeight" with the proper type -PASS Element interface: document.createElement('div') must inherit property "clientTop" with the proper type -PASS Element interface: document.createElement('div') must inherit property "clientLeft" with the proper type -PASS Element interface: document.createElement('div') must inherit property "clientWidth" with the proper type -PASS Element interface: document.createElement('div') must inherit property "clientHeight" with the proper type -FAIL Element interface: document.createElement('div') must inherit property "getBoxQuads(BoxQuadOptions)" with the proper type assert_inherits: property "getBoxQuads" not found in prototype chain -FAIL Element interface: calling getBoxQuads(BoxQuadOptions) on document.createElement('div') with too few arguments must throw TypeError assert_inherits: property "getBoxQuads" not found in prototype chain -FAIL Element interface: document.createElement('div') must inherit property "convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertQuadFromNode" not found in prototype chain -FAIL Element interface: calling convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions) on document.createElement('div') with too few arguments must throw TypeError assert_inherits: property "convertQuadFromNode" not found in prototype chain -FAIL Element interface: document.createElement('div') must inherit property "convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertRectFromNode" not found in prototype chain -FAIL Element interface: calling convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions) on document.createElement('div') with too few arguments must throw TypeError assert_inherits: property "convertRectFromNode" not found in prototype chain -FAIL Element interface: document.createElement('div') must inherit property "convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertPointFromNode" not found in prototype chain -FAIL Element interface: calling convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions) on document.createElement('div') with too few arguments must throw TypeError assert_inherits: property "convertPointFromNode" not found in prototype chain +PASS HTMLElement interface: document.createElement("div") must inherit property "offsetParent" with the proper type +PASS HTMLElement interface: document.createElement("div") must inherit property "offsetTop" with the proper type +PASS HTMLElement interface: document.createElement("div") must inherit property "offsetLeft" with the proper type +PASS HTMLElement interface: document.createElement("div") must inherit property "offsetWidth" with the proper type +PASS HTMLElement interface: document.createElement("div") must inherit property "offsetHeight" with the proper type +PASS Element interface: document.createElement("div") must inherit property "getClientRects()" with the proper type +PASS Element interface: document.createElement("div") must inherit property "getBoundingClientRect()" with the proper type +PASS Element interface: document.createElement("div") must inherit property "scrollIntoView([object Object],[object Object])" with the proper type +PASS Element interface: calling scrollIntoView([object Object],[object Object]) on document.createElement("div") with too few arguments must throw TypeError +PASS Element interface: document.createElement("div") must inherit property "scroll(ScrollToOptions)" with the proper type +PASS Element interface: calling scroll(ScrollToOptions) on document.createElement("div") with too few arguments must throw TypeError +PASS Element interface: document.createElement("div") must inherit property "scroll(unrestricted double, unrestricted double)" with the proper type +PASS Element interface: calling scroll(unrestricted double, unrestricted double) on document.createElement("div") with too few arguments must throw TypeError +PASS Element interface: document.createElement("div") must inherit property "scrollTo(ScrollToOptions)" with the proper type +PASS Element interface: calling scrollTo(ScrollToOptions) on document.createElement("div") with too few arguments must throw TypeError +PASS Element interface: document.createElement("div") must inherit property "scrollTo(unrestricted double, unrestricted double)" with the proper type +PASS Element interface: calling scrollTo(unrestricted double, unrestricted double) on document.createElement("div") with too few arguments must throw TypeError +PASS Element interface: document.createElement("div") must inherit property "scrollBy(ScrollToOptions)" with the proper type +PASS Element interface: calling scrollBy(ScrollToOptions) on document.createElement("div") with too few arguments must throw TypeError +PASS Element interface: document.createElement("div") must inherit property "scrollBy(unrestricted double, unrestricted double)" with the proper type +PASS Element interface: calling scrollBy(unrestricted double, unrestricted double) on document.createElement("div") with too few arguments must throw TypeError +PASS Element interface: document.createElement("div") must inherit property "scrollTop" with the proper type +PASS Element interface: document.createElement("div") must inherit property "scrollLeft" with the proper type +PASS Element interface: document.createElement("div") must inherit property "scrollWidth" with the proper type +PASS Element interface: document.createElement("div") must inherit property "scrollHeight" with the proper type +PASS Element interface: document.createElement("div") must inherit property "clientTop" with the proper type +PASS Element interface: document.createElement("div") must inherit property "clientLeft" with the proper type +PASS Element interface: document.createElement("div") must inherit property "clientWidth" with the proper type +PASS Element interface: document.createElement("div") must inherit property "clientHeight" with the proper type +FAIL Element interface: document.createElement("div") must inherit property "getBoxQuads(BoxQuadOptions)" with the proper type assert_inherits: property "getBoxQuads" not found in prototype chain +FAIL Element interface: calling getBoxQuads(BoxQuadOptions) on document.createElement("div") with too few arguments must throw TypeError assert_inherits: property "getBoxQuads" not found in prototype chain +FAIL Element interface: document.createElement("div") must inherit property "convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertQuadFromNode" not found in prototype chain +FAIL Element interface: calling convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions) on document.createElement("div") with too few arguments must throw TypeError assert_inherits: property "convertQuadFromNode" not found in prototype chain +FAIL Element interface: document.createElement("div") must inherit property "convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertRectFromNode" not found in prototype chain +FAIL Element interface: calling convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions) on document.createElement("div") with too few arguments must throw TypeError assert_inherits: property "convertRectFromNode" not found in prototype chain +FAIL Element interface: document.createElement("div") must inherit property "convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertPointFromNode" not found in prototype chain +FAIL Element interface: calling convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions) on document.createElement("div") with too few arguments must throw TypeError assert_inherits: property "convertPointFromNode" not found in prototype chain PASS HTMLImageElement interface: attribute x PASS Unscopable handled correctly for x property on HTMLImageElement PASS HTMLImageElement interface: attribute y PASS Unscopable handled correctly for y property on HTMLImageElement -PASS HTMLImageElement interface: document.createElement('img') must inherit property "x" with the proper type -PASS HTMLImageElement interface: document.createElement('img') must inherit property "y" with the proper type -PASS HTMLElement interface: document.createElement('img') must inherit property "offsetParent" with the proper type -PASS HTMLElement interface: document.createElement('img') must inherit property "offsetTop" with the proper type -PASS HTMLElement interface: document.createElement('img') must inherit property "offsetLeft" with the proper type -PASS HTMLElement interface: document.createElement('img') must inherit property "offsetWidth" with the proper type -PASS HTMLElement interface: document.createElement('img') must inherit property "offsetHeight" with the proper type -PASS Element interface: document.createElement('img') must inherit property "getClientRects()" with the proper type -PASS Element interface: document.createElement('img') must inherit property "getBoundingClientRect()" with the proper type -PASS Element interface: document.createElement('img') must inherit property "scrollIntoView([object Object],[object Object])" with the proper type -PASS Element interface: calling scrollIntoView([object Object],[object Object]) on document.createElement('img') with too few arguments must throw TypeError -PASS Element interface: document.createElement('img') must inherit property "scroll(ScrollToOptions)" with the proper type -PASS Element interface: calling scroll(ScrollToOptions) on document.createElement('img') with too few arguments must throw TypeError -PASS Element interface: document.createElement('img') must inherit property "scroll(unrestricted double, unrestricted double)" with the proper type -PASS Element interface: calling scroll(unrestricted double, unrestricted double) on document.createElement('img') with too few arguments must throw TypeError -PASS Element interface: document.createElement('img') must inherit property "scrollTo(ScrollToOptions)" with the proper type -PASS Element interface: calling scrollTo(ScrollToOptions) on document.createElement('img') with too few arguments must throw TypeError -PASS Element interface: document.createElement('img') must inherit property "scrollTo(unrestricted double, unrestricted double)" with the proper type -PASS Element interface: calling scrollTo(unrestricted double, unrestricted double) on document.createElement('img') with too few arguments must throw TypeError -PASS Element interface: document.createElement('img') must inherit property "scrollBy(ScrollToOptions)" with the proper type -PASS Element interface: calling scrollBy(ScrollToOptions) on document.createElement('img') with too few arguments must throw TypeError -PASS Element interface: document.createElement('img') must inherit property "scrollBy(unrestricted double, unrestricted double)" with the proper type -PASS Element interface: calling scrollBy(unrestricted double, unrestricted double) on document.createElement('img') with too few arguments must throw TypeError -PASS Element interface: document.createElement('img') must inherit property "scrollTop" with the proper type -PASS Element interface: document.createElement('img') must inherit property "scrollLeft" with the proper type -PASS Element interface: document.createElement('img') must inherit property "scrollWidth" with the proper type -PASS Element interface: document.createElement('img') must inherit property "scrollHeight" with the proper type -PASS Element interface: document.createElement('img') must inherit property "clientTop" with the proper type -PASS Element interface: document.createElement('img') must inherit property "clientLeft" with the proper type -PASS Element interface: document.createElement('img') must inherit property "clientWidth" with the proper type -PASS Element interface: document.createElement('img') must inherit property "clientHeight" with the proper type -FAIL Element interface: document.createElement('img') must inherit property "getBoxQuads(BoxQuadOptions)" with the proper type assert_inherits: property "getBoxQuads" not found in prototype chain -FAIL Element interface: calling getBoxQuads(BoxQuadOptions) on document.createElement('img') with too few arguments must throw TypeError assert_inherits: property "getBoxQuads" not found in prototype chain -FAIL Element interface: document.createElement('img') must inherit property "convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertQuadFromNode" not found in prototype chain -FAIL Element interface: calling convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions) on document.createElement('img') with too few arguments must throw TypeError assert_inherits: property "convertQuadFromNode" not found in prototype chain -FAIL Element interface: document.createElement('img') must inherit property "convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertRectFromNode" not found in prototype chain -FAIL Element interface: calling convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions) on document.createElement('img') with too few arguments must throw TypeError assert_inherits: property "convertRectFromNode" not found in prototype chain -FAIL Element interface: document.createElement('img') must inherit property "convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertPointFromNode" not found in prototype chain -FAIL Element interface: calling convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions) on document.createElement('img') with too few arguments must throw TypeError assert_inherits: property "convertPointFromNode" not found in prototype chain +PASS HTMLImageElement interface: document.createElement("img") must inherit property "x" with the proper type +PASS HTMLImageElement interface: document.createElement("img") must inherit property "y" with the proper type +PASS HTMLElement interface: document.createElement("img") must inherit property "offsetParent" with the proper type +PASS HTMLElement interface: document.createElement("img") must inherit property "offsetTop" with the proper type +PASS HTMLElement interface: document.createElement("img") must inherit property "offsetLeft" with the proper type +PASS HTMLElement interface: document.createElement("img") must inherit property "offsetWidth" with the proper type +PASS HTMLElement interface: document.createElement("img") must inherit property "offsetHeight" with the proper type +PASS Element interface: document.createElement("img") must inherit property "getClientRects()" with the proper type +PASS Element interface: document.createElement("img") must inherit property "getBoundingClientRect()" with the proper type +PASS Element interface: document.createElement("img") must inherit property "scrollIntoView([object Object],[object Object])" with the proper type +PASS Element interface: calling scrollIntoView([object Object],[object Object]) on document.createElement("img") with too few arguments must throw TypeError +PASS Element interface: document.createElement("img") must inherit property "scroll(ScrollToOptions)" with the proper type +PASS Element interface: calling scroll(ScrollToOptions) on document.createElement("img") with too few arguments must throw TypeError +PASS Element interface: document.createElement("img") must inherit property "scroll(unrestricted double, unrestricted double)" with the proper type +PASS Element interface: calling scroll(unrestricted double, unrestricted double) on document.createElement("img") with too few arguments must throw TypeError +PASS Element interface: document.createElement("img") must inherit property "scrollTo(ScrollToOptions)" with the proper type +PASS Element interface: calling scrollTo(ScrollToOptions) on document.createElement("img") with too few arguments must throw TypeError +PASS Element interface: document.createElement("img") must inherit property "scrollTo(unrestricted double, unrestricted double)" with the proper type +PASS Element interface: calling scrollTo(unrestricted double, unrestricted double) on document.createElement("img") with too few arguments must throw TypeError +PASS Element interface: document.createElement("img") must inherit property "scrollBy(ScrollToOptions)" with the proper type +PASS Element interface: calling scrollBy(ScrollToOptions) on document.createElement("img") with too few arguments must throw TypeError +PASS Element interface: document.createElement("img") must inherit property "scrollBy(unrestricted double, unrestricted double)" with the proper type +PASS Element interface: calling scrollBy(unrestricted double, unrestricted double) on document.createElement("img") with too few arguments must throw TypeError +PASS Element interface: document.createElement("img") must inherit property "scrollTop" with the proper type +PASS Element interface: document.createElement("img") must inherit property "scrollLeft" with the proper type +PASS Element interface: document.createElement("img") must inherit property "scrollWidth" with the proper type +PASS Element interface: document.createElement("img") must inherit property "scrollHeight" with the proper type +PASS Element interface: document.createElement("img") must inherit property "clientTop" with the proper type +PASS Element interface: document.createElement("img") must inherit property "clientLeft" with the proper type +PASS Element interface: document.createElement("img") must inherit property "clientWidth" with the proper type +PASS Element interface: document.createElement("img") must inherit property "clientHeight" with the proper type +FAIL Element interface: document.createElement("img") must inherit property "getBoxQuads(BoxQuadOptions)" with the proper type assert_inherits: property "getBoxQuads" not found in prototype chain +FAIL Element interface: calling getBoxQuads(BoxQuadOptions) on document.createElement("img") with too few arguments must throw TypeError assert_inherits: property "getBoxQuads" not found in prototype chain +FAIL Element interface: document.createElement("img") must inherit property "convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertQuadFromNode" not found in prototype chain +FAIL Element interface: calling convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions) on document.createElement("img") with too few arguments must throw TypeError assert_inherits: property "convertQuadFromNode" not found in prototype chain +FAIL Element interface: document.createElement("img") must inherit property "convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertRectFromNode" not found in prototype chain +FAIL Element interface: calling convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions) on document.createElement("img") with too few arguments must throw TypeError assert_inherits: property "convertRectFromNode" not found in prototype chain +FAIL Element interface: document.createElement("img") must inherit property "convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertPointFromNode" not found in prototype chain +FAIL Element interface: calling convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions) on document.createElement("img") with too few arguments must throw TypeError assert_inherits: property "convertPointFromNode" not found in prototype chain PASS Window interface: operation matchMedia(CSSOMString) PASS Unscopable handled correctly for matchMedia(CSSOMString) on Window PASS Window interface: attribute screen @@ -178,10 +260,6 @@ PASS Window interface: window must inherit property "outerHeight" with the proper type PASS Window interface: window must inherit property "devicePixelRatio" with the proper type PASS WorkerGlobalScope interface: existence and properties of interface object -PASS DedicatedWorkerGlobalScope interface: existence and properties of interface object -PASS SharedWorkerGlobalScope interface: existence and properties of interface object -PASS WorkerNavigator interface: existence and properties of interface object -PASS WorkerLocation interface: existence and properties of interface object PASS Document interface: operation elementFromPoint(double, double) PASS Unscopable handled correctly for elementFromPoint(double, double) on Document PASS Document interface: operation elementsFromPoint(double, double) @@ -255,38 +333,38 @@ PASS Unscopable handled correctly for convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions) on Element FAIL Element interface: operation convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions) assert_own_property: interface prototype object missing non-static operation expected property "convertPointFromNode" missing PASS Unscopable handled correctly for convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions) on Element -PASS Element interface: document.createElementNS('x', 'y') must inherit property "getClientRects()" with the proper type -PASS Element interface: document.createElementNS('x', 'y') must inherit property "getBoundingClientRect()" with the proper type -PASS Element interface: document.createElementNS('x', 'y') must inherit property "scrollIntoView([object Object],[object Object])" with the proper type -PASS Element interface: calling scrollIntoView([object Object],[object Object]) on document.createElementNS('x', 'y') with too few arguments must throw TypeError -PASS Element interface: document.createElementNS('x', 'y') must inherit property "scroll(ScrollToOptions)" with the proper type -PASS Element interface: calling scroll(ScrollToOptions) on document.createElementNS('x', 'y') with too few arguments must throw TypeError -PASS Element interface: document.createElementNS('x', 'y') must inherit property "scroll(unrestricted double, unrestricted double)" with the proper type -PASS Element interface: calling scroll(unrestricted double, unrestricted double) on document.createElementNS('x', 'y') with too few arguments must throw TypeError -PASS Element interface: document.createElementNS('x', 'y') must inherit property "scrollTo(ScrollToOptions)" with the proper type -PASS Element interface: calling scrollTo(ScrollToOptions) on document.createElementNS('x', 'y') with too few arguments must throw TypeError -PASS Element interface: document.createElementNS('x', 'y') must inherit property "scrollTo(unrestricted double, unrestricted double)" with the proper type -PASS Element interface: calling scrollTo(unrestricted double, unrestricted double) on document.createElementNS('x', 'y') with too few arguments must throw TypeError -PASS Element interface: document.createElementNS('x', 'y') must inherit property "scrollBy(ScrollToOptions)" with the proper type -PASS Element interface: calling scrollBy(ScrollToOptions) on document.createElementNS('x', 'y') with too few arguments must throw TypeError -PASS Element interface: document.createElementNS('x', 'y') must inherit property "scrollBy(unrestricted double, unrestricted double)" with the proper type -PASS Element interface: calling scrollBy(unrestricted double, unrestricted double) on document.createElementNS('x', 'y') with too few arguments must throw TypeError -PASS Element interface: document.createElementNS('x', 'y') must inherit property "scrollTop" with the proper type -PASS Element interface: document.createElementNS('x', 'y') must inherit property "scrollLeft" with the proper type -PASS Element interface: document.createElementNS('x', 'y') must inherit property "scrollWidth" with the proper type -PASS Element interface: document.createElementNS('x', 'y') must inherit property "scrollHeight" with the proper type -PASS Element interface: document.createElementNS('x', 'y') must inherit property "clientTop" with the proper type -PASS Element interface: document.createElementNS('x', 'y') must inherit property "clientLeft" with the proper type -PASS Element interface: document.createElementNS('x', 'y') must inherit property "clientWidth" with the proper type -PASS Element interface: document.createElementNS('x', 'y') must inherit property "clientHeight" with the proper type -FAIL Element interface: document.createElementNS('x', 'y') must inherit property "getBoxQuads(BoxQuadOptions)" with the proper type assert_inherits: property "getBoxQuads" not found in prototype chain -FAIL Element interface: calling getBoxQuads(BoxQuadOptions) on document.createElementNS('x', 'y') with too few arguments must throw TypeError assert_inherits: property "getBoxQuads" not found in prototype chain -FAIL Element interface: document.createElementNS('x', 'y') must inherit property "convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertQuadFromNode" not found in prototype chain -FAIL Element interface: calling convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions) on document.createElementNS('x', 'y') with too few arguments must throw TypeError assert_inherits: property "convertQuadFromNode" not found in prototype chain -FAIL Element interface: document.createElementNS('x', 'y') must inherit property "convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertRectFromNode" not found in prototype chain -FAIL Element interface: calling convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions) on document.createElementNS('x', 'y') with too few arguments must throw TypeError assert_inherits: property "convertRectFromNode" not found in prototype chain -FAIL Element interface: document.createElementNS('x', 'y') must inherit property "convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertPointFromNode" not found in prototype chain -FAIL Element interface: calling convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions) on document.createElementNS('x', 'y') with too few arguments must throw TypeError assert_inherits: property "convertPointFromNode" not found in prototype chain +PASS Element interface: document.createElementNS("x", "y") must inherit property "getClientRects()" with the proper type +PASS Element interface: document.createElementNS("x", "y") must inherit property "getBoundingClientRect()" with the proper type +PASS Element interface: document.createElementNS("x", "y") must inherit property "scrollIntoView([object Object],[object Object])" with the proper type +PASS Element interface: calling scrollIntoView([object Object],[object Object]) on document.createElementNS("x", "y") with too few arguments must throw TypeError +PASS Element interface: document.createElementNS("x", "y") must inherit property "scroll(ScrollToOptions)" with the proper type +PASS Element interface: calling scroll(ScrollToOptions) on document.createElementNS("x", "y") with too few arguments must throw TypeError +PASS Element interface: document.createElementNS("x", "y") must inherit property "scroll(unrestricted double, unrestricted double)" with the proper type +PASS Element interface: calling scroll(unrestricted double, unrestricted double) on document.createElementNS("x", "y") with too few arguments must throw TypeError +PASS Element interface: document.createElementNS("x", "y") must inherit property "scrollTo(ScrollToOptions)" with the proper type +PASS Element interface: calling scrollTo(ScrollToOptions) on document.createElementNS("x", "y") with too few arguments must throw TypeError +PASS Element interface: document.createElementNS("x", "y") must inherit property "scrollTo(unrestricted double, unrestricted double)" with the proper type +PASS Element interface: calling scrollTo(unrestricted double, unrestricted double) on document.createElementNS("x", "y") with too few arguments must throw TypeError +PASS Element interface: document.createElementNS("x", "y") must inherit property "scrollBy(ScrollToOptions)" with the proper type +PASS Element interface: calling scrollBy(ScrollToOptions) on document.createElementNS("x", "y") with too few arguments must throw TypeError +PASS Element interface: document.createElementNS("x", "y") must inherit property "scrollBy(unrestricted double, unrestricted double)" with the proper type +PASS Element interface: calling scrollBy(unrestricted double, unrestricted double) on document.createElementNS("x", "y") with too few arguments must throw TypeError +PASS Element interface: document.createElementNS("x", "y") must inherit property "scrollTop" with the proper type +PASS Element interface: document.createElementNS("x", "y") must inherit property "scrollLeft" with the proper type +PASS Element interface: document.createElementNS("x", "y") must inherit property "scrollWidth" with the proper type +PASS Element interface: document.createElementNS("x", "y") must inherit property "scrollHeight" with the proper type +PASS Element interface: document.createElementNS("x", "y") must inherit property "clientTop" with the proper type +PASS Element interface: document.createElementNS("x", "y") must inherit property "clientLeft" with the proper type +PASS Element interface: document.createElementNS("x", "y") must inherit property "clientWidth" with the proper type +PASS Element interface: document.createElementNS("x", "y") must inherit property "clientHeight" with the proper type +FAIL Element interface: document.createElementNS("x", "y") must inherit property "getBoxQuads(BoxQuadOptions)" with the proper type assert_inherits: property "getBoxQuads" not found in prototype chain +FAIL Element interface: calling getBoxQuads(BoxQuadOptions) on document.createElementNS("x", "y") with too few arguments must throw TypeError assert_inherits: property "getBoxQuads" not found in prototype chain +FAIL Element interface: document.createElementNS("x", "y") must inherit property "convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertQuadFromNode" not found in prototype chain +FAIL Element interface: calling convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions) on document.createElementNS("x", "y") with too few arguments must throw TypeError assert_inherits: property "convertQuadFromNode" not found in prototype chain +FAIL Element interface: document.createElementNS("x", "y") must inherit property "convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertRectFromNode" not found in prototype chain +FAIL Element interface: calling convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions) on document.createElementNS("x", "y") with too few arguments must throw TypeError assert_inherits: property "convertRectFromNode" not found in prototype chain +FAIL Element interface: document.createElementNS("x", "y") must inherit property "convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertPointFromNode" not found in prototype chain +FAIL Element interface: calling convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions) on document.createElementNS("x", "y") with too few arguments must throw TypeError assert_inherits: property "convertPointFromNode" not found in prototype chain FAIL Text interface: operation getBoxQuads(BoxQuadOptions) assert_own_property: interface prototype object missing non-static operation expected property "getBoxQuads" missing PASS Unscopable handled correctly for getBoxQuads(BoxQuadOptions) on Text FAIL Text interface: operation convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions) assert_own_property: interface prototype object missing non-static operation expected property "convertQuadFromNode" missing @@ -295,101 +373,19 @@ PASS Unscopable handled correctly for convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions) on Text FAIL Text interface: operation convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions) assert_own_property: interface prototype object missing non-static operation expected property "convertPointFromNode" missing PASS Unscopable handled correctly for convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions) on Text -FAIL Text interface: document.createTextNode('x') must inherit property "getBoxQuads(BoxQuadOptions)" with the proper type assert_inherits: property "getBoxQuads" not found in prototype chain -FAIL Text interface: calling getBoxQuads(BoxQuadOptions) on document.createTextNode('x') with too few arguments must throw TypeError assert_inherits: property "getBoxQuads" not found in prototype chain -FAIL Text interface: document.createTextNode('x') must inherit property "convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertQuadFromNode" not found in prototype chain -FAIL Text interface: calling convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions) on document.createTextNode('x') with too few arguments must throw TypeError assert_inherits: property "convertQuadFromNode" not found in prototype chain -FAIL Text interface: document.createTextNode('x') must inherit property "convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertRectFromNode" not found in prototype chain -FAIL Text interface: calling convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions) on document.createTextNode('x') with too few arguments must throw TypeError assert_inherits: property "convertRectFromNode" not found in prototype chain -FAIL Text interface: document.createTextNode('x') must inherit property "convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertPointFromNode" not found in prototype chain -FAIL Text interface: calling convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions) on document.createTextNode('x') with too few arguments must throw TypeError assert_inherits: property "convertPointFromNode" not found in prototype chain +FAIL Text interface: document.createTextNode("x") must inherit property "getBoxQuads(BoxQuadOptions)" with the proper type assert_inherits: property "getBoxQuads" not found in prototype chain +FAIL Text interface: calling getBoxQuads(BoxQuadOptions) on document.createTextNode("x") with too few arguments must throw TypeError assert_inherits: property "getBoxQuads" not found in prototype chain +FAIL Text interface: document.createTextNode("x") must inherit property "convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertQuadFromNode" not found in prototype chain +FAIL Text interface: calling convertQuadFromNode(DOMQuadInit, GeometryNode, ConvertCoordinateOptions) on document.createTextNode("x") with too few arguments must throw TypeError assert_inherits: property "convertQuadFromNode" not found in prototype chain +FAIL Text interface: document.createTextNode("x") must inherit property "convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertRectFromNode" not found in prototype chain +FAIL Text interface: calling convertRectFromNode(DOMRectReadOnly, GeometryNode, ConvertCoordinateOptions) on document.createTextNode("x") with too few arguments must throw TypeError assert_inherits: property "convertRectFromNode" not found in prototype chain +FAIL Text interface: document.createTextNode("x") must inherit property "convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions)" with the proper type assert_inherits: property "convertPointFromNode" not found in prototype chain +FAIL Text interface: calling convertPointFromNode(DOMPointInit, GeometryNode, ConvertCoordinateOptions) on document.createTextNode("x") with too few arguments must throw TypeError assert_inherits: property "convertPointFromNode" not found in prototype chain PASS Range interface: operation getClientRects() PASS Unscopable handled correctly for getClientRects() on Range PASS Range interface: operation getBoundingClientRect() PASS Unscopable handled correctly for getBoundingClientRect() on Range PASS Range interface: new Range() must inherit property "getClientRects()" with the proper type PASS Range interface: new Range() must inherit property "getBoundingClientRect()" with the proper type -PASS MediaQueryList interface: existence and properties of interface object -PASS MediaQueryList interface object length -PASS MediaQueryList interface object name -PASS MediaQueryList interface: existence and properties of interface prototype object -PASS MediaQueryList interface: existence and properties of interface prototype object's "constructor" property -PASS MediaQueryList interface: existence and properties of interface prototype object's @@unscopables property -PASS MediaQueryList interface: attribute media -PASS Unscopable handled correctly for media property on MediaQueryList -PASS MediaQueryList interface: attribute matches -PASS Unscopable handled correctly for matches property on MediaQueryList -PASS MediaQueryList interface: operation addListener(EventListener) -PASS Unscopable handled correctly for addListener(EventListener) on MediaQueryList -PASS MediaQueryList interface: operation removeListener(EventListener) -PASS Unscopable handled correctly for removeListener(EventListener) on MediaQueryList -PASS MediaQueryList interface: attribute onchange -PASS Unscopable handled correctly for onchange property on MediaQueryList -PASS MediaQueryList must be primary interface of matchMedia('all') -PASS Stringification of matchMedia('all') -PASS MediaQueryList interface: matchMedia('all') must inherit property "media" with the proper type -PASS MediaQueryList interface: matchMedia('all') must inherit property "matches" with the proper type -PASS MediaQueryList interface: matchMedia('all') must inherit property "addListener(EventListener)" with the proper type -PASS MediaQueryList interface: calling addListener(EventListener) on matchMedia('all') with too few arguments must throw TypeError -PASS MediaQueryList interface: matchMedia('all') must inherit property "removeListener(EventListener)" with the proper type -PASS MediaQueryList interface: calling removeListener(EventListener) on matchMedia('all') with too few arguments must throw TypeError -PASS MediaQueryList interface: matchMedia('all') must inherit property "onchange" with the proper type -PASS MediaQueryListEvent interface: existence and properties of interface object -PASS MediaQueryListEvent interface object length -PASS MediaQueryListEvent interface object name -PASS MediaQueryListEvent interface: existence and properties of interface prototype object -PASS MediaQueryListEvent interface: existence and properties of interface prototype object's "constructor" property -PASS MediaQueryListEvent interface: existence and properties of interface prototype object's @@unscopables property -PASS MediaQueryListEvent interface: attribute media -PASS Unscopable handled correctly for media property on MediaQueryListEvent -PASS MediaQueryListEvent interface: attribute matches -PASS Unscopable handled correctly for matches property on MediaQueryListEvent -PASS MediaQueryListEvent must be primary interface of new MediaQueryListEvent('change') -PASS Stringification of new MediaQueryListEvent('change') -PASS MediaQueryListEvent interface: new MediaQueryListEvent('change') must inherit property "media" with the proper type -PASS MediaQueryListEvent interface: new MediaQueryListEvent('change') must inherit property "matches" with the proper type -PASS Screen interface: existence and properties of interface object -PASS Screen interface object length -PASS Screen interface object name -PASS Screen interface: existence and properties of interface prototype object -PASS Screen interface: existence and properties of interface prototype object's "constructor" property -PASS Screen interface: existence and properties of interface prototype object's @@unscopables property -PASS Screen interface: attribute availWidth -PASS Unscopable handled correctly for availWidth property on Screen -PASS Screen interface: attribute availHeight -PASS Unscopable handled correctly for availHeight property on Screen -PASS Screen interface: attribute width -PASS Unscopable handled correctly for width property on Screen -PASS Screen interface: attribute height -PASS Unscopable handled correctly for height property on Screen -PASS Screen interface: attribute colorDepth -PASS Unscopable handled correctly for colorDepth property on Screen -PASS Screen interface: attribute pixelDepth -PASS Unscopable handled correctly for pixelDepth property on Screen -PASS Screen must be primary interface of screen -PASS Stringification of screen -PASS Screen interface: screen must inherit property "availWidth" with the proper type -PASS Screen interface: screen must inherit property "availHeight" with the proper type -PASS Screen interface: screen must inherit property "width" with the proper type -PASS Screen interface: screen must inherit property "height" with the proper type -PASS Screen interface: screen must inherit property "colorDepth" with the proper type -PASS Screen interface: screen must inherit property "pixelDepth" with the proper type -FAIL CaretPosition interface: existence and properties of interface object assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing -FAIL CaretPosition interface object length assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing -FAIL CaretPosition interface object name assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing -FAIL CaretPosition interface: existence and properties of interface prototype object assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing -FAIL CaretPosition interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing -FAIL CaretPosition interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing -FAIL CaretPosition interface: attribute offsetNode assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing -PASS Unscopable handled correctly for offsetNode property on CaretPosition -FAIL CaretPosition interface: attribute offset assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing -PASS Unscopable handled correctly for offset property on CaretPosition -FAIL CaretPosition interface: operation getClientRect() assert_own_property: self does not have own property "CaretPosition" expected property "CaretPosition" missing -PASS Unscopable handled correctly for getClientRect() on CaretPosition -FAIL CaretPosition must be primary interface of document.caretPositionFromPoint(5, 5) assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: document.caretPositionFromPoint is not a function" -FAIL Stringification of document.caretPositionFromPoint(5, 5) assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: document.caretPositionFromPoint is not a function" -FAIL CaretPosition interface: document.caretPositionFromPoint(5, 5) must inherit property "offsetNode" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: document.caretPositionFromPoint is not a function" -FAIL CaretPosition interface: document.caretPositionFromPoint(5, 5) must inherit property "offset" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: document.caretPositionFromPoint is not a function" -FAIL CaretPosition interface: document.caretPositionFromPoint(5, 5) must inherit property "getClientRect()" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: document.caretPositionFromPoint is not a function" Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/interfaces.html b/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/interfaces.html index 38de8dc..c73663e 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/interfaces.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/interfaces.html
@@ -15,59 +15,32 @@ <div id=log></div> <script> -"use strict"; +'use strict'; -function doTest([html, dom, uievents, cssom, cssom_view]) { +const waitForLoad = new Promise(resolve => { addEventListener('load', resolve); }); - var idlArray = new IdlArray(); - var svg = "interface SVGElement : Element {};"; - idlArray.add_untested_idls(html + dom + svg + cssom); - idlArray.add_untested_idls(uievents, { only: [ - 'UIEvent', - 'UIEventInit', - 'MouseEvent', - 'MouseEventInit', - 'EventModifierInit'] - }); - idlArray.add_idls(cssom_view); +idl_test( + ['cssom-view'], + ['html', 'dom', 'uievents', 'cssom'], + async idlArray => { + idlArray.add_objects({ + Window: ['window'], + MediaQueryList: ['matchMedia("all")'], + MediaQueryListEvent: ['new MediaQueryListEvent("change")'], + Screen: ['screen'], + Document: ['document'], + CaretPosition: ['document.caretPositionFromPoint(5, 5)'], + Element: ['document.createElementNS("x", "y")'], + HTMLElement: ['document.createElement("div")'], + HTMLImageElement: ['document.createElement("img")'], + Range: ['new Range()'], + // MouseEvent: ['new MouseEvent("foo")'], + Text: ['document.createTextNode("x")'], + // CSSPseudoElement: [], + }); - idlArray.add_objects({ - "Window": ["window"], - "MediaQueryList": ["matchMedia('all')"], - "MediaQueryListEvent": ["new MediaQueryListEvent('change')"], - "Screen": ["screen"], - "Document": ["document"], - "CaretPosition": ["document.caretPositionFromPoint(5, 5)"], - "Element": ["document.createElementNS('x', 'y')"], - "HTMLElement": ["document.createElement('div')"], - "HTMLImageElement": ["document.createElement('img')"], - "Range": ["new Range()"], - // "MouseEvent": ["new MouseEvent('foo')"], - "Text": ["document.createTextNode('x')"], - // "CSSPseudoElement": [], - }); - idlArray.test(); -}; - -function fetchData(url) { - return fetch(url).then((response) => response.text()); -} - -function waitForLoad() { - return new Promise(function(resolve) { - addEventListener("load", resolve); - }); -} - -promise_test(function() { - // Have to wait for onload - return Promise.all([fetchData("/interfaces/html.idl"), - fetchData("/interfaces/dom.idl"), - fetchData("/interfaces/uievents.idl"), - fetchData("/interfaces/cssom.idl"), - fetchData("/interfaces/cssom-view.idl"), - waitForLoad()]) - .then(doTest); -}, "Test driver"); - + await waitForLoad; + }, + 'Test driver' +); </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/interfaces-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/interfaces-expected.txt index 18d406b..c44a991 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/interfaces-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/interfaces-expected.txt
@@ -1,35 +1,8 @@ This is a testharness.js-based test. -Found 444 tests; 389 PASS, 55 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 429 tests; 374 PASS, 55 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Test driver PASS Partial interface Document: original interface defined PASS Partial interface Window: original interface defined -PASS HTMLElement interface: attribute style -PASS Unscopable handled correctly for style property on HTMLElement -PASS HTMLElement interface: style_element must inherit property "style" with the proper type -PASS HTMLElement interface: document.createElement('unknownelement') must inherit property "style" with the proper type -PASS HTMLLinkElement interface: attribute sheet -PASS Unscopable handled correctly for sheet property on HTMLLinkElement -PASS HTMLStyleElement interface: attribute sheet -PASS Unscopable handled correctly for sheet property on HTMLStyleElement -PASS Window interface: operation getComputedStyle(Element, CSSOMString) -PASS Unscopable handled correctly for getComputedStyle(Element, CSSOMString) on Window -PASS Window interface: window must inherit property "getComputedStyle(Element, CSSOMString)" with the proper type -PASS Window interface: calling getComputedStyle(Element, CSSOMString) on window with too few arguments must throw TypeError -PASS WorkerGlobalScope interface: existence and properties of interface object -PASS DedicatedWorkerGlobalScope interface: existence and properties of interface object -PASS SharedWorkerGlobalScope interface: existence and properties of interface object -PASS WorkerNavigator interface: existence and properties of interface object -PASS WorkerLocation interface: existence and properties of interface object -PASS Document interface: attribute styleSheets -PASS Unscopable handled correctly for styleSheets property on Document -PASS Document interface: document must inherit property "styleSheets" with the proper type -PASS Document interface: new Document() must inherit property "styleSheets" with the proper type -PASS ProcessingInstruction interface: attribute sheet -PASS Unscopable handled correctly for sheet property on ProcessingInstruction -PASS ProcessingInstruction interface: xmlss_pi must inherit property "sheet" with the proper type -PASS SVGElement interface: attribute style -PASS Unscopable handled correctly for style property on SVGElement -PASS SVGElement interface: svg_element must inherit property "style" with the proper type PASS MediaList interface: existence and properties of interface object PASS MediaList interface object length PASS MediaList interface object name @@ -47,16 +20,16 @@ PASS Unscopable handled correctly for appendMedium(CSSOMString) on MediaList PASS MediaList interface: operation deleteMedium(CSSOMString) PASS Unscopable handled correctly for deleteMedium(CSSOMString) on MediaList -PASS MediaList must be primary interface of style_element.sheet.media -PASS Stringification of style_element.sheet.media -PASS MediaList interface: style_element.sheet.media must inherit property "mediaText" with the proper type -PASS MediaList interface: style_element.sheet.media must inherit property "length" with the proper type -PASS MediaList interface: style_element.sheet.media must inherit property "item(unsigned long)" with the proper type -PASS MediaList interface: calling item(unsigned long) on style_element.sheet.media with too few arguments must throw TypeError -PASS MediaList interface: style_element.sheet.media must inherit property "appendMedium(CSSOMString)" with the proper type -PASS MediaList interface: calling appendMedium(CSSOMString) on style_element.sheet.media with too few arguments must throw TypeError -PASS MediaList interface: style_element.sheet.media must inherit property "deleteMedium(CSSOMString)" with the proper type -PASS MediaList interface: calling deleteMedium(CSSOMString) on style_element.sheet.media with too few arguments must throw TypeError +PASS MediaList must be primary interface of sheet.media +PASS Stringification of sheet.media +PASS MediaList interface: sheet.media must inherit property "mediaText" with the proper type +PASS MediaList interface: sheet.media must inherit property "length" with the proper type +PASS MediaList interface: sheet.media must inherit property "item(unsigned long)" with the proper type +PASS MediaList interface: calling item(unsigned long) on sheet.media with too few arguments must throw TypeError +PASS MediaList interface: sheet.media must inherit property "appendMedium(CSSOMString)" with the proper type +PASS MediaList interface: calling appendMedium(CSSOMString) on sheet.media with too few arguments must throw TypeError +PASS MediaList interface: sheet.media must inherit property "deleteMedium(CSSOMString)" with the proper type +PASS MediaList interface: calling deleteMedium(CSSOMString) on sheet.media with too few arguments must throw TypeError PASS StyleSheet interface: existence and properties of interface object PASS StyleSheet interface object length PASS StyleSheet interface object name @@ -91,21 +64,21 @@ PASS Unscopable handled correctly for insertRule(CSSOMString, unsigned long) on CSSStyleSheet PASS CSSStyleSheet interface: operation deleteRule(unsigned long) PASS Unscopable handled correctly for deleteRule(unsigned long) on CSSStyleSheet -PASS CSSStyleSheet must be primary interface of style_element.sheet -PASS Stringification of style_element.sheet -PASS CSSStyleSheet interface: style_element.sheet must inherit property "ownerRule" with the proper type -PASS CSSStyleSheet interface: style_element.sheet must inherit property "cssRules" with the proper type -PASS CSSStyleSheet interface: style_element.sheet must inherit property "insertRule(CSSOMString, unsigned long)" with the proper type -PASS CSSStyleSheet interface: calling insertRule(CSSOMString, unsigned long) on style_element.sheet with too few arguments must throw TypeError -PASS CSSStyleSheet interface: style_element.sheet must inherit property "deleteRule(unsigned long)" with the proper type -PASS CSSStyleSheet interface: calling deleteRule(unsigned long) on style_element.sheet with too few arguments must throw TypeError -PASS StyleSheet interface: style_element.sheet must inherit property "type" with the proper type -PASS StyleSheet interface: style_element.sheet must inherit property "href" with the proper type -PASS StyleSheet interface: style_element.sheet must inherit property "ownerNode" with the proper type -PASS StyleSheet interface: style_element.sheet must inherit property "parentStyleSheet" with the proper type -PASS StyleSheet interface: style_element.sheet must inherit property "title" with the proper type -PASS StyleSheet interface: style_element.sheet must inherit property "media" with the proper type -PASS StyleSheet interface: style_element.sheet must inherit property "disabled" with the proper type +PASS CSSStyleSheet must be primary interface of sheet +PASS Stringification of sheet +PASS CSSStyleSheet interface: sheet must inherit property "ownerRule" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "cssRules" with the proper type +PASS CSSStyleSheet interface: sheet must inherit property "insertRule(CSSOMString, unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling insertRule(CSSOMString, unsigned long) on sheet with too few arguments must throw TypeError +PASS CSSStyleSheet interface: sheet must inherit property "deleteRule(unsigned long)" with the proper type +PASS CSSStyleSheet interface: calling deleteRule(unsigned long) on sheet with too few arguments must throw TypeError +PASS StyleSheet interface: sheet must inherit property "type" with the proper type +PASS StyleSheet interface: sheet must inherit property "href" with the proper type +PASS StyleSheet interface: sheet must inherit property "ownerNode" with the proper type +PASS StyleSheet interface: sheet must inherit property "parentStyleSheet" with the proper type +PASS StyleSheet interface: sheet must inherit property "title" with the proper type +PASS StyleSheet interface: sheet must inherit property "media" with the proper type +PASS StyleSheet interface: sheet must inherit property "disabled" with the proper type PASS StyleSheetList interface: existence and properties of interface object PASS StyleSheetList interface object length PASS StyleSheetList interface object name @@ -131,11 +104,11 @@ PASS Unscopable handled correctly for item(unsigned long) on CSSRuleList PASS CSSRuleList interface: attribute length PASS Unscopable handled correctly for length property on CSSRuleList -PASS CSSRuleList must be primary interface of style_element.sheet.cssRules -PASS Stringification of style_element.sheet.cssRules -PASS CSSRuleList interface: style_element.sheet.cssRules must inherit property "item(unsigned long)" with the proper type -PASS CSSRuleList interface: calling item(unsigned long) on style_element.sheet.cssRules with too few arguments must throw TypeError -PASS CSSRuleList interface: style_element.sheet.cssRules must inherit property "length" with the proper type +PASS CSSRuleList must be primary interface of sheet.cssRules +PASS Stringification of sheet.cssRules +PASS CSSRuleList interface: sheet.cssRules must inherit property "item(unsigned long)" with the proper type +PASS CSSRuleList interface: calling item(unsigned long) on sheet.cssRules with too few arguments must throw TypeError +PASS CSSRuleList interface: sheet.cssRules must inherit property "length" with the proper type PASS CSSRule interface: existence and properties of interface object PASS CSSRule interface object length PASS CSSRule interface object name @@ -176,22 +149,22 @@ PASS Unscopable handled correctly for selectorText property on CSSStyleRule PASS CSSStyleRule interface: attribute style PASS Unscopable handled correctly for style property on CSSStyleRule -PASS CSSStyleRule must be primary interface of style_element.sheet.cssRules[4] -PASS Stringification of style_element.sheet.cssRules[4] -PASS CSSStyleRule interface: style_element.sheet.cssRules[4] must inherit property "selectorText" with the proper type -PASS CSSStyleRule interface: style_element.sheet.cssRules[4] must inherit property "style" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[4] must inherit property "STYLE_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[4] must inherit property "CHARSET_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[4] must inherit property "IMPORT_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[4] must inherit property "MEDIA_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[4] must inherit property "FONT_FACE_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[4] must inherit property "PAGE_RULE" with the proper type -FAIL CSSRule interface: style_element.sheet.cssRules[4] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain -PASS CSSRule interface: style_element.sheet.cssRules[4] must inherit property "NAMESPACE_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[4] must inherit property "type" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[4] must inherit property "cssText" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[4] must inherit property "parentRule" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[4] must inherit property "parentStyleSheet" with the proper type +PASS CSSStyleRule must be primary interface of sheet.cssRules[4] +PASS Stringification of sheet.cssRules[4] +PASS CSSStyleRule interface: sheet.cssRules[4] must inherit property "selectorText" with the proper type +PASS CSSStyleRule interface: sheet.cssRules[4] must inherit property "style" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[4] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[4] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[4] must inherit property "parentStyleSheet" with the proper type PASS CSSImportRule interface: existence and properties of interface object PASS CSSImportRule interface object length PASS CSSImportRule interface object name @@ -204,23 +177,23 @@ PASS Unscopable handled correctly for media property on CSSImportRule PASS CSSImportRule interface: attribute styleSheet PASS Unscopable handled correctly for styleSheet property on CSSImportRule -PASS CSSImportRule must be primary interface of style_element.sheet.cssRules[0] -PASS Stringification of style_element.sheet.cssRules[0] -PASS CSSImportRule interface: style_element.sheet.cssRules[0] must inherit property "href" with the proper type -PASS CSSImportRule interface: style_element.sheet.cssRules[0] must inherit property "media" with the proper type -PASS CSSImportRule interface: style_element.sheet.cssRules[0] must inherit property "styleSheet" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[0] must inherit property "STYLE_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[0] must inherit property "CHARSET_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[0] must inherit property "IMPORT_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[0] must inherit property "MEDIA_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[0] must inherit property "FONT_FACE_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[0] must inherit property "PAGE_RULE" with the proper type -FAIL CSSRule interface: style_element.sheet.cssRules[0] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain -PASS CSSRule interface: style_element.sheet.cssRules[0] must inherit property "NAMESPACE_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[0] must inherit property "type" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[0] must inherit property "cssText" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[0] must inherit property "parentRule" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[0] must inherit property "parentStyleSheet" with the proper type +PASS CSSImportRule must be primary interface of sheet.cssRules[0] +PASS Stringification of sheet.cssRules[0] +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "href" with the proper type +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "media" with the proper type +PASS CSSImportRule interface: sheet.cssRules[0] must inherit property "styleSheet" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[0] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[0] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[0] must inherit property "parentStyleSheet" with the proper type PASS CSSGroupingRule interface: existence and properties of interface object PASS CSSGroupingRule interface object length PASS CSSGroupingRule interface object name @@ -243,27 +216,27 @@ PASS Unscopable handled correctly for selectorText property on CSSPageRule PASS CSSPageRule interface: attribute style PASS Unscopable handled correctly for style property on CSSPageRule -PASS CSSPageRule must be primary interface of style_element.sheet.cssRules[2] -PASS Stringification of style_element.sheet.cssRules[2] -PASS CSSPageRule interface: style_element.sheet.cssRules[2] must inherit property "selectorText" with the proper type -PASS CSSPageRule interface: style_element.sheet.cssRules[2] must inherit property "style" with the proper type -FAIL CSSGroupingRule interface: style_element.sheet.cssRules[2] must inherit property "cssRules" with the proper type assert_inherits: property "cssRules" not found in prototype chain -FAIL CSSGroupingRule interface: style_element.sheet.cssRules[2] must inherit property "insertRule(CSSOMString, unsigned long)" with the proper type assert_inherits: property "insertRule" not found in prototype chain -FAIL CSSGroupingRule interface: calling insertRule(CSSOMString, unsigned long) on style_element.sheet.cssRules[2] with too few arguments must throw TypeError assert_inherits: property "insertRule" not found in prototype chain -FAIL CSSGroupingRule interface: style_element.sheet.cssRules[2] must inherit property "deleteRule(unsigned long)" with the proper type assert_inherits: property "deleteRule" not found in prototype chain -FAIL CSSGroupingRule interface: calling deleteRule(unsigned long) on style_element.sheet.cssRules[2] with too few arguments must throw TypeError assert_inherits: property "deleteRule" not found in prototype chain -PASS CSSRule interface: style_element.sheet.cssRules[2] must inherit property "STYLE_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[2] must inherit property "CHARSET_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[2] must inherit property "IMPORT_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[2] must inherit property "MEDIA_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[2] must inherit property "FONT_FACE_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[2] must inherit property "PAGE_RULE" with the proper type -FAIL CSSRule interface: style_element.sheet.cssRules[2] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain -PASS CSSRule interface: style_element.sheet.cssRules[2] must inherit property "NAMESPACE_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[2] must inherit property "type" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[2] must inherit property "cssText" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[2] must inherit property "parentRule" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[2] must inherit property "parentStyleSheet" with the proper type +PASS CSSPageRule must be primary interface of sheet.cssRules[2] +PASS Stringification of sheet.cssRules[2] +PASS CSSPageRule interface: sheet.cssRules[2] must inherit property "selectorText" with the proper type +PASS CSSPageRule interface: sheet.cssRules[2] must inherit property "style" with the proper type +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "cssRules" with the proper type assert_inherits: property "cssRules" not found in prototype chain +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "insertRule(CSSOMString, unsigned long)" with the proper type assert_inherits: property "insertRule" not found in prototype chain +FAIL CSSGroupingRule interface: calling insertRule(CSSOMString, unsigned long) on sheet.cssRules[2] with too few arguments must throw TypeError assert_inherits: property "insertRule" not found in prototype chain +FAIL CSSGroupingRule interface: sheet.cssRules[2] must inherit property "deleteRule(unsigned long)" with the proper type assert_inherits: property "deleteRule" not found in prototype chain +FAIL CSSGroupingRule interface: calling deleteRule(unsigned long) on sheet.cssRules[2] with too few arguments must throw TypeError assert_inherits: property "deleteRule" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[2] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[2] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[2] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[2] must inherit property "parentStyleSheet" with the proper type FAIL CSSMarginRule interface: existence and properties of interface object assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing FAIL CSSMarginRule interface object length assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing FAIL CSSMarginRule interface object name assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing @@ -274,22 +247,22 @@ PASS Unscopable handled correctly for name property on CSSMarginRule FAIL CSSMarginRule interface: attribute style assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing PASS Unscopable handled correctly for style property on CSSMarginRule -FAIL CSSMarginRule must be primary interface of style_element.sheet.cssRules[2].cssRules[0] assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL Stringification of style_element.sheet.cssRules[2].cssRules[0] assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSMarginRule interface: style_element.sheet.cssRules[2].cssRules[0] must inherit property "name" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSMarginRule interface: style_element.sheet.cssRules[2].cssRules[0] must inherit property "style" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSRule interface: style_element.sheet.cssRules[2].cssRules[0] must inherit property "STYLE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSRule interface: style_element.sheet.cssRules[2].cssRules[0] must inherit property "CHARSET_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSRule interface: style_element.sheet.cssRules[2].cssRules[0] must inherit property "IMPORT_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSRule interface: style_element.sheet.cssRules[2].cssRules[0] must inherit property "MEDIA_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSRule interface: style_element.sheet.cssRules[2].cssRules[0] must inherit property "FONT_FACE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSRule interface: style_element.sheet.cssRules[2].cssRules[0] must inherit property "PAGE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSRule interface: style_element.sheet.cssRules[2].cssRules[0] must inherit property "MARGIN_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSRule interface: style_element.sheet.cssRules[2].cssRules[0] must inherit property "NAMESPACE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSRule interface: style_element.sheet.cssRules[2].cssRules[0] must inherit property "type" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSRule interface: style_element.sheet.cssRules[2].cssRules[0] must inherit property "cssText" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSRule interface: style_element.sheet.cssRules[2].cssRules[0] must inherit property "parentRule" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSRule interface: style_element.sheet.cssRules[2].cssRules[0] must inherit property "parentStyleSheet" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSMarginRule must be primary interface of sheet.cssRules[2].cssRules[0] assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL Stringification of sheet.cssRules[2].cssRules[0] assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSMarginRule interface: sheet.cssRules[2].cssRules[0] must inherit property "name" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSMarginRule interface: sheet.cssRules[2].cssRules[0] must inherit property "style" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "STYLE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "CHARSET_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "IMPORT_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "MEDIA_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "FONT_FACE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "PAGE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "MARGIN_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "NAMESPACE_RULE" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "type" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "cssText" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "parentRule" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSRule interface: sheet.cssRules[2].cssRules[0] must inherit property "parentStyleSheet" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" PASS CSSNamespaceRule interface: existence and properties of interface object PASS CSSNamespaceRule interface object length PASS CSSNamespaceRule interface object name @@ -300,22 +273,22 @@ PASS Unscopable handled correctly for namespaceURI property on CSSNamespaceRule PASS CSSNamespaceRule interface: attribute prefix PASS Unscopable handled correctly for prefix property on CSSNamespaceRule -PASS CSSNamespaceRule must be primary interface of style_element.sheet.cssRules[1] -PASS Stringification of style_element.sheet.cssRules[1] -PASS CSSNamespaceRule interface: style_element.sheet.cssRules[1] must inherit property "namespaceURI" with the proper type -PASS CSSNamespaceRule interface: style_element.sheet.cssRules[1] must inherit property "prefix" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[1] must inherit property "STYLE_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[1] must inherit property "CHARSET_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[1] must inherit property "IMPORT_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[1] must inherit property "MEDIA_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[1] must inherit property "FONT_FACE_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[1] must inherit property "PAGE_RULE" with the proper type -FAIL CSSRule interface: style_element.sheet.cssRules[1] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain -PASS CSSRule interface: style_element.sheet.cssRules[1] must inherit property "NAMESPACE_RULE" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[1] must inherit property "type" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[1] must inherit property "cssText" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[1] must inherit property "parentRule" with the proper type -PASS CSSRule interface: style_element.sheet.cssRules[1] must inherit property "parentStyleSheet" with the proper type +PASS CSSNamespaceRule must be primary interface of sheet.cssRules[1] +PASS Stringification of sheet.cssRules[1] +PASS CSSNamespaceRule interface: sheet.cssRules[1] must inherit property "namespaceURI" with the proper type +PASS CSSNamespaceRule interface: sheet.cssRules[1] must inherit property "prefix" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "STYLE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "CHARSET_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "IMPORT_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "MEDIA_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "FONT_FACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "PAGE_RULE" with the proper type +FAIL CSSRule interface: sheet.cssRules[1] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain +PASS CSSRule interface: sheet.cssRules[1] must inherit property "NAMESPACE_RULE" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "type" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "cssText" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "parentRule" with the proper type +PASS CSSRule interface: sheet.cssRules[1] must inherit property "parentStyleSheet" with the proper type PASS CSSStyleDeclaration interface: existence and properties of interface object PASS CSSStyleDeclaration interface object length PASS CSSStyleDeclaration interface object name @@ -340,54 +313,54 @@ PASS Unscopable handled correctly for parentRule property on CSSStyleDeclaration PASS CSSStyleDeclaration interface: attribute cssFloat PASS Unscopable handled correctly for cssFloat property on CSSStyleDeclaration -PASS CSSStyleDeclaration must be primary interface of style_element.sheet.cssRules[4].style -PASS Stringification of style_element.sheet.cssRules[4].style -PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[4].style must inherit property "cssText" with the proper type -PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[4].style must inherit property "length" with the proper type -PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[4].style must inherit property "item(unsigned long)" with the proper type -PASS CSSStyleDeclaration interface: calling item(unsigned long) on style_element.sheet.cssRules[4].style with too few arguments must throw TypeError -PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[4].style must inherit property "getPropertyValue(CSSOMString)" with the proper type -PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on style_element.sheet.cssRules[4].style with too few arguments must throw TypeError -PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[4].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type -PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on style_element.sheet.cssRules[4].style with too few arguments must throw TypeError -PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[4].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type -PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on style_element.sheet.cssRules[4].style with too few arguments must throw TypeError -PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[4].style must inherit property "removeProperty(CSSOMString)" with the proper type -PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on style_element.sheet.cssRules[4].style with too few arguments must throw TypeError -PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[4].style must inherit property "parentRule" with the proper type -PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[4].style must inherit property "cssFloat" with the proper type -PASS CSSStyleDeclaration must be primary interface of style_element.sheet.cssRules[2].style -PASS Stringification of style_element.sheet.cssRules[2].style -PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[2].style must inherit property "cssText" with the proper type -PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[2].style must inherit property "length" with the proper type -PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[2].style must inherit property "item(unsigned long)" with the proper type -PASS CSSStyleDeclaration interface: calling item(unsigned long) on style_element.sheet.cssRules[2].style with too few arguments must throw TypeError -PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[2].style must inherit property "getPropertyValue(CSSOMString)" with the proper type -PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on style_element.sheet.cssRules[2].style with too few arguments must throw TypeError -PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[2].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type -PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on style_element.sheet.cssRules[2].style with too few arguments must throw TypeError -PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[2].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type -PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on style_element.sheet.cssRules[2].style with too few arguments must throw TypeError -PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[2].style must inherit property "removeProperty(CSSOMString)" with the proper type -PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on style_element.sheet.cssRules[2].style with too few arguments must throw TypeError -PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[2].style must inherit property "parentRule" with the proper type -PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[2].style must inherit property "cssFloat" with the proper type -FAIL CSSStyleDeclaration must be primary interface of style_element.sheet.cssRules[2].cssRules[0].style assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL Stringification of style_element.sheet.cssRules[2].cssRules[0].style assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSStyleDeclaration interface: style_element.sheet.cssRules[2].cssRules[0].style must inherit property "cssText" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSStyleDeclaration interface: style_element.sheet.cssRules[2].cssRules[0].style must inherit property "length" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSStyleDeclaration interface: style_element.sheet.cssRules[2].cssRules[0].style must inherit property "item(unsigned long)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSStyleDeclaration interface: calling item(unsigned long) on style_element.sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSStyleDeclaration interface: style_element.sheet.cssRules[2].cssRules[0].style must inherit property "getPropertyValue(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on style_element.sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSStyleDeclaration interface: style_element.sheet.cssRules[2].cssRules[0].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on style_element.sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSStyleDeclaration interface: style_element.sheet.cssRules[2].cssRules[0].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on style_element.sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSStyleDeclaration interface: style_element.sheet.cssRules[2].cssRules[0].style must inherit property "removeProperty(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on style_element.sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSStyleDeclaration interface: style_element.sheet.cssRules[2].cssRules[0].style must inherit property "parentRule" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" -FAIL CSSStyleDeclaration interface: style_element.sheet.cssRules[2].cssRules[0].style must inherit property "cssFloat" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +PASS CSSStyleDeclaration must be primary interface of sheet.cssRules[4].style +PASS Stringification of sheet.cssRules[4].style +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[4].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[4].style must inherit property "cssFloat" with the proper type +PASS CSSStyleDeclaration must be primary interface of sheet.cssRules[2].style +PASS Stringification of sheet.cssRules[2].style +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "cssText" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "length" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "item(unsigned long)" with the proper type +PASS CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "getPropertyValue(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "removeProperty(CSSOMString)" with the proper type +PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[2].style with too few arguments must throw TypeError +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "parentRule" with the proper type +PASS CSSStyleDeclaration interface: sheet.cssRules[2].style must inherit property "cssFloat" with the proper type +FAIL CSSStyleDeclaration must be primary interface of sheet.cssRules[2].cssRules[0].style assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL Stringification of sheet.cssRules[2].cssRules[0].style assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "cssText" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "length" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "item(unsigned long)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling item(unsigned long) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "getPropertyValue(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling getPropertyValue(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "getPropertyPriority(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling getPropertyPriority(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "setProperty(CSSOMString, CSSOMString, CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling setProperty(CSSOMString, CSSOMString, CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "removeProperty(CSSOMString)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on sheet.cssRules[2].cssRules[0].style with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "parentRule" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" +FAIL CSSStyleDeclaration interface: sheet.cssRules[2].cssRules[0].style must inherit property "cssFloat" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Cannot read property '0' of undefined" PASS CSSStyleDeclaration must be primary interface of style_element.style PASS Stringification of style_element.style PASS CSSStyleDeclaration interface: style_element.style must inherit property "cssText" with the proper type @@ -436,13 +409,25 @@ PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "parentRule" with the proper type PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "cssFloat" with the proper type -PASS CSS interface: existence and properties of interface object -PASS CSS interface object length -PASS CSS interface object name -PASS CSS interface: existence and properties of interface prototype object -PASS CSS interface: existence and properties of interface prototype object's "constructor" property -PASS CSS interface: existence and properties of interface prototype object's @@unscopables property -PASS CSS interface: operation escape(CSSOMString) -PASS Unscopable handled correctly for escape(CSSOMString) on CSS +PASS CSS namespace: operation escape(CSSOMString) +PASS SVGElement interface: attribute style +PASS Unscopable handled correctly for style property on SVGElement +PASS SVGElement interface: svg_element must inherit property "style" with the proper type +PASS HTMLElement interface: attribute style +PASS Unscopable handled correctly for style property on HTMLElement +PASS HTMLElement interface: style_element must inherit property "style" with the proper type +PASS HTMLElement interface: document.createElement("unknownelement") must inherit property "style" with the proper type +PASS Window interface: operation getComputedStyle(Element, CSSOMString) +PASS Unscopable handled correctly for getComputedStyle(Element, CSSOMString) on Window +PASS Window interface: window must inherit property "getComputedStyle(Element, CSSOMString)" with the proper type +PASS Window interface: calling getComputedStyle(Element, CSSOMString) on window with too few arguments must throw TypeError +PASS WorkerGlobalScope interface: existence and properties of interface object +PASS Document interface: attribute styleSheets +PASS Unscopable handled correctly for styleSheets property on Document +PASS Document interface: document must inherit property "styleSheets" with the proper type +PASS Document interface: new Document() must inherit property "styleSheets" with the proper type +PASS ProcessingInstruction interface: attribute sheet +PASS Unscopable handled correctly for sheet property on ProcessingInstruction +PASS ProcessingInstruction interface: xmlss_pi must inherit property "sheet" with the proper type Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/interfaces.html b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/interfaces.html index 08d04c0..d409e481 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/interfaces.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/interfaces.html
@@ -28,70 +28,50 @@ <div id=log></div> <script> -"use strict"; -var style_element, svg_element, xmlss_pi; +'use strict'; -function doTest([html, dom, uievents, cssom]) { - style_element = document.getElementById('styleElement'); - svg_element = document.getElementById('svgElement'); - xmlss_pi = document.getElementById('xmlssPiIframe').contentDocument.firstChild; +const waitForLoad = new Promise(r => { addEventListener('load', r); }); - var idlArray = new IdlArray(); - var svg = "interface SVGElement : Element {};"; - idlArray.add_untested_idls(html + dom + svg); - idlArray.add_untested_idls(uievents, { only: [ - 'UIEvent', - 'UIEventInit', - 'MouseEvent', - 'MouseEventInit', - 'EventModifierInit' - ]}); - idlArray.add_idls(cssom); +idl_test( + ['cssom'], + ['SVG', 'uievents', 'html', 'dom'], + async idlArray => { + idlArray.add_objects({ + Document: ['document', 'new Document()'], + StyleSheetList: ['document.styleSheets'], + CSSStyleSheet: ['sheet'], + MediaList: ['sheet.media'], + CSSRuleList: ['sheet.cssRules'], + CSSImportRule: ['sheet.cssRules[0]'], + CSSNamespaceRule: ['sheet.cssRules[1]'], + CSSPageRule: ['sheet.cssRules[2]'], + CSSMarginRule: ['sheet.cssRules[2].cssRules[0]'], + CSSMediaRule: ['sheet.cssRules[3]'], + CSSStyleRule: ['sheet.cssRules[4]'], + CSSStyleDeclaration: [ + 'sheet.cssRules[4].style', // CSSStyleRule + 'sheet.cssRules[2].style', // CSSPageRule + 'sheet.cssRules[2].cssRules[0].style', // CSSMarginRule + 'style_element.style', // ElementCSSInlineStyle for HTMLElement + 'svg_element.style', // ElementCSSInlineStyle for SVGElement + 'getComputedStyle(svg_element)' + ], + ProcessingInstruction: ['xmlss_pi'], + Window: ['window'], + HTMLElement: [ + 'style_element', + 'document.createElement("unknownelement")' + ], + SVGElement: ['svg_element'], + }); - idlArray.add_objects({ - "Document": ["document", "new Document()"], - "StyleSheetList": ["document.styleSheets"], - "CSSStyleSheet": ["style_element.sheet"], - "MediaList": ["style_element.sheet.media"], - "CSSRuleList": ["style_element.sheet.cssRules"], - "CSSImportRule": ["style_element.sheet.cssRules[0]"], - "CSSNamespaceRule": ["style_element.sheet.cssRules[1]"], - "CSSPageRule": ["style_element.sheet.cssRules[2]"], - "CSSMarginRule": ["style_element.sheet.cssRules[2].cssRules[0]"], - "CSSMediaRule": ["style_element.sheet.cssRules[3]"], - "CSSStyleRule": ["style_element.sheet.cssRules[4]"], - "CSSStyleDeclaration": ["style_element.sheet.cssRules[4].style", // CSSStyleRule - "style_element.sheet.cssRules[2].style", // CSSPageRule - "style_element.sheet.cssRules[2].cssRules[0].style", // CSSMarginRule - "style_element.style", // ElementCSSInlineStyle for HTMLElement - "svg_element.style", // ElementCSSInlineStyle for SVGElement - "getComputedStyle(svg_element)"], - "ProcessingInstruction": ["xmlss_pi"], - "Window": ["window"], - "HTMLElement": ["style_element", "document.createElement('unknownelement')"], - "SVGElement": ["svg_element"], - }); - idlArray.test(); -}; - -function fetchData(url) { - return fetch(url).then((response) => response.text()); -} - -function waitForLoad() { - return new Promise(function(resolve) { - addEventListener("load", resolve); - }); -} - -promise_test(function() { - // Have to wait for onload - return Promise.all([fetchData("/interfaces/html.idl"), - fetchData("/interfaces/dom.idl"), - fetchData("/interfaces/uievents.idl"), - fetchData("/interfaces/cssom.idl"), - waitForLoad()]) - .then(doTest); -}, "Test driver"); + await waitForLoad; + self.style_element = document.getElementById('styleElement'); + self.sheet = style_element.sheet; + self.svg_element = document.getElementById('svgElement'); + self.xmlss_pi = document.getElementById('xmlssPiIframe').contentDocument.firstChild; + }, + 'Test driver' +); </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/Comment-Text-constructor.js b/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/Comment-Text-constructor.js index 360b976..24b4425 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/Comment-Text-constructor.js +++ b/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/Comment-Text-constructor.js
@@ -23,7 +23,7 @@ assert_equals(object.ownerDocument, document); }, "new " + ctor + "(): no arguments"); - var arguments = [ + var testArgs = [ [undefined, ""], [null, "null"], [42, "42"], @@ -37,7 +37,7 @@ ["&", "&"], ]; - arguments.forEach(function(a) { + testArgs.forEach(function(a) { var argument = a[0], expected = a[1]; test(function() { var object = new window[ctor](argument);
diff --git a/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/Node-textContent.html b/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/Node-textContent.html index 9378dec..cf2e072 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/Node-textContent.html +++ b/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/Node-textContent.html
@@ -111,7 +111,7 @@ // Setting // DocumentFragment, Element: -var arguments = [ +var testArgs = [ [null, null], [undefined, null], ["", null], @@ -121,7 +121,7 @@ ["d\0e", "d\0e"] // XXX unpaired surrogate? ] -arguments.forEach(function(aValue) { +testArgs.forEach(function(aValue) { var argument = aValue[0], expectation = aValue[1] var check = function(aElementOrDocumentFragment) { if (expectation === null) {
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces.https.html b/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces.https.html index 165865d..78f7d13 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces.https.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces.https.html
@@ -33,210 +33,191 @@ return input; } -function doTest([html, dom, cssom, uievents, touchevents]) { - var idlArray = new IdlArray(); - var svg = "interface SVGElement : Element {};"; - idlArray.add_untested_idls(dom + svg + cssom + uievents + touchevents); - idlArray.add_idls(html); +const waitForLoad = new Promise(resolve => { addEventListener('load', resolve); }) - idlArray.add_objects({ - NodeList: ['document.getElementsByName("name")'], - HTMLAllCollection: ['document.all'], - HTMLFormControlsCollection: ['document.createElement("form").elements'], - RadioNodeList: [], - HTMLOptionsCollection: ['document.createElement("select").options'], - DOMStringMap: ['document.head.dataset'], - Transferable: [], - Document: ['iframe.contentDocument', 'new Document()'], - XMLDocument: ['document.implementation.createDocument(null, "", null)'], - HTMLElement: ['document.createElement("noscript")'], // more tests in html/semantics/interfaces.js - HTMLUnknownElement: ['document.createElement("bgsound")'], // more tests in html/semantics/interfaces.js - HTMLHtmlElement: ['document.createElement("html")'], - HTMLHeadElement: ['document.createElement("head")'], - HTMLTitleElement: ['document.createElement("title")'], - HTMLBaseElement: ['document.createElement("base")'], - HTMLLinkElement: ['document.createElement("link")'], - HTMLMetaElement: ['document.createElement("meta")'], - HTMLStyleElement: ['document.createElement("style")'], - HTMLScriptElement: ['document.createElement("script")'], - HTMLBodyElement: ['document.createElement("body")'], - HTMLHeadingElement: ['document.createElement("h1")'], - HTMLParagraphElement: ['document.createElement("p")'], - HTMLHRElement: ['document.createElement("hr")'], - HTMLPreElement: [ - 'document.createElement("pre")', - 'document.createElement("listing")', - 'document.createElement("xmp")', - ], - HTMLQuoteElement: [ - 'document.createElement("blockquote")', - 'document.createElement("q")', - ], - HTMLOlistElement: ['document.createElement("ol")'], - HTMLUlistElement: ['document.createElement("ul")'], - HTMLLIElement: ['document.createElement("li")'], - HTMLDlistElement: ['document.createElement("dl")'], - HTMLDivElement: ['document.createElement("div")'], - HTMLAnchorElement: ['document.createElement("a")'], - HTMLDataElement: ['document.createElement("data")'], - HTMLTimeElement: ['document.createElement("time")'], - HTMLSpanElement: ['document.createElement("span")'], - HTMLBRElement: ['document.createElement("br")'], - HTMLModElement: [ - 'document.createElement("ins")', - 'document.createElement("del")', - ], - HTMLPictureElement: ['document.createElement("picture")'], - HTMLImageElement: ['document.createElement("img")', 'new Image()'], - HTMLIframeElement: ['document.createElement("iframe")'], - HTMLEmbedElement: ['document.createElement("embed")'], - HTMLObjectElement: ['document.createElement("object")'], - HTMLParamElement: ['document.createElement("param")'], - HTMLVideoElement: ['document.createElement("video")'], - HTMLAudioElement: ['document.createElement("audio")', 'new Audio()'], - HTMLSourceElement: ['document.createElement("source")'], - HTMLTrackElement: ['document.createElement("track")'], - HTMLMediaElement: [], - MediaError: ['errorVideo.error'], - AudioTrackList: [], - AudioTrack: [], - VideoTrackList: [], - VideoTrack: [], - TextTrackList: ['document.createElement("video").textTracks'], - TextTrack: ['document.createElement("track").track'], - TextTrackCueList: ['document.createElement("video").addTextTrack("subtitles").cues'], - TextTrackCue: [], - DataCue: [], - TimeRanges: ['document.createElement("video").buffered'], - TrackEvent: ['new TrackEvent("addtrack", {track:document.createElement("track").track})'], - HTMLTemplateElement: ['document.createElement("template")'], - HTMLSlotElement: ['document.createElement("slot")'], - HTMLCanvasElement: ['document.createElement("canvas")'], - CanvasRenderingContext2D: ['document.createElement("canvas").getContext("2d")'], - CanvasGradient: [], - CanvasPattern: [], - TextMetrics: [], - ImageData: [], - HTMLMapElement: ['document.createElement("map")'], - HTMLAreaElement: ['document.createElement("area")'], - HTMLTableElement: ['document.createElement("table")'], - HTMLTableCaptionElement: ['document.createElement("caption")'], - HTMLTableColElement: [ - 'document.createElement("colgroup")', - 'document.createElement("col")', - ], - HTMLTableSectionElement: [ - 'document.createElement("tbody")', - 'document.createElement("thead")', - 'document.createElement("tfoot")', - ], - HTMLTableRowElement: ['document.createElement("tr")'], - HTMLTableCellElement: [ - 'document.createElement("td")', - 'document.createElement("th")', - ], - HTMLFormElement: ['document.createElement("form")'], - HTMLFieldsetElement: ['document.createElement("fieldset")'], - HTMLLegendElement: ['document.createElement("legend")'], - HTMLLabelElement: ['document.createElement("label")'], - HTMLInputElement: [ - 'document.createElement("input")', - 'createInput("text")', - 'createInput("hidden")', - 'createInput("search")', - 'createInput("tel")', - 'createInput("url")', - 'createInput("email")', - 'createInput("password")', - 'createInput("date")', - 'createInput("month")', - 'createInput("week")', - 'createInput("time")', - 'createInput("datetime-local")', - 'createInput("number")', - 'createInput("range")', - 'createInput("color")', - 'createInput("checkbox")', - 'createInput("radio")', - 'createInput("file")', - 'createInput("submit")', - 'createInput("image")', - 'createInput("reset")', - 'createInput("button")' - ], - HTMLButtonElement: ['document.createElement("button")'], - HTMLSelectElement: ['document.createElement("select")'], - HTMLDataListElement: ['document.createElement("datalist")'], - HTMLOptGroupElement: ['document.createElement("optgroup")'], - HTMLOptionElement: ['document.createElement("option")', 'new Option()'], - HTMLTextAreaElement: ['document.createElement("textarea")'], - HTMLOutputElement: ['document.createElement("output")'], - HTMLProgressElement: ['document.createElement("progress")'], - HTMLMeterElement: ['document.createElement("meter")'], - ValidityState: ['document.createElement("input").validity'], - HTMLDetailsElement: ['document.createElement("details")'], - HTMLMenuElement: ['document.createElement("menu")'], - Window: ['window'], - BarProp: [], - History: ['window.history'], - Location: ['window.location'], - PopStateEvent: ['new PopStateEvent("popstate", { data: {} })'], - HashChangeEvent: [], - PageTransitionEvent: [], - BeforeUnloadEvent: [], - ApplicationCache: ['window.applicationCache'], - WindowModal: [], - Navigator: ['window.navigator'], - External: ['window.external'], - DataTransfer: [], - DataTransferItemList: [], - DataTransferItem: [], - DragEvent: [], - NavigatorUserMediaError: [], - MediaStream: [], - LocalMediaStream: [], - MediaStreamTrack: [], - MediaStreamRecorder: [], - PeerConnection: [], - MediaStreamEvent: [], - ErrorEvent: [], - WebSocket: ['new WebSocket("wss://foo")'], - CloseEvent: ['new CloseEvent("close")'], - AbstractWorker: [], - Worker: [], - SharedWorker: [], - MessageEvent: ['new MessageEvent("message", { data: 5 })'], - MessageChannel: [], - MessagePort: [], - HTMLMarqueeElement: ['document.createElement("marquee")'], - HTMLFrameSetElement: ['document.createElement("frameset")'], - HTMLFrameElement: ['document.createElement("frame")'], - HTMLDirectoryElement: ['document.createElement("dir")'], - HTMLFontElement: ['document.createElement("font")'], - }); - idlArray.prevent_multiple_testing("HTMLElement"); - idlArray.test(); -}; - -function fetchData(url) { - return fetch(url).then((response) => response.text()); -} - -function waitForLoad() { - return new Promise(function(resolve) { - addEventListener("load", resolve); - }); -} - -promise_test(function() { - // Have to wait for onload - return Promise.all([fetchData("/interfaces/html.idl"), - fetchData("/interfaces/dom.idl"), - fetchData("/interfaces/cssom.idl"), - fetchData("/interfaces/touchevents.idl"), - fetchData("/interfaces/uievents.idl"), - waitForLoad()]) - .then(doTest); -}, "Test driver"); +idl_test( + ['html'], + ['SVG', 'cssom', 'touchevents', 'uievents', 'dom'], + async idlArray => { + idlArray.add_objects({ + NodeList: ['document.getElementsByName("name")'], + HTMLAllCollection: ['document.all'], + HTMLFormControlsCollection: ['document.createElement("form").elements'], + RadioNodeList: [], + HTMLOptionsCollection: ['document.createElement("select").options'], + DOMStringMap: ['document.head.dataset'], + Transferable: [], + Document: ['iframe.contentDocument', 'new Document()'], + XMLDocument: ['document.implementation.createDocument(null, "", null)'], + HTMLElement: ['document.createElement("noscript")'], // more tests in html/semantics/interfaces.js + HTMLUnknownElement: ['document.createElement("bgsound")'], // more tests in html/semantics/interfaces.js + HTMLHtmlElement: ['document.createElement("html")'], + HTMLHeadElement: ['document.createElement("head")'], + HTMLTitleElement: ['document.createElement("title")'], + HTMLBaseElement: ['document.createElement("base")'], + HTMLLinkElement: ['document.createElement("link")'], + HTMLMetaElement: ['document.createElement("meta")'], + HTMLStyleElement: ['document.createElement("style")'], + HTMLScriptElement: ['document.createElement("script")'], + HTMLBodyElement: ['document.createElement("body")'], + HTMLHeadingElement: ['document.createElement("h1")'], + HTMLParagraphElement: ['document.createElement("p")'], + HTMLHRElement: ['document.createElement("hr")'], + HTMLPreElement: [ + 'document.createElement("pre")', + 'document.createElement("listing")', + 'document.createElement("xmp")', + ], + HTMLQuoteElement: [ + 'document.createElement("blockquote")', + 'document.createElement("q")', + ], + HTMLOlistElement: ['document.createElement("ol")'], + HTMLUlistElement: ['document.createElement("ul")'], + HTMLLIElement: ['document.createElement("li")'], + HTMLDlistElement: ['document.createElement("dl")'], + HTMLDivElement: ['document.createElement("div")'], + HTMLAnchorElement: ['document.createElement("a")'], + HTMLDataElement: ['document.createElement("data")'], + HTMLTimeElement: ['document.createElement("time")'], + HTMLSpanElement: ['document.createElement("span")'], + HTMLBRElement: ['document.createElement("br")'], + HTMLModElement: [ + 'document.createElement("ins")', + 'document.createElement("del")', + ], + HTMLPictureElement: ['document.createElement("picture")'], + HTMLImageElement: ['document.createElement("img")', 'new Image()'], + HTMLIframeElement: ['document.createElement("iframe")'], + HTMLEmbedElement: ['document.createElement("embed")'], + HTMLObjectElement: ['document.createElement("object")'], + HTMLParamElement: ['document.createElement("param")'], + HTMLVideoElement: ['document.createElement("video")'], + HTMLAudioElement: ['document.createElement("audio")', 'new Audio()'], + HTMLSourceElement: ['document.createElement("source")'], + HTMLTrackElement: ['document.createElement("track")'], + HTMLMediaElement: [], + MediaError: ['errorVideo.error'], + AudioTrackList: [], + AudioTrack: [], + VideoTrackList: [], + VideoTrack: [], + TextTrackList: ['document.createElement("video").textTracks'], + TextTrack: ['document.createElement("track").track'], + TextTrackCueList: ['document.createElement("video").addTextTrack("subtitles").cues'], + TextTrackCue: [], + DataCue: [], + TimeRanges: ['document.createElement("video").buffered'], + TrackEvent: ['new TrackEvent("addtrack", {track:document.createElement("track").track})'], + HTMLTemplateElement: ['document.createElement("template")'], + HTMLSlotElement: ['document.createElement("slot")'], + HTMLCanvasElement: ['document.createElement("canvas")'], + CanvasRenderingContext2D: ['document.createElement("canvas").getContext("2d")'], + CanvasGradient: [], + CanvasPattern: [], + TextMetrics: [], + ImageData: [], + HTMLMapElement: ['document.createElement("map")'], + HTMLAreaElement: ['document.createElement("area")'], + HTMLTableElement: ['document.createElement("table")'], + HTMLTableCaptionElement: ['document.createElement("caption")'], + HTMLTableColElement: [ + 'document.createElement("colgroup")', + 'document.createElement("col")', + ], + HTMLTableSectionElement: [ + 'document.createElement("tbody")', + 'document.createElement("thead")', + 'document.createElement("tfoot")', + ], + HTMLTableRowElement: ['document.createElement("tr")'], + HTMLTableCellElement: [ + 'document.createElement("td")', + 'document.createElement("th")', + ], + HTMLFormElement: ['document.createElement("form")'], + HTMLFieldsetElement: ['document.createElement("fieldset")'], + HTMLLegendElement: ['document.createElement("legend")'], + HTMLLabelElement: ['document.createElement("label")'], + HTMLInputElement: [ + 'document.createElement("input")', + 'createInput("text")', + 'createInput("hidden")', + 'createInput("search")', + 'createInput("tel")', + 'createInput("url")', + 'createInput("email")', + 'createInput("password")', + 'createInput("date")', + 'createInput("month")', + 'createInput("week")', + 'createInput("time")', + 'createInput("datetime-local")', + 'createInput("number")', + 'createInput("range")', + 'createInput("color")', + 'createInput("checkbox")', + 'createInput("radio")', + 'createInput("file")', + 'createInput("submit")', + 'createInput("image")', + 'createInput("reset")', + 'createInput("button")' + ], + HTMLButtonElement: ['document.createElement("button")'], + HTMLSelectElement: ['document.createElement("select")'], + HTMLDataListElement: ['document.createElement("datalist")'], + HTMLOptGroupElement: ['document.createElement("optgroup")'], + HTMLOptionElement: ['document.createElement("option")', 'new Option()'], + HTMLTextAreaElement: ['document.createElement("textarea")'], + HTMLOutputElement: ['document.createElement("output")'], + HTMLProgressElement: ['document.createElement("progress")'], + HTMLMeterElement: ['document.createElement("meter")'], + ValidityState: ['document.createElement("input").validity'], + HTMLDetailsElement: ['document.createElement("details")'], + HTMLMenuElement: ['document.createElement("menu")'], + Window: ['window'], + BarProp: [], + History: ['window.history'], + Location: ['window.location'], + PopStateEvent: ['new PopStateEvent("popstate", { data: {} })'], + HashChangeEvent: [], + PageTransitionEvent: [], + BeforeUnloadEvent: [], + ApplicationCache: ['window.applicationCache'], + WindowModal: [], + Navigator: ['window.navigator'], + External: ['window.external'], + DataTransfer: [], + DataTransferItemList: [], + DataTransferItem: [], + DragEvent: [], + NavigatorUserMediaError: [], + MediaStream: [], + LocalMediaStream: [], + MediaStreamTrack: [], + MediaStreamRecorder: [], + PeerConnection: [], + MediaStreamEvent: [], + ErrorEvent: [], + WebSocket: ['new WebSocket("wss://foo")'], + CloseEvent: ['new CloseEvent("close")'], + AbstractWorker: [], + Worker: [], + SharedWorker: [], + MessageEvent: ['new MessageEvent("message", { data: 5 })'], + MessageChannel: [], + MessagePort: [], + HTMLMarqueeElement: ['document.createElement("marquee")'], + HTMLFrameSetElement: ['document.createElement("frameset")'], + HTMLFrameElement: ['document.createElement("frame")'], + HTMLDirectoryElement: ['document.createElement("dir")'], + HTMLFontElement: ['document.createElement("font")'], + }); + idlArray.prevent_multiple_testing('HTMLElement'); + await waitForLoad; + }, + 'html interfaces' +); </script>
diff --git "a/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces.https_exclude=\050Document_Window_HTML._\051-expected.txt" "b/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces.https_exclude=\050Document_Window_HTML._\051-expected.txt" index aa7ff5c..c5c2494e 100644 --- "a/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces.https_exclude=\050Document_Window_HTML._\051-expected.txt" +++ "b/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces.https_exclude=\050Document_Window_HTML._\051-expected.txt"
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -PASS Test driver +PASS html interfaces PASS Partial interface Document: original interface defined PASS Partial interface NavigatorID: original interface defined PASS Partial interface HTMLAnchorElement: original interface defined @@ -1512,5 +1512,145 @@ PASS Stringification of window.external PASS External interface: window.external must inherit property "AddSearchProvider()" with the proper type PASS External interface: window.external must inherit property "IsSearchProviderInstalled()" with the proper type +PASS SVGElement interface: attribute onabort +PASS Unscopable handled correctly for onabort property on SVGElement +PASS SVGElement interface: attribute onauxclick +PASS Unscopable handled correctly for onauxclick property on SVGElement +PASS SVGElement interface: attribute onblur +PASS Unscopable handled correctly for onblur property on SVGElement +PASS SVGElement interface: attribute oncancel +PASS Unscopable handled correctly for oncancel property on SVGElement +PASS SVGElement interface: attribute oncanplay +PASS Unscopable handled correctly for oncanplay property on SVGElement +PASS SVGElement interface: attribute oncanplaythrough +PASS Unscopable handled correctly for oncanplaythrough property on SVGElement +PASS SVGElement interface: attribute onchange +PASS Unscopable handled correctly for onchange property on SVGElement +PASS SVGElement interface: attribute onclick +PASS Unscopable handled correctly for onclick property on SVGElement +PASS SVGElement interface: attribute onclose +PASS Unscopable handled correctly for onclose property on SVGElement +PASS SVGElement interface: attribute oncontextmenu +PASS Unscopable handled correctly for oncontextmenu property on SVGElement +PASS SVGElement interface: attribute oncuechange +PASS Unscopable handled correctly for oncuechange property on SVGElement +PASS SVGElement interface: attribute ondblclick +PASS Unscopable handled correctly for ondblclick property on SVGElement +PASS SVGElement interface: attribute ondrag +PASS Unscopable handled correctly for ondrag property on SVGElement +PASS SVGElement interface: attribute ondragend +PASS Unscopable handled correctly for ondragend property on SVGElement +PASS SVGElement interface: attribute ondragenter +PASS Unscopable handled correctly for ondragenter property on SVGElement +FAIL SVGElement interface: attribute ondragexit assert_true: The prototype object must have a property "ondragexit" expected true got false +PASS Unscopable handled correctly for ondragexit property on SVGElement +PASS SVGElement interface: attribute ondragleave +PASS Unscopable handled correctly for ondragleave property on SVGElement +PASS SVGElement interface: attribute ondragover +PASS Unscopable handled correctly for ondragover property on SVGElement +PASS SVGElement interface: attribute ondragstart +PASS Unscopable handled correctly for ondragstart property on SVGElement +PASS SVGElement interface: attribute ondrop +PASS Unscopable handled correctly for ondrop property on SVGElement +PASS SVGElement interface: attribute ondurationchange +PASS Unscopable handled correctly for ondurationchange property on SVGElement +PASS SVGElement interface: attribute onemptied +PASS Unscopable handled correctly for onemptied property on SVGElement +PASS SVGElement interface: attribute onended +PASS Unscopable handled correctly for onended property on SVGElement +PASS SVGElement interface: attribute onerror +PASS Unscopable handled correctly for onerror property on SVGElement +PASS SVGElement interface: attribute onfocus +PASS Unscopable handled correctly for onfocus property on SVGElement +PASS SVGElement interface: attribute oninput +PASS Unscopable handled correctly for oninput property on SVGElement +PASS SVGElement interface: attribute oninvalid +PASS Unscopable handled correctly for oninvalid property on SVGElement +PASS SVGElement interface: attribute onkeydown +PASS Unscopable handled correctly for onkeydown property on SVGElement +PASS SVGElement interface: attribute onkeypress +PASS Unscopable handled correctly for onkeypress property on SVGElement +PASS SVGElement interface: attribute onkeyup +PASS Unscopable handled correctly for onkeyup property on SVGElement +PASS SVGElement interface: attribute onload +PASS Unscopable handled correctly for onload property on SVGElement +PASS SVGElement interface: attribute onloadeddata +PASS Unscopable handled correctly for onloadeddata property on SVGElement +PASS SVGElement interface: attribute onloadedmetadata +PASS Unscopable handled correctly for onloadedmetadata property on SVGElement +FAIL SVGElement interface: attribute onloadend assert_true: The prototype object must have a property "onloadend" expected true got false +PASS Unscopable handled correctly for onloadend property on SVGElement +PASS SVGElement interface: attribute onloadstart +PASS Unscopable handled correctly for onloadstart property on SVGElement +PASS SVGElement interface: attribute onmousedown +PASS Unscopable handled correctly for onmousedown property on SVGElement +PASS SVGElement interface: attribute onmouseenter +PASS Unscopable handled correctly for onmouseenter property on SVGElement +PASS SVGElement interface: attribute onmouseleave +PASS Unscopable handled correctly for onmouseleave property on SVGElement +PASS SVGElement interface: attribute onmousemove +PASS Unscopable handled correctly for onmousemove property on SVGElement +PASS SVGElement interface: attribute onmouseout +PASS Unscopable handled correctly for onmouseout property on SVGElement +PASS SVGElement interface: attribute onmouseover +PASS Unscopable handled correctly for onmouseover property on SVGElement +PASS SVGElement interface: attribute onmouseup +PASS Unscopable handled correctly for onmouseup property on SVGElement +PASS SVGElement interface: attribute onwheel +PASS Unscopable handled correctly for onwheel property on SVGElement +PASS SVGElement interface: attribute onpause +PASS Unscopable handled correctly for onpause property on SVGElement +PASS SVGElement interface: attribute onplay +PASS Unscopable handled correctly for onplay property on SVGElement +PASS SVGElement interface: attribute onplaying +PASS Unscopable handled correctly for onplaying property on SVGElement +PASS SVGElement interface: attribute onprogress +PASS Unscopable handled correctly for onprogress property on SVGElement +PASS SVGElement interface: attribute onratechange +PASS Unscopable handled correctly for onratechange property on SVGElement +PASS SVGElement interface: attribute onreset +PASS Unscopable handled correctly for onreset property on SVGElement +PASS SVGElement interface: attribute onresize +PASS Unscopable handled correctly for onresize property on SVGElement +PASS SVGElement interface: attribute onscroll +PASS Unscopable handled correctly for onscroll property on SVGElement +FAIL SVGElement interface: attribute onsecuritypolicyviolation assert_true: The prototype object must have a property "onsecuritypolicyviolation" expected true got false +PASS Unscopable handled correctly for onsecuritypolicyviolation property on SVGElement +PASS SVGElement interface: attribute onseeked +PASS Unscopable handled correctly for onseeked property on SVGElement +PASS SVGElement interface: attribute onseeking +PASS Unscopable handled correctly for onseeking property on SVGElement +PASS SVGElement interface: attribute onselect +PASS Unscopable handled correctly for onselect property on SVGElement +PASS SVGElement interface: attribute onstalled +PASS Unscopable handled correctly for onstalled property on SVGElement +PASS SVGElement interface: attribute onsubmit +PASS Unscopable handled correctly for onsubmit property on SVGElement +PASS SVGElement interface: attribute onsuspend +PASS Unscopable handled correctly for onsuspend property on SVGElement +PASS SVGElement interface: attribute ontimeupdate +PASS Unscopable handled correctly for ontimeupdate property on SVGElement +PASS SVGElement interface: attribute ontoggle +PASS Unscopable handled correctly for ontoggle property on SVGElement +PASS SVGElement interface: attribute onvolumechange +PASS Unscopable handled correctly for onvolumechange property on SVGElement +PASS SVGElement interface: attribute onwaiting +PASS Unscopable handled correctly for onwaiting property on SVGElement +FAIL SVGElement interface: attribute oncopy assert_own_property: expected property "oncopy" missing +PASS Unscopable handled correctly for oncopy property on SVGElement +FAIL SVGElement interface: attribute oncut assert_own_property: expected property "oncut" missing +PASS Unscopable handled correctly for oncut property on SVGElement +FAIL SVGElement interface: attribute onpaste assert_own_property: expected property "onpaste" missing +PASS Unscopable handled correctly for onpaste property on SVGElement +PASS SVGElement interface: attribute dataset +PASS Unscopable handled correctly for dataset property on SVGElement +PASS SVGElement interface: attribute nonce +PASS Unscopable handled correctly for nonce property on SVGElement +PASS SVGElement interface: attribute tabIndex +PASS Unscopable handled correctly for tabIndex property on SVGElement +PASS SVGElement interface: operation focus(FocusOptions) +PASS Unscopable handled correctly for focus(FocusOptions) on SVGElement +PASS SVGElement interface: operation blur() +PASS Unscopable handled correctly for blur() on SVGElement Harness: the test ran to completion.
diff --git "a/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces.https_include=\050Document_Window\051-expected.txt" "b/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces.https_include=\050Document_Window\051-expected.txt" index 6be909ac..faa8a3bc 100644 --- "a/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces.https_include=\050Document_Window\051-expected.txt" +++ "b/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces.https_include=\050Document_Window\051-expected.txt"
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -PASS Test driver +PASS html interfaces PASS Partial interface Document: original interface defined PASS Partial interface NavigatorID: original interface defined PASS Partial interface HTMLAnchorElement: original interface defined @@ -36,6 +36,421 @@ PASS Partial interface HTMLUListElement: original interface defined PASS Partial interface Document[2]: original interface defined PASS Partial interface Window: original interface defined +PASS Window interface: existence and properties of interface object +PASS Window interface object length +PASS Window interface object name +PASS Window interface: existence and properties of interface prototype object +PASS Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via Object.setPrototypeOf should throw a TypeError +PASS Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via __proto__ should throw a TypeError +PASS Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via Reflect.setPrototypeOf should return false +PASS Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via Object.setPrototypeOf should not throw +PASS Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via __proto__ should not throw +PASS Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via Reflect.setPrototypeOf should return true +PASS Window interface: existence and properties of interface prototype object's "constructor" property +PASS Window interface: existence and properties of interface prototype object's @@unscopables property +FAIL Window interface: attribute self assert_equals: "self" must have a getter expected "function" but got "undefined" +PASS Unscopable handled correctly for self property on Window +PASS Window interface: attribute name +PASS Unscopable handled correctly for name property on Window +PASS Window interface: attribute history +PASS Unscopable handled correctly for history property on Window +PASS Window interface: attribute customElements +PASS Unscopable handled correctly for customElements property on Window +PASS Window interface: attribute locationbar +PASS Unscopable handled correctly for locationbar property on Window +PASS Window interface: attribute menubar +PASS Unscopable handled correctly for menubar property on Window +PASS Window interface: attribute personalbar +PASS Unscopable handled correctly for personalbar property on Window +PASS Window interface: attribute scrollbars +PASS Unscopable handled correctly for scrollbars property on Window +PASS Window interface: attribute statusbar +PASS Unscopable handled correctly for statusbar property on Window +PASS Window interface: attribute toolbar +PASS Unscopable handled correctly for toolbar property on Window +PASS Window interface: attribute status +PASS Unscopable handled correctly for status property on Window +PASS Window interface: operation close() +PASS Unscopable handled correctly for close() on Window +FAIL Window interface: attribute closed assert_equals: "closed" must have a getter expected "function" but got "undefined" +PASS Unscopable handled correctly for closed property on Window +PASS Window interface: operation stop() +PASS Unscopable handled correctly for stop() on Window +PASS Window interface: operation focus() +PASS Unscopable handled correctly for focus() on Window +PASS Window interface: operation blur() +PASS Unscopable handled correctly for blur() on Window +FAIL Window interface: attribute frames assert_equals: "frames" must have a getter expected "function" but got "undefined" +PASS Unscopable handled correctly for frames property on Window +FAIL Window interface: attribute length assert_equals: "length" must have a getter expected "function" but got "undefined" +PASS Unscopable handled correctly for length property on Window +FAIL Window interface: attribute opener assert_equals: "opener" must have a getter expected "function" but got "undefined" +PASS Unscopable handled correctly for opener property on Window +FAIL Window interface: attribute parent assert_equals: "parent" must have a getter expected "function" but got "undefined" +PASS Unscopable handled correctly for parent property on Window +PASS Window interface: attribute frameElement +PASS Unscopable handled correctly for frameElement property on Window +PASS Window interface: operation open(USVString, DOMString, DOMString) +PASS Unscopable handled correctly for open(USVString, DOMString, DOMString) on Window +PASS Window interface: attribute navigator +PASS Unscopable handled correctly for navigator property on Window +PASS Window interface: attribute applicationCache +PASS Unscopable handled correctly for applicationCache property on Window +PASS Window interface: operation alert() +PASS Unscopable handled correctly for alert() on Window +PASS Window interface: operation alert(DOMString) +PASS Unscopable handled correctly for alert(DOMString) on Window +PASS Window interface: operation confirm(DOMString) +PASS Unscopable handled correctly for confirm(DOMString) on Window +PASS Window interface: operation prompt(DOMString, DOMString) +PASS Unscopable handled correctly for prompt(DOMString, DOMString) on Window +PASS Window interface: operation print() +PASS Unscopable handled correctly for print() on Window +PASS Window interface: operation requestAnimationFrame(FrameRequestCallback) +PASS Unscopable handled correctly for requestAnimationFrame(FrameRequestCallback) on Window +PASS Window interface: operation cancelAnimationFrame(unsigned long) +PASS Unscopable handled correctly for cancelAnimationFrame(unsigned long) on Window +PASS Window interface: operation postMessage(any, USVString, [object Object]) +PASS Unscopable handled correctly for postMessage(any, USVString, [object Object]) on Window +PASS Window interface: operation postMessage(any, [object Object], WindowPostMessageOptions) +PASS Unscopable handled correctly for postMessage(any, [object Object], WindowPostMessageOptions) on Window +PASS Window interface: operation captureEvents() +PASS Unscopable handled correctly for captureEvents() on Window +PASS Window interface: operation releaseEvents() +PASS Unscopable handled correctly for releaseEvents() on Window +PASS Window interface: attribute external +PASS Unscopable handled correctly for external property on Window +PASS Window interface: attribute onabort +PASS Unscopable handled correctly for onabort property on Window +PASS Window interface: attribute onauxclick +PASS Unscopable handled correctly for onauxclick property on Window +PASS Window interface: attribute onblur +PASS Unscopable handled correctly for onblur property on Window +PASS Window interface: attribute oncancel +PASS Unscopable handled correctly for oncancel property on Window +PASS Window interface: attribute oncanplay +PASS Unscopable handled correctly for oncanplay property on Window +PASS Window interface: attribute oncanplaythrough +PASS Unscopable handled correctly for oncanplaythrough property on Window +PASS Window interface: attribute onchange +PASS Unscopable handled correctly for onchange property on Window +PASS Window interface: attribute onclick +PASS Unscopable handled correctly for onclick property on Window +PASS Window interface: attribute onclose +PASS Unscopable handled correctly for onclose property on Window +PASS Window interface: attribute oncontextmenu +PASS Unscopable handled correctly for oncontextmenu property on Window +PASS Window interface: attribute oncuechange +PASS Unscopable handled correctly for oncuechange property on Window +PASS Window interface: attribute ondblclick +PASS Unscopable handled correctly for ondblclick property on Window +PASS Window interface: attribute ondrag +PASS Unscopable handled correctly for ondrag property on Window +PASS Window interface: attribute ondragend +PASS Unscopable handled correctly for ondragend property on Window +PASS Window interface: attribute ondragenter +PASS Unscopable handled correctly for ondragenter property on Window +FAIL Window interface: attribute ondragexit assert_own_property: The global object must have a property "ondragexit" expected property "ondragexit" missing +PASS Unscopable handled correctly for ondragexit property on Window +PASS Window interface: attribute ondragleave +PASS Unscopable handled correctly for ondragleave property on Window +PASS Window interface: attribute ondragover +PASS Unscopable handled correctly for ondragover property on Window +PASS Window interface: attribute ondragstart +PASS Unscopable handled correctly for ondragstart property on Window +PASS Window interface: attribute ondrop +PASS Unscopable handled correctly for ondrop property on Window +PASS Window interface: attribute ondurationchange +PASS Unscopable handled correctly for ondurationchange property on Window +PASS Window interface: attribute onemptied +PASS Unscopable handled correctly for onemptied property on Window +PASS Window interface: attribute onended +PASS Unscopable handled correctly for onended property on Window +PASS Window interface: attribute onerror +PASS Unscopable handled correctly for onerror property on Window +PASS Window interface: attribute onfocus +PASS Unscopable handled correctly for onfocus property on Window +PASS Window interface: attribute oninput +PASS Unscopable handled correctly for oninput property on Window +PASS Window interface: attribute oninvalid +PASS Unscopable handled correctly for oninvalid property on Window +PASS Window interface: attribute onkeydown +PASS Unscopable handled correctly for onkeydown property on Window +PASS Window interface: attribute onkeypress +PASS Unscopable handled correctly for onkeypress property on Window +PASS Window interface: attribute onkeyup +PASS Unscopable handled correctly for onkeyup property on Window +PASS Window interface: attribute onload +PASS Unscopable handled correctly for onload property on Window +PASS Window interface: attribute onloadeddata +PASS Unscopable handled correctly for onloadeddata property on Window +PASS Window interface: attribute onloadedmetadata +PASS Unscopable handled correctly for onloadedmetadata property on Window +FAIL Window interface: attribute onloadend assert_own_property: The global object must have a property "onloadend" expected property "onloadend" missing +PASS Unscopable handled correctly for onloadend property on Window +PASS Window interface: attribute onloadstart +PASS Unscopable handled correctly for onloadstart property on Window +PASS Window interface: attribute onmousedown +PASS Unscopable handled correctly for onmousedown property on Window +PASS Window interface: attribute onmouseenter +PASS Unscopable handled correctly for onmouseenter property on Window +PASS Window interface: attribute onmouseleave +PASS Unscopable handled correctly for onmouseleave property on Window +PASS Window interface: attribute onmousemove +PASS Unscopable handled correctly for onmousemove property on Window +PASS Window interface: attribute onmouseout +PASS Unscopable handled correctly for onmouseout property on Window +PASS Window interface: attribute onmouseover +PASS Unscopable handled correctly for onmouseover property on Window +PASS Window interface: attribute onmouseup +PASS Unscopable handled correctly for onmouseup property on Window +PASS Window interface: attribute onwheel +PASS Unscopable handled correctly for onwheel property on Window +PASS Window interface: attribute onpause +PASS Unscopable handled correctly for onpause property on Window +PASS Window interface: attribute onplay +PASS Unscopable handled correctly for onplay property on Window +PASS Window interface: attribute onplaying +PASS Unscopable handled correctly for onplaying property on Window +PASS Window interface: attribute onprogress +PASS Unscopable handled correctly for onprogress property on Window +PASS Window interface: attribute onratechange +PASS Unscopable handled correctly for onratechange property on Window +PASS Window interface: attribute onreset +PASS Unscopable handled correctly for onreset property on Window +PASS Window interface: attribute onresize +PASS Unscopable handled correctly for onresize property on Window +PASS Window interface: attribute onscroll +PASS Unscopable handled correctly for onscroll property on Window +FAIL Window interface: attribute onsecuritypolicyviolation assert_own_property: The global object must have a property "onsecuritypolicyviolation" expected property "onsecuritypolicyviolation" missing +PASS Unscopable handled correctly for onsecuritypolicyviolation property on Window +PASS Window interface: attribute onseeked +PASS Unscopable handled correctly for onseeked property on Window +PASS Window interface: attribute onseeking +PASS Unscopable handled correctly for onseeking property on Window +PASS Window interface: attribute onselect +PASS Unscopable handled correctly for onselect property on Window +PASS Window interface: attribute onstalled +PASS Unscopable handled correctly for onstalled property on Window +PASS Window interface: attribute onsubmit +PASS Unscopable handled correctly for onsubmit property on Window +PASS Window interface: attribute onsuspend +PASS Unscopable handled correctly for onsuspend property on Window +PASS Window interface: attribute ontimeupdate +PASS Unscopable handled correctly for ontimeupdate property on Window +PASS Window interface: attribute ontoggle +PASS Unscopable handled correctly for ontoggle property on Window +PASS Window interface: attribute onvolumechange +PASS Unscopable handled correctly for onvolumechange property on Window +PASS Window interface: attribute onwaiting +PASS Unscopable handled correctly for onwaiting property on Window +PASS Window interface: attribute onafterprint +PASS Unscopable handled correctly for onafterprint property on Window +PASS Window interface: attribute onbeforeprint +PASS Unscopable handled correctly for onbeforeprint property on Window +PASS Window interface: attribute onbeforeunload +PASS Unscopable handled correctly for onbeforeunload property on Window +PASS Window interface: attribute onhashchange +PASS Unscopable handled correctly for onhashchange property on Window +PASS Window interface: attribute onlanguagechange +PASS Unscopable handled correctly for onlanguagechange property on Window +PASS Window interface: attribute onmessage +PASS Unscopable handled correctly for onmessage property on Window +PASS Window interface: attribute onmessageerror +PASS Unscopable handled correctly for onmessageerror property on Window +PASS Window interface: attribute onoffline +PASS Unscopable handled correctly for onoffline property on Window +PASS Window interface: attribute ononline +PASS Unscopable handled correctly for ononline property on Window +PASS Window interface: attribute onpagehide +PASS Unscopable handled correctly for onpagehide property on Window +PASS Window interface: attribute onpageshow +PASS Unscopable handled correctly for onpageshow property on Window +PASS Window interface: attribute onpopstate +PASS Unscopable handled correctly for onpopstate property on Window +PASS Window interface: attribute onrejectionhandled +PASS Unscopable handled correctly for onrejectionhandled property on Window +PASS Window interface: attribute onstorage +PASS Unscopable handled correctly for onstorage property on Window +PASS Window interface: attribute onunhandledrejection +PASS Unscopable handled correctly for onunhandledrejection property on Window +PASS Window interface: attribute onunload +PASS Unscopable handled correctly for onunload property on Window +PASS Window interface: attribute origin +PASS Unscopable handled correctly for origin property on Window +PASS Window interface: operation btoa(DOMString) +PASS Unscopable handled correctly for btoa(DOMString) on Window +PASS Window interface: operation atob(DOMString) +PASS Unscopable handled correctly for atob(DOMString) on Window +PASS Window interface: operation setTimeout(TimerHandler, long, any) +PASS Unscopable handled correctly for setTimeout(TimerHandler, long, any) on Window +PASS Window interface: operation clearTimeout(long) +PASS Unscopable handled correctly for clearTimeout(long) on Window +PASS Window interface: operation setInterval(TimerHandler, long, any) +PASS Unscopable handled correctly for setInterval(TimerHandler, long, any) on Window +PASS Window interface: operation clearInterval(long) +PASS Unscopable handled correctly for clearInterval(long) on Window +PASS Window interface: operation createImageBitmap(ImageBitmapSource, ImageBitmapOptions) +PASS Unscopable handled correctly for createImageBitmap(ImageBitmapSource, ImageBitmapOptions) on Window +PASS Window interface: operation createImageBitmap(ImageBitmapSource, long, long, long, long, ImageBitmapOptions) +PASS Unscopable handled correctly for createImageBitmap(ImageBitmapSource, long, long, long, long, ImageBitmapOptions) on Window +PASS Window interface: attribute sessionStorage +PASS Unscopable handled correctly for sessionStorage property on Window +PASS Window interface: attribute localStorage +PASS Unscopable handled correctly for localStorage property on Window +PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via Object.setPrototypeOf should throw a TypeError +PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via __proto__ should throw a TypeError +PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via Reflect.setPrototypeOf should return false +PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via Object.setPrototypeOf should not throw +PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via __proto__ should not throw +PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via Reflect.setPrototypeOf should return true +PASS Window must be primary interface of window +PASS Stringification of window +FAIL Window interface: window must have own property "window" assert_false: property descriptor should not have a "value" field expected false got true +FAIL Window interface: window must inherit property "self" with the proper type Unrecognized type WindowProxy +PASS Window interface: window must have own property "document" +PASS Window interface: window must inherit property "name" with the proper type +FAIL Window interface: window must have own property "location" assert_false: property descriptor should not have a "value" field expected false got true +PASS Window interface: window must inherit property "history" with the proper type +PASS Window interface: window must inherit property "customElements" with the proper type +PASS Window interface: window must inherit property "locationbar" with the proper type +PASS Window interface: window must inherit property "menubar" with the proper type +PASS Window interface: window must inherit property "personalbar" with the proper type +PASS Window interface: window must inherit property "scrollbars" with the proper type +PASS Window interface: window must inherit property "statusbar" with the proper type +PASS Window interface: window must inherit property "toolbar" with the proper type +PASS Window interface: window must inherit property "status" with the proper type +PASS Window interface: window must inherit property "close()" with the proper type +PASS Window interface: window must inherit property "closed" with the proper type +PASS Window interface: window must inherit property "stop()" with the proper type +PASS Window interface: window must inherit property "focus()" with the proper type +PASS Window interface: window must inherit property "blur()" with the proper type +FAIL Window interface: window must inherit property "frames" with the proper type Unrecognized type WindowProxy +PASS Window interface: window must inherit property "length" with the proper type +FAIL Window interface: window must have own property "top" assert_false: property descriptor should not have a "value" field expected false got true +PASS Window interface: window must inherit property "opener" with the proper type +FAIL Window interface: window must inherit property "parent" with the proper type Unrecognized type WindowProxy +PASS Window interface: window must inherit property "frameElement" with the proper type +PASS Window interface: window must inherit property "open(USVString, DOMString, DOMString)" with the proper type +PASS Window interface: calling open(USVString, DOMString, DOMString) on window with too few arguments must throw TypeError +PASS Window interface: window must inherit property "navigator" with the proper type +PASS Window interface: window must inherit property "applicationCache" with the proper type +PASS Window interface: window must inherit property "alert()" with the proper type +PASS Window interface: window must inherit property "alert(DOMString)" with the proper type +PASS Window interface: calling alert(DOMString) on window with too few arguments must throw TypeError +PASS Window interface: window must inherit property "confirm(DOMString)" with the proper type +PASS Window interface: calling confirm(DOMString) on window with too few arguments must throw TypeError +PASS Window interface: window must inherit property "prompt(DOMString, DOMString)" with the proper type +PASS Window interface: calling prompt(DOMString, DOMString) on window with too few arguments must throw TypeError +PASS Window interface: window must inherit property "print()" with the proper type +PASS Window interface: window must inherit property "requestAnimationFrame(FrameRequestCallback)" with the proper type +PASS Window interface: calling requestAnimationFrame(FrameRequestCallback) on window with too few arguments must throw TypeError +PASS Window interface: window must inherit property "cancelAnimationFrame(unsigned long)" with the proper type +PASS Window interface: calling cancelAnimationFrame(unsigned long) on window with too few arguments must throw TypeError +PASS Window interface: window must inherit property "postMessage(any, USVString, [object Object])" with the proper type +PASS Window interface: calling postMessage(any, USVString, [object Object]) on window with too few arguments must throw TypeError +PASS Window interface: window must inherit property "postMessage(any, [object Object], WindowPostMessageOptions)" with the proper type +PASS Window interface: calling postMessage(any, [object Object], WindowPostMessageOptions) on window with too few arguments must throw TypeError +PASS Window interface: window must inherit property "captureEvents()" with the proper type +PASS Window interface: window must inherit property "releaseEvents()" with the proper type +PASS Window interface: window must inherit property "external" with the proper type +PASS Window interface: window must inherit property "onabort" with the proper type +PASS Window interface: window must inherit property "onauxclick" with the proper type +PASS Window interface: window must inherit property "onblur" with the proper type +PASS Window interface: window must inherit property "oncancel" with the proper type +PASS Window interface: window must inherit property "oncanplay" with the proper type +PASS Window interface: window must inherit property "oncanplaythrough" with the proper type +PASS Window interface: window must inherit property "onchange" with the proper type +PASS Window interface: window must inherit property "onclick" with the proper type +PASS Window interface: window must inherit property "onclose" with the proper type +PASS Window interface: window must inherit property "oncontextmenu" with the proper type +PASS Window interface: window must inherit property "oncuechange" with the proper type +PASS Window interface: window must inherit property "ondblclick" with the proper type +PASS Window interface: window must inherit property "ondrag" with the proper type +PASS Window interface: window must inherit property "ondragend" with the proper type +PASS Window interface: window must inherit property "ondragenter" with the proper type +FAIL Window interface: window must inherit property "ondragexit" with the proper type assert_own_property: expected property "ondragexit" missing +PASS Window interface: window must inherit property "ondragleave" with the proper type +PASS Window interface: window must inherit property "ondragover" with the proper type +PASS Window interface: window must inherit property "ondragstart" with the proper type +PASS Window interface: window must inherit property "ondrop" with the proper type +PASS Window interface: window must inherit property "ondurationchange" with the proper type +PASS Window interface: window must inherit property "onemptied" with the proper type +PASS Window interface: window must inherit property "onended" with the proper type +PASS Window interface: window must inherit property "onerror" with the proper type +PASS Window interface: window must inherit property "onfocus" with the proper type +PASS Window interface: window must inherit property "oninput" with the proper type +PASS Window interface: window must inherit property "oninvalid" with the proper type +PASS Window interface: window must inherit property "onkeydown" with the proper type +PASS Window interface: window must inherit property "onkeypress" with the proper type +PASS Window interface: window must inherit property "onkeyup" with the proper type +PASS Window interface: window must inherit property "onload" with the proper type +PASS Window interface: window must inherit property "onloadeddata" with the proper type +PASS Window interface: window must inherit property "onloadedmetadata" with the proper type +FAIL Window interface: window must inherit property "onloadend" with the proper type assert_own_property: expected property "onloadend" missing +PASS Window interface: window must inherit property "onloadstart" with the proper type +PASS Window interface: window must inherit property "onmousedown" with the proper type +PASS Window interface: window must inherit property "onmouseenter" with the proper type +PASS Window interface: window must inherit property "onmouseleave" with the proper type +PASS Window interface: window must inherit property "onmousemove" with the proper type +PASS Window interface: window must inherit property "onmouseout" with the proper type +PASS Window interface: window must inherit property "onmouseover" with the proper type +PASS Window interface: window must inherit property "onmouseup" with the proper type +PASS Window interface: window must inherit property "onwheel" with the proper type +PASS Window interface: window must inherit property "onpause" with the proper type +PASS Window interface: window must inherit property "onplay" with the proper type +PASS Window interface: window must inherit property "onplaying" with the proper type +PASS Window interface: window must inherit property "onprogress" with the proper type +PASS Window interface: window must inherit property "onratechange" with the proper type +PASS Window interface: window must inherit property "onreset" with the proper type +PASS Window interface: window must inherit property "onresize" with the proper type +PASS Window interface: window must inherit property "onscroll" with the proper type +FAIL Window interface: window must inherit property "onsecuritypolicyviolation" with the proper type assert_own_property: expected property "onsecuritypolicyviolation" missing +PASS Window interface: window must inherit property "onseeked" with the proper type +PASS Window interface: window must inherit property "onseeking" with the proper type +PASS Window interface: window must inherit property "onselect" with the proper type +PASS Window interface: window must inherit property "onstalled" with the proper type +PASS Window interface: window must inherit property "onsubmit" with the proper type +PASS Window interface: window must inherit property "onsuspend" with the proper type +PASS Window interface: window must inherit property "ontimeupdate" with the proper type +PASS Window interface: window must inherit property "ontoggle" with the proper type +PASS Window interface: window must inherit property "onvolumechange" with the proper type +PASS Window interface: window must inherit property "onwaiting" with the proper type +PASS Window interface: window must inherit property "onafterprint" with the proper type +PASS Window interface: window must inherit property "onbeforeprint" with the proper type +PASS Window interface: window must inherit property "onbeforeunload" with the proper type +PASS Window interface: window must inherit property "onhashchange" with the proper type +PASS Window interface: window must inherit property "onlanguagechange" with the proper type +PASS Window interface: window must inherit property "onmessage" with the proper type +PASS Window interface: window must inherit property "onmessageerror" with the proper type +PASS Window interface: window must inherit property "onoffline" with the proper type +PASS Window interface: window must inherit property "ononline" with the proper type +PASS Window interface: window must inherit property "onpagehide" with the proper type +PASS Window interface: window must inherit property "onpageshow" with the proper type +PASS Window interface: window must inherit property "onpopstate" with the proper type +PASS Window interface: window must inherit property "onrejectionhandled" with the proper type +PASS Window interface: window must inherit property "onstorage" with the proper type +PASS Window interface: window must inherit property "onunhandledrejection" with the proper type +PASS Window interface: window must inherit property "onunload" with the proper type +PASS Window interface: window must inherit property "origin" with the proper type +PASS Window interface: window must inherit property "btoa(DOMString)" with the proper type +PASS Window interface: calling btoa(DOMString) on window with too few arguments must throw TypeError +PASS Window interface: window must inherit property "atob(DOMString)" with the proper type +PASS Window interface: calling atob(DOMString) on window with too few arguments must throw TypeError +PASS Window interface: window must inherit property "setTimeout(TimerHandler, long, any)" with the proper type +PASS Window interface: calling setTimeout(TimerHandler, long, any) on window with too few arguments must throw TypeError +PASS Window interface: window must inherit property "clearTimeout(long)" with the proper type +PASS Window interface: calling clearTimeout(long) on window with too few arguments must throw TypeError +PASS Window interface: window must inherit property "setInterval(TimerHandler, long, any)" with the proper type +PASS Window interface: calling setInterval(TimerHandler, long, any) on window with too few arguments must throw TypeError +PASS Window interface: window must inherit property "clearInterval(long)" with the proper type +PASS Window interface: calling clearInterval(long) on window with too few arguments must throw TypeError +PASS Window interface: window must inherit property "createImageBitmap(ImageBitmapSource, ImageBitmapOptions)" with the proper type +PASS Window interface: calling createImageBitmap(ImageBitmapSource, ImageBitmapOptions) on window with too few arguments must throw TypeError +PASS Window interface: window must inherit property "createImageBitmap(ImageBitmapSource, long, long, long, long, ImageBitmapOptions)" with the proper type +PASS Window interface: calling createImageBitmap(ImageBitmapSource, long, long, long, long, ImageBitmapOptions) on window with too few arguments must throw TypeError +PASS Window interface: window must inherit property "sessionStorage" with the proper type +PASS Window interface: window must inherit property "localStorage" with the proper type PASS Document interface: attribute domain PASS Unscopable handled correctly for domain property on Document PASS Document interface: attribute referrer @@ -496,541 +911,5 @@ PASS Document interface: new Document() must inherit property "oncopy" with the proper type PASS Document interface: new Document() must inherit property "oncut" with the proper type PASS Document interface: new Document() must inherit property "onpaste" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must have own property "location" -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "domain" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "referrer" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "cookie" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "lastModified" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "readyState" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "title" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "dir" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "body" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "head" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "images" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "embeds" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "plugins" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "links" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "forms" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "scripts" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "getElementsByName(DOMString)" with the proper type -PASS Document interface: calling getElementsByName(DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "currentScript" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "open(DOMString, DOMString)" with the proper type -PASS Document interface: calling open(DOMString, DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "open(USVString, DOMString, DOMString)" with the proper type -PASS Document interface: calling open(USVString, DOMString, DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "close()" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "write(DOMString)" with the proper type -PASS Document interface: calling write(DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "writeln(DOMString)" with the proper type -PASS Document interface: calling writeln(DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "defaultView" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "activeElement" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "hasFocus()" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "designMode" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "execCommand(DOMString, boolean, DOMString)" with the proper type -PASS Document interface: calling execCommand(DOMString, boolean, DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "queryCommandEnabled(DOMString)" with the proper type -PASS Document interface: calling queryCommandEnabled(DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "queryCommandIndeterm(DOMString)" with the proper type -PASS Document interface: calling queryCommandIndeterm(DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "queryCommandState(DOMString)" with the proper type -PASS Document interface: calling queryCommandState(DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "queryCommandSupported(DOMString)" with the proper type -PASS Document interface: calling queryCommandSupported(DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "queryCommandValue(DOMString)" with the proper type -PASS Document interface: calling queryCommandValue(DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onreadystatechange" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "fgColor" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "linkColor" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "vlinkColor" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "alinkColor" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "bgColor" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "anchors" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "applets" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "clear()" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "captureEvents()" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "releaseEvents()" with the proper type -FAIL Document interface: document.implementation.createDocument(null, "", null) must inherit property "all" with the proper type assert_in_array: wrong type: not object or function value "undefined" not in array ["object", "function"] -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onabort" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onauxclick" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onblur" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "oncancel" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "oncanplay" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "oncanplaythrough" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onchange" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onclick" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onclose" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "oncontextmenu" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "oncuechange" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "ondblclick" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "ondrag" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "ondragend" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "ondragenter" with the proper type -FAIL Document interface: document.implementation.createDocument(null, "", null) must inherit property "ondragexit" with the proper type assert_inherits: property "ondragexit" not found in prototype chain -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "ondragleave" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "ondragover" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "ondragstart" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "ondrop" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "ondurationchange" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onemptied" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onended" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onerror" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onfocus" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "oninput" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "oninvalid" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onkeydown" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onkeypress" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onkeyup" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onload" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onloadeddata" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onloadedmetadata" with the proper type -FAIL Document interface: document.implementation.createDocument(null, "", null) must inherit property "onloadend" with the proper type assert_inherits: property "onloadend" not found in prototype chain -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onloadstart" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onmousedown" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onmouseenter" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onmouseleave" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onmousemove" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onmouseout" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onmouseover" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onmouseup" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onwheel" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onpause" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onplay" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onplaying" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onprogress" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onratechange" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onreset" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onresize" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onscroll" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onsecuritypolicyviolation" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onseeked" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onseeking" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onselect" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onstalled" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onsubmit" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onsuspend" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "ontimeupdate" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "ontoggle" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onvolumechange" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onwaiting" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "oncopy" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "oncut" with the proper type -PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "onpaste" with the proper type -PASS Window interface: existence and properties of interface object -PASS Window interface object length -PASS Window interface object name -PASS Window interface: existence and properties of interface prototype object -PASS Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via Object.setPrototypeOf should throw a TypeError -PASS Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via __proto__ should throw a TypeError -PASS Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to a new value via Reflect.setPrototypeOf should return false -PASS Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via Object.setPrototypeOf should not throw -PASS Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via __proto__ should not throw -PASS Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via Reflect.setPrototypeOf should return true -PASS Window interface: existence and properties of interface prototype object's "constructor" property -PASS Window interface: existence and properties of interface prototype object's @@unscopables property -FAIL Window interface: attribute self assert_equals: "self" must have a getter expected "function" but got "undefined" -PASS Unscopable handled correctly for self property on Window -PASS Window interface: attribute name -PASS Unscopable handled correctly for name property on Window -PASS Window interface: attribute history -PASS Unscopable handled correctly for history property on Window -PASS Window interface: attribute customElements -PASS Unscopable handled correctly for customElements property on Window -PASS Window interface: attribute locationbar -PASS Unscopable handled correctly for locationbar property on Window -PASS Window interface: attribute menubar -PASS Unscopable handled correctly for menubar property on Window -PASS Window interface: attribute personalbar -PASS Unscopable handled correctly for personalbar property on Window -PASS Window interface: attribute scrollbars -PASS Unscopable handled correctly for scrollbars property on Window -PASS Window interface: attribute statusbar -PASS Unscopable handled correctly for statusbar property on Window -PASS Window interface: attribute toolbar -PASS Unscopable handled correctly for toolbar property on Window -PASS Window interface: attribute status -PASS Unscopable handled correctly for status property on Window -PASS Window interface: operation close() -PASS Unscopable handled correctly for close() on Window -FAIL Window interface: attribute closed assert_equals: "closed" must have a getter expected "function" but got "undefined" -PASS Unscopable handled correctly for closed property on Window -PASS Window interface: operation stop() -PASS Unscopable handled correctly for stop() on Window -PASS Window interface: operation focus() -PASS Unscopable handled correctly for focus() on Window -PASS Window interface: operation blur() -PASS Unscopable handled correctly for blur() on Window -FAIL Window interface: attribute frames assert_equals: "frames" must have a getter expected "function" but got "undefined" -PASS Unscopable handled correctly for frames property on Window -FAIL Window interface: attribute length assert_equals: "length" must have a getter expected "function" but got "undefined" -PASS Unscopable handled correctly for length property on Window -FAIL Window interface: attribute opener assert_equals: "opener" must have a getter expected "function" but got "undefined" -PASS Unscopable handled correctly for opener property on Window -FAIL Window interface: attribute parent assert_equals: "parent" must have a getter expected "function" but got "undefined" -PASS Unscopable handled correctly for parent property on Window -PASS Window interface: attribute frameElement -PASS Unscopable handled correctly for frameElement property on Window -PASS Window interface: operation open(USVString, DOMString, DOMString) -PASS Unscopable handled correctly for open(USVString, DOMString, DOMString) on Window -PASS Window interface: attribute navigator -PASS Unscopable handled correctly for navigator property on Window -PASS Window interface: attribute applicationCache -PASS Unscopable handled correctly for applicationCache property on Window -PASS Window interface: operation alert() -PASS Unscopable handled correctly for alert() on Window -PASS Window interface: operation alert(DOMString) -PASS Unscopable handled correctly for alert(DOMString) on Window -PASS Window interface: operation confirm(DOMString) -PASS Unscopable handled correctly for confirm(DOMString) on Window -PASS Window interface: operation prompt(DOMString, DOMString) -PASS Unscopable handled correctly for prompt(DOMString, DOMString) on Window -PASS Window interface: operation print() -PASS Unscopable handled correctly for print() on Window -PASS Window interface: operation requestAnimationFrame(FrameRequestCallback) -PASS Unscopable handled correctly for requestAnimationFrame(FrameRequestCallback) on Window -PASS Window interface: operation cancelAnimationFrame(unsigned long) -PASS Unscopable handled correctly for cancelAnimationFrame(unsigned long) on Window -PASS Window interface: operation postMessage(any, USVString, [object Object]) -PASS Unscopable handled correctly for postMessage(any, USVString, [object Object]) on Window -PASS Window interface: operation postMessage(any, [object Object], WindowPostMessageOptions) -PASS Unscopable handled correctly for postMessage(any, [object Object], WindowPostMessageOptions) on Window -PASS Window interface: operation captureEvents() -PASS Unscopable handled correctly for captureEvents() on Window -PASS Window interface: operation releaseEvents() -PASS Unscopable handled correctly for releaseEvents() on Window -PASS Window interface: attribute external -PASS Unscopable handled correctly for external property on Window -PASS Window interface: attribute onabort -PASS Unscopable handled correctly for onabort property on Window -PASS Window interface: attribute onauxclick -PASS Unscopable handled correctly for onauxclick property on Window -PASS Window interface: attribute onblur -PASS Unscopable handled correctly for onblur property on Window -PASS Window interface: attribute oncancel -PASS Unscopable handled correctly for oncancel property on Window -PASS Window interface: attribute oncanplay -PASS Unscopable handled correctly for oncanplay property on Window -PASS Window interface: attribute oncanplaythrough -PASS Unscopable handled correctly for oncanplaythrough property on Window -PASS Window interface: attribute onchange -PASS Unscopable handled correctly for onchange property on Window -PASS Window interface: attribute onclick -PASS Unscopable handled correctly for onclick property on Window -PASS Window interface: attribute onclose -PASS Unscopable handled correctly for onclose property on Window -PASS Window interface: attribute oncontextmenu -PASS Unscopable handled correctly for oncontextmenu property on Window -PASS Window interface: attribute oncuechange -PASS Unscopable handled correctly for oncuechange property on Window -PASS Window interface: attribute ondblclick -PASS Unscopable handled correctly for ondblclick property on Window -PASS Window interface: attribute ondrag -PASS Unscopable handled correctly for ondrag property on Window -PASS Window interface: attribute ondragend -PASS Unscopable handled correctly for ondragend property on Window -PASS Window interface: attribute ondragenter -PASS Unscopable handled correctly for ondragenter property on Window -FAIL Window interface: attribute ondragexit assert_own_property: The global object must have a property "ondragexit" expected property "ondragexit" missing -PASS Unscopable handled correctly for ondragexit property on Window -PASS Window interface: attribute ondragleave -PASS Unscopable handled correctly for ondragleave property on Window -PASS Window interface: attribute ondragover -PASS Unscopable handled correctly for ondragover property on Window -PASS Window interface: attribute ondragstart -PASS Unscopable handled correctly for ondragstart property on Window -PASS Window interface: attribute ondrop -PASS Unscopable handled correctly for ondrop property on Window -PASS Window interface: attribute ondurationchange -PASS Unscopable handled correctly for ondurationchange property on Window -PASS Window interface: attribute onemptied -PASS Unscopable handled correctly for onemptied property on Window -PASS Window interface: attribute onended -PASS Unscopable handled correctly for onended property on Window -PASS Window interface: attribute onerror -PASS Unscopable handled correctly for onerror property on Window -PASS Window interface: attribute onfocus -PASS Unscopable handled correctly for onfocus property on Window -PASS Window interface: attribute oninput -PASS Unscopable handled correctly for oninput property on Window -PASS Window interface: attribute oninvalid -PASS Unscopable handled correctly for oninvalid property on Window -PASS Window interface: attribute onkeydown -PASS Unscopable handled correctly for onkeydown property on Window -PASS Window interface: attribute onkeypress -PASS Unscopable handled correctly for onkeypress property on Window -PASS Window interface: attribute onkeyup -PASS Unscopable handled correctly for onkeyup property on Window -PASS Window interface: attribute onload -PASS Unscopable handled correctly for onload property on Window -PASS Window interface: attribute onloadeddata -PASS Unscopable handled correctly for onloadeddata property on Window -PASS Window interface: attribute onloadedmetadata -PASS Unscopable handled correctly for onloadedmetadata property on Window -FAIL Window interface: attribute onloadend assert_own_property: The global object must have a property "onloadend" expected property "onloadend" missing -PASS Unscopable handled correctly for onloadend property on Window -PASS Window interface: attribute onloadstart -PASS Unscopable handled correctly for onloadstart property on Window -PASS Window interface: attribute onmousedown -PASS Unscopable handled correctly for onmousedown property on Window -PASS Window interface: attribute onmouseenter -PASS Unscopable handled correctly for onmouseenter property on Window -PASS Window interface: attribute onmouseleave -PASS Unscopable handled correctly for onmouseleave property on Window -PASS Window interface: attribute onmousemove -PASS Unscopable handled correctly for onmousemove property on Window -PASS Window interface: attribute onmouseout -PASS Unscopable handled correctly for onmouseout property on Window -PASS Window interface: attribute onmouseover -PASS Unscopable handled correctly for onmouseover property on Window -PASS Window interface: attribute onmouseup -PASS Unscopable handled correctly for onmouseup property on Window -PASS Window interface: attribute onwheel -PASS Unscopable handled correctly for onwheel property on Window -PASS Window interface: attribute onpause -PASS Unscopable handled correctly for onpause property on Window -PASS Window interface: attribute onplay -PASS Unscopable handled correctly for onplay property on Window -PASS Window interface: attribute onplaying -PASS Unscopable handled correctly for onplaying property on Window -PASS Window interface: attribute onprogress -PASS Unscopable handled correctly for onprogress property on Window -PASS Window interface: attribute onratechange -PASS Unscopable handled correctly for onratechange property on Window -PASS Window interface: attribute onreset -PASS Unscopable handled correctly for onreset property on Window -PASS Window interface: attribute onresize -PASS Unscopable handled correctly for onresize property on Window -PASS Window interface: attribute onscroll -PASS Unscopable handled correctly for onscroll property on Window -FAIL Window interface: attribute onsecuritypolicyviolation assert_own_property: The global object must have a property "onsecuritypolicyviolation" expected property "onsecuritypolicyviolation" missing -PASS Unscopable handled correctly for onsecuritypolicyviolation property on Window -PASS Window interface: attribute onseeked -PASS Unscopable handled correctly for onseeked property on Window -PASS Window interface: attribute onseeking -PASS Unscopable handled correctly for onseeking property on Window -PASS Window interface: attribute onselect -PASS Unscopable handled correctly for onselect property on Window -PASS Window interface: attribute onstalled -PASS Unscopable handled correctly for onstalled property on Window -PASS Window interface: attribute onsubmit -PASS Unscopable handled correctly for onsubmit property on Window -PASS Window interface: attribute onsuspend -PASS Unscopable handled correctly for onsuspend property on Window -PASS Window interface: attribute ontimeupdate -PASS Unscopable handled correctly for ontimeupdate property on Window -PASS Window interface: attribute ontoggle -PASS Unscopable handled correctly for ontoggle property on Window -PASS Window interface: attribute onvolumechange -PASS Unscopable handled correctly for onvolumechange property on Window -PASS Window interface: attribute onwaiting -PASS Unscopable handled correctly for onwaiting property on Window -PASS Window interface: attribute onafterprint -PASS Unscopable handled correctly for onafterprint property on Window -PASS Window interface: attribute onbeforeprint -PASS Unscopable handled correctly for onbeforeprint property on Window -PASS Window interface: attribute onbeforeunload -PASS Unscopable handled correctly for onbeforeunload property on Window -PASS Window interface: attribute onhashchange -PASS Unscopable handled correctly for onhashchange property on Window -PASS Window interface: attribute onlanguagechange -PASS Unscopable handled correctly for onlanguagechange property on Window -PASS Window interface: attribute onmessage -PASS Unscopable handled correctly for onmessage property on Window -PASS Window interface: attribute onmessageerror -PASS Unscopable handled correctly for onmessageerror property on Window -PASS Window interface: attribute onoffline -PASS Unscopable handled correctly for onoffline property on Window -PASS Window interface: attribute ononline -PASS Unscopable handled correctly for ononline property on Window -PASS Window interface: attribute onpagehide -PASS Unscopable handled correctly for onpagehide property on Window -PASS Window interface: attribute onpageshow -PASS Unscopable handled correctly for onpageshow property on Window -PASS Window interface: attribute onpopstate -PASS Unscopable handled correctly for onpopstate property on Window -PASS Window interface: attribute onrejectionhandled -PASS Unscopable handled correctly for onrejectionhandled property on Window -PASS Window interface: attribute onstorage -PASS Unscopable handled correctly for onstorage property on Window -PASS Window interface: attribute onunhandledrejection -PASS Unscopable handled correctly for onunhandledrejection property on Window -PASS Window interface: attribute onunload -PASS Unscopable handled correctly for onunload property on Window -PASS Window interface: attribute origin -PASS Unscopable handled correctly for origin property on Window -PASS Window interface: operation btoa(DOMString) -PASS Unscopable handled correctly for btoa(DOMString) on Window -PASS Window interface: operation atob(DOMString) -PASS Unscopable handled correctly for atob(DOMString) on Window -PASS Window interface: operation setTimeout(TimerHandler, long, any) -PASS Unscopable handled correctly for setTimeout(TimerHandler, long, any) on Window -PASS Window interface: operation clearTimeout(long) -PASS Unscopable handled correctly for clearTimeout(long) on Window -PASS Window interface: operation setInterval(TimerHandler, long, any) -PASS Unscopable handled correctly for setInterval(TimerHandler, long, any) on Window -PASS Window interface: operation clearInterval(long) -PASS Unscopable handled correctly for clearInterval(long) on Window -PASS Window interface: operation createImageBitmap(ImageBitmapSource, ImageBitmapOptions) -PASS Unscopable handled correctly for createImageBitmap(ImageBitmapSource, ImageBitmapOptions) on Window -PASS Window interface: operation createImageBitmap(ImageBitmapSource, long, long, long, long, ImageBitmapOptions) -PASS Unscopable handled correctly for createImageBitmap(ImageBitmapSource, long, long, long, long, ImageBitmapOptions) on Window -PASS Window interface: attribute sessionStorage -PASS Unscopable handled correctly for sessionStorage property on Window -PASS Window interface: attribute localStorage -PASS Unscopable handled correctly for localStorage property on Window -PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via Object.setPrototypeOf should throw a TypeError -PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via __proto__ should throw a TypeError -PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to a new value via Reflect.setPrototypeOf should return false -PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via Object.setPrototypeOf should not throw -PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via __proto__ should not throw -PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via Reflect.setPrototypeOf should return true -PASS Window must be primary interface of window -PASS Stringification of window -FAIL Window interface: window must have own property "window" assert_false: property descriptor should not have a "value" field expected false got true -FAIL Window interface: window must inherit property "self" with the proper type Unrecognized type WindowProxy -PASS Window interface: window must have own property "document" -PASS Window interface: window must inherit property "name" with the proper type -FAIL Window interface: window must have own property "location" assert_false: property descriptor should not have a "value" field expected false got true -PASS Window interface: window must inherit property "history" with the proper type -PASS Window interface: window must inherit property "customElements" with the proper type -PASS Window interface: window must inherit property "locationbar" with the proper type -PASS Window interface: window must inherit property "menubar" with the proper type -PASS Window interface: window must inherit property "personalbar" with the proper type -PASS Window interface: window must inherit property "scrollbars" with the proper type -PASS Window interface: window must inherit property "statusbar" with the proper type -PASS Window interface: window must inherit property "toolbar" with the proper type -PASS Window interface: window must inherit property "status" with the proper type -PASS Window interface: window must inherit property "close()" with the proper type -PASS Window interface: window must inherit property "closed" with the proper type -PASS Window interface: window must inherit property "stop()" with the proper type -PASS Window interface: window must inherit property "focus()" with the proper type -PASS Window interface: window must inherit property "blur()" with the proper type -FAIL Window interface: window must inherit property "frames" with the proper type Unrecognized type WindowProxy -PASS Window interface: window must inherit property "length" with the proper type -FAIL Window interface: window must have own property "top" assert_false: property descriptor should not have a "value" field expected false got true -PASS Window interface: window must inherit property "opener" with the proper type -FAIL Window interface: window must inherit property "parent" with the proper type Unrecognized type WindowProxy -PASS Window interface: window must inherit property "frameElement" with the proper type -PASS Window interface: window must inherit property "open(USVString, DOMString, DOMString)" with the proper type -PASS Window interface: calling open(USVString, DOMString, DOMString) on window with too few arguments must throw TypeError -PASS Window interface: window must inherit property "navigator" with the proper type -PASS Window interface: window must inherit property "applicationCache" with the proper type -PASS Window interface: window must inherit property "alert()" with the proper type -PASS Window interface: window must inherit property "alert(DOMString)" with the proper type -PASS Window interface: calling alert(DOMString) on window with too few arguments must throw TypeError -PASS Window interface: window must inherit property "confirm(DOMString)" with the proper type -PASS Window interface: calling confirm(DOMString) on window with too few arguments must throw TypeError -PASS Window interface: window must inherit property "prompt(DOMString, DOMString)" with the proper type -PASS Window interface: calling prompt(DOMString, DOMString) on window with too few arguments must throw TypeError -PASS Window interface: window must inherit property "print()" with the proper type -PASS Window interface: window must inherit property "requestAnimationFrame(FrameRequestCallback)" with the proper type -PASS Window interface: calling requestAnimationFrame(FrameRequestCallback) on window with too few arguments must throw TypeError -PASS Window interface: window must inherit property "cancelAnimationFrame(unsigned long)" with the proper type -PASS Window interface: calling cancelAnimationFrame(unsigned long) on window with too few arguments must throw TypeError -PASS Window interface: window must inherit property "postMessage(any, USVString, [object Object])" with the proper type -PASS Window interface: calling postMessage(any, USVString, [object Object]) on window with too few arguments must throw TypeError -PASS Window interface: window must inherit property "postMessage(any, [object Object], WindowPostMessageOptions)" with the proper type -PASS Window interface: calling postMessage(any, [object Object], WindowPostMessageOptions) on window with too few arguments must throw TypeError -PASS Window interface: window must inherit property "captureEvents()" with the proper type -PASS Window interface: window must inherit property "releaseEvents()" with the proper type -PASS Window interface: window must inherit property "external" with the proper type -PASS Window interface: window must inherit property "onabort" with the proper type -PASS Window interface: window must inherit property "onauxclick" with the proper type -PASS Window interface: window must inherit property "onblur" with the proper type -PASS Window interface: window must inherit property "oncancel" with the proper type -PASS Window interface: window must inherit property "oncanplay" with the proper type -PASS Window interface: window must inherit property "oncanplaythrough" with the proper type -PASS Window interface: window must inherit property "onchange" with the proper type -PASS Window interface: window must inherit property "onclick" with the proper type -PASS Window interface: window must inherit property "onclose" with the proper type -PASS Window interface: window must inherit property "oncontextmenu" with the proper type -PASS Window interface: window must inherit property "oncuechange" with the proper type -PASS Window interface: window must inherit property "ondblclick" with the proper type -PASS Window interface: window must inherit property "ondrag" with the proper type -PASS Window interface: window must inherit property "ondragend" with the proper type -PASS Window interface: window must inherit property "ondragenter" with the proper type -FAIL Window interface: window must inherit property "ondragexit" with the proper type assert_own_property: expected property "ondragexit" missing -PASS Window interface: window must inherit property "ondragleave" with the proper type -PASS Window interface: window must inherit property "ondragover" with the proper type -PASS Window interface: window must inherit property "ondragstart" with the proper type -PASS Window interface: window must inherit property "ondrop" with the proper type -PASS Window interface: window must inherit property "ondurationchange" with the proper type -PASS Window interface: window must inherit property "onemptied" with the proper type -PASS Window interface: window must inherit property "onended" with the proper type -PASS Window interface: window must inherit property "onerror" with the proper type -PASS Window interface: window must inherit property "onfocus" with the proper type -PASS Window interface: window must inherit property "oninput" with the proper type -PASS Window interface: window must inherit property "oninvalid" with the proper type -PASS Window interface: window must inherit property "onkeydown" with the proper type -PASS Window interface: window must inherit property "onkeypress" with the proper type -PASS Window interface: window must inherit property "onkeyup" with the proper type -PASS Window interface: window must inherit property "onload" with the proper type -PASS Window interface: window must inherit property "onloadeddata" with the proper type -PASS Window interface: window must inherit property "onloadedmetadata" with the proper type -FAIL Window interface: window must inherit property "onloadend" with the proper type assert_own_property: expected property "onloadend" missing -PASS Window interface: window must inherit property "onloadstart" with the proper type -PASS Window interface: window must inherit property "onmousedown" with the proper type -PASS Window interface: window must inherit property "onmouseenter" with the proper type -PASS Window interface: window must inherit property "onmouseleave" with the proper type -PASS Window interface: window must inherit property "onmousemove" with the proper type -PASS Window interface: window must inherit property "onmouseout" with the proper type -PASS Window interface: window must inherit property "onmouseover" with the proper type -PASS Window interface: window must inherit property "onmouseup" with the proper type -PASS Window interface: window must inherit property "onwheel" with the proper type -PASS Window interface: window must inherit property "onpause" with the proper type -PASS Window interface: window must inherit property "onplay" with the proper type -PASS Window interface: window must inherit property "onplaying" with the proper type -PASS Window interface: window must inherit property "onprogress" with the proper type -PASS Window interface: window must inherit property "onratechange" with the proper type -PASS Window interface: window must inherit property "onreset" with the proper type -PASS Window interface: window must inherit property "onresize" with the proper type -PASS Window interface: window must inherit property "onscroll" with the proper type -FAIL Window interface: window must inherit property "onsecuritypolicyviolation" with the proper type assert_own_property: expected property "onsecuritypolicyviolation" missing -PASS Window interface: window must inherit property "onseeked" with the proper type -PASS Window interface: window must inherit property "onseeking" with the proper type -PASS Window interface: window must inherit property "onselect" with the proper type -PASS Window interface: window must inherit property "onstalled" with the proper type -PASS Window interface: window must inherit property "onsubmit" with the proper type -PASS Window interface: window must inherit property "onsuspend" with the proper type -PASS Window interface: window must inherit property "ontimeupdate" with the proper type -PASS Window interface: window must inherit property "ontoggle" with the proper type -PASS Window interface: window must inherit property "onvolumechange" with the proper type -PASS Window interface: window must inherit property "onwaiting" with the proper type -PASS Window interface: window must inherit property "onafterprint" with the proper type -PASS Window interface: window must inherit property "onbeforeprint" with the proper type -PASS Window interface: window must inherit property "onbeforeunload" with the proper type -PASS Window interface: window must inherit property "onhashchange" with the proper type -PASS Window interface: window must inherit property "onlanguagechange" with the proper type -PASS Window interface: window must inherit property "onmessage" with the proper type -PASS Window interface: window must inherit property "onmessageerror" with the proper type -PASS Window interface: window must inherit property "onoffline" with the proper type -PASS Window interface: window must inherit property "ononline" with the proper type -PASS Window interface: window must inherit property "onpagehide" with the proper type -PASS Window interface: window must inherit property "onpageshow" with the proper type -PASS Window interface: window must inherit property "onpopstate" with the proper type -PASS Window interface: window must inherit property "onrejectionhandled" with the proper type -PASS Window interface: window must inherit property "onstorage" with the proper type -PASS Window interface: window must inherit property "onunhandledrejection" with the proper type -PASS Window interface: window must inherit property "onunload" with the proper type -PASS Window interface: window must inherit property "origin" with the proper type -PASS Window interface: window must inherit property "btoa(DOMString)" with the proper type -PASS Window interface: calling btoa(DOMString) on window with too few arguments must throw TypeError -PASS Window interface: window must inherit property "atob(DOMString)" with the proper type -PASS Window interface: calling atob(DOMString) on window with too few arguments must throw TypeError -PASS Window interface: window must inherit property "setTimeout(TimerHandler, long, any)" with the proper type -PASS Window interface: calling setTimeout(TimerHandler, long, any) on window with too few arguments must throw TypeError -PASS Window interface: window must inherit property "clearTimeout(long)" with the proper type -PASS Window interface: calling clearTimeout(long) on window with too few arguments must throw TypeError -PASS Window interface: window must inherit property "setInterval(TimerHandler, long, any)" with the proper type -PASS Window interface: calling setInterval(TimerHandler, long, any) on window with too few arguments must throw TypeError -PASS Window interface: window must inherit property "clearInterval(long)" with the proper type -PASS Window interface: calling clearInterval(long) on window with too few arguments must throw TypeError -PASS Window interface: window must inherit property "createImageBitmap(ImageBitmapSource, ImageBitmapOptions)" with the proper type -PASS Window interface: calling createImageBitmap(ImageBitmapSource, ImageBitmapOptions) on window with too few arguments must throw TypeError -PASS Window interface: window must inherit property "createImageBitmap(ImageBitmapSource, long, long, long, long, ImageBitmapOptions)" with the proper type -PASS Window interface: calling createImageBitmap(ImageBitmapSource, long, long, long, long, ImageBitmapOptions) on window with too few arguments must throw TypeError -PASS Window interface: window must inherit property "sessionStorage" with the proper type -PASS Window interface: window must inherit property "localStorage" with the proper type Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces.https_include=HTML._-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces.https_include=HTML._-expected.txt index 12c10025..5ba502f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces.https_include=HTML._-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces.https_include=HTML._-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -PASS Test driver +PASS html interfaces PASS Partial interface Document: original interface defined PASS Partial interface NavigatorID: original interface defined PASS Partial interface HTMLAnchorElement: original interface defined
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces.worker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces.worker-expected.txt index 5cf29a9..e0464fc 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces.worker-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/html/dom/interfaces.worker-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -FAIL Test driver promise_test: Unhandled rejection with value: "SVGElement implements ElementCSSInlineStyle, but SVGElement is undefined." +FAIL Test driver promise_test: Unhandled rejection with value: "SVGElement includes ElementCSSInlineStyle, but SVGElement is undefined." PASS Partial interface Document: original interface defined PASS Partial interface NavigatorID: original interface defined PASS Partial interface HTMLAnchorElement: original interface defined
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/user-activation/message-event-activation-api-iframe-cross-origin.sub.tentative.html b/third_party/WebKit/LayoutTests/external/wpt/html/user-activation/message-event-activation-api-iframe-cross-origin.sub.tentative.html new file mode 100644 index 0000000..63a1da0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/user-activation/message-event-activation-api-iframe-cross-origin.sub.tentative.html
@@ -0,0 +1,55 @@ +<!DOCTYPE html> +<!-- + Tentative due to: + https://github.com/whatwg/html/issues/3739 + +--> +<html> +<head> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-vendor.js"></script> +</head> +<body> + <h1>Clicking in iframe has activation state in child via MessageEvent</h1> + <ol id="instructions"> + <li>Click inside the red area. + </ol> + <iframe id="child" width="200" height="200"></iframe> + <script> + async_test(function(t) { + var child = document.getElementById("child"); + assert_false(navigator.userActivation.isActive); + assert_false(navigator.userActivation.hasBeenActive); + window.addEventListener("message", t.step_func(event => { + if (event.data == 'child-three-loaded') { + // values have false after load + assert_true(event.userActivation != null); + assert_false(event.userActivation.isActive); + assert_false(event.userActivation.hasBeenActive); + test_driver.click(child); + } else if (event.data == 'child-three-clicked') { + // values have activation state on click + assert_true(navigator.userActivation.hasBeenActive); + assert_true(event.userActivation != null); + assert_true(event.userActivation.isActive); + assert_true(event.userActivation.hasBeenActive); + child.contentWindow.postMessage('report', "*"); + } else if (event.data == 'child-three-report') { + assert_false(navigator.userActivation.isActive); + assert_true(navigator.userActivation.hasBeenActive); + assert_true(event.userActivation != null); + assert_false(event.userActivation.isActive); + assert_true(event.userActivation.hasBeenActive); + child.contentWindow.postMessage('report-no-activation', "*"); + } else if (event.data == 'child-three-report-no-activation') { + assert_true(event.userActivation === null); + t.done(); + } + })); + child.src = "http://{{domains[www]}}:{{ports[http][0]}}/html/user-activation/resources/child-three.html"; + }, "Message propagates values on post"); + </script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/user-activation/message-event-init.tentative.html b/third_party/WebKit/LayoutTests/external/wpt/html/user-activation/message-event-init.tentative.html new file mode 100644 index 0000000..8e2b1d0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/user-activation/message-event-init.tentative.html
@@ -0,0 +1,15 @@ +<!DOCTYPE html> +<title>MessageEvent constructor</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> +test(function() { + var ev = new MessageEvent("test", { userActivation: navigator.userActivation }) + assert_equals(ev.userActivation, navigator.userActivation, "userActivation attribute") +}, "MessageEventInit user activation set") +test(function() { + var ev = new MessageEvent("test") + assert_equals(ev.userActivation, null, "userActivation attribute") +}, "MessageEventInit user activation not set") + +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/user-activation/resources/child-three.html b/third_party/WebKit/LayoutTests/external/wpt/html/user-activation/resources/child-three.html new file mode 100644 index 0000000..5a74cf5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/user-activation/resources/child-three.html
@@ -0,0 +1,19 @@ +<!DOCTYPE html> +<body style="background: red;"> + <script> + window.parent.postMessage("child-three-loaded", {targetOrigin: "*", includeUserActivation: true}); + window.addEventListener("click", event => { + window.parent.postMessage("child-three-clicked", {targetOrigin: "*", includeUserActivation: true}); + var win = window.open('404.html'); + win.close(); + }); + + window.addEventListener("message", event => { + if (event.data == "report") + window.parent.postMessage("child-three-report", {targetOrigin: "*", includeUserActivation: true}); + if (event.data == "report-no-activation") + window.parent.postMessage("child-three-report-no-activation", {targetOrigin: "*", includeUserActivation: false}); + }); + +</script> +</body>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/interfaces/cssom.idl b/third_party/WebKit/LayoutTests/external/wpt/interfaces/cssom.idl index b99bbc7..510fa4d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/interfaces/cssom.idl +++ b/third_party/WebKit/LayoutTests/external/wpt/interfaces/cssom.idl
@@ -1,6 +1,7 @@ // GENERATED CONTENT - DO NOT EDIT -// Content of this file was automatically extracted from the CSS Object Model (CSSOM) spec. -// See https://drafts.csswg.org/cssom/ +// Content of this file was automatically extracted from the +// "CSS Object Model (CSSOM)" spec. +// See: https://drafts.csswg.org/cssom/ typedef USVString CSSOMString; @@ -42,14 +43,11 @@ [SameObject] readonly attribute StyleSheetList styleSheets; }; -[Exposed=Window, - NoInterfaceObject] -interface LinkStyle { +interface mixin LinkStyle { readonly attribute StyleSheet? sheet; }; -ProcessingInstruction implements LinkStyle; - +ProcessingInstruction includes LinkStyle; [Exposed=Window] interface CSSRuleList { getter CSSRule? item(unsigned long index); @@ -123,21 +121,19 @@ [CEReactions] attribute [TreatNullAs=EmptyString] CSSOMString cssFloat; }; -[Exposed=Window, - NoInterfaceObject] -interface ElementCSSInlineStyle { +interface mixin ElementCSSInlineStyle { [SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style; }; -HTMLElement implements ElementCSSInlineStyle; +HTMLElement includes ElementCSSInlineStyle; -SVGElement implements ElementCSSInlineStyle; +SVGElement includes ElementCSSInlineStyle; partial interface Window { [NewObject] CSSStyleDeclaration getComputedStyle(Element elt, optional CSSOMString? pseudoElt); }; [Exposed=Window] -interface CSS { - static CSSOMString escape(CSSOMString ident); +namespace CSS { + CSSOMString escape(CSSOMString ident); };
diff --git a/third_party/WebKit/LayoutTests/external/wpt/subresource-integrity/idlharness.window-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/subresource-integrity/idlharness.window-expected.txt index e56b204..17cac98 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/subresource-integrity/idlharness.window-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/subresource-integrity/idlharness.window-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -FAIL webappsec-subresource-integrity interfaces promise_test: Unhandled rejection with value: "ProcessingInstruction implements LinkStyle, but ProcessingInstruction is undefined." +FAIL webappsec-subresource-integrity interfaces promise_test: Unhandled rejection with value: "ProcessingInstruction includes LinkStyle, but ProcessingInstruction is undefined." PASS Partial interface HTMLLinkElement: original interface defined PASS Partial interface HTMLScriptElement: original interface defined Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/fast/harness/override-preferences-3.html b/third_party/WebKit/LayoutTests/fast/harness/override-preferences-3.html new file mode 100644 index 0000000..ce74907 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/harness/override-preferences-3.html
@@ -0,0 +1,41 @@ +<!DOCTYPE html> +<title>Tests parsing for testRunner.overridePreference parameters.</title> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script> +type_error = new TypeError(); + +test(() => { + assert_throws(type_error, () => { + testRunner.overridePreference(); + }); +}, "No parameters"); + +test(() => { + assert_throws(type_error, () => { + testRunner.overridePreference("WebKitDefaultFontSize"); + }); +}, "Only one parameter"); + +test(() => { + assert_throws(type_error, () => { + testRunner.overridePreference(5, 5); + }); +}, "Invalid type for key parameter"); + +test(() => { + assert_throws(type_error, () => { + testRunner.overridePreference("foo", 5); + }); +}, "Unknown key parameter"); + +test(() => { + assert_throws(type_error, () => { + testRunner.overridePreference("WebKitDefaultFontSize", Symbol.iterator); + }); +}, "Failed conversion from value"); + +test(() => { +testRunner.overridePreference("WebKitDefaultFontSize", 5); +}); +</script>
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/relative-sized-document-scrollbars-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/relative-sized-document-scrollbars-expected.txt index 3a47980a..35a2bc0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/relative-sized-document-scrollbars-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/svg/relative-sized-document-scrollbars-expected.txt
@@ -14,12 +14,12 @@ { "object": "LayoutSVGRoot svg", "rect": [6, 2, 788, 595], - "reason": "chunk appeared" + "reason": "paint property change" }, { "object": "LayoutSVGRoot svg", "rect": [6, 4, 788, 592], - "reason": "chunk disappeared" + "reason": "paint property change" } ] }
diff --git a/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-click-event.https.html b/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-click-event.https.html deleted file mode 100644 index 4a2bacb7..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-click-event.https.html +++ /dev/null
@@ -1,19 +0,0 @@ -<!doctype html> -<meta charset="utf-8"> -<title>Background Fetch API: BackgroundFetchClickEvent tests</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/serviceworker/resources/test-helpers.js"></script> - -<!-- TODO(peter): Upstream this test to WPT when the directory has been imported. --> - -<h1>BackgroundFetchClickEvent</h1> -<p>This test validates that the BackgroundFetchClickEvent is exposed and can -be constructed with an id and a valid state.</p> - -<script> -'use strict'; - -// This test needs to be run in a Service Worker. -service_worker_test('resources/background-fetch-click-event-worker.js'); -</script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-event.https.html b/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-event.https.html deleted file mode 100644 index 326079265..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-event.https.html +++ /dev/null
@@ -1,19 +0,0 @@ -<!doctype html> -<meta charset="utf-8"> -<title>Background Fetch API: BackgroundFetchEvent tests</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/serviceworker/resources/test-helpers.js"></script> - -<!-- TODO(peter): Upstream this test to WPT when the directory has been imported. --> - -<h1>BackgroundFetchEvent</h1> -<p>This test validates that the BackgroundFetchEvent is exposed and can -be constructed with an id.</p> - -<script> -'use strict'; - -// This test needs to be run in a Service Worker. -service_worker_test('resources/background-fetch-event-worker.js'); -</script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-fail-event.https.html b/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-fail-event.https.html deleted file mode 100644 index f70f731..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-fail-event.https.html +++ /dev/null
@@ -1,19 +0,0 @@ -<!doctype html> -<meta charset="utf-8"> -<title>Background Fetch API: BackgroundFetchFailEvent tests</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/serviceworker/resources/test-helpers.js"></script> - -<!-- TODO(peter): Upstream this test to WPT when the directory has been imported. --> - -<h1>BackgroundFetchFailEvent</h1> -<p>This test validates that the BackgroundFetchFailEvent is exposed, and can be -constructed with an id and a sequence of settled responses.</p> - -<script> -'use strict'; - -// This test needs to be run in a Service Worker. -service_worker_test('resources/background-fetch-fail-event-worker.js'); -</script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-manager-fetch.https.html b/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-manager-fetch.https.html deleted file mode 100644 index 593e6c4..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-manager-fetch.https.html +++ /dev/null
@@ -1,102 +0,0 @@ -<!doctype html> -<meta charset="utf-8"> -<title>Background Fetch API: fetch() tests</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/serviceworker/resources/test-helpers.js"></script> - -<h1>BackgroundFetchManager.fetch()</h1> -<p>This test validates the behaviour of the fetch() method.</p> - -<!-- TODO(peter): Move this to the WPT directory when it's merged and the - behaviour of fetch() for null and empty sequences is defined. --> - -<script> -'use strict'; - -const workerUrl = 'resources/empty-worker.js'; -const scope = 'resources/scope/' + location.pathname; -const id = 'my-background-fetch'; - -promise_test(function(test) { - return service_worker_unregister_and_register(test, workerUrl, scope) - .then(registration => { - assert_equals(null, registration.active); - return registration.backgroundFetch.fetch('id', ['resources/non-existing-file.png']); - }) - .then(unreached_fulfillment(test), error => { - assert_equals(error.name, 'TypeError'); - }); - -}, 'BackgroundFetchManager.fetch() requires an activated Service Worker.'); - -promise_test(function(test) { - let registration = null; - return service_worker_unregister_and_register(test, workerUrl, scope) - .then(r => { - registration = r; - return wait_for_state(test, r.installing, 'activated'); - }) - .then(() => registration.backgroundFetch.fetch(id, null)) - .then(() => unreached_fulfillment(test), () => true /* pass */); - -}, 'BackgroundFetchManager.fetch() throws when given a null request.'); - -promise_test(function(test) { - let registration = null; - return service_worker_unregister_and_register(test, workerUrl, scope) - .then(r => { - registration = r; - return wait_for_state(test, r.installing, 'activated'); - }) - .then(() => registration.backgroundFetch.fetch(id, [])) - .then(() => unreached_fulfillment(test), () => true /* pass */); - -}, 'BackgroundFetchManager.fetch() throws when given an empty sequence.'); - -promise_test(function(test) { - let registration = null; - return service_worker_unregister_and_register(test, workerUrl, scope) - .then(r => { - registration = r; - return wait_for_state(test, r.installing, 'activated'); - }) - .then(() => registration.backgroundFetch.fetch(id, ['resources/non-existing-file.png', null])) - .then(() => unreached_fulfillment(test), () => true /* pass */); - -}, 'BackgroundFetchManager.fetch() throws when given a sequence with a null request.'); - -promise_test(function(test) { - const options = { - icons: [ - { - src: 'resources/non-existing-large-icon.png', - sizes: '256x256', - type: 'image/png' - }, - { - src: 'resources/non-existing-small-icon.jpg', - sizes: '64x64', - type: 'image/jpg' - } - ], - title: 'My Background Fetch', - downloadTotal: 1024 - }; - - let registration = null; - - return service_worker_unregister_and_register(test, workerUrl, scope) - .then(r => { - registration = r; - return wait_for_state(test, r.installing, 'activated'); - }) - .then(() => registration.backgroundFetch.fetch(id, ['resources/non-existing-file.png'], options)) - .then(backgroundFetchRegistration => { - assert_true(backgroundFetchRegistration instanceof BackgroundFetchRegistration); - assert_equals(backgroundFetchRegistration.id, id); - assert_equals(backgroundFetchRegistration.downloadTotal, options.downloadTotal); - }); - -}, 'BackgroundFetchManager.fetch() returns a BackgroundFetchRegistration object.'); -</script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-manager-get.https.html b/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-manager-get.https.html deleted file mode 100644 index 7c74060..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-manager-get.https.html +++ /dev/null
@@ -1,110 +0,0 @@ -<!doctype html> -<meta charset="utf-8"> -<title>Background Fetch API: get() tests</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/serviceworker/resources/test-helpers.js"></script> - -<h1>BackgroundFetchManager.get()</h1> -<p>This test validates the behaviour of the get() method.</p> - -<!-- TODO(peter): Move this to the WPT directory when it's merged. --> - -<script> -'use strict'; - -const workerUrl = 'resources/empty-worker.js'; -const scope = 'resources/scope/' + location.pathname; - -promise_test(function(test) { - return service_worker_unregister_and_register(test, workerUrl, scope) - .then(registration => { - assert_equals(null, registration.active); - return registration.backgroundFetch.get('id'); - }) - .then(unreached_fulfillment(test), error => { - assert_equals(error.name, 'TypeError'); - }); - -}, 'BackgroundFetchManager.get() requires an activated Service Worker.'); - -promise_test(function(test) { - let registration = null; - - return service_worker_unregister_and_register(test, workerUrl, scope) - .then(r => { - registration = r; - return wait_for_state(test, r.installing, 'activated'); - }) - .then(() => registration.backgroundFetch.get('invalid-fetch-id')) - .then(backgroundFetchRegistration => { - assert_equals(backgroundFetchRegistration, null); - }); - -}, 'BackgroundFetchManager.get() returns NULL for non-existing fetches.'); - -promise_test(function(test) { - const id = 'my-id'; - const options = { - icons: [ - { - src: 'resources/non-existing-large-icon.png', - sizes: '256x256', - type: 'image/png' - }, - { - src: 'resources/non-existing-small-icon.jpg', - sizes: '64x64', - type: 'image/jpg' - } - ], - title: 'My Background Fetch', - downloadTotal: 1024 - }; - - let registration = null; - - return service_worker_unregister_and_register(test, workerUrl, scope) - .then(r => { - registration = r; - return wait_for_state(test, r.installing, 'activated'); - }) - .then(() => registration.backgroundFetch.fetch(id, ['resources/non-existing-file.png'], options)) - .then(backgroundFetchRegistration => { - assert_true(backgroundFetchRegistration instanceof BackgroundFetchRegistration); - - return registration.backgroundFetch.get(id) - .then(secondBackgroundFetchRegistration => { - assert_true(secondBackgroundFetchRegistration instanceof BackgroundFetchRegistration); - assert_equals(secondBackgroundFetchRegistration.id, id); - assert_equals(secondBackgroundFetchRegistration.downloadTotal, options.downloadTotal); - }); - }); -}, 'BackgroundFetchManager.get() can return created fetches.'); - -promise_test(function(test) { - const id = 'my-id'; - - let registration = null; - - return service_worker_unregister_and_register(test, workerUrl, scope) - .then(r => { - registration = r; - return wait_for_state(test, r.installing, 'activated'); - }) - .then(() => registration.backgroundFetch.fetch(id, ['resources/non-existing-file.png'])) - .then(backgroundFetchRegistration => { - assert_true(backgroundFetchRegistration instanceof BackgroundFetchRegistration); - return registration.backgroundFetch.get(id); - }) - .then(secondBackgroundFetchRegistration => { - assert_true(secondBackgroundFetchRegistration instanceof BackgroundFetchRegistration); - return secondBackgroundFetchRegistration.abort(); - }) - .then(() => registration.backgroundFetch.get(id)) - .then(thirdBackgroundFetchRegistration => { - assert_equals(thirdBackgroundFetchRegistration, null); - }); - -}, 'BackgroundFetchManager.get() returned fetches can be aborted.'); -</script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-manager-getTags.https.html b/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-manager-getTags.https.html deleted file mode 100644 index 49900d5..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-manager-getTags.https.html +++ /dev/null
@@ -1,68 +0,0 @@ -<!doctype html> -<meta charset="utf-8"> -<title>Background Fetch API: getIds() tests</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/serviceworker/resources/test-helpers.js"></script> - -<h1>BackgroundFetchManager.getIds()</h1> -<p>This test validates the behaviour of the getIds() method.</p> - -<!-- TODO(peter): Move this to the WPT directory when it's merged. --> - -<script> -'use strict'; - -const workerUrl = 'resources/empty-worker.js'; -const scope = 'resources/scope/' + location.pathname; - -promise_test(function(test) { - return service_worker_unregister_and_register(test, workerUrl, scope) - .then(registration => { - assert_equals(null, registration.active); - return registration.backgroundFetch.getIds(); - }) - .then(unreached_fulfillment(test), error => { - assert_equals(error.name, 'TypeError'); - }); - -}, 'BackgroundFetchManager.getIds() requires an activated Service Worker.'); - -promise_test(function(test) { - let registration = null; - - return service_worker_unregister_and_register(test, workerUrl, scope) - .then(r => { - registration = r; - return wait_for_state(test, r.installing, 'activated'); - }) - .then(() => registration.backgroundFetch.getIds()) - .then(ids => { - assert_true(Array.isArray(ids)); - assert_equals(ids.length, 0); - }); - -}, 'BackgroundFetchManager.getIds() returns an empty sequence by default.'); - -promise_test(function(test) { - const ids = ['first-id', 'second-id', 'third-id']; - - let registration = null; - - return service_worker_unregister_and_register(test, workerUrl, scope) - .then(r => { - registration = r; - return wait_for_state(test, r.installing, 'activated'); - }) - .then(() => { - return Promise.all( - ids.map(id => registration.backgroundFetch.fetch(id, ['resources/non-existing-file.png']))); - }) - .then(() => registration.backgroundFetch.getIds()) - .then(receivedIds => { - assert_array_equals(receivedIds, ids); - }); - -}, 'BackgroundFetchManager.getIds() returns a sequence of active fetches.'); - -</script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-registration-abort.https.html b/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-registration-abort.https.html deleted file mode 100644 index 220fa8ff..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-registration-abort.https.html +++ /dev/null
@@ -1,52 +0,0 @@ -<!doctype html> -<meta charset="utf-8"> -<title>Background Fetch API: BackgroundFetchRegistration.abort() tests</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/serviceworker/resources/test-helpers.js"></script> - -<h1>BackgroundFetchRegistration.abort()</h1> -<p>This test validates the behaviour of the abort() method.</p> - -<!-- TODO(peter): Move this to the WPT directory when it's merged and we - can successfully create a new Background Fetch registration. --> - -<script> -'use strict'; - -const workerUrl = 'resources/empty-worker.js'; -const scope = 'resources/scope/' + location.pathname; - -promise_test(function(test) { - const id = 'my-background-fetch'; - - let registration = null; - let backgroundFetchRegistration = null; - - return service_worker_unregister_and_register(test, workerUrl, scope) - .then(r => { - registration = r; - return wait_for_state(test, r.installing, 'activated'); - }) - .then(() => registration.backgroundFetch.fetch(id, ['resources/non-existing-file.png'])) - .then(r => { - backgroundFetchRegistration = r; - - assert_true(backgroundFetchRegistration instanceof BackgroundFetchRegistration); - assert_inherits(backgroundFetchRegistration, 'abort'); - - return backgroundFetchRegistration.abort(); - }) - .then(success => { - // The registration was valid, so aborting it should be successful. - assert_true(success); - - return backgroundFetchRegistration.abort(); - }) - .then(success => { - // The registration had already been aborted, so aborting it again should fail. - assert_false(success); - }); - -}, 'BackgroundFetchRegistration.abort() return a Promise indicating success.'); -</script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-update-event.https.html b/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-update-event.https.html deleted file mode 100644 index 34a42c63..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/background_fetch/background-fetch-update-event.https.html +++ /dev/null
@@ -1,17 +0,0 @@ -<!doctype html> -<meta charset="utf-8"> -<title>Background Fetch API: BackgroundFetchUpdateEvent tests</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/serviceworker/resources/test-helpers.js"></script> - -<h1>BackgroundFetchUpdateEvent</h1> -<p>This test validates that the BackgroundFetchUpdateEvent is exposed, and can be -constructed with an id and a sequence of settled responses.</p> - -<script> -'use strict'; - -// This test needs to be run in a Service Worker. -service_worker_test('resources/background-fetch-update-event-worker.js'); -</script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/background_fetch/resources/background-fetch-click-event-worker.js b/third_party/WebKit/LayoutTests/http/tests/background_fetch/resources/background-fetch-click-event-worker.js deleted file mode 100644 index 0e5380b8..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/background_fetch/resources/background-fetch-click-event-worker.js +++ /dev/null
@@ -1,31 +0,0 @@ -'use strict'; - -importScripts('/resources/testharness.js'); - -test(function() { - assert_own_property(self, 'BackgroundFetchClickEvent'); - - // The `id` and `state` are required in the BackgroundFetchClickEventInit. - assert_throws({name: "TypeError"}, () => new BackgroundFetchClickEvent('BackgroundFetchClickEvent')); - assert_throws({name: "TypeError"}, () => new BackgroundFetchClickEvent('BackgroundFetchClickEvent', {})); - assert_throws({name: "TypeError"}, () => new BackgroundFetchClickEvent('BackgroundFetchClickEvent', { id: 'foo' })); - assert_throws({name: "TypeError"}, () => new BackgroundFetchClickEvent('BackgroundFetchClickEvent', { id: 'foo', state: 'foo' })); - - // The `state` must be one of { pending, succeeded, failed }. This should not throw. - for (let state of ['pending', 'succeeded', 'failed']) - new BackgroundFetchClickEvent('BackgroundFetchClickEvent', { id: 'foo', state }); - - const event = new BackgroundFetchClickEvent('BackgroundFetchClickEvent', { - id: 'my-id', - state: 'succeeded' - }); - - assert_equals(event.type, 'BackgroundFetchClickEvent'); - assert_equals(event.cancelable, false); - assert_equals(event.bubbles, false); - assert_equals(event.id, 'my-id'); - assert_equals(event.state, 'succeeded'); - - assert_inherits(event, 'waitUntil'); - -}, 'Verifies that the BackgroundFetchClickEvent can be constructed.');
diff --git a/third_party/WebKit/LayoutTests/http/tests/background_fetch/resources/background-fetch-event-worker.js b/third_party/WebKit/LayoutTests/http/tests/background_fetch/resources/background-fetch-event-worker.js deleted file mode 100644 index 3dd792b..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/background_fetch/resources/background-fetch-event-worker.js +++ /dev/null
@@ -1,23 +0,0 @@ -'use strict'; - -importScripts('/resources/testharness.js'); - -test(function() { - assert_own_property(self, 'BackgroundFetchEvent'); - - // The `id` is required in the BackgroundFetchEventInit. - assert_throws({name: "TypeError"}, () => new BackgroundFetchEvent('BackgroundFetchEvent')); - assert_throws({name: "TypeError"}, () => new BackgroundFetchEvent('BackgroundFetchEvent', {})); - - const event = new BackgroundFetchEvent('BackgroundFetchEvent', { - id: 'my-id' - }); - - assert_equals(event.type, 'BackgroundFetchEvent'); - assert_equals(event.cancelable, false); - assert_equals(event.bubbles, false); - assert_equals(event.id, 'my-id'); - - assert_inherits(event, 'waitUntil'); - -}, 'Verifies that the BackgroundFetchEvent can be constructed.');
diff --git a/third_party/WebKit/LayoutTests/http/tests/background_fetch/resources/background-fetch-fail-event-worker.js b/third_party/WebKit/LayoutTests/http/tests/background_fetch/resources/background-fetch-fail-event-worker.js deleted file mode 100644 index 06e8312..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/background_fetch/resources/background-fetch-fail-event-worker.js +++ /dev/null
@@ -1,36 +0,0 @@ -'use strict'; - -importScripts('/resources/testharness.js'); - -test(function() { - assert_own_property(self, 'BackgroundFetchFailEvent'); - - // The `id` and `fetches` are required options in the - // BackgroundFetchFailEventInit. The latter must be a sequence of - // BackgroundFetchSettledFetch instances. - assert_throws({name: "TypeError"}, () => new BackgroundFetchFailEvent('BackgroundFetchFailEvent')); - assert_throws({name: "TypeError"}, () => new BackgroundFetchFailEvent('BackgroundFetchFailEvent', {})); - assert_throws({name: "TypeError"}, () => new BackgroundFetchFailEvent('BackgroundFetchFailEvent', { id: 'foo' })); - assert_throws({name: "TypeError"}, () => new BackgroundFetchFailEvent('BackgroundFetchFailEvent', { id: 'foo', fetches: 'bar' })); - - const fetches = [ - new BackgroundFetchSettledFetch(new Request('non-existing-image.png'), new Response()), - new BackgroundFetchSettledFetch(new Request('non-existing-image-2.png'), new Response()) - ]; - - const event = new BackgroundFetchFailEvent('BackgroundFetchFailEvent', { - id: 'my-id', - fetches - }); - - assert_equals(event.type, 'BackgroundFetchFailEvent'); - assert_equals(event.cancelable, false); - assert_equals(event.bubbles, false); - assert_equals(event.id, 'my-id'); - - assert_true(Array.isArray(event.fetches)); - assert_array_equals(event.fetches, fetches); - - assert_inherits(event, 'waitUntil'); - -}, 'Verifies that the BackgroundFetchFailEvent can be constructed.');
diff --git a/third_party/WebKit/LayoutTests/http/tests/background_fetch/resources/background-fetch-update-event-worker.js b/third_party/WebKit/LayoutTests/http/tests/background_fetch/resources/background-fetch-update-event-worker.js deleted file mode 100644 index bc16c3d..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/background_fetch/resources/background-fetch-update-event-worker.js +++ /dev/null
@@ -1,18 +0,0 @@ -'use strict'; - -importScripts('/resources/testharness.js'); - -promise_test(async function() { - assert_own_property(self, 'BackgroundFetchUpdateEvent'); - - // The `id` and `fetches` are required options in the - // BackgroundFetchUpdateEventInit. The latter must be an instance of - // BackgroundFetchSettledFetches. - assert_throws({name: "TypeError"}, () => new BackgroundFetchUpdateEvent('BackgroundFetchUpdateEvent')); - assert_throws({name: "TypeError"}, () => new BackgroundFetchUpdateEvent('BackgroundFetchUpdateEvent', {})); - assert_throws({name: "TypeError"}, () => new BackgroundFetchUpdateEvent('BackgroundFetchUpdateEvent', { id: 'foo' })); - - // TODO(rayankans): Add actual construction test to BackgroundFetchUpdateEvent after - // https://github.com/WICG/background-fetch/issues/64 is resolved. - -}, 'Verifies that the BackgroundFetchUpdateEvent can be constructed.');
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/svg/absolute-sized-document-no-scrollbars-expected.txt b/third_party/WebKit/LayoutTests/paint/invalidation/svg/absolute-sized-document-no-scrollbars-expected.txt index cb50729a..030ae482 100644 --- a/third_party/WebKit/LayoutTests/paint/invalidation/svg/absolute-sized-document-no-scrollbars-expected.txt +++ b/third_party/WebKit/LayoutTests/paint/invalidation/svg/absolute-sized-document-no-scrollbars-expected.txt
@@ -25,12 +25,12 @@ { "object": "LayoutSVGRoot svg", "rect": [0, 0, 577, 433], - "reason": "chunk appeared" + "reason": "paint property change" }, { "object": "LayoutSVGRoot svg", "rect": [0, 0, 481, 361], - "reason": "chunk disappeared" + "reason": "paint property change" } ] }
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/svg/relative-sized-document-scrollbars-expected.txt b/third_party/WebKit/LayoutTests/paint/invalidation/svg/relative-sized-document-scrollbars-expected.txt index 5a8bcc54..f8d32b2 100644 --- a/third_party/WebKit/LayoutTests/paint/invalidation/svg/relative-sized-document-scrollbars-expected.txt +++ b/third_party/WebKit/LayoutTests/paint/invalidation/svg/relative-sized-document-scrollbars-expected.txt
@@ -25,12 +25,12 @@ { "object": "LayoutSVGRoot svg", "rect": [6, 2, 788, 595], - "reason": "chunk appeared" + "reason": "paint property change" }, { "object": "LayoutSVGRoot svg", "rect": [6, 4, 788, 592], - "reason": "chunk disappeared" + "reason": "paint property change" } ] }
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/svg/resize-svg-invalidate-children-expected.txt b/third_party/WebKit/LayoutTests/paint/invalidation/svg/resize-svg-invalidate-children-expected.txt index 2badce7..5d2938d 100644 --- a/third_party/WebKit/LayoutTests/paint/invalidation/svg/resize-svg-invalidate-children-expected.txt +++ b/third_party/WebKit/LayoutTests/paint/invalidation/svg/resize-svg-invalidate-children-expected.txt
@@ -20,12 +20,12 @@ { "object": "LayoutSVGRoot svg", "rect": [58, 58, 100, 100], - "reason": "chunk appeared" + "reason": "paint property change" }, { "object": "LayoutSVGRoot svg", "rect": [33, 33, 50, 50], - "reason": "chunk disappeared" + "reason": "paint property change" } ] }
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt index 746011cd..cd18a8b 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
@@ -4456,6 +4456,7 @@ getter origin getter ports getter source + getter userActivation method constructor method initMessageEvent interface MessagePort : EventTarget
diff --git a/third_party/blink/common/BUILD.gn b/third_party/blink/common/BUILD.gn index 2c792df3..a8c2d26a 100644 --- a/third_party/blink/common/BUILD.gn +++ b/third_party/blink/common/BUILD.gn
@@ -16,6 +16,8 @@ sources = [ # NOTE: Please do not add public headers that need to be referenced from # outside WebKit, add them in public/common instead. + "associated_interfaces/associated_interface_provider.cc", + "associated_interfaces/associated_interface_registry.cc", "blob/blob_utils.cc", "client_hints/client_hints.cc", "common_export.h",
diff --git a/content/common/associated_interface_provider_impl.cc b/third_party/blink/common/associated_interfaces/associated_interface_provider.cc similarity index 65% rename from content/common/associated_interface_provider_impl.cc rename to third_party/blink/common/associated_interfaces/associated_interface_provider.cc index ba5ef404..e87b89fd 100644 --- a/content/common/associated_interface_provider_impl.cc +++ b/third_party/blink/common/associated_interfaces/associated_interface_provider.cc
@@ -1,17 +1,21 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. +// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/common/associated_interface_provider_impl.h" -#include "base/callback.h" -#include "base/run_loop.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" + +#include <map> + #include "mojo/public/cpp/bindings/associated_binding.h" -namespace content { +namespace blink { -class AssociatedInterfaceProviderImpl::LocalProvider +class AssociatedInterfaceProvider::LocalProvider : public mojom::AssociatedInterfaceProvider { public: + using Binder = + base::RepeatingCallback<void(mojo::ScopedInterfaceEndpointHandle)>; + LocalProvider(mojom::AssociatedInterfaceProviderAssociatedPtr* proxy, scoped_refptr<base::SingleThreadTaskRunner> task_runner) : associated_interface_provider_binding_(this) { @@ -22,9 +26,7 @@ ~LocalProvider() override {} - void SetBinderForName( - const std::string& name, - const base::Callback<void(mojo::ScopedInterfaceEndpointHandle)>& binder) { + void SetBinderForName(const std::string& name, const Binder& binder) { binders_[name] = binder; } @@ -38,39 +40,38 @@ it->second.Run(request.PassHandle()); } - using BinderMap = - std::map<std::string, - base::Callback<void(mojo::ScopedInterfaceEndpointHandle)>>; - BinderMap binders_; - + std::map<std::string, Binder> binders_; mojo::AssociatedBinding<mojom::AssociatedInterfaceProvider> associated_interface_provider_binding_; + + DISALLOW_COPY_AND_ASSIGN(LocalProvider); }; -AssociatedInterfaceProviderImpl::AssociatedInterfaceProviderImpl( +AssociatedInterfaceProvider::AssociatedInterfaceProvider( mojom::AssociatedInterfaceProviderAssociatedPtr proxy, scoped_refptr<base::SingleThreadTaskRunner> task_runner) : proxy_(std::move(proxy)), task_runner_(std::move(task_runner)) { DCHECK(proxy_.is_bound()); } -AssociatedInterfaceProviderImpl::AssociatedInterfaceProviderImpl( +AssociatedInterfaceProvider::AssociatedInterfaceProvider( scoped_refptr<base::SingleThreadTaskRunner> task_runner) : local_provider_(std::make_unique<LocalProvider>(&proxy_, task_runner)), task_runner_(std::move(task_runner)) {} -AssociatedInterfaceProviderImpl::~AssociatedInterfaceProviderImpl() {} +AssociatedInterfaceProvider::~AssociatedInterfaceProvider() = default; -void AssociatedInterfaceProviderImpl::GetInterface( +void AssociatedInterfaceProvider::GetInterface( const std::string& name, mojo::ScopedInterfaceEndpointHandle handle) { proxy_->GetAssociatedInterface( name, mojom::AssociatedInterfaceAssociatedRequest(std::move(handle))); } -void AssociatedInterfaceProviderImpl::OverrideBinderForTesting( +void AssociatedInterfaceProvider::OverrideBinderForTesting( const std::string& name, - const base::Callback<void(mojo::ScopedInterfaceEndpointHandle)>& binder) { + const base::RepeatingCallback<void(mojo::ScopedInterfaceEndpointHandle)>& + binder) { if (!local_provider_) { DCHECK(proxy_.is_bound()); proxy_.reset(); @@ -79,4 +80,4 @@ local_provider_->SetBinderForName(name, binder); } -} // namespace content +} // namespace blink
diff --git a/third_party/blink/common/associated_interfaces/associated_interface_registry.cc b/third_party/blink/common/associated_interfaces/associated_interface_registry.cc new file mode 100644 index 0000000..652296d --- /dev/null +++ b/third_party/blink/common/associated_interfaces/associated_interface_registry.cc
@@ -0,0 +1,38 @@ +// Copyright 2018 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 "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" + +namespace blink { + +AssociatedInterfaceRegistry::AssociatedInterfaceRegistry() = default; + +AssociatedInterfaceRegistry::~AssociatedInterfaceRegistry() = default; + +void AssociatedInterfaceRegistry::AddInterface(const std::string& name, + const Binder& binder) { + auto result = interfaces_.emplace(name, binder); + DCHECK(result.second); +} + +void AssociatedInterfaceRegistry::RemoveInterface(const std::string& name) { + interfaces_.erase(name); +} + +bool AssociatedInterfaceRegistry::TryBindInterface( + const std::string& name, + mojo::ScopedInterfaceEndpointHandle* handle) { + auto it = interfaces_.find(name); + if (it == interfaces_.end()) + return false; + it->second.Run(std::move(*handle)); + return true; +} + +base::WeakPtr<AssociatedInterfaceRegistry> +AssociatedInterfaceRegistry::GetWeakPtr() { + return weak_ptr_factory_.GetWeakPtr(); +} + +} // namespace blink
diff --git a/third_party/blink/common/message_port/transferable_message_struct_traits.cc b/third_party/blink/common/message_port/transferable_message_struct_traits.cc index 38674b298c..fba548a 100644 --- a/third_party/blink/common/message_port/transferable_message_struct_traits.cc +++ b/third_party/blink/common/message_port/transferable_message_struct_traits.cc
@@ -17,7 +17,8 @@ if (!data.ReadMessage(static_cast<blink::CloneableMessage*>(out)) || !data.ReadArrayBufferContentsArray(&out->array_buffer_contents_array) || !data.ReadImageBitmapContentsArray(&out->image_bitmap_contents_array) || - !data.ReadPorts(&ports)) { + !data.ReadPorts(&ports) || + !data.ReadUserActivation(&out->user_activation)) { return false; }
diff --git a/third_party/blink/common/message_port/transferable_message_struct_traits.h b/third_party/blink/common/message_port/transferable_message_struct_traits.h index ff17a2d..2bf79e69 100644 --- a/third_party/blink/common/message_port/transferable_message_struct_traits.h +++ b/third_party/blink/common/message_port/transferable_message_struct_traits.h
@@ -40,6 +40,11 @@ return input.has_user_gesture; } + static const blink::mojom::UserActivationSnapshotPtr& user_activation( + blink::TransferableMessage& input) { + return input.user_activation; + } + static bool Read(blink::mojom::TransferableMessage::DataView data, blink::TransferableMessage* out); };
diff --git a/third_party/blink/public/common/associated_interfaces/associated_interface_provider.h b/third_party/blink/public/common/associated_interfaces/associated_interface_provider.h index 06d7d1b..72eba5d 100644 --- a/third_party/blink/public/common/associated_interfaces/associated_interface_provider.h +++ b/third_party/blink/public/common/associated_interfaces/associated_interface_provider.h
@@ -7,9 +7,15 @@ #include <string> +#include "base/callback.h" +#include "base/macros.h" +#include "base/memory/ref_counted.h" +#include "base/single_thread_task_runner.h" #include "mojo/public/cpp/bindings/associated_interface_ptr.h" #include "mojo/public/cpp/bindings/associated_interface_request.h" #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" +#include "third_party/blink/common/common_export.h" +#include "third_party/blink/public/mojom/associated_interfaces/associated_interfaces.mojom.h" namespace blink { @@ -26,26 +32,57 @@ // example, RenderFrameHost exposes an instance of this class for which all // interfaces are associated with the IPC::ChannelProxy to the render process // which hosts its corresponding RenderFrame. -class AssociatedInterfaceProvider { +class BLINK_COMMON_EXPORT AssociatedInterfaceProvider { public: - virtual ~AssociatedInterfaceProvider() {} + // Binds this to a remote mojom::AssociatedInterfaceProvider. + // + // |task_runner| must belong to the same thread. It will be used to dispatch + // all callbacks and connection error notification. + explicit AssociatedInterfaceProvider( + mojom::AssociatedInterfaceProviderAssociatedPtr proxy, + scoped_refptr<base::SingleThreadTaskRunner> task_runner = nullptr); + + // Constructs a local provider with no remote interfaces. This is useful in + // conjunction with OverrideBinderForTesting(), in test environments where + // there may not be a remote |mojom::AssociatedInterfaceProvider| available. + // + // |task_runner| must belong to the same thread. It will be used to dispatch + // all callbacks and connection error notification. + explicit AssociatedInterfaceProvider( + scoped_refptr<base::SingleThreadTaskRunner> task_runner); + + ~AssociatedInterfaceProvider(); // Passes an associated endpoint handle to the remote end to be bound to a // Channel-associated interface named |name|. - virtual void GetInterface(const std::string& name, - mojo::ScopedInterfaceEndpointHandle handle) = 0; + void GetInterface(const std::string& name, + mojo::ScopedInterfaceEndpointHandle handle); - // Templated helper for GetInterface(). + // Templated helpers for GetInterface(). template <typename Interface> - void GetInterface(mojo::AssociatedInterfacePtr<Interface>* proxy) { - auto request = mojo::MakeRequest(proxy); + void GetInterface(mojo::AssociatedInterfaceRequest<Interface> request) { GetInterface(Interface::Name_, request.PassHandle()); } - virtual void OverrideBinderForTesting( + template <typename Interface> + void GetInterface(mojo::AssociatedInterfacePtr<Interface>* proxy) { + GetInterface(mojo::MakeRequest(proxy)); + } + + void OverrideBinderForTesting( const std::string& name, const base::RepeatingCallback<void(mojo::ScopedInterfaceEndpointHandle)>& - binder) = 0; + binder); + + private: + class LocalProvider; + + mojom::AssociatedInterfaceProviderAssociatedPtr proxy_; + + std::unique_ptr<LocalProvider> local_provider_; + scoped_refptr<base::SingleThreadTaskRunner> task_runner_; + + DISALLOW_COPY_AND_ASSIGN(AssociatedInterfaceProvider); }; } // namespace blink
diff --git a/third_party/blink/public/common/associated_interfaces/associated_interface_registry.h b/third_party/blink/public/common/associated_interfaces/associated_interface_registry.h index 53d4eb08..590786f 100644 --- a/third_party/blink/public/common/associated_interfaces/associated_interface_registry.h +++ b/third_party/blink/public/common/associated_interfaces/associated_interface_registry.h
@@ -5,12 +5,16 @@ #ifndef THIRD_PARTY_BLINK_PUBLIC_COMMON_ASSOCIATED_INTERFACES_ASSOCIATED_INTERFACE_REGISTRY_H_ #define THIRD_PARTY_BLINK_PUBLIC_COMMON_ASSOCIATED_INTERFACES_ASSOCIATED_INTERFACE_REGISTRY_H_ +#include <map> #include <string> #include "base/bind.h" #include "base/callback.h" +#include "base/macros.h" +#include "base/memory/weak_ptr.h" #include "mojo/public/cpp/bindings/associated_interface_request.h" #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" +#include "third_party/blink/common/common_export.h" namespace blink { @@ -26,18 +30,26 @@ // configuration of the specific AssociatedInterfaceRegistry instance. For // example, RenderFrame exposes an instance of this class for which all // interfaces are associated with the IPC::SyncChannel to the browser. -class AssociatedInterfaceRegistry { +class BLINK_COMMON_EXPORT AssociatedInterfaceRegistry { public: using Binder = base::RepeatingCallback<void(mojo::ScopedInterfaceEndpointHandle)>; - virtual ~AssociatedInterfaceRegistry() {} + AssociatedInterfaceRegistry(); + ~AssociatedInterfaceRegistry(); // Adds an interface binder to the registry. - virtual void AddInterface(const std::string& name, const Binder& binder) = 0; + void AddInterface(const std::string& name, const Binder& binder); // Removes an interface binder from the registry. - virtual void RemoveInterface(const std::string& name) = 0; + void RemoveInterface(const std::string& name); + + // Attempts to bind an interface named |interface_name| using a registered + // binder. If no matching binder exists, this returns |false| and |*handle| is + // untouched. Otherwise this returns |true| and ownership of |*handle| is + // taken. + bool TryBindInterface(const std::string& name, + mojo::ScopedInterfaceEndpointHandle* handle); template <typename Interface> using InterfaceBinder = base::RepeatingCallback<void( @@ -50,12 +62,19 @@ base::BindRepeating(&BindInterface<Interface>, binder)); } + base::WeakPtr<AssociatedInterfaceRegistry> GetWeakPtr(); + private: template <typename Interface> static void BindInterface(const InterfaceBinder<Interface>& binder, mojo::ScopedInterfaceEndpointHandle handle) { binder.Run(mojo::AssociatedInterfaceRequest<Interface>(std::move(handle))); } + + std::map<std::string, Binder> interfaces_; + base::WeakPtrFactory<AssociatedInterfaceRegistry> weak_ptr_factory_{this}; + + DISALLOW_COPY_AND_ASSIGN(AssociatedInterfaceRegistry); }; } // namespace blink
diff --git a/third_party/blink/public/common/message_port/transferable_message.h b/third_party/blink/public/common/message_port/transferable_message.h index 7659788..7ddd36b7 100644 --- a/third_party/blink/public/common/message_port/transferable_message.h +++ b/third_party/blink/public/common/message_port/transferable_message.h
@@ -13,6 +13,7 @@ #include "third_party/blink/public/common/message_port/cloneable_message.h" #include "third_party/blink/public/common/message_port/message_port_channel.h" #include "third_party/blink/public/mojom/array_buffer/array_buffer_contents.mojom.h" +#include "third_party/blink/public/mojom/message_port/user_activation_snapshot.mojom.h" #include "third_party/skia/include/core/SkBitmap.h" namespace blink { @@ -37,6 +38,9 @@ // message. bool has_user_gesture = false; + // The state of user activation. + mojom::UserActivationSnapshotPtr user_activation; + private: DISALLOW_COPY_AND_ASSIGN(TransferableMessage); };
diff --git a/third_party/blink/public/mojom/BUILD.gn b/third_party/blink/public/mojom/BUILD.gn index f121b4d..bb6945f 100644 --- a/third_party/blink/public/mojom/BUILD.gn +++ b/third_party/blink/public/mojom/BUILD.gn
@@ -10,6 +10,7 @@ mojom("mojom_platform") { sources = [ "array_buffer/array_buffer_contents.mojom", + "associated_interfaces/associated_interfaces.mojom", "blob/blob.mojom", "blob/blob_registry.mojom", "blob/blob_url_store.mojom", @@ -102,6 +103,7 @@ mojom("mojom_core") { sources = [ "message_port/message_port.mojom", + "message_port/user_activation_snapshot.mojom", "portal/portal.mojom", "service_worker/service_worker.mojom", "service_worker/service_worker_object.mojom",
diff --git a/third_party/blink/public/mojom/associated_interfaces/OWNERS b/third_party/blink/public/mojom/associated_interfaces/OWNERS new file mode 100644 index 0000000..08850f4 --- /dev/null +++ b/third_party/blink/public/mojom/associated_interfaces/OWNERS
@@ -0,0 +1,2 @@ +per-file *.mojom=set noparent +per-file *.mojom=file://ipc/SECURITY_OWNERS
diff --git a/third_party/blink/public/mojom/associated_interfaces/associated_interfaces.mojom b/third_party/blink/public/mojom/associated_interfaces/associated_interfaces.mojom new file mode 100644 index 0000000..20ce5b3 --- /dev/null +++ b/third_party/blink/public/mojom/associated_interfaces/associated_interfaces.mojom
@@ -0,0 +1,15 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module blink.mojom; + +// A generic, nominal interface to support transitional Channel-associated +// interfaces not known to Blink. +interface AssociatedInterface {}; + +// Analogous to the generic InterfaceProvider interface, but for content +// AssociatedInterfaces. +interface AssociatedInterfaceProvider { + GetAssociatedInterface(string name, associated AssociatedInterface& request); +};
diff --git a/third_party/blink/public/mojom/message_port/message_port.mojom b/third_party/blink/public/mojom/message_port/message_port.mojom index 69faa050..e727b40 100644 --- a/third_party/blink/public/mojom/message_port/message_port.mojom +++ b/third_party/blink/public/mojom/message_port/message_port.mojom
@@ -7,6 +7,7 @@ import "mojo/public/mojom/base/big_buffer.mojom"; import "third_party/blink/public/mojom/array_buffer/array_buffer_contents.mojom"; import "third_party/blink/public/mojom/blob/serialized_blob.mojom"; +import "third_party/blink/public/mojom/message_port/user_activation_snapshot.mojom"; import "skia/public/interfaces/bitmap.mojom"; // A MessagePort is represented as a raw mojo message pipe, as such no interface @@ -45,4 +46,6 @@ // Whether the recipient should have a user gesture when it processes this // message. bool has_user_gesture; + // The user activation state, null if the frame isn't providing it. + UserActivationSnapshot? user_activation; };
diff --git a/third_party/blink/public/mojom/message_port/user_activation_snapshot.mojom b/third_party/blink/public/mojom/message_port/user_activation_snapshot.mojom new file mode 100644 index 0000000..38d1851 --- /dev/null +++ b/third_party/blink/public/mojom/message_port/user_activation_snapshot.mojom
@@ -0,0 +1,12 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module blink.mojom; + +// This struct represents the UserActivation state at the time which the message +// was sent. +struct UserActivationSnapshot { + bool has_been_active; + bool was_active; +};
diff --git a/third_party/blink/renderer/DEPS b/third_party/blink/renderer/DEPS index 0659cd7..11370c6 100644 --- a/third_party/blink/renderer/DEPS +++ b/third_party/blink/renderer/DEPS
@@ -12,6 +12,7 @@ "+base/memory/ptr_util.h", "+base/memory/weak_ptr.h", "+base/metrics/histogram_macros.h", + "+base/metrics/field_trial_params.h", "+base/numerics/checked_math.h", "+base/numerics/safe_conversions.h", "+base/optional.h",
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_abstract_event_listener.cc b/third_party/blink/renderer/bindings/core/v8/v8_abstract_event_listener.cc index 45e8cc1..500b0ed 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_abstract_event_listener.cc +++ b/third_party/blink/renderer/bindings/core/v8/v8_abstract_event_listener.cc
@@ -54,21 +54,25 @@ : EventListener(kJSEventListenerType), is_attribute_(is_attribute), world_(&world), - isolate_(isolate), - worker_or_worklet_global_scope_(nullptr) { + isolate_(isolate) { if (IsMainThread()) InstanceCounters::IncrementCounter( InstanceCounters::kJSEventListenerCounter); - else - worker_or_worklet_global_scope_ = - ToWorkerOrWorkletGlobalScope(CurrentExecutionContext(isolate)); } V8AbstractEventListener::~V8AbstractEventListener() { - DCHECK(listener_.IsEmpty()); - if (IsMainThread()) + // For non-main threads a termination garbage collection clears out the + // wrapper links to CustomWrappable which result in CustomWrappable not being + // rooted by JavaScript objects anymore. This means that + // V8AbstractEventListener can be collected without while still holding a + // valid weak references. + if (IsMainThread()) { + DCHECK(listener_.IsEmpty()); InstanceCounters::DecrementCounter( InstanceCounters::kJSEventListenerCounter); + } else { + listener_.Clear(); + } } // static @@ -126,12 +130,6 @@ v8::Local<v8::Object> listener, const V8PrivateProperty::Symbol& property) { DCHECK(listener_.IsEmpty()); - // Balanced in WrapperCleared xor ClearListenerObject. - if (worker_or_worklet_global_scope_) { - worker_or_worklet_global_scope_->RegisterEventListener(this); - } else { - keep_alive_ = this; - } listener_.Set(GetIsolate(), listener, this, &WrapperCleared); Attach(script_state, listener, property, this); } @@ -264,11 +262,6 @@ return; probe::AsyncTaskCanceled(GetIsolate(), this); listener_.Clear(); - if (worker_or_worklet_global_scope_) { - worker_or_worklet_global_scope_->DeregisterEventListener(this); - } else { - keep_alive_.Clear(); - } } void V8AbstractEventListener::WrapperCleared( @@ -278,7 +271,6 @@ void V8AbstractEventListener::Trace(blink::Visitor* visitor) { visitor->Trace(listener_.Cast<v8::Value>()); - visitor->Trace(worker_or_worklet_global_scope_); EventListener::Trace(visitor); }
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_abstract_event_listener.h b/third_party/blink/renderer/bindings/core/v8/v8_abstract_event_listener.h index 1bc7551..d915954 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_abstract_event_listener.h +++ b/third_party/blink/renderer/bindings/core/v8/v8_abstract_event_listener.h
@@ -42,7 +42,6 @@ class Event; class EventTarget; -class WorkerOrWorkletGlobalScope; // There are two kinds of event listeners: HTML or non-HMTL. onload, // onfocus, etc (attributes) are always HTML event handler type; Event @@ -145,11 +144,6 @@ scoped_refptr<DOMWrapperWorld> world_; v8::Isolate* isolate_; - - // nullptr unless this listener belongs to a worker or worklet. - Member<WorkerOrWorkletGlobalScope> worker_or_worklet_global_scope_; - - SelfKeepAlive<V8AbstractEventListener> keep_alive_; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/css/parser/css_parser_fast_paths.cc b/third_party/blink/renderer/core/css/parser/css_parser_fast_paths.cc index 3fa20d6a..ecfe64c 100644 --- a/third_party/blink/renderer/core/css/parser/css_parser_fast_paths.cc +++ b/third_party/blink/renderer/core/css/parser/css_parser_fast_paths.cc
@@ -601,8 +601,7 @@ value_id == CSSValueWebkitFlex || value_id == CSSValueWebkitInlineFlex || value_id == CSSValueNone || value_id == CSSValueGrid || value_id == CSSValueInlineGrid || - (RuntimeEnabledFeatures::CSSDisplayContentsEnabled() && - value_id == CSSValueContents); + value_id == CSSValueContents; case CSSPropertyDominantBaseline: return value_id == CSSValueAuto || value_id == CSSValueAlphabetic || value_id == CSSValueMiddle ||
diff --git a/third_party/blink/renderer/core/dom/element.cc b/third_party/blink/renderer/core/dom/element.cc index 1385f1e9f..2274319 100644 --- a/third_party/blink/renderer/core/dom/element.cc +++ b/third_party/blink/renderer/core/dom/element.cc
@@ -4009,8 +4009,6 @@ if (!CanGeneratePseudoElement(pseudo_id)) return nullptr; if (pseudo_id == kPseudoIdFirstLetter) { - if (IsSVGElement()) - return nullptr; if (!FirstLetterPseudoElement::FirstLetterTextLayoutObject(*this)) return nullptr; } @@ -4128,6 +4126,8 @@ bool Element::CanGeneratePseudoElement(PseudoId pseudo_id) const { if (pseudo_id == kPseudoIdBackdrop && !IsInTopLayer()) return false; + if (pseudo_id == kPseudoIdFirstLetter && IsSVGElement()) + return false; if (const ComputedStyle* style = GetComputedStyle()) return style->CanGeneratePseudoElement(pseudo_id); return false;
diff --git a/third_party/blink/renderer/core/events/message_event.cc b/third_party/blink/renderer/core/events/message_event.cc index c098abda..9c47945 100644 --- a/third_party/blink/renderer/core/events/message_event.cc +++ b/third_party/blink/renderer/core/events/message_event.cc
@@ -30,6 +30,7 @@ #include <memory> #include "third_party/blink/renderer/bindings/core/v8/v8_array_buffer.h" +#include "third_party/blink/renderer/core/frame/user_activation.h" #include "third_party/blink/renderer/platform/bindings/exception_state.h" #include "third_party/blink/renderer/platform/bindings/v8_private_property.h" @@ -78,6 +79,8 @@ source_ = initializer.source(); if (initializer.hasPorts()) ports_ = new MessagePortArray(initializer.ports()); + if (initializer.hasUserActivation()) + user_activation_ = initializer.userActivation(); DCHECK(IsValidSource(source_.Get())); } @@ -114,7 +117,8 @@ const String& origin, const String& last_event_id, EventTarget* source, - Vector<MessagePortChannel> channels) + Vector<MessagePortChannel> channels, + UserActivation* user_activation) : Event(EventTypeNames::message, Bubbles::kNo, Cancelable::kNo), data_type_(kDataTypeSerializedScriptValue), data_as_serialized_script_value_( @@ -122,7 +126,8 @@ origin_(origin), last_event_id_(last_event_id), source_(source), - channels_(std::move(channels)) { + channels_(std::move(channels)), + user_activation_(user_activation) { DCHECK(IsValidSource(source_.Get())); } @@ -186,7 +191,8 @@ const String& origin, const String& last_event_id, EventTarget* source, - MessagePortArray* ports) { + MessagePortArray* ports, + UserActivation* user_activation) { if (IsBeingDispatched()) return; @@ -200,6 +206,7 @@ source_ = source; ports_ = ports; is_ports_dirty_ = true; + user_activation_ = user_activation; } void MessageEvent::initMessageEvent(const AtomicString& type, @@ -248,6 +255,7 @@ visitor->Trace(data_as_array_buffer_); visitor->Trace(source_); visitor->Trace(ports_); + visitor->Trace(user_activation_); Event::Trace(visitor); }
diff --git a/third_party/blink/renderer/core/events/message_event.h b/third_party/blink/renderer/core/events/message_event.h index 8020a91..bf3f165 100644 --- a/third_party/blink/renderer/core/events/message_event.h +++ b/third_party/blink/renderer/core/events/message_event.h
@@ -43,6 +43,8 @@ namespace blink { +class UserActivation; + class CORE_EXPORT MessageEvent final : public Event { DEFINE_WRAPPERTYPEINFO(); @@ -66,9 +68,10 @@ scoped_refptr<SerializedScriptValue> data, const String& origin = String(), const String& last_event_id = String(), - EventTarget* source = nullptr) { + EventTarget* source = nullptr, + UserActivation* user_activation = nullptr) { return new MessageEvent(std::move(data), origin, last_event_id, source, - std::move(channels)); + std::move(channels), user_activation); } static MessageEvent* Create(const String& data, const String& origin = String()) { @@ -101,7 +104,8 @@ const String& origin, const String& last_event_id, EventTarget* source, - MessagePortArray*); + MessagePortArray*, + UserActivation* user_activation); void initMessageEvent(const AtomicString& type, bool bubbles, bool cancelable, @@ -116,6 +120,7 @@ EventTarget* source() const { return source_.Get(); } MessagePortArray ports(); bool isPortsDirty() const { return is_ports_dirty_; } + UserActivation* userActivation() const { return user_activation_; } Vector<MessagePortChannel> ReleaseChannels() { return std::move(channels_); } @@ -196,7 +201,8 @@ const String& origin, const String& last_event_id, EventTarget* source, - Vector<MessagePortChannel>); + Vector<MessagePortChannel>, + UserActivation* user_activation); MessageEvent(const String& data, const String& origin); MessageEvent(Blob* data, const String& origin); @@ -217,6 +223,7 @@ Member<MessagePortArray> ports_; bool is_ports_dirty_ = true; Vector<MessagePortChannel> channels_; + Member<UserActivation> user_activation_; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/events/message_event.idl b/third_party/blink/renderer/core/events/message_event.idl index c84bba5..ffa43e6 100644 --- a/third_party/blink/renderer/core/events/message_event.idl +++ b/third_party/blink/renderer/core/events/message_event.idl
@@ -38,6 +38,7 @@ // TODO(bashi): |source| should be (WindowProxy or MessagePort)? readonly attribute EventTarget? source; [CachedAttribute=isPortsDirty] readonly attribute FrozenArray<MessagePort> ports; + [Exposed=Window, RuntimeEnabled=UserActivationAPI] readonly attribute UserActivation? userActivation; // TODO(foolip): none of the arguments should have [Default=Undefined] (they // have other default values in the spec) and |sourceArg|'s type is wrong.
diff --git a/third_party/blink/renderer/core/events/message_event_init.idl b/third_party/blink/renderer/core/events/message_event_init.idl index bab4872..d6930296 100644 --- a/third_party/blink/renderer/core/events/message_event_init.idl +++ b/third_party/blink/renderer/core/events/message_event_init.idl
@@ -11,4 +11,5 @@ // TODO(bashi): |source| should be (WindowProxy or MessagePort)? EventTarget? source; sequence<MessagePort> ports = []; + [Exposed=Window, RuntimeEnabled=UserActivationAPI] UserActivation? userActivation = null; };
diff --git a/third_party/blink/renderer/core/exported/web_dom_message_event.cc b/third_party/blink/renderer/core/exported/web_dom_message_event.cc index db718d45..97b23b4 100644 --- a/third_party/blink/renderer/core/exported/web_dom_message_event.cc +++ b/third_party/blink/renderer/core/exported/web_dom_message_event.cc
@@ -38,6 +38,7 @@ #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/events/message_event.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" +#include "third_party/blink/renderer/core/frame/user_activation.h" #include "third_party/blink/renderer/core/messaging/blink_transferable_message.h" #include "third_party/blink/renderer/core/messaging/message_port.h" @@ -60,9 +61,9 @@ } // TODO(esprehn): Chromium always passes empty string for lastEventId, is that // right? - Unwrap<MessageEvent>()->initMessageEvent("message", false, false, - message_data, origin, - "" /*lastEventId*/, window, ports); + Unwrap<MessageEvent>()->initMessageEvent( + "message", false, false, message_data, origin, "" /*lastEventId*/, window, + ports, nullptr /*user_activation*/); } WebDOMMessageEvent::WebDOMMessageEvent(TransferableMessage message, @@ -79,11 +80,19 @@ Document* core_document = target_document; ports = MessagePort::EntanglePorts(*core_document, std::move(msg.ports)); } + + UserActivation* user_activation = nullptr; + if (msg.user_activation) { + user_activation = + new UserActivation(msg.user_activation->has_been_active, + msg.user_activation->was_active); + } + // TODO(esprehn): Chromium always passes empty string for lastEventId, is that // right? - Unwrap<MessageEvent>()->initMessageEvent("message", false, false, - std::move(msg.message), origin, - "" /*lastEventId*/, window, ports); + Unwrap<MessageEvent>()->initMessageEvent( + "message", false, false, std::move(msg.message), origin, + "" /*lastEventId*/, window, ports, user_activation); } WebString WebDOMMessageEvent::Origin() const { @@ -94,7 +103,13 @@ BlinkTransferableMessage msg; msg.message = Unwrap<MessageEvent>()->DataAsSerializedScriptValue(); msg.ports = Unwrap<MessageEvent>()->ReleaseChannels(); - return ToTransferableMessage(std::move(msg)); + UserActivation* user_activation = Unwrap<MessageEvent>()->userActivation(); + TransferableMessage transferable_msg = ToTransferableMessage(std::move(msg)); + if (user_activation) { + transferable_msg.user_activation = mojom::UserActivationSnapshot::New( + user_activation->hasBeenActive(), user_activation->isActive()); + } + return transferable_msg; } } // namespace blink
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc index 851fc88..a414a18 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -2667,7 +2667,7 @@ MainFrameImpl() ->GetFrame() ->View() - ->UpdateLifecycleToCompositingCleanPlusScrolling(); + ->UpdateLifecycleToLayoutClean(); } Document* document = page_->MainFrame()->IsLocalFrame()
diff --git a/third_party/blink/renderer/core/frame/dom_window.cc b/third_party/blink/renderer/core/frame/dom_window.cc index 449668c..c9b8887 100644 --- a/third_party/blink/renderer/core/frame/dom_window.cc +++ b/third_party/blink/renderer/core/frame/dom_window.cc
@@ -19,6 +19,7 @@ #include "third_party/blink/renderer/core/frame/location.h" #include "third_party/blink/renderer/core/frame/settings.h" #include "third_party/blink/renderer/core/frame/use_counter.h" +#include "third_party/blink/renderer/core/frame/user_activation.h" #include "third_party/blink/renderer/core/frame/window_post_message_options.h" #include "third_party/blink/renderer/core/input/input_device_capabilities.h" #include "third_party/blink/renderer/core/inspector/console_message.h" @@ -151,7 +152,7 @@ serialized_message->UnregisterMemoryAllocatedWithCurrentScriptContext(); DoPostMessage(std::move(serialized_message), transferables.message_ports, - options.targetOrigin(), incumbent_window, exception_state); + options, incumbent_window, exception_state); } DOMWindow* DOMWindow::AnonymousIndexedGetter(uint32_t index) const { @@ -406,13 +407,14 @@ const String& target_origin, LocalDOMWindow* source, ExceptionState& exception_state) { - DoPostMessage(std::move(message), ports, target_origin, source, - exception_state); + WindowPostMessageOptions options; + options.setTargetOrigin(target_origin); + DoPostMessage(std::move(message), ports, options, source, exception_state); } void DOMWindow::DoPostMessage(scoped_refptr<SerializedScriptValue> message, const MessagePortArray& ports, - const String& target_origin, + const WindowPostMessageOptions& options, LocalDOMWindow* source, ExceptionState& exception_state) { if (!IsCurrentlyDisplayedInFrame()) @@ -420,6 +422,8 @@ Document* source_document = source->document(); + const String& target_origin = options.targetOrigin(); + // Compute the target origin. We need to do this synchronously in order // to generate the SyntaxError exception correctly. scoped_refptr<const SecurityOrigin> target; @@ -484,9 +488,13 @@ source->GetFrame(), WebFeature::kPostMessageOutgoingWouldBeBlockedByConnectSrc); } + UserActivation* user_activation = nullptr; + if (options.includeUserActivation()) + user_activation = UserActivation::CreateSnapshot(source); - MessageEvent* event = MessageEvent::Create( - std::move(channels), std::move(message), source_origin, String(), source); + MessageEvent* event = + MessageEvent::Create(std::move(channels), std::move(message), + source_origin, String(), source, user_activation); SchedulePostMessage(event, std::move(target), source_document); }
diff --git a/third_party/blink/renderer/core/frame/dom_window.h b/third_party/blink/renderer/core/frame/dom_window.h index 4d28c93..58a3f12 100644 --- a/third_party/blink/renderer/core/frame/dom_window.h +++ b/third_party/blink/renderer/core/frame/dom_window.h
@@ -136,7 +136,7 @@ private: void DoPostMessage(scoped_refptr<SerializedScriptValue> message, const MessagePortArray&, - const String& target_origin, + const WindowPostMessageOptions& options, LocalDOMWindow* source, ExceptionState&);
diff --git a/third_party/blink/renderer/core/frame/navigator_user_activation.cc b/third_party/blink/renderer/core/frame/navigator_user_activation.cc index 8d23e6c..2c7b3a5 100644 --- a/third_party/blink/renderer/core/frame/navigator_user_activation.cc +++ b/third_party/blink/renderer/core/frame/navigator_user_activation.cc
@@ -36,7 +36,7 @@ } NavigatorUserActivation::NavigatorUserActivation(Navigator& navigator) { - user_activation_ = new UserActivation(navigator.DomWindow()); + user_activation_ = UserActivation::CreateLive(navigator.DomWindow()); } } // namespace blink
diff --git a/third_party/blink/renderer/core/frame/user_activation.cc b/third_party/blink/renderer/core/frame/user_activation.cc index 0f07a645..8aaaacc2 100644 --- a/third_party/blink/renderer/core/frame/user_activation.cc +++ b/third_party/blink/renderer/core/frame/user_activation.cc
@@ -8,6 +8,19 @@ namespace blink { +UserActivation* UserActivation::CreateSnapshot(LocalDOMWindow* window) { + LocalFrame* frame = window->GetFrame(); + return new UserActivation(frame ? frame->HasBeenActivated() : false, + Frame::HasTransientUserActivation(frame)); +} + +UserActivation* UserActivation::CreateLive(LocalDOMWindow* window) { + return new UserActivation(window); +} + +UserActivation::UserActivation(bool has_been_active, bool is_active) + : has_been_active_(has_been_active), is_active_(is_active) {} + UserActivation::UserActivation(LocalDOMWindow* window) : window_(window) {} UserActivation::~UserActivation() = default; @@ -20,14 +33,14 @@ bool UserActivation::hasBeenActive() const { LocalFrame* frame = window_ ? window_->GetFrame() : nullptr; if (!frame) - return false; + return has_been_active_; return frame->HasBeenActivated(); } bool UserActivation::isActive() const { LocalFrame* frame = window_ ? window_->GetFrame() : nullptr; if (!frame) - return false; + return is_active_; return Frame::HasTransientUserActivation(frame); }
diff --git a/third_party/blink/renderer/core/frame/user_activation.h b/third_party/blink/renderer/core/frame/user_activation.h index 9658ea2..b6da9d40 100644 --- a/third_party/blink/renderer/core/frame/user_activation.h +++ b/third_party/blink/renderer/core/frame/user_activation.h
@@ -15,8 +15,14 @@ DEFINE_WRAPPERTYPEINFO(); public: - explicit UserActivation(LocalDOMWindow* window); + // Creates an instance that is a snapshot of the current state of this + // LocalDOMWindow. + static UserActivation* CreateSnapshot(LocalDOMWindow* window); + // Creates an instance that represents the live state of this LocalDOMWindow. + static UserActivation* CreateLive(LocalDOMWindow* window); + + UserActivation(bool has_been_active, bool is_active); ~UserActivation() override; void Trace(blink::Visitor*) override; @@ -25,7 +31,11 @@ bool isActive() const; private: + explicit UserActivation(LocalDOMWindow* window); + Member<LocalDOMWindow> window_; + bool has_been_active_ = false; + bool is_active_ = false; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/frame/window_post_message_options.idl b/third_party/blink/renderer/core/frame/window_post_message_options.idl index d42d557..15ca5e2 100644 --- a/third_party/blink/renderer/core/frame/window_post_message_options.idl +++ b/third_party/blink/renderer/core/frame/window_post_message_options.idl
@@ -7,4 +7,5 @@ dictionary WindowPostMessageOptions { USVString targetOrigin = "/"; sequence<object> transfer = []; + [RuntimeEnabled=UserActivationAPI] boolean includeUserActivation = false; };
diff --git a/third_party/blink/renderer/core/messaging/blink_transferable_message.cc b/third_party/blink/renderer/core/messaging/blink_transferable_message.cc index 7872a69..3be8c7fb 100644 --- a/third_party/blink/renderer/core/messaging/blink_transferable_message.cc +++ b/third_party/blink/renderer/core/messaging/blink_transferable_message.cc
@@ -38,6 +38,11 @@ message.stack_trace_debugger_id_second)); result.ports.AppendRange(message.ports.begin(), message.ports.end()); result.has_user_gesture = message.has_user_gesture; + if (message.user_activation) { + result.user_activation = mojom::blink::UserActivationSnapshot::New( + message.user_activation->has_been_active, + message.user_activation->was_active); + } return result; } @@ -60,6 +65,11 @@ message.sender_stack_trace_id.debugger_id.second; result.ports.assign(message.ports.begin(), message.ports.end()); result.has_user_gesture = message.has_user_gesture; + if (message.user_activation) { + result.user_activation = mojom::UserActivationSnapshot::New( + message.user_activation->has_been_active, + message.user_activation->was_active); + } return result; }
diff --git a/third_party/blink/renderer/core/messaging/blink_transferable_message.h b/third_party/blink/renderer/core/messaging/blink_transferable_message.h index 8aeaebe..08e92a7 100644 --- a/third_party/blink/renderer/core/messaging/blink_transferable_message.h +++ b/third_party/blink/renderer/core/messaging/blink_transferable_message.h
@@ -8,6 +8,7 @@ #include "base/macros.h" #include "third_party/blink/public/common/message_port/message_port_channel.h" #include "third_party/blink/public/common/message_port/transferable_message.h" +#include "third_party/blink/public/mojom/message_port/user_activation_snapshot.mojom-blink.h" #include "third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/messaging/blink_cloneable_message.h" @@ -29,6 +30,8 @@ bool has_user_gesture = false; + mojom::blink::UserActivationSnapshotPtr user_activation; + private: DISALLOW_COPY_AND_ASSIGN(BlinkTransferableMessage); };
diff --git a/third_party/blink/renderer/core/messaging/blink_transferable_message_struct_traits.cc b/third_party/blink/renderer/core/messaging/blink_transferable_message_struct_traits.cc index a223c52..06b904b 100644 --- a/third_party/blink/renderer/core/messaging/blink_transferable_message_struct_traits.cc +++ b/third_party/blink/renderer/core/messaging/blink_transferable_message_struct_traits.cc
@@ -5,6 +5,7 @@ #include "third_party/blink/renderer/core/messaging/blink_transferable_message_struct_traits.h" #include "mojo/public/cpp/base/big_buffer_mojom_traits.h" +#include "third_party/blink/public/mojom/message_port/message_port.mojom-blink.h" #include "third_party/blink/renderer/core/imagebitmap/image_bitmap.h" #include "third_party/skia/include/core/SkBitmap.h" @@ -71,7 +72,7 @@ if (!data.ReadMessage(static_cast<blink::BlinkCloneableMessage*>(out)) || !data.ReadArrayBufferContentsArray(&array_buffer_contents_array) || !data.ReadImageBitmapContentsArray(&sk_bitmaps) || - !data.ReadPorts(&ports)) { + !data.ReadPorts(&ports) || !data.ReadUserActivation(&out->user_activation)) { return false; } @@ -98,7 +99,6 @@ image_bitmap_contents_array.push_back(bitmap_contents); } out->message->SetImageBitmapContentsArray(image_bitmap_contents_array); - return true; }
diff --git a/third_party/blink/renderer/core/messaging/blink_transferable_message_struct_traits.h b/third_party/blink/renderer/core/messaging/blink_transferable_message_struct_traits.h index 1efcbb3..a2f966f 100644 --- a/third_party/blink/renderer/core/messaging/blink_transferable_message_struct_traits.h +++ b/third_party/blink/renderer/core/messaging/blink_transferable_message_struct_traits.h
@@ -46,6 +46,11 @@ return input.has_user_gesture; } + static const blink::mojom::blink::UserActivationSnapshotPtr& user_activation( + const blink::BlinkTransferableMessage& input) { + return input.user_activation; + } + static bool Read(blink::mojom::blink::TransferableMessage::DataView, blink::BlinkTransferableMessage* out); };
diff --git a/third_party/blink/renderer/core/paint/box_model_object_painter.cc b/third_party/blink/renderer/core/paint/box_model_object_painter.cc index 7cfd64ee..db8d1ce 100644 --- a/third_party/blink/renderer/core/paint/box_model_object_painter.cc +++ b/third_party/blink/renderer/core/paint/box_model_object_painter.cc
@@ -52,9 +52,7 @@ const InlineFlowBox* flow_box) : BoxPainterBase(&box.GetDocument(), box.StyleRef(), - GeneratingNodeForObject(box), - box.BorderBoxOutsets(), - box.PaddingOutsets()), + GeneratingNodeForObject(box)), box_model_(box), flow_box_(flow_box) {} @@ -108,7 +106,7 @@ // the ends. IntSize offset = this_box.ScrolledContentOffset(); scrolled_paint_rect.Move(-offset); - LayoutRectOutsets border = BorderOutsets(info); + LayoutRectOutsets border = AdjustedBorderOutsets(info); scrolled_paint_rect.SetWidth(border.Left() + this_box.ScrollWidth() + border.Right()); scrolled_paint_rect.SetHeight(this_box.BorderTop() + @@ -118,6 +116,14 @@ return scrolled_paint_rect; } +LayoutRectOutsets BoxModelObjectPainter::ComputeBorders() const { + return box_model_.BorderBoxOutsets(); +} + +LayoutRectOutsets BoxModelObjectPainter::ComputePadding() const { + return box_model_.PaddingOutsets(); +} + BoxPainterBase::FillLayerInfo BoxModelObjectPainter::GetFillLayerInfo( const Color& color, const FillLayer& bg_layer,
diff --git a/third_party/blink/renderer/core/paint/box_model_object_painter.h b/third_party/blink/renderer/core/paint/box_model_object_painter.h index 8896cdbc5..c1ff417 100644 --- a/third_party/blink/renderer/core/paint/box_model_object_painter.h +++ b/third_party/blink/renderer/core/paint/box_model_object_painter.h
@@ -32,6 +32,8 @@ const PaintInfo&); protected: + LayoutRectOutsets ComputeBorders() const override; + LayoutRectOutsets ComputePadding() const override; BoxPainterBase::FillLayerInfo GetFillLayerInfo( const Color&, const FillLayer&,
diff --git a/third_party/blink/renderer/core/paint/box_painter_base.cc b/third_party/blink/renderer/core/paint/box_painter_base.cc index 441e273..4806f93e 100644 --- a/third_party/blink/renderer/core/paint/box_painter_base.cc +++ b/third_party/blink/renderer/core/paint/box_painter_base.cc
@@ -572,9 +572,9 @@ } // anonymous namespace -LayoutRectOutsets BoxPainterBase::BorderOutsets( +LayoutRectOutsets BoxPainterBase::AdjustedBorderOutsets( const FillLayerInfo& info) const { - return AdjustOutsetsForEdgeInclusion(border_, info); + return AdjustOutsetsForEdgeInclusion(ComputeBorders(), info); } void BoxPainterBase::PaintFillLayer(const PaintInfo& paint_info, @@ -623,7 +623,9 @@ composite_op = (op == SkBlendMode::kSrcOver) ? bg_op : op; } - LayoutRectOutsets border_padding_insets = -(border_ + padding_); + LayoutRectOutsets border = ComputeBorders(); + LayoutRectOutsets padding = ComputePadding(); + LayoutRectOutsets border_padding_insets = -(border + padding); FloatRoundedRect border_rect = RoundedBorderRectForClip( style_, info, bg_layer, rect, object_has_multiple_boxes, flow_box_size, bleed_avoidance, border_padding_insets); @@ -659,9 +661,9 @@ // Clip to the padding or content boxes as necessary. LayoutRect clip_rect = scrolled_paint_rect; - clip_rect.Contract(AdjustOutsetsForEdgeInclusion(border_, info)); + clip_rect.Contract(AdjustOutsetsForEdgeInclusion(border, info)); if (bg_layer.Clip() == EFillBox::kContent) - clip_rect.Contract(AdjustOutsetsForEdgeInclusion(padding_, info)); + clip_rect.Contract(AdjustOutsetsForEdgeInclusion(padding, info)); background_clip_state_saver.Save(); // TODO(chrishtr): this should be pixel-snapped. context.Clip(FloatRect(clip_rect));
diff --git a/third_party/blink/renderer/core/paint/box_painter_base.h b/third_party/blink/renderer/core/paint/box_painter_base.h index 9f4cb79..f0cbcbda 100644 --- a/third_party/blink/renderer/core/paint/box_painter_base.h +++ b/third_party/blink/renderer/core/paint/box_painter_base.h
@@ -5,7 +5,6 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_BOX_PAINTER_BASE_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_BOX_PAINTER_BASE_H_ -#include "base/optional.h" #include "third_party/blink/renderer/core/layout/background_bleed_avoidance.h" #include "third_party/blink/renderer/core/style/style_image.h" #include "third_party/blink/renderer/platform/geometry/layout_rect_outsets.h" @@ -36,14 +35,8 @@ public: BoxPainterBase(const Document* document, const ComputedStyle& style, - Node* node, - LayoutRectOutsets border, - LayoutRectOutsets padding) - : document_(document), - style_(style), - node_(node), - border_(border), - padding_(padding) {} + Node* node) + : document_(document), style_(style), node_(node) {} void PaintFillLayers(const PaintInfo&, const Color&, @@ -139,7 +132,9 @@ }; protected: - LayoutRectOutsets BorderOutsets(const FillLayerInfo&) const; + virtual LayoutRectOutsets ComputeBorders() const = 0; + virtual LayoutRectOutsets ComputePadding() const = 0; + LayoutRectOutsets AdjustedBorderOutsets(const FillLayerInfo&) const; void PaintFillLayerTextFillBox(GraphicsContext&, const FillLayerInfo&, Image*, @@ -169,8 +164,6 @@ Member<const Document> document_; const ComputedStyle& style_; Member<Node> node_; - const LayoutRectOutsets border_; - const LayoutRectOutsets padding_; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/paint/find_properties_needing_update.h b/third_party/blink/renderer/core/paint/find_properties_needing_update.h index 22a99601..95504fe 100644 --- a/third_party/blink/renderer/core/paint/find_properties_needing_update.h +++ b/third_party/blink/renderer/core/paint/find_properties_needing_update.h
@@ -140,8 +140,8 @@ DCHECK_OBJECT_PROPERTY_EQ(object_, original_properties_->Perspective(), object_properties->Perspective()); DCHECK_OBJECT_PROPERTY_EQ( - object_, original_properties_->SvgLocalToBorderBoxTransform(), - object_properties->SvgLocalToBorderBoxTransform()); + object_, original_properties_->ReplacedContentTransform(), + object_properties->ReplacedContentTransform()); DCHECK_OBJECT_PROPERTY_EQ(object_, original_properties_->Scroll(), object_properties->Scroll()); DCHECK_OBJECT_PROPERTY_EQ(object_,
diff --git a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc index 874c9f57..aefb673 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc
@@ -119,13 +119,9 @@ } // anonymous namespace NGBoxFragmentPainter::NGBoxFragmentPainter(const NGPaintFragment& box) - : BoxPainterBase( - &box.GetLayoutObject()->GetDocument(), - box.Style(), - box.GetLayoutObject()->GeneratingNode(), - BoxStrutToLayoutRectOutsets(box.PhysicalFragment().BorderWidths()), - BoxStrutToLayoutRectOutsets( - ToNGPhysicalBoxFragment(box.PhysicalFragment()).Padding())), + : BoxPainterBase(&box.GetLayoutObject()->GetDocument(), + box.Style(), + box.GetLayoutObject()->GeneratingNode()), box_fragment_(box), border_edges_( NGBorderEdges::FromPhysical(box.PhysicalFragment().BorderEdges(), @@ -803,12 +799,22 @@ // the ends. IntSize offset = physical.ScrolledContentOffset(); scrolled_paint_rect.Move(-offset); - LayoutRectOutsets borders = BorderOutsets(info); + LayoutRectOutsets borders = AdjustedBorderOutsets(info); scrolled_paint_rect.SetSize(physical.ScrollSize() + borders.Size()); } return scrolled_paint_rect; } +LayoutRectOutsets NGBoxFragmentPainter::ComputeBorders() const { + return BoxStrutToLayoutRectOutsets( + box_fragment_.PhysicalFragment().BorderWidths()); +} + +LayoutRectOutsets NGBoxFragmentPainter::ComputePadding() const { + return BoxStrutToLayoutRectOutsets( + ToNGPhysicalBoxFragment(box_fragment_.PhysicalFragment()).Padding()); +} + BoxPainterBase::FillLayerInfo NGBoxFragmentPainter::GetFillLayerInfo( const Color& color, const FillLayer& bg_layer,
diff --git a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.h b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.h index f88f840..5534781 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.h +++ b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.h
@@ -47,6 +47,8 @@ HitTestAction); protected: + LayoutRectOutsets ComputeBorders() const override; + LayoutRectOutsets ComputePadding() const override; BoxPainterBase::FillLayerInfo GetFillLayerInfo( const Color&, const FillLayer&, @@ -161,7 +163,6 @@ const NGPhysicalBoxFragment& PhysicalFragment() const; const NGPaintFragment& box_fragment_; - NGBorderEdges border_edges_; };
diff --git a/third_party/blink/renderer/core/paint/object_paint_properties.h b/third_party/blink/renderer/core/paint/object_paint_properties.h index aba1997..e173e32 100644 --- a/third_party/blink/renderer/core/paint/object_paint_properties.h +++ b/third_party/blink/renderer/core/paint/object_paint_properties.h
@@ -52,9 +52,9 @@ // +---[ transform ] The space created by CSS transform. // | This is the local border box space. // +---[ perspective ] The space created by CSS perspective. - // +---[ svgLocalToBorderBoxTransform ] Additional transform for - // children of the outermost root SVG. - // OR (SVG does not support scrolling.) + // +---[ replacedContentTransform ] Additional transform for replaced + // elements to implement object-fit. + // OR (Replaced elements don't scroll.) // +---[ scrollTranslation ] The space created by overflow clip. const TransformPaintPropertyNode* PaintOffsetTranslation() const { return paint_offset_translation_.get(); @@ -65,8 +65,8 @@ const TransformPaintPropertyNode* Perspective() const { return perspective_.get(); } - const TransformPaintPropertyNode* SvgLocalToBorderBoxTransform() const { - return svg_local_to_border_box_transform_.get(); + const TransformPaintPropertyNode* ReplacedContentTransform() const { + return replaced_content_transform_.get(); } const ScrollPaintPropertyNode* Scroll() const { return scroll_.get(); } const TransformPaintPropertyNode* ScrollTranslation() const { @@ -190,8 +190,8 @@ bool ClearInnerBorderRadiusClip() { return Clear(inner_border_radius_clip_); } bool ClearOverflowClip() { return Clear(overflow_clip_); } bool ClearPerspective() { return Clear(perspective_); } - bool ClearSvgLocalToBorderBoxTransform() { - return Clear(svg_local_to_border_box_transform_); + bool ClearReplacedContentTransform() { + return Clear(replaced_content_transform_); } bool ClearScroll() { return Clear(scroll_); } bool ClearScrollTranslation() { return Clear(scroll_translation_); } @@ -221,13 +221,13 @@ TransformPaintPropertyNode::State&& state) { return Update(perspective_, parent, std::move(state)); } - UpdateResult UpdateSvgLocalToBorderBoxTransform( + UpdateResult UpdateReplacedContentTransform( const TransformPaintPropertyNode& parent, TransformPaintPropertyNode::State&& state) { - DCHECK(!ScrollTranslation()) << "SVG elements cannot scroll so there " + DCHECK(!ScrollTranslation()) << "Replaced elements don't scroll so there " "should never be both a scroll translation " - "and an SVG local to border box transform."; - return Update(svg_local_to_border_box_transform_, parent, std::move(state)); + "and a replaced content transform."; + return Update(replaced_content_transform_, parent, std::move(state)); } UpdateResult UpdateScroll(const ScrollPaintPropertyNode& parent, ScrollPaintPropertyNode::State&& state) { @@ -236,9 +236,9 @@ UpdateResult UpdateScrollTranslation( const TransformPaintPropertyNode& parent, TransformPaintPropertyNode::State&& state) { - DCHECK(!SvgLocalToBorderBoxTransform()) - << "SVG elements cannot scroll so there should never be both a scroll " - "translation and an SVG local to border box transform."; + DCHECK(!ReplacedContentTransform()) + << "Replaced elements don't scroll so there should never be both a " + "scroll translation and a replaced content transform."; return Update(scroll_translation_, parent, std::move(state)); } UpdateResult UpdateEffect(const EffectPaintPropertyNode& parent, @@ -350,9 +350,9 @@ cloned->overflow_clip_ = overflow_clip_->Clone(); if (perspective_) cloned->perspective_ = perspective_->Clone(); - if (svg_local_to_border_box_transform_) { - cloned->svg_local_to_border_box_transform_ = - svg_local_to_border_box_transform_->Clone(); + if (replaced_content_transform_) { + cloned->replaced_content_transform_ = + replaced_content_transform_->Clone(); } if (scroll_) cloned->scroll_ = scroll_->Clone(); @@ -413,8 +413,7 @@ scoped_refptr<ClipPaintPropertyNode> inner_border_radius_clip_; scoped_refptr<ClipPaintPropertyNode> overflow_clip_; scoped_refptr<TransformPaintPropertyNode> perspective_; - // TODO(pdr): Only LayoutSVGRoot needs this and it should be moved there. - scoped_refptr<TransformPaintPropertyNode> svg_local_to_border_box_transform_; + scoped_refptr<TransformPaintPropertyNode> replaced_content_transform_; scoped_refptr<ScrollPaintPropertyNode> scroll_; scoped_refptr<TransformPaintPropertyNode> scroll_translation_;
diff --git a/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc b/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc index 0cab1ff2..61b7131 100644 --- a/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc +++ b/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc
@@ -146,7 +146,7 @@ ALWAYS_INLINE void UpdateInnerBorderRadiusClip(); ALWAYS_INLINE void UpdateOverflowClip(); ALWAYS_INLINE void UpdatePerspective(); - ALWAYS_INLINE void UpdateSvgLocalToBorderBoxTransform(); + ALWAYS_INLINE void UpdateReplacedContentTransform(); ALWAYS_INLINE void UpdateScrollAndScrollTranslation(); ALWAYS_INLINE void UpdateOutOfFlowContext(); @@ -219,7 +219,7 @@ return !scroll_offset.IsZero() || NeedsScrollNode(object); } -static bool NeedsSVGLocalToBorderBoxTransform(const LayoutObject& object) { +static bool NeedsReplacedContentTransform(const LayoutObject& object) { return object.IsSVGRoot(); } @@ -262,7 +262,7 @@ return true; if (NeedsPaintOffsetTranslationForScrollbars(box_model)) return true; - if (NeedsSVGLocalToBorderBoxTransform(object)) + if (NeedsReplacedContentTransform(object)) return true; // Don't let paint offset cross composited layer boundaries, to avoid @@ -1215,7 +1215,7 @@ } } -void FragmentPaintPropertyTreeBuilder::UpdateSvgLocalToBorderBoxTransform() { +void FragmentPaintPropertyTreeBuilder::UpdateReplacedContentTransform() { DCHECK(properties_); if (!object_.IsSVGRoot()) return; @@ -1225,17 +1225,17 @@ SVGRootPainter(ToLayoutSVGRoot(object_)) .TransformToPixelSnappedBorderBox(context_.current.paint_offset); if (!transform_to_border_box.IsIdentity() && - NeedsSVGLocalToBorderBoxTransform(object_)) { - OnUpdate(properties_->UpdateSvgLocalToBorderBoxTransform( + NeedsReplacedContentTransform(object_)) { + OnUpdate(properties_->UpdateReplacedContentTransform( *context_.current.transform, TransformPaintPropertyNode::State{transform_to_border_box})); } else { - OnClear(properties_->ClearSvgLocalToBorderBoxTransform()); + OnClear(properties_->ClearReplacedContentTransform()); } } - if (properties_->SvgLocalToBorderBoxTransform()) { - context_.current.transform = properties_->SvgLocalToBorderBoxTransform(); + if (properties_->ReplacedContentTransform()) { + context_.current.transform = properties_->ReplacedContentTransform(); context_.current.should_flatten_inherited_transform = false; context_.current.rendering_context_id = 0; } @@ -1817,7 +1817,7 @@ UpdateInnerBorderRadiusClip(); UpdateOverflowClip(); UpdatePerspective(); - UpdateSvgLocalToBorderBoxTransform(); + UpdateReplacedContentTransform(); UpdateScrollAndScrollTranslation(); } UpdateOutOfFlowContext(); @@ -2447,7 +2447,7 @@ NeedsTransformForNonRootSVG(object_) || NeedsFilter(object_) || NeedsCssClip(object_) || NeedsInnerBorderRadiusClip(object_) || NeedsOverflowClip(object_) || NeedsPerspective(object_) || - NeedsSVGLocalToBorderBoxTransform(object_) || + NeedsReplacedContentTransform(object_) || NeedsScrollOrScrollTranslation(object_); // Need of fragmentation clip will be determined in CreateFragmentContexts().
diff --git a/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc b/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc index 5db643f5eb..049e27b5 100644 --- a/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc +++ b/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc
@@ -1043,19 +1043,17 @@ svg_with_view_box.FirstFragment().PaintProperties(); EXPECT_EQ(TransformationMatrix().Translate3d(1, 2, 3), svg_with_view_box_properties->Transform()->Matrix()); - EXPECT_EQ( - TransformationMatrix().Translate(-50, -50), - svg_with_view_box_properties->SvgLocalToBorderBoxTransform()->Matrix()); - EXPECT_EQ( - svg_with_view_box_properties->SvgLocalToBorderBoxTransform()->Parent(), - svg_with_view_box_properties->Transform()); + EXPECT_EQ(TransformationMatrix().Translate(-50, -50), + svg_with_view_box_properties->ReplacedContentTransform()->Matrix()); + EXPECT_EQ(svg_with_view_box_properties->ReplacedContentTransform()->Parent(), + svg_with_view_box_properties->Transform()); LayoutObject& rect = *GetLayoutObjectByElementId("rect"); const ObjectPaintProperties* rect_properties = rect.FirstFragment().PaintProperties(); EXPECT_EQ(TransformationMatrix().Translate(100, 100), rect_properties->Transform()->Matrix()); - EXPECT_EQ(svg_with_view_box_properties->SvgLocalToBorderBoxTransform(), + EXPECT_EQ(svg_with_view_box_properties->ReplacedContentTransform(), rect_properties->Transform()->Parent()); } @@ -1080,7 +1078,7 @@ EXPECT_EQ( FloatSize(50, 25), svg_properties->PaintOffsetTranslation()->Matrix().To2DTranslation()); - EXPECT_EQ(nullptr, svg_properties->SvgLocalToBorderBoxTransform()); + EXPECT_EQ(nullptr, svg_properties->ReplacedContentTransform()); EXPECT_EQ(DocPreTranslation(), svg_properties->PaintOffsetTranslation()->Parent()); } @@ -1109,11 +1107,11 @@ EXPECT_EQ(TransformationMatrix().Translate(5, 7), svg_properties->Transform()->Matrix()); EXPECT_EQ(TransformationMatrix().Translate(11, 11).Scale(100.0 / 13.0), - svg_properties->SvgLocalToBorderBoxTransform()->Matrix()); + svg_properties->ReplacedContentTransform()->Matrix()); EXPECT_EQ(svg_properties->PaintOffsetTranslation(), svg_properties->Transform()->Parent()); EXPECT_EQ(svg_properties->Transform(), - svg_properties->SvgLocalToBorderBoxTransform()->Parent()); + svg_properties->ReplacedContentTransform()->Parent()); // Ensure the rect's transform is a child of the local to border box // transform. @@ -1122,7 +1120,7 @@ rect.FirstFragment().PaintProperties(); EXPECT_EQ(TransformationMatrix().Translate(17, 19), rect_properties->Transform()->Matrix()); - EXPECT_EQ(svg_properties->SvgLocalToBorderBoxTransform(), + EXPECT_EQ(svg_properties->ReplacedContentTransform(), rect_properties->Transform()->Parent()); } @@ -1143,15 +1141,15 @@ EXPECT_EQ(TransformationMatrix().Translate(11, 11), svg_properties->Transform()->Matrix()); EXPECT_EQ(TransformationMatrix().Scale(2), - svg_properties->SvgLocalToBorderBoxTransform()->Matrix()); + svg_properties->ReplacedContentTransform()->Matrix()); LayoutObject& nested_svg = *GetLayoutObjectByElementId("nestedSvg"); const ObjectPaintProperties* nested_svg_properties = nested_svg.FirstFragment().PaintProperties(); EXPECT_EQ(TransformationMatrix().Scale(10), nested_svg_properties->Transform()->Matrix()); - EXPECT_EQ(nullptr, nested_svg_properties->SvgLocalToBorderBoxTransform()); - EXPECT_EQ(svg_properties->SvgLocalToBorderBoxTransform(), + EXPECT_EQ(nullptr, nested_svg_properties->ReplacedContentTransform()); + EXPECT_EQ(svg_properties->ReplacedContentTransform(), nested_svg_properties->Transform()->Parent()); LayoutObject& rect = *GetLayoutObjectByElementId("rect"); @@ -2482,7 +2480,7 @@ svg_with_transform_properties->Transform()->Matrix()); EXPECT_EQ(LayoutPoint(FloatPoint(0.1, 0)), svg_with_transform.FirstFragment().PaintOffset()); - EXPECT_TRUE(svg_with_transform_properties->SvgLocalToBorderBoxTransform() == + EXPECT_TRUE(svg_with_transform_properties->ReplacedContentTransform() == nullptr); LayoutObject& rect_with_transform = *GetLayoutObjectByElementId("rect"); @@ -2516,7 +2514,7 @@ svg_properties->PaintOffsetTranslation()->Matrix().To2DTranslation()); EXPECT_EQ(LayoutPoint(LayoutUnit(-0.40625), LayoutUnit(0.3)), svg->FirstFragment().PaintOffset()); - EXPECT_EQ(nullptr, svg_properties->SvgLocalToBorderBoxTransform()); + EXPECT_EQ(nullptr, svg_properties->ReplacedContentTransform()); const auto* foreign_object = GetLayoutObjectByElementId("foreign"); const auto* foreign_object_properties = foreign_object->FirstFragment().PaintProperties(); @@ -3160,7 +3158,7 @@ } TEST_P(PaintPropertyTreeBuilderTest, - SvgLocalToBorderBoxTransformContentsTreeState) { + ReplacedContentTransformContentsTreeState) { SetBodyInnerHTML(R"HTML( <style> body {
diff --git a/third_party/blink/renderer/core/paint/paint_property_tree_printer.cc b/third_party/blink/renderer/core/paint/paint_property_tree_printer.cc index e407f3d2..c9b53d2 100644 --- a/third_party/blink/renderer/core/paint/paint_property_tree_printer.cc +++ b/third_party/blink/renderer/core/paint/paint_property_tree_printer.cc
@@ -78,7 +78,7 @@ printer.AddNode(properties.PaintOffsetTranslation()); printer.AddNode(properties.Transform()); printer.AddNode(properties.Perspective()); - printer.AddNode(properties.SvgLocalToBorderBoxTransform()); + printer.AddNode(properties.ReplacedContentTransform()); printer.AddNode(properties.ScrollTranslation()); } }; @@ -170,8 +170,8 @@ object); SetDebugName(properties.Transform(), "Transform", object); SetDebugName(properties.Perspective(), "Perspective", object); - SetDebugName(properties.SvgLocalToBorderBoxTransform(), - "SvgLocalToBorderBoxTransform", object); + SetDebugName(properties.ReplacedContentTransform(), + "ReplacedContentTransform", object); SetDebugName(properties.ScrollTranslation(), "ScrollTranslation", object); SetDebugName(properties.FragmentClip(), "FragmentClip", object);
diff --git a/third_party/blink/renderer/core/paint/replaced_painter.cc b/third_party/blink/renderer/core/paint/replaced_painter.cc index 9465730..5d3a041 100644 --- a/third_party/blink/renderer/core/paint/replaced_painter.cc +++ b/third_party/blink/renderer/core/paint/replaced_painter.cc
@@ -86,35 +86,49 @@ bool skip_clip = layout_replaced_.IsSVGRoot() && !ToLayoutSVGRoot(layout_replaced_).ShouldApplyViewportClip(); if (skip_clip || !layout_replaced_.ContentBoxRect().IsEmpty()) { + PaintInfo transformed_paint_info = local_paint_info; base::Optional<ScopedPaintChunkProperties> chunk_properties; if (const auto* fragment = paint_info.FragmentToPaint(layout_replaced_)) { if (const auto* paint_properties = fragment->PaintProperties()) { + PropertyTreeState new_properties = + local_paint_info.context.GetPaintController() + .CurrentPaintChunkProperties(); + bool property_changed = false; + if (paint_properties->ReplacedContentTransform()) { + new_properties.SetTransform( + paint_properties->ReplacedContentTransform()); + DCHECK(paint_properties->ReplacedContentTransform() + ->Matrix() + .IsAffine()); + transformed_paint_info.UpdateCullRect( + paint_properties->ReplacedContentTransform() + ->Matrix() + .ToAffineTransform()); + property_changed = true; + } + if (paint_properties->OverflowClip() && + (!layout_replaced_.IsLayoutImage() || + layout_replaced_.StyleRef().HasBorderRadius())) { + new_properties.SetClip(paint_properties->OverflowClip()); + property_changed = true; + } // Check filter for optimized image policy violation highlights, which // may be applied locally. if (paint_properties->Filter() && (!layout_replaced_.HasLayer() || !layout_replaced_.Layer()->IsSelfPaintingLayer())) { + new_properties.SetEffect(paint_properties->Filter()); + property_changed = true; + } + if (property_changed) { chunk_properties.emplace( - local_paint_info.context.GetPaintController(), - fragment->ContentsProperties(), layout_replaced_, - paint_info.DisplayItemTypeForClipping()); - } else if (paint_properties->OverflowClip() && - (!layout_replaced_.IsLayoutImage() || - layout_replaced_.StyleRef().HasBorderRadius())) { - // Make an exception for non-composited <img>. ImagePainter clips - // its content by painting a smaller rect that maps to the subset - // of the source image, without changing clip state. This - // micro-optimization makes huge performance improvement. - // See https://crbug.com/867670 - chunk_properties.emplace( - local_paint_info.context.GetPaintController(), - paint_properties->OverflowClip(), layout_replaced_, - paint_info.DisplayItemTypeForClipping()); + local_paint_info.context.GetPaintController(), new_properties, + layout_replaced_, paint_info.DisplayItemTypeForClipping()); } } } - layout_replaced_.PaintReplaced(local_paint_info, paint_offset); + layout_replaced_.PaintReplaced(transformed_paint_info, paint_offset); } if (layout_replaced_.CanResize()) {
diff --git a/third_party/blink/renderer/core/paint/svg_paint_context.h b/third_party/blink/renderer/core/paint/svg_paint_context.h index 2616396..a2b4da9 100644 --- a/third_party/blink/renderer/core/paint/svg_paint_context.h +++ b/third_party/blink/renderer/core/paint/svg_paint_context.h
@@ -49,6 +49,8 @@ SVGTransformContext(const PaintInfo& paint_info, const LayoutObject& object, const AffineTransform& transform) { + DCHECK(object.IsSVGChild()); + const auto* fragment = paint_info.FragmentToPaint(object); if (!fragment) return; @@ -56,19 +58,7 @@ if (!properties) return; - const TransformPaintPropertyNode* transform_node; - if (object.IsSVGRoot()) { - // If a transform exists, we can rely on a layer existing to apply it. - DCHECK(!properties || !properties->Transform() || object.HasLayer()); - transform_node = properties->SvgLocalToBorderBoxTransform(); - } else { - DCHECK(object.IsSVG()); - // Should only be used by LayoutSVGRoot. - DCHECK(!properties->SvgLocalToBorderBoxTransform()); - transform_node = properties->Transform(); - } - - if (transform_node) { + if (const auto* transform_node = properties->Transform()) { DCHECK(transform_node->Matrix() == transform.ToTransformationMatrix()); transform_property_scope_.emplace( paint_info.context.GetPaintController(), transform_node, object,
diff --git a/third_party/blink/renderer/core/paint/svg_root_painter.cc b/third_party/blink/renderer/core/paint/svg_root_painter.cc index a4976a0a..676dc4b 100644 --- a/third_party/blink/renderer/core/paint/svg_root_painter.cc +++ b/third_party/blink/renderer/core/paint/svg_root_painter.cc
@@ -50,14 +50,7 @@ if (svg->HasEmptyViewBox()) return; - PaintInfo paint_info_before_filtering(paint_info); - AffineTransform transform_to_border_box = - TransformToPixelSnappedBorderBox(paint_offset); - paint_info_before_filtering.UpdateCullRect(transform_to_border_box); - SVGTransformContext transform_context( - paint_info_before_filtering, layout_svg_root_, transform_to_border_box); - - SVGPaintContext paint_context(layout_svg_root_, paint_info_before_filtering); + SVGPaintContext paint_context(layout_svg_root_, paint_info); if (paint_context.GetPaintInfo().phase == PaintPhase::kForeground && !paint_context.ApplyClipMaskAndFilterIfNecessary()) return;
diff --git a/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.cc b/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.cc index c006e649..bdc30cfa 100644 --- a/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.cc +++ b/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.cc
@@ -126,18 +126,6 @@ void WorkerOrWorkletGlobalScope::Dispose() { DCHECK(script_controller_); - // Event listeners would keep DOMWrapperWorld objects alive for too long. - // Also, they have references to JS objects, which become dangling once Heap - // is destroyed. - HeapHashSet<Member<V8AbstractEventListener>> listeners; - listeners.swap(event_listeners_); - while (!listeners.IsEmpty()) { - for (const auto& listener : listeners) - listener->ClearListenerObject(); - listeners.clear(); - // Pick up any additions made while iterating. - listeners.swap(event_listeners_); - } RemoveAllEventListeners(); script_controller_->Dispose(); @@ -149,22 +137,6 @@ } } -void WorkerOrWorkletGlobalScope::RegisterEventListener( - V8AbstractEventListener* event_listener) { - // TODO(sof): remove once crbug.com/677654 has been diagnosed. - CHECK(&ThreadState::FromObject(this)->Heap() == - &ThreadState::FromObject(event_listener)->Heap()); - bool new_entry = event_listeners_.insert(event_listener).is_new_entry; - CHECK(new_entry); -} - -void WorkerOrWorkletGlobalScope::DeregisterEventListener( - V8AbstractEventListener* event_listener) { - auto it = event_listeners_.find(event_listener); - CHECK(it != event_listeners_.end() || IsClosing()); - event_listeners_.erase(it); -} - void WorkerOrWorkletGlobalScope::SetModulator(Modulator* modulator) { modulator_ = modulator; } @@ -230,7 +202,6 @@ void WorkerOrWorkletGlobalScope::Trace(blink::Visitor* visitor) { visitor->Trace(resource_fetcher_); visitor->Trace(script_controller_); - visitor->Trace(event_listeners_); visitor->Trace(modulator_); EventTargetWithInlineData::Trace(visitor); ExecutionContext::Trace(visitor);
diff --git a/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.h b/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.h index bf40a50..c99979d 100644 --- a/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.h +++ b/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.h
@@ -25,7 +25,6 @@ class Modulator; class ModuleTreeClient; class ResourceFetcher; -class V8AbstractEventListener; class WorkerOrWorkletScriptController; class WorkerReportingProxy; class WorkerThread; @@ -73,9 +72,6 @@ // sub-classes to perform any cleanup needed. virtual void Dispose(); - void RegisterEventListener(V8AbstractEventListener*); - void DeregisterEventListener(V8AbstractEventListener*); - void SetModulator(Modulator*); // Called from UseCounter to record API use in this execution context. @@ -125,8 +121,6 @@ WorkerReportingProxy& reporting_proxy_; - HeapHashSet<Member<V8AbstractEventListener>> event_listeners_; - // This is the set of features that this worker has used. BitVector used_features_;
diff --git a/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc b/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc index 9203415..b0a8870 100644 --- a/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc +++ b/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc
@@ -209,6 +209,13 @@ "that URL is invalid"); } + // 6.3.1.7.2: If |internalRequest|’s mode is "no-cors", then return a + // promise rejected with a TypeError. + if (web_request.Mode() == network::mojom::FetchRequestMode::kNoCORS) { + return RejectWithTypeError(script_state, request_url, + "the request mode must not be no-cors"); + } + // Check this before mixed content, so that if mixed content is blocked by // CSP they get a CSP warning rather than a mixed content warning. if (ShouldBlockDueToCSP(execution_context, request_url)) { @@ -267,8 +274,8 @@ return promise; } - DidLoadIcons(id, std::move(web_requests), std::move(options_ptr), - WrapPersistent(resolver), SkBitmap()); + DidLoadIcons(id, std::move(web_requests), std::move(options_ptr), resolver, + SkBitmap()); return promise; } @@ -287,6 +294,9 @@ ScriptPromiseResolver* resolver, mojom::blink::BackgroundFetchError error, BackgroundFetchRegistration* registration) { + ScriptState* script_state = resolver->GetScriptState(); + ScriptState::Scope scope(script_state); + switch (error) { case mojom::blink::BackgroundFetchError::NONE: DCHECK(registration); @@ -295,18 +305,18 @@ case mojom::blink::BackgroundFetchError::DUPLICATED_DEVELOPER_ID: DCHECK(!registration); resolver->Reject(V8ThrowException::CreateTypeError( - resolver->GetScriptState()->GetIsolate(), + script_state->GetIsolate(), "There already is a registration for the given id.")); return; case mojom::blink::BackgroundFetchError::STORAGE_ERROR: DCHECK(!registration); resolver->Reject(V8ThrowException::CreateTypeError( - resolver->GetScriptState()->GetIsolate(), + script_state->GetIsolate(), "Failed to store registration due to I/O error.")); return; case mojom::blink::BackgroundFetchError::SERVICE_WORKER_UNAVAILABLE: resolver->Reject(V8ThrowException::CreateTypeError( - resolver->GetScriptState()->GetIsolate(), + script_state->GetIsolate(), "There is no service worker available to service the fetch.")); return; case mojom::blink::BackgroundFetchError::INVALID_ARGUMENT: @@ -320,13 +330,10 @@ ScriptPromise BackgroundFetchManager::get(ScriptState* script_state, const String& id) { - if (!registration_->active()) { - return ScriptPromise::Reject( - script_state, - V8ThrowException::CreateTypeError(script_state->GetIsolate(), - "No active registration available on " - "the ServiceWorkerRegistration.")); - } + // Creating a Background Fetch registration requires an activated worker, so + // if |registration_| has not been activated we can skip the Mojo roundtrip. + if (!registration_->active()) + return ScriptPromise::CastUndefined(script_state); ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state); ScriptPromise promise = resolver->Promise(); @@ -401,11 +408,18 @@ ScriptPromiseResolver* resolver, mojom::blink::BackgroundFetchError error, BackgroundFetchRegistration* registration) { + ScriptState* script_state = resolver->GetScriptState(); + ScriptState::Scope scope(script_state); + switch (error) { case mojom::blink::BackgroundFetchError::NONE: - case mojom::blink::BackgroundFetchError::INVALID_ID: + DCHECK(registration); resolver->Resolve(registration); return; + case mojom::blink::BackgroundFetchError::INVALID_ID: + DCHECK(!registration); + resolver->Resolve(v8::Undefined(script_state->GetIsolate())); + return; case mojom::blink::BackgroundFetchError::STORAGE_ERROR: DCHECK(!registration); resolver->Reject( @@ -427,12 +441,11 @@ } ScriptPromise BackgroundFetchManager::getIds(ScriptState* script_state) { + // Creating a Background Fetch registration requires an activated worker, so + // if |registration_| has not been activated we can skip the Mojo roundtrip. if (!registration_->active()) { - return ScriptPromise::Reject( - script_state, - V8ThrowException::CreateTypeError(script_state->GetIsolate(), - "No active registration available on " - "the ServiceWorkerRegistration.")); + return ScriptPromise::Cast(script_state, + v8::Array::New(script_state->GetIsolate())); } ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state); @@ -449,6 +462,8 @@ ScriptPromiseResolver* resolver, mojom::blink::BackgroundFetchError error, const Vector<String>& developer_ids) { + ScriptState::Scope scope(resolver->GetScriptState()); + switch (error) { case mojom::blink::BackgroundFetchError::NONE: resolver->Resolve(developer_ids);
diff --git a/third_party/blink/renderer/platform/bindings/v8_dom_wrapper.cc b/third_party/blink/renderer/platform/bindings/v8_dom_wrapper.cc index 7c7b8b8..adee1ee 100644 --- a/third_party/blink/renderer/platform/bindings/v8_dom_wrapper.cc +++ b/third_party/blink/renderer/platform/bindings/v8_dom_wrapper.cc
@@ -94,7 +94,7 @@ if (object->InternalFieldCount() < kV8DefaultWrapperInternalFieldCount) return false; - // The untrusted wrappable can either be ScriptWrappable or CustomWrappable. + // The untyped wrappable can either be ScriptWrappable or CustomWrappable. const void* untrused_wrappable = ToUntypedWrappable(object); const WrapperTypeInfo* untrusted_wrapper_type_info = ToWrapperTypeInfo(object);
diff --git a/third_party/blink/renderer/platform/graphics/DEPS b/third_party/blink/renderer/platform/graphics/DEPS index 137bba4..0d9d52f 100644 --- a/third_party/blink/renderer/platform/graphics/DEPS +++ b/third_party/blink/renderer/platform/graphics/DEPS
@@ -24,7 +24,6 @@ "+services/ui/public/cpp/gpu/context_provider_command_buffer.h", "+services/viz/public/interfaces", "+third_party/blink/renderer/platform/animation", - "+third_party/blink/renderer/platform/bindings", "+third_party/blink/renderer/platform/cpu/mips/common_macros_msa.h", "+third_party/blink/renderer/platform/cross_thread_functional.h", "+third_party/blink/renderer/platform/drag_image.h",
diff --git a/third_party/blink/renderer/platform/graphics/graphics_layer.cc b/third_party/blink/renderer/platform/graphics/graphics_layer.cc index 07dc0da0..517b8e8 100644 --- a/third_party/blink/renderer/platform/graphics/graphics_layer.cc +++ b/third_party/blink/renderer/platform/graphics/graphics_layer.cc
@@ -41,8 +41,6 @@ #include "third_party/blink/public/platform/web_float_rect.h" #include "third_party/blink/public/platform/web_point.h" #include "third_party/blink/public/platform/web_size.h" -#include "third_party/blink/renderer/platform/bindings/runtime_call_stats.h" -#include "third_party/blink/renderer/platform/bindings/v8_per_isolate_data.h" #include "third_party/blink/renderer/platform/drag_image.h" #include "third_party/blink/renderer/platform/geometry/float_rect.h" #include "third_party/blink/renderer/platform/geometry/layout_rect.h"
diff --git a/third_party/blink/renderer/platform/heap/heap_compact.cc b/third_party/blink/renderer/platform/heap/heap_compact.cc index 3c9ab97..d0ab4ad 100644 --- a/third_party/blink/renderer/platform/heap/heap_compact.cc +++ b/third_party/blink/renderer/platform/heap/heap_compact.cc
@@ -156,7 +156,14 @@ void Relocate(Address from, Address to) { auto it = fixups_.find(from); - DCHECK(it != fixups_.end()); + /// This means that there is no corresponding slot for a live backing store. + // This may happen because a mutator may change the slot to point to a + // different backing store after an incremental marking traced the slot (and + // marked the old backing store as live). + // As another case, this may happen becuase we may relocate backings that + // were dereferenced in EagerSweep/PreFinalizer/WeapProcessing. + if (it == fixups_.end()) + return; #if DCHECK_IS_ON() BasePage* from_page = PageFromObject(from); DCHECK(relocatable_pages_.Contains(from_page));
diff --git a/third_party/blink/renderer/platform/network/DEPS b/third_party/blink/renderer/platform/network/DEPS index 77af399a..e31a6fc2 100644 --- a/third_party/blink/renderer/platform/network/DEPS +++ b/third_party/blink/renderer/platform/network/DEPS
@@ -25,8 +25,6 @@ "+third_party/blink/renderer/platform/heap", "+third_party/blink/renderer/platform/instrumentation", "+third_party/blink/renderer/platform/loader", - "+third_party/blink/renderer/platform/loader", - "+third_party/blink/renderer/platform/loader", "+third_party/blink/renderer/platform/platform_export.h", "+third_party/blink/renderer/platform/scheduler", "+third_party/blink/renderer/platform/shared_buffer.h",
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index 015d6e29..108c6eb7 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -255,10 +255,6 @@ status: "experimental", }, { - name: "CSSDisplayContents", - status: "stable", - }, - { name: "CSSEnvironmentVariables", status: "stable", },
diff --git a/third_party/blink/renderer/platform/scheduler/worker/compositor_thread_scheduler.cc b/third_party/blink/renderer/platform/scheduler/worker/compositor_thread_scheduler.cc index 60813ca..12da463 100644 --- a/third_party/blink/renderer/platform/scheduler/worker/compositor_thread_scheduler.cc +++ b/third_party/blink/renderer/platform/scheduler/worker/compositor_thread_scheduler.cc
@@ -32,10 +32,8 @@ CompositorThreadScheduler::CompositorThreadScheduler( std::unique_ptr<base::sequence_manager::SequenceManager> sequence_manager) - : NonMainThreadSchedulerImpl(std::make_unique<NonMainThreadSchedulerHelper>( - std::move(sequence_manager), - this, - TaskType::kCompositorThreadTaskQueueDefault)), + : NonMainThreadSchedulerImpl(std::move(sequence_manager), + TaskType::kCompositorThreadTaskQueueDefault), input_task_queue_( base::FeatureList::IsEnabled(kHighPriorityInputOnCompositorThread) ? helper()->NewTaskQueue(
diff --git a/third_party/blink/renderer/platform/scheduler/worker/non_main_thread_scheduler_impl.cc b/third_party/blink/renderer/platform/scheduler/worker/non_main_thread_scheduler_impl.cc index 690ef4e..dab72573 100644 --- a/third_party/blink/renderer/platform/scheduler/worker/non_main_thread_scheduler_impl.cc +++ b/third_party/blink/renderer/platform/scheduler/worker/non_main_thread_scheduler_impl.cc
@@ -13,8 +13,9 @@ namespace scheduler { NonMainThreadSchedulerImpl::NonMainThreadSchedulerImpl( - std::unique_ptr<NonMainThreadSchedulerHelper> helper) - : helper_(std::move(helper)) {} + std::unique_ptr<base::sequence_manager::SequenceManager> manager, + TaskType default_task_type) + : helper_(std::move(manager), this, default_task_type) {} NonMainThreadSchedulerImpl::~NonMainThreadSchedulerImpl() = default; @@ -33,10 +34,10 @@ scoped_refptr<NonMainThreadTaskQueue> NonMainThreadSchedulerImpl::CreateTaskQueue(const char* name) { - helper_->CheckOnValidThread(); - return helper_->NewTaskQueue(base::sequence_manager::TaskQueue::Spec(name) - .SetShouldMonitorQuiescence(true) - .SetTimeDomain(nullptr)); + helper_.CheckOnValidThread(); + return helper_.NewTaskQueue(base::sequence_manager::TaskQueue::Spec(name) + .SetShouldMonitorQuiescence(true) + .SetTimeDomain(nullptr)); } void NonMainThreadSchedulerImpl::RunIdleTask(blink::WebThread::IdleTask task, @@ -78,26 +79,26 @@ scoped_refptr<base::SingleThreadTaskRunner> NonMainThreadSchedulerImpl::ControlTaskRunner() { - return helper_->ControlNonMainThreadTaskQueue(); + return helper_.ControlNonMainThreadTaskQueue(); } void NonMainThreadSchedulerImpl::RegisterTimeDomain( base::sequence_manager::TimeDomain* time_domain) { - return helper_->RegisterTimeDomain(time_domain); + return helper_.RegisterTimeDomain(time_domain); } void NonMainThreadSchedulerImpl::UnregisterTimeDomain( base::sequence_manager::TimeDomain* time_domain) { - return helper_->UnregisterTimeDomain(time_domain); + return helper_.UnregisterTimeDomain(time_domain); } base::sequence_manager::TimeDomain* NonMainThreadSchedulerImpl::GetActiveTimeDomain() { - return helper_->real_time_domain(); + return helper_.real_time_domain(); } const base::TickClock* NonMainThreadSchedulerImpl::GetTickClock() { - return helper_->GetClock(); + return helper_.GetClock(); } } // namespace scheduler
diff --git a/third_party/blink/renderer/platform/scheduler/worker/non_main_thread_scheduler_impl.h b/third_party/blink/renderer/platform/scheduler/worker/non_main_thread_scheduler_impl.h index a818ef8..6ea7939d 100644 --- a/third_party/blink/renderer/platform/scheduler/worker/non_main_thread_scheduler_impl.h +++ b/third_party/blink/renderer/platform/scheduler/worker/non_main_thread_scheduler_impl.h
@@ -89,17 +89,18 @@ static void RunIdleTask(WebThread::IdleTask task, base::TimeTicks deadline); explicit NonMainThreadSchedulerImpl( - std::unique_ptr<NonMainThreadSchedulerHelper> helper); + std::unique_ptr<base::sequence_manager::SequenceManager> sequence_manager, + TaskType default_task_type); friend class WorkerScheduler; // Called during Init() for delayed initialization for subclasses. virtual void InitImpl() = 0; - NonMainThreadSchedulerHelper* helper() { return helper_.get(); } + NonMainThreadSchedulerHelper* helper() { return &helper_; } private: - std::unique_ptr<NonMainThreadSchedulerHelper> helper_; + NonMainThreadSchedulerHelper helper_; DISALLOW_COPY_AND_ASSIGN(NonMainThreadSchedulerImpl); };
diff --git a/third_party/blink/renderer/platform/scheduler/worker/worker_thread_scheduler.cc b/third_party/blink/renderer/platform/scheduler/worker/worker_thread_scheduler.cc index ce441dc..6541a2c 100644 --- a/third_party/blink/renderer/platform/scheduler/worker/worker_thread_scheduler.cc +++ b/third_party/blink/renderer/platform/scheduler/worker/worker_thread_scheduler.cc
@@ -96,10 +96,8 @@ WebThreadType thread_type, std::unique_ptr<base::sequence_manager::SequenceManager> sequence_manager, WorkerSchedulerProxy* proxy) - : NonMainThreadSchedulerImpl(std::make_unique<NonMainThreadSchedulerHelper>( - std::move(sequence_manager), - this, - TaskType::kWorkerThreadTaskQueueDefault)), + : NonMainThreadSchedulerImpl(std::move(sequence_manager), + TaskType::kWorkerThreadTaskQueueDefault), idle_helper_(helper(), this, "WorkerSchedulerIdlePeriod",
diff --git a/third_party/blink/tools/audit_non_blink_usage.py b/third_party/blink/tools/audit_non_blink_usage.py index aa4e0c1..d8dc773b 100755 --- a/third_party/blink/tools/audit_non_blink_usage.py +++ b/third_party/blink/tools/audit_non_blink_usage.py
@@ -77,6 +77,12 @@ # //base/memory/ptr_util.h. 'base::WrapUnique', + # //base/metrics/field_trial_params.h. + 'base::GetFieldTrialParamValueByFeature', + 'base::GetFieldTrialParamByFeatureAsBool', + 'base::GetFieldTrialParamByFeatureAsDouble', + 'base::GetFieldTrialParamByFeatureAsInt', + # //base/numerics/safe_conversions.h. 'base::as_signed', 'base::as_unsigned',
diff --git a/third_party/libjingle_xmpp/xmpp/DEPS b/third_party/libjingle_xmpp/xmpp/DEPS index 7630113a..fe4af51 100644 --- a/third_party/libjingle_xmpp/xmpp/DEPS +++ b/third_party/libjingle_xmpp/xmpp/DEPS
@@ -3,8 +3,3 @@ "+third_party/webrtc/rtc_base", "+third_party/webrtc/p2p", ] -specific_include_rules = { - "xmpplogintask_unittest\.cc": [ - "+third_party/webrtc/typedefs.h", - ], -}
diff --git a/third_party/libjingle_xmpp/xmpp/xmpplogintask_unittest.cc b/third_party/libjingle_xmpp/xmpp/xmpplogintask_unittest.cc index a7edbc6..815fe47e9 100644 --- a/third_party/libjingle_xmpp/xmpp/xmpplogintask_unittest.cc +++ b/third_party/libjingle_xmpp/xmpp/xmpplogintask_unittest.cc
@@ -20,7 +20,6 @@ #include "third_party/libjingle_xmpp/xmpp/util_unittest.h" #include "third_party/libjingle_xmpp/xmpp/xmppengine.h" #include "third_party/webrtc/rtc_base/gunit.h" -#include "third_party/webrtc/typedefs.h" // Macro to be used for switch-case fallthrough (required for enabling // -Wimplicit-fallthrough warning on Clang).
diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py index 04d97b47..fda8768 100755 --- a/tools/clang/scripts/update.py +++ b/tools/clang/scripts/update.py
@@ -798,7 +798,7 @@ 'i686': 'x86', }[target_arch]]) - # Build sanitizer runtimes for Android in a separate build tree. + # Build compiler-rt runtimes needed for Android in a separate build tree. build_dir = os.path.join(LLVM_BUILD_DIR, 'android-' + target_arch) if not os.path.exists(build_dir): os.mkdir(os.path.join(build_dir)) @@ -825,11 +825,16 @@ '-DANDROID=1'] RmCmakeCache('.') RunCommand(['cmake'] + android_args + [COMPILER_RT_DIR]) - RunCommand(['ninja', 'asan', 'ubsan']) + RunCommand(['ninja', 'asan', 'ubsan', 'profile']) # And copy them into the main build tree. - for f in glob.glob(os.path.join(build_dir, 'lib/linux/*.so')): - shutil.copy(f, asan_rt_lib_dst_dir) + want = [ + 'lib/linux/*.so', # ASan and UBSan shared libraries only. + 'lib/linux/*profile*', # Static profile libraries. + ] + for p in want: + for f in glob.glob(os.path.join(build_dir, p)): + shutil.copy(f, asan_rt_lib_dst_dir) # Run tests. if args.run_tests or use_head_revision:
diff --git a/tools/cr/cr/actions/action.py b/tools/cr/cr/actions/action.py index d187094a..5bdd9ce3 100644 --- a/tools/cr/cr/actions/action.py +++ b/tools/cr/cr/actions/action.py
@@ -43,5 +43,3 @@ True if this implementation is a skip action. """ return self.name == 'skip' - -
diff --git a/tools/cr/cr/actions/builder.py b/tools/cr/cr/actions/builder.py index 015e6e5..82c71c1 100644 --- a/tools/cr/cr/actions/builder.py +++ b/tools/cr/cr/actions/builder.py
@@ -79,4 +79,3 @@ def IsTarget(self, target_name): return True -
diff --git a/tools/cr/cr/actions/gdb.py b/tools/cr/cr/actions/gdb.py index cdbb1bf..3268ef0 100644 --- a/tools/cr/cr/actions/gdb.py +++ b/tools/cr/cr/actions/gdb.py
@@ -36,4 +36,3 @@ gdb_binaries = cr.Host.SearchPath('gdb') if gdb_binaries: cls.DETECTED.Set(CR_GDB=gdb_binaries[0]) -
diff --git a/tools/cr/cr/actions/linux.py b/tools/cr/cr/actions/linux.py index 8e670e3..b47b516c 100644 --- a/tools/cr/cr/actions/linux.py +++ b/tools/cr/cr/actions/linux.py
@@ -49,4 +49,3 @@ def Reinstall(self, targets, arguments): pass -
diff --git a/tools/cr/cr/actions/runner.py b/tools/cr/cr/actions/runner.py index 0b7a03d..e768eef 100644 --- a/tools/cr/cr/actions/runner.py +++ b/tools/cr/cr/actions/runner.py
@@ -85,4 +85,3 @@ def Test(self, target, arguments): pass -
diff --git a/tools/cr/cr/base/android.py b/tools/cr/cr/base/android.py index ed78824..2ae48ce 100644 --- a/tools/cr/cr/base/android.py +++ b/tools/cr/cr/base/android.py
@@ -77,4 +77,3 @@ print 'You may need to sync before an output directory can be made.' if cr.Host.YesNo('Would you like to sync this client now?'): cr.SyncCommand.Sync(["--nohooks"]) -
diff --git a/tools/cr/cr/base/buildtype.py b/tools/cr/cr/base/buildtype.py index 1755812..2761531 100644 --- a/tools/cr/cr/base/buildtype.py +++ b/tools/cr/cr/base/buildtype.py
@@ -55,4 +55,3 @@ @property def priority(self): return BuildType.GetPlugin('Debug').priority + 1 -
diff --git a/tools/cr/cr/base/client.py b/tools/cr/cr/base/client.py index 4c89c46..cde8cdf3f 100644 --- a/tools/cr/cr/base/client.py +++ b/tools/cr/cr/base/client.py
@@ -281,4 +281,3 @@ config: The mutable config that will be written. """ raise NotImplementedError('Must be overridden.') -
diff --git a/tools/cr/cr/commands/command.py b/tools/cr/cr/commands/command.py index d42a688c..f1f37cd 100644 --- a/tools/cr/cr/commands/command.py +++ b/tools/cr/cr/commands/command.py
@@ -93,4 +93,3 @@ call this base version. """ raise NotImplementedError('Must be overridden.') -
diff --git a/tools/cr/cr/commands/info.py b/tools/cr/cr/commands/info.py index 4e5c2be..fca1c4c0 100644 --- a/tools/cr/cr/commands/info.py +++ b/tools/cr/cr/commands/info.py
@@ -41,4 +41,3 @@ print var, '=', cr.context.Find(var) else: cr.base.client.PrintInfo() -
diff --git a/tools/cr/cr/commands/prepare.py b/tools/cr/cr/commands/prepare.py index 8d8f251..c4b62930 100644 --- a/tools/cr/cr/commands/prepare.py +++ b/tools/cr/cr/commands/prepare.py
@@ -66,4 +66,3 @@ def Prepare(self): """All PrepareOut plugins must override this method to do their work.""" raise NotImplementedError('Must be overridden.') -
diff --git a/tools/cr/cr/commands/run.py b/tools/cr/cr/commands/run.py index 15d7db06..18d2afc 100644 --- a/tools/cr/cr/commands/run.py +++ b/tools/cr/cr/commands/run.py
@@ -50,4 +50,3 @@ cr.Runner.Kill(run_targets, []) cr.Installer.Reinstall(run_targets, []) cr.Runner.Invoke(original_targets, cr.context.remains) -
diff --git a/tools/cr/cr/fixups/arch.py b/tools/cr/cr/fixups/arch.py index a756272f..e1677d6 100644 --- a/tools/cr/cr/fixups/arch.py +++ b/tools/cr/cr/fixups/arch.py
@@ -51,4 +51,3 @@ if old_arch == 'arm': return cr.Arm32Arch.GetInstance().name return old_arch -
diff --git a/tools/cr/cr/targets/chrome_public.py b/tools/cr/cr/targets/chrome_public.py index 5f0311ab..a9fa1ad 100644 --- a/tools/cr/cr/targets/chrome_public.py +++ b/tools/cr/cr/targets/chrome_public.py
@@ -24,4 +24,3 @@ CR_TEST_TYPE=cr.Target.INSTRUMENTATION_TEST, CR_RUN_DEPENDENCIES=[ChromePublicTarget.NAME], ) -
diff --git a/tools/cr/cr/visitor.py b/tools/cr/cr/visitor.py index 8e01c70..8bedda3 100644 --- a/tools/cr/cr/visitor.py +++ b/tools/cr/cr/visitor.py
@@ -257,4 +257,3 @@ self._children = collections.deque() self._values = {} self.NotifyChanged() -
diff --git a/tools/gdb/viewg.gdb b/tools/gdb/viewg.gdb new file mode 100644 index 0000000..9b69581 --- /dev/null +++ b/tools/gdb/viewg.gdb
@@ -0,0 +1,34 @@ +# Copyright 2018 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. + +# Creates a SVG graph of the view hierarchy, when stopped in a +# method of an object that inherits from views::View. Requires +# graphviz. +# +# For more info see +# chromium/src/+/HEAD/docs/graphical_debugging_aid_chromium_views.md +# +# To make this command available, add the following to your ~/.lldbinit: +# source {Path to SRC Root}/tools/gdbviewg.gdb +# +# Usage: type `viewg` at the GDB prompt, given the conditions above. + + +define viewg + if $argc != 0 + echo Usage: viewg + else + set pagination off + set print elements 0 + set logging off + set logging file ~/state.dot + set logging overwrite on + set logging redirect on + set logging on + printf "%s\n", view::PrintViewGraph(this).c_str() + set logging off + shell dot -Tsvg -o ~/state.svg ~/state.dot + set pagination on + end +end \ No newline at end of file
diff --git a/tools/lldb/lldb_viewg.py b/tools/lldb/lldb_viewg.py new file mode 100644 index 0000000..2ecfa8c --- /dev/null +++ b/tools/lldb/lldb_viewg.py
@@ -0,0 +1,47 @@ +# Copyright 2018 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. + +""" + Creates a SVG graph of the view hierarchy, when stopped in a + method of an object that inherits from views::View. Requires + graphviz. + + For more info see + chromium/src/+/HEAD/docs/graphical_debugging_aid_chromium_views.md + + To make this command available, add the following to your ~/.lldbinit: + command script import {Path to SRC Root}/tools/lldb/lldb_viewg.py + + Usage: type `viewg` at the LLDB prompt, given the conditions above. +""" + +import lldb +import os + +def view_graph(debugger, command, result, internal_dict): + dot = os.path.expanduser("~/state.dot") + svg = os.path.splitext(dot)[0] + ".svg" + + process = debugger.GetSelectedTarget().GetProcess() + frame = process.GetSelectedThread().GetSelectedFrame() + + cstr_address = frame.EvaluateExpression("views::PrintViewGraph(this).c_str()") + if not cstr_address.GetError().Success(): + return + str_size = frame.EvaluateExpression("(size_t)strlen(%s)" + % cstr_address.GetValue()) + if not str_size.GetError().Success(): + return + error = lldb.SBError() + dot_str = process.ReadCStringFromMemory(int(cstr_address.GetValue(), 16), + str_size.GetValueAsUnsigned(), error) + if not error.Success(): + return + + with open(dot, "w") as f: + f.write(dot_str) + os.system("dot -Tsvg -o %s %s" % (svg, dot)) + +def __lldb_init_module(debugger, internal_dict): + debugger.HandleCommand('command script add -f lldb_viewg.view_graph viewg')
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index f0c392bc..d943d1d 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -6991,11 +6991,11 @@ <int value="0" label="unknown"/> <int value="1" label="HTTP/1.1"/> <int value="2" label="SPDY/2 (deprecated)"/> - <int value="3" label="SPDY/3"/> + <int value="3" label="SPDY/3 (deprecated)"/> <int value="4" label="HTTP/2"/> <int value="5" label="QUIC (unknown version)"/> - <int value="6" label="HTTP/2 draft-14"/> - <int value="7" label="HTTP/2 draft-15"/> + <int value="6" label="HTTP/2 draft-14 (deprecated)"/> + <int value="7" label="HTTP/2 draft-15 (deprecated)"/> <int value="8" label="HTTP/0.9"/> <int value="9" label="HTTP/1.0"/> <int value="10" label="QUIC/32"/> @@ -7011,6 +7011,7 @@ <int value="20" label="QUIC/42"/> <int value="21" label="QUIC/43"/> <int value="22" label="QUIC/99"/> + <int value="23" label="QUIC/44"/> </enum> <enum name="ConnectionResult"> @@ -27897,6 +27898,7 @@ <int value="-1419788257" label="enable-experimental-hotwording"/> <int value="-1417122729" label="AutofillCreditCardAblationExperiment:disabled"/> + <int value="-1416758392" label="migrate-linux-to-logindb:disabled"/> <int value="-1416754663" label="enable-mac-views-native-app-windows"/> <int value="-1416184931" label="TranslateRankerEnforcement:enabled"/> <int value="-1411003295" label="disable-encrypted-media"/> @@ -28122,6 +28124,7 @@ <int value="-972737445" label="ArcUseAuthEndpoint:disabled"/> <int value="-972425050" label="gesture-editing"/> <int value="-970067535" label="BackgroundTaskComponentUpdate:disabled"/> + <int value="-969815853" label="migrate-linux-to-logindb:enabled"/> <int value="-969332901" label="stop-non-timers-in-background:disabled"/> <int value="-968010468" label="SharedArrayBuffer:disabled"/> <int value="-966290456" label="WebAuthenticationCtap2:enabled"/>
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index fc486ae..dde109f 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -928,6 +928,14 @@ </summary> </histogram> +<histogram name="Android.AppNotificationStatus" enum="NotificationAppStatus"> + <owner>peter@chromium.org</owner> + <summary> + Records whether notifications are enabled for Chrome, as the Android app, + every time metrics are logged. + </summary> +</histogram> + <histogram name="Android.ArmFpu" enum="AndroidArmFpu"> <owner>fdegans@chromium.org</owner> <summary> @@ -49650,6 +49658,24 @@ </summary> </histogram> +<histogram name="Net.ConnectionInfo.MainFrame" enum="ConnectionInfo"> + <owner>bnc@chromium.org</owner> + <summary> + Application protocol used for main frame resources. Logged by the renderer + only for request that accessed the network and have received response + headers. + </summary> +</histogram> + +<histogram name="Net.ConnectionInfo.SubResource" enum="ConnectionInfo"> + <owner>bnc@chromium.org</owner> + <summary> + Application protocol used for subresources (resources other than main + frame). Logged by the renderer only for request that accessed the network + and have received response headers. + </summary> +</histogram> + <histogram name="Net.ConnectionTypeCount" enum="ConnectionType"> <obsolete> The count was inaccurate (it counted transactions rather than connections)
diff --git a/tools/perf/core/perf_benchmark.py b/tools/perf/core/perf_benchmark.py index bfe8171..7b678c1 100644 --- a/tools/perf/core/perf_benchmark.py +++ b/tools/perf/core/perf_benchmark.py
@@ -1,7 +1,6 @@ # Copyright 2015 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. - import json import os import sys @@ -15,6 +14,7 @@ '..', 'variations')) import fieldtrial_util # pylint: disable=import-error + # This function returns a list of two-tuples designed to extend # browser_options.profile_files_to_copy. On success, it will return two entries: # 1. The actual indexed ruleset file, which will be placed in a destination @@ -22,7 +22,7 @@ # 2. A default prefs 'Local State' file, which contains information about the ad # tagging ruleset's version. def GetAdTaggingProfileFiles(chrome_output_directory): - """Gets ad tagging tuples for browser_options.profile_files_to_copy + """Gets ad tagging tuples for browser_options.profile_files_to_copy. This function looks for input files related to ad tagging, and returns tuples indicating where those files should be copied to in the resulting perf @@ -41,7 +41,7 @@ return [] ruleset_path = os.path.join(chrome_output_directory, 'gen', 'components', - 'subresource_filter', 'tools','GeneratedRulesetData') + 'subresource_filter', 'tools', 'GeneratedRulesetData') if not os.path.exists(ruleset_path): return [] @@ -72,7 +72,7 @@ """ def SetExtraBrowserOptions(self, options): - """ To be overridden by perf benchmarks. """ + """To be overridden by perf benchmarks.""" pass def CustomizeBrowserOptions(self, options): @@ -90,7 +90,7 @@ # # The same logic applies to the ad filtering ruleset, which could be in a # binary format that an older build does not expect. - if options.browser_type != 'reference': + if options.browser_type != 'reference' and not options.compatibility_mode: variations = self._GetVariationsBrowserArgs(options.finder_options) options.AppendExtraBrowserArgs(variations) @@ -134,7 +134,7 @@ possible_directories = path_module.GetBuildDirectories(chrome_src_dir) # Special case "android-chromium" and "any" and check all # possible out directories. - if browser_type in ("android-chromium", "any"): + if browser_type in ('android-chromium', 'any'): return possible_directories # For all other browser types, just consider directories which match. @@ -142,11 +142,13 @@ if os.path.basename(p).lower() == browser_type) def _GetOutDirectoryEstimate(self, options): - """Gets an estimate of the output directory for this build + """Gets an estimate of the output directory for this build. Note that as an estimate, this may be incorrect. Callers should be aware of this and ensure that in the case that this returns an existing but - incorrect directory, nothing should critically break.""" + incorrect directory, nothing should critically break. + + """ finder_options = options.finder_options if finder_options.chromium_output_dir is not None: return finder_options.chromium_output_dir
diff --git a/tools/perf/core/perf_benchmark_unittest.py b/tools/perf/core/perf_benchmark_unittest.py index 9b91943..84228c2c 100644 --- a/tools/perf/core/perf_benchmark_unittest.py +++ b/tools/perf/core/perf_benchmark_unittest.py
@@ -90,6 +90,16 @@ for arg in expected_args: self.assertNotIn(arg, options.browser_options.extra_browser_args) + def testVariationArgsCompatibilityMode(self): + benchmark = perf_benchmark.PerfBenchmark() + options = options_for_unittests.GetCopy() + options.browser_options.compatibility_mode = True + benchmark.CustomizeBrowserOptions(options.browser_options) + + extra_args = options.browser_options.extra_browser_args + feature_args = [a for a in extra_args if a.startswith('--enable-features')] + self.assertEqual(0, len(feature_args)) + def testNoAdTaggingRuleset(self): benchmark = perf_benchmark.PerfBenchmark() options = options_for_unittests.GetCopy()
diff --git a/tools/translation/testdata/part_grdp/OWNERS b/tools/translation/testdata/part_grdp/OWNERS new file mode 100644 index 0000000..1cac0d2 --- /dev/null +++ b/tools/translation/testdata/part_grdp/OWNERS
@@ -0,0 +1,3 @@ +# This OWNERS file is for testing. Point it to the original so as not to break +# this directory. +file://tools/translation/OWNERS
diff --git a/tools/translation/testdata/test_grd/README.md b/tools/translation/testdata/test_grd/README.md new file mode 100644 index 0000000..93acd73 --- /dev/null +++ b/tools/translation/testdata/test_grd/README.md
@@ -0,0 +1 @@ +Test readme file \ No newline at end of file
diff --git a/tools/translation/upload_screenshots.py b/tools/translation/upload_screenshots.py index 964079a..4cef0a2 100755 --- a/tools/translation/upload_screenshots.py +++ b/tools/translation/upload_screenshots.py
@@ -131,7 +131,7 @@ if not os.path.exists(screenshots_dir): continue for f in os.listdir(screenshots_dir): - if f.endswith('.sha1'): + if f in ('OWNERS', 'README.md') or f.endswith('.sha1'): continue if not f.endswith('.png'): print 'File with unexpected extension: %s in %s' % (f, screenshots_dir) @@ -176,7 +176,7 @@ gsutil=gsutil, force=False, use_md5=False, - num_threads=1, + num_threads=10, skip_hashing=False, gzip=None) != 0: print 'Error uploading screenshots, exiting.'
diff --git a/ui/views/cocoa/bridged_native_widget.mm b/ui/views/cocoa/bridged_native_widget.mm index c85c4d3..60e134a 100644 --- a/ui/views/cocoa/bridged_native_widget.mm +++ b/ui/views/cocoa/bridged_native_widget.mm
@@ -43,15 +43,6 @@ #include "ui/views/widget/widget_delegate.h" #include "ui/views/window/dialog_delegate.h" -extern "C" { - -typedef int32_t CGSConnection; -CGSConnection _CGSDefaultConnection(); -CGError CGSSetWindowBackgroundBlurRadius(CGSConnection connection, - NSInteger windowNumber, - int radius); - -} namespace { constexpr auto kUIPaintTimeout = base::TimeDelta::FromSeconds(5); } // namespace