diff --git a/DEPS b/DEPS index 8795c742..44239d6b 100644 --- a/DEPS +++ b/DEPS
@@ -105,7 +105,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': 'f18c297cfb74a48b748bc7909991f98dabb8d460', + 'skia_revision': '5457141b011e1791f5d3406e99de22c208d480f3', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # 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': '299bdfe75173549470981d70e88dd55c02123abb', + 'angle_revision': 'a602f9064b3eb0f8f2594e314892f6ec718fcc94', # 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': 'e5495aef8e462d6aa5f4460afea10d5b90338543', + 'catapult_revision': '846ae9bff247b09aee0f07b2384f6b967b354eff', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -595,7 +595,7 @@ # Build tools for Chrome OS. Note: This depends on third_party/pyelftools. 'src/third_party/chromite': { - 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '7fd8b20a597af3ee31ed185a8c0d6229ecabf2af', + 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '16285b48a4d5cc5c467bb59809db939abef8910f', 'condition': 'checkout_linux', }, @@ -610,7 +610,7 @@ # For Linux and Chromium OS. 'src/third_party/cros_system_api': { - 'url': Var('chromium_git') + '/chromiumos/platform/system_api.git' + '@' + '137cb973fb0eb203f47e50adce03baa4ff06a21b', + 'url': Var('chromium_git') + '/chromiumos/platform/system_api.git' + '@' + '536735c009117dc648808dfe47e55284deca8fa0', 'condition': 'checkout_linux', }, @@ -954,7 +954,7 @@ }, 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + '2e5a2964784b33df48a0ad0827ed105e4fecfe3d', + Var('android_git') + '/platform/external/perfetto.git' + '@' + 'ad59bc2906ca854f78db997792afd60eea8fe96a', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + 'ac0d98b5cee6c024b0cffeb4f8f45b6fc5ccdb78', @@ -1106,7 +1106,7 @@ Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + '6d2f3f4cb8bac1f7c4a945c73d07a33df74f22f9', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + 'a7af0218826cfed77664e6723470c77089e12db1', + Var('webrtc_git') + '/src.git' + '@' + '6f68324adbf52b247e10b33a4e83a586e66cc6df', 'src/third_party/xdg-utils': { 'url': Var('chromium_git') + '/chromium/deps/xdg-utils.git' + '@' + 'd80274d5869b17b8c9067a1022e4416ee7ed5e0d', @@ -1137,7 +1137,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@d57b80dd25bd5e5766a2efa2f7b602c7588de818', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@50ebab8640aec4505b7fb38ff5e1d9b6dc9f882a', 'condition': 'checkout_src_internal', },
diff --git a/ash/assistant/ui/assistant_web_view.cc b/ash/assistant/ui/assistant_web_view.cc index c91c4cf..d571554 100644 --- a/ash/assistant/ui/assistant_web_view.cc +++ b/ash/assistant/ui/assistant_web_view.cc
@@ -163,6 +163,11 @@ embed_token.value()); content_view_->AddObserver(this); + // The mask layer should always match the bounds of the content view. We + // enforce this prior to applying the mask to the |native_content_view_| + // layer to prevent a DCHECK failure in cc::Layer. + content_view_mask_->layer()->SetBounds(content_view_->GetLocalBounds()); + // Apply our layer mask which enforces corner radius. native_content_view_ = app_list::AnswerCardContentsRegistry::Get()->GetNativeView(
diff --git a/ash/resources/vector_icons/BUILD.gn b/ash/resources/vector_icons/BUILD.gn index 75c4f3b..2ce0c93 100644 --- a/ash/resources/vector_icons/BUILD.gn +++ b/ash/resources/vector_icons/BUILD.gn
@@ -180,6 +180,7 @@ "system_tray_caps_lock.icon", "system_tray_cast.icon", "system_tray_do_not_disturb.icon", + "system_tray_family_link.icon", "system_tray_managed.icon", "system_tray_night_light.icon", "system_tray_notification_counter_plus.icon",
diff --git a/ash/resources/vector_icons/system_tray_family_link.icon b/ash/resources/vector_icons/system_tray_family_link.icon new file mode 100644 index 0000000..84b3a30 --- /dev/null +++ b/ash/resources/vector_icons/system_tray_family_link.icon
@@ -0,0 +1,28 @@ +// 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. + +CANVAS_DIMENSIONS, 20, +MOVE_TO, 10.32f, 2, +LINE_TO, 4.63f, 8, +R_LINE_TO, 4.92f, 7.5f, +R_LINE_TO, -0.4f, 0.6f, +R_CUBIC_TO, -0.04f, 0.07f, -0.09f, 0.12f, -0.14f, 0.18f, +R_CUBIC_TO, -0.24f, 0.25f, -0.56f, 0.39f, -0.9f, 0.39f, +R_CUBIC_TO, -0.34f, 0, -0.65f, -0.13f, -0.9f, -0.39f, +R_ARC_TO, 1.35f, 1.35f, 0, 0, 1, -0.37f, -0.94f, +R_ARC_TO, 2.72f, 2.72f, 0, 0, 0, -0.74f, -1.88f, +R_ARC_TO, 2.44f, 2.44f, 0, 0, 0, -1.78f, -0.78f, +H_LINE_TO, 4, +R_V_LINE_TO, 1.34f, +R_H_LINE_TO, 0.33f, +R_CUBIC_TO, 0.34f, 0, 0.65f, 0.14f, 0.9f, 0.39f, +R_CUBIC_TO, 0.24f, 0.26f, 0.37f, 0.59f, 0.37f, 0.95f, +R_CUBIC_TO, 0, 0.71f, 0.26f, 1.38f, 0.74f, 1.88f, +R_CUBIC_TO, 0.48f, 0.5f, 1.11f, 0.78f, 1.78f, 0.78f, +R_CUBIC_TO, 0.67f, 0, 1.31f, -0.28f, 1.78f, -0.78f, +R_CUBIC_TO, 0.11f, -0.11f, 0.2f, -0.23f, 0.28f, -0.35f, +R_LINE_TO, 1.27f, -1.94f, +LINE_TO, 16, 8, +LINE_TO, 10.32f, 2, +CLOSE
diff --git a/ash/system/unified/managed_device_view.cc b/ash/system/unified/managed_device_view.cc index c5cf8c6..a52be4b 100644 --- a/ash/system/unified/managed_device_view.cc +++ b/ash/system/unified/managed_device_view.cc
@@ -18,27 +18,45 @@ ManagedDeviceView::ManagedDeviceView() : TrayItemView(nullptr) { Shell::Get()->system_tray_model()->enterprise_domain()->AddObserver(this); + Shell::Get()->session_controller()->AddObserver(this); CreateImageView(); - image_view()->SetImage(gfx::CreateVectorIcon( - kSystemTrayManagedIcon, - TrayIconColor(Shell::Get()->session_controller()->GetSessionState()))); Update(); } ManagedDeviceView::~ManagedDeviceView() { Shell::Get()->system_tray_model()->enterprise_domain()->RemoveObserver(this); + Shell::Get()->session_controller()->RemoveObserver(this); } void ManagedDeviceView::OnEnterpriseDomainChanged() { - Update(); + EnterpriseDomainModel* model = + Shell::Get()->system_tray_model()->enterprise_domain(); + bool old_value = is_enterprise_; + is_enterprise_ = model->active_directory_managed() || + !model->enterprise_display_domain().empty(); + if (is_enterprise_ != old_value) + Update(); } void ManagedDeviceView::Update() { - // TODO(crbug.com/870409): Also support family link. - EnterpriseDomainModel* model = - Shell::Get()->system_tray_model()->enterprise_domain(); - SetVisible(model->active_directory_managed() || - !model->enterprise_display_domain().empty()); + if (is_enterprise_) { + image_view()->SetImage(gfx::CreateVectorIcon( + kSystemTrayManagedIcon, + TrayIconColor(Shell::Get()->session_controller()->GetSessionState()))); + SetVisible(true); + } else if (is_child_) { + image_view()->SetImage(gfx::CreateVectorIcon( + kSystemTrayFamilyLinkIcon, + TrayIconColor(Shell::Get()->session_controller()->GetSessionState()))); + SetVisible(true); + } else { + SetVisible(false); + } +} + +void ManagedDeviceView::OnLoginStatusChanged(LoginStatus status) { + SessionController* session = Shell::Get()->session_controller(); + is_child_ = status == LoginStatus::SUPERVISED && session->IsUserChild(); } } // namespace ash
diff --git a/ash/system/unified/managed_device_view.h b/ash/system/unified/managed_device_view.h index 191b4c9..4dff9815 100644 --- a/ash/system/unified/managed_device_view.h +++ b/ash/system/unified/managed_device_view.h
@@ -5,6 +5,7 @@ #ifndef ASH_SYSTEM_UNIFIED_MANAGED_DEVICE_VIEW_H_ #define ASH_SYSTEM_UNIFIED_MANAGED_DEVICE_VIEW_H_ +#include "ash/session/session_observer.h" #include "ash/system/enterprise/enterprise_domain_observer.h" #include "ash/system/tray/tray_item_view.h" #include "base/macros.h" @@ -14,7 +15,9 @@ // A view to show an icon in the status tray when the device is managed by // an organization admin. Observes change of the enterprise domain in order to // show/hide the icon reflecting the latest status. -class ManagedDeviceView : public TrayItemView, public EnterpriseDomainObserver { +class ManagedDeviceView : public TrayItemView, + public EnterpriseDomainObserver, + public SessionObserver { public: ManagedDeviceView(); ~ManagedDeviceView() override; @@ -22,9 +25,15 @@ // EnterpriseDomainObserver: void OnEnterpriseDomainChanged() override; + // SessionObserver: + void OnLoginStatusChanged(LoginStatus status) override; + private: void Update(); + bool is_child_ = false; + bool is_enterprise_ = false; + DISALLOW_COPY_AND_ASSIGN(ManagedDeviceView); };
diff --git a/ash/system/unified/unified_system_tray.cc b/ash/system/unified/unified_system_tray.cc index b6bf253..29f44ba 100644 --- a/ash/system/unified/unified_system_tray.cc +++ b/ash/system/unified/unified_system_tray.cc
@@ -295,6 +295,10 @@ time, battery); } +void UnifiedSystemTray::HideBubble(const TrayBubbleView* bubble_view) { + CloseBubble(); +} + void UnifiedSystemTray::HideBubbleWithView(const TrayBubbleView* bubble_view) {} void UnifiedSystemTray::ClickedOutsideBubble() {
diff --git a/ash/system/unified/unified_system_tray.h b/ash/system/unified/unified_system_tray.h index 70d72f0..c1a4e0f 100644 --- a/ash/system/unified/unified_system_tray.h +++ b/ash/system/unified/unified_system_tray.h
@@ -85,6 +85,7 @@ void CloseBubble() override; base::string16 GetAccessibleNameForBubble() override; base::string16 GetAccessibleNameForTray() override; + void HideBubble(const TrayBubbleView* bubble_view) override; void HideBubbleWithView(const TrayBubbleView* bubble_view) override; void ClickedOutsideBubble() override; void UpdateAfterShelfAlignmentChange() override;
diff --git a/base/files/file_path_watcher_linux.cc b/base/files/file_path_watcher_linux.cc index c58d6865..1cd8035 100644 --- a/base/files/file_path_watcher_linux.cc +++ b/base/files/file_path_watcher_linux.cc
@@ -47,14 +47,14 @@ class InotifyReaderThreadDelegate final : public PlatformThread::Delegate { public: - InotifyReaderThreadDelegate(int inotify_fd) : inotify_fd_(inotify_fd){}; - + explicit InotifyReaderThreadDelegate(int inotify_fd) + : inotify_fd_(inotify_fd) {} ~InotifyReaderThreadDelegate() override = default; private: void ThreadMain() override; - int inotify_fd_; + const int inotify_fd_; DISALLOW_COPY_AND_ASSIGN(InotifyReaderThreadDelegate); }; @@ -64,11 +64,11 @@ // http://crbug.com/38174 class InotifyReader { public: - typedef int Watch; // Watch descriptor used by AddWatch and RemoveWatch. - static const Watch kInvalidWatch = -1; + using Watch = int; // Watch descriptor used by AddWatch() and RemoveWatch(). + static constexpr Watch kInvalidWatch = -1; // Watch directory |path| for changes. |watcher| will be notified on each - // change. Returns kInvalidWatch on failure. + // change. Returns |kInvalidWatch| on failure. Watch AddWatch(const FilePath& path, FilePathWatcherImpl* watcher); // Remove |watch| if it's valid. @@ -80,8 +80,6 @@ private: friend struct LazyInstanceTraitsBase<InotifyReader>; - typedef std::set<FilePathWatcherImpl*> WatcherSet; - InotifyReader(); // There is no destructor because |g_inotify_reader| is a // base::LazyInstace::Leaky object. Having a destructor causes build @@ -90,12 +88,12 @@ // Returns true on successful thread creation. bool StartThread(); - // We keep track of which delegates want to be notified on which watches. - std::unordered_map<Watch, WatcherSet> watchers_; - - // Lock to protect watchers_. + // Lock to protect |watchers_|. Lock lock_; + // We keep track of which delegates want to be notified on which watches. + std::unordered_map<Watch, std::set<FilePathWatcherImpl*>> watchers_; + // File descriptor returned by inotify_init. const int inotify_fd_; @@ -103,7 +101,7 @@ InotifyReaderThreadDelegate thread_delegate_; // Flag set to true when startup was successful. - bool valid_; + bool valid_ = false; DISALLOW_COPY_AND_ASSIGN(InotifyReader); }; @@ -158,7 +156,6 @@ FilePath::StringType subdir; FilePath::StringType linkname; }; - typedef std::vector<WatchEntry> WatchVector; // Reconfigure to watch for the most specific parent directory of |target_| // that exists. Also calls UpdateRecursiveWatches() below. @@ -195,12 +192,12 @@ // The file or directory we're supposed to watch. FilePath target_; - bool recursive_; + bool recursive_ = false; // The vector of watches and next component names for all path components, // starting at the root directory. The last entry corresponds to the watch for // |target_| and always stores an empty next component name in |subdir|. - WatchVector watches_; + std::vector<WatchEntry> watches_; std::unordered_map<InotifyReader::Watch, FilePath> recursive_paths_by_watch_; std::map<FilePath, InotifyReader::Watch> recursive_watches_by_path_; @@ -269,9 +266,7 @@ } InotifyReader::InotifyReader() - : inotify_fd_(inotify_init()), - thread_delegate_(inotify_fd_), - valid_(false) { + : inotify_fd_(inotify_init()), thread_delegate_(inotify_fd_) { if (inotify_fd_ < 0) { PLOG(ERROR) << "inotify_init() failed"; return; @@ -330,19 +325,15 @@ FilePath::StringType child(event->len ? event->name : FILE_PATH_LITERAL("")); AutoLock auto_lock(lock_); - for (WatcherSet::iterator watcher = watchers_[event->wd].begin(); - watcher != watchers_[event->wd].end(); - ++watcher) { - (*watcher)->OnFilePathChanged(event->wd, - child, - event->mask & (IN_CREATE | IN_MOVED_TO), - event->mask & (IN_DELETE | IN_MOVED_FROM), - event->mask & IN_ISDIR); + auto& watcher_set = watchers_[event->wd]; + for (FilePathWatcherImpl* watcher : watcher_set) { + watcher->OnFilePathChanged( + event->wd, child, event->mask & (IN_CREATE | IN_MOVED_TO), + event->mask & (IN_DELETE | IN_MOVED_FROM), event->mask & IN_ISDIR); } } -FilePathWatcherImpl::FilePathWatcherImpl() - : recursive_(false), weak_factory_(this) { +FilePathWatcherImpl::FilePathWatcherImpl() : weak_factory_(this) { weak_ptr_ = weak_factory_.GetWeakPtr(); } @@ -487,8 +478,8 @@ set_cancelled(); callback_.Reset(); - for (size_t i = 0; i < watches_.size(); ++i) - g_inotify_reader.Get().RemoveWatch(watches_[i].watch, this); + for (const auto& watch : watches_) + g_inotify_reader.Get().RemoveWatch(watch.watch, this); watches_.clear(); target_.clear(); RemoveRecursiveWatches(); @@ -502,8 +493,7 @@ // Walk the list of watches and update them as we go. FilePath path(FILE_PATH_LITERAL("/")); - for (size_t i = 0; i < watches_.size(); ++i) { - WatchEntry& watch_entry = watches_[i]; + for (WatchEntry& watch_entry : watches_) { InotifyReader::Watch old_watch = watch_entry.watch; watch_entry.watch = InotifyReader::kInvalidWatch; watch_entry.linkname.clear();
diff --git a/base/memory/platform_shared_memory_region.cc b/base/memory/platform_shared_memory_region.cc index c145336..45647925 100644 --- a/base/memory/platform_shared_memory_region.cc +++ b/base/memory/platform_shared_memory_region.cc
@@ -5,6 +5,7 @@ #include "base/memory/platform_shared_memory_region.h" #include "base/memory/shared_memory_mapping.h" +#include "base/numerics/checked_math.h" namespace base { namespace subtle { @@ -33,5 +34,29 @@ return std::move(handle_); } +bool PlatformSharedMemoryRegion::MapAt(off_t offset, + size_t size, + void** memory, + size_t* mapped_size) const { + if (!IsValid()) + return false; + + if (size == 0) + return false; + + size_t end_byte; + if (!CheckAdd(offset, size).AssignIfValid(&end_byte) || end_byte > size_) { + return false; + } + + bool success = MapAtInternal(offset, size, memory, mapped_size); + if (success) { + DCHECK_EQ( + 0U, reinterpret_cast<uintptr_t>(*memory) & (kMapMinimumAlignment - 1)); + } + + return success; +} + } // namespace subtle } // namespace base
diff --git a/base/memory/platform_shared_memory_region.h b/base/memory/platform_shared_memory_region.h index 1bf09e9..a5e7f429 100644 --- a/base/memory/platform_shared_memory_region.h +++ b/base/memory/platform_shared_memory_region.h
@@ -241,6 +241,11 @@ size_t size, const UnguessableToken& guid); + bool MapAtInternal(off_t offset, + size_t size, + void** memory, + size_t* mapped_size) const; + ScopedPlatformHandle handle_; Mode mode_ = Mode::kReadOnly; size_t size_ = 0;
diff --git a/base/memory/platform_shared_memory_region_android.cc b/base/memory/platform_shared_memory_region_android.cc index c7dd5a9..77b1051 100644 --- a/base/memory/platform_shared_memory_region_android.cc +++ b/base/memory/platform_shared_memory_region_android.cc
@@ -127,18 +127,10 @@ return true; } -bool PlatformSharedMemoryRegion::MapAt(off_t offset, - size_t size, - void** memory, - size_t* mapped_size) const { - if (!IsValid()) - return false; - - size_t end_byte; - if (!CheckAdd(offset, size).AssignIfValid(&end_byte) || end_byte > size_) { - return false; - } - +bool PlatformSharedMemoryRegion::MapAtInternal(off_t offset, + size_t size, + void** memory, + size_t* mapped_size) const { bool write_allowed = mode_ != Mode::kReadOnly; *memory = mmap(nullptr, size, PROT_READ | (write_allowed ? PROT_WRITE : 0), MAP_SHARED, handle_.get(), offset); @@ -150,8 +142,6 @@ } *mapped_size = size; - DCHECK_EQ(0U, - reinterpret_cast<uintptr_t>(*memory) & (kMapMinimumAlignment - 1)); return true; }
diff --git a/base/memory/platform_shared_memory_region_fuchsia.cc b/base/memory/platform_shared_memory_region_fuchsia.cc index ba66119..0d10336 100644 --- a/base/memory/platform_shared_memory_region_fuchsia.cc +++ b/base/memory/platform_shared_memory_region_fuchsia.cc
@@ -10,7 +10,6 @@ #include "base/bits.h" #include "base/fuchsia/fuchsia_logging.h" -#include "base/numerics/checked_math.h" #include "base/process/process_metrics.h" namespace base { @@ -108,18 +107,10 @@ return true; } -bool PlatformSharedMemoryRegion::MapAt(off_t offset, - size_t size, - void** memory, - size_t* mapped_size) const { - if (!IsValid()) - return false; - - size_t end_byte; - if (!CheckAdd(offset, size).AssignIfValid(&end_byte) || end_byte > size_) { - return false; - } - +bool PlatformSharedMemoryRegion::MapAtInternal(off_t offset, + size_t size, + void** memory, + size_t* mapped_size) const { bool write_allowed = mode_ != Mode::kReadOnly; uintptr_t addr; zx_status_t status = zx::vmar::root_self()->map( @@ -133,8 +124,6 @@ *memory = reinterpret_cast<void*>(addr); *mapped_size = size; - DCHECK_EQ(0U, - reinterpret_cast<uintptr_t>(*memory) & (kMapMinimumAlignment - 1)); return true; }
diff --git a/base/memory/platform_shared_memory_region_mac.cc b/base/memory/platform_shared_memory_region_mac.cc index 764de306..406f930f 100644 --- a/base/memory/platform_shared_memory_region_mac.cc +++ b/base/memory/platform_shared_memory_region_mac.cc
@@ -10,7 +10,6 @@ #include "base/mac/scoped_mach_vm.h" #include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" -#include "base/numerics/checked_math.h" #include "build/build_config.h" #if defined(OS_IOS) @@ -151,18 +150,10 @@ return true; } -bool PlatformSharedMemoryRegion::MapAt(off_t offset, - size_t size, - void** memory, - size_t* mapped_size) const { - if (!IsValid()) - return false; - - size_t end_byte; - if (!CheckAdd(offset, size).AssignIfValid(&end_byte) || end_byte > size_) { - return false; - } - +bool PlatformSharedMemoryRegion::MapAtInternal(off_t offset, + size_t size, + void** memory, + size_t* mapped_size) const { bool write_allowed = mode_ != Mode::kReadOnly; vm_prot_t vm_prot_write = write_allowed ? VM_PROT_WRITE : 0; kern_return_t kr = mach_vm_map( @@ -181,8 +172,6 @@ } *mapped_size = size; - DCHECK_EQ(0U, - reinterpret_cast<uintptr_t>(*memory) & (kMapMinimumAlignment - 1)); return true; }
diff --git a/base/memory/platform_shared_memory_region_posix.cc b/base/memory/platform_shared_memory_region_posix.cc index cc6dcf5..3226ca4a 100644 --- a/base/memory/platform_shared_memory_region_posix.cc +++ b/base/memory/platform_shared_memory_region_posix.cc
@@ -9,7 +9,6 @@ #include <sys/stat.h> #include "base/files/file_util.h" -#include "base/numerics/checked_math.h" #include "base/threading/thread_restrictions.h" #include "build/build_config.h" @@ -173,18 +172,10 @@ return true; } -bool PlatformSharedMemoryRegion::MapAt(off_t offset, - size_t size, - void** memory, - size_t* mapped_size) const { - if (!IsValid()) - return false; - - size_t end_byte; - if (!CheckAdd(offset, size).AssignIfValid(&end_byte) || end_byte > size_) { - return false; - } - +bool PlatformSharedMemoryRegion::MapAtInternal(off_t offset, + size_t size, + void** memory, + size_t* mapped_size) const { bool write_allowed = mode_ != Mode::kReadOnly; *memory = mmap(nullptr, size, PROT_READ | (write_allowed ? PROT_WRITE : 0), MAP_SHARED, handle_.fd.get(), offset); @@ -196,8 +187,6 @@ } *mapped_size = size; - DCHECK_EQ(0U, - reinterpret_cast<uintptr_t>(*memory) & (kMapMinimumAlignment - 1)); return true; }
diff --git a/base/memory/platform_shared_memory_region_unittest.cc b/base/memory/platform_shared_memory_region_unittest.cc index 2bedb75..e0918bb 100644 --- a/base/memory/platform_shared_memory_region_unittest.cc +++ b/base/memory/platform_shared_memory_region_unittest.cc
@@ -162,6 +162,15 @@ EXPECT_FALSE(region2.IsValid()); } +// Tests that mapping zero bytes fails. +TEST_F(PlatformSharedMemoryRegionTest, MapAtZeroBytesTest) { + PlatformSharedMemoryRegion region = + PlatformSharedMemoryRegion::CreateWritable(kRegionSize); + ASSERT_TRUE(region.IsValid()); + WritableSharedMemoryMapping mapping = MapAtForTesting(®ion, 0, 0); + EXPECT_FALSE(mapping.IsValid()); +} + // Tests that mapping bytes out of the region limits fails. TEST_F(PlatformSharedMemoryRegionTest, MapAtOutOfTheRegionLimitsTest) { PlatformSharedMemoryRegion region =
diff --git a/base/memory/platform_shared_memory_region_win.cc b/base/memory/platform_shared_memory_region_win.cc index c300101..2c865ed 100644 --- a/base/memory/platform_shared_memory_region_win.cc +++ b/base/memory/platform_shared_memory_region_win.cc
@@ -12,7 +12,6 @@ #include "base/bits.h" #include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" -#include "base/numerics/checked_math.h" #include "base/process/process_handle.h" #include "base/rand_util.h" #include "base/strings/stringprintf.h" @@ -218,18 +217,10 @@ return true; } -bool PlatformSharedMemoryRegion::MapAt(off_t offset, - size_t size, - void** memory, - size_t* mapped_size) const { - if (!IsValid()) - return false; - - size_t end_byte; - if (!CheckAdd(offset, size).AssignIfValid(&end_byte) || end_byte > size_) { - return false; - } - +bool PlatformSharedMemoryRegion::MapAtInternal(off_t offset, + size_t size, + void** memory, + size_t* mapped_size) const { bool write_allowed = mode_ != Mode::kReadOnly; // Try to map the shared memory. On the first failure, release any reserved // address space for a single entry. @@ -247,8 +238,6 @@ } *mapped_size = GetMemorySectionSize(*memory); - DCHECK_EQ(0U, - reinterpret_cast<uintptr_t>(*memory) & (kMapMinimumAlignment - 1)); return true; }
diff --git a/base/memory/shared_memory_region_unittest.cc b/base/memory/shared_memory_region_unittest.cc index bcb70e7..8b93b2a 100644 --- a/base/memory/shared_memory_region_unittest.cc +++ b/base/memory/shared_memory_region_unittest.cc
@@ -195,6 +195,11 @@ EXPECT_FALSE(mapping.IsValid()); } +TYPED_TEST(SharedMemoryRegionTest, MapZeroBytesFails) { + typename TypeParam::MappingType mapping = this->region_.MapAt(0, 0); + EXPECT_FALSE(mapping.IsValid()); +} + TYPED_TEST(SharedMemoryRegionTest, MapMoreBytesThanRegionSizeFails) { size_t region_real_size = this->region_.GetSize(); typename TypeParam::MappingType mapping =
diff --git a/base/trace_event/trace_event_unittest.cc b/base/trace_event/trace_event_unittest.cc index 30c9731..4f51f97 100644 --- a/base/trace_event/trace_event_unittest.cc +++ b/base/trace_event/trace_event_unittest.cc
@@ -1334,7 +1334,9 @@ } }; -TEST_F(TraceEventTestFixture, SelfRemovingObserver) { +// Self removing observers are not supported at the moment. +// TODO(alph): We could add support once we have recursive locks. +TEST_F(TraceEventTestFixture, DISABLED_SelfRemovingObserver) { ASSERT_EQ(0u, TraceLog::GetInstance()->GetObserverCountForTest()); SelfRemovingEnabledStateObserver observer;
diff --git a/base/trace_event/trace_log.cc b/base/trace_event/trace_log.cc index 6e8c3fc..f3d42a2e 100644 --- a/base/trace_event/trace_log.cc +++ b/base/trace_event/trace_log.cc
@@ -370,7 +370,6 @@ TraceLog::TraceLog() : enabled_modes_(0), num_traces_recorded_(0), - dispatching_to_observer_list_(false), process_sort_index_(0), process_id_hash_(0), process_id_(0), @@ -571,95 +570,90 @@ uint8_t modes_to_enable) { DCHECK(trace_config.process_filter_config().IsEnabled(process_id_)); - std::vector<EnabledStateObserver*> observer_list; - std::map<AsyncEnabledStateObserver*, RegisteredAsyncObserver> observer_map; + AutoLock lock(lock_); + + // Can't enable tracing when Flush() is in progress. + DCHECK(!flush_task_runner_); + + InternalTraceOptions new_options = + GetInternalOptionsFromTraceConfig(trace_config); + + InternalTraceOptions old_options = trace_options(); + + if (dispatching_to_observers_) { + // TODO(ssid): Change to NOTREACHED after fixing crbug.com/625170. + DLOG(ERROR) + << "Cannot manipulate TraceLog::Enabled state from an observer."; + return; + } + + // Clear all filters from previous tracing session. These filters are not + // cleared at the end of tracing because some threads which hit trace event + // when disabling, could try to use the filters. + if (!enabled_modes_) + GetCategoryGroupFilters().clear(); + + // Update trace config for recording. + const bool already_recording = enabled_modes_ & RECORDING_MODE; + if (modes_to_enable & RECORDING_MODE) { + if (already_recording) { + // TODO(ssid): Stop supporting enabling of RECORDING_MODE when already + // enabled crbug.com/625170. + DCHECK_EQ(new_options, old_options) << "Attempting to re-enable " + "tracing with a different set " + "of options."; + trace_config_.Merge(trace_config); + } else { + trace_config_ = trace_config; + } + } + + // Update event filters only if filtering was not enabled. + if (modes_to_enable & FILTERING_MODE && enabled_event_filters_.empty()) { + DCHECK(!trace_config.event_filters().empty()); + enabled_event_filters_ = trace_config.event_filters(); + } + // Keep the |trace_config_| updated with only enabled filters in case anyone + // tries to read it using |GetCurrentTraceConfig| (even if filters are + // empty). + trace_config_.SetEventFilters(enabled_event_filters_); + + enabled_modes_ |= modes_to_enable; + UpdateCategoryRegistry(); + + // Do not notify observers or create trace buffer if only enabled for + // filtering or if recording was already enabled. + if (!(modes_to_enable & RECORDING_MODE) || already_recording) + return; + + // Discard events if new trace options are different. Reducing trace buffer + // size is not supported while already recording, so only replace trace + // buffer if we were not already recording. + if (new_options != old_options || + (trace_config_.GetTraceBufferSizeInEvents() && !already_recording)) { + subtle::NoBarrier_Store(&trace_options_, new_options); + UseNextTraceBuffer(); + } + + num_traces_recorded_++; + + UpdateCategoryRegistry(); + + dispatching_to_observers_ = true; { - AutoLock lock(lock_); - - // Can't enable tracing when Flush() is in progress. - DCHECK(!flush_task_runner_); - - InternalTraceOptions new_options = - GetInternalOptionsFromTraceConfig(trace_config); - - InternalTraceOptions old_options = trace_options(); - - if (dispatching_to_observer_list_) { - // TODO(ssid): Change to NOTREACHED after fixing crbug.com/625170. - DLOG(ERROR) - << "Cannot manipulate TraceLog::Enabled state from an observer."; - return; + // Notify observers outside of the thread events lock, so they can trigger + // trace events. + AutoUnlock unlock(lock_); + AutoLock lock2(observers_lock_); + for (EnabledStateObserver* observer : enabled_state_observers_) + observer->OnTraceLogEnabled(); + for (const auto& it : async_observers_) { + it.second.task_runner->PostTask( + FROM_HERE, BindOnce(&AsyncEnabledStateObserver::OnTraceLogEnabled, + it.second.observer)); } - - // Clear all filters from previous tracing session. These filters are not - // cleared at the end of tracing because some threads which hit trace event - // when disabling, could try to use the filters. - if (!enabled_modes_) - GetCategoryGroupFilters().clear(); - - // Update trace config for recording. - const bool already_recording = enabled_modes_ & RECORDING_MODE; - if (modes_to_enable & RECORDING_MODE) { - if (already_recording) { - // TODO(ssid): Stop suporting enabling of RECODING_MODE when already - // enabled crbug.com/625170. - DCHECK_EQ(new_options, old_options) << "Attempting to re-enable " - "tracing with a different set " - "of options."; - trace_config_.Merge(trace_config); - } else { - trace_config_ = trace_config; - } - } - - // Update event filters only if filtering was not enabled. - if (modes_to_enable & FILTERING_MODE && enabled_event_filters_.empty()) { - DCHECK(!trace_config.event_filters().empty()); - enabled_event_filters_ = trace_config.event_filters(); - } - // Keep the |trace_config_| updated with only enabled filters in case anyone - // tries to read it using |GetCurrentTraceConfig| (even if filters are - // empty). - trace_config_.SetEventFilters(enabled_event_filters_); - - enabled_modes_ |= modes_to_enable; - UpdateCategoryRegistry(); - - // Do not notify observers or create trace buffer if only enabled for - // filtering or if recording was already enabled. - if (!(modes_to_enable & RECORDING_MODE) || already_recording) - return; - - // Discard events if new trace options are different. Reducing trace buffer - // size is not supported while already recording, so only replace trace - // buffer if we were not already recording. - if (new_options != old_options || - (trace_config_.GetTraceBufferSizeInEvents() && !already_recording)) { - subtle::NoBarrier_Store(&trace_options_, new_options); - UseNextTraceBuffer(); - } - - num_traces_recorded_++; - - UpdateCategoryRegistry(); - - dispatching_to_observer_list_ = true; - observer_list = enabled_state_observer_list_; - observer_map = async_observers_; } - // Notify observers outside the lock in case they trigger trace events. - for (EnabledStateObserver* observer : observer_list) - observer->OnTraceLogEnabled(); - for (const auto& it : observer_map) { - it.second.task_runner->PostTask( - FROM_HERE, BindOnce(&AsyncEnabledStateObserver::OnTraceLogEnabled, - it.second.observer)); - } - - { - AutoLock lock(lock_); - dispatching_to_observer_list_ = false; - } + dispatching_to_observers_ = false; } void TraceLog::SetArgumentFilterPredicate( @@ -710,7 +704,7 @@ if (!(enabled_modes_ & modes_to_disable)) return; - if (dispatching_to_observer_list_) { + if (dispatching_to_observers_) { // TODO(ssid): Change to NOTREACHED after fixing crbug.com/625170. DLOG(ERROR) << "Cannot manipulate TraceLog::Enabled state from an observer."; @@ -739,58 +733,68 @@ // Remove metadata events so they will not get added to a subsequent trace. metadata_events_.clear(); - dispatching_to_observer_list_ = true; - std::vector<EnabledStateObserver*> observer_list = - enabled_state_observer_list_; - std::map<AsyncEnabledStateObserver*, RegisteredAsyncObserver> observer_map = - async_observers_; - + dispatching_to_observers_ = true; { - // Dispatch to observers outside the lock in case the observer triggers a - // trace event. + // Release trace events lock, so observers can trigger trace events. AutoUnlock unlock(lock_); - for (EnabledStateObserver* observer : observer_list) - observer->OnTraceLogDisabled(); - for (const auto& it : observer_map) { + AutoLock lock2(observers_lock_); + for (auto* it : enabled_state_observers_) + it->OnTraceLogDisabled(); + for (const auto& it : async_observers_) { it.second.task_runner->PostTask( FROM_HERE, BindOnce(&AsyncEnabledStateObserver::OnTraceLogDisabled, it.second.observer)); } } - dispatching_to_observer_list_ = false; + dispatching_to_observers_ = false; } int TraceLog::GetNumTracesRecorded() { AutoLock lock(lock_); - if (!IsEnabled()) - return -1; - return num_traces_recorded_; + return IsEnabled() ? num_traces_recorded_ : -1; } void TraceLog::AddEnabledStateObserver(EnabledStateObserver* listener) { - AutoLock lock(lock_); - enabled_state_observer_list_.push_back(listener); + AutoLock lock(observers_lock_); + enabled_state_observers_.push_back(listener); } void TraceLog::RemoveEnabledStateObserver(EnabledStateObserver* listener) { - AutoLock lock(lock_); - std::vector<EnabledStateObserver*>::iterator it = - std::find(enabled_state_observer_list_.begin(), - enabled_state_observer_list_.end(), listener); - if (it != enabled_state_observer_list_.end()) - enabled_state_observer_list_.erase(it); + AutoLock lock(observers_lock_); + enabled_state_observers_.erase( + std::remove(enabled_state_observers_.begin(), + enabled_state_observers_.end(), listener), + enabled_state_observers_.end()); } void TraceLog::AddOwnedEnabledStateObserver( std::unique_ptr<EnabledStateObserver> listener) { - AutoLock lock(lock_); - enabled_state_observer_list_.push_back(listener.get()); + AutoLock lock(observers_lock_); + enabled_state_observers_.push_back(listener.get()); owned_enabled_state_observer_copy_.push_back(std::move(listener)); } bool TraceLog::HasEnabledStateObserver(EnabledStateObserver* listener) const { - AutoLock lock(lock_); - return ContainsValue(enabled_state_observer_list_, listener); + AutoLock lock(observers_lock_); + return ContainsValue(enabled_state_observers_, listener); +} + +void TraceLog::AddAsyncEnabledStateObserver( + WeakPtr<AsyncEnabledStateObserver> listener) { + AutoLock lock(observers_lock_); + async_observers_.emplace(listener.get(), RegisteredAsyncObserver(listener)); +} + +void TraceLog::RemoveAsyncEnabledStateObserver( + AsyncEnabledStateObserver* listener) { + AutoLock lock(observers_lock_); + async_observers_.erase(listener); +} + +bool TraceLog::HasAsyncEnabledStateObserver( + AsyncEnabledStateObserver* listener) const { + AutoLock lock(observers_lock_); + return ContainsKey(async_observers_, listener); } TraceLogStatus TraceLog::GetStatus() const { @@ -1724,7 +1728,7 @@ } size_t TraceLog::GetObserverCountForTest() const { - return enabled_state_observer_list_.size(); + return enabled_state_observers_.size(); } void TraceLog::SetCurrentThreadBlocksMessageLoop() { @@ -1785,25 +1789,6 @@ sizeof(*this)); } -void TraceLog::AddAsyncEnabledStateObserver( - WeakPtr<AsyncEnabledStateObserver> listener) { - AutoLock lock(lock_); - async_observers_.insert( - std::make_pair(listener.get(), RegisteredAsyncObserver(listener))); -} - -void TraceLog::RemoveAsyncEnabledStateObserver( - AsyncEnabledStateObserver* listener) { - AutoLock lock(lock_); - async_observers_.erase(listener); -} - -bool TraceLog::HasAsyncEnabledStateObserver( - AsyncEnabledStateObserver* listener) const { - AutoLock lock(lock_); - return ContainsKey(async_observers_, listener); -} - } // namespace trace_event } // namespace base
diff --git a/base/trace_event/trace_log.h b/base/trace_event/trace_log.h index db7c887..e1d233a 100644 --- a/base/trace_event/trace_log.h +++ b/base/trace_event/trace_log.h
@@ -125,7 +125,9 @@ // TraceLog::IsEnabled() is false at this point. virtual void OnTraceLogDisabled() = 0; }; + // Adds an observer. Cannot be called from within the observer callback. void AddEnabledStateObserver(EnabledStateObserver* listener); + // Removes an observer. Cannot be called from within the observer callback. void RemoveEnabledStateObserver(EnabledStateObserver* listener); // Adds an observer that is owned by TraceLog. This is useful for agents that // implement tracing feature that needs to stay alive as long as TraceLog @@ -478,12 +480,15 @@ int num_traces_recorded_; std::unique_ptr<TraceBuffer> logged_events_; std::vector<std::unique_ptr<TraceEvent>> metadata_events_; - bool dispatching_to_observer_list_; - std::vector<EnabledStateObserver*> enabled_state_observer_list_; + + // The lock protects observers access. + mutable Lock observers_lock_; + bool dispatching_to_observers_ = false; + std::vector<EnabledStateObserver*> enabled_state_observers_; std::map<AsyncEnabledStateObserver*, RegisteredAsyncObserver> async_observers_; // Manages ownership of the owned observers. The owned observers will also be - // added to |enabled_state_observer_list_|. + // added to |enabled_state_observers_|. std::vector<std::unique_ptr<EnabledStateObserver>> owned_enabled_state_observer_copy_;
diff --git a/cc/base/unique_notifier.cc b/cc/base/unique_notifier.cc index d7b59ae..2ad6a291c 100644 --- a/cc/base/unique_notifier.cc +++ b/cc/base/unique_notifier.cc
@@ -22,11 +22,13 @@ UniqueNotifier::~UniqueNotifier() = default; void UniqueNotifier::Cancel() { + DCHECK(task_runner_->RunsTasksInCurrentSequence()); base::AutoLock hold(lock_); notification_pending_ = false; } void UniqueNotifier::Schedule() { + DCHECK(task_runner_->RunsTasksInCurrentSequence()); base::AutoLock hold(lock_); if (notification_pending_) return; @@ -38,6 +40,7 @@ } void UniqueNotifier::Notify() { + DCHECK(task_runner_->RunsTasksInCurrentSequence()); // Scope to release |lock_| before running the closure. { base::AutoLock hold(lock_);
diff --git a/cc/base/unique_notifier.h b/cc/base/unique_notifier.h index e4fb7b55..d753e1f 100644 --- a/cc/base/unique_notifier.h +++ b/cc/base/unique_notifier.h
@@ -16,6 +16,8 @@ namespace cc { +// Callers must ensure that they only schedule the notifier on the same thread +// that the provided |task_runner| runs on. class CC_BASE_EXPORT UniqueNotifier { public: // Configure this notifier to issue the |closure| notification when scheduled.
diff --git a/cc/base/unique_notifier_unittest.cc b/cc/base/unique_notifier_unittest.cc index 2c54758..cfac61e 100644 --- a/cc/base/unique_notifier_unittest.cc +++ b/cc/base/unique_notifier_unittest.cc
@@ -29,6 +29,24 @@ int notification_count_; }; +// Need to guarantee that Schedule and Notify happen in the same thread. +// Multiple schedules may result in multiple runs when notify task is posted to +// a different thread. So we use thread checker to avoid this. +// Example which may result in multiple runs: +// base::Thread notifier_thread("NotifierThread"); +// notifier_thread.Start(); +// UniqueNotifier notifier( +// notifier_thread.task_runner().get(), +// base::BindRepeating(&UniqueNotifierTest::Notify, +// base::Unretained(this))); +// EXPECT_EQ(0, NotificationCount()); +// for (int i = 0; i < 50000; ++i) +// notifier.Schedule(); +// base::RunLoop().RunUntilIdle(); + +// notifier_thread.Stop(); +// EXPECT_LE(1, NotificationCount()); +// 50000 can be any number bigger than 1. The bigger the easier to more runs. TEST_F(UniqueNotifierTest, Schedule) { { UniqueNotifier notifier( @@ -43,7 +61,8 @@ base::RunLoop().RunUntilIdle(); EXPECT_EQ(1, NotificationCount()); - // Multiple schedules should only result in one run. + // UniqueNotifier can only runs in the main thread, and multiple schedules + // should result in one run. for (int i = 0; i < 5; ++i) notifier.Schedule();
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc index 283e364..a7d7f4ee 100644 --- a/cc/test/layer_tree_test.cc +++ b/cc/test/layer_tree_test.cc
@@ -429,8 +429,6 @@ test_hooks_->BeginMainFrame(args); } - void RecordEndOfFrameMetrics(base::TimeTicks) override {} - void UpdateLayerTreeHost() override { test_hooks_->UpdateLayerTreeHost(); } void ApplyViewportDeltas(const gfx::Vector2dF& inner_delta,
diff --git a/cc/test/stub_layer_tree_host_client.h b/cc/test/stub_layer_tree_host_client.h index fa24c0fa..57d56ffc 100644 --- a/cc/test/stub_layer_tree_host_client.h +++ b/cc/test/stub_layer_tree_host_client.h
@@ -17,7 +17,6 @@ void WillBeginMainFrame() override {} void DidBeginMainFrame() override {} void BeginMainFrame(const viz::BeginFrameArgs& args) override {} - void RecordEndOfFrameMetrics(base::TimeTicks) override {} void BeginMainFrameNotExpectedSoon() override {} void BeginMainFrameNotExpectedUntil(base::TimeTicks time) override {} void UpdateLayerTreeHost() override {}
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index a18aa62..716021c 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc
@@ -945,10 +945,6 @@ RecordWheelAndTouchScrollingCount(*info); } -void LayerTreeHost::RecordEndOfFrameMetrics(base::TimeTicks frame_begin_time) { - client_->RecordEndOfFrameMetrics(frame_begin_time); -} - const base::WeakPtr<InputHandler>& LayerTreeHost::GetInputHandler() const { return input_handler_weak_ptr_;
diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h index d2cd6ed..3531699 100644 --- a/cc/trees/layer_tree_host.h +++ b/cc/trees/layer_tree_host.h
@@ -536,7 +536,6 @@ // Called when the compositor completed page scale animation. void DidCompletePageScaleAnimation(); void ApplyScrollAndScale(ScrollAndScaleSet* info); - void RecordEndOfFrameMetrics(base::TimeTicks frame_begin_time); LayerTreeHostClient* client() { return client_; }
diff --git a/cc/trees/layer_tree_host_client.h b/cc/trees/layer_tree_host_client.h index 302521d..8950d17b 100644 --- a/cc/trees/layer_tree_host_client.h +++ b/cc/trees/layer_tree_host_client.h
@@ -89,9 +89,6 @@ virtual void DidPresentCompositorFrame( uint32_t frame_token, const gfx::PresentationFeedback& feedback) = 0; - // Record UMA and UKM metrics that require the time from the start of - // BeginMainFrame to the Commit, or early out. - virtual void RecordEndOfFrameMetrics(base::TimeTicks frame_begin_time) = 0; protected: virtual ~LayerTreeHostClient() {}
diff --git a/cc/trees/proxy_main.cc b/cc/trees/proxy_main.cc index c89bd779..c84c480f 100644 --- a/cc/trees/proxy_main.cc +++ b/cc/trees/proxy_main.cc
@@ -228,7 +228,6 @@ if (skip_commit) { TRACE_EVENT_INSTANT0("cc", "EarlyOut_DeferCommit_InsideBeginMainFrame", TRACE_EVENT_SCOPE_THREAD); - layer_tree_host_->RecordEndOfFrameMetrics(begin_main_frame_start_time); std::vector<std::unique_ptr<SwapPromise>> empty_swap_promises; ImplThreadTaskRunner()->PostTask( FROM_HERE, base::BindOnce(&ProxyImpl::BeginMainFrameAbortedOnImpl, @@ -275,7 +274,6 @@ current_pipeline_stage_ = COMMIT_PIPELINE_STAGE; if (final_pipeline_stage_ < COMMIT_PIPELINE_STAGE) { TRACE_EVENT_INSTANT0("cc", "EarlyOut_NoUpdates", TRACE_EVENT_SCOPE_THREAD); - layer_tree_host_->RecordEndOfFrameMetrics(begin_main_frame_start_time); std::vector<std::unique_ptr<SwapPromise>> swap_promises = layer_tree_host_->GetSwapPromiseManager()->TakeSwapPromises(); ImplThreadTaskRunner()->PostTask( @@ -310,7 +308,6 @@ // coordinated by the Scheduler. { TRACE_EVENT0("cc", "ProxyMain::BeginMainFrame::commit"); - layer_tree_host_->RecordEndOfFrameMetrics(begin_main_frame_start_time); DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_);
diff --git a/chrome/VERSION b/chrome/VERSION index 4acba0a..5a62821 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=71 MINOR=0 -BUILD=3562 +BUILD=3563 PATCH=0
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantUiController.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantUiController.java index ad5d239..b66fcea 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantUiController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantUiController.java
@@ -40,13 +40,15 @@ * @param activity The CustomTabActivity of the controller associated with. */ public AutofillAssistantUiController(CustomTabActivity activity) { - Tab activityTab = activity.getActivityTab(); + // Set mUiDelegate before nativeInit, as it can be accessed through native methods from + // nativeInit already. + mUiDelegate = new AutofillAssistantUiDelegate(activity, this); - Map<String, String> parameters = extractParameters(activity.getInitialIntent().getExtras()); // TODO(crbug.com/806868): Treat parameter // org.chromium.chrome.browser.autofill_assistant.ENABLED specially, and disable autofill // assistant if it is false or unset. - + Map<String, String> parameters = extractParameters(activity.getInitialIntent().getExtras()); + Tab activityTab = activity.getActivityTab(); mUiControllerAndroid = nativeInit(activityTab.getWebContents(), parameters.keySet().toArray(new String[parameters.size()]), parameters.values().toArray(new String[parameters.size()])); @@ -76,7 +78,6 @@ } }); - mUiDelegate = new AutofillAssistantUiDelegate(activity, this); } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityDisclosure.java b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityDisclosure.java index 5d7f38b1..52b978a1 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityDisclosure.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityDisclosure.java
@@ -7,10 +7,13 @@ import android.content.res.Resources; import org.chromium.chrome.R; +import org.chromium.chrome.browser.dependency_injection.ActivityScope; import org.chromium.chrome.browser.preferences.ChromePreferenceManager; import org.chromium.chrome.browser.snackbar.Snackbar; import org.chromium.chrome.browser.snackbar.SnackbarManager; +import javax.inject.Inject; + /** * Shows the Trusted Web Activity disclosure when appropriate and records its acceptance. * @@ -18,8 +21,11 @@ * {@link TrustedWebActivityUi}. * Thread safety: All methods on this class should be called on the UI thread. */ -/* package */ class TrustedWebActivityDisclosure { +@ActivityScope +public class TrustedWebActivityDisclosure { + // TODO(peconn): Make this package private once TrustedWebActivityUi can be injected. private final Resources mResources; + private final ChromePreferenceManager mPreferenceManager; private boolean mSnackbarShowing; @@ -38,13 +44,15 @@ */ @Override public void onAction(Object actionData) { - ChromePreferenceManager.getInstance() - .setUserAcceptedTwaDisclosureForPackage((String) actionData); + mPreferenceManager.setUserAcceptedTwaDisclosureForPackage((String) actionData); } }; - /* package */ TrustedWebActivityDisclosure(Resources resources) { + @Inject + /* package */ TrustedWebActivityDisclosure(Resources resources, + ChromePreferenceManager preferenceManager) { mResources = resources; + mPreferenceManager = preferenceManager; } /** Dismisses the Snackbar if it is showing. */ @@ -65,9 +73,8 @@ } /** Has a Snackbar been dismissed for this client package before? */ - private static boolean wasSnackbarDismissed(String packageName) { - return ChromePreferenceManager.getInstance() - .hasUserAcceptedTwaDisclosureForPackage(packageName); + private boolean wasSnackbarDismissed(String packageName) { + return mPreferenceManager.hasUserAcceptedTwaDisclosureForPackage(packageName); } private Snackbar makeRunningInChromeInfobar(String packageName) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityUi.java b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityUi.java index cb40f2b4..0952ef4 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityUi.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/TrustedWebActivityUi.java
@@ -4,7 +4,6 @@ package org.chromium.chrome.browser.browserservices; -import android.content.res.Resources; import android.support.customtabs.CustomTabsService; import org.chromium.chrome.browser.fullscreen.BrowserStateBrowserControlsVisibilityDelegate; @@ -22,6 +21,8 @@ * Thread safety: All methods on this class should be called on the UI thread. */ public class TrustedWebActivityUi { + // TODO(peconn): Convert this class to use dependency injection, when you do clean up + // CustomTabActivityComponent and TrustedWebActivityDisclosure. /** The Digital Asset Link relationship used for Trusted Web Activities. */ private final static int RELATIONSHIP = CustomTabsService.RELATION_HANDLE_ALL_URLS; @@ -94,9 +95,10 @@ /** Creates a TrustedWebActivityUi, providing a delegate from the embedder. */ - public TrustedWebActivityUi(TrustedWebActivityUiDelegate delegate, Resources resources) { + public TrustedWebActivityUi(TrustedWebActivityUiDelegate delegate, + TrustedWebActivityDisclosure disclosure) { mDelegate = delegate; - mDisclosure = new TrustedWebActivityDisclosure(resources); + mDisclosure = disclosure; } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorSurfaceManager.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorSurfaceManager.java index a74dbfd..b3fefdd 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorSurfaceManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorSurfaceManager.java
@@ -46,9 +46,9 @@ void doneWithUnownedSurface(); /** - * Destroy and re-create the surface. Useful for a JB workaround needed by CompositorView. + * Destroy and re-create the surface. */ - void recreateSurfaceForJellyBean(); + void recreateSurface(); /** * Update the background drawable on all surfaces.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorSurfaceManagerImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorSurfaceManagerImpl.java index 50834a1..f1a3a6e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorSurfaceManagerImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorSurfaceManagerImpl.java
@@ -202,7 +202,7 @@ } @Override - public void recreateSurfaceForJellyBean() { + public void recreateSurface() { // If they don't have a surface, then they'll get a new one anyway. if (mOwnedByClient == null) return;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorView.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorView.java index 982d63f..71313d4 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorView.java
@@ -317,15 +317,9 @@ mRenderHost.onCompositorLayout(); } - /* - * On JellyBean there is a known bug where a crashed producer process - * (i.e. GPU process) does not properly disconnect from the BufferQueue, - * which means we won't be able to reconnect to it ever again. - * This workaround forces the creation of a new Surface. - */ @CalledByNative - private void onJellyBeanSurfaceDisconnectWorkaround(boolean inOverlayMode) { - mCompositorSurfaceManager.recreateSurfaceForJellyBean(); + private void recreateSurface() { + mCompositorSurfaceManager.recreateSurface(); } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java index 4ab8ab9..a9b31c5 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
@@ -49,6 +49,7 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.ActivityTabTaskDescriptionHelper; import org.chromium.chrome.browser.ChromeActivity; +import org.chromium.chrome.browser.ChromeApplication; import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.IntentHandler; @@ -65,10 +66,13 @@ import org.chromium.chrome.browser.browserservices.BrowserSessionContentUtils; import org.chromium.chrome.browser.browserservices.TrustedWebActivityUi; import org.chromium.chrome.browser.compositor.layouts.LayoutManager; +import org.chromium.chrome.browser.contextual_suggestions.ContextualSuggestionsModule; import org.chromium.chrome.browser.customtabs.dynamicmodule.ActivityDelegate; import org.chromium.chrome.browser.customtabs.dynamicmodule.ActivityHostImpl; import org.chromium.chrome.browser.customtabs.dynamicmodule.ModuleEntryPoint; import org.chromium.chrome.browser.customtabs.dynamicmodule.ModuleMetrics; +import org.chromium.chrome.browser.dependency_injection.ChromeActivityCommonsModule; +import org.chromium.chrome.browser.dependency_injection.CustomTabActivityComponent; import org.chromium.chrome.browser.externalauth.ExternalAuthUtils; import org.chromium.chrome.browser.externalnav.ExternalNavigationDelegateImpl; import org.chromium.chrome.browser.firstrun.FirstRunSignInProcessor; @@ -118,7 +122,7 @@ /** * The activity for custom tabs. It will be launched on top of a client's task. */ -public class CustomTabActivity extends ChromeActivity { +public class CustomTabActivity extends ChromeActivity<CustomTabActivityComponent> { private static final String TAG = "CustomTabActivity"; private static final String LAST_URL_PREF = "pref_last_custom_tab_url"; @@ -320,7 +324,7 @@ public SnackbarManager getSnackbarManager() { return CustomTabActivity.this.getSnackbarManager(); } - }, getResources()); + }, getComponent().getTrustedWebActivityDisclosure()); } /** @@ -1565,4 +1569,11 @@ finishAndClose(false); } } + + @Override + protected CustomTabActivityComponent createComponent(ChromeActivityCommonsModule commonsModule, + ContextualSuggestionsModule contextualSuggestionsModule) { + return ChromeApplication.getComponent().createCustomTabActivityComponent(commonsModule, + contextualSuggestionsModule); + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/dependency_injection/ChromeActivityCommonsModule.java b/chrome/android/java/src/org/chromium/chrome/browser/dependency_injection/ChromeActivityCommonsModule.java index efc6cfe2..0d23f29 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/dependency_injection/ChromeActivityCommonsModule.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/dependency_injection/ChromeActivityCommonsModule.java
@@ -4,6 +4,8 @@ package org.chromium.chrome.browser.dependency_injection; +import android.content.res.Resources; + import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; import org.chromium.chrome.browser.tabmodel.TabModelSelector; @@ -57,4 +59,9 @@ // a lot of code is coupled specifically to ChromeActivity. return mActivity; } + + @Provides + public Resources provideResources() { + return mActivity.getResources(); + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/dependency_injection/ChromeActivityComponent.java b/chrome/android/java/src/org/chromium/chrome/browser/dependency_injection/ChromeActivityComponent.java index a151a251..c02eb36 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/dependency_injection/ChromeActivityComponent.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/dependency_injection/ChromeActivityComponent.java
@@ -10,7 +10,7 @@ import dagger.Subcomponent; /** - * Activity-scoped component associated with {@link org.chromium.chrome.browser.ChromeActivity} + * Activity-scoped component associated with {@link org.chromium.chrome.browser.ChromeActivity}. */ @Subcomponent(modules = {ChromeActivityCommonsModule.class, ContextualSuggestionsModule.class}) @ActivityScope
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/dependency_injection/ChromeAppComponent.java b/chrome/android/java/src/org/chromium/chrome/browser/dependency_injection/ChromeAppComponent.java index d903a08..cab77b0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/dependency_injection/ChromeAppComponent.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/dependency_injection/ChromeAppComponent.java
@@ -20,6 +20,9 @@ ChromeActivityComponent createChromeActivityComponent(ChromeActivityCommonsModule module, ContextualSuggestionsModule contextualSuggestionsModule); + CustomTabActivityComponent createCustomTabActivityComponent(ChromeActivityCommonsModule module, + ContextualSuggestionsModule contextualSuggestionsModule); + // Temporary getters for DI migration process. All of these getters // should eventually be replaced with constructor injection. EnabledStateMonitor getContextualSuggestionsEnabledStateMonitor();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/dependency_injection/ChromeAppModule.java b/chrome/android/java/src/org/chromium/chrome/browser/dependency_injection/ChromeAppModule.java index bcde8dd..16a9d25 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/dependency_injection/ChromeAppModule.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/dependency_injection/ChromeAppModule.java
@@ -8,6 +8,7 @@ import org.chromium.chrome.browser.contextual_suggestions.EnabledStateMonitor; import org.chromium.chrome.browser.contextual_suggestions.EnabledStateMonitorImpl; +import org.chromium.chrome.browser.preferences.ChromePreferenceManager; import org.chromium.chrome.browser.profiles.Profile; import javax.inject.Named; @@ -35,4 +36,9 @@ public EnabledStateMonitor provideEnabledStateMonitor() { return new EnabledStateMonitorImpl(); } + + @Provides + public ChromePreferenceManager providesChromePreferenceManager() { + return ChromePreferenceManager.getInstance(); + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/dependency_injection/CustomTabActivityComponent.java b/chrome/android/java/src/org/chromium/chrome/browser/dependency_injection/CustomTabActivityComponent.java new file mode 100644 index 0000000..9b36baf --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/dependency_injection/CustomTabActivityComponent.java
@@ -0,0 +1,20 @@ +// 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.dependency_injection; + +import org.chromium.chrome.browser.browserservices.TrustedWebActivityDisclosure; +import org.chromium.chrome.browser.contextual_suggestions.ContextualSuggestionsModule; + +import dagger.Subcomponent; + +/** + * Activity-scoped component associated with + * {@link org.chromium.chrome.browser.customtabs.CustomTabActivity}. + */ +@Subcomponent(modules = {ChromeActivityCommonsModule.class, ContextualSuggestionsModule.class}) +@ActivityScope +public interface CustomTabActivityComponent extends ChromeActivityComponent { + TrustedWebActivityDisclosure getTrustedWebActivityDisclosure(); +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunFlowSequencer.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunFlowSequencer.java index e9ab1c2..af7feb746 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunFlowSequencer.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunFlowSequencer.java
@@ -108,7 +108,8 @@ @VisibleForTesting protected boolean isSyncAllowed() { SigninManager signinManager = SigninManager.get(); - return FeatureUtilities.canAllowSync(mActivity) && signinManager.isSigninSupported(); + return FeatureUtilities.canAllowSync(mActivity) && !signinManager.isSigninDisabledByPolicy() + && signinManager.isSigninSupported(); } @VisibleForTesting
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/SignInPreference.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/SignInPreference.java index 983f8ac0..266afb85 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/SignInPreference.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/SignInPreference.java
@@ -155,6 +155,11 @@ /** Updates the title, summary, and image based on the current sign-in state. */ private void update() { + if (SigninManager.get().isSigninDisabledByPolicy()) { + setupSigninDisabled(); + return; + } + String accountName = ChromeSigninController.get().getSignedInAccountName(); if (accountName != null) { setupSignedIn(accountName);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountManagementFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountManagementFragment.java index 2d2e1e6..5e3f6d1 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountManagementFragment.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountManagementFragment.java
@@ -142,7 +142,7 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); - ListView list = (ListView) getView().findViewById(android.R.id.list); + ListView list = getView().findViewById(android.R.id.list); list.setDivider(null); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountPickerDialogFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountPickerDialogFragment.java index 5a6d22e..10ccee78 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountPickerDialogFragment.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountPickerDialogFragment.java
@@ -117,11 +117,10 @@ return new ViewHolder(view); } View view = inflater.inflate(R.layout.account_picker_row, viewGroup, false); - ImageView accountImage = (ImageView) view.findViewById(R.id.account_image); - TextView accountTextPrimary = (TextView) view.findViewById(R.id.account_text_primary); - TextView accountTextSecondary = - (TextView) view.findViewById(R.id.account_text_secondary); - ImageView selectionMark = (ImageView) view.findViewById(R.id.account_selection_mark); + ImageView accountImage = view.findViewById(R.id.account_image); + TextView accountTextPrimary = view.findViewById(R.id.account_text_primary); + TextView accountTextSecondary = view.findViewById(R.id.account_text_secondary); + ImageView selectionMark = view.findViewById(R.id.account_selection_mark); return new ViewHolder( view, accountImage, accountTextPrimary, accountTextSecondary, selectionMark); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninActivity.java index ebbac77f..5f405ae 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninActivity.java
@@ -15,6 +15,7 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.SynchronousInitializationActivity; +import org.chromium.chrome.browser.preferences.ManagedPreferencesUtils; import org.chromium.chrome.browser.preferences.PrefServiceBridge; import org.chromium.chrome.browser.preferences.PreferencesLauncher; import org.chromium.chrome.browser.signin.SigninManager.SignInCallback; @@ -59,6 +60,9 @@ */ public static boolean startIfAllowed(Context context, @AccessPoint int accessPoint) { if (!SigninManager.get().isSignInAllowed()) { + if (SigninManager.get().isSigninDisabledByPolicy()) { + ManagedPreferencesUtils.showManagedByAdministratorToast(context); + } return false; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninChooseView.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninChooseView.java index ee8118d8..6c6fa73 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninChooseView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninChooseView.java
@@ -45,8 +45,7 @@ @Override protected void onFinishInflate() { super.onFinishInflate(); - mRootChildView = - (LinearLayout) findViewById(R.id.account_signin_choose_view_root_child_view); + mRootChildView = findViewById(R.id.account_signin_choose_view_root_child_view); mAccountViewStartIndex = mRootChildView.getChildCount(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninView.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninView.java index 828d4c2..4822c8f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninView.java
@@ -300,27 +300,25 @@ protected void onFinishInflate() { super.onFinishInflate(); - mSigninChooseView = (AccountSigninChooseView) findViewById(R.id.account_signin_choose_view); + mSigninChooseView = findViewById(R.id.account_signin_choose_view); mSigninChooseView.setAddNewAccountObserver(() -> { mListener.onNewAccount(); RecordUserAction.record("Signin_AddAccountToDevice"); }); - mPositiveButton = (ButtonCompat) findViewById(R.id.positive_button); - mNegativeButton = (Button) findViewById(R.id.negative_button); - mMoreButton = (Button) findViewById(R.id.more_button); - mSigninConfirmationView = - (AccountSigninConfirmationView) findViewById(R.id.signin_confirmation_view); - mSigninAccountImage = (ImageView) findViewById(R.id.signin_account_image); - mSigninAccountName = (TextView) findViewById(R.id.signin_account_name); - mSigninAccountEmail = (TextView) findViewById(R.id.signin_account_email); - mSigninSyncTitle = (TextView) findViewById(R.id.signin_sync_title); - mSigninSyncDescription = (TextView) findViewById(R.id.signin_sync_description); - mSigninPersonalizeServiceTitle = - (TextView) findViewById(R.id.signin_personalize_service_title); + mPositiveButton = findViewById(R.id.positive_button); + mNegativeButton = findViewById(R.id.negative_button); + mMoreButton = findViewById(R.id.more_button); + mSigninConfirmationView = findViewById(R.id.signin_confirmation_view); + mSigninAccountImage = findViewById(R.id.signin_account_image); + mSigninAccountName = findViewById(R.id.signin_account_name); + mSigninAccountEmail = findViewById(R.id.signin_account_email); + mSigninSyncTitle = findViewById(R.id.signin_sync_title); + mSigninSyncDescription = findViewById(R.id.signin_sync_description); + mSigninPersonalizeServiceTitle = findViewById(R.id.signin_personalize_service_title); mSigninPersonalizeServiceDescription = - (TextView) findViewById(R.id.signin_personalize_service_description); - mSigninSettingsControl = (TextView) findViewById(R.id.signin_settings_control); + findViewById(R.id.signin_personalize_service_description); + mSigninSettingsControl = findViewById(R.id.signin_settings_control); // For the spans to be clickable. mSigninSettingsControl.setMovementMethod(LinkMovementMethod.getInstance()); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/ConfirmImportSyncDataDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/ConfirmImportSyncDataDialog.java index 046ca2e5..2727dd3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/ConfirmImportSyncDataDialog.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/ConfirmImportSyncDataDialog.java
@@ -129,13 +129,11 @@ LayoutInflater inflater = getActivity().getLayoutInflater(); View v = inflater.inflate(R.layout.confirm_import_sync_data, null); - TextView prompt = (TextView) v.findViewById(R.id.sync_import_data_prompt); + TextView prompt = v.findViewById(R.id.sync_import_data_prompt); prompt.setText(getActivity().getString(R.string.sync_import_data_prompt, oldAccountName)); - mConfirmImportOption = (RadioButtonWithDescription) - v.findViewById(R.id.sync_confirm_import_choice); - mKeepSeparateOption = (RadioButtonWithDescription) - v.findViewById(R.id.sync_keep_separate_choice); + mConfirmImportOption = v.findViewById(R.id.sync_confirm_import_choice); + mKeepSeparateOption = v.findViewById(R.id.sync_keep_separate_choice); mConfirmImportOption.setDescriptionText(getActivity().getString( R.string.sync_import_existing_data_subtext, newAccountName)); @@ -169,7 +167,7 @@ if (importSyncType == ImportSyncType.SWITCHING_SYNC_ACCOUNTS) { // Re-order the buttons so that Import Data is last and Don't Import (the default) is // at the top. - LinearLayout layout = (LinearLayout) v.findViewById(R.id.sync_import_data_content); + LinearLayout layout = v.findViewById(R.id.sync_import_data_content); layout.removeView(mConfirmImportOption); layout.addView(mConfirmImportOption); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/PersonalizedSigninPromoView.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/PersonalizedSigninPromoView.java index 0cd5b551..6f32dca 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/PersonalizedSigninPromoView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/PersonalizedSigninPromoView.java
@@ -33,11 +33,11 @@ protected void onFinishInflate() { super.onFinishInflate(); - mImage = (ImageView) findViewById(R.id.signin_promo_image); - mDismissButton = (ImageButton) findViewById(R.id.signin_promo_close_button); - mDescription = (TextView) findViewById(R.id.signin_promo_description); - mSigninButton = (ButtonCompat) findViewById(R.id.signin_promo_signin_button); - mChooseAccountButton = (Button) findViewById(R.id.signin_promo_choose_account_button); + mImage = findViewById(R.id.signin_promo_image); + mDismissButton = findViewById(R.id.signin_promo_close_button); + mDescription = findViewById(R.id.signin_promo_description); + mSigninButton = findViewById(R.id.signin_promo_signin_button); + mChooseAccountButton = findViewById(R.id.signin_promo_choose_account_button); } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninManager.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninManager.java index 7385971..d32619b0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninManager.java
@@ -72,6 +72,8 @@ */ private SignInState mSignInState; + private boolean mSigninAllowedByPolicy; + /** * Set during sign-out process and nulled out once complete. Helps to atomically gather/clear * various sign-out state. @@ -222,6 +224,7 @@ ThreadUtils.assertOnUiThread(); mContext = ContextUtils.getApplicationContext(); mNativeSigninManagerAndroid = nativeInit(); + mSigninAllowedByPolicy = nativeIsSigninAllowedByPolicy(mNativeSigninManagerAndroid); AccountTrackerService.get().addSystemAccountsSeededListener(this); } @@ -259,11 +262,18 @@ * Returns true if signin can be started now. */ public boolean isSignInAllowed() { - return !mFirstRunCheckIsPending && mSignInState == null + return !mFirstRunCheckIsPending && mSignInState == null && mSigninAllowedByPolicy && ChromeSigninController.get().getSignedInUser() == null && isSigninSupported(); } /** + * Returns true if signin is disabled by policy. + */ + public boolean isSigninDisabledByPolicy() { + return !mSigninAllowedByPolicy; + } + + /** * @return Whether true if the current user is not demo user and the user has a reasonable * Google Play Services installed. */ @@ -681,6 +691,12 @@ return nativeIsSignedInOnNative(mNativeSigninManagerAndroid); } + @CalledByNative + private void onSigninAllowedByPolicyChanged(boolean newSigninAllowedByPolicy) { + mSigninAllowedByPolicy = newSigninAllowedByPolicy; + notifySignInAllowedChanged(); + } + /** * Performs an asynchronous check to see if the user is a managed user. * @param callback A callback to be called with true if the user is a managed user and false @@ -710,6 +726,8 @@ @VisibleForTesting native long nativeInit(); @VisibleForTesting + native boolean nativeIsSigninAllowedByPolicy(long nativeSigninManagerAndroid); + @VisibleForTesting native boolean nativeIsForceSigninEnabled(long nativeSigninManagerAndroid); @VisibleForTesting native void nativeCheckPolicyBeforeSignIn(long nativeSigninManagerAndroid, String username);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninView.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninView.java index ecac88d2..82123143 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninView.java
@@ -49,23 +49,21 @@ protected void onFinishInflate() { super.onFinishInflate(); - mScrollView = (SigninScrollView) findViewById(R.id.signin_scroll_view); - mHeaderImage = (ImageView) findViewById(R.id.signin_header_image); - mTitle = (TextView) findViewById(R.id.signin_title); + mScrollView = findViewById(R.id.signin_scroll_view); + mHeaderImage = findViewById(R.id.signin_header_image); + mTitle = findViewById(R.id.signin_title); mAccountPicker = findViewById(R.id.signin_account_picker); - mAccountImage = (ImageView) findViewById(R.id.account_image); - mAccountTextPrimary = (TextView) findViewById(R.id.account_text_primary); - mAccountTextSecondary = (TextView) findViewById(R.id.account_text_secondary); - mAccountPickerEndImage = (ImageView) findViewById(R.id.account_picker_end_image); - mSyncDescription = (TextView) findViewById(R.id.signin_sync_description); - mPersonalizationDescription = - (TextView) findViewById(R.id.signin_personalization_description); - mGoogleServicesDescription = - (TextView) findViewById(R.id.signin_google_services_description); - mDetailsDescription = (TextView) findViewById(R.id.signin_details_description); - mAcceptButton = (ButtonCompat) findViewById(R.id.positive_button); - mRefuseButton = (Button) findViewById(R.id.negative_button); - mMoreButton = (Button) findViewById(R.id.more_button); + mAccountImage = findViewById(R.id.account_image); + mAccountTextPrimary = findViewById(R.id.account_text_primary); + mAccountTextSecondary = findViewById(R.id.account_text_secondary); + mAccountPickerEndImage = findViewById(R.id.account_picker_end_image); + mSyncDescription = findViewById(R.id.signin_sync_description); + mPersonalizationDescription = findViewById(R.id.signin_personalization_description); + mGoogleServicesDescription = findViewById(R.id.signin_google_services_description); + mDetailsDescription = findViewById(R.id.signin_details_description); + mAcceptButton = findViewById(R.id.positive_button); + mRefuseButton = findViewById(R.id.negative_button); + mMoreButton = findViewById(R.id.more_button); mAcceptButtonEndPadding = findViewById(R.id.positive_button_end_padding); mAnimationLooper = AnimationLooper.create(mHeaderImage.getDrawable());
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SyncPromoView.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/SyncPromoView.java index 0415090..0cd27f1 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SyncPromoView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SyncPromoView.java
@@ -63,9 +63,9 @@ protected void onFinishInflate() { super.onFinishInflate(); - mTitle = (TextView) findViewById(R.id.title); - mDescription = (TextView) findViewById(R.id.description); - mPositiveButton = (Button) findViewById(R.id.sign_in); + mTitle = findViewById(R.id.title); + mDescription = findViewById(R.id.description); + mPositiveButton = findViewById(R.id.sign_in); } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr/VrCompositorSurfaceManager.java b/chrome/android/java/src/org/chromium/chrome/browser/vr/VrCompositorSurfaceManager.java index 4ed91fa6..7bae546 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/vr/VrCompositorSurfaceManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/vr/VrCompositorSurfaceManager.java
@@ -94,7 +94,7 @@ public void doneWithUnownedSurface() {} @Override - public void recreateSurfaceForJellyBean() {} + public void recreateSurface() {} @Override public void setBackgroundDrawable(Drawable background) {}
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni index 458f0a4..23ab067 100644 --- a/chrome/android/java_sources.gni +++ b/chrome/android/java_sources.gni
@@ -408,6 +408,7 @@ "java/src/org/chromium/chrome/browser/dependency_injection/ChromeAppComponent.java", "java/src/org/chromium/chrome/browser/dependency_injection/ChromeAppModule.java", "java/src/org/chromium/chrome/browser/dependency_injection/ChromeCommonQualifiers.java", + "java/src/org/chromium/chrome/browser/dependency_injection/CustomTabActivityComponent.java", "java/src/org/chromium/chrome/browser/dependency_injection/ModuleFactoryOverrides.java", "java/src/org/chromium/chrome/browser/device/DeviceClassManager.java", "java/src/org/chromium/chrome/browser/display_cutout/DisplayCutoutController.java",
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/compositor/CompositorSurfaceManagerImplTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/compositor/CompositorSurfaceManagerImplTest.java index a133985..33938aa1 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/compositor/CompositorSurfaceManagerImplTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/compositor/CompositorSurfaceManagerImplTest.java
@@ -389,8 +389,8 @@ @Test @Feature("Compositor") @Config(shadows = {MyShadowSurfaceView.class}) - public void testJellyBeanWorkaround() { - // See if recreateSurfaceForJellyBean destroys / re-creates the surface. + public void testRecreateSurface() { + // See if recreateSurface destroys / re-creates the surface. // should get a synthetic 'created', but a real 'changed' callback. SurfaceView opaque = requestThenCreateSurface(PixelFormat.OPAQUE); verify(mCallback, times(1)).surfaceCreated(opaque.getHolder().getSurface()); @@ -398,7 +398,7 @@ // We should be notified that the surface was destroyed via synthetic callback, and the // surface should be detached. - mManager.recreateSurfaceForJellyBean(); + mManager.recreateSurface(); verify(mCallback, times(1)).surfaceCreated(opaque.getHolder().getSurface()); verify(mCallback, times(1)).surfaceDestroyed(opaque.getHolder().getSurface()); assertEquals(0, mLayout.getChildCount());
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/signin/SigninManagerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/signin/SigninManagerTest.java index 5fd5cf95..6718276 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/signin/SigninManagerTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/signin/SigninManagerTest.java
@@ -37,6 +37,11 @@ long nativeInit() { return 0; } + + @Override + boolean nativeIsSigninAllowedByPolicy(long nativeSigninManagerAndroid) { + return true; + } } @Spy
diff --git a/chrome/app/chrome_command_ids.h b/chrome/app/chrome_command_ids.h index 101b0f89..713ac2d 100644 --- a/chrome/app/chrome_command_ids.h +++ b/chrome/app/chrome_command_ids.h
@@ -151,6 +151,9 @@ #define IDC_SHOW_KEYBOARD_OVERLAY 40027 #define IDC_PROFILING_ENABLED 40028 #define IDC_BOOKMARKS_MENU 40029 +// TODO(atwilson): Remove IDC_SHOW_SYNC_SETUP when we officially allow signin +// when sync is disabled. +#define IDC_SHOW_SYNC_SETUP 40030 #define IDC_SHOW_SIGNIN 40030 #define IDC_EXTENSION_ERRORS 40031 #define IDC_SHOW_SIGNIN_ERROR 40032
diff --git a/chrome/app/chromium_strings.grd b/chrome/app/chromium_strings.grd index 3ed2470..a96b625 100644 --- a/chrome/app/chromium_strings.grd +++ b/chrome/app/chromium_strings.grd
@@ -1164,7 +1164,7 @@ Not now </message> <message name="IDS_DICE_WELCOME_DESCRIPTION" desc="A message on the welcome page explaining the purpose of signing in."> - Sign in to sync and personalize Chromium across your devices + Sync and personalize Chromium across your devices </message> </if>
diff --git a/chrome/app/google_chrome_strings.grd b/chrome/app/google_chrome_strings.grd index 1c38a0f..7a954f8838 100644 --- a/chrome/app/google_chrome_strings.grd +++ b/chrome/app/google_chrome_strings.grd
@@ -1182,7 +1182,7 @@ Not now </message> <message name="IDS_DICE_WELCOME_DESCRIPTION" desc="A message on the welcome page explaining the purpose of signing in."> - Sign in to sync and personalize Chrome across your devices + Sync and personalize Chrome across your devices </message> </if>
diff --git a/chrome/app/profiles_strings.grdp b/chrome/app/profiles_strings.grdp index b307c01c..3306d87 100644 --- a/chrome/app/profiles_strings.grdp +++ b/chrome/app/profiles_strings.grdp
@@ -73,7 +73,10 @@ Syncing to </message> <message name="IDS_PROFILES_DICE_SIGNIN_BUTTON" desc="Button in the profile user menu to sign in and turn on Sync."> - Sign in + Turn on sync... + </message> + <message name="IDS_PROFILES_DICE_NOT_SYNCING_TITLE" desc="Title of the sync promo account card in the user menu."> + Not syncing </message> <message name="IDS_PROFILES_DICE_SIGNIN_FIRST_ACCOUNT_BUTTON" desc="Button to sign in and turn on Sync for a specific web account."> Sync as <ph name="ACCOUNT_FULL_NAME">$1<ex>John Doe</ex></ph>
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index a6725c4b..cc2151f 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -873,6 +873,17 @@ {"(bold)", kAutofillPrimaryInfoStyleBold, base::size(kAutofillPrimaryInfoStyleBold), nullptr}, }; + +const FeatureEntry::FeatureParam kPedalSuggestionInSuggestion[] = { + {OmniboxFieldTrial::kPedalSuggestionModeParam, "in_suggestion"}}; +const FeatureEntry::FeatureParam kPedalSuggestionDedicated[] = { + {OmniboxFieldTrial::kPedalSuggestionModeParam, "dedicated"}}; +const FeatureEntry::FeatureVariation kPedalSuggestionVariations[] = { + {"In Suggestion (Side Button)", kPedalSuggestionInSuggestion, + base::size(kPedalSuggestionInSuggestion), nullptr}, + {"Dedicated Suggestion Line", kPedalSuggestionDedicated, + base::size(kPedalSuggestionDedicated), nullptr}, +}; #endif // defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) const FeatureEntry::Choice kAutoplayPolicyChoices[] = { @@ -2319,6 +2330,9 @@ flag_descriptions::kEnableDesktopPWAsLinkCapturingName, flag_descriptions::kEnableDesktopPWAsLinkCapturingDescription, kOsDesktop, FEATURE_VALUE_TYPE(features::kDesktopPWAsLinkCapturing)}, + {"enable-system-webapps", flag_descriptions::kEnableSystemWebAppsName, + flag_descriptions::kEnableSystemWebAppsDescription, kOsDesktop, + FEATURE_VALUE_TYPE(features::kSystemWebApps)}, {"use-sync-sandbox", flag_descriptions::kSyncSandboxName, flag_descriptions::kSyncSandboxDescription, kOsAll, SINGLE_VALUE_TYPE_AND_VALUE( @@ -3219,6 +3233,12 @@ flag_descriptions::kOmniboxTabSwitchSuggestionsName, flag_descriptions::kOmniboxTabSwitchSuggestionsDescription, kOsDesktop, FEATURE_VALUE_TYPE(omnibox::kOmniboxTabSwitchSuggestions)}, + {"omnibox-pedal-suggestions", + flag_descriptions::kOmniboxPedalSuggestionsName, + flag_descriptions::kOmniboxPedalSuggestionsDescription, kOsDesktop, + FEATURE_WITH_PARAMS_VALUE_TYPE(omnibox::kOmniboxPedalSuggestions, + kPedalSuggestionVariations, + "PedalSuggestionVariations")}, {"enable-new-app-menu-icon", flag_descriptions::kEnableNewAppMenuIconName, flag_descriptions::kEnableNewAppMenuIconDescription, kOsDesktop, FEATURE_VALUE_TYPE(features::kAnimatedAppMenuIcon)},
diff --git a/chrome/browser/android/compositor/compositor_view.cc b/chrome/browser/android/compositor/compositor_view.cc index c1e6d959..ae97d5e5 100644 --- a/chrome/browser/android/compositor/compositor_view.cc +++ b/chrome/browser/android/compositor/compositor_view.cc
@@ -116,6 +116,12 @@ return compositor_->GetResourceManager().GetJavaObject(); } +void CompositorView::RecreateSurface() { + JNIEnv* env = base::android::AttachCurrentThread(); + compositor_->SetSurface(nullptr); + Java_CompositorView_recreateSurface(env, obj_); +} + void CompositorView::UpdateLayerTreeHost() { JNIEnv* env = base::android::AttachCurrentThread(); // TODO(wkorman): Rename JNI interface to onCompositorUpdateLayerTreeHost. @@ -261,8 +267,7 @@ data.process_type == content::PROCESS_TYPE_GPU) { JNIEnv* env = base::android::AttachCurrentThread(); compositor_->SetSurface(nullptr); - Java_CompositorView_onJellyBeanSurfaceDisconnectWorkaround( - env, obj_, overlay_video_mode_); + Java_CompositorView_recreateSurface(env, obj_); } }
diff --git a/chrome/browser/android/compositor/compositor_view.h b/chrome/browser/android/compositor/compositor_view.h index d994948..6a68ac7 100644 --- a/chrome/browser/android/compositor/compositor_view.h +++ b/chrome/browser/android/compositor/compositor_view.h
@@ -20,7 +20,7 @@ namespace cc { class Layer; class SolidColorLayer; -} +} // namespace cc namespace content { class Compositor; @@ -30,7 +30,7 @@ class WindowAndroid; class ResourceManager; class UIResourceProvider; -} +} // namespace ui namespace android { @@ -87,6 +87,7 @@ const base::android::JavaParamRef<jobject>& window_android); // CompositorClient implementation: + void RecreateSurface() override; void UpdateLayerTreeHost() override; void DidSwapFrame(int pending_frames) override; void DidSwapBuffers(const gfx::Size& swap_size) override;
diff --git a/chrome/browser/android/signin/signin_manager_android.cc b/chrome/browser/android/signin/signin_manager_android.cc index 157a51c..175e860 100644 --- a/chrome/browser/android/signin/signin_manager_android.cc +++ b/chrome/browser/android/signin/signin_manager_android.cc
@@ -142,6 +142,11 @@ profile_ = ProfileManager::GetActiveUserProfile(); DCHECK(profile_); SigninManagerFactory::GetForProfile(profile_)->AddObserver(this); + pref_change_registrar_.Init(profile_->GetPrefs()); + pref_change_registrar_.Add( + prefs::kSigninAllowed, + base::Bind(&SigninManagerAndroid::OnSigninAllowedPrefChanged, + base::Unretained(this))); } SigninManagerAndroid::~SigninManagerAndroid() {} @@ -301,6 +306,12 @@ ->ValidateAccounts(primary_acct, true); } +jboolean SigninManagerAndroid::IsSigninAllowedByPolicy( + JNIEnv* env, + const JavaParamRef<jobject>& obj) { + return SigninManagerFactory::GetForProfile(profile_)->IsSigninAllowed(); +} + jboolean SigninManagerAndroid::IsForceSigninEnabled( JNIEnv* env, const JavaParamRef<jobject>& obj) { @@ -335,6 +346,12 @@ java_signin_manager_); } +void SigninManagerAndroid::OnSigninAllowedPrefChanged() { + Java_SigninManager_onSigninAllowedByPolicyChanged( + base::android::AttachCurrentThread(), java_signin_manager_, + SigninManagerFactory::GetForProfile(profile_)->IsSigninAllowed()); +} + // static void SigninManagerAndroid::WipeData(Profile* profile, bool all_data,
diff --git a/chrome/browser/android/signin/signin_manager_android.h b/chrome/browser/android/signin/signin_manager_android.h index c192217..2596442 100644 --- a/chrome/browser/android/signin/signin_manager_android.h +++ b/chrome/browser/android/signin/signin_manager_android.h
@@ -12,6 +12,7 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/threading/thread_checker.h" +#include "components/prefs/pref_change_registrar.h" #include "components/signin/core/browser/signin_manager_base.h" class Profile; @@ -68,6 +69,10 @@ void ClearLastSignedInUser(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); + jboolean IsSigninAllowedByPolicy( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj); + jboolean IsForceSigninEnabled( JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); @@ -99,6 +104,8 @@ void OnBrowsingDataRemoverDone(); + void OnSigninAllowedPrefChanged(); + static void WipeData(Profile* profile, bool all_data, base::OnceClosure callback); @@ -117,6 +124,8 @@ // for the policy dialog, when |username_| corresponds to a managed account. std::string username_; + PrefChangeRegistrar pref_change_registrar_; + base::ThreadChecker thread_checker_; base::WeakPtrFactory<SigninManagerAndroid> weak_factory_;
diff --git a/chrome/browser/chromeos/crostini/crostini_share_path.cc b/chrome/browser/chromeos/crostini/crostini_share_path.cc index ca585d9..27cd4565 100644 --- a/chrome/browser/chromeos/crostini/crostini_share_path.cc +++ b/chrome/browser/chromeos/crostini/crostini_share_path.cc
@@ -13,6 +13,7 @@ #include "chrome/browser/chromeos/crostini/crostini_util.h" #include "chrome/browser/chromeos/file_manager/path_util.h" #include "chrome/browser/profiles/profile.h" +#include "chromeos/chromeos_switches.h" #include "chromeos/dbus/concierge/service.pb.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/seneschal_client.h" @@ -102,6 +103,10 @@ base::OnceCallback<void(bool, std::string)> callback) { DCHECK(profile); DCHECK(callback); + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( + chromeos::switches::kCrostiniFiles)) { + std::move(callback).Run(false, "Flag crostini-files not enabled"); + } // TODO(joelhockey): Save new path into prefs once management UI is ready. CallSeneschalSharePath(profile, vm_name, path, std::move(callback)); } @@ -109,6 +114,10 @@ std::vector<std::string> GetSharedPaths(Profile* profile) { DCHECK(profile); std::vector<std::string> result; + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( + chromeos::switches::kCrostiniFiles)) { + return result; + } const base::ListValue* shared_paths = profile->GetPrefs()->GetList(prefs::kCrostiniSharedPaths); for (const auto& path : *shared_paths) {
diff --git a/chrome/browser/chromeos/crostini/crostini_share_path_unittest.cc b/chrome/browser/chromeos/crostini/crostini_share_path_unittest.cc index 3ba9b74..95e42850 100644 --- a/chrome/browser/chromeos/crostini/crostini_share_path_unittest.cc +++ b/chrome/browser/chromeos/crostini/crostini_share_path_unittest.cc
@@ -14,6 +14,7 @@ #include "chrome/browser/chromeos/crostini/crostini_util.h" #include "chrome/browser/chromeos/file_manager/path_util.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/chromeos_switches.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/fake_cicerone_client.h" #include "chromeos/dbus/fake_concierge_client.h" @@ -99,6 +100,9 @@ run_loop_ = std::make_unique<base::RunLoop>(); profile_ = std::make_unique<TestingProfile>(); + base::CommandLine::ForCurrentProcess()->AppendSwitch( + chromeos::switches::kCrostiniFiles); + // Fake that this is a real ChromeOS system in order to use TestingProfile // /tmp path for Downloads rather than the current Linux user $HOME. // SetChromeOSVersionInfoForTest() must not be called until D-Bus is
diff --git a/chrome/browser/chromeos/extensions/file_manager/file_manager_private_apitest.cc b/chrome/browser/chromeos/extensions/file_manager/file_manager_private_apitest.cc index d61e74e..7613bfc 100644 --- a/chrome/browser/chromeos/extensions/file_manager/file_manager_private_apitest.cc +++ b/chrome/browser/chromeos/extensions/file_manager/file_manager_private_apitest.cc
@@ -28,6 +28,7 @@ #include "chrome/common/chrome_features.h" #include "chrome/common/extensions/api/file_system_provider_capabilities/file_system_provider_capabilities_handler.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/chromeos_switches.h" #include "chromeos/dbus/concierge/service.pb.h" #include "chromeos/dbus/cros_disks_client.h" #include "chromeos/disks/disk.h" @@ -352,6 +353,8 @@ crostini::prefs::kCrostiniEnabled, true); scoped_feature_list->InitWithFeatures( {features::kCrostini, features::kExperimentalCrostiniUI}, {}); + base::CommandLine::ForCurrentProcess()->AppendSwitch( + chromeos::switches::kCrostiniFiles); // Profile must be signed in with email for crostini. identity::SetPrimaryAccount( SigninManagerFactory::GetForProfileIfExists(browser()->profile()),
diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc index 7b5bcb6..3f2f90f 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc
@@ -11,8 +11,12 @@ #include "base/base64.h" #include "base/command_line.h" +#include "base/i18n/string_search.h" #include "base/memory/ptr_util.h" #include "base/strings/strcat.h" +#include "base/strings/string_piece.h" +#include "base/strings/string_split.h" +#include "base/strings/utf_string_conversions.h" #include "base/task/post_task.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/drive/drive_integration_service.h" @@ -35,6 +39,7 @@ #include "chromeos/chromeos_switches.h" #include "chromeos/network/network_handler.h" #include "chromeos/network/network_state_handler.h" +#include "components/drive/chromeos/search_metadata.h" #include "components/drive/event_logger.h" #include "components/signin/core/browser/profile_oauth2_token_service.h" #include "components/signin/core/browser/signin_manager.h" @@ -699,8 +704,10 @@ properties_->can_share = std::make_unique<bool>(metadata->capabilities->can_share); - properties_->thumbnail_url = std::make_unique<std::string>( - base::StrCat({"drivefs:", file_system_url_.ToGURL().spec()})); + if (metadata->type != drivefs::mojom::FileMetadata::Type::kDirectory) { + properties_->thumbnail_url = std::make_unique<std::string>( + base::StrCat({"drivefs:", file_system_url_.ToGURL().spec()})); + } CompleteGetEntryProperties(drive::FILE_ERROR_OK); } @@ -1248,18 +1255,34 @@ this, std::move(query), filter_dirs, base::BindOnce( &FileManagerPrivateSearchDriveMetadataFunction::OnSearchDriveFs, - this)); + this, params->search_params.query)); } return true; } void FileManagerPrivateSearchDriveMetadataFunction::OnSearchDriveFs( + const std::string& query_text, std::unique_ptr<base::ListValue> results) { if (!results) { SendResponse(false); return; } + std::vector<base::string16> keywords = + base::SplitString(base::UTF8ToUTF16(query_text), + base::StringPiece16(base::kWhitespaceUTF16), + base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); + std::vector<std::unique_ptr< + base::i18n::FixedPatternStringSearchIgnoringCaseAndAccents>> + queries; + queries.reserve(keywords.size()); + for (const auto& keyword : keywords) { + queries.push_back( + std::make_unique< + base::i18n::FixedPatternStringSearchIgnoringCaseAndAccents>( + keyword)); + } + auto results_list = std::make_unique<base::ListValue>(); results_list->GetList().reserve(results->GetList().size()); for (auto& entry : *results) { @@ -1268,8 +1291,10 @@ base::Value* value = entry.FindKey("fileFullPath"); if (value && value->GetAsString(&highlight)) { base::FilePath path(highlight); - highlight = path.BaseName().value(); - // TODO(crbug/854481): Implement highlighting of the found term. + if (!drive::internal::FindAndHighlight(path.BaseName().value(), queries, + &highlight)) { + highlight = path.BaseName().value(); + } } dict.SetKey("entry", std::move(entry)); dict.SetKey("highlightedBaseName", base::Value(highlight));
diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_drive.h b/chrome/browser/chromeos/extensions/file_manager/private_api_drive.h index 94897afa..0e33194 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_drive.h +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_drive.h
@@ -171,7 +171,8 @@ drive::FileError error, std::unique_ptr<drive::MetadataSearchResultVector> results); - void OnSearchDriveFs(std::unique_ptr<base::ListValue> results); + void OnSearchDriveFs(const std::string& query_text, + std::unique_ptr<base::ListValue> results); // Called when |results| in OnSearchMetadata() are converted to a list of // entry definitions.
diff --git a/chrome/browser/chromeos/multidevice_setup/android_sms_app_helper_delegate_impl.cc b/chrome/browser/chromeos/multidevice_setup/android_sms_app_helper_delegate_impl.cc index 8b2ee7ea..b914342 100644 --- a/chrome/browser/chromeos/multidevice_setup/android_sms_app_helper_delegate_impl.cc +++ b/chrome/browser/chromeos/multidevice_setup/android_sms_app_helper_delegate_impl.cc
@@ -45,7 +45,9 @@ web_app::PendingAppManager::AppInfo( chromeos::android_sms::GetAndroidMessagesURLWithExperiments(), web_app::PendingAppManager::LaunchContainer::kWindow, - web_app::PendingAppManager::InstallSource::kInternal), + web_app::PendingAppManager::InstallSource::kInternal, + web_app::PendingAppManager::AppInfo::kDefaultCreateShortcuts, + true), // override_previous_user_uninstall base::BindOnce(&AndroidSmsAppHelperDelegateImpl::OnAppInstalled, weak_ptr_factory_.GetWeakPtr(), launch_on_install)); }
diff --git a/chrome/browser/chromeos/multidevice_setup/android_sms_app_helper_delegate_impl_unittest.cc b/chrome/browser/chromeos/multidevice_setup/android_sms_app_helper_delegate_impl_unittest.cc index 54ed8ee..6de6c3b 100644 --- a/chrome/browser/chromeos/multidevice_setup/android_sms_app_helper_delegate_impl_unittest.cc +++ b/chrome/browser/chromeos/multidevice_setup/android_sms_app_helper_delegate_impl_unittest.cc
@@ -57,7 +57,9 @@ expected_apps_to_install.emplace_back( chromeos::android_sms::GetAndroidMessagesURLWithExperiments(), web_app::PendingAppManager::LaunchContainer::kWindow, - web_app::PendingAppManager::InstallSource::kInternal); + web_app::PendingAppManager::InstallSource::kInternal, + web_app::PendingAppManager::AppInfo::kDefaultCreateShortcuts, + true); // override_previous_user_uninstall EXPECT_EQ(expected_apps_to_install, test_pending_app_manager()->install_requests()); }
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index bec8cd2..f741201 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -509,6 +509,11 @@ "URLs that are in-scope of Desktop PWAs will open in a window. Requires " "#enable-desktop-pwas."; +const char kEnableSystemWebAppsName[] = "System Web Apps"; +const char kEnableSystemWebAppsDescription[] = + "Experimental system for using the Desktop PWA framework for running System" + "Apps (e.g Settings, Discover)."; + const char kEnableDockedMagnifierName[] = "Docked Magnifier"; const char kEnableDockedMagnifierDescription[] = "Enables the Docked Magnifier (a.k.a. picture-in-picture magnifier)."; @@ -2801,6 +2806,13 @@ "Has no effect unless either the #upcoming-ui-features flag is Enabled or " "the #top-chrome-md flag is set to Refresh or Touchable Refresh."; +const char kOmniboxPedalSuggestionsName[] = "Omnibox Pedal suggestions"; +const char kOmniboxPedalSuggestionsDescription[] = + "Enable omnibox Pedal suggestions using either a side button in suggestion " + "or a dedicated suggestion item beneath the triggering line item. Omnibox " + "Pedals accelerate actions within Chrome by detecting user intent and " + "offering direct access to the end goal."; + const char kOmniboxTailSuggestionsName[] = "Omnibox tail suggestions"; const char kOmniboxTailSuggestionsDescription[] = "Enable receiving tail suggestions, a type of search suggestion based on "
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index 1d0fdfe..e0453ed 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -339,6 +339,9 @@ extern const char kEnableDesktopPWAsLinkCapturingName[]; extern const char kEnableDesktopPWAsLinkCapturingDescription[]; +extern const char kEnableSystemWebAppsName[]; +extern const char kEnableSystemWebAppsDescription[]; + extern const char kEnableDockedMagnifierName[]; extern const char kEnableDockedMagnifierDescription[]; @@ -1686,6 +1689,9 @@ extern const char kOmniboxTabSwitchSuggestionsName[]; extern const char kOmniboxTabSwitchSuggestionsDescription[]; +extern const char kOmniboxPedalSuggestionsName[]; +extern const char kOmniboxPedalSuggestionsDescription[]; + extern const char kOmniboxTailSuggestionsName[]; extern const char kOmniboxTailSuggestionsDescription[];
diff --git a/chrome/browser/media/android/router/media_router_android.cc b/chrome/browser/media/android/router/media_router_android.cc index da350ce1..b05e0f9 100644 --- a/chrome/browser/media/android/router/media_router_android.cc +++ b/chrome/browser/media/android/router/media_router_android.cc
@@ -50,6 +50,11 @@ media_router_android_->SendRouteMessage(route_id_, message->get_message()); } +void MediaRouterAndroid::PresentationConnectionProxy::Terminate() { + DCHECK(peer_); + peer_->DidChangeState(blink::mojom::PresentationConnectionState::TERMINATED); +} + void MediaRouterAndroid::PresentationConnectionProxy::DidClose( blink::mojom::PresentationConnectionCloseReason reason) { auto& route_connections = @@ -306,9 +311,19 @@ } void MediaRouterAndroid::OnRouteTerminated(const MediaRoute::Id& route_id) { + auto entry = presentation_connections_.find(route_id); + if (entry != presentation_connections_.end()) { + // Note: Route-ID-to-presentation-ID mapping is done by route providers. + // Although the messages API (being deprecated) is based on route IDs, + // providers may use the same route for each presentation connection. This + // would result in broadcasting provider messages to all presentation + // connections. So although this loop may seem strange in the context of + // the Presentation API, it can't be avoided at the moment. + for (auto& connection : entry->second) { + connection->Terminate(); + } + } RemoveRoute(route_id); - NotifyPresentationConnectionStateChange( - route_id, blink::mojom::PresentationConnectionState::TERMINATED); } void MediaRouterAndroid::OnRouteClosed(
diff --git a/chrome/browser/media/android/router/media_router_android.h b/chrome/browser/media/android/router/media_router_android.h index 519e712..2674ed0 100644 --- a/chrome/browser/media/android/router/media_router_android.h +++ b/chrome/browser/media/android/router/media_router_android.h
@@ -124,6 +124,9 @@ // Sends a text message back to router's peer for this connection (|peer_|). void SendMessage(const std::string& message); + // Sends a TERMINATED state change message directly via |peer_|. + void Terminate(); + private: blink::mojom::PresentationConnectionPtrInfo Bind();
diff --git a/chrome/browser/media/android/router/media_router_android_unittest.cc b/chrome/browser/media/android/router/media_router_android_unittest.cc index beb69141..c37c29c0 100644 --- a/chrome/browser/media/android/router/media_router_android_unittest.cc +++ b/chrome/browser/media/android/router/media_router_android_unittest.cc
@@ -97,12 +97,6 @@ } TEST_F(MediaRouterAndroidTest, OnRouteTerminated) { - base::MockCallback<content::PresentationConnectionStateChangedCallback> - callback; - content::PresentationConnectionStateChangeInfo change_info_terminated( - PresentationConnectionState::TERMINATED); - EXPECT_CALL(callback, Run(StateChangeInfoEquals(change_info_terminated))); - Expectation createRouteExpectation = EXPECT_CALL(*mock_bridge_, CreateRoute(_, _, _, _, _, _, 1)) .WillOnce(Return()); @@ -113,9 +107,10 @@ EXPECT_NE(nullptr, router_->FindRouteBySource("source")); - std::unique_ptr<PresentationConnectionStateSubscription> subscription = - router_->AddPresentationConnectionStateChangedCallback("route", - callback.Get()); + // Route termination on Android results in the PresentationConnectionPtr + // directly being messaged, and therefore there is no + // PresentationConnectionStateChangedCallback that can be intercepted for + // test verification purposes. router_->OnRouteTerminated("route"); EXPECT_EQ(nullptr, router_->FindRouteBySource("source"));
diff --git a/chrome/browser/policy/configuration_policy_handler_list_factory.cc b/chrome/browser/policy/configuration_policy_handler_list_factory.cc index 3dd7c48ac..0a0e3bba 100644 --- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc +++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc
@@ -265,6 +265,9 @@ { key::kDefaultGeolocationSetting, prefs::kManagedDefaultGeolocationSetting, base::Value::Type::INTEGER }, + { key::kSigninAllowed, + prefs::kSigninAllowed, + base::Value::Type::BOOLEAN }, { key::kEnableOnlineRevocationChecks, prefs::kCertRevocationCheckingEnabled, base::Value::Type::BOOLEAN },
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc index 2aa2cbd..4e3be026 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc
@@ -370,9 +370,6 @@ const char kLastWelcomedOSVersion[] = "browser.last_welcomed_os_version"; #endif -// Deprecated 9/2018. -const char kSigninAllowed[] = "signin.allowed"; - // Register prefs used only for migration (clearing or moving to a new key). void RegisterProfilePrefsForMigration( user_prefs::PrefRegistrySyncable* registry) { @@ -395,7 +392,6 @@ registry->RegisterIntegerPref(kModuleConflictBubbleShown, 0); registry->RegisterIntegerPref(kOptionsWindowLastTabIndex, 0); registry->RegisterStringPref(kTrustedDownloadSources, std::string()); - registry->RegisterBooleanPref(kSigninAllowed, true); } } // namespace @@ -850,7 +846,4 @@ profile_prefs->ClearPref(kModuleConflictBubbleShown); profile_prefs->ClearPref(kOptionsWindowLastTabIndex); profile_prefs->ClearPref(kTrustedDownloadSources); - - // Added 9/2018 - profile_prefs->ClearPref(kSigninAllowed); }
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc index dde3116..9d1f4de 100644 --- a/chrome/browser/profiles/profile_manager.cc +++ b/chrome/browser/profiles/profile_manager.cc
@@ -1725,6 +1725,7 @@ void ProfileManager::SetNonPersonalProfilePrefs(Profile* profile) { PrefService* prefs = profile->GetPrefs(); + prefs->SetBoolean(prefs::kSigninAllowed, false); prefs->SetBoolean(bookmarks::prefs::kEditBookmarksEnabled, false); prefs->SetBoolean(bookmarks::prefs::kShowBookmarkBar, false); prefs->ClearPref(DefaultSearchManager::kDefaultSearchProviderDataPrefName);
diff --git a/chrome/browser/resource_coordinator/discard_before_unload_helper_browsertest.cc b/chrome/browser/resource_coordinator/discard_before_unload_helper_browsertest.cc index a0f2e0e..6f839a2f 100644 --- a/chrome/browser/resource_coordinator/discard_before_unload_helper_browsertest.cc +++ b/chrome/browser/resource_coordinator/discard_before_unload_helper_browsertest.cc
@@ -79,8 +79,9 @@ } // namespace +// TODO(https://crbug.com/889304): Re-enable this test. IN_PROC_BROWSER_TEST_F(HasBeforeUnloadHandlerTest, - NonEmptyBeforeUnloadDetected) { + DISABLED_NonEmptyBeforeUnloadDetected) { TestDiscardBeforeUnloadHelper("/beforeunload.html", true /* has_beforeunload_helper */); }
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/log.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/log.js index a488843..bdce4af 100644 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/log.js +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/log.js
@@ -49,8 +49,8 @@ }; var params = new URLSearchParams(location.search); - for (var type in LogStore.LogType) { - var typeFilter = LogStore.LogType[type] + 'Filter'; + for (var type of LogStore.logTypes()) { + var typeFilter = type + 'Filter'; LogPage.setFilterTypeEnabled(typeFilter, params.get(typeFilter)); } var saveLogButton = document.getElementById('saveLog'); @@ -101,9 +101,8 @@ * update logs. */ LogPage.update = function() { - var logTypes = LogStore.logTypeStr(); - for (var i = 0; i < logTypes.length; i++) { - var typeFilter = logTypes[i] + 'Filter'; + for (var type of LogStore.logTypes()) { + var typeFilter = type + 'Filter'; var element = document.getElementById(typeFilter); element.checked = LogPage.urlPrefs_[typeFilter]; } @@ -176,8 +175,8 @@ */ LogPage.createUrlParams = function() { var urlParams = []; - for (var type in LogStore.LogType) { - var typeFilter = LogStore.LogType[type] + 'Filter'; + for (var type of LogStore.logTypes()) { + var typeFilter = type + 'Filter'; urlParams.push(typeFilter + '=' + LogPage.urlPrefs_[typeFilter]); } return '?' + urlParams.join('&');
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/log_store.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/log_store.js index ef42e09..d605505 100644 --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/log_store.js +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/log_store.js
@@ -124,7 +124,7 @@ * List of all LogTypes. * @return {!Array<!TextLog.LogType | !TreeLog.LogType>} */ -LogStore.logTypeStr = function() { +LogStore.logTypes = function() { var types = []; for (var type in TextLog.LogType) types.push(TextLog.LogType[type]);
diff --git a/chrome/browser/resources/chromeos/chromevox/host/chrome/classic_earcons.js b/chrome/browser/resources/chromeos/chromevox/host/chrome/classic_earcons.js index 707e1ff..2ba8696 100644 --- a/chrome/browser/resources/chromeos/chromevox/host/chrome/classic_earcons.js +++ b/chrome/browser/resources/chromeos/chromevox/host/chrome/classic_earcons.js
@@ -11,6 +11,8 @@ goog.provide('cvox.ClassicEarcons'); +goog.require('LogStore'); +goog.require('TextLog'); goog.require('cvox.AbstractEarcons'); @@ -54,7 +56,10 @@ if (!cvox.AbstractEarcons.enabled) { return; } - console.log('Earcon ' + earcon); + if (localStorage['enableEarconLogging'] == 'true') { + LogStore.getInstance().writeTextLog(earcon, TextLog.LogType.EARCON); + console.log('Earcon ' + earcon); + } this.currentAudio = this.audioMap[earcon]; if (!this.currentAudio) {
diff --git a/chrome/browser/resources/print_preview/new/copies_settings.js b/chrome/browser/resources/print_preview/new/copies_settings.js index 88ea635..14b8bf2 100644 --- a/chrome/browser/resources/print_preview/new/copies_settings.js +++ b/chrome/browser/resources/print_preview/new/copies_settings.js
@@ -41,8 +41,10 @@ * @private */ onInputChanged_: function() { - this.setSetting( - 'copies', this.inputValid_ ? parseInt(this.currentValue_, 10) : 1); + if (this.currentValue_ !== '') { + this.setSetting( + 'copies', this.inputValid_ ? parseInt(this.currentValue_, 10) : 1); + } this.setSettingValid('copies', this.inputValid_); }, @@ -51,7 +53,8 @@ * @private */ collateHidden_: function() { - return !this.inputValid_ || parseInt(this.currentValue_, 10) == 1; + return !this.inputValid_ || this.currentValue_ === '' || + parseInt(this.currentValue_, 10) == 1; }, /** @private */
diff --git a/chrome/browser/resources/print_preview/new/number_settings_section.html b/chrome/browser/resources/print_preview/new/number_settings_section.html index bfa9efe..bedf681 100644 --- a/chrome/browser/resources/print_preview/new/number_settings_section.html +++ b/chrome/browser/resources/print_preview/new/number_settings_section.html
@@ -8,11 +8,7 @@ <dom-module id="print-preview-number-settings-section"> <template> <style include="print-preview-shared"> - :host([error-displayed_]) print-preview-settings-section { - margin-bottom: 8px; - } - - :host([error-displayed_]) #section-title { + :host(:not([input-valid])) #section-title { margin-top: calc(-14px - 2 * .75rem); } @@ -32,7 +28,7 @@ width: 100%; } - :host(:not([error-displayed_])) cr-input { + :host([input-valid]) cr-input { --cr-input-error-display: none; }
diff --git a/chrome/browser/resources/print_preview/new/number_settings_section.js b/chrome/browser/resources/print_preview/new/number_settings_section.js index 080adffe..1801357 100644 --- a/chrome/browser/resources/print_preview/new/number_settings_section.js +++ b/chrome/browser/resources/print_preview/new/number_settings_section.js
@@ -19,6 +19,7 @@ inputValid: { type: Boolean, notify: true, + reflectToAttribute: true, value: true, }, @@ -42,16 +43,6 @@ hintMessage: String, disabled: Boolean, - - /** - * Whether the error message should be displayed on the input. - * @private {boolean} - */ - errorDisplayed_: { - type: Boolean, - reflectToAttribute: true, - computed: 'computeErrorDisplayed_(inputString_, inputValid)', - }, }, listeners: { @@ -83,8 +74,13 @@ * @param {!KeyboardEvent} e The keyboard event */ onKeydown_: function(e) { - if (e.key == '.' || e.key == 'e' || e.key == '-') + if (['.', 'e', 'E', '-', '+'].includes(e.key)) { e.preventDefault(); + return; + } + + if (e.key == 'Enter') + this.onBlur_(); }, /** @private */ @@ -115,14 +111,6 @@ computeValid_: function() { // Make sure value updates first, in case inputString_ was updated by JS. this.$.userValue.value = this.inputString_; - return !this.$.userValue.invalid && this.inputString_ != ''; - }, - - /** - * @return {boolean} Whether the error message should be empty. - * @private - */ - computeErrorDisplayed_: function() { - return !this.inputValid && this.inputString_ != ''; + return !this.$.userValue.invalid; }, });
diff --git a/chrome/browser/resources/print_preview/new/pages_settings.html b/chrome/browser/resources/print_preview/new/pages_settings.html index 76c90cca..6e18574 100644 --- a/chrome/browser/resources/print_preview/new/pages_settings.html +++ b/chrome/browser/resources/print_preview/new/pages_settings.html
@@ -58,7 +58,7 @@ <cr-input id="pageSettingsCustomInput" type="text" data-timeout-delay="500" disabled$="[[getDisabled_(disabled)]]" spellcheck="false" - on-blur="onCustomInputBlur_" + on-blur="onCustomInputBlur_" on-keydown="onKeydown_" placeholder="$i18n{examplePageRangeText}" error-message="[[getHintMessage_(errorState_, documentInfo.pageCount)]]">
diff --git a/chrome/browser/resources/print_preview/new/pages_settings.js b/chrome/browser/resources/print_preview/new/pages_settings.js index 9f12e46c..c0d22d3 100644 --- a/chrome/browser/resources/print_preview/new/pages_settings.js +++ b/chrome/browser/resources/print_preview/new/pages_settings.js
@@ -314,6 +314,24 @@ this.onCustomInputBlur_(event); }, + /** @private */ + resetIfEmpty_: function() { + if (this.inputString_ === '') { + this.customSelected_ = false; + this.selectedValue = PagesValue.ALL.toString(); + } + }, + + /** + * @param {!KeyboardEvent} e The keyboard event + */ + onKeydown_: function(e) { + if (e.key == 'Enter') { + this.resetAndUpdate(); + this.resetIfEmpty_(); + } + }, + /** * @param {Event} event Contains information about where focus is going. * @private @@ -321,11 +339,9 @@ onCustomInputBlur_: function(event) { this.resetAndUpdate(); - if (this.inputString_ === '' && - event.relatedTarget != this.$.customInputWrapper && + if (event.relatedTarget != this.$.customInputWrapper && event.relatedTarget != this.$$('.md-select')) { - this.customSelected_ = false; - this.selectedValue = PagesValue.ALL.toString(); + this.resetIfEmpty_(); } },
diff --git a/chrome/browser/resources/print_preview/new/print_preview_shared_css.html b/chrome/browser/resources/print_preview/new/print_preview_shared_css.html index 5e3de37..d231f99 100644 --- a/chrome/browser/resources/print_preview/new/print_preview_shared_css.html +++ b/chrome/browser/resources/print_preview/new/print_preview_shared_css.html
@@ -11,10 +11,6 @@ --cr-input-row-container: { min-height: 38px; }; - --cr-input-container: { - margin-top: 3px; - margin-bottom: 3px; - }; --md-select-width: calc(100% - 17px); --print-preview-settings-border: 1px solid rgb(232, 234, 237); --print-preview-dialog-margin: 34px;
diff --git a/chrome/browser/resources/print_preview/new/scaling_settings.js b/chrome/browser/resources/print_preview/new/scaling_settings.js index e259780..fe71d7e 100644 --- a/chrome/browser/resources/print_preview/new/scaling_settings.js +++ b/chrome/browser/resources/print_preview/new/scaling_settings.js
@@ -151,7 +151,7 @@ return; this.setSettingValid('scaling', this.inputValid_); - if (this.inputValid_) + if (this.currentValue_ !== '' && this.inputValid_) this.setSetting('scaling', this.currentValue_); },
diff --git a/chrome/browser/search/thumbnail_source.cc b/chrome/browser/search/thumbnail_source.cc index b8cc5cd6..e1562b4a 100644 --- a/chrome/browser/search/thumbnail_source.cc +++ b/chrome/browser/search/thumbnail_source.cc
@@ -75,6 +75,12 @@ SyncDisabled: true } } + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } })"); // Otherwise, if a fallback thumbnail URL was provided, fetch it and // eventually return it.
diff --git a/chrome/browser/signin/signin_promo_util.cc b/chrome/browser/signin/signin_promo_util.cc index fa12fed..ba55a8a 100644 --- a/chrome/browser/signin/signin_promo_util.cc +++ b/chrome/browser/signin/signin_promo_util.cc
@@ -29,7 +29,8 @@ // Display the signin promo if the user is not signed in. SigninManager* signin = SigninManagerFactory::GetForProfile(profile->GetOriginalProfile()); - return !signin->AuthInProgress() && !signin->IsAuthenticated(); + return !signin->AuthInProgress() && signin->IsSigninAllowed() && + !signin->IsAuthenticated(); #endif }
diff --git a/chrome/browser/supervised_user/child_accounts/child_account_service.cc b/chrome/browser/supervised_user/child_accounts/child_account_service.cc index ff5f7a2..ca6ac82 100644 --- a/chrome/browser/supervised_user/child_accounts/child_account_service.cc +++ b/chrome/browser/supervised_user/child_accounts/child_account_service.cc
@@ -171,6 +171,10 @@ supervised_users::kRecordHistoryIncludesSessionSync, std::make_unique<base::Value>(false)); + // In contrast to legacy SUs, child account SUs must sign in. + settings_service->SetLocalSetting(supervised_users::kSigninAllowed, + std::make_unique<base::Value>(true)); + // Always allow cookies, to avoid website compatibility issues. settings_service->SetLocalSetting(supervised_users::kCookiesAlwaysAllowed, std::make_unique<base::Value>(true)); @@ -211,6 +215,8 @@ SupervisedUserSettingsServiceFactory::GetForProfile(profile_); settings_service->SetLocalSetting( supervised_users::kRecordHistoryIncludesSessionSync, nullptr); + settings_service->SetLocalSetting(supervised_users::kSigninAllowed, + nullptr); settings_service->SetLocalSetting(supervised_users::kCookiesAlwaysAllowed, nullptr); settings_service->SetLocalSetting(supervised_users::kForceSafeSearch,
diff --git a/chrome/browser/supervised_user/supervised_user_constants.cc b/chrome/browser/supervised_user/supervised_user_constants.cc index 63e4240..f6902f2 100644 --- a/chrome/browser/supervised_user/supervised_user_constants.cc +++ b/chrome/browser/supervised_user/supervised_user_constants.cc
@@ -24,6 +24,7 @@ const char kRecordHistoryIncludesSessionSync[] = "RecordHistoryIncludesSessionSync"; const char kSafeSitesEnabled[] = "SafeSites"; +const char kSigninAllowed[] = "SigninAllowed"; const char kUserName[] = "UserName"; // NOTE: Do not change this value without changing the value of the
diff --git a/chrome/browser/supervised_user/supervised_user_constants.h b/chrome/browser/supervised_user/supervised_user_constants.h index b090923..222e849 100644 --- a/chrome/browser/supervised_user/supervised_user_constants.h +++ b/chrome/browser/supervised_user/supervised_user_constants.h
@@ -24,6 +24,7 @@ extern const char kRecordHistory[]; extern const char kRecordHistoryIncludesSessionSync[]; extern const char kSafeSitesEnabled[]; +extern const char kSigninAllowed[]; extern const char kUserName[]; // A pseudo-email address for systems that expect well-formed email addresses
diff --git a/chrome/browser/supervised_user/supervised_user_pref_store.cc b/chrome/browser/supervised_user/supervised_user_pref_store.cc index 37f448fc..5e063cf 100644 --- a/chrome/browser/supervised_user/supervised_user_pref_store.cc +++ b/chrome/browser/supervised_user/supervised_user_pref_store.cc
@@ -60,6 +60,9 @@ supervised_users::kSafeSitesEnabled, prefs::kSupervisedUserSafeSites, }, { + supervised_users::kSigninAllowed, prefs::kSigninAllowed, + }, + { supervised_users::kUserName, prefs::kProfileName, }, }; @@ -127,6 +130,7 @@ prefs_->SetInteger(prefs::kForceYouTubeRestrict, safe_search_util::YOUTUBE_RESTRICT_MODERATE); prefs_->SetBoolean(prefs::kHideWebStoreIcon, true); + prefs_->SetBoolean(prefs::kSigninAllowed, false); prefs_->SetBoolean(ntp_snippets::prefs::kEnableSnippets, false); // Copy supervised user settings to prefs.
diff --git a/chrome/browser/ui/ash/chrome_keyboard_ui.cc b/chrome/browser/ui/ash/chrome_keyboard_ui.cc index 1b176669..4dc5c880 100644 --- a/chrome/browser/ui/ash/chrome_keyboard_ui.cc +++ b/chrome/browser/ui/ash/chrome_keyboard_ui.cc
@@ -112,7 +112,7 @@ if (view && window->Contains(view->GetNativeView())) { gfx::Rect view_bounds = view->GetViewBounds(); gfx::Rect intersect = gfx::IntersectRects( - view_bounds, GetKeyboardWindow()->GetBoundsInScreen()); + view_bounds, keyboard_controller()->GetWorkspaceOccludedBounds()); int overlap = ShouldEnableInsets(window) ? intersect.height() : 0; if (overlap > 0 && overlap < view_bounds.height()) view->SetInsets(gfx::Insets(0, 0, overlap, 0));
diff --git a/chrome/browser/ui/ash/keyboard_end_to_end_browsertest.cc b/chrome/browser/ui/ash/keyboard_end_to_end_browsertest.cc index d5d237f..14bed37 100644 --- a/chrome/browser/ui/ash/keyboard_end_to_end_browsertest.cc +++ b/chrome/browser/ui/ash/keyboard_end_to_end_browsertest.cc
@@ -23,7 +23,7 @@ namespace keyboard { -class KeyboardEndToEndTest : public chromeos::TextInputTestBase { +class KeyboardEndToEndTest : public InProcessBrowserTest { public: // Ensure that the virtual keyboard is enabled. void SetUpCommandLine(base::CommandLine* command_line) override { @@ -300,4 +300,87 @@ EXPECT_EQ(GetViewportHeight(web_contents), old_height); } +IN_PROC_BROWSER_TEST_F( + KeyboardEndToEndOverscrollTest, + ToggleKeyboardOnNonOverlappingWindowDoesNotAffectViewport) { + // Set the window bounds so that it does not overlap with the keyboard. + // The virtual keyboard takes up no more than half the screen height. + const auto screen_bounds = ash::Shell::GetPrimaryRootWindow()->bounds(); + browser()->window()->SetBounds( + gfx::Rect(0, 0, screen_bounds.width(), screen_bounds.height() / 2)); + aura::test::WaitForAllChangesToComplete(); + + const int old_height = GetViewportHeight(web_contents); + + FocusAndShowKeyboard(); + ASSERT_TRUE(WaitUntilShown()); + + EXPECT_EQ(GetViewportHeight(web_contents), old_height); + + HideKeyboard(); + ASSERT_TRUE(WaitUntilHidden()); + + EXPECT_EQ(GetViewportHeight(web_contents), old_height); +} + +IN_PROC_BROWSER_TEST_F( + KeyboardEndToEndOverscrollTest, + ToggleKeyboardOnShortOverlappingWindowMovesWindowUpwards) { + // Shift the window down so that it overlaps with the keyboard, but shrink the + // window size so that when it moves upwards, it will no longer overlap with + // the keyboard. + const auto screen_bounds = ash::Shell::GetPrimaryRootWindow()->bounds(); + browser()->window()->SetBounds(gfx::Rect(0, screen_bounds.height() / 2, + screen_bounds.width(), + screen_bounds.height() / 2)); + aura::test::WaitForAllChangesToComplete(); + + const auto old_browser_bounds = browser()->window()->GetBounds(); + const int old_height = GetViewportHeight(web_contents); + + FocusAndShowKeyboard(); + ASSERT_TRUE(WaitUntilShown()); + + EXPECT_LT(browser()->window()->GetBounds().y(), old_browser_bounds.y()); + EXPECT_EQ(browser()->window()->GetBounds().height(), + old_browser_bounds.height()); + EXPECT_EQ(GetViewportHeight(web_contents), old_height); + + HideKeyboard(); + ASSERT_TRUE(WaitUntilHidden()); + + EXPECT_EQ(browser()->window()->GetBounds(), old_browser_bounds); + EXPECT_EQ(GetViewportHeight(web_contents), old_height); +} + +IN_PROC_BROWSER_TEST_F( + KeyboardEndToEndOverscrollTest, + ToggleKeyboardOnTallOverlappingWindowMovesWindowUpwardsAndAffectsViewport) { + // Shift the window down so that it overlaps with the keyboard, and expand the + // window size so that when it moves upwards, it will still overlap with + // the keyboard. + const auto screen_bounds = ash::Shell::GetPrimaryRootWindow()->bounds(); + browser()->window()->SetBounds(gfx::Rect(0, screen_bounds.height() / 3, + screen_bounds.width(), + screen_bounds.height() / 3 * 2)); + aura::test::WaitForAllChangesToComplete(); + + const auto old_browser_bounds = browser()->window()->GetBounds(); + const int old_height = GetViewportHeight(web_contents); + + FocusAndShowKeyboard(); + ASSERT_TRUE(WaitUntilShown()); + + EXPECT_LT(browser()->window()->GetBounds().y(), old_browser_bounds.y()); + EXPECT_EQ(browser()->window()->GetBounds().height(), + old_browser_bounds.height()); + EXPECT_LT(GetViewportHeight(web_contents), old_height); + + HideKeyboard(); + ASSERT_TRUE(WaitUntilHidden()); + + EXPECT_EQ(browser()->window()->GetBounds(), old_browser_bounds); + EXPECT_EQ(GetViewportHeight(web_contents), old_height); +} + } // namespace keyboard
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc index 773e715..ae98c5f 100644 --- a/chrome/browser/ui/browser_command_controller.cc +++ b/chrome/browser/ui/browser_command_controller.cc
@@ -143,6 +143,11 @@ base::Bind(&BrowserCommandController::UpdateCommandsForFullscreenMode, base::Unretained(this))); #endif + pref_signin_allowed_.Init( + prefs::kSigninAllowed, + profile()->GetOriginalProfile()->GetPrefs(), + base::Bind(&BrowserCommandController::OnSigninAllowedPrefChange, + base::Unretained(this))); InitCommandState(); @@ -722,6 +727,16 @@ return command_updater_.UpdateCommandEnabled(id, state); } +//////////////////////////////////////////////////////////////////////////////// +// BrowserCommandController, SigninPrefObserver implementation: + +void BrowserCommandController::OnSigninAllowedPrefChange() { + // For unit tests, we don't have a window. + if (!window()) + return; + UpdateShowSyncState(IsShowingMainUI()); +} + // BrowserCommandController, TabStripModelObserver implementation: void BrowserCommandController::TabInsertedAt(TabStripModel* tab_strip_model, @@ -884,6 +899,8 @@ } #endif + UpdateShowSyncState(true); + // Navigation commands command_updater_.UpdateCommandEnabled( IDC_HOME, @@ -1161,6 +1178,7 @@ #if defined(GOOGLE_CHROME_BUILD) command_updater_.UpdateCommandEnabled(IDC_FEEDBACK, show_main_ui); #endif + UpdateShowSyncState(show_main_ui); command_updater_.UpdateCommandEnabled(IDC_EDIT_SEARCH_ENGINES, show_main_ui); command_updater_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, show_main_ui); @@ -1274,6 +1292,14 @@ command_updater_.UpdateCommandEnabled(IDC_SAVE_PAGE, CanSavePage(browser_)); } +void BrowserCommandController::UpdateShowSyncState(bool show_main_ui) { + if (is_locked_fullscreen_) + return; + + command_updater_.UpdateCommandEnabled( + IDC_SHOW_SYNC_SETUP, show_main_ui && pref_signin_allowed_.GetValue()); +} + // static void BrowserCommandController::UpdateOpenFileState( CommandUpdater* command_updater) {
diff --git a/chrome/browser/ui/browser_command_controller.h b/chrome/browser/ui/browser_command_controller.h index 8f53e27..275df32 100644 --- a/chrome/browser/ui/browser_command_controller.h +++ b/chrome/browser/ui/browser_command_controller.h
@@ -201,6 +201,7 @@ PrefChangeRegistrar profile_pref_registrar_; PrefChangeRegistrar local_pref_registrar_; + BooleanPrefMember pref_signin_allowed_; // In locked fullscreen mode disallow enabling/disabling commands. bool is_locked_fullscreen_ = false;
diff --git a/chrome/browser/ui/browser_command_controller_unittest.cc b/chrome/browser/ui/browser_command_controller_unittest.cc index fe9badb..96e92fd 100644 --- a/chrome/browser/ui/browser_command_controller_unittest.cc +++ b/chrome/browser/ui/browser_command_controller_unittest.cc
@@ -341,7 +341,6 @@ // Command ID | tab mode | fullscreen | // | enabled | reserved | enabled | reserved | - // clang-format off { IDC_OPEN_CURRENT_URL, true, false, false, false }, { IDC_FOCUS_TOOLBAR, true, false, false, false }, { IDC_FOCUS_LOCATION, true, false, false, false }, @@ -370,8 +369,6 @@ { IDC_SELECT_PREVIOUS_TAB, true, true, true, false }, { IDC_EXIT, true, true, true, true }, { IDC_SHOW_AS_TAB, false, false, false, false }, - { IDC_SHOW_SIGNIN, true, false, true, false }, - // clang-format on }; const content::NativeWebKeyboardEvent key_event( blink::WebInputEvent::kTypeFirst, 0, @@ -473,7 +470,7 @@ EXPECT_TRUE(chrome::IsCommandEnabled(browser(), IDC_OPTIONS)); } -TEST_F(BrowserCommandControllerTest, IncognitoModeShowSigninCommand) { +TEST_F(BrowserCommandControllerTest, IncognitoModeOnSigninAllowedPrefChange) { // Set up a profile with an off the record profile. std::unique_ptr<TestingProfile> profile1 = TestingProfile::Builder().Build(); Profile* profile2 = profile1->GetOffTheRecordProfile(); @@ -489,6 +486,18 @@ chrome::BrowserCommandController command_controller(browser2.get()); const CommandUpdater* command_updater = &command_controller; - // Check that the IDC_SHOW_SIGNIN command is enabled in incognito. - EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_SIGNIN)); + // Check that the SYNC_SETUP command is updated on preference change. + EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP)); + profile1->GetPrefs()->SetBoolean(prefs::kSigninAllowed, false); + EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP)); +} + +TEST_F(BrowserCommandControllerTest, OnSigninAllowedPrefChange) { + chrome::BrowserCommandController command_controller(browser()); + const CommandUpdater* command_updater = &command_controller; + + // Check that the SYNC_SETUP command is updated on preference change. + EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP)); + profile()->GetPrefs()->SetBoolean(prefs::kSigninAllowed, false); + EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SHOW_SYNC_SETUP)); }
diff --git a/chrome/browser/ui/chrome_pages.cc b/chrome/browser/ui/chrome_pages.cc index 503935b..d4901768 100644 --- a/chrome/browser/ui/chrome_pages.cc +++ b/chrome/browser/ui/chrome_pages.cc
@@ -384,6 +384,10 @@ void ShowBrowserSignin(Browser* browser, signin_metrics::AccessPoint access_point) { Profile* original_profile = browser->profile()->GetOriginalProfile(); + SigninManagerBase* manager = + SigninManagerFactory::GetForProfile(original_profile); + DCHECK(manager->IsSigninAllowed()); + // If the browser's profile is an incognito profile, make sure to use // a browser window from the original profile. The user cannot sign in // from an incognito window. @@ -423,8 +427,6 @@ #if defined(OS_CHROMEOS) NOTREACHED(); #else - SigninManagerBase* manager = - SigninManagerFactory::GetForProfile(original_profile); profiles::BubbleViewMode bubble_view_mode = manager->IsAuthenticated() ? profiles::BUBBLE_VIEW_MODE_GAIA_REAUTH : profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN; @@ -439,6 +441,7 @@ Profile* original_profile = browser->profile()->GetOriginalProfile(); SigninManagerBase* manager = SigninManagerFactory::GetForProfile(original_profile); + DCHECK(manager->IsSigninAllowed()); if (manager->IsAuthenticated()) ShowSettings(browser); else
diff --git a/chrome/browser/ui/toolbar/app_menu_model.cc b/chrome/browser/ui/toolbar/app_menu_model.cc index ed190211..5c2342b5 100644 --- a/chrome/browser/ui/toolbar/app_menu_model.cc +++ b/chrome/browser/ui/toolbar/app_menu_model.cc
@@ -534,7 +534,7 @@ } LogMenuAction(MENU_ACTION_SHOW_DOWNLOADS); break; - case IDC_SHOW_SIGNIN: + case IDC_SHOW_SYNC_SETUP: if (!uma_action_recorded_) { UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.ShowSyncSetup", delta);
diff --git a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc index 42d5a12..7643756 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc
@@ -27,6 +27,7 @@ #include "components/omnibox/browser/omnibox_field_trial.h" #include "components/omnibox/browser/omnibox_popup_model.h" #include "components/omnibox/browser/vector_icons.h" +#include "components/strings/grit/components_strings.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" @@ -87,8 +88,10 @@ // Set up 'switch to tab' button. if (match.ShouldShowTabMatch()) { - suggestion_tab_switch_button_ = - std::make_unique<OmniboxTabSwitchButton>(model_, this); + constexpr int ids_hint = IDS_OMNIBOX_TAB_SUGGEST_HINT; + constexpr int ids_hint_short = IDS_OMNIBOX_TAB_SUGGEST_SHORT_HINT; + suggestion_tab_switch_button_ = std::make_unique<OmniboxTabSwitchButton>( + model_, this, ids_hint, ids_hint_short, omnibox::kSwitchIcon); suggestion_tab_switch_button_->set_owned_by_client(); AddChildView(suggestion_tab_switch_button_.get()); } else {
diff --git a/chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.cc b/chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.cc index 57f3bea..4ac9cba 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.cc
@@ -27,29 +27,33 @@ size_t OmniboxTabSwitchButton::full_text_width_; OmniboxTabSwitchButton::OmniboxTabSwitchButton(OmniboxPopupContentsView* model, - OmniboxResultView* result_view) + OmniboxResultView* result_view, + int ids_hint, + int ids_hint_short, + const gfx::VectorIcon& icon) : MdTextButton(result_view, views::style::CONTEXT_BUTTON_MD), model_(model), result_view_(result_view), initialized_(false), - animation_(new gfx::SlideAnimation(this)) { + animation_(new gfx::SlideAnimation(this)), + ids_hint_(ids_hint), + ids_hint_short_(ids_hint_short) { SetBgColorOverride(GetBackgroundColor()); - SetImage(STATE_NORMAL, - gfx::CreateVectorIcon(omnibox::kSwitchIcon, - GetLayoutConstant(LOCATION_BAR_ICON_SIZE), - gfx::kChromeIconGrey)); + SetImage(STATE_NORMAL, gfx::CreateVectorIcon( + icon, GetLayoutConstant(LOCATION_BAR_ICON_SIZE), + gfx::kChromeIconGrey)); SetImageLabelSpacing(8); if (!calculated_widths_) { icon_only_width_ = MdTextButton::CalculatePreferredSize().width(); - SetText(l10n_util::GetStringUTF16(IDS_OMNIBOX_TAB_SUGGEST_SHORT_HINT)); + SetText(l10n_util::GetStringUTF16(ids_hint_short_)); short_text_width_ = MdTextButton::CalculatePreferredSize().width(); - SetText(l10n_util::GetStringUTF16(IDS_OMNIBOX_TAB_SUGGEST_HINT)); + SetText(l10n_util::GetStringUTF16(ids_hint_)); full_text_width_ = MdTextButton::CalculatePreferredSize().width(); calculated_widths_ = true; } else { - SetText(l10n_util::GetStringUTF16(IDS_OMNIBOX_TAB_SUGGEST_HINT)); + SetText(l10n_util::GetStringUTF16(ids_hint_)); } - SetTooltipText(l10n_util::GetStringUTF16(IDS_OMNIBOX_TAB_SUGGEST_HINT)); + SetTooltipText(l10n_util::GetStringUTF16(ids_hint_)); set_corner_radius(CalculatePreferredSize().height() / 2.f); animation_->SetSlideDuration(500); SetElideBehavior(gfx::FADE_TAIL); @@ -187,11 +191,11 @@ size_t OmniboxTabSwitchButton::CalculateGoalWidth(size_t parent_width, base::string16* goal_text) { if (full_text_width_ * 5 <= parent_width) { - *goal_text = l10n_util::GetStringUTF16(IDS_OMNIBOX_TAB_SUGGEST_HINT); + *goal_text = l10n_util::GetStringUTF16(ids_hint_); return full_text_width_; } if (short_text_width_ * 5 <= parent_width) { - *goal_text = l10n_util::GetStringUTF16(IDS_OMNIBOX_TAB_SUGGEST_SHORT_HINT); + *goal_text = l10n_util::GetStringUTF16(ids_hint_short_); return short_text_width_; } *goal_text = base::string16();
diff --git a/chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.h b/chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.h index 23e45c90..b30801f 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.h +++ b/chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.h
@@ -17,7 +17,10 @@ class OmniboxTabSwitchButton : public views::MdTextButton { public: OmniboxTabSwitchButton(OmniboxPopupContentsView* model, - OmniboxResultView* result_view); + OmniboxResultView* result_view, + int ids_hint, + int ids_hint_short, + const gfx::VectorIcon& icon); ~OmniboxTabSwitchButton() override; @@ -81,6 +84,10 @@ base::string16 goal_text_; std::unique_ptr<gfx::SlideAnimation> animation_; + // String identifiers for hint text and its short version (may be same). + int ids_hint_; + int ids_hint_short_; + DISALLOW_COPY_AND_ASSIGN(OmniboxTabSwitchButton); };
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc index d26e0264..6131232 100644 --- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc +++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -420,6 +420,7 @@ passwords_button_ = nullptr; credit_cards_button_ = nullptr; addresses_button_ = nullptr; + signout_button_ = nullptr; } void ProfileChooserView::Init() { @@ -753,6 +754,8 @@ dice_accounts_menu_->SetSignOutButtonCallback(base::BindOnce( &ProfileChooserView::SignOutAllWebAccounts, base::Unretained(this))); dice_accounts_menu_->Show(sender, sync_to_another_account_button_); + } else if (sender == signout_button_) { + SignOutAllWebAccounts(); } else { // Either one of the "other profiles", or one of the profile accounts // buttons was pressed. @@ -1116,7 +1119,8 @@ return view; } - if (!dice_enabled_) { + if (!dice_enabled_ && + SigninManagerFactory::GetForProfile(profile)->IsSigninAllowed()) { views::View* extra_links_view = new views::View(); extra_links_view->SetLayoutManager(std::make_unique<views::BoxLayout>( views::BoxLayout::kVertical, @@ -1173,37 +1177,39 @@ views::BoxLayout::kVertical, gfx::Insets(0, 0, additional_bottom_spacing, 0))); - if (GetDiceSigninPromoShowCount() <= - kDiceSigninPromoIllustrationShowCountMax) { - // Add the illustration. - ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); - views::ImageView* illustration = new NonAccessibleImageView(); - illustration->SetImage( - *rb.GetNativeImageNamed(IDR_PROFILES_DICE_TURN_ON_SYNC).ToImageSkia()); - view->AddChildView(illustration); - // Adjust the spacing between illustration and promo text. - promotext_top_spacing = 24; - } - // Add the promo text. - bool show_personalized_promo = !dice_sync_promo_accounts_.empty(); - views::Label* promo = new views::Label(l10n_util::GetStringUTF16( - show_personalized_promo ? IDS_PROFILES_DICE_SYNC_PROMO - : IDS_PROFILES_DICE_SIGNIN_PROMO)); - promo->SetMultiLine(true); - promo->SetHorizontalAlignment(gfx::ALIGN_LEFT); - promo->SetMaximumWidth(menu_width_ - 2 * kMenuEdgeMargin); - promo->SetBorder(views::CreateEmptyBorder( - promotext_top_spacing, kMenuEdgeMargin, 0, kMenuEdgeMargin)); - view->AddChildView(promo); + const bool promo_account_available = !dice_sync_promo_accounts_.empty(); // Log sign-in impressions user metrics. signin_metrics::RecordSigninImpressionUserActionForAccessPoint( signin_metrics::AccessPoint::ACCESS_POINT_AVATAR_BUBBLE_SIGN_IN); signin_metrics::RecordSigninImpressionWithAccountUserActionForAccessPoint( signin_metrics::AccessPoint::ACCESS_POINT_AVATAR_BUBBLE_SIGN_IN, - show_personalized_promo); + promo_account_available); - if (!show_personalized_promo) { + if (!promo_account_available) { + // Show promo illustration+text when there is no promo account. + if (GetDiceSigninPromoShowCount() <= + kDiceSigninPromoIllustrationShowCountMax) { + // Add the illustration. + ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); + views::ImageView* illustration = new NonAccessibleImageView(); + illustration->SetImage( + *rb.GetNativeImageNamed(IDR_PROFILES_DICE_TURN_ON_SYNC) + .ToImageSkia()); + view->AddChildView(illustration); + // Adjust the spacing between illustration and promo text. + promotext_top_spacing = 24; + } + // Add the promo text. + views::Label* promo = new views::Label( + l10n_util::GetStringUTF16(IDS_PROFILES_DICE_SYNC_PROMO)); + promo->SetMultiLine(true); + promo->SetHorizontalAlignment(gfx::ALIGN_LEFT); + promo->SetMaximumWidth(menu_width_ - 2 * kMenuEdgeMargin); + promo->SetBorder(views::CreateEmptyBorder( + promotext_top_spacing, kMenuEdgeMargin, 0, kMenuEdgeMargin)); + view->AddChildView(promo); + // Create a sign-in button without account information. dice_signin_button_view_ = new DiceSigninButtonView(this); dice_signin_button_view_->SetBorder( @@ -1224,19 +1230,29 @@ } dice_signin_button_view_ = new DiceSigninButtonView(dice_promo_default_account, account_icon, this, - true /* show_drop_down_arrow */); - views::View* signin_button_container = new views::View(); - // Create a container for the signin button, so the special highlighting of - // the button won't go over the border. (DiceSigninButtonView sets a custom - // highlighting view with |HoverButton::SetHighlightingView|.) - signin_button_container->SetLayoutManager( - std::make_unique<views::FillLayout>()); - signin_button_container->SetBorder( - views::CreateEmptyBorder(gfx::Insets(kMenuEdgeMargin))); - signin_button_container->AddChildView(dice_signin_button_view_); - view->AddChildView(signin_button_container); + /*show_drop_down_arrow=*/false); signin_with_gaia_account_button_ = dice_signin_button_view_->signin_button(); - sync_to_another_account_button_ = dice_signin_button_view_->drop_down_arrow(); + + views::View* promo_button_container = new views::View(); + const int content_list_vert_spacing = + ChromeLayoutProvider::Get()->GetDistanceMetric( + DISTANCE_CONTENT_LIST_VERTICAL_MULTI); + const int bottom_spacing = kMenuEdgeMargin - content_list_vert_spacing; + promo_button_container->SetLayoutManager(std::make_unique<views::BoxLayout>( + views::BoxLayout::kVertical, + gfx::Insets(kMenuEdgeMargin, kMenuEdgeMargin, bottom_spacing, + kMenuEdgeMargin), + content_list_vert_spacing)); + promo_button_container->AddChildView(dice_signin_button_view_); + + // Add sign out button. + signout_button_ = views::MdTextButton::Create( + this, l10n_util::GetStringUTF16(IDS_SCREEN_LOCK_SIGN_OUT), + views::style::CONTEXT_BUTTON); + promo_button_container->AddChildView(signout_button_); + + view->AddChildView(promo_button_container); + return view; }
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.h b/chrome/browser/ui/views/profiles/profile_chooser_view.h index d921462..15aec59 100644 --- a/chrome/browser/ui/views/profiles/profile_chooser_view.h +++ b/chrome/browser/ui/views/profiles/profile_chooser_view.h
@@ -227,6 +227,7 @@ views::LabelButton* passwords_button_; views::LabelButton* credit_cards_button_; views::LabelButton* addresses_button_; + views::LabelButton* signout_button_; // Buttons displayed in the gaia signin view. views::ImageButton* gaia_signin_cancel_button_;
diff --git a/chrome/browser/ui/views/sync/dice_bubble_sync_promo_view.cc b/chrome/browser/ui/views/sync/dice_bubble_sync_promo_view.cc index c1e8a5463..67ff5cc 100644 --- a/chrome/browser/ui/views/sync/dice_bubble_sync_promo_view.cc +++ b/chrome/browser/ui/views/sync/dice_bubble_sync_promo_view.cc
@@ -34,9 +34,8 @@ std::vector<AccountInfo> accounts = signin_ui_util::GetAccountsForDicePromos(profile); - int title_resource_id = accounts.empty() - ? no_accounts_promo_message_resource_id - : accounts_promo_message_resource_id; + // Always show the accounts promo message for now. + const int title_resource_id = accounts_promo_message_resource_id; std::unique_ptr<views::BoxLayout> layout = std::make_unique<views::BoxLayout>( views::BoxLayout::kVertical, gfx::Insets(), @@ -66,7 +65,8 @@ profiles::GetPlaceholderAvatarIconResourceID()); } signin_button_view_ = new DiceSigninButtonView( - accounts[0], account_icon, this, true /* show_drop_down_arrow */); + accounts[0], account_icon, this, /*show_drop_down_arrow=*/false, + /*use_account_name_as_title=*/true); // Store account information for submenu. accounts_for_submenu_.assign(accounts.begin() + 1, accounts.end());
diff --git a/chrome/browser/ui/views/sync/dice_signin_button_view.cc b/chrome/browser/ui/views/sync/dice_signin_button_view.cc index 01155333..1d751ec 100644 --- a/chrome/browser/ui/views/sync/dice_signin_button_view.cc +++ b/chrome/browser/ui/views/sync/dice_signin_button_view.cc
@@ -24,32 +24,7 @@ namespace { constexpr int kDropDownArrowIconSize = 12; -constexpr int kDividerVerticalPadding = 10; -constexpr int kButtonCornerRadius = 2; -constexpr SkColor kDividerColor = SK_ColorWHITE; - -base::string16 GetButtonTitleForAccount(const AccountInfo& account) { - if (!account.given_name.empty()) { - return l10n_util::GetStringFUTF16( - IDS_PROFILES_DICE_SIGNIN_FIRST_ACCOUNT_BUTTON, - base::UTF8ToUTF16(account.given_name)); - } - if (!account.full_name.empty()) { - return l10n_util::GetStringFUTF16( - IDS_PROFILES_DICE_SIGNIN_FIRST_ACCOUNT_BUTTON, - base::UTF8ToUTF16(account.full_name)); - } - return l10n_util::GetStringUTF16( - IDS_PROFILES_DICE_SIGNIN_FIRST_ACCOUNT_BUTTON_NO_NAME); -} - -// Sizes |image| to 40x40 and shapes it circular. -gfx::ImageSkia PrepareAvatarImage(const gfx::Image& image) { - CHECK(!image.IsEmpty()); - return profiles::GetSizedAvatarIcon(image, true, 40, 40, - profiles::SHAPE_CIRCLE) - .AsImageSkia(); -} +constexpr int kPromoAccountImageSize = 40; } // namespace @@ -72,70 +47,65 @@ const AccountInfo& account, const gfx::Image& account_icon, views::ButtonListener* button_listener, - bool show_drop_down_arrow) + bool show_drop_down_arrow, + bool use_account_name_as_title) : account_(account) { views::GridLayout* grid_layout = SetLayoutManager(std::make_unique<views::GridLayout>(this)); views::ColumnSet* columns = grid_layout->AddColumnSet(0); grid_layout->StartRow(views::GridLayout::kFixedSize, 0); - // Add a stretching column for the account button. + // Add a stretching column for the account card. columns->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1.0, views::GridLayout::USE_PREF, 0, 0); - auto icon_view = std::make_unique<views::ImageView>(); - icon_view->SetImage(PrepareAvatarImage(account_icon)); - HoverButton* hover_button = new HoverButton( - button_listener, std::move(icon_view), GetButtonTitleForAccount(account), - base::ASCIIToUTF16(account_->email)); - hover_button->SetStyle(HoverButton::STYLE_PROMINENT); - signin_button_ = hover_button; - grid_layout->AddView(signin_button_); - if (!show_drop_down_arrow) - return; + DCHECK(!account_icon.IsEmpty()); + auto account_icon_view = std::make_unique<views::ImageView>(); + account_icon_view->SetImage( + profiles::GetSizedAvatarIcon(account_icon, true, kPromoAccountImageSize, + kPromoAccountImageSize, + profiles::SHAPE_CIRCLE) + .AsImageSkia()); + auto card_title = + use_account_name_as_title + ? base::UTF8ToUTF16(account.full_name) + : l10n_util::GetStringUTF16(IDS_PROFILES_DICE_NOT_SYNCING_TITLE); + HoverButton* account_card = + new HoverButton(button_listener, std::move(account_icon_view), card_title, + base::ASCIIToUTF16(account_->email)); + account_card->SetBorder(nullptr); + account_card->SetEnabled(false); + grid_layout->AddView(account_card); - // Add a non-stretching column for the the drop down arrow. - columns->AddColumn(views::GridLayout::TRAILING, views::GridLayout::FILL, - views::GridLayout::kFixedSize, views::GridLayout::USE_PREF, - 0, 0); - arrow_ = new HoverButton( + if (show_drop_down_arrow) { + // Add a non-stretching column for the the drop down arrow. + columns->AddColumn(views::GridLayout::TRAILING, views::GridLayout::FILL, + views::GridLayout::kFixedSize, + views::GridLayout::USE_PREF, 0, 0); + arrow_ = new HoverButton( + button_listener, + gfx::CreateVectorIcon(kSigninButtonDropDownArrowIcon, + kDropDownArrowIconSize, SK_ColorBLACK), + base::string16()); + arrow_->SetTooltipText(l10n_util::GetStringUTF16( + IDS_PROFILES_DICE_SIGNIN_WITH_ANOTHER_ACCOUNT_BUTTON)); + grid_layout->AddView(arrow_); + } + + grid_layout->AddPaddingRow(views::GridLayout::kFixedSize, 16); + + columns = grid_layout->AddColumnSet(1); + grid_layout->StartRow(views::GridLayout::kFixedSize, 1); + // Add a stretching column for the sign in button. + columns->AddColumn(views::GridLayout::FILL, views::GridLayout::TRAILING, 1.0, + views::GridLayout::USE_PREF, 0, 0); + views::MdTextButton* button = views::MdTextButton::Create( button_listener, - gfx::CreateVectorIcon(kSigninButtonDropDownArrowIcon, - kDropDownArrowIconSize, SK_ColorWHITE), - base::string16()); - arrow_->SetTooltipText(l10n_util::GetStringUTF16( - IDS_PROFILES_DICE_SIGNIN_WITH_ANOTHER_ACCOUNT_BUTTON)); - grid_layout->AddView(arrow_); - - // Make the background of the entire view match the prominent - // |signin_button_|. - SetBackground( - views::CreateSolidBackground(signin_button_->background()->get_color())); - // Make the entire view (including the arrow) highlighted when the - // |signin_button_| is hovered. - hover_button->SetHighlightingView(this); + l10n_util::GetStringUTF16(IDS_PROFILES_DICE_SIGNIN_BUTTON), + views::style::CONTEXT_BUTTON); + button->SetProminent(true); + grid_layout->AddView(button); + signin_button_ = button; } DiceSigninButtonView::~DiceSigninButtonView() = default; - -void DiceSigninButtonView::OnPaint(gfx::Canvas* canvas) { - views::View::OnPaint(canvas); - if (arrow_) { - // Draw divider between |signin_button_| and |arrow_|. - gfx::Rect bounds = arrow_->GetMirroredBounds(); - bounds.Inset(gfx::Insets(kDividerVerticalPadding, 0)); - if (base::i18n::IsRTL()) - bounds.Inset(bounds.width() - 1, 0, 0, 0); - canvas->DrawLine(bounds.origin(), bounds.bottom_left(), kDividerColor); - } -} - -void DiceSigninButtonView::Layout() { - views::View::Layout(); - // Clip the view to make the corners rounded and to remove the border - // background in case a parent view wants to set a transparent border. - gfx::Path path; - path.addRoundRect(gfx::RectToSkRect(GetContentsBounds()), kButtonCornerRadius, - kButtonCornerRadius); - set_clip_path(path); -}
diff --git a/chrome/browser/ui/views/sync/dice_signin_button_view.h b/chrome/browser/ui/views/sync/dice_signin_button_view.h index d557ea2..c18cd5d 100644 --- a/chrome/browser/ui/views/sync/dice_signin_button_view.h +++ b/chrome/browser/ui/views/sync/dice_signin_button_view.h
@@ -34,7 +34,8 @@ DiceSigninButtonView(const AccountInfo& account_info, const gfx::Image& account_icon, views::ButtonListener* button_listener, - bool show_drop_down_arrow = false); + bool show_drop_down_arrow = false, + bool use_account_name_as_title = false); ~DiceSigninButtonView() override; views::LabelButton* signin_button() const { return signin_button_; } @@ -42,9 +43,6 @@ base::Optional<AccountInfo> account() const { return account_; } private: - // views::View override: - void OnPaint(gfx::Canvas* canvas) override; - void Layout() override; views::LabelButton* signin_button_ = nullptr; HoverButton* arrow_ = nullptr;
diff --git a/chrome/browser/ui/webui/app_launcher_login_handler.cc b/chrome/browser/ui/webui/app_launcher_login_handler.cc index fccb7ab..cff5e1e 100644 --- a/chrome/browser/ui/webui/app_launcher_login_handler.cc +++ b/chrome/browser/ui/webui/app_launcher_login_handler.cc
@@ -195,7 +195,10 @@ } } else { #if !defined(OS_CHROMEOS) - if (!profile->IsLegacySupervised()) { + // Chromeos does not show this status header. + SigninManager* signin = SigninManagerFactory::GetForProfile( + profile->GetOriginalProfile()); + if (!profile->IsLegacySupervised() && signin->IsSigninAllowed()) { base::string16 signed_in_link = l10n_util::GetStringUTF16( IDS_SYNC_PROMO_NOT_SIGNED_IN_STATUS_LINK); signed_in_link = @@ -233,7 +236,8 @@ // UI and the avatar menu don't exist on that platform. return false; #else - return !profile->IsOffTheRecord(); + SigninManager* signin = SigninManagerFactory::GetForProfile(profile); + return !profile->IsOffTheRecord() && signin && signin->IsSigninAllowed(); #endif }
diff --git a/chrome/browser/ui/webui/profile_info_watcher.cc b/chrome/browser/ui/webui/profile_info_watcher.cc index d28ca33..422472e 100644 --- a/chrome/browser/ui/webui/profile_info_watcher.cc +++ b/chrome/browser/ui/webui/profile_info_watcher.cc
@@ -10,7 +10,10 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/signin/signin_manager_factory.h" +#include "chrome/common/pref_names.h" +#include "components/prefs/pref_service.h" #include "components/signin/core/browser/signin_manager.h" +#include "components/signin/core/browser/signin_pref_names.h" ProfileInfoWatcher::ProfileInfoWatcher( Profile* profile, const base::Closure& callback) @@ -22,6 +25,9 @@ // The profile_manager might be NULL in testing environments. if (profile_manager) profile_manager->GetProfileAttributesStorage().AddObserver(this); + + signin_allowed_pref_.Init(prefs::kSigninAllowed, profile_->GetPrefs(), + base::Bind(&ProfileInfoWatcher::RunCallback, base::Unretained(this))); } ProfileInfoWatcher::~ProfileInfoWatcher() {
diff --git a/chrome/browser/ui/webui/profile_info_watcher.h b/chrome/browser/ui/webui/profile_info_watcher.h index 4b34c709..114282d6 100644 --- a/chrome/browser/ui/webui/profile_info_watcher.h +++ b/chrome/browser/ui/webui/profile_info_watcher.h
@@ -10,6 +10,7 @@ #include "base/callback.h" #include "base/macros.h" #include "chrome/browser/profiles/profile_attributes_storage.h" +#include "components/prefs/pref_member.h" class Profile; class SigninManagerBase; @@ -41,6 +42,8 @@ // Called when the authenticated username changes. base::Closure callback_; + BooleanPrefMember signin_allowed_pref_; + DISALLOW_COPY_AND_ASSIGN(ProfileInfoWatcher); };
diff --git a/chrome/browser/ui/webui/settings/people_handler.cc b/chrome/browser/ui/webui/settings/people_handler.cc index 16c04b5..4559bd51 100644 --- a/chrome/browser/ui/webui/settings/people_handler.cc +++ b/chrome/browser/ui/webui/settings/people_handler.cc
@@ -184,6 +184,27 @@ } } +#if BUILDFLAG(ENABLE_DICE_SUPPORT) +// Returns the base::Value associated with the account, to use in the stored +// accounts list. +base::Value GetAccountValue(const AccountInfo& account, + AccountTrackerService* account_tracker) { + DCHECK(!account.IsEmpty()); + base::Value dictionary(base::Value::Type::DICTIONARY); + dictionary.SetKey("email", base::Value(account.email)); + dictionary.SetKey("fullName", base::Value(account.full_name)); + dictionary.SetKey("givenName", base::Value(account.given_name)); + const gfx::Image& account_image = + account_tracker->GetAccountImage(account.account_id); + if (!account_image.IsEmpty()) { + dictionary.SetKey( + "avatarImage", + base::Value(webui::GetBitmapDataUrl(account_image.AsBitmap()))); + } + return dictionary; +} +#endif // BUILDFLAG(ENABLE_DICE_SUPPORT) + } // namespace namespace settings { @@ -279,6 +300,12 @@ } void PeopleHandler::OnJavascriptAllowed() { + PrefService* prefs = profile_->GetPrefs(); + profile_pref_registrar_.Init(prefs); + profile_pref_registrar_.Add( + prefs::kSigninAllowed, + base::Bind(&PeopleHandler::UpdateSyncStatus, base::Unretained(this))); + SigninManagerBase* signin_manager( SigninManagerFactory::GetInstance()->GetForProfile(profile_)); if (signin_manager) @@ -300,6 +327,7 @@ } void PeopleHandler::OnJavascriptDisallowed() { + profile_pref_registrar_.RemoveAll(); signin_observer_.RemoveAll(); sync_service_observer_.RemoveAll(); #if BUILDFLAG(ENABLE_DICE_SUPPORT) @@ -499,33 +527,35 @@ } std::unique_ptr<base::ListValue> PeopleHandler::GetStoredAccountsList() { - if (!AccountConsistencyModeManager::IsDiceEnabledForProfile(profile_)) { - // During the DICE migration, the settings code should not have access to - // the list of accounts as they should not be visible to the user. - return std::make_unique<base::ListValue>(); - } + std::unique_ptr<base::ListValue> accounts_list = + std::make_unique<base::ListValue>(); + bool dice_enabled = + AccountConsistencyModeManager::IsDiceEnabledForProfile(profile_); - std::vector<AccountInfo> accounts = - signin_ui_util::GetAccountsForDicePromos(profile_); + // Dice and unified consent both disabled: do not show the list of accounts. + if (!dice_enabled && !unified_consent::IsUnifiedConsentFeatureEnabled()) + return accounts_list; AccountTrackerService* account_tracker = AccountTrackerServiceFactory::GetForProfile(profile_); - std::unique_ptr<base::ListValue> accounts_list(new base::ListValue); - accounts_list->Reserve(accounts.size()); - for (auto const& account : accounts) { - accounts_list->GetList().push_back( - base::Value(base::Value::Type::DICTIONARY)); - base::Value& acc = accounts_list->GetList().back(); - acc.SetKey("email", base::Value(account.email)); - acc.SetKey("fullName", base::Value(account.full_name)); - acc.SetKey("givenName", base::Value(account.given_name)); - const gfx::Image& account_image = - account_tracker->GetAccountImage(account.account_id); - if (!account_image.IsEmpty()) { - acc.SetKey( - "avatarImage", - base::Value(webui::GetBitmapDataUrl(account_image.AsBitmap()))); + if (dice_enabled) { + // If dice is enabled, show all the accounts. + std::vector<AccountInfo> accounts = + signin_ui_util::GetAccountsForDicePromos(profile_); + accounts_list->Reserve(accounts.size()); + for (auto const& account : accounts) { + accounts_list->GetList().push_back( + GetAccountValue(account, account_tracker)); + } + } else { + // If dice is disabled (and unified consent enabled), show only the primary + // account. + std::string primary_account = SigninManagerFactory::GetForProfile(profile_) + ->GetAuthenticatedAccountId(); + if (!primary_account.empty()) { + accounts_list->GetList().push_back(GetAccountValue( + account_tracker->GetAccountInfo(primary_account), account_tracker)); } } @@ -933,8 +963,7 @@ bool disallowed_by_policy = service && service->HasDisableReason( syncer::SyncService::DISABLE_REASON_ENTERPRISE_POLICY); - // Sign-in is always allowed for all regular profiles. - sync_status->SetBoolean("signinAllowed", true); + sync_status->SetBoolean("signinAllowed", signin->IsSigninAllowed()); sync_status->SetBoolean("syncSystemEnabled", (service != nullptr)); sync_status->SetBoolean("setupInProgress", service && !disallowed_by_policy &&
diff --git a/chrome/browser/ui/webui/settings/people_handler.h b/chrome/browser/ui/webui/settings/people_handler.h index fd3e9d61..ffdc169 100644 --- a/chrome/browser/ui/webui/settings/people_handler.h +++ b/chrome/browser/ui/webui/settings/people_handler.h
@@ -19,6 +19,7 @@ #include "chrome/browser/sync/sync_startup_tracker.h" #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" #include "chrome/browser/ui/webui/signin/login_ui_service.h" +#include "components/prefs/pref_change_registrar.h" #include "components/signin/core/browser/signin_buildflags.h" #include "components/signin/core/browser/signin_manager_base.h" #include "components/sync/driver/sync_service_observer.h" @@ -120,6 +121,8 @@ FRIEND_TEST_ALL_PREFIXES( PeopleHandlerTest, RestartSyncAfterDashboardClearWithStandaloneTransport); + FRIEND_TEST_ALL_PREFIXES(PeopleHandlerDiceUnifiedConsentTest, + StoredAccountsList); // SettingsPageUIHandler implementation. void RegisterMessages() override; @@ -248,6 +251,9 @@ // service. std::unique_ptr<base::OneShotTimer> engine_start_timer_; + // Used to listen for pref changes to allow or disallow signin. + PrefChangeRegistrar profile_pref_registrar_; + // Manages observer lifetimes. ScopedObserver<SigninManagerBase, PeopleHandler> signin_observer_; ScopedObserver<browser_sync::ProfileSyncService, PeopleHandler>
diff --git a/chrome/browser/ui/webui/settings/people_handler_unittest.cc b/chrome/browser/ui/webui/settings/people_handler_unittest.cc index 0d38ac0..d2f47257 100644 --- a/chrome/browser/ui/webui/settings/people_handler_unittest.cc +++ b/chrome/browser/ui/webui/settings/people_handler_unittest.cc
@@ -14,7 +14,10 @@ #include "base/stl_util.h" #include "base/values.h" #include "build/build_config.h" +#include "chrome/browser/signin/account_tracker_service_factory.h" #include "chrome/browser/signin/fake_signin_manager_builder.h" +#include "chrome/browser/signin/profile_oauth2_token_service_factory.h" +#include "chrome/browser/signin/scoped_account_consistency.h" #include "chrome/browser/signin/signin_error_controller_factory.h" #include "chrome/browser/signin/signin_manager_factory.h" #include "chrome/browser/sync/profile_sync_service_factory.h" @@ -31,10 +34,13 @@ #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" #include "components/prefs/pref_service.h" +#include "components/signin/core/browser/account_tracker_service.h" #include "components/signin/core/browser/fake_auth_status_provider.h" +#include "components/signin/core/browser/profile_oauth2_token_service.h" #include "components/signin/core/browser/signin_manager.h" #include "components/sync/base/sync_prefs.h" #include "components/sync_preferences/pref_service_syncable.h" +#include "components/unified_consent/scoped_unified_consent.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui_controller.h" @@ -1002,4 +1008,63 @@ ExpectPageStatusResponse(PeopleHandler::kConfigurePageStatus); } +#if BUILDFLAG(ENABLE_DICE_SUPPORT) +class PeopleHandlerDiceUnifiedConsentTest + : public ::testing::TestWithParam<std::tuple<bool, bool>> {}; + +TEST_P(PeopleHandlerDiceUnifiedConsentTest, StoredAccountsList) { + content::TestBrowserThreadBundle test_browser_thread_bundle; + + // Decode test parameters. + bool dice_enabled; + bool unified_consent_enabled; + std::tie(dice_enabled, unified_consent_enabled) = GetParam(); + unified_consent::ScopedUnifiedConsent unified_consent( + unified_consent_enabled + ? unified_consent::UnifiedConsentFeatureState::kEnabledWithBump + : unified_consent::UnifiedConsentFeatureState::kDisabled); + ScopedAccountConsistency dice( + dice_enabled ? signin::AccountConsistencyMethod::kDice + : signin::AccountConsistencyMethod::kDiceFixAuthErrors); + + // Setup the profile. + TestingProfile profile; + AccountTrackerService* account_tracker = + AccountTrackerServiceFactory::GetForProfile(&profile); + SigninManager* signin_manager = SigninManagerFactory::GetForProfile(&profile); + ProfileOAuth2TokenService* token_service = + ProfileOAuth2TokenServiceFactory::GetForProfile(&profile); + std::string account_1 = + account_tracker->SeedAccountInfo("1234", "a@gmail.com"); + std::string account_2 = + account_tracker->SeedAccountInfo("5678", "b@gmail.com"); + token_service->UpdateCredentials(account_1, "token"); + token_service->UpdateCredentials(account_2, "token"); + signin_manager->SetAuthenticatedAccountInfo("1234", "a@gmail.com"); + + PeopleHandler handler(&profile); + std::unique_ptr<base::ListValue> accounts_list = + handler.GetStoredAccountsList(); + + if (dice_enabled) { + EXPECT_EQ(2u, accounts_list->GetSize()); + EXPECT_EQ("a@gmail.com", + accounts_list->GetList()[0].FindKey("email")->GetString()); + EXPECT_EQ("b@gmail.com", + accounts_list->GetList()[1].FindKey("email")->GetString()); + } else if (unified_consent_enabled) { + EXPECT_EQ(1u, accounts_list->GetSize()); + EXPECT_EQ("a@gmail.com", + accounts_list->GetList()[0].FindKey("email")->GetString()); + } else { + EXPECT_EQ(0u, accounts_list->GetSize()); + } +} + +INSTANTIATE_TEST_CASE_P(Test, + PeopleHandlerDiceUnifiedConsentTest, + ::testing::Combine(::testing::Bool(), + ::testing::Bool())); +#endif // BUILDFLAG(ENABLE_DICE_SUPPORT) + } // namespace settings
diff --git a/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper_unittest.cc b/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper_unittest.cc index 85efcfa..d962685 100644 --- a/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper_unittest.cc +++ b/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper_unittest.cc
@@ -480,6 +480,38 @@ CheckDelegateCalls(); } +// Tests that the login error is displayed and that the account is kept. +TEST_F(DiceTurnSyncOnHelperTest, CanOfferSigninErrorKeepAccount) { + // Set expectations. + expected_login_error_email_ = kEmail; + // Configure the test. + profile()->GetPrefs()->SetBoolean(prefs::kSigninAllowed, false); + // Signin flow. + CreateDiceTurnOnSyncHelper( + DiceTurnSyncOnHelper::SigninAbortedMode::KEEP_ACCOUNT); + base::RunLoop().RunUntilIdle(); + // Check expectations. + EXPECT_FALSE(signin_manager()->IsAuthenticated()); + EXPECT_TRUE(token_service()->RefreshTokenIsAvailable(account_id())); + CheckDelegateCalls(); +} + +// Tests that the login error is displayed and that the account is removed. +TEST_F(DiceTurnSyncOnHelperTest, CanOfferSigninErrorRemoveAccount) { + // Set expectations. + expected_login_error_email_ = kEmail; + // Configure the test. + profile()->GetPrefs()->SetBoolean(prefs::kSigninAllowed, false); + // Signin flow. + CreateDiceTurnOnSyncHelper( + DiceTurnSyncOnHelper::SigninAbortedMode::REMOVE_ACCOUNT); + base::RunLoop().RunUntilIdle(); + // Check expectations. + EXPECT_FALSE(signin_manager()->IsAuthenticated()); + EXPECT_FALSE(token_service()->RefreshTokenIsAvailable(account_id())); + CheckDelegateCalls(); +} + // Aborts the flow after the cross account dialog. TEST_F(DiceTurnSyncOnHelperTest, CrossAccountAbort) { // Set expectations.
diff --git a/chrome/browser/ui/webui/signin/inline_login_ui_browsertest.cc b/chrome/browser/ui/webui/signin/inline_login_ui_browsertest.cc index 3716f9e..2be52a36 100644 --- a/chrome/browser/ui/webui/signin/inline_login_ui_browsertest.cc +++ b/chrome/browser/ui/webui/signin/inline_login_ui_browsertest.cc
@@ -272,6 +272,7 @@ InlineLoginUIBrowserTest() {} void SetUpSigninManager(const std::string& username); + void EnableSigninAllowed(bool enable); void EnableOneClick(bool enable); void AddEmailToOneClickRejectedList(const std::string& email); void AllowSigninCookies(bool enable); @@ -290,6 +291,11 @@ signin_manager->SetAuthenticatedAccountInfo(username, username); } +void InlineLoginUIBrowserTest::EnableSigninAllowed(bool enable) { + PrefService* pref_service = browser()->profile()->GetPrefs(); + pref_service->SetBoolean(prefs::kSigninAllowed, enable); +} + void InlineLoginUIBrowserTest::EnableOneClick(bool enable) { PrefService* pref_service = browser()->profile()->GetPrefs(); pref_service->SetBoolean(prefs::kReverseAutologinEnabled, enable); @@ -389,6 +395,7 @@ IN_PROC_BROWSER_TEST_F(InlineLoginUIBrowserTest, CanOfferProfileConnected) { SetUpSigninManager("foo@gmail.com"); + EnableSigninAllowed(true); std::string error_message; @@ -418,6 +425,8 @@ } IN_PROC_BROWSER_TEST_F(InlineLoginUIBrowserTest, CanOfferWithRejectedEmail) { + EnableSigninAllowed(true); + AddEmailToOneClickRejectedList("foo@gmail.com"); AddEmailToOneClickRejectedList("user@gmail.com"); @@ -432,6 +441,7 @@ IN_PROC_BROWSER_TEST_F(InlineLoginUIBrowserTest, CanOfferNoSigninCookies) { AllowSigninCookies(false); + EnableSigninAllowed(true); std::string error_message; EXPECT_FALSE(CanOfferSignin(browser()->profile(),
diff --git a/chrome/browser/ui/webui/signin/signin_utils_desktop.cc b/chrome/browser/ui/webui/signin/signin_utils_desktop.cc index f3cf729..7fe0ef7d 100644 --- a/chrome/browser/ui/webui/signin/signin_utils_desktop.cc +++ b/chrome/browser/ui/webui/signin/signin_utils_desktop.cc
@@ -33,10 +33,13 @@ if (!profile) return false; + SigninManager* manager = SigninManagerFactory::GetForProfile(profile); + if (manager && !manager->IsSigninAllowed()) + return false; + if (!ChromeSigninClient::ProfileAllowsSigninCookies(profile)) return false; - SigninManager* manager = SigninManagerFactory::GetForProfile(profile); if (!email.empty()) { if (!manager) return false;
diff --git a/chrome/browser/web_applications/components/pending_app_manager.cc b/chrome/browser/web_applications/components/pending_app_manager.cc index 2dd7ae2..182bf9b8 100644 --- a/chrome/browser/web_applications/components/pending_app_manager.cc +++ b/chrome/browser/web_applications/components/pending_app_manager.cc
@@ -13,14 +13,20 @@ namespace web_app { +const bool PendingAppManager::AppInfo::kDefaultCreateShortcuts = true; +const bool PendingAppManager::AppInfo::kDefaultOverridePreviousUserUninstall = + false; + PendingAppManager::AppInfo::AppInfo(GURL url, LaunchContainer launch_container, InstallSource install_source, - bool create_shortcuts) + bool create_shortcuts, + bool override_previous_user_uninstall) : url(std::move(url)), launch_container(launch_container), install_source(install_source), - create_shortcuts(create_shortcuts) {} + create_shortcuts(create_shortcuts), + override_previous_user_uninstall(override_previous_user_uninstall) {} PendingAppManager::AppInfo::AppInfo(PendingAppManager::AppInfo&& other) = default; @@ -29,17 +35,20 @@ std::unique_ptr<PendingAppManager::AppInfo> PendingAppManager::AppInfo::Clone() const { - std::unique_ptr<AppInfo> other( - new AppInfo(url, launch_container, install_source, create_shortcuts)); + std::unique_ptr<AppInfo> other(new AppInfo(url, launch_container, + install_source, create_shortcuts, + override_previous_user_uninstall)); DCHECK_EQ(*this, *other); return other; } bool PendingAppManager::AppInfo::operator==( const PendingAppManager::AppInfo& other) const { - return std::tie(url, launch_container, install_source, create_shortcuts) == + return std::tie(url, launch_container, install_source, create_shortcuts, + override_previous_user_uninstall) == std::tie(other.url, other.launch_container, other.install_source, - other.create_shortcuts); + other.create_shortcuts, + other.override_previous_user_uninstall); } PendingAppManager::PendingAppManager() = default; @@ -75,7 +84,9 @@ << static_cast<int32_t>(app_info.launch_container) << "\n install_source: " << static_cast<int32_t>(app_info.install_source) - << "\n create_shortcuts: " << app_info.create_shortcuts; + << "\n create_shortcuts: " << app_info.create_shortcuts + << "\n override_previous_user_uninstall: " + << app_info.override_previous_user_uninstall; } } // namespace web_app
diff --git a/chrome/browser/web_applications/components/pending_app_manager.h b/chrome/browser/web_applications/components/pending_app_manager.h index 5a94a7b3..9e6b456 100644 --- a/chrome/browser/web_applications/components/pending_app_manager.h +++ b/chrome/browser/web_applications/components/pending_app_manager.h
@@ -96,10 +96,15 @@ }; struct AppInfo { + static const bool kDefaultCreateShortcuts; + static const bool kDefaultOverridePreviousUserUninstall; + AppInfo(GURL url, LaunchContainer launch_container, InstallSource install_source, - bool create_shortcuts = true); + bool create_shortcuts = kDefaultCreateShortcuts, + bool override_previous_user_uninstall = + kDefaultOverridePreviousUserUninstall); AppInfo(AppInfo&& other); ~AppInfo(); @@ -111,6 +116,7 @@ const LaunchContainer launch_container; const InstallSource install_source; const bool create_shortcuts; + const bool override_previous_user_uninstall; private: DISALLOW_COPY_AND_ASSIGN(AppInfo);
diff --git a/chrome/browser/web_applications/extensions/pending_bookmark_app_manager.cc b/chrome/browser/web_applications/extensions/pending_bookmark_app_manager.cc index 9d65121..4ea8641 100644 --- a/chrome/browser/web_applications/extensions/pending_bookmark_app_manager.cc +++ b/chrome/browser/web_applications/extensions/pending_bookmark_app_manager.cc
@@ -167,21 +167,26 @@ std::move(pending_tasks_and_callbacks_.front()); pending_tasks_and_callbacks_.pop_front(); + const web_app::PendingAppManager::AppInfo& app_info = + front->task->app_info(); base::Optional<std::string> extension_id = - extension_ids_map_.LookupExtensionId(front->task->app_info().url); + extension_ids_map_.LookupExtensionId(app_info.url); if (extension_id) { base::Optional<bool> opt = IsExtensionPresentAndInstalled(extension_id.value()); if (opt.has_value()) { - // TODO(crbug.com/878262): Handle the case where the app is already - // installed but from a different source. - std::move(front->callback) - .Run(front->task->app_info().url, - opt.value() - ? web_app::InstallResultCode::kAlreadyInstalled - : web_app::InstallResultCode::kPreviouslyUninstalled); - continue; + bool installed = opt.value(); + if (installed || !app_info.override_previous_user_uninstall) { + // TODO(crbug.com/878262): Handle the case where the app is already + // installed but from a different source. + std::move(front->callback) + .Run(app_info.url, + installed + ? web_app::InstallResultCode::kAlreadyInstalled + : web_app::InstallResultCode::kPreviouslyUninstalled); + continue; + } } }
diff --git a/chrome/browser/web_applications/extensions/pending_bookmark_app_manager_unittest.cc b/chrome/browser/web_applications/extensions/pending_bookmark_app_manager_unittest.cc index db564c7..88a7fe5 100644 --- a/chrome/browser/web_applications/extensions/pending_bookmark_app_manager_unittest.cc +++ b/chrome/browser/web_applications/extensions/pending_bookmark_app_manager_unittest.cc
@@ -41,10 +41,14 @@ const char kWrongUrl[] = "https://foobar.example"; -web_app::PendingAppManager::AppInfo GetFooAppInfo() { +web_app::PendingAppManager::AppInfo GetFooAppInfo( + bool override_previous_user_uninstall = web_app::PendingAppManager:: + AppInfo::kDefaultOverridePreviousUserUninstall) { return web_app::PendingAppManager::AppInfo( GURL(kFooWebAppUrl), web_app::PendingAppManager::LaunchContainer::kTab, - web_app::PendingAppManager::InstallSource::kExternalPolicy); + web_app::PendingAppManager::InstallSource::kExternalPolicy, + web_app::PendingAppManager::AppInfo::kDefaultCreateShortcuts, + override_previous_user_uninstall); } web_app::PendingAppManager::AppInfo GetBarAppInfo() { @@ -882,7 +886,6 @@ EXPECT_EQ(1u, installation_task_run_count()); EXPECT_TRUE(app_installed()); - ResetResults(); // Simulate the extension for the app getting uninstalled. @@ -926,7 +929,6 @@ EXPECT_EQ(1u, installation_task_run_count()); EXPECT_TRUE(app_installed()); - ResetResults(); // Simulate external extension for the app getting uninstalled by the user. @@ -934,7 +936,6 @@ ExtensionRegistry::Get(profile())->RemoveEnabled(app_id); ExtensionPrefs::Get(profile())->OnExtensionUninstalled( app_id, Manifest::EXTERNAL_POLICY, false /* external_uninstall */); - ResetResults(); // Trying to uninstall the app should fail and have no effect. pending_app_manager->UninstallApps( @@ -946,17 +947,27 @@ EXPECT_EQ(GURL(kFooWebAppUrl), uninstall_callback_url()); EXPECT_FALSE(last_uninstall_successful()); EXPECT_EQ(0u, uninstalls_count()); + ResetResults(); - pending_app_manager->Install( - GetFooAppInfo(), - base::BindOnce(&PendingBookmarkAppManagerTest::InstallCallback, - base::Unretained(this))); - base::RunLoop().RunUntilIdle(); + // The extension was uninstalled by the user. Installing again should succeed + // or fail depending on whether we set override_previous_user_uninstall. We + // try with override_previous_user_uninstall false first, true second. + for (unsigned int i = 0; i < 2; i++) { + bool override_previous_user_uninstall = i > 0; - // The extension was uninstalled by the user, we shouldn't try to install it - // again. - EXPECT_EQ(0u, installation_task_run_count()); - EXPECT_FALSE(app_installed()); + pending_app_manager->Install( + GetFooAppInfo(override_previous_user_uninstall), + base::BindOnce(&PendingBookmarkAppManagerTest::InstallCallback, + base::Unretained(this))); + base::RunLoop().RunUntilIdle(); + if (override_previous_user_uninstall) { + SuccessfullyLoad(GURL(kFooWebAppUrl)); + } + + EXPECT_EQ(i, installation_task_run_count()); + EXPECT_EQ(override_previous_user_uninstall, app_installed()); + ResetResults(); + } } TEST_F(PendingBookmarkAppManagerTest, UninstallApps_Succeeds) { @@ -970,7 +981,6 @@ SuccessfullyLoad(GURL(kFooWebAppUrl)); EXPECT_TRUE(app_installed()); - ResetResults(); pending_app_manager->UninstallApps(
diff --git a/chrome/test/data/policy/policy_test_cases.json b/chrome/test/data/policy/policy_test_cases.json index 3fbb3472..d08eed9 100644 --- a/chrome/test/data/policy/policy_test_cases.json +++ b/chrome/test/data/policy/policy_test_cases.json
@@ -637,7 +637,11 @@ }, "SigninAllowed": { - "note": "This policy has been removed in Chrome 70." + "os": ["win", "linux", "mac"], + "test_policy": { "SigninAllowed": true }, + "pref_mappings": [ + { "pref": "signin.allowed" } + ] }, "EnableDeprecatedWebBasedSignin": {
diff --git a/chrome/test/data/webui/settings/a11y/sign_out_a11y_test.js b/chrome/test/data/webui/settings/a11y/sign_out_a11y_test.js index 1e9db84..160ac02 100644 --- a/chrome/test/data/webui/settings/a11y/sign_out_a11y_test.js +++ b/chrome/test/data/webui/settings/a11y/sign_out_a11y_test.js
@@ -27,6 +27,7 @@ extraLibraries: SettingsAccessibilityTest.prototype.extraLibraries.concat([ '../../test_browser_proxy.js', '../sync_test_util.js', + '../test_util.js', '../test_sync_browser_proxy.js', ]), }; @@ -74,28 +75,38 @@ /** @override */ tests: { 'Accessible Dialog': function() { - return this.browserProxy.getSyncStatus().then((syncStatus) => { - // Navigate to the sign out dialog. - Polymer.dom.flush(); - disconnectButton = null; - if (this.peoplePage.diceEnabled_) { - const syncAccountControl = - this.peoplePage.$$('settings-sync-account-control'); - syncAccountControl.syncStatus = { - signedIn: true, - signedInUsername: 'bar@bar.com', - statusAction: settings.StatusAction.NO_ACTION, - hasError: false, - disabled: false, - }; - disconnectButton = syncAccountControl.$$('#turn-off'); - } else { - disconnectButton = this.peoplePage.$$('#disconnectButton'); - } - assert(!!disconnectButton); - disconnectButton.click(); - Polymer.dom.flush(); - }); + let parent = null; + let disconnectButtonSelector = null; + + return this.browserProxy.getSyncStatus() + .then(syncStatus => { + // Navigate to the sign out dialog. + Polymer.dom.flush(); + + if (this.peoplePage.diceEnabled_) { + const syncAccountControl = + this.peoplePage.$$('settings-sync-account-control'); + syncAccountControl.syncStatus = { + signedIn: true, + signedInUsername: 'bar@bar.com', + statusAction: settings.StatusAction.NO_ACTION, + hasError: false, + disabled: false, + }; + parent = syncAccountControl; + disconnectButtonSelector = '#turn-off'; + } else { + parent = this.peoplePage; + disconnectButtonSelector = '#disconnectButton'; + } + return test_util.waitForRender(parent); + }) + .then(() => { + disconnectButton = parent.$$(disconnectButtonSelector); + assert(!!disconnectButton); + disconnectButton.click(); + Polymer.dom.flush(); + }); } }, /** @override */
diff --git a/chromeos/CHROMEOS_LKGM b/chromeos/CHROMEOS_LKGM index c894b7a..7f86a88 100644 --- a/chromeos/CHROMEOS_LKGM +++ b/chromeos/CHROMEOS_LKGM
@@ -1 +1 @@ -11085.0.0 \ No newline at end of file +11099.0.0 \ No newline at end of file
diff --git a/chromeos/components/drivefs/drivefs_host.cc b/chromeos/components/drivefs/drivefs_host.cc index 7d27860..68df4456 100644 --- a/chromeos/components/drivefs/drivefs_host.cc +++ b/chromeos/components/drivefs/drivefs_host.cc
@@ -180,7 +180,7 @@ mint_token_flow_ = host_->delegate_->CreateMintTokenFlow(this, client_id, app_id, scopes); DCHECK(mint_token_flow_); - host_->GetIdentityManager().GetPrimaryAccountWhenAvailable(base::BindOnce( + GetIdentityManager().GetPrimaryAccountWhenAvailable(base::BindOnce( &DriveFsHost::MountState::AccountReady, base::Unretained(this))); } @@ -255,7 +255,7 @@ void AccountReady(const AccountInfo& info, const identity::AccountState& state) { - host_->GetIdentityManager().GetAccessToken( + GetIdentityManager().GetAccessToken( host_->delegate_->GetAccountId().GetUserEmail(), {}, kIdentityConsumerId, base::BindOnce(&DriveFsHost::MountState::GotChromeAccessToken, @@ -293,6 +293,15 @@ mint_token_flow_.reset(); } + identity::mojom::IdentityManager& GetIdentityManager() { + DCHECK_CALLED_ON_VALID_SEQUENCE(host_->sequence_checker_); + if (!identity_manager_) { + host_->delegate_->GetConnector()->BindInterface( + identity::mojom::kServiceName, mojo::MakeRequest(&identity_manager_)); + } + return *identity_manager_; + } + // Owns |this|. DriveFsHost* const host_; @@ -322,6 +331,9 @@ bool drivefs_has_mounted_ = false; bool drivefs_has_terminated_ = false; + // The connection to the identity service. Access via |GetIdentityManager()|. + identity::mojom::IdentityManagerPtr identity_manager_; + DISALLOW_COPY_AND_ASSIGN(MountState); }; @@ -401,13 +413,4 @@ } } -identity::mojom::IdentityManager& DriveFsHost::GetIdentityManager() { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (!identity_manager_) { - delegate_->GetConnector()->BindInterface( - identity::mojom::kServiceName, mojo::MakeRequest(&identity_manager_)); - } - return *identity_manager_; -} - } // namespace drivefs
diff --git a/chromeos/components/drivefs/drivefs_host.h b/chromeos/components/drivefs/drivefs_host.h index e556933..937d9450 100644 --- a/chromeos/components/drivefs/drivefs_host.h +++ b/chromeos/components/drivefs/drivefs_host.h
@@ -115,9 +115,6 @@ SEQUENCE_CHECKER(sequence_checker_); - // Returns the connection to the identity service, connecting lazily. - identity::mojom::IdentityManager& GetIdentityManager(); - // The path to the user's profile. const base::FilePath profile_path_; @@ -128,9 +125,6 @@ // State specific to the current mount, or null if not mounted. std::unique_ptr<MountState> mount_state_; - // The connection to the identity service. Access via |GetIdentityManager()|. - identity::mojom::IdentityManagerPtr identity_manager_; - base::ObserverList<DriveFsHostObserver>::Unchecked observers_; DISALLOW_COPY_AND_ASSIGN(DriveFsHost);
diff --git a/chromeos/components/drivefs/drivefs_host_unittest.cc b/chromeos/components/drivefs/drivefs_host_unittest.cc index c9fabe7..76098cf 100644 --- a/chromeos/components/drivefs/drivefs_host_unittest.cc +++ b/chromeos/components/drivefs/drivefs_host_unittest.cc
@@ -174,6 +174,8 @@ const std::string& account_id, const ::identity::ScopeSet& scopes, const std::string& consumer_id)); + + mojo::BindingSet<identity::mojom::IdentityManager>* bindings_ = nullptr; }; class FakeIdentityService @@ -184,8 +186,11 @@ binder_registry_.AddInterface( base::BindRepeating(&FakeIdentityService::BindIdentityManagerRequest, base::Unretained(this))); + mock_->bindings_ = &bindings_; } + ~FakeIdentityService() override { mock_->bindings_ = nullptr; } + private: void OnBindInterface(const service_manager::BindSourceInfo& source, const std::string& interface_name, @@ -780,6 +785,30 @@ run_loop.Run(); } +TEST_F(DriveFsHostTest, GetAccessToken_UnmountDuringMojoRequest) { + ASSERT_NO_FATAL_FAILURE(DoMount()); + + EXPECT_CALL(mock_identity_manager_, + GetAccessToken("test@example.com", _, "drivefs")) + .WillOnce(testing::DoAll( + testing::InvokeWithoutArgs([&]() { host_->Unmount(); }), + testing::Return(std::make_pair( + base::nullopt, GoogleServiceAuthError::ACCOUNT_DISABLED)))); + host_delegate_->mock_flow().ExpectNoStartCalls(); + + base::RunLoop run_loop; + delegate_ptr_.set_connection_error_handler(run_loop.QuitClosure()); + delegate_ptr_->GetAccessToken( + "client ID", "app ID", {"scope1", "scope2"}, + base::BindLambdaForTesting([](mojom::AccessTokenStatus status, + const std::string& token) { FAIL(); })); + run_loop.Run(); + EXPECT_FALSE(host_->IsMounted()); + + // Wait for the response to reach the InterfacePtr if it's still open. + mock_identity_manager_.bindings_->FlushForTesting(); +} + ACTION_P(CloneStruct, output) { *output = arg0.Clone(); }
diff --git a/chromeos/services/ime/BUILD.gn b/chromeos/services/ime/BUILD.gn index a16c509..05ec79d 100644 --- a/chromeos/services/ime/BUILD.gn +++ b/chromeos/services/ime/BUILD.gn
@@ -18,6 +18,19 @@ "rulebased/controller.cc", "rulebased/controller.h", "rulebased/def/ar.h", + "rulebased/def/ckb_ar.h", + "rulebased/def/ckb_en.h", + "rulebased/def/fa.h", + "rulebased/def/km.h", + "rulebased/def/lo.h", + "rulebased/def/ne_inscript.h", + "rulebased/def/ru_phone_aatseel.h", + "rulebased/def/ru_phone_yazhert.h", + "rulebased/def/ta_inscript.h", + "rulebased/def/ta_typewriter.h", + "rulebased/def/th.h", + "rulebased/def/th_pattajoti.h", + "rulebased/def/th_tis.h", "rulebased/rules_data.cc", "rulebased/rules_data.h", ]
diff --git a/chromeos/services/ime/ime_service_unittest.cc b/chromeos/services/ime/ime_service_unittest.cc index 0ed52074..eceb940 100644 --- a/chromeos/services/ime/ime_service_unittest.cc +++ b/chromeos/services/ime/ime_service_unittest.cc
@@ -16,7 +16,6 @@ #include "services/service_manager/public/cpp/service_test.h" #include "services/service_manager/public/mojom/service_factory.mojom.h" #include "testing/gmock/include/gmock/gmock.h" -#include "testing/gtest/include/gtest/gtest.h" using testing::_; @@ -139,7 +138,7 @@ // Tests that the service is instantiated and it will return false when // activating an IME engine with an invalid IME spec. TEST_F(ImeServiceTest, ConnectInvalidImeEngine) { - bool success = false; + bool success = true; TestClientChannel test_channel; mojom::InputChannelPtr to_engine_ptr; @@ -151,9 +150,53 @@ EXPECT_FALSE(success); } +TEST_F(ImeServiceTest, MultipleClients) { + bool success = false; + TestClientChannel test_channel; + mojom::InputChannelPtr to_engine_ptr1; + mojom::InputChannelPtr to_engine_ptr2; + + ime_manager_->ConnectToImeEngine( + "m17n:ar", mojo::MakeRequest(&to_engine_ptr1), + test_channel.CreateInterfacePtrAndBind(), extra, + base::BindOnce(&ConnectCallback, &success)); + ime_manager_.FlushForTesting(); + + ime_manager_->ConnectToImeEngine( + "m17n:ar", mojo::MakeRequest(&to_engine_ptr2), + test_channel.CreateInterfacePtrAndBind(), extra, + base::BindOnce(&ConnectCallback, &success)); + ime_manager_.FlushForTesting(); + + std::string response; + std::string process_text_key = + "{\"method\":\"keyEvent\",\"type\":\"keydown\"" + ",\"code\":\"KeyA\",\"shift\":true,\"altgr\":false,\"caps\":false}"; + to_engine_ptr1->ProcessText( + process_text_key, base::BindOnce(&TestProcessTextCallback, &response)); + to_engine_ptr1.FlushForTesting(); + + to_engine_ptr2->ProcessText( + process_text_key, base::BindOnce(&TestProcessTextCallback, &response)); + to_engine_ptr2.FlushForTesting(); + + std::string process_text_key_count = "{\"method\":\"countKey\"}"; + to_engine_ptr1->ProcessText( + process_text_key_count, + base::BindOnce(&TestProcessTextCallback, &response)); + to_engine_ptr1.FlushForTesting(); + EXPECT_EQ("1", response); + + to_engine_ptr2->ProcessText( + process_text_key_count, + base::BindOnce(&TestProcessTextCallback, &response)); + to_engine_ptr2.FlushForTesting(); + EXPECT_EQ("1", response); +} + // Tests that the rule-based Arabic keyboard can work correctly. TEST_F(ImeServiceTest, RuleBasedArabic) { - bool success = true; + bool success = false; TestClientChannel test_channel; mojom::InputChannelPtr to_engine_ptr;
diff --git a/chromeos/services/ime/input_engine.cc b/chromeos/services/ime/input_engine.cc index a17dfff3..e4ff835c 100644 --- a/chromeos/services/ime/input_engine.cc +++ b/chromeos/services/ime/input_engine.cc
@@ -25,10 +25,19 @@ } // namespace -InputEngine::InputEngine() { - rule_based_controller_ = std::make_unique<rulebased::Controller>(); +InputEngineContext::InputEngineContext(const std::string& ime) : ime_spec(ime) { + // The |ime_spec|'s format for rule based imes is: "m17n:<id>". + std::string id = GetIdFromImeSpec(ime_spec); + if (rulebased::Controller::IsImeSupported(id)) { + controller = std::make_unique<rulebased::Controller>(); + controller->Activate(id); + } } +InputEngineContext::~InputEngineContext() {} + +InputEngine::InputEngine() {} + InputEngine::~InputEngine() {} bool InputEngine::BindRequest(const std::string& ime_spec, @@ -38,19 +47,21 @@ if (!IsImeSupported(ime_spec)) return false; - channel_bindings_.AddBinding(this, std::move(request), ime_spec); + channel_bindings_.AddBinding(this, std::move(request), + std::make_unique<InputEngineContext>(ime_spec)); + return true; // TODO(https://crbug.com/837156): Registry connection error handler. } bool InputEngine::IsImeSupported(const std::string& ime_spec) { - return rule_based_controller_->IsImeSupported(GetIdFromImeSpec(ime_spec)); + return rulebased::Controller::IsImeSupported(GetIdFromImeSpec(ime_spec)); } void InputEngine::ProcessText(const std::string& message, ProcessTextCallback callback) { - auto& ime_spec = channel_bindings_.dispatch_context(); - std::string result = Process(message, ime_spec); + auto& context = channel_bindings_.dispatch_context(); + std::string result = Process(message, context.get()); std::move(callback).Run(result); } @@ -60,14 +71,12 @@ } const std::string InputEngine::Process(const std::string& message, - const std::string& ime_spec) { - // The |ime_spec|'s format for rule based imes is: "m17n:<id>". - std::string id = GetIdFromImeSpec(ime_spec); - if (id.empty()) + const InputEngineContext* context) { + std::string ime_spec = context->ime_spec; + auto& controller = context->controller; + if (!controller) return base::EmptyString(); - rule_based_controller_->Activate(id); - const char* false_response = "{\"result\":false}"; // The request message is in JSON format as: @@ -96,8 +105,12 @@ return false_response; const std::string& method_str = method->GetString(); + if (method_str == "countKey") { + return std::to_string(controller->process_key_count()); + } + if (method_str == "reset") { - rule_based_controller_->Reset(); + controller->Reset(); return "{\"result\":true}"; } @@ -123,7 +136,7 @@ modifiers |= rulebased::MODIFIER_CAPSLOCK; rulebased::ProcessKeyResult res = - rule_based_controller_->ProcessKey(code->GetString(), modifiers); + controller->ProcessKey(code->GetString(), modifiers); // The response message is in JSON format as: // {
diff --git a/chromeos/services/ime/input_engine.h b/chromeos/services/ime/input_engine.h index 2ce83b2..c853d68 100644 --- a/chromeos/services/ime/input_engine.h +++ b/chromeos/services/ime/input_engine.h
@@ -15,6 +15,18 @@ class Controller; } +class InputEngineContext { + public: + InputEngineContext(const std::string& ime); + ~InputEngineContext(); + + std::string ime_spec; + std::unique_ptr<rulebased::Controller> controller; + + private: + DISALLOW_COPY_AND_ASSIGN(InputEngineContext); +}; + // A basic implementation of InputEngine without using any decoder. class InputEngine : public mojom::InputChannel { public: @@ -41,11 +53,10 @@ private: const std::string Process(const std::string& message, - const std::string& ime_spec); + const InputEngineContext* context); - mojo::BindingSet<mojom::InputChannel, std::string> channel_bindings_; - - std::unique_ptr<rulebased::Controller> rule_based_controller_; + mojo::BindingSet<mojom::InputChannel, std::unique_ptr<InputEngineContext>> + channel_bindings_; DISALLOW_COPY_AND_ASSIGN(InputEngine); };
diff --git a/chromeos/services/ime/rulebased/controller.cc b/chromeos/services/ime/rulebased/controller.cc index 473e410e..8b40ef8 100644 --- a/chromeos/services/ime/rulebased/controller.cc +++ b/chromeos/services/ime/rulebased/controller.cc
@@ -10,9 +10,14 @@ namespace ime { namespace rulebased { -Controller::Controller() {} +Controller::Controller() : process_key_count_(0) {} Controller::~Controller() {} +// static +bool Controller::IsImeSupported(const std::string& id) { + return RulesData::IsIdSupported(id); +} + void Controller::Activate(const std::string& id) { if (current_id_ != id) { Reset(); @@ -21,16 +26,15 @@ } } -bool Controller::IsImeSupported(const std::string& id) { - return RulesData::IsIdSupported(id); -} - void Controller::Reset() { // TODO(shuchen): Implement this for the ones with transform rules. + process_key_count_ = 0; } ProcessKeyResult Controller::ProcessKey(const std::string& code, uint8_t modifier_state) { + process_key_count_++; + ProcessKeyResult res; if (!current_data_) return res;
diff --git a/chromeos/services/ime/rulebased/controller.h b/chromeos/services/ime/rulebased/controller.h index 09fde85..d921261 100644 --- a/chromeos/services/ime/rulebased/controller.h +++ b/chromeos/services/ime/rulebased/controller.h
@@ -33,14 +33,18 @@ Controller(); ~Controller(); + static bool IsImeSupported(const std::string& id); + void Activate(const std::string& id); - bool IsImeSupported(const std::string& id); void Reset(); ProcessKeyResult ProcessKey(const std::string& code, uint8_t modifier_state); + uint32_t process_key_count() const { return process_key_count_; } + private: std::unique_ptr<const RulesData> current_data_; std::string current_id_; + uint32_t process_key_count_; DISALLOW_COPY_AND_ASSIGN(Controller); };
diff --git a/chromeos/services/ime/rulebased/def/ckb_ar.h b/chromeos/services/ime/rulebased/def/ckb_ar.h new file mode 100644 index 0000000..35905a0 --- /dev/null +++ b/chromeos/services/ime/rulebased/def/ckb_ar.h
@@ -0,0 +1,36 @@ +// 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_IME_RULEBASED_DEF_CKB_AR_H_ +#define CHROMEOS_SERVICES_IME_RULEBASED_DEF_CKB_AR_H_ + +const wchar_t* key_map_ckb_ar[] = { + // Row #1 + L"\u0698\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u0660-=" + // Row #2 + L"\u0686\u0635\u067e\u0642\u0641\u063a\u0639\u0647\u062e\u062d\u062c\u062f" + L"\\" + // Row #3 + L"\u0634\u0633\u06cc\u0628\u0644\u0627\u062a\u0646\u0645\u06a9\u06af" + // Row #4 + L"\u0626\u0621\u06c6\u0631{{\u0644\u0627}}\u0649{{\u0647\u200c}}\u0648" + L"\u0632/" + // Row #5 + L"\u0020", + // Row #1 + L"~!@#$%\u00bb\u00ab*)(_+" + // Row #2 + L"\u0636}\u062b{\u06a4\u0625{{}}'\"\u061b><|" + // Row #3 + L"][\u06ce{{}}\u06b5\u0623\u0640\u060c/:\u0637" + // Row #4 + L"\u2904{{\u0648\u0648}}\u0624\u0695{{\u06b5\u0627}}\u0622\u0629,.\u061f" + // Row #5 + L"\u200c"}; + +const uint8_t key_map_index_ckb_ar[8]{0, 1, 0, 1, 0, 1, 0, 0}; +const char* id_ckb_ar = "ckb_ar"; +const bool is_102_ckb_ar = false; + +#endif // CHROMEOS_SERVICES_IME_RULEBASED_DEF_CKB_AR_H_
diff --git a/chromeos/services/ime/rulebased/def/ckb_en.h b/chromeos/services/ime/rulebased/def/ckb_en.h new file mode 100644 index 0000000..a797757 --- /dev/null +++ b/chromeos/services/ime/rulebased/def/ckb_en.h
@@ -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. + +#ifndef CHROMEOS_SERVICES_IME_RULEBASED_DEF_CKB_EN_H_ +#define CHROMEOS_SERVICES_IME_RULEBASED_DEF_CKB_EN_H_ + +const wchar_t* key_map_ckb_en[] = { + // Row #1 + L"\u20ac\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u0660-=" + // Row #2 + L"\u0642\u0648\u06d5\u0631\u062a\u06cc\u0626\u062d\u06c6\u067e}{\\" + // Row #3 + L"\u0627\u0633\u062f\u0641\u06af\u0647\u0698\u06a9\u0644\u061b'" + // Row #4 + L"\u0632\u062e\u062c\u06a4\u0628\u0646\u0645\u060c./" + // Row #5 + L"\u0020", + // Row #1 + L"~!@#$%\u00bb\u00ab*)(_+" + // Row #2 + L"`{{\u0648\u0648}}\u064a\u0695\u0637\u06ce\u0621\u0639\u0624\u062b][|" + // Row #3 + L"\u0622\u0634\u0630\u0625\u063a\u200c\u0623\u0643\u06b5:\"" + // Row #4 + L"\u0636\u0635\u0686\u0638\u0649\u0629\u0640><\u061f" + // Row #5 + L"\u200c"}; + +const uint8_t key_map_index_ckb_en[8]{0, 1, 0, 1, 0, 1, 0, 0}; +const char* id_ckb_en = "ckb_en"; +const bool is_102_ckb_en = false; + +#endif // CHROMEOS_SERVICES_IME_RULEBASED_DEF_CKB_EN_H_
diff --git a/chromeos/services/ime/rulebased/def/fa.h b/chromeos/services/ime/rulebased/def/fa.h new file mode 100644 index 0000000..a52ad96 --- /dev/null +++ b/chromeos/services/ime/rulebased/def/fa.h
@@ -0,0 +1,45 @@ +// 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_IME_RULEBASED_DEF_FA_H_ +#define CHROMEOS_SERVICES_IME_RULEBASED_DEF_FA_H_ + +const wchar_t* key_map_fa[] = { + // Row #1 + L"\u200d\u06f1\u06f2\u06f3\u06f4\u06f5\u06f6\u06f7\u06f8\u06f9\u06f0-=" + // Row #2 + L"\u0636\u0635\u062b\u0642\u0641\u063a\u0639\u0647\u062e\u062d\u062c\u0686" + L"\\" + // Row #3 + L"\u0634\u0633\u06cc\u0628\u0644\u0627\u062a\u0646\u0645\u06a9\u06af" + // Row #4 + L"\u0638\u0637\u0632\u0631\u0630\u062f\u067e\u0648./" + // Row #5 + L"\u0020", + // Row #1 + L"{{}}!\u066c\u066b{{\u0631\u06cc\u0627\u0644}}\u066a\u00d7\u060c*)(\u0640+" + // Row #2 + L"\u0652\u064c\u064d\u064b\u064f\u0650\u064e\u0651][}{|" + // Row #3 + L"\u0624\u0626\u064a\u0625\u0623\u0622\u0629\u00bb\u00ab:\u061b" + // Row #4 + L"\u0643{{}}\u0698{{}}\u200c{{}}\u0621<>\u061f" + // Row #5 + L"\u200c", + // Row #1 + L"~`@#$%^&\u2022\u200e\u200f_\u2212" + // Row #2 + L"\u00b0{{}}\u20ac{{}}{{}}{{}}{{}}\u202d\u202e\u202c\u202a\u202b\u2010" + // Row #3 + L"{{}}{{}}\u0649{{}}{{}}\u0671{{}}\ufd3e\ufd3f;\"" + // Row #4 + L"\u00a0{{}}{{}}\u0656\u200d\u0655\u2026,'?" + // Row #5 + L"\u0020"}; + +const uint8_t key_map_index_fa[8]{0, 1, 2, 1, 0, 1, 0, 1}; +const char* id_fa = "fa"; +const bool is_102_fa = false; + +#endif // CHROMEOS_SERVICES_IME_RULEBASED_DEF_FA_H_
diff --git a/chromeos/services/ime/rulebased/def/km.h b/chromeos/services/ime/rulebased/def/km.h new file mode 100644 index 0000000..f50e9f8 --- /dev/null +++ b/chromeos/services/ime/rulebased/def/km.h
@@ -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. + +#ifndef CHROMEOS_SERVICES_IME_RULEBASED_DEF_KM_H_ +#define CHROMEOS_SERVICES_IME_RULEBASED_DEF_KM_H_ + +const wchar_t* key_map_km[] = { + // Row #1 + L"\u00ab\u17e1\u17e2\u17e3\u17e4\u17e5\u17e6\u17e7\u17e8\u17e9\u17e0\u17a5" + L"\u17b2" + // Row #2 + L"\u1786\u17b9\u17c1\u179a\u178f\u1799\u17bb\u17b7\u17c4\u1795\u17c0\u17aa" + L"\u17ae" + // Row #3 + L"\u17b6\u179f\u178a\u1790\u1784\u17a0\u17d2\u1780\u179b\u17be\u17cb" + // Row #4 + L"\u178b\u1781\u1785\u179c\u1794\u1793\u1798{{\u17bb\u17c6}}\u17d4\u17ca" + // Row #5 + L"\u200b", + // Row #1 + L"\u00bb!\u17d7\"\u17db%\u17cd\u17d0\u17cf()\u17cc=" + // Row #2 + L"\u1788\u17ba\u17c2\u17ac\u1791\u17bd\u17bc\u17b8\u17c5\u1797\u17bf\u17a7" + L"\u17ad" + // Row #3 + L"{{\u17b6\u17c6}}\u17c3\u178c\u1792\u17a2\u17c7\u1789\u1782\u17a1{{\u17c4" + L"\u17c7}}\u17c9" + // Row #4 + L"\u178d\u1783\u1787{{\u17c1\u17c7}}\u1796\u178e\u17c6{{\u17bb\u17c7}}" + L"\u17d5?" + // Row #5 + L"\u0020", + // Row #1 + L"\u200d\u200c@\u17d1$\u20ac\u17d9\u17da*{}\u00d7\u17ce" + // Row #2 + L"\u17dc\u17dd\u17af\u17ab\u17a8{{}}{{}}\u17a6\u17b1\u17b0\u17a9\u17b3\\" + // Row #3 + L"+-{{}}{{}}{{}}{{}}{{}}\u179d{{}}\u17d6\u17c8" + // Row #4 + L"{{}}{{}}{{}}{{}}\u179e{{}}{{}},./" + // Row #5 + L"\u0020", + // Row #1 + L"{{}}\u17f1\u17f2\u17f3\u17f4\u17f5\u17f6\u17f7\u17f8\u17f9\u17f0{{}}{{}}" + // Row #2 + L"\u19e0\u19e1\u19e2\u19e3\u19e4\u19e5\u19e6\u19e7\u19e8\u19e9\u19ea\u19eb{" + L"{}}" + // Row #3 + L"\u19ec\u19ed\u19ee\u19ef\u19f0\u19f1\u19f2\u19f3\u19f4\u19f5\u19f6" + // Row #4 + L"\u19f7\u19f8\u19f9\u19fa\u19fb\u19fc\u19fd\u19fe\u19ff{{}}" + // Row #5 + L"\u0020"}; + +const uint8_t key_map_index_km[8]{0, 1, 2, 3, 1, 0, 3, 2}; +const char* id_km = "km"; +const bool is_102_km = false; + +#endif // CHROMEOS_SERVICES_IME_RULEBASED_DEF_KM_H_
diff --git a/chromeos/services/ime/rulebased/def/lo.h b/chromeos/services/ime/rulebased/def/lo.h new file mode 100644 index 0000000..1c0c525 --- /dev/null +++ b/chromeos/services/ime/rulebased/def/lo.h
@@ -0,0 +1,46 @@ +// 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_IME_RULEBASED_DEF_LO_H_ +#define CHROMEOS_SERVICES_IME_RULEBASED_DEF_LO_H_ + +const wchar_t* key_map_lo[] = { + // Row #1 + L"*\u0ea2\u0e9f\u0ec2\u0e96\u0eb8\u0eb9\u0e84\u0e95\u0e88\u0e82\u0e8a\u0ecd" + // Row #2 + L"\u0ebb\u0ec4\u0eb3\u0e9e\u0eb0\u0eb4\u0eb5\u0eae\u0e99\u0e8d\u0e9a\u0ea5" + L"\u201c" + // Row #3 + L"\u0eb1\u0eab\u0e81\u0e94\u0ec0\u0ec9\u0ec8\u0eb2\u0eaa\u0ea7\u0e87" + // Row #4 + L"\u0e9c\u0e9b\u0ec1\u0ead\u0eb6\u0eb7\u0e97\u0ea1\u0ec3\u0e9d" + // Row #5 + L"\u0020", + // Row #1 + L"/1234\u0ecc\u0ebc56789{{\u0ecd\u0ec8}}" + // Row #2 + L"{{\u0ebb\u0ec9}}0{{\u0eb3\u0ec9}}_+{{\u0eb4\u0ec9}}{{\u0eb5\u0ec9}}\u0ea3" + L"\u0edc\u0ebd-{{\u0eab\u0ebc}}\u201d" + // Row #3 + L"{{\u0eb1\u0ec9}};.,:\u0eca\u0ecb!?%=" + // Row #4 + L"\u20ad(\u0eafx{{\u0eb6\u0ec9}}{{\u0eb7\u0ec9}}\u0ec6\u0edd$)" + // Row #5 + L"\u0020", + // Row #1 + L"{{}}\u0ed1\u0ed2\u0ed3\u0ed4\u0ed5\u0ed6\u0ed7\u0ed8\u0ed9\u0ed0{{}}{{}}" + // Row #2 + L"{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}" + // Row #3 + L"{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}" + // Row #4 + L"{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}" + // Row #5 + L"\u0020"}; + +const uint8_t key_map_index_lo[8]{0, 1, 2, 1, 0, 1, 2, 1}; +const char* id_lo = "lo"; +const bool is_102_lo = false; + +#endif // CHROMEOS_SERVICES_IME_RULEBASED_DEF_LO_H_
diff --git a/chromeos/services/ime/rulebased/def/ne_inscript.h b/chromeos/services/ime/rulebased/def/ne_inscript.h new file mode 100644 index 0000000..82384fb3 --- /dev/null +++ b/chromeos/services/ime/rulebased/def/ne_inscript.h
@@ -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. + +#ifndef CHROMEOS_SERVICES_IME_RULEBASED_DEF_NE_INSCRIPT_H_ +#define CHROMEOS_SERVICES_IME_RULEBASED_DEF_NE_INSCRIPT_H_ + +const wchar_t* key_map_ne_inscript[] = { + // Row #1 + L"\u091e\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f\u0966\u0914" + L"\u200d" + // Row #2 + L"{{\u0924\u094d\u0930}}\u0927\u092d\u091a\u0924\u0925\u0917\u0937\u092f" + L"\u0909{{\u0930\u094d}}\u0947\u094d" + // Row #3 + L"\u092c\u0915\u092e\u093e\u0928\u091c\u0935\u092a\u093f\u0938\u0941" + // Row #4 + L"\u0936\u0939\u0905\u0916\u0926\u0932\u0903\u093d\u0964\u0930" + // Row #5 + L"\u0020", + // Row #1 + L"\u0965{{\u091c\u094d\u091e}}\u0908\u0918$\u091b\u091f\u0920\u0921\u0922" + L"\u0923\u0913\u200c" + // Row #2 + L"{{\u0924\u094d\u0924}}{{\u0921\u094d\u0922}}\u0910{{\u0926\u094d\u0935}}{" + L"{\u091f\u094d\u091f}}{{\u0920\u094d\u0920}}\u090a{{\u0915\u094d\u0937}}" + L"\u0907" + L"\u090f\u0943\u0948\u0902" + // Row #3 + L"\u0906{{\u0919\u094d\u0915}}{{\u0919\u094d\u0917}}\u0901{{\u0926\u094d" + L"\u0926}}\u091d\u094b\u092b\u0940{{\u091f\u094d\u0920}}\u0942" + // Row #4 + L"{{\u0915\u094d\u0915}}{{\u0939\u094d\u092e}}\u090b\u0950\u094c{{\u0926" + L"\u094d\u092f}}{{\u0921\u094d\u0921}}\u0919{{\u0936\u094d\u0930}}{{" + L"\u0930\u0941}}" + // Row #5 + L"\u0020"}; + +const uint8_t key_map_index_ne_inscript[8]{0, 1, 0, 1, 0, 1, 0, 1}; +const char* id_ne_inscript = "ne_inscript"; +const bool is_102_ne_inscript = false; + +#endif // CHROMEOS_SERVICES_IME_RULEBASED_DEF_NE_INSCRIPT_H_
diff --git a/chromeos/services/ime/rulebased/def/ru_phone_aatseel.h b/chromeos/services/ime/rulebased/def/ru_phone_aatseel.h new file mode 100644 index 0000000..1f317a6c --- /dev/null +++ b/chromeos/services/ime/rulebased/def/ru_phone_aatseel.h
@@ -0,0 +1,98 @@ +// 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_IME_RULEBASED_DEF_RU_PHONE_AATSEEL_H_ +#define CHROMEOS_SERVICES_IME_RULEBASED_DEF_RU_PHONE_AATSEEL_H_ + +const wchar_t* key_map_ru_phone_aatseel[] = { + // Row #1 + L"\u04511234567890-\u044a" + // Row #2 + L"\u044f\u0448\u0435\u0440\u0442\u044b\u0443\u0438\u043e\u043f\u044e\u0449" + L"\u044d" + // Row #3 + L"\u0430\u0441\u0434\u0444\u0433\u0447\u0439\u043a\u043b\u044c\u0436" + // Row #4 + L"\u0437\u0445\u0446\u0432\u0431\u043d\u043c,./" + // Row #5 + L"\u0020", + // Row #1 + L"\u0401!@#\":^&*()_\u042a" + // Row #2 + L"\u042f\u0428\u0415\u0420\u0422\u042b\u0423\u0418\u041e\u041f\u042e\u0429" + L"\u042d" + // Row #3 + L"\u0410\u0421\u0414\u0424\u0413\u0427\u0419\u041a\u041b\u042c\u0416" + // Row #4 + L"\u0417\u0425\u0426\u0412\u0411\u041d\u041c<>?" + // Row #5 + L"\u0020", + // Row #1 + L"`1234567890-=" + // Row #2 + L"qwertyuiop[]\\" + // Row #3 + L"asdfghjkl;'" + // Row #4 + L"zxcvbnm,./" + // Row #5 + L"\u0020", + // Row #1 + L"\u04011234567890-\u042a" + // Row #2 + L"\u042f\u0428\u0415\u0420\u0422\u042b\u0423\u0418\u041e\u041f\u042e\u0429" + L"\u042d" + // Row #3 + L"\u0410\u0421\u0414\u0424\u0413\u0427\u0419\u041a\u041b\u042c\u0416" + // Row #4 + L"\u0417\u0425\u0426\u0412\u0411\u041d\u041c,./" + // Row #5 + L"\u0020", + // Row #1 + L"~!@#$%^&*()_+" + // Row #2 + L"QWERTYUIOP{}|" + // Row #3 + L"ASDFGHJKL:\"" + // Row #4 + L"ZXCVBNM<>?" + // Row #5 + L"\u0020", + // Row #1 + L"`1234567890-=" + // Row #2 + L"QWERTYUIOP[]\\" + // Row #3 + L"ASDFGHJKL;'" + // Row #4 + L"ZXCVBNM,./" + // Row #5 + L"\u0020", + // Row #1 + L"\u0451!@#\":^&*()_\u044a" + // Row #2 + L"\u044f\u0448\u0435\u0440\u0442\u044b\u0443\u0438\u043e\u043f\u044e\u0449" + L"\u044d" + // Row #3 + L"\u0430\u0441\u0434\u0444\u0433\u0447\u0439\u043a\u043b\u044c\u0436" + // Row #4 + L"\u0437\u0445\u0446\u0432\u0431\u043d\u043c<>?" + // Row #5 + L"\u0020", + // Row #1 + L"~!@#$%^&*()_+" + // Row #2 + L"qwertyuiop{}|" + // Row #3 + L"asdfghjkl:\"" + // Row #4 + L"zxcvbnm<>?" + // Row #5 + L"\u0020"}; + +const uint8_t key_map_index_ru_phone_aatseel[8]{0, 1, 2, 4, 3, 6, 5, 7}; +const char* id_ru_phone_aatseel = "ru_phone_aatseel"; +const bool is_102_ru_phone_aatseel = false; + +#endif // CHROMEOS_SERVICES_IME_RULEBASED_DEF_RU_PHONE_AATSEEL_H_
diff --git a/chromeos/services/ime/rulebased/def/ru_phone_yazhert.h b/chromeos/services/ime/rulebased/def/ru_phone_yazhert.h new file mode 100644 index 0000000..06f949a --- /dev/null +++ b/chromeos/services/ime/rulebased/def/ru_phone_yazhert.h
@@ -0,0 +1,98 @@ +// 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_IME_RULEBASED_DEF_RU_PHONE_YAZHERT_H_ +#define CHROMEOS_SERVICES_IME_RULEBASED_DEF_RU_PHONE_YAZHERT_H_ + +const wchar_t* key_map_ru_phone_yazhert[] = { + // Row #1 + L"\u044e1234567890-\u044c" + // Row #2 + L"\u044f\u0436\u0435\u0440\u0442\u044b\u0443\u0438\u043e\u043f\u0448\u0449" + L"\u044d" + // Row #3 + L"\u0430\u0441\u0434\u0444\u0433\u0447\u0439\u043a\u043b;'" + // Row #4 + L"\u0437\u0445\u0446\u0432\u0431\u043d\u043c,./" + // Row #5 + L"\u0020", + // Row #1 + L"\u042e!\u044a\u042a$%\u0451\u0401*()_\u042c" + // Row #2 + L"\u042f\u0416\u0415\u0420\u0422\u042b\u0423\u0418\u041e\u041f\u0428\u0429" + L"\u042d" + // Row #3 + L"\u0410\u0421\u0414\u0424\u0413\u0427\u0419\u041a\u041b:\"" + // Row #4 + L"\u0417\u0425\u0426\u0412\u0411\u041d\u041c<>?" + // Row #5 + L"\u0020", + // Row #1 + L"`1234567890-=" + // Row #2 + L"qwertyuiop[]\\" + // Row #3 + L"asdfghjkl;'" + // Row #4 + L"zxcvbnm,./" + // Row #5 + L"\u0020", + // Row #1 + L"\u042e1234567890-\u042c" + // Row #2 + L"\u042f\u0416\u0415\u0420\u0422\u042b\u0423\u0418\u041e\u041f\u0428\u0429" + L"\u042d" + // Row #3 + L"\u0410\u0421\u0414\u0424\u0413\u0427\u0419\u041a\u041b;'" + // Row #4 + L"\u0417\u0425\u0426\u0412\u0411\u041d\u041c,./" + // Row #5 + L"\u0020", + // Row #1 + L"~!@#$%^&*()_+" + // Row #2 + L"QWERTYUIOP{}|" + // Row #3 + L"ASDFGHJKL:\"" + // Row #4 + L"ZXCVBNM<>?" + // Row #5 + L"\u0020", + // Row #1 + L"`1234567890-=" + // Row #2 + L"QWERTYUIOP[]\\" + // Row #3 + L"ASDFGHJKL;'" + // Row #4 + L"ZXCVBNM,./" + // Row #5 + L"\u0020", + // Row #1 + L"\u044e!\u044a\u042a$%\u0451\u0401*()_\u044c" + // Row #2 + L"\u044f\u0436\u0435\u0440\u0442\u044b\u0443\u0438\u043e\u043f\u0448\u0449" + L"\u044d" + // Row #3 + L"\u0430\u0441\u0434\u0444\u0433\u0447\u0439\u043a\u043b:\"" + // Row #4 + L"\u0437\u0445\u0446\u0432\u0431\u043d\u043c<>?" + // Row #5 + L"\u0020", + // Row #1 + L"~!@#$%^&*()_+" + // Row #2 + L"qwertyuiop{}|" + // Row #3 + L"asdfghjkl:\"" + // Row #4 + L"zxcvbnm<>?" + // Row #5 + L"\u0020"}; + +const uint8_t key_map_index_ru_phone_yazhert[8]{0, 1, 2, 4, 3, 6, 5, 7}; +const char* id_ru_phone_yazhert = "ru_phone_yazhert"; +const bool is_102_ru_phone_yazhert = false; + +#endif // CHROMEOS_SERVICES_IME_RULEBASED_DEF_RU_PHONE_YAZHERT_H_
diff --git a/chromeos/services/ime/rulebased/def/ta_inscript.h b/chromeos/services/ime/rulebased/def/ta_inscript.h new file mode 100644 index 0000000..08b3867 --- /dev/null +++ b/chromeos/services/ime/rulebased/def/ta_inscript.h
@@ -0,0 +1,49 @@ +// 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_IME_RULEBASED_DEF_TA_INSCRIPT_H_ +#define CHROMEOS_SERVICES_IME_RULEBASED_DEF_TA_INSCRIPT_H_ + +const wchar_t* key_map_ta_inscript[] = { + // Row #1 + L"\u0bca1234567890-\u0bf2" + // Row #2 + L"\u0bcc\u0bc8\u0bbe\u0bc0\u0bc2\u0baa\u0bb9\u0b95\u0ba4\u0b9c\u0b9f\u0b9e" + L"\u0b9f" + // Row #3 + L"\u0bcb\u0bc7\u0bcd\u0bbf\u0bc1\u0baa\u0bb0\u0b95\u0ba4\u0b9a\u0b9f" + // Row #4 + L"\u0bc6\u0b82\u0bae\u0ba8\u0bb5\u0bb2\u0bb8,.\u0baf" + // Row #5 + L"\u0020", + // Row #1 + L"\u0b92\u0b95\u0be8{{\u0bcd\u0bb0}}{{\u0bb0\u0bcd}}{{\u0b9c\u0bcd\u0b9e}}{" + L"{\u0ba4\u0bcd\u0bb0}}{{\u0b95\u0bcd\u0bb7}}{{\u0bb6\u0bcd\u0bb0}}()" + L"\u0b83{{}}" + // Row #2 + L"\u0b94\u0b90\u0b86\u0b88\u0b8a{{}}\u0b99{{}}{{}}\u0b9a{{}}{{}}{{}}" + // Row #3 + L"\u0b93\u0b8f\u0b85\u0b87\u0b89{{}}\u0bb1{{}}{{}}{{}}{{}}" + // Row #4 + L"\u0b8e{{}}\u0ba3\u0ba9\u0bb4\u0bb3\u0bb6\u0bb7{{\u0bb8\u0bcd\u0bb0\u0bc0}" + L"}{{}}" + // Row #5 + L"\u0020", + // Row #1 + L"{{}}\u0be7\u0be8\u0be9\u0bea\u0beb\u0bec\u0bed\u0bee\u0bef\u0be6{{}}" + L"\u0bf2" + // Row #2 + L"{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}" + // Row #3 + L"{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}" + // Row #4 + L"{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}" + // Row #5 + L"\u0020"}; + +const uint8_t key_map_index_ta_inscript[8]{0, 1, 2, 1, 0, 1, 0, 1}; +const char* id_ta_inscript = "ta_inscript"; +const bool is_102_ta_inscript = false; + +#endif // CHROMEOS_SERVICES_IME_RULEBASED_DEF_TA_INSCRIPT_H_
diff --git a/chromeos/services/ime/rulebased/def/ta_typewriter.h b/chromeos/services/ime/rulebased/def/ta_typewriter.h new file mode 100644 index 0000000..8c0fce2 --- /dev/null +++ b/chromeos/services/ime/rulebased/def/ta_typewriter.h
@@ -0,0 +1,39 @@ +// 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_IME_RULEBASED_DEF_TA_TYPEWRITER_H_ +#define CHROMEOS_SERVICES_IME_RULEBASED_DEF_TA_TYPEWRITER_H_ + +const wchar_t* key_map_ta_typewriter[] = { + // Row #1 + L"\u0b831234567890/=" + // Row #2 + L"{{\u0ba3\u0bc1}}\u0bb1\u0ba8\u0b9a\u0bb5\u0bb2\u0bb0\u0bc8{{\u0b9f\u0bbf}" + L"}\u0bbf\u0bc1\u0bb9{{\u0b95\u0bcd\u0bb7}}" + // Row #3 + L"\u0baf\u0bb3\u0ba9\u0b95\u0baa\u0bbe\u0ba4\u0bae\u0b9f\u0bcd\u0b99" + // Row #4 + L"\u0ba3\u0b92\u0b89\u0b8e\u0bc6\u0bc7\u0b85\u0b87,." + // Row #5 + L"\u0020", + // Row #1 + L"'\u0bb8\"%\u0b9c\u0bb6\u0bb7{{}}{{}}(){{\u0bb8\u0bcd\u0bb0\u0bc0}}+" + // Row #2 + L"{{}}{{\u0bb1\u0bc1}}{{\u0ba8\u0bc1}}{{\u0b9a\u0bc1}}{{\u0b95\u0bc2}}{{" + L"\u0bb2\u0bc1}}{{\u0bb0\u0bc1}}\u0b90{{\u0b9f\u0bc0}}" + L"\u0bc0\u0bc2\u0bcc\u0bf8" + // Row #3 + L"{{}}{{\u0bb3\u0bc1}}{{\u0ba9\u0bc1}}{{\u0b95\u0bc1}}{{\u0bb4\u0bc1}}" + L"\u0bb4{{\u0ba4\u0bc1}}{{\u0bae\u0bc1}}{{\u0b9f\u0bc1}}\\\u0b9e" + // Row #4 + L"\u0bb7\u0b93\u0b8a\u0b8f{{\u0b95\u0bcd\u0bb7}}{{\u0b9a\u0bc2}}\u0b86" + L"\u0b88?-" + // Row #5 + L"\u0020"}; + +const uint8_t key_map_index_ta_typewriter[8]{0, 1, 0, 1, 1, 0, 1, 0}; +const char* id_ta_typewriter = "ta_typewriter"; +const bool is_102_ta_typewriter = false; + +#endif // CHROMEOS_SERVICES_IME_RULEBASED_DEF_TA_TYPEWRITER_H_
diff --git a/chromeos/services/ime/rulebased/def/th.h b/chromeos/services/ime/rulebased/def/th.h new file mode 100644 index 0000000..9471d2d --- /dev/null +++ b/chromeos/services/ime/rulebased/def/th.h
@@ -0,0 +1,45 @@ +// 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_IME_RULEBASED_DEF_TH_H_ +#define CHROMEOS_SERVICES_IME_RULEBASED_DEF_TH_H_ + +const wchar_t* key_map_th[] = { + // Row #1 + L"_\u0e45/-\u0e20\u0e16\u0e38\u0e36\u0e04\u0e15\u0e08\u0e02\u0e0a" + // Row #2 + L"\u0e46\u0e44\u0e33\u0e1e\u0e30\u0e31\u0e35\u0e23\u0e19\u0e22\u0e1a\u0e25" + L"\u0e03" + // Row #3 + L"\u0e1f\u0e2b\u0e01\u0e14\u0e40\u0e49\u0e48\u0e32\u0e2a\u0e27\u0e07" + // Row #4 + L"\u0e1c\u0e1b\u0e41\u0e2d\u0e34\u0e37\u0e17\u0e21\u0e43\u0e1d" + // Row #5 + L"\u0020", + // Row #1 + L"%+\u0e51\u0e52\u0e53\u0e54\u0e39\u0e3f\u0e55\u0e56\u0e57\u0e58\u0e59" + // Row #2 + L"\u0e50\"\u0e0e\u0e11\u0e18\u0e4d\u0e4a\u0e13\u0e2f\u0e0d\u0e10,\u0e05" + // Row #3 + L"\u0e24\u0e06\u0e0f\u0e42\u0e0c\u0e47\u0e4b\u0e29\u0e28\u0e0b." + // Row #4 + L"()\u0e09\u0e2e\u0e3a\u0e4c?\u0e12\u0e2c\u0e26" + // Row #5 + L"\u0020", + // Row #1 + L"{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}" + // Row #2 + L"{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}%\u0e51+" + // Row #3 + L"{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}" + // Row #4 + L"{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}{{}}" + // Row #5 + L"\u0020"}; + +const uint8_t key_map_index_th[8]{0, 1, 2, 1, 1, 0, 2, 0}; +const char* id_th = "th"; +const bool is_102_th = false; + +#endif // CHROMEOS_SERVICES_IME_RULEBASED_DEF_TH_H_
diff --git a/chromeos/services/ime/rulebased/def/th_pattajoti.h b/chromeos/services/ime/rulebased/def/th_pattajoti.h new file mode 100644 index 0000000..8c699aa --- /dev/null +++ b/chromeos/services/ime/rulebased/def/th_pattajoti.h
@@ -0,0 +1,36 @@ +// 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_IME_RULEBASED_DEF_TH_PATTAJOTI_H_ +#define CHROMEOS_SERVICES_IME_RULEBASED_DEF_TH_PATTAJOTI_H_ + +const wchar_t* key_map_th_pattajoti[] = { + // Row #1 + L"_=\u0e52\u0e53\u0e54\u0e55\u0e39\u0e57\u0e58\u0e59\u0e50\u0e51\u0e56" + // Row #2 + L"\u0e47\u0e15\u0e22\u0e2d\u0e23\u0e48\u0e14\u0e21\u0e27\u0e41\u0e43\u0e0c" + L"\u0e3a" + // Row #3 + L"\u0e49\u0e17\u0e07\u0e01\u0e31\u0e35\u0e32\u0e19\u0e40\u0e44\u0e02" + // Row #4 + L"\u0e1a\u0e1b\u0e25\u0e2b\u0e34\u0e04\u0e2a\u0e30\u0e08\u0e1e" + // Row #5 + L"\u0020", + // Row #1 + L"\u0e3f+\"/,?\u0e38\u0e45.()-%" + // Row #2 + L"\u0e4a\u0e24\u0e46\u0e0d\u0e29\u0e36\u0e1d\u0e0b\u0e16\u0e12\u0e2f\u0e26" + L"\u0e4d" + // Row #3 + L"\u0e4b\u0e18\u0e33\u0e13\u0e4c\u0e37\u0e1c\u0e0a\u0e42\u0e06\u0e11" + // Row #4 + L"\u0e0e\u0e0f\u0e10\u0e20{{\u0e31\u0e49}}\u0e28\u0e2e\u0e1f\u0e09\u0e2c" + // Row #5 + L"\u0020"}; + +const uint8_t key_map_index_th_pattajoti[8]{0, 1, 0, 1, 1, 0, 1, 0}; +const char* id_th_pattajoti = "th_pattajoti"; +const bool is_102_th_pattajoti = false; + +#endif // CHROMEOS_SERVICES_IME_RULEBASED_DEF_TH_PATTAJOTI_H_
diff --git a/chromeos/services/ime/rulebased/def/th_tis.h b/chromeos/services/ime/rulebased/def/th_tis.h new file mode 100644 index 0000000..7adcb5c --- /dev/null +++ b/chromeos/services/ime/rulebased/def/th_tis.h
@@ -0,0 +1,35 @@ +// 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_IME_RULEBASED_DEF_TH_TIS_H_ +#define CHROMEOS_SERVICES_IME_RULEBASED_DEF_TH_TIS_H_ + +const wchar_t* key_map_th_tis[] = { + // Row #1 + L"_\u0e45/-\u0e20\u0e16\u0e38\u0e36\u0e04\u0e15\u0e08\u0e02\u0e0a" + // Row #2 + L"\u0e46\u0e44\u0e33\u0e1e\u0e30\u0e31\u0e35\u0e23\u0e19\u0e22\u0e1a\u0e25" + L"\u0e03" + // Row #3 + L"\u0e1f\u0e2b\u0e01\u0e14\u0e40\u0e49\u0e48\u0e32\u0e2a\u0e27\u0e07" + // Row #4 + L"\u0e1c\u0e1b\u0e41\u0e2d\u0e34\u0e37\u0e17\u0e21\u0e43\u0e1d" + // Row #5 + L"\u0020", + // Row #1 + L"%+\u0e51\u0e52\u0e53\u0e54\u0e39\u0e3f\u0e55\u0e56\u0e57\u0e58\u0e59" + // Row #2 + L"\u0e50\"\u0e0e\u0e11\u0e18\u0e4d\u0e4a\u0e13\u0e2f\u0e0d\u0e10,\u0e05" + // Row #3 + L"\u0e24\u0e06\u0e0f\u0e42\u0e0c\u0e47\u0e4b\u0e29\u0e28\u0e0b." + // Row #4 + L"()\u0e09\u0e2e\u0e3a\u0e4c?\u0e12\u0e2c\u0e26" + // Row #5 + L"\u0020"}; + +const uint8_t key_map_index_th_tis[8]{0, 1, 0, 1, 1, 0, 1, 0}; +const char* id_th_tis = "th_tis"; +const bool is_102_th_tis = false; + +#endif // CHROMEOS_SERVICES_IME_RULEBASED_DEF_TH_TIS_H_
diff --git a/chromeos/services/ime/rulebased/rulebased_unittest.cc b/chromeos/services/ime/rulebased/rulebased_unittest.cc index fee8ce7..f8b6f1b 100644 --- a/chromeos/services/ime/rulebased/rulebased_unittest.cc +++ b/chromeos/services/ime/rulebased/rulebased_unittest.cc
@@ -12,6 +12,16 @@ namespace chromeos { namespace ime { +namespace { + +struct KeyVerifyEntry { + const char* key; + uint8_t modifiers; + const wchar_t* expected_str; +}; + +} // namespace + class RulebasedImeTest : public testing::Test { protected: RulebasedImeTest() = default; @@ -20,6 +30,16 @@ // testing::Test: void SetUp() override { controller_.reset(new rulebased::Controller); } + void VerifyKeys(std::vector<KeyVerifyEntry> entries) { + for (auto entry : entries) { + rulebased::ProcessKeyResult res = + controller_->ProcessKey(entry.key, entry.modifiers); + EXPECT_TRUE(res.key_handled); + std::string expected_str = base::WideToUTF8(entry.expected_str); + EXPECT_EQ(expected_str, res.commit_text); + } + } + std::unique_ptr<rulebased::Controller> controller_; private: @@ -28,21 +48,40 @@ TEST_F(RulebasedImeTest, Arabic) { controller_->Activate("ar"); + std::vector<KeyVerifyEntry> entries; + entries.push_back({"KeyA", rulebased::MODIFIER_SHIFT, L"\u0650"}); + entries.push_back({"KeyB", 0, L"\u0644\u0627"}); + entries.push_back({"Space", 0, L" "}); + VerifyKeys(entries); +} - rulebased::ProcessKeyResult res = - controller_->ProcessKey("KeyA", rulebased::MODIFIER_SHIFT); - EXPECT_TRUE(res.key_handled); - std::string expected_str = base::WideToUTF8(L"\u0650"); - EXPECT_EQ(expected_str, res.commit_text); +TEST_F(RulebasedImeTest, Persian) { + controller_->Activate("fa"); + std::vector<KeyVerifyEntry> entries; + entries.push_back({"KeyA", 0, L"\u0634"}); + entries.push_back({"KeyV", rulebased::MODIFIER_SHIFT, L""}); + entries.push_back({"Space", rulebased::MODIFIER_SHIFT, L"\u200c"}); + VerifyKeys(entries); +} - res = controller_->ProcessKey("KeyB", 0); - EXPECT_TRUE(res.key_handled); - expected_str = base::WideToUTF8(L"\u0644\u0627"); - EXPECT_EQ(expected_str, res.commit_text); +TEST_F(RulebasedImeTest, Thai) { + controller_->Activate("th"); + std::vector<KeyVerifyEntry> entries; + entries.push_back({"KeyA", 0, L"\u0e1f"}); + entries.push_back({"KeyA", rulebased::MODIFIER_ALTGR, L""}); + VerifyKeys(entries); - res = controller_->ProcessKey("Space", 0); - EXPECT_TRUE(res.key_handled); - EXPECT_EQ(" ", res.commit_text); + controller_->Activate("th_pattajoti"); + entries.clear(); + entries.push_back({"KeyA", 0, L"\u0e49"}); + entries.push_back({"KeyB", rulebased::MODIFIER_SHIFT, L"\u0e31\u0e49"}); + VerifyKeys(entries); + + controller_->Activate("th_tis"); + entries.clear(); + entries.push_back({"KeyA", 0, L"\u0e1f"}); + entries.push_back({"KeyM", rulebased::MODIFIER_SHIFT, L"?"}); + VerifyKeys(entries); } TEST_F(RulebasedImeTest, ParseKeyMap) {
diff --git a/chromeos/services/ime/rulebased/rules_data.cc b/chromeos/services/ime/rulebased/rules_data.cc index dd203ff..109bbad 100644 --- a/chromeos/services/ime/rulebased/rules_data.cc +++ b/chromeos/services/ime/rulebased/rules_data.cc
@@ -8,6 +8,19 @@ #include "base/stl_util.h" #include "base/strings/utf_string_conversions.h" #include "chromeos/services/ime/rulebased/def/ar.h" +#include "chromeos/services/ime/rulebased/def/ckb_ar.h" +#include "chromeos/services/ime/rulebased/def/ckb_en.h" +#include "chromeos/services/ime/rulebased/def/fa.h" +#include "chromeos/services/ime/rulebased/def/km.h" +#include "chromeos/services/ime/rulebased/def/lo.h" +#include "chromeos/services/ime/rulebased/def/ne_inscript.h" +#include "chromeos/services/ime/rulebased/def/ru_phone_aatseel.h" +#include "chromeos/services/ime/rulebased/def/ru_phone_yazhert.h" +#include "chromeos/services/ime/rulebased/def/ta_inscript.h" +#include "chromeos/services/ime/rulebased/def/ta_typewriter.h" +#include "chromeos/services/ime/rulebased/def/th.h" +#include "chromeos/services/ime/rulebased/def/th_pattajoti.h" +#include "chromeos/services/ime/rulebased/def/th_tis.h" namespace chromeos { namespace ime { @@ -35,7 +48,59 @@ {id_ar, RawDataEntry(key_map_ar, base::size(key_map_ar), key_map_index_ar, - is_102_ar)}}; + is_102_ar)}, + {id_ckb_ar, RawDataEntry(key_map_ckb_ar, + base::size(key_map_ckb_ar), + key_map_index_ckb_ar, + is_102_ckb_ar)}, + {id_ckb_en, RawDataEntry(key_map_ckb_en, + base::size(key_map_ckb_en), + key_map_index_ckb_en, + is_102_ckb_en)}, + {id_fa, RawDataEntry(key_map_fa, + base::size(key_map_fa), + key_map_index_fa, + is_102_fa)}, + {id_km, RawDataEntry(key_map_km, + base::size(key_map_km), + key_map_index_km, + is_102_km)}, + {id_lo, RawDataEntry(key_map_lo, + base::size(key_map_lo), + key_map_index_lo, + is_102_lo)}, + {id_ne_inscript, RawDataEntry(key_map_ne_inscript, + base::size(key_map_ne_inscript), + key_map_index_ne_inscript, + is_102_ne_inscript)}, + {id_ru_phone_aatseel, RawDataEntry(key_map_ru_phone_aatseel, + base::size(key_map_ru_phone_aatseel), + key_map_index_ru_phone_aatseel, + is_102_ru_phone_aatseel)}, + {id_ru_phone_yazhert, RawDataEntry(key_map_ru_phone_yazhert, + base::size(key_map_ru_phone_yazhert), + key_map_index_ru_phone_yazhert, + is_102_ru_phone_yazhert)}, + {id_ta_inscript, RawDataEntry(key_map_ta_inscript, + base::size(key_map_ta_inscript), + key_map_index_ta_inscript, + is_102_ta_inscript)}, + {id_ta_typewriter, RawDataEntry(key_map_ta_typewriter, + base::size(key_map_ta_typewriter), + key_map_index_ta_typewriter, + is_102_ta_typewriter)}, + {id_th, RawDataEntry(key_map_th, + base::size(key_map_th), + key_map_index_th, + is_102_th)}, + {id_th_pattajoti, RawDataEntry(key_map_th_pattajoti, + base::size(key_map_th_pattajoti), + key_map_index_th_pattajoti, + is_102_th_pattajoti)}, + {id_th_tis, RawDataEntry(key_map_th_tis, + base::size(key_map_th_tis), + key_map_index_th_tis, + is_102_th_tis)}}; static const char* s_101_keys[] = { // Row #1
diff --git a/components/autofill_assistant/browser/actions/action_delegate.h b/components/autofill_assistant/browser/actions/action_delegate.h index 236b28d..c44d118 100644 --- a/components/autofill_assistant/browser/actions/action_delegate.h +++ b/components/autofill_assistant/browser/actions/action_delegate.h
@@ -73,14 +73,11 @@ const std::vector<std::string>& selectors, base::OnceCallback<void(const std::string&)> callback) = 0; - // Set the |values| of all fields in |selectors_list| and return the result - // through |callback|. Selectors and values are one on one matched, i.e. the - // value of selectors_list[i] should be set to values[i] (therefore, this - // method requires that selectors_list.size() == values.size()). - virtual void SetFieldsValue( - const std::vector<std::vector<std::string>>& selectors_list, - const std::vector<std::string>& values, - base::OnceCallback<void(bool)> callback) = 0; + // Set the |value| of field |selectors| and return the result through + // |callback|. + virtual void SetFieldValue(const std::vector<std::string>& selectors, + const std::string& value, + base::OnceCallback<void(bool)> callback) = 0; // Get the AutofillProfile with ID |guid|, or nullptr if it doesn't exist. virtual const autofill::AutofillProfile* GetAutofillProfile(
diff --git a/components/autofill_assistant/browser/actions/autofill_action.cc b/components/autofill_assistant/browser/actions/autofill_action.cc index 4451e7ae..d0f7c3b 100644 --- a/components/autofill_assistant/browser/actions/autofill_action.cc +++ b/components/autofill_assistant/browser/actions/autofill_action.cc
@@ -18,7 +18,7 @@ namespace autofill_assistant { AutofillAction::AutofillAction(const ActionProto& proto) - : Action(proto), weak_ptr_factory_(this) { + : Action(proto), pending_set_field_value_(0), weak_ptr_factory_(this) { if (proto.has_use_address()) { prompt_ = proto.use_address().prompt(); name_ = proto.use_address().name(); @@ -41,6 +41,7 @@ void AutofillAction::ProcessAction(ActionDelegate* delegate, ProcessActionCallback action_callback) { + process_action_callback_ = std::move(action_callback); processed_action_proto_ = std::make_unique<ProcessedActionProto>(); // Check data already selected in a previous action. base::Optional<std::string> selected_data; @@ -57,18 +58,20 @@ // TODO(crbug.com/806868): We need to differentiate between action failure // and stopping an action to let the user fill a form (expected stop). UpdateProcessedAction(false); - std::move(action_callback).Run(std::move(processed_action_proto_)); + std::move(process_action_callback_) + .Run(std::move(processed_action_proto_)); return; } if (selectors_.empty()) { // If there is no selector, finish the action directly. UpdateProcessedAction(true); - std::move(action_callback).Run(std::move(processed_action_proto_)); + std::move(process_action_callback_) + .Run(std::move(processed_action_proto_)); return; } - FillFormWithData(guid, delegate, std::move(action_callback)); + FillFormWithData(guid, delegate); return; } @@ -80,8 +83,7 @@ // Ask user to select the data. base::OnceCallback<void(const std::string&)> selection_callback = base::BindOnce(&AutofillAction::OnDataSelected, - weak_ptr_factory_.GetWeakPtr(), delegate, - std::move(action_callback)); + weak_ptr_factory_.GetWeakPtr(), delegate); if (is_autofill_card_) { delegate->ChooseCard(std::move(selection_callback)); return; @@ -91,7 +93,6 @@ } void AutofillAction::OnDataSelected(ActionDelegate* delegate, - ProcessActionCallback action_callback, const std::string& guid) { // Remember the selection. if (is_autofill_card_) { @@ -105,7 +106,7 @@ // TODO(crbug.com/806868): We need to differentiate between action failure // and stopping an action to let the user fill a form (expected stop). UpdateProcessedAction(false); - std::move(action_callback).Run(std::move(processed_action_proto_)); + std::move(process_action_callback_).Run(std::move(processed_action_proto_)); return; } @@ -114,64 +115,59 @@ // when we want to trigger the selection of address or card at the beginning // of the script and use it later. UpdateProcessedAction(true); - std::move(action_callback).Run(std::move(processed_action_proto_)); + std::move(process_action_callback_).Run(std::move(processed_action_proto_)); return; } // TODO(crbug.com/806868): Validate form and use fallback if needed. - FillFormWithData(guid, delegate, std::move(action_callback)); + FillFormWithData(guid, delegate); } void AutofillAction::FillFormWithData(const std::string& guid, - ActionDelegate* delegate, - ProcessActionCallback action_callback) { + ActionDelegate* delegate) { DCHECK(!selectors_.empty()); if (is_autofill_card_) { delegate->FillAddressForm( guid, selectors_, base::BindOnce(&AutofillAction::OnFormFilled, - weak_ptr_factory_.GetWeakPtr(), guid, delegate, - std::move(action_callback))); + weak_ptr_factory_.GetWeakPtr(), guid, delegate)); return; } - delegate->FillCardForm(guid, selectors_, - base::BindOnce(&AutofillAction::OnFormFilled, - weak_ptr_factory_.GetWeakPtr(), guid, - delegate, std::move(action_callback))); + delegate->FillCardForm( + guid, selectors_, + base::BindOnce(&AutofillAction::OnFormFilled, + weak_ptr_factory_.GetWeakPtr(), guid, delegate)); } void AutofillAction::OnFormFilled(const std::string& guid, ActionDelegate* delegate, - ProcessActionCallback action_callback, bool successful) { // In case Autofill failed, we stop the action. if (!successful) { UpdateProcessedAction(false); - std::move(action_callback).Run(std::move(processed_action_proto_)); + std::move(process_action_callback_).Run(std::move(processed_action_proto_)); // TODO(crbug.com/806868): Tell the user to fill the form manually. return; } - CheckRequiredFields(guid, delegate, std::move(action_callback), - /* allow_fallback */ true); + CheckRequiredFields(guid, delegate, /* allow_fallback */ true); } void AutofillAction::CheckRequiredFields(const std::string& guid, ActionDelegate* delegate, - ProcessActionCallback action_callback, bool allow_fallback) { if (is_autofill_card_) { // TODO(crbug.com/806868): Implement required fields checking for cards. UpdateProcessedAction(true); - std::move(action_callback).Run(std::move(processed_action_proto_)); + std::move(process_action_callback_).Run(std::move(processed_action_proto_)); return; } // If there are no required fields, finish the action successfully. if (proto_.use_address().required_fields().empty()) { UpdateProcessedAction(true); - std::move(action_callback).Run(std::move(processed_action_proto_)); + std::move(process_action_callback_).Run(std::move(processed_action_proto_)); return; } @@ -188,17 +184,15 @@ selectors.emplace_back(selector); } delegate->GetFieldValue( - selectors, - base::BindOnce(&AutofillAction::OnGetRequiredFieldValue, - weak_ptr_factory_.GetWeakPtr(), guid, delegate, - std::move(action_callback), allow_fallback, i)); + selectors, base::BindOnce(&AutofillAction::OnGetRequiredFieldValue, + weak_ptr_factory_.GetWeakPtr(), guid, + delegate, allow_fallback, i)); } } void AutofillAction::OnGetRequiredFieldValue( const std::string& guid, ActionDelegate* delegate, - ProcessActionCallback action_callback, bool allow_fallback, int index, const std::string& value) { @@ -226,7 +220,8 @@ // Validation failed and we don't want to try the fallback, so we fail // the action. UpdateProcessedAction(false); - std::move(action_callback).Run(std::move(processed_action_proto_)); + std::move(process_action_callback_) + .Run(std::move(processed_action_proto_)); // TODO(crbug.com/806868): Tell the user to fill the form manually. return; } @@ -252,7 +247,7 @@ if (validation_successful) { UpdateProcessedAction(true); - std::move(action_callback).Run(std::move(processed_action_proto_)); + std::move(process_action_callback_).Run(std::move(processed_action_proto_)); return; } @@ -260,16 +255,18 @@ // One or more required fields is empty but there is no fallback value, so // we fail the action. UpdateProcessedAction(false); - std::move(action_callback).Run(std::move(processed_action_proto_)); + std::move(process_action_callback_).Run(std::move(processed_action_proto_)); // TODO(crbug.com/806868): Tell the user to fill the form manually. return; } - delegate->SetFieldsValue( - failed_selectors, fallback_values, - base::BindOnce(&AutofillAction::OnSetFieldsValue, - weak_ptr_factory_.GetWeakPtr(), guid, delegate, - std::move(action_callback))); + pending_set_field_value_ = failed_selectors.size(); + for (size_t i = 0; i < failed_selectors.size(); i++) { + delegate->SetFieldValue( + failed_selectors[i], fallback_values[i], + base::BindOnce(&AutofillAction::OnSetFieldValue, + weak_ptr_factory_.GetWeakPtr(), guid, delegate)); + } } base::string16 AutofillAction::GetAddressFieldValue( @@ -310,22 +307,31 @@ } } -void AutofillAction::OnSetFieldsValue(const std::string& guid, - ActionDelegate* delegate, - ProcessActionCallback action_callback, - bool successful) { +void AutofillAction::OnSetFieldValue(const std::string& guid, + ActionDelegate* delegate, + bool successful) { + DCHECK_LT(0u, pending_set_field_value_); + pending_set_field_value_--; + + // Fail early if filling a field failed and we haven't returned anything yet. + // We can ignore the other SetFieldValue callbacks given that an action is + // processed only once. if (!successful) { // Fallback failed: we fail the action without checking the fields. - UpdateProcessedAction(false); - std::move(action_callback).Run(std::move(processed_action_proto_)); - // TODO(crbug.com/806868): Tell the user to fill the form manually. + if (process_action_callback_) { + UpdateProcessedAction(false); + std::move(process_action_callback_) + .Run(std::move(processed_action_proto_)); + // TODO(crbug.com/806868): Tell the user to fill the form manually. + } return; } - // We check the required fields again, but this time we don't want to try the - // fallback in case if failure. - CheckRequiredFields(guid, delegate, std::move(action_callback), - /* allow_fallback */ false); + if (!pending_set_field_value_ && process_action_callback_) { + // We check the required fields again, but this time we don't want to try + // the fallback in case if failure. + CheckRequiredFields(guid, delegate, /* allow_fallback */ false); + } } } // namespace autofill_assistant.
diff --git a/components/autofill_assistant/browser/actions/autofill_action.h b/components/autofill_assistant/browser/actions/autofill_action.h index 4218f08..1365f695 100644 --- a/components/autofill_assistant/browser/actions/autofill_action.h +++ b/components/autofill_assistant/browser/actions/autofill_action.h
@@ -10,7 +10,7 @@ #include <string> #include <vector> -#include "base/callback_forward.h" +#include "base/callback.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" @@ -34,19 +34,15 @@ // Called when the user selected the data. void OnDataSelected(ActionDelegate* delegate, - ProcessActionCallback callback, const std::string& guid); // Fill the form using data with GUID |guid|. Return whether filling succeeded // or not through |callback|. - void FillFormWithData(const std::string& guid, - ActionDelegate* delegate, - ProcessActionCallback action_callback); + void FillFormWithData(const std::string& guid, ActionDelegate* delegate); // Called when the form has been filled. void OnFormFilled(const std::string& guid, ActionDelegate* delegate, - ProcessActionCallback action_callback, bool successful); // Check whether all required fields have a non-empty value. If it is the @@ -55,13 +51,11 @@ // the failed fields without Autofill. void CheckRequiredFields(const std::string& guid, ActionDelegate* delegate, - ProcessActionCallback action_callback, bool allow_fallback); // Called when we get the value of the required fields. void OnGetRequiredFieldValue(const std::string& guid, ActionDelegate* delegate, - ProcessActionCallback action_callback, bool allow_fallback, int index, const std::string& value); @@ -74,10 +68,9 @@ // Called after trying to set form values without Autofill in case of fallback // after failed validation. - void OnSetFieldsValue(const std::string& guid, - ActionDelegate* delegate, - ProcessActionCallback action_callback, - bool successful); + void OnSetFieldValue(const std::string& guid, + ActionDelegate* delegate, + bool successful); // Usage of the autofilled address. Ignored if autofilling a card. std::string name_; @@ -87,6 +80,8 @@ // True if autofilling a card, otherwise we are autofilling an address. bool is_autofill_card_; std::vector<FieldValueStatus> required_fields_value_status_; + size_t pending_set_field_value_; + ProcessActionCallback process_action_callback_; base::WeakPtrFactory<AutofillAction> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(AutofillAction);
diff --git a/components/autofill_assistant/browser/protocol_utils.cc b/components/autofill_assistant/browser/protocol_utils.cc index eaf740b8..3ab4340 100644 --- a/components/autofill_assistant/browser/protocol_utils.cc +++ b/components/autofill_assistant/browser/protocol_utils.cc
@@ -131,9 +131,10 @@ } // static -bool ProtocolUtils::ParseActions(const std::string& response, - std::string* return_server_payload, - std::deque<std::unique_ptr<Action>>* actions) { +bool ProtocolUtils::ParseActions( + const std::string& response, + std::string* return_server_payload, + std::vector<std::unique_ptr<Action>>* actions) { DCHECK(actions); ActionsResponseProto response_proto;
diff --git a/components/autofill_assistant/browser/protocol_utils.h b/components/autofill_assistant/browser/protocol_utils.h index 881494c..d184caa 100644 --- a/components/autofill_assistant/browser/protocol_utils.h +++ b/components/autofill_assistant/browser/protocol_utils.h
@@ -49,14 +49,14 @@ const std::string& previous_server_payload, const std::vector<ProcessedActionProto>& processed_actions); - // Parse actions from the given |response|, which should not be an empty - // string. + // Parse actions from the given |response|, which can be an empty string. + // // Pass in nullptr for |return_server_payload| to indicate no need to return // server payload. Parsed actions are returned through |actions|, which should // not be nullptr. Return false if parse failed, otherwise return true. static bool ParseActions(const std::string& response, std::string* return_server_payload, - std::deque<std::unique_ptr<Action>>* actions); + std::vector<std::unique_ptr<Action>>* actions); private: // To avoid instantiate this class by accident.
diff --git a/components/autofill_assistant/browser/script_executor.cc b/components/autofill_assistant/browser/script_executor.cc index d7f3379..a5c02f4 100644 --- a/components/autofill_assistant/browser/script_executor.cc +++ b/components/autofill_assistant/browser/script_executor.cc
@@ -92,12 +92,11 @@ delegate_->GetWebController()->GetFieldValue(selectors, std::move(callback)); } -void ScriptExecutor::SetFieldsValue( - const std::vector<std::vector<std::string>>& selectors_list, - const std::vector<std::string>& values, - base::OnceCallback<void(bool)> callback) { - delegate_->GetWebController()->SetFieldsValue(selectors_list, values, - std::move(callback)); +void ScriptExecutor::SetFieldValue(const std::vector<std::string>& selectors, + const std::string& value, + base::OnceCallback<void(bool)> callback) { + delegate_->GetWebController()->SetFieldValue(selectors, value, + std::move(callback)); } const autofill::AutofillProfile* ScriptExecutor::GetAutofillProfile( @@ -137,31 +136,35 @@ std::move(callback_).Run(true); return; } + ProcessNextAction(); } void ScriptExecutor::ProcessNextAction() { - if (actions_.empty()) { + // We could get into a strange situation if ProcessNextAction is called before + // the action was reported as processed, which should not happen. In that case + // we could have more |processed_actions| than |actions_|. + if (actions_.size() <= processed_actions_.size()) { + DCHECK_EQ(actions_.size(), processed_actions_.size()); // Request more actions to execute. GetNextActions(); return; } - std::unique_ptr<Action> action = std::move(actions_.front()); - actions_.pop_front(); + Action* action = actions_[processed_actions_.size()].get(); int delay_ms = action->proto().action_delay_ms(); if (delay_ms > 0) { base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, base::BindOnce(&ScriptExecutor::ProcessAction, - weak_ptr_factory_.GetWeakPtr(), std::move(action)), + weak_ptr_factory_.GetWeakPtr(), action), base::TimeDelta::FromMilliseconds(delay_ms)); } else { - ProcessAction(std::move(action)); + ProcessAction(action); } } -void ScriptExecutor::ProcessAction(std::unique_ptr<Action> action) { +void ScriptExecutor::ProcessAction(Action* action) { action->ProcessAction(this, base::BindOnce(&ScriptExecutor::OnProcessedAction, weak_ptr_factory_.GetWeakPtr())); }
diff --git a/components/autofill_assistant/browser/script_executor.h b/components/autofill_assistant/browser/script_executor.h index fa9f1fb6..59b8883 100644 --- a/components/autofill_assistant/browser/script_executor.h +++ b/components/autofill_assistant/browser/script_executor.h
@@ -54,10 +54,9 @@ void GetFieldValue( const std::vector<std::string>& selectors, base::OnceCallback<void(const std::string&)> callback) override; - void SetFieldsValue( - const std::vector<std::vector<std::string>>& selectors_list, - const std::vector<std::string>& values, - base::OnceCallback<void(bool)> callback) override; + void SetFieldValue(const std::vector<std::string>& selectors, + const std::string& value, + base::OnceCallback<void(bool)> callback) override; const autofill::AutofillProfile* GetAutofillProfile( const std::string& guid) override; void BuildNodeTree(const std::vector<std::string>& selectors, @@ -68,7 +67,7 @@ private: void OnGetActions(bool result, const std::string& response); void ProcessNextAction(); - void ProcessAction(std::unique_ptr<Action> action); + void ProcessAction(Action* action); void GetNextActions(); void OnProcessedAction(std::unique_ptr<ProcessedActionProto> action); @@ -76,7 +75,7 @@ ScriptExecutorDelegate* delegate_; RunScriptCallback callback_; - std::deque<std::unique_ptr<Action>> actions_; + std::vector<std::unique_ptr<Action>> actions_; std::vector<ProcessedActionProto> processed_actions_; std::string last_server_payload_;
diff --git a/components/autofill_assistant/browser/web_controller.cc b/components/autofill_assistant/browser/web_controller.cc index 8c07096..21c1cfa 100644 --- a/components/autofill_assistant/browser/web_controller.cc +++ b/components/autofill_assistant/browser/web_controller.cc
@@ -58,6 +58,11 @@ const char* const kGetValueAttributeScript = "function () { return this.value; }"; +// Javascript code to set the 'value' attribute of a node, where $1 will be +// replaced with the value. +const char* const kSetValueAttributeScript = + "function (value) { this.value = value; }"; + } // namespace // static @@ -603,14 +608,10 @@ return; } - std::vector<std::unique_ptr<runtime::CallArgument>> argument; - argument.emplace_back( - runtime::CallArgument::Builder().SetObjectId(object_id).Build()); devtools_client_->GetRuntime()->Enable(); devtools_client_->GetRuntime()->CallFunctionOn( runtime::CallFunctionOnParams::Builder() .SetObjectId(object_id) - .SetArguments(std::move(argument)) .SetFunctionDeclaration(std::string(kGetValueAttributeScript)) .SetReturnByValue(true) .Build(), @@ -632,13 +633,46 @@ OnResult(result->GetResult()->GetValue()->GetString(), std::move(callback)); } -void WebController::SetFieldsValue( - const std::vector<std::vector<std::string>>& selectors_list, - const std::vector<std::string>& values, - base::OnceCallback<void(bool)> callback) { - DCHECK_EQ(selectors_list.size(), values.size()); - // TODO(crbug.com/806868): Implement set fields value operation. - std::move(callback).Run(true); +void WebController::SetFieldValue(const std::vector<std::string>& selectors, + const std::string& value, + base::OnceCallback<void(bool)> callback) { + FindElement(selectors, + base::BindOnce(&WebController::OnFindElementForSetFieldValue, + weak_ptr_factory_.GetWeakPtr(), value, + std::move(callback))); +} + +void WebController::OnFindElementForSetFieldValue( + const std::string& value, + base::OnceCallback<void(bool)> callback, + std::unique_ptr<FindElementResult> element_result) { + const std::string object_id = element_result->object_id; + if (object_id.empty()) { + OnResult(false, std::move(callback)); + return; + } + + std::vector<std::unique_ptr<runtime::CallArgument>> argument; + argument.emplace_back( + runtime::CallArgument::Builder() + .SetValue(base::Value::ToUniquePtrValue(base::Value(value))) + .Build()); + devtools_client_->GetRuntime()->Enable(); + devtools_client_->GetRuntime()->CallFunctionOn( + runtime::CallFunctionOnParams::Builder() + .SetObjectId(object_id) + .SetArguments(std::move(argument)) + .SetFunctionDeclaration(std::string(kSetValueAttributeScript)) + .Build(), + base::BindOnce(&WebController::OnSetValueAttribute, + weak_ptr_factory_.GetWeakPtr(), std::move(callback))); +} + +void WebController::OnSetValueAttribute( + base::OnceCallback<void(bool)> callback, + std::unique_ptr<runtime::CallFunctionOnResult> result) { + devtools_client_->GetRuntime()->Disable(); + OnResult(result && !result->HasExceptionDetails(), std::move(callback)); } void WebController::BuildNodeTree(const std::vector<std::string>& selectors,
diff --git a/components/autofill_assistant/browser/web_controller.h b/components/autofill_assistant/browser/web_controller.h index 1e57e87e..8277558 100644 --- a/components/autofill_assistant/browser/web_controller.h +++ b/components/autofill_assistant/browser/web_controller.h
@@ -84,14 +84,11 @@ const std::vector<std::string>& selectors, base::OnceCallback<void(const std::string&)> callback); - // Set the |values| of all fields in |selectors_list| and return the result - // through |callback|. Selectors and values are one on one matched, i.e. the - // value of selectors_list[i] should be set to values[i] (therefore, this - // method requires that selectors_list.size() == values.size()). - virtual void SetFieldsValue( - const std::vector<std::vector<std::string>>& selectors_list, - const std::vector<std::string>& values, - base::OnceCallback<void(bool)> callback); + // Set the |value| of field |selectors| and return the result through + // |callback|. + virtual void SetFieldValue(const std::vector<std::string>& selectors, + const std::string& value, + base::OnceCallback<void(bool)> callback); // Given an element |selectors| on the page as the root element, build a node // tree using the output parameter |node_tree_out| as a starting node. @@ -210,6 +207,13 @@ void OnGetValueAttribute( base::OnceCallback<void(const std::string&)> callback, std::unique_ptr<runtime::CallFunctionOnResult> result); + void OnFindElementForSetFieldValue( + const std::string& value, + base::OnceCallback<void(bool)> callback, + std::unique_ptr<FindElementResult> element_result); + void OnSetValueAttribute( + base::OnceCallback<void(bool)> callback, + std::unique_ptr<runtime::CallFunctionOnResult> result); // Weak pointer is fine here since it must outlive this web controller, which // is guaranteed by the owner of this object.
diff --git a/components/autofill_assistant/browser/web_controller_browsertest.cc b/components/autofill_assistant/browser/web_controller_browsertest.cc index 1630d3134..0938619 100644 --- a/components/autofill_assistant/browser/web_controller_browsertest.cc +++ b/components/autofill_assistant/browser/web_controller_browsertest.cc
@@ -180,6 +180,26 @@ std::move(done_callback).Run(); } + bool SetFieldValue(const std::vector<std::string>& selectors, + const std::string& value) { + base::RunLoop run_loop; + bool result; + web_controller_->SetFieldValue( + selectors, value, + base::BindOnce(&WebControllerBrowserTest::OnSetFieldValue, + base::Unretained(this), run_loop.QuitClosure(), + &result)); + run_loop.Run(); + return result; + } + + void OnSetFieldValue(const base::Closure& done_callback, + bool* result_output, + bool result) { + *result_output = result; + std::move(done_callback).Run(); + } + private: std::unique_ptr<net::EmbeddedTestServer> http_server_; std::unique_ptr<WebController> web_controller_; @@ -364,14 +384,18 @@ EXPECT_EQ(node.value(), "BODY"); } -IN_PROC_BROWSER_TEST_F(WebControllerBrowserTest, GetFieldValue) { +IN_PROC_BROWSER_TEST_F(WebControllerBrowserTest, GetAndSetFieldValue) { std::vector<std::string> selectors; selectors.emplace_back("#input"); EXPECT_EQ("helloworld", GetFieldValue(selectors)); + EXPECT_TRUE(SetFieldValue(selectors, "foo'")); + EXPECT_EQ("foo'", GetFieldValue(selectors)); + selectors.clear(); selectors.emplace_back("#invalid_selector"); EXPECT_EQ("", GetFieldValue(selectors)); + EXPECT_FALSE(SetFieldValue(selectors, "foobar")); } } // namespace
diff --git a/components/cryptauth/cryptauth_client_impl.cc b/components/cryptauth/cryptauth_client_impl.cc index a280f4c..6425c86 100644 --- a/components/cryptauth/cryptauth_client_impl.cc +++ b/components/cryptauth/cryptauth_client_impl.cc
@@ -204,6 +204,11 @@ setting: "This feature cannot be disabled by settings. However, this request " "is made only for signed-in users." + chrome_policy { + SigninAllowed { + SigninAllowed: false + } + } })"); MakeApiCall(kSetupEnrollmentPath, request, callback, error_callback, partial_traffic_annotation); @@ -230,6 +235,11 @@ setting: "This feature cannot be disabled by settings. However, this request " "is made only for signed-in users." + chrome_policy { + SigninAllowed { + SigninAllowed: false + } + } })"); MakeApiCall(kFinishEnrollmentPath, request, callback, error_callback, partial_traffic_annotation);
diff --git a/components/cryptauth/cryptauth_device_manager_impl.cc b/components/cryptauth/cryptauth_device_manager_impl.cc index f9707761..be37474 100644 --- a/components/cryptauth/cryptauth_device_manager_impl.cc +++ b/components/cryptauth/cryptauth_device_manager_impl.cc
@@ -750,6 +750,11 @@ setting: "This feature cannot be disabled in settings. However, this request " "is made only for signed-in users." + chrome_policy { + SigninAllowed { + SigninAllowed: false + } + } })"); cryptauth_client_->GetMyDevices( request,
diff --git a/components/omnibox/browser/BUILD.gn b/components/omnibox/browser/BUILD.gn index 1d55e686..8fe3865 100644 --- a/components/omnibox/browser/BUILD.gn +++ b/components/omnibox/browser/BUILD.gn
@@ -37,6 +37,7 @@ "http.icon", "keyword_search.icon", "md_page.icon", + "pedal.icon", "star.icon", "switch.icon", "tab.icon",
diff --git a/components/omnibox/browser/omnibox_field_trial.cc b/components/omnibox/browser/omnibox_field_trial.cc index 871246d..cce20ad 100644 --- a/components/omnibox/browser/omnibox_field_trial.cc +++ b/components/omnibox/browser/omnibox_field_trial.cc
@@ -70,7 +70,7 @@ const base::Feature kExperimentalKeywordMode{"ExperimentalKeywordMode", base::FEATURE_DISABLED_BY_DEFAULT}; -// Feature used to enable pedal suggestion as either in-suggestion side button +// Feature used to enable Pedal suggestions as either in-suggestion side button // or dedicated suggestion beneath triggering suggestion. const base::Feature kOmniboxPedalSuggestions{"OmniboxPedalSuggestions", base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/components/omnibox/browser/omnibox_field_trial.h b/components/omnibox/browser/omnibox_field_trial.h index a2cd9c6..8de5ab80 100644 --- a/components/omnibox/browser/omnibox_field_trial.h +++ b/components/omnibox/browser/omnibox_field_trial.h
@@ -157,7 +157,7 @@ EMPHASIZE_NEVER = 3 }; - // These are the discrete possibilities for pedal behavior. + // These are the discrete possibilities for Pedal behavior. enum class PedalSuggestionMode { NONE, IN_SUGGESTION,
diff --git a/components/omnibox/browser/vector_icons/pedal.icon b/components/omnibox/browser/vector_icons/pedal.icon new file mode 100644 index 0000000..e6bb15f --- /dev/null +++ b/components/omnibox/browser/vector_icons/pedal.icon
@@ -0,0 +1,81 @@ +// 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. + +// Source: bicycle-pedal.svg -> SVGOMG -> Skiafy + +CANVAS_DIMENSIONS, 100, +MOVE_TO, 97.5f, 49.85f, +R_ARC_TO, 2.23f, 2.23f, 0, 0, 0, -0.28f, -0.95f, +LINE_TO, 78.76f, 16.92f, +R_ARC_TO, 2.26f, 2.26f, 0, 0, 0, -1.94f, -1.12f, +R_H_LINE_TO, -36.91f, +R_CUBIC_TO, -0.77f, 0, -1.53f, 0.44f, -1.92f, 1.12f, +LINE_TO, 19.53f, 48.9f, +R_ARC_TO, 2.26f, 2.26f, 0, 0, 0, 0, 2.22f, +R_LINE_TO, 18.46f, 31.98f, +R_ARC_TO, 2.26f, 2.26f, 0, 0, 0, 1.92f, 1.1f, +R_H_LINE_TO, 36.91f, +R_ARC_TO, 2.26f, 2.26f, 0, 0, 0, 1.94f, -1.1f, +LINE_TO, 97.22f, 51.11f, +R_CUBIC_TO, 0.18f, -0.32f, 0.27f, -0.69f, 0.28f, -1.06f, +R_ARC_TO, 2.25f, 2.25f, 0, 0, 0, 0, -0.21f, +CLOSE, +R_MOVE_TO, -9.17f, -0.18f, +R_CUBIC_TO, 0.01f, 0.35f, -0.07f, 0.7f, -0.23f, 1.01f, +R_LINE_TO, -14.14f, 24.66f, +H_LINE_TO, 42.78f, +LINE_TO, 28.73f, 51.4f, +R_ARC_TO, 2.25f, 2.25f, 0, 0, 1, -0.11f, -1.99f, +R_LINE_TO, 14.15f, -24.74f, +R_H_LINE_TO, 31.18f, +LINE_TO, 88.03f, 48.61f, +R_CUBIC_TO, 0.19f, 0.32f, 0.29f, 0.69f, 0.3f, 1.06f, +CLOSE, +R_MOVE_TO, -1.82f, 0.09f, +R_ARC_TO, 2.23f, 2.23f, 0, 0, 0, -0.3f, -1.16f, +R_LINE_TO, -3.9f, -6.76f, +H_LINE_TO, 34.79f, +R_LINE_TO, -4.24f, 7.33f, +R_ARC_TO, 2.26f, 2.26f, 0, 0, 0, 0, 2.22f, +R_LINE_TO, 3.91f, 6.77f, +H_LINE_TO, 81.97f, +R_LINE_TO, 4.24f, -7.34f, +R_CUBIC_TO, 0.19f, -0.32f, 0.29f, -0.69f, 0.3f, -1.06f, +CLOSE, +MOVE_TO, 73.96f, 20.24f, +R_ARC_TO, 1.58f, 1.58f, 0, 1, 1, -3.17f, 0, +R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, 3.17f, 0, +CLOSE, +R_MOVE_TO, 0, 59.53f, +R_ARC_TO, 1.58f, 1.58f, 0, 1, 1, -3.17f, 0, +R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, 3.17f, 0, +CLOSE, +MOVE_TO, 59.95f, 20.24f, +R_ARC_TO, 1.58f, 1.58f, 0, 1, 1, -3.17f, 0, +R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, 3.17f, 0, +CLOSE, +R_MOVE_TO, 0, 59.53f, +R_ARC_TO, 1.58f, 1.58f, 0, 1, 1, -3.17f, 0, +R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, 3.17f, 0, +CLOSE, +MOVE_TO, 45.94f, 20.24f, +R_ARC_TO, 1.58f, 1.58f, 0, 1, 1, -3.17f, 0, +R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, 3.17f, 0, +CLOSE, +R_MOVE_TO, 0, 59.53f, +R_ARC_TO, 1.58f, 1.58f, 0, 1, 1, -3.17f, 0, +R_ARC_TO, 1.58f, 1.58f, 0, 0, 1, 3.17f, 0, +CLOSE, +MOVE_TO, 22, 41.46f, +H_LINE_TO, 13.91f, +R_V_LINE_TO, 2.22f, +H_LINE_TO, 2.5f, +R_V_LINE_TO, 12.67f, +R_H_LINE_TO, 11.41f, +R_V_LINE_TO, 2.21f, +R_H_LINE_TO, 8.09f, +R_LINE_TO, -4.29f, -7.43f, +R_ARC_TO, 2.22f, 2.22f, 0, 0, 1, 0, -2.22f, +R_LINE_TO, 4.29f, -7.44f, +CLOSE
diff --git a/components/policy/core/common/cloud/device_management_service.cc b/components/policy/core/common/cloud/device_management_service.cc index 53a497f..62b1441 100644 --- a/components/policy/core/common/cloud/device_management_service.cc +++ b/components/policy/core/common/cloud/device_management_service.cc
@@ -633,10 +633,15 @@ } policy { cookies_allowed: NO - setting: "This feature cannot be controlled by Chrome settings, " - "but users can sign out of Chrome to disable it.", - policy_exception_justification: - "Essential for Google account management" + setting: + "This feature cannot be controlled by Chrome settings, but users " + "can sign out of Chrome to disable it." + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } })"); auto resource_request = std::make_unique<network::ResourceRequest>(); resource_request->url = std::move(url);
diff --git a/components/policy/core/common/cloud/user_info_fetcher.cc b/components/policy/core/common/cloud/user_info_fetcher.cc index 1be9670..f9feeceb 100644 --- a/components/policy/core/common/cloud/user_info_fetcher.cc +++ b/components/policy/core/common/cloud/user_info_fetcher.cc
@@ -56,9 +56,13 @@ cookies_allowed: NO setting: "This feature cannot be controlled by Chrome settings, but users " - "can sign out of Chrome to disable it.", - policy_exception_justification: - "Essential for Google account management" + "can sign out of Chrome to disable it." + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } })"); auto resource_request = std::make_unique<network::ResourceRequest>();
diff --git a/components/policy/resources/policy_templates.json b/components/policy/resources/policy_templates.json index 6f8f8c9..737a613 100644 --- a/components/policy/resources/policy_templates.json +++ b/components/policy/resources/policy_templates.json
@@ -2281,7 +2281,7 @@ 'name': 'SigninAllowed', 'type': 'main', 'schema': { 'type': 'boolean' }, - 'supported_on': ['chrome.*:27-70', 'android:38-70'], + 'supported_on': ['chrome.*:27-', 'android:38-'], 'features': { 'dynamic_refresh': True, 'per_profile': True,
diff --git a/components/printing/test/print_render_frame_helper_browsertest.cc b/components/printing/test/print_render_frame_helper_browsertest.cc index b747485..48c8e8a 100644 --- a/components/printing/test/print_render_frame_helper_browsertest.cc +++ b/components/printing/test/print_render_frame_helper_browsertest.cc
@@ -13,6 +13,7 @@ #include "base/command_line.h" #include "base/macros.h" #include "base/run_loop.h" +#include "base/stl_util.h" #include "base/strings/string_piece.h" #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" @@ -523,7 +524,7 @@ bool baseline = false; EXPECT_TRUE(print_render_thread_->printer()); - for (size_t i = 0; i < arraysize(kTestPages); ++i) { + for (size_t i = 0; i < base::size(kTestPages); ++i) { // Load an HTML page and print it. LoadHTML(kTestPages[i].page); OnPrintPages();
diff --git a/components/signin/core/browser/signin_manager.cc b/components/signin/core/browser/signin_manager.cc index 88c5da41..c27e9797 100644 --- a/components/signin/core/browser/signin_manager.cc +++ b/components/signin/core/browser/signin_manager.cc
@@ -245,7 +245,8 @@ // profile is not connected to an account. switch (remove_option) { case RemoveAccountsOption::kRemoveAllAccounts: - VLOG(0) << "Revoking all refresh tokens on server. Reason: sign out."; + VLOG(0) << "Revoking all refresh tokens on server. Reason: sign out, " + << "IsSigninAllowed: " << IsSigninAllowed(); token_service_->RevokeAllCredentials(); break; case RemoveAccountsOption::kRemoveAuthenticatedAccountIfInError: @@ -271,12 +272,16 @@ base::Bind(&SigninManager::OnGoogleServicesUsernamePatternChanged, weak_pointer_factory_.GetWeakPtr())); } + signin_allowed_.Init(prefs::kSigninAllowed, + client_->GetPrefs(), + base::Bind(&SigninManager::OnSigninAllowedPrefChanged, + base::Unretained(this))); std::string account_id = client_->GetPrefs()->GetString(prefs::kGoogleServicesAccountId); std::string user = account_id.empty() ? std::string() : account_tracker_service()->GetAccountInfo(account_id).email; - if (!account_id.empty() && !IsAllowedUsername(user)) { + if ((!account_id.empty() && !IsAllowedUsername(user)) || !IsSigninAllowed()) { // User is signed in, but the username is invalid - the administrator must // have changed the policy since the last signin, so sign out the user. SignOut(signin_metrics::SIGNIN_PREF_CHANGED_DURING_SIGNIN, @@ -307,6 +312,16 @@ } } +bool SigninManager::IsSigninAllowed() const { + return signin_allowed_.GetValue(); +} + +void SigninManager::OnSigninAllowedPrefChanged() { + if (!IsSigninAllowed() && (IsAuthenticated() || AuthInProgress())) + SignOut(signin_metrics::SIGNOUT_PREF_CHANGED, + signin_metrics::SignoutDelete::IGNORE_METRIC); +} + // static bool SigninManager::IsUsernameAllowedByPolicy(const std::string& username, const std::string& policy) {
diff --git a/components/signin/core/browser/signin_manager.h b/components/signin/core/browser/signin_manager.h index 9e7d02b4..25f7920 100644 --- a/components/signin/core/browser/signin_manager.h +++ b/components/signin/core/browser/signin_manager.h
@@ -33,6 +33,7 @@ #include "base/observer_list.h" #include "components/keyed_service/core/keyed_service.h" #include "components/prefs/pref_change_registrar.h" +#include "components/prefs/pref_member.h" #include "components/signin/core/browser/account_info.h" #include "components/signin/core/browser/account_tracker_service.h" #include "components/signin/core/browser/profile_management_switches.h" @@ -161,6 +162,8 @@ // Returns true if there's a signin in progress. bool AuthInProgress() const override; + bool IsSigninAllowed() const override; + // Returns true if the passed username is allowed by policy. Virtual for // mocking in tests. virtual bool IsAllowedUsername(const std::string& username) const; @@ -264,6 +267,7 @@ signin_metrics::SignoutDelete signout_delete_metric, RemoveAccountsOption remove_option); + void OnSigninAllowedPrefChanged(); void OnGoogleServicesUsernamePatternChanged(); std::string possibly_invalid_account_id_; @@ -295,6 +299,9 @@ // profile-specific local prefs (like kGoogleServicesUsernamePattern). PrefChangeRegistrar local_state_pref_registrar_; + // Helper object to listen for changes to the signin allowed preference. + BooleanPrefMember signin_allowed_; + signin::AccountConsistencyMethod account_consistency_; // Two gate conditions for when PostSignedIn should be called. Verify
diff --git a/components/signin/core/browser/signin_manager_base.cc b/components/signin/core/browser/signin_manager_base.cc index 1c37342b..4089566b 100644 --- a/components/signin/core/browser/signin_manager_base.cc +++ b/components/signin/core/browser/signin_manager_base.cc
@@ -56,6 +56,7 @@ registry->RegisterBooleanPref(prefs::kReverseAutologinEnabled, true); registry->RegisterListPref(prefs::kReverseAutologinRejectedEmailList, std::make_unique<base::ListValue>()); + registry->RegisterBooleanPref(prefs::kSigninAllowed, true); registry->RegisterInt64Pref(prefs::kSignedInTime, base::Time().ToInternalValue()); @@ -153,6 +154,10 @@ bool SigninManagerBase::IsInitialized() const { return initialized_; } +bool SigninManagerBase::IsSigninAllowed() const { + return client_->GetPrefs()->GetBoolean(prefs::kSigninAllowed); +} + AccountInfo SigninManagerBase::GetAuthenticatedAccountInfo() const { return account_tracker_service_->GetAccountInfo(GetAuthenticatedAccountId()); }
diff --git a/components/signin/core/browser/signin_manager_base.h b/components/signin/core/browser/signin_manager_base.h index 682999b..63e0fc72 100644 --- a/components/signin/core/browser/signin_manager_base.h +++ b/components/signin/core/browser/signin_manager_base.h
@@ -128,6 +128,14 @@ virtual void Initialize(PrefService* local_state); bool IsInitialized() const; + // Returns true if a signin to Chrome is allowed (by policy or pref). + // TODO(tim): kSigninAllowed is defined for all platforms in pref_names.h. + // If kSigninAllowed pref was non-Chrome OS-only, this method wouldn't be + // needed, but as is we provide this method to let all interested code + // code query the value in one way, versus half using PrefService directly + // and the other half using SigninManager. + virtual bool IsSigninAllowed() const; + // If a user has previously signed in (and has not signed out), this returns // the know information of the account. Otherwise, it returns an empty struct. AccountInfo GetAuthenticatedAccountInfo() const;
diff --git a/components/signin/core/browser/signin_manager_unittest.cc b/components/signin/core/browser/signin_manager_unittest.cc index cae4659..c47fefa 100644 --- a/components/signin/core/browser/signin_manager_unittest.cc +++ b/components/signin/core/browser/signin_manager_unittest.cc
@@ -431,6 +431,17 @@ EXPECT_EQ(account_id, manager_->GetAuthenticatedAccountId()); } +TEST_F(SigninManagerTest, SigninNotAllowed) { + std::string user("user@google.com"); + user_prefs_.SetString(prefs::kGoogleServicesAccountId, user); + user_prefs_.SetBoolean(prefs::kSigninAllowed, false); + CreateSigninManager(); + AddToAccountTracker("gaia_id", user); + // Currently signing in is prohibited by policy, so should be signed out. + EXPECT_EQ("", manager_->GetAuthenticatedAccountInfo().email); + EXPECT_EQ("", manager_->GetAuthenticatedAccountId()); +} + TEST_F(SigninManagerTest, UpgradeToNewPrefs) { user_prefs_.SetString(prefs::kGoogleServicesUsername, "user@gmail.com"); user_prefs_.SetString(prefs::kGoogleServicesUserAccountId, "account_id");
diff --git a/components/signin/core/browser/signin_pref_names.cc b/components/signin/core/browser/signin_pref_names.cc index 9c2ed2f..0215ef0 100644 --- a/components/signin/core/browser/signin_pref_names.cc +++ b/components/signin/core/browser/signin_pref_names.cc
@@ -89,6 +89,9 @@ // to the browser. const char kSignedInTime[] = "signin.signedin_time"; +// Boolean which stores if the user is allowed to signin to chrome. +const char kSigninAllowed[] = "signin.allowed"; + // True if the token service has been prepared for Dice migration. const char kTokenServiceDiceCompatible[] = "token_service.dice_compatible";
diff --git a/components/signin/core/browser/signin_pref_names.h b/components/signin/core/browser/signin_pref_names.h index 0579d6e..7e6afad 100644 --- a/components/signin/core/browser/signin_pref_names.h +++ b/components/signin/core/browser/signin_pref_names.h
@@ -26,6 +26,7 @@ extern const char kReverseAutologinEnabled[]; extern const char kReverseAutologinRejectedEmailList[]; extern const char kSignedInTime[]; +extern const char kSigninAllowed[]; extern const char kTokenServiceDiceCompatible[]; extern const char kTokenServiceExcludeAllSecondaryAccounts[]; extern const char kTokenServiceExcludedSecondaryAccounts[];
diff --git a/components/suggestions/image_manager.cc b/components/suggestions/image_manager.cc index 99d13fc..2466524 100644 --- a/components/suggestions/image_manager.cc +++ b/components/suggestions/image_manager.cc
@@ -51,10 +51,16 @@ "Users can disable this feature by signing out of Chrome, or " "disabling Sync or History Sync in Chrome settings under 'Advanced " "sync settings...'. The feature is enabled by default." - chrome_policy { - SyncDisabled { - policy_options {mode: MANDATORY} - SyncDisabled: true + chrome_policy { + SyncDisabled { + policy_options {mode: MANDATORY} + SyncDisabled: true + } + } + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false } } })");
diff --git a/components/suggestions/suggestions_service_impl.cc b/components/suggestions/suggestions_service_impl.cc index ed9d9ca..1c3678c 100644 --- a/components/suggestions/suggestions_service_impl.cc +++ b/components/suggestions/suggestions_service_impl.cc
@@ -445,6 +445,12 @@ SyncDisabled: true } } + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } })"); auto resource_request = std::make_unique<network::ResourceRequest>(); resource_request->url = url;
diff --git a/components/sync/base/data_type_histogram.cc b/components/sync/base/data_type_histogram.cc index 68b71f7..0d75794 100644 --- a/components/sync/base/data_type_histogram.cc +++ b/components/sync/base/data_type_histogram.cc
@@ -8,7 +8,7 @@ namespace { const char kModelTypeMemoryHistogramPrefix[] = "Sync.ModelTypeMemoryKB."; -const char kModelTypeCountHistogramPrefix[] = "Sync.ModelTypeCount3."; +const char kModelTypeCountHistogramPrefix[] = "Sync.ModelTypeCount4."; } // namespace void SyncRecordModelTypeMemoryHistogram(syncer::ModelType model_type,
diff --git a/components/sync/driver/directory_data_type_controller.cc b/components/sync/driver/directory_data_type_controller.cc index 3420a8c..3d5ca23 100644 --- a/components/sync/driver/directory_data_type_controller.cc +++ b/components/sync/driver/directory_data_type_controller.cc
@@ -95,8 +95,8 @@ sync_client_->GetSyncService()->GetUserShare()->directory.get(); SyncRecordModelTypeMemoryHistogram( type(), directory->EstimateMemoryUsageByType(type())); - SyncRecordModelTypeCountHistogram(type(), - directory->CountEntriesByType(type())); + int count_excl_root_node = directory->CountEntriesByType(type()) - 1; + SyncRecordModelTypeCountHistogram(type(), count_excl_root_node); } // static
diff --git a/components/viz/host/host_gpu_memory_buffer_manager_unittest.cc b/components/viz/host/host_gpu_memory_buffer_manager_unittest.cc index 7a63389..07c8df0 100644 --- a/components/viz/host/host_gpu_memory_buffer_manager_unittest.cc +++ b/components/viz/host/host_gpu_memory_buffer_manager_unittest.cc
@@ -111,11 +111,13 @@ void GetVideoMemoryUsageStats( GetVideoMemoryUsageStatsCallback callback) override {} +#if defined(OS_WIN) void RequestCompleteGpuInfo( RequestCompleteGpuInfoCallback callback) override {} void GetGpuSupportedRuntimeVersion( GetGpuSupportedRuntimeVersionCallback callback) override {} +#endif void RequestHDRStatus(RequestHDRStatusCallback callback) override {}
diff --git a/components/viz/service/display_embedder/gpu_display_provider.cc b/components/viz/service/display_embedder/gpu_display_provider.cc index 25a02fb..155ef82 100644 --- a/components/viz/service/display_embedder/gpu_display_provider.cc +++ b/components/viz/service/display_embedder/gpu_display_provider.cc
@@ -152,7 +152,7 @@ renderer_settings.requires_alpha_channel); context_result = context_provider->BindToCurrentThread(); - if (context_result == gpu::ContextResult::kFatalFailure) { + if (IsFatalOrSurfaceFailure(context_result)) { gpu_service_impl_->DisableGpuCompositing(); return nullptr; }
diff --git a/components/viz/service/gl/gpu_service_impl.cc b/components/viz/service/gl/gpu_service_impl.cc index 3469d92..40a6b345 100644 --- a/components/viz/service/gl/gpu_service_impl.cc +++ b/components/viz/service/gl/gpu_service_impl.cc
@@ -519,10 +519,9 @@ std::move(callback).Run(video_memory_usage_stats); } -// Currently, this function only supports the Windows platform. +#if defined(OS_WIN) void GpuServiceImpl::GetGpuSupportedRuntimeVersion( GetGpuSupportedRuntimeVersionCallback callback) { -#if defined(OS_WIN) if (io_runner_->BelongsToCurrentThread()) { auto wrap_callback = WrapCallback(io_runner_, std::move(callback)); main_runner_->PostTask( @@ -544,7 +543,6 @@ // The unsandboxed GPU process fulfilled its duty. Bye bye. ExitProcess(); } -#endif } void GpuServiceImpl::RequestCompleteGpuInfo( @@ -563,16 +561,15 @@ base::BindOnce( [](GpuServiceImpl* gpu_service, RequestCompleteGpuInfoCallback callback) { - std::move(callback).Run(gpu_service->gpu_info_); -#if defined(OS_WIN) + std::move(callback).Run(gpu_service->gpu_info_.dx_diagnostics); if (!gpu_service->in_host_process()) { // The unsandboxed GPU process fulfilled its duty. Bye bye. gpu_service->ExitProcess(); } -#endif }, this, std::move(callback)))); } +#endif void GpuServiceImpl::RequestHDRStatus(RequestHDRStatusCallback callback) { DCHECK(io_runner_->BelongsToCurrentThread());
diff --git a/components/viz/service/gl/gpu_service_impl.h b/components/viz/service/gl/gpu_service_impl.h index 16164d9..9fc34bf 100644 --- a/components/viz/service/gl/gpu_service_impl.h +++ b/components/viz/service/gl/gpu_service_impl.h
@@ -216,9 +216,11 @@ const gpu::SyncToken& sync_token) override; void GetVideoMemoryUsageStats( GetVideoMemoryUsageStatsCallback callback) override; +#if defined(OS_WIN) void RequestCompleteGpuInfo(RequestCompleteGpuInfoCallback callback) override; void GetGpuSupportedRuntimeVersion( GetGpuSupportedRuntimeVersionCallback callback) override; +#endif void RequestHDRStatus(RequestHDRStatusCallback callback) override; void LoadedShader(int32_t client_id, const std::string& key,
diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc index 68f22f3..3ef8b77 100644 --- a/content/browser/compositor/gpu_process_transport_factory.cc +++ b/content/browser/compositor/gpu_process_transport_factory.cc
@@ -404,7 +404,7 @@ auto result = shared_worker_context_provider_->BindToCurrentThread(); if (result != gpu::ContextResult::kSuccess) { shared_worker_context_provider_ = nullptr; - if (result == gpu::ContextResult::kFatalFailure) + if (gpu::IsFatalOrSurfaceFailure(result)) use_gpu_compositing = false; } } @@ -434,7 +434,7 @@ auto result = context_provider->BindToCurrentThread(); if (result != gpu::ContextResult::kSuccess) { context_provider = nullptr; - if (result == gpu::ContextResult::kFatalFailure) + if (gpu::IsFatalOrSurfaceFailure(result)) use_gpu_compositing = false; } }
diff --git a/content/browser/compositor/viz_process_transport_factory.cc b/content/browser/compositor/viz_process_transport_factory.cc index 75dbc2d2..2e4a7ba 100644 --- a/content/browser/compositor/viz_process_transport_factory.cc +++ b/content/browser/compositor/viz_process_transport_factory.cc
@@ -234,10 +234,11 @@ context_result = TryCreateContextsForGpuCompositing( gpu_channel_establish_factory_->EstablishGpuChannelSync()); - if (context_result == gpu::ContextResult::kFatalFailure) + if (gpu::IsFatalOrSurfaceFailure(context_result)) DisableGpuCompositing(nullptr); } - // On kFatalFailure |main_context_provider_| will be null. + // On kFatalFailure or kSurfaceFailure, |main_context_provider_| will be + // null. } return main_context_provider_; @@ -376,7 +377,7 @@ base::BindOnce(&VizProcessTransportFactory::OnEstablishedGpuChannel, weak_ptr_factory_.GetWeakPtr(), compositor_weak_ptr)); return; - } else if (context_result == gpu::ContextResult::kFatalFailure) { + } else if (gpu::IsFatalOrSurfaceFailure(context_result)) { DisableGpuCompositing(compositor); gpu_compositing = false; }
diff --git a/content/browser/compositor/viz_process_transport_factory.h b/content/browser/compositor/viz_process_transport_factory.h index 41619afe..5823501ed 100644 --- a/content/browser/compositor/viz_process_transport_factory.h +++ b/content/browser/compositor/viz_process_transport_factory.h
@@ -104,8 +104,8 @@ // blacklisted. // // Returns kSuccess if caller can use GPU compositing, kTransientFailure if - // caller should try again or kFatalFailure if caller should fallback to - // software compositing. + // caller should try again or kFatalFailure/kSurfaceFailure if caller should + // fallback to software compositing. gpu::ContextResult TryCreateContextsForGpuCompositing( scoped_refptr<gpu::GpuChannelHost> gpu_channel_host);
diff --git a/content/browser/do_not_track_browsertest.cc b/content/browser/do_not_track_browsertest.cc index 757f6a3..f6bfed9f 100644 --- a/content/browser/do_not_track_browsertest.cc +++ b/content/browser/do_not_track_browsertest.cc
@@ -79,6 +79,10 @@ return value; } + GURL GetURL(std::string relative_url) { + return embedded_test_server()->GetURL(relative_url); + } + private: ContentBrowserClient* original_client_ = nullptr; MockContentBrowserClient client_; @@ -101,8 +105,7 @@ // Checks that the DNT header is not sent by default. IN_PROC_BROWSER_TEST_F(DoNotTrackTest, NotEnabled) { ASSERT_TRUE(embedded_test_server()->Start()); - GURL url = embedded_test_server()->GetURL("/echoheader?DNT"); - EXPECT_TRUE(NavigateToURL(shell(), url)); + EXPECT_TRUE(NavigateToURL(shell(), GetURL("/echoheader?DNT"))); ExpectPageTextEq("None"); // And the DOM property is not set. EXPECT_EQ("", GetDOMDoNotTrackProperty()); @@ -113,17 +116,15 @@ ASSERT_TRUE(embedded_test_server()->Start()); if (!EnableDoNotTrack()) return; - GURL url = embedded_test_server()->GetURL("/echoheader?DNT"); - EXPECT_TRUE(NavigateToURL(shell(), url)); + EXPECT_TRUE(NavigateToURL(shell(), GetURL("/echoheader?DNT"))); ExpectPageTextEq("1"); } // Checks that the DNT header is preserved during redirects. IN_PROC_BROWSER_TEST_F(DoNotTrackTest, Redirect) { ASSERT_TRUE(embedded_test_server()->Start()); - GURL final_url = embedded_test_server()->GetURL("/echoheader?DNT"); - GURL url = embedded_test_server()->GetURL(std::string("/server-redirect?") + - final_url.spec()); + GURL final_url = GetURL("/echoheader?DNT"); + GURL url = GetURL("/server-redirect?" + final_url.spec()); if (!EnableDoNotTrack()) return; // We don't check the result NavigateToURL as it returns true only if the @@ -135,10 +136,9 @@ // Checks that the DOM property is set when the corresponding preference is set. IN_PROC_BROWSER_TEST_F(DoNotTrackTest, DOMProperty) { ASSERT_TRUE(embedded_test_server()->Start()); - GURL url = embedded_test_server()->GetURL("/echo"); if (!EnableDoNotTrack()) return; - EXPECT_TRUE(NavigateToURL(shell(), url)); + EXPECT_TRUE(NavigateToURL(shell(), GetURL("/echo"))); EXPECT_EQ("1", GetDOMDoNotTrackProperty()); } @@ -152,9 +152,8 @@ ASSERT_TRUE(embedded_test_server()->Start()); if (!EnableDoNotTrack()) return; - const GURL url = embedded_test_server()->GetURL( - std::string("/workers/create_worker.html?worker_url=/capture")); - NavigateToURL(shell(), url); + NavigateToURL(shell(), + GetURL("/workers/create_worker.html?worker_url=/capture")); loop.Run(); EXPECT_TRUE(header_map.find("DNT") != header_map.end()); @@ -177,9 +176,9 @@ ASSERT_TRUE(embedded_test_server()->Start()); if (!EnableDoNotTrack()) return; - const GURL url = embedded_test_server()->GetURL( - std::string("/workers/create_shared_worker.html?worker_url=/capture")); - NavigateToURL(shell(), url); + NavigateToURL( + shell(), + GetURL("/workers/create_shared_worker.html?worker_url=/capture")); loop.Run(); EXPECT_TRUE(header_map.find("DNT") != header_map.end()); @@ -196,9 +195,10 @@ ASSERT_TRUE(embedded_test_server()->Start()); if (!EnableDoNotTrack()) return; - const GURL url = embedded_test_server()->GetURL(std::string( - "/service_worker/create_service_worker.html?worker_url=/capture")); - NavigateToURL(shell(), url); + NavigateToURL(shell(), GetURL("/service_worker/create_service_worker.html")); + // We only verify the request for the worker script so we don't check the + // result of register(). + EXPECT_TRUE(ExecJs(shell(), "register('/capture');")); loop.Run(); EXPECT_TRUE(header_map.find("DNT") != header_map.end()); @@ -211,13 +211,8 @@ ASSERT_TRUE(embedded_test_server()->Start()); if (!EnableDoNotTrack()) return; - const GURL fetch_url = embedded_test_server()->GetURL("/echoheader?DNT"); - const GURL page_url = - embedded_test_server()->GetURL("/workers/fetch_from_worker.html"); - NavigateToURL(shell(), page_url); - - EXPECT_EQ("1", - EvalJs(shell(), "fetch_from_worker('" + fetch_url.spec() + "');")); + NavigateToURL(shell(), GetURL("/workers/fetch_from_worker.html")); + EXPECT_EQ("1", EvalJs(shell(), "fetch_from_worker('/echoheader?DNT');")); } // Checks that the DNT header is preserved when fetching from a shared worker. @@ -233,13 +228,10 @@ ASSERT_TRUE(embedded_test_server()->Start()); if (!EnableDoNotTrack()) return; - const GURL fetch_url = embedded_test_server()->GetURL("/echoheader?DNT"); - const GURL page_url = - embedded_test_server()->GetURL("/workers/fetch_from_shared_worker.html"); - NavigateToURL(shell(), page_url); + NavigateToURL(shell(), GetURL("/workers/fetch_from_shared_worker.html")); - EXPECT_EQ("1", EvalJs(shell(), "fetch_from_shared_worker('" + - fetch_url.spec() + "');")); + EXPECT_EQ("1", + EvalJs(shell(), "fetch_from_shared_worker('/echoheader?DNT');")); } // Checks that the DNT header is preserved when fetching from a service worker. @@ -247,14 +239,12 @@ ASSERT_TRUE(embedded_test_server()->Start()); if (!EnableDoNotTrack()) return; - const GURL fetch_url = embedded_test_server()->GetURL("/echoheader?DNT"); - const GURL page_url = embedded_test_server()->GetURL( - "/service_worker/fetch_from_service_worker.html"); - NavigateToURL(shell(), page_url); + NavigateToURL(shell(), + GetURL("/service_worker/fetch_from_service_worker.html")); EXPECT_EQ("ready", EvalJs(shell(), "setup();")); - EXPECT_EQ("1", EvalJs(shell(), "fetch_from_service_worker('" + - fetch_url.spec() + "');")); + EXPECT_EQ("1", + EvalJs(shell(), "fetch_from_service_worker('/echoheader?DNT');")); } // Checks that the DNT header is preserved when fetching from a page controlled @@ -266,28 +256,15 @@ if (!EnableDoNotTrack()) return; - { - // Register a service worker which controls /service_worker. - const GURL url = embedded_test_server()->GetURL( - "/service_worker/create_service_worker.html?" - "worker_url=/service_worker/empty.js"); - EXPECT_TRUE(NavigateToURL(shell(), url)); - const base::string16 title = base::ASCIIToUTF16("DONE"); - TitleWatcher watcher(shell()->web_contents(), title); - EXPECT_EQ(title, watcher.WaitAndGetTitle()); - } + // Register a service worker which controls /service_worker. + EXPECT_TRUE(NavigateToURL( + shell(), GetURL("/service_worker/create_service_worker.html"))); + EXPECT_EQ("DONE", EvalJs(shell(), "register('empty.js');")); - { - // Issue a request from a controlled page. - const GURL url = embedded_test_server()->GetURL( - "/service_worker/fetch_from_page.html?url=/echoheader?DNT"); - EXPECT_TRUE(NavigateToURL(shell(), url)); - const base::string16 title = base::ASCIIToUTF16("DONE"); - TitleWatcher watcher(shell()->web_contents(), title); - EXPECT_EQ(title, watcher.WaitAndGetTitle()); - } - - ExpectPageTextEq("1"); + // Issue a request from a controlled page. + EXPECT_TRUE( + NavigateToURL(shell(), GetURL("/service_worker/fetch_from_page.html"))); + EXPECT_EQ("1", EvalJs(shell(), "fetch_from_page('/echoheader?DNT');")); } // Checks that the DNT header is preserved when fetching from a page controlled @@ -298,28 +275,16 @@ if (!EnableDoNotTrack()) return; - { - // Register a service worker which controls /service_worker. - const GURL url = embedded_test_server()->GetURL( - "/service_worker/create_service_worker.html?" - "worker_url=/service_worker/fetch_event_pass_through.js"); - EXPECT_TRUE(NavigateToURL(shell(), url)); - const base::string16 title = base::ASCIIToUTF16("DONE"); - TitleWatcher watcher(shell()->web_contents(), title); - EXPECT_EQ(title, watcher.WaitAndGetTitle()); - } + // Register a service worker which controls /service_worker. + EXPECT_TRUE(NavigateToURL( + shell(), GetURL("/service_worker/create_service_worker.html"))); + EXPECT_EQ("DONE", + EvalJs(shell(), "register('fetch_event_pass_through.js');")); - { - // Issue a request from a controlled page. - const GURL url = embedded_test_server()->GetURL( - "/service_worker/fetch_from_page.html?url=/echoheader?DNT"); - EXPECT_TRUE(NavigateToURL(shell(), url)); - const base::string16 title = base::ASCIIToUTF16("DONE"); - TitleWatcher watcher(shell()->web_contents(), title); - EXPECT_EQ(title, watcher.WaitAndGetTitle()); - } - - ExpectPageTextEq("1"); + // Issue a request from a controlled page. + EXPECT_TRUE( + NavigateToURL(shell(), GetURL("/service_worker/fetch_from_page.html"))); + EXPECT_EQ("1", EvalJs(shell(), "fetch_from_page('/echoheader?DNT');")); } // Checks that the DNT header is preserved when fetching from a page controlled @@ -330,28 +295,16 @@ if (!EnableDoNotTrack()) return; - { - // Register a service worker which controls /service_worker. - const GURL url = embedded_test_server()->GetURL( - "/service_worker/create_service_worker.html?" - "worker_url=/service_worker/fetch_event_respond_with_fetch.js"); - EXPECT_TRUE(NavigateToURL(shell(), url)); - const base::string16 title = base::ASCIIToUTF16("DONE"); - TitleWatcher watcher(shell()->web_contents(), title); - EXPECT_EQ(title, watcher.WaitAndGetTitle()); - } + // Register a service worker which controls /service_worker. + EXPECT_TRUE(NavigateToURL( + shell(), GetURL("/service_worker/create_service_worker.html"))); + EXPECT_EQ("DONE", + EvalJs(shell(), "register('fetch_event_respond_with_fetch.js');")); - { - // Issue a request from a controlled page. - const GURL url = embedded_test_server()->GetURL( - "/service_worker/fetch_from_page.html?url=/echoheader?DNT"); - EXPECT_TRUE(NavigateToURL(shell(), url)); - const base::string16 title = base::ASCIIToUTF16("DONE"); - TitleWatcher watcher(shell()->web_contents(), title); - EXPECT_EQ(title, watcher.WaitAndGetTitle()); - } - - ExpectPageTextEq("1"); + // Issue a request from a controlled page. + EXPECT_TRUE( + NavigateToURL(shell(), GetURL("/service_worker/fetch_from_page.html"))); + EXPECT_EQ("1", EvalJs(shell(), "fetch_from_page('/echoheader?DNT');")); } } // namespace
diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc index 0dcae8ab..abe9475 100644 --- a/content/browser/gpu/gpu_data_manager_impl.cc +++ b/content/browser/gpu/gpu_data_manager_impl.cc
@@ -102,6 +102,19 @@ private_->UpdateGpuInfo(gpu_info, gpu_info_for_hardware_gpu); } +#if defined(OS_WIN) +void GpuDataManagerImpl::UpdateDxDiagNode( + const gpu::DxDiagNode& dx_diagnostics) { + base::AutoLock auto_lock(lock_); + private_->UpdateDxDiagNode(dx_diagnostics); +} + +void GpuDataManagerImpl::UpdateDX12VulkanInfo(const gpu::GPUInfo& gpu_info) { + base::AutoLock auto_lock(lock_); + private_->UpdateDX12VulkanInfo(gpu_info); +} +#endif + void GpuDataManagerImpl::UpdateGpuFeatureInfo( const gpu::GpuFeatureInfo& gpu_feature_info, const base::Optional<gpu::GpuFeatureInfo>&
diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h index f0e91a8..1aa0fa3 100644 --- a/content/browser/gpu/gpu_data_manager_impl.h +++ b/content/browser/gpu/gpu_data_manager_impl.h
@@ -20,6 +20,7 @@ #include "base/thread_annotations.h" #include "base/time/time.h" #include "base/values.h" +#include "build/build_config.h" #include "content/public/browser/gpu_data_manager.h" #include "content/public/common/three_d_api_types.h" #include "gpu/config/gpu_control_list.h" @@ -73,12 +74,13 @@ bool IsGpuFeatureInfoAvailable() const; gpu::GpuFeatureStatus GetFeatureStatus(gpu::GpuFeatureType feature) const; - // Only update if the current GPUInfo is not finalized. If blacklist is - // loaded, run through blacklist and update blacklisted features. void UpdateGpuInfo( const gpu::GPUInfo& gpu_info, const base::Optional<gpu::GPUInfo>& gpu_info_for_hardware_gpu); - +#if defined(OS_WIN) + void UpdateDX12VulkanInfo(const gpu::GPUInfo& gpu_info); + void UpdateDxDiagNode(const gpu::DxDiagNode& dx_diagnostics); +#endif // Update the GPU feature info. This updates the blacklist and enabled status // of GPU rasterization. In the future this will be used for more features. void UpdateGpuFeatureInfo(const gpu::GpuFeatureInfo& gpu_feature_info,
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc index ee940e6f..0876e96 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.cc +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
@@ -251,21 +251,33 @@ base::BindOnce(&OnVideoMemoryUsageStats, callback)); } -void UpdateGpuInfoOnIO(const gpu::GPUInfo& gpu_info) { +#if defined(OS_WIN) +void UpdateDxDiagNodeOnIO(const gpu::DxDiagNode& dx_diagnostics) { // This function is called on the IO thread, but GPUInfo on GpuDataManagerImpl - // should be updated on the UI thread (since it can call into functions that - // expect to run in the UI thread, e.g. ContentClient::SetGpuInfo()). + // should be updated on the UI thread since it can call into functions that + // expect to run in the UI thread. + base::PostTaskWithTraits( + FROM_HERE, {BrowserThread::UI}, + base::BindOnce( + [](const gpu::DxDiagNode& dx_diagnostics) { + GpuDataManagerImpl::GetInstance()->UpdateDxDiagNode(dx_diagnostics); + }, + dx_diagnostics)); +} + +void UpdateDX12VulkanInfoOnIO(const gpu::GPUInfo& gpu_info) { + // This function is called on the IO thread, but GPUInfo on GpuDataManagerImpl + // should be updated on the UI thread since it can call into functions that + // expect to run in the UI thread. base::PostTaskWithTraits( FROM_HERE, {BrowserThread::UI}, base::BindOnce( [](const gpu::GPUInfo& gpu_info) { - TRACE_EVENT0("test_gpu", "OnGraphicsInfoCollected"); - GpuDataManagerImpl::GetInstance()->UpdateGpuInfo(gpu_info, - base::nullopt); + GpuDataManagerImpl::GetInstance()->UpdateDX12VulkanInfo(gpu_info); }, gpu_info)); } - +#endif } // anonymous namespace GpuDataManagerImplPrivate::GpuDataManagerImplPrivate(GpuDataManagerImpl* owner) @@ -372,25 +384,26 @@ return; if (!NeedsCompleteGpuInfoCollection()) return; + +#if defined(OS_WIN) if (!GpuAccessAllowed(nullptr)) return; if (in_process_gpu_) return; - complete_gpu_info_already_requested_ = true; - - GpuProcessHost::CallOnIO( -#if defined(OS_WIN) - GpuProcessHost::GPU_PROCESS_KIND_UNSANDBOXED, + GpuProcessHost::CallOnIO(GpuProcessHost::GPU_PROCESS_KIND_UNSANDBOXED_NO_GL, + true /* force_create */, + base::Bind([](GpuProcessHost* host) { + if (!host) + return; + host->gpu_service()->RequestCompleteGpuInfo( + base::BindOnce(&UpdateDxDiagNodeOnIO)); + })); #else - GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, + // NeedsCompleteGpuInfoCollection() always returns false on platforms other + // than Windows. + NOTREACHED(); #endif - true /* force_create */, base::Bind([](GpuProcessHost* host) { - if (!host) - return; - host->gpu_service()->RequestCompleteGpuInfo( - base::BindOnce(&UpdateGpuInfoOnIO)); - })); } void GpuDataManagerImplPrivate::RequestGpuSupportedRuntimeVersion() { @@ -398,17 +411,20 @@ if (in_process_gpu_) return; base::OnceClosure task = base::BindOnce([]() { - GpuProcessHost* host = GpuProcessHost::Get( - GpuProcessHost::GPU_PROCESS_KIND_UNSANDBOXED, true /* force_create */); + GpuProcessHost* host = + GpuProcessHost::Get(GpuProcessHost::GPU_PROCESS_KIND_UNSANDBOXED_NO_GL, + true /* force_create */); if (!host) return; host->gpu_service()->GetGpuSupportedRuntimeVersion( - base::BindOnce(&UpdateGpuInfoOnIO)); + base::BindOnce(&UpdateDX12VulkanInfoOnIO)); }); base::PostDelayedTaskWithTraits(FROM_HERE, {BrowserThread::IO}, std::move(task), base::TimeDelta::FromMilliseconds(15000)); +#else + NOTREACHED(); #endif } @@ -474,27 +490,16 @@ void GpuDataManagerImplPrivate::UpdateGpuInfo( const gpu::GPUInfo& gpu_info, const base::Optional<gpu::GPUInfo>& gpu_info_for_hardware_gpu) { - bool sandboxed = gpu_info_.sandboxed; #if defined(OS_WIN) + // If GPU process crashes and launches again, GPUInfo will be sent back from + // the new GPU process again, and may overwrite the DX12, Vulkan, DxDiagNode + // info we already collected. This is to make sure it doesn't happen. uint32_t d3d12_feature_level = gpu_info_.d3d12_feature_level; uint32_t vulkan_version = gpu_info_.vulkan_version; + gpu::DxDiagNode dx_diagnostics = gpu_info_.dx_diagnostics; #endif gpu_info_ = gpu_info; - if (!gpu_info_for_hardware_gpu_.IsInitialized()) { - if (!!gpu_info_for_hardware_gpu) { - DCHECK(gpu_info_for_hardware_gpu->IsInitialized()); - gpu_info_for_hardware_gpu_ = gpu_info_for_hardware_gpu.value(); - } else { - gpu_info_for_hardware_gpu_ = gpu_info; - } - } #if defined(OS_WIN) - // On Windows, complete GPUInfo is collected through an unsandboxed - // GPU process. If the regular GPU process is sandboxed, it should - // not be overwritten. - if (sandboxed) - gpu_info_.sandboxed = true; - if (d3d12_feature_level) { gpu_info_.d3d12_feature_level = d3d12_feature_level; gpu_info_.supports_dx12 = true; @@ -503,19 +508,49 @@ gpu_info_.vulkan_version = vulkan_version; gpu_info_.supports_vulkan = true; } -#else - (void)sandboxed; + if (!dx_diagnostics.IsEmpty()) { + gpu_info_.dx_diagnostics = dx_diagnostics; + } #endif // OS_WIN - if (complete_gpu_info_already_requested_ && - !NeedsCompleteGpuInfoCollection()) { - complete_gpu_info_already_requested_ = false; + if (!gpu_info_for_hardware_gpu_.IsInitialized()) { + if (gpu_info_for_hardware_gpu) { + DCHECK(gpu_info_for_hardware_gpu->IsInitialized()); + gpu_info_for_hardware_gpu_ = gpu_info_for_hardware_gpu.value(); + } else { + gpu_info_for_hardware_gpu_ = gpu_info_; + } } GetContentClient()->SetGpuInfo(gpu_info_); NotifyGpuInfoUpdate(); } +#if defined(OS_WIN) +void GpuDataManagerImplPrivate::UpdateDxDiagNode( + const gpu::DxDiagNode& dx_diagnostics) { + gpu_info_.dx_diagnostics = dx_diagnostics; + if (complete_gpu_info_already_requested_) + complete_gpu_info_already_requested_ = false; + // No need to call GetContentClient()->SetGpuInfo(). + NotifyGpuInfoUpdate(); +} + +void GpuDataManagerImplPrivate::UpdateDX12VulkanInfo( + const gpu::GPUInfo& gpu_info) { + if (gpu_info.d3d12_feature_level) { + gpu_info_.d3d12_feature_level = gpu_info.d3d12_feature_level; + gpu_info_.supports_dx12 = true; + } + if (gpu_info.vulkan_version) { + gpu_info_.vulkan_version = gpu_info.vulkan_version; + gpu_info_.supports_vulkan = true; + } + // No need to call GetContentClient()->SetGpuInfo(). + NotifyGpuInfoUpdate(); +} +#endif + void GpuDataManagerImplPrivate::UpdateGpuFeatureInfo( const gpu::GpuFeatureInfo& gpu_feature_info, const base::Optional<gpu::GpuFeatureInfo>& @@ -834,8 +869,7 @@ bool GpuDataManagerImplPrivate::NeedsCompleteGpuInfoCollection() const { #if defined(OS_WIN) - return (gpu_info_.dx_diagnostics.values.empty() && - gpu_info_.dx_diagnostics.children.empty()); + return gpu_info_.dx_diagnostics.IsEmpty(); #else return false; #endif
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.h b/content/browser/gpu/gpu_data_manager_impl_private.h index a64a15a..140c5f7 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.h +++ b/content/browser/gpu/gpu_data_manager_impl_private.h
@@ -63,6 +63,10 @@ void UpdateGpuInfo( const gpu::GPUInfo& gpu_info, const base::Optional<gpu::GPUInfo>& optional_gpu_info_for_hardware_gpu); +#if defined(OS_WIN) + void UpdateDxDiagNode(const gpu::DxDiagNode& dx_diagnostics); + void UpdateDX12VulkanInfo(const gpu::GPUInfo& gpu_info); +#endif void UpdateGpuFeatureInfo(const gpu::GpuFeatureInfo& gpu_feature_info, const base::Optional<gpu::GpuFeatureInfo>& gpu_feature_info_for_hardware_gpu);
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc index 671d5bf..19603aa 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc
@@ -579,7 +579,7 @@ bool force_create, const base::Callback<void(GpuProcessHost*)>& callback) { #if !defined(OS_WIN) - DCHECK_NE(kind, GpuProcessHost::GPU_PROCESS_KIND_UNSANDBOXED); + DCHECK_NE(kind, GpuProcessHost::GPU_PROCESS_KIND_UNSANDBOXED_NO_GL); #endif base::PostTaskWithTraits( FROM_HERE, {BrowserThread::IO}, @@ -926,12 +926,14 @@ const base::Optional<gpu::GPUInfo>& gpu_info_for_hardware_gpu, const base::Optional<gpu::GpuFeatureInfo>& gpu_feature_info_for_hardware_gpu) { - auto* gpu_data_manager = GpuDataManagerImpl::GetInstance(); - // Update GpuFeatureInfo first, because UpdateGpuInfo() will notify all - // listeners. - gpu_data_manager->UpdateGpuFeatureInfo(gpu_feature_info, - gpu_feature_info_for_hardware_gpu); - gpu_data_manager->UpdateGpuInfo(gpu_info, gpu_info_for_hardware_gpu); + if (kind_ != GPU_PROCESS_KIND_UNSANDBOXED_NO_GL) { + auto* gpu_data_manager = GpuDataManagerImpl::GetInstance(); + // Update GpuFeatureInfo first, because UpdateGpuInfo() will notify all + // listeners. + gpu_data_manager->UpdateGpuFeatureInfo(gpu_feature_info, + gpu_feature_info_for_hardware_gpu); + gpu_data_manager->UpdateGpuInfo(gpu_info, gpu_info_for_hardware_gpu); + } } void GpuProcessHost::DidFailInitialize() { @@ -1037,8 +1039,11 @@ cmd_line->AppendArg(switches::kPrefetchArgumentGpu); #endif // defined(OS_WIN) - if (kind_ == GPU_PROCESS_KIND_UNSANDBOXED) + if (kind_ == GPU_PROCESS_KIND_UNSANDBOXED_NO_GL) { cmd_line->AppendSwitch(service_manager::switches::kDisableGpuSandbox); + cmd_line->AppendSwitchASCII(switches::kUseGL, + gl::kGLImplementationDisabledName); + } // TODO(penghuang): Replace all GPU related switches with GpuPreferences. // https://crbug.com/590825
diff --git a/content/browser/gpu/gpu_process_host.h b/content/browser/gpu/gpu_process_host.h index c4f52c03..ce9ffeb 100644 --- a/content/browser/gpu/gpu_process_host.h +++ b/content/browser/gpu/gpu_process_host.h
@@ -55,7 +55,7 @@ public viz::GpuHostImpl::Delegate { public: enum GpuProcessKind { - GPU_PROCESS_KIND_UNSANDBOXED, + GPU_PROCESS_KIND_UNSANDBOXED_NO_GL, // Unsandboxed, no init GL bindings. GPU_PROCESS_KIND_SANDBOXED, GPU_PROCESS_KIND_COUNT };
diff --git a/content/browser/network_service_restart_browsertest.cc b/content/browser/network_service_restart_browsertest.cc index f34bc58..63d25226 100644 --- a/content/browser/network_service_restart_browsertest.cc +++ b/content/browser/network_service_restart_browsertest.cc
@@ -624,6 +624,130 @@ EXPECT_EQ(last_request_relative_url(), "/title2.html"); } +// Make sure fetch from a page controlled by a service worker which doesn't have +// a fetch handler works after crash. +IN_PROC_BROWSER_TEST_F(NetworkServiceRestartBrowserTest, + FetchFromServiceWorkerControlledPage_NoFetchHandler) { + StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>( + BrowserContext::GetDefaultStoragePartition(browser_context())); + ServiceWorkerStatusObserver observer; + ServiceWorkerContextWrapper* service_worker_context = + partition->GetServiceWorkerContext(); + service_worker_context->AddObserver(&observer); + + // Register a service worker which controls /service_worker/. + EXPECT_TRUE(NavigateToURL(shell(), + embedded_test_server()->GetURL( + "/service_worker/create_service_worker.html"))); + EXPECT_EQ("DONE", EvalJs(shell(), "register('empty.js')")); + + // Navigate to a controlled page. + EXPECT_TRUE(NavigateToURL( + shell(), + embedded_test_server()->GetURL("/service_worker/fetch_from_page.html"))); + + // Fetch from the controlled page. + const std::string script = "fetch_from_page('/echo');"; + EXPECT_EQ("Echo", EvalJs(shell(), script)); + + // Crash the NetworkService process. Existing interfaces should receive error + // notifications at some point. + SimulateNetworkServiceCrash(); + // Flush the interface to make sure the error notification was received. + partition->FlushNetworkInterfaceForTesting(); + + // Service worker should be stopped when network service crashes. + observer.WaitForState(EmbeddedWorkerStatus::STOPPED); + + // Fetch from the controlled page again. + EXPECT_EQ("Echo", EvalJs(shell(), script)); + + service_worker_context->RemoveObserver(&observer); +} + +// Make sure fetch from a page controlled by a service worker which has a fetch +// handler but falls back to the network works after crash. +IN_PROC_BROWSER_TEST_F(NetworkServiceRestartBrowserTest, + FetchFromServiceWorkerControlledPage_PassThrough) { + StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>( + BrowserContext::GetDefaultStoragePartition(browser_context())); + ServiceWorkerStatusObserver observer; + ServiceWorkerContextWrapper* service_worker_context = + partition->GetServiceWorkerContext(); + service_worker_context->AddObserver(&observer); + + // Register a service worker which controls /service_worker/. + EXPECT_TRUE(NavigateToURL(shell(), + embedded_test_server()->GetURL( + "/service_worker/create_service_worker.html"))); + EXPECT_EQ("DONE", EvalJs(shell(), "register('fetch_event_pass_through.js')")); + + // Navigate to a controlled page. + EXPECT_TRUE(NavigateToURL( + shell(), + embedded_test_server()->GetURL("/service_worker/fetch_from_page.html"))); + + // Fetch from the controlled page. + const std::string script = "fetch_from_page('/echo');"; + EXPECT_EQ("Echo", EvalJs(shell(), script)); + + // Crash the NetworkService process. Existing interfaces should receive error + // notifications at some point. + SimulateNetworkServiceCrash(); + // Flush the interface to make sure the error notification was received. + partition->FlushNetworkInterfaceForTesting(); + + // Service worker should be stopped when network service crashes. + observer.WaitForState(EmbeddedWorkerStatus::STOPPED); + + // Fetch from the controlled page again. + EXPECT_EQ("Echo", EvalJs(shell(), script)); + + service_worker_context->RemoveObserver(&observer); +} + +// Make sure fetch from a page controlled by a service worker which has a fetch +// handler and responds with fetch() works after crash. +IN_PROC_BROWSER_TEST_F(NetworkServiceRestartBrowserTest, + FetchFromServiceWorkerControlledPage_RespondWithFetch) { + StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>( + BrowserContext::GetDefaultStoragePartition(browser_context())); + ServiceWorkerStatusObserver observer; + ServiceWorkerContextWrapper* service_worker_context = + partition->GetServiceWorkerContext(); + service_worker_context->AddObserver(&observer); + + // Register a service worker which controls /service_worker/. + EXPECT_TRUE(NavigateToURL(shell(), + embedded_test_server()->GetURL( + "/service_worker/create_service_worker.html"))); + EXPECT_EQ("DONE", + EvalJs(shell(), "register('fetch_event_respond_with_fetch.js')")); + + // Navigate to a controlled page. + EXPECT_TRUE(NavigateToURL( + shell(), + embedded_test_server()->GetURL("/service_worker/fetch_from_page.html"))); + + // Fetch from the controlled page. + const std::string script = "fetch_from_page('/echo');"; + EXPECT_EQ("Echo", EvalJs(shell(), script)); + + // Crash the NetworkService process. Existing interfaces should receive error + // notifications at some point. + SimulateNetworkServiceCrash(); + // Flush the interface to make sure the error notification was received. + partition->FlushNetworkInterfaceForTesting(); + + // Service worker should be stopped when network service crashes. + observer.WaitForState(EmbeddedWorkerStatus::STOPPED); + + // Fetch from the controlled page again. + EXPECT_EQ("Echo", EvalJs(shell(), script)); + + service_worker_context->RemoveObserver(&observer); +} + // Make sure fetch from service worker context works after crash. IN_PROC_BROWSER_TEST_F(NetworkServiceRestartBrowserTest, ServiceWorkerFetch) { StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>(
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc index b52eed53..d9faa8a4 100644 --- a/content/browser/renderer_host/compositor_impl_android.cc +++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -1134,6 +1134,11 @@ auto result = context_provider->BindToCurrentThread(); LOG_IF(FATAL, result == gpu::ContextResult::kFatalFailure) << "Fatal error making Gpu context"; + if (result == gpu::ContextResult::kSurfaceFailure) { + SetSurface(nullptr); + client_->RecreateSurface(); + } + if (result != gpu::ContextResult::kSuccess) { HandlePendingLayerTreeFrameSinkRequest(); return;
diff --git a/content/browser/renderer_host/compositor_impl_android.h b/content/browser/renderer_host/compositor_impl_android.h index 34a7d12..020f0d12 100644 --- a/content/browser/renderer_host/compositor_impl_android.h +++ b/content/browser/renderer_host/compositor_impl_android.h
@@ -130,7 +130,6 @@ void DidPresentCompositorFrame( uint32_t frame_token, const gfx::PresentationFeedback& feedback) override {} - void RecordEndOfFrameMetrics(base::TimeTicks frame_begin_time) override {} // LayerTreeHostSingleThreadClient implementation. void DidSubmitCompositorFrame() override;
diff --git a/content/browser/renderer_host/input/touch_selection_controller_client_aura_browsertest.cc b/content/browser/renderer_host/input/touch_selection_controller_client_aura_browsertest.cc index d3a73898..d8c4e84 100644 --- a/content/browser/renderer_host/input/touch_selection_controller_client_aura_browsertest.cc +++ b/content/browser/renderer_host/input/touch_selection_controller_client_aura_browsertest.cc
@@ -180,7 +180,6 @@ base::WrapUnique(selection_controller_client_)); } - protected: void SetUpOnMainThread() override { ContentBrowserTest::SetUpOnMainThread(); if (!ui::TouchSelectionMenuRunner::GetInstance()) @@ -236,7 +235,7 @@ class GestureLongPressWaiter : public RenderWidgetHost::InputEventObserver { public: - GestureLongPressWaiter(RenderWidgetHost* rwh) + explicit GestureLongPressWaiter(RenderWidgetHost* rwh) : rwh_(static_cast<RenderWidgetHostImpl*>(rwh)->GetWeakPtr()), gesture_long_press_seen_(false) { rwh->AddInputEventObserver(this);
diff --git a/content/browser/service_worker/service_worker_browsertest.cc b/content/browser/service_worker/service_worker_browsertest.cc index c4a7660..4494d3b3 100644 --- a/content/browser/service_worker/service_worker_browsertest.cc +++ b/content/browser/service_worker/service_worker_browsertest.cc
@@ -1788,14 +1788,10 @@ // Navigate to a new page and request a sub resource. This should succeed // normally. - { - const GURL url = embedded_test_server()->GetURL( - "/service_worker/fetch_from_page.html?url=/service_worker/empty.html"); - EXPECT_TRUE(NavigateToURL(shell(), url)); - const base::string16 title = base::ASCIIToUTF16("DONE"); - TitleWatcher watcher(shell()->web_contents(), title); - EXPECT_EQ(title, watcher.WaitAndGetTitle()); - } + EXPECT_TRUE(NavigateToURL( + shell(), + embedded_test_server()->GetURL("/service_worker/fetch_from_page.html"))); + EXPECT_EQ("Echo", EvalJs(shell(), "fetch_from_page('/echo');")); // Simulate to attach DevTools. base::RunLoop loop; @@ -1830,12 +1826,7 @@ // idle. However, the browser process notifies the renderer to let it continue // to work because DevTools is attached, and it'll result in running all // queued events. - EXPECT_EQ(200, EvalJs(shell(), R"( - (async () => { - let response = await fetch(params.get('url')); - return response.status; - })() - )")); + EXPECT_EQ("Echo", EvalJs(shell(), "fetch_from_page('/echo');")); } class ServiceWorkerNavigationPreloadTest : public ServiceWorkerBrowserTest { @@ -3427,26 +3418,20 @@ ServiceWorkerBrowserTest::TearDownOnMainThread(); } - void NavigateAndWaitForDone(const GURL& url) { - const base::string16 title = base::ASCIIToUTF16("DONE"); - TitleWatcher watcher(shell()->web_contents(), title); - watcher.AlsoWaitForTitle(base::ASCIIToUTF16("ERROR")); - EXPECT_TRUE(NavigateToURL(shell(), url)); - EXPECT_EQ(title, watcher.WaitAndGetTitle()); - } - void RegisterServiceWorker(const std::string& worker_url) { - GURL url = embedded_test_server()->GetURL( - "/service_worker/create_service_worker.html?worker_url=" + worker_url); - NavigateAndWaitForDone(url); + EXPECT_TRUE(NavigateToURL( + shell(), embedded_test_server()->GetURL( + "/service_worker/create_service_worker.html"))); + EXPECT_EQ("DONE", EvalJs(shell(), "register('" + worker_url + "');")); } void RegisterServiceWorkerWithScope(const std::string& worker_url, const std::string& scope) { - GURL url = embedded_test_server()->GetURL( - "/service_worker/create_service_worker.html?worker_url=" + worker_url + - "&scope=" + scope); - NavigateAndWaitForDone(url); + EXPECT_TRUE(NavigateToURL( + shell(), embedded_test_server()->GetURL( + "/service_worker/create_service_worker.html"))); + EXPECT_EQ("DONE", EvalJs(shell(), "register('" + worker_url + "', '" + + scope + "');")); } };
diff --git a/content/browser/service_worker/service_worker_controllee_request_handler.cc b/content/browser/service_worker/service_worker_controllee_request_handler.cc index f2814a2..d4415e7 100644 --- a/content/browser/service_worker/service_worker_controllee_request_handler.cc +++ b/content/browser/service_worker/service_worker_controllee_request_handler.cc
@@ -763,6 +763,12 @@ } void ServiceWorkerControlleeRequestHandler::ClearJob() { + // Invalidate weak pointers to cancel RegisterStatusChangeCallback(). + // Otherwise we may end up calling ForwardToServiceWorer() + // or FallbackToNetwork() twice on the same |url_job_|. + // TODO(bashi): Consider not to reuse this handler when restarting the + // request after S13nServiceWorker is shipped. + weak_factory_.InvalidateWeakPtrs(); url_job_.reset(); }
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc index 8f1dd731..3b85cbe 100644 --- a/content/browser/site_per_process_browsertest.cc +++ b/content/browser/site_per_process_browsertest.cc
@@ -1328,7 +1328,9 @@ // Test that scrolling a nested out-of-process iframe bubbles unused scroll // delta to a parent frame. -IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ScrollBubblingFromOOPIFTest) { +// TODO(https://crbug.com/889301): Re-enable this test. +IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, + DISABLED_ScrollBubblingFromOOPIFTest) { ui::GestureConfiguration::GetInstance()->set_scroll_debounce_interval_in_ms( 0); GURL main_url(embedded_test_server()->GetURL(
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc index 86ee1af..554cbc0f 100644 --- a/content/child/blink_platform_impl.cc +++ b/content/child/blink_platform_impl.cc
@@ -23,10 +23,7 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/synchronization/lock.h" -#include "base/synchronization/waitable_event.h" #include "base/sys_info.h" -#include "base/threading/platform_thread.h" -#include "base/threading/thread.h" #include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" #include "base/trace_event/memory_allocator_dump_guid.h" @@ -359,57 +356,9 @@ : main_thread_task_runner_(std::move(main_thread_task_runner)), io_thread_task_runner_(std::move(io_thread_task_runner)) {} -void BlinkPlatformImpl::WaitUntilWebThreadTLSUpdate( - blink::scheduler::WebThreadBase* thread) { - base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC, - base::WaitableEvent::InitialState::NOT_SIGNALED); - thread->GetTaskRunner()->PostTask( - FROM_HERE, - base::BindOnce(&BlinkPlatformImpl::UpdateWebThreadTLS, - base::Unretained(this), base::Unretained(thread), - base::Unretained(&event))); - event.Wait(); -} - -void BlinkPlatformImpl::UpdateWebThreadTLS(blink::WebThread* thread, - base::WaitableEvent* event) { - DCHECK(!current_thread_slot_.Get()); - current_thread_slot_.Set(thread); - event->Signal(); -} - BlinkPlatformImpl::~BlinkPlatformImpl() { } -std::unique_ptr<blink::WebThread> BlinkPlatformImpl::CreateThread( - const blink::WebThreadCreationParams& params) { - std::unique_ptr<blink::scheduler::WebThreadBase> thread = - blink::scheduler::WebThreadBase::CreateWorkerThread(params); - thread->Init(); - WaitUntilWebThreadTLSUpdate(thread.get()); - return std::move(thread); -} - -std::unique_ptr<blink::WebThread> BlinkPlatformImpl::CreateWebAudioThread() { - blink::WebThreadCreationParams params(blink::WebThreadType::kWebAudioThread); - // WebAudio uses a thread with |DISPLAY| priority to avoid glitch when the - // system is under the high pressure. Note that the main browser thread also - // runs with same priority. (see: crbug.com/734539) - params.thread_options.priority = base::ThreadPriority::DISPLAY; - - std::unique_ptr<blink::scheduler::WebThreadBase> thread = - blink::scheduler::WebThreadBase::CreateWorkerThread(params); - thread->Init(); - WaitUntilWebThreadTLSUpdate(thread.get()); - return std::move(thread); -} - -blink::WebThread* BlinkPlatformImpl::CurrentThread() { - // TODO(yutak): This only works on non-main threads. We can support - // the main thread here as well. - return static_cast<blink::WebThread*>(current_thread_slot_.Get()); -} - void BlinkPlatformImpl::RecordAction(const blink::UserMetricsAction& name) { if (ChildThread* child_thread = ChildThread::Get()) child_thread->RecordComputedAction(name.Action()); @@ -757,11 +706,6 @@ return base::SysInfo::IsLowEndDevice(); } -bool BlinkPlatformImpl::IsMainThread() const { - return main_thread_task_runner_.get() && - main_thread_task_runner_->BelongsToCurrentThread(); -} - WebString BlinkPlatformImpl::DomCodeStringFromEnum(int dom_code) { return WebString::FromUTF8(ui::KeycodeConverter::DomCodeToCodeString( static_cast<ui::DomCode>(dom_code)));
diff --git a/content/child/blink_platform_impl.h b/content/child/blink_platform_impl.h index 3bd58104..000a65c 100644 --- a/content/child/blink_platform_impl.h +++ b/content/child/blink_platform_impl.h
@@ -10,7 +10,6 @@ #include "base/compiler_specific.h" #include "base/single_thread_task_runner.h" -#include "base/threading/thread_local_storage.h" #include "base/timer/timer.h" #include "base/trace_event/trace_event.h" #include "build/build_config.h" @@ -33,16 +32,6 @@ #include "content/child/webthemeengine_impl_android.h" #endif -namespace base { -class WaitableEvent; -} - -namespace blink { -namespace scheduler { -class WebThreadBase; -} -} - namespace content { class WebCryptoImpl; @@ -72,10 +61,6 @@ size_t MaxDecodedImageBytes() override; bool IsLowEndDevice() override; - std::unique_ptr<blink::WebThread> CreateThread( - const blink::WebThreadCreationParams& params) override; - std::unique_ptr<blink::WebThread> CreateWebAudioThread() override; - blink::WebThread* CurrentThread() override; void RecordAction(const blink::UserMetricsAction&) override; blink::WebData GetDataResource(const char* name) override; @@ -100,22 +85,14 @@ int DomKeyEnumFromString(const blink::WebString& key_string) override; bool IsDomKeyForModifier(int dom_key) override; - void WaitUntilWebThreadTLSUpdate(blink::scheduler::WebThreadBase* thread); - scoped_refptr<base::SingleThreadTaskRunner> GetIOTaskRunner() const override; std::unique_ptr<NestedMessageLoopRunner> CreateNestedMessageLoopRunner() const override; - protected: - bool IsMainThread() const; - private: - void UpdateWebThreadTLS(blink::WebThread* thread, base::WaitableEvent* event); - scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner_; WebThemeEngineImpl native_theme_engine_; - base::ThreadLocalStorage::Slot current_thread_slot_; webcrypto::WebCryptoImpl web_crypto_; media::WebMediaCapabilitiesClientImpl media_capabilities_client_; };
diff --git a/content/ppapi_plugin/ppapi_blink_platform_impl.cc b/content/ppapi_plugin/ppapi_blink_platform_impl.cc index 2d21964f..74cc14d6 100644 --- a/content/ppapi_plugin/ppapi_blink_platform_impl.cc +++ b/content/ppapi_plugin/ppapi_blink_platform_impl.cc
@@ -164,12 +164,6 @@ #endif } -blink::WebThread* PpapiBlinkPlatformImpl::CurrentThread() { - if (IsMainThread()) - return main_thread_; - return BlinkPlatformImpl::CurrentThread(); -} - blink::WebSandboxSupport* PpapiBlinkPlatformImpl::GetSandboxSupport() { #if !defined(OS_ANDROID) && !defined(OS_WIN) return sandbox_support_.get();
diff --git a/content/ppapi_plugin/ppapi_blink_platform_impl.h b/content/ppapi_plugin/ppapi_blink_platform_impl.h index eee308c..279b883 100644 --- a/content/ppapi_plugin/ppapi_blink_platform_impl.h +++ b/content/ppapi_plugin/ppapi_blink_platform_impl.h
@@ -29,7 +29,6 @@ void Shutdown(); // BlinkPlatformImpl methods: - blink::WebThread* CurrentThread() override; blink::WebSandboxSupport* GetSandboxSupport() override; unsigned long long VisitedLinkHash(const char* canonical_url, size_t length) override;
diff --git a/content/public/browser/android/compositor_client.h b/content/public/browser/android/compositor_client.h index 38257521..2c519a5 100644 --- a/content/public/browser/android/compositor_client.h +++ b/content/public/browser/android/compositor_client.h
@@ -13,6 +13,11 @@ class CONTENT_EXPORT CompositorClient { public: + // Compositor is requesting client to create a new surface and call + // SetSurface again. The existing surface if any is cleared from the + // compositor before this call. + virtual void RecreateSurface() {} + // Gives the client a chance to update the layer tree host before compositing. virtual void UpdateLayerTreeHost() {}
diff --git a/content/renderer/gpu/layer_tree_view.cc b/content/renderer/gpu/layer_tree_view.cc index 1690631..b471c15 100644 --- a/content/renderer/gpu/layer_tree_view.cc +++ b/content/renderer/gpu/layer_tree_view.cc
@@ -673,10 +673,6 @@ } } -void LayerTreeView::RecordEndOfFrameMetrics(base::TimeTicks frame_begin_time) { - delegate_->RecordEndOfFrameMetrics(frame_begin_time); -} - void LayerTreeView::RequestScheduleAnimation() { delegate_->RequestScheduleAnimation(); }
diff --git a/content/renderer/gpu/layer_tree_view.h b/content/renderer/gpu/layer_tree_view.h index 820d1a2..644d239 100644 --- a/content/renderer/gpu/layer_tree_view.h +++ b/content/renderer/gpu/layer_tree_view.h
@@ -197,7 +197,6 @@ void DidPresentCompositorFrame( uint32_t frame_token, const gfx::PresentationFeedback& feedback) override; - void RecordEndOfFrameMetrics(base::TimeTicks frame_begin_time) override; // cc::LayerTreeHostSingleThreadClient implementation. void RequestScheduleAnimation() override;
diff --git a/content/renderer/gpu/layer_tree_view_delegate.h b/content/renderer/gpu/layer_tree_view_delegate.h index d28c056..0f13c9d 100644 --- a/content/renderer/gpu/layer_tree_view_delegate.h +++ b/content/renderer/gpu/layer_tree_view_delegate.h
@@ -69,12 +69,6 @@ // will be displayed. virtual void DidReceiveCompositorFrameAck() = 0; - // Requests that a UMA and UKM metric be recorded for the total frame time. - // Call this as soon as the total frame time becomes known for a given frame. - // For example, ProxyMain::BeginMainFrame calls it immediately before aborting - // or committing a frame (at the same time Tracing measurements are taken). - virtual void RecordEndOfFrameMetrics(base::TimeTicks frame_begin_time) = 0; - // Indicates whether the LayerTreeView is about to close. virtual bool IsClosing() const = 0;
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index dd6dc88..8f1d4b61 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc
@@ -1689,7 +1689,11 @@ if (!base::FeatureList::IsEnabled(features::kPurgeAndSuspend)) return; - base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory(); + if (base::MemoryPressureListener::AreNotificationsSuppressed()) + return; + + base::MemoryPressureListener::NotifyMemoryPressure( + base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL); needs_to_record_first_active_paint_ = true; RendererMemoryMetrics memory_metrics;
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc index 21f16fa..77f9bd6 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc
@@ -1099,13 +1099,6 @@ } } -void RenderWidget::RecordEndOfFrameMetrics(base::TimeTicks frame_begin_time) { - if (!GetWebWidget()) - return; - - GetWebWidget()->RecordEndOfFrameMetrics(frame_begin_time); -} - void RenderWidget::WillBeginCompositorFrame() { TRACE_EVENT0("gpu", "RenderWidget::willBeginCompositorFrame");
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h index 7bb9097..5a3c9a8 100644 --- a/content/renderer/render_widget.h +++ b/content/renderer/render_widget.h
@@ -272,7 +272,6 @@ void DidCommitCompositorFrame() override; void DidCompletePageScaleAnimation() override; void DidReceiveCompositorFrameAck() override; - void RecordEndOfFrameMetrics(base::TimeTicks frame_begin_time) override; bool IsClosing() const override; void RequestScheduleAnimation() override; void UpdateVisualState() override;
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc index 20e975e..5584066 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -381,15 +381,12 @@ void RendererBlinkPlatformImpl::SetCompositorThread( blink::scheduler::WebThreadBase* compositor_thread) { + // TODO(yutak): Compositor thread is currently owned by RenderThreadImpl, + // but should probably be owned by Platform so this wouldn't depend on + // WebThread. compositor_thread_ = compositor_thread; if (compositor_thread_) - WaitUntilWebThreadTLSUpdate(compositor_thread_); -} - -blink::WebThread* RendererBlinkPlatformImpl::CurrentThread() { - if (main_thread_->IsCurrentThread()) - return main_thread_.get(); - return BlinkPlatformImpl::CurrentThread(); + RegisterExtraThreadToTLS(compositor_thread_); } blink::BlameContext* RendererBlinkPlatformImpl::GetTopLevelBlameContext() { @@ -1181,11 +1178,13 @@ //------------------------------------------------------------------------------ void RendererBlinkPlatformImpl::RequestPurgeMemory() { - // TODO(tasak|bashi): We should use ChildMemoryCoordinator here, but - // ChildMemoryCoordinator isn't always available as it's only initialized - // when kMemoryCoordinatorV0 is enabled. - // Use ChildMemoryCoordinator when memory coordinator is always enabled. - base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory(); + base::MemoryPressureListener::NotifyMemoryPressure( + base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL); +} + +void RendererBlinkPlatformImpl::SetMemoryPressureNotificationsSuppressed( + bool suppressed) { + base::MemoryPressureListener::SetNotificationsSuppressed(suppressed); } void RendererBlinkPlatformImpl::InitializeWebDatabaseHostIfNeeded() {
diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h index 02866eea..56600366 100644 --- a/content/renderer/renderer_blink_platform_impl.h +++ b/content/renderer/renderer_blink_platform_impl.h
@@ -197,7 +197,6 @@ blink::WebString ConvertIDNToUnicode(const blink::WebString& host) override; service_manager::Connector* GetConnector() override; blink::InterfaceProvider* GetInterfaceProvider() override; - blink::WebThread* CurrentThread() override; blink::BlameContext* GetTopLevelBlameContext() override; void RecordRappor(const char* metric, const blink::WebString& sample) override; @@ -231,6 +230,7 @@ std::unique_ptr<blink::WebDataConsumerHandle> CreateDataConsumerHandle( mojo::ScopedDataPipeConsumerHandle handle) override; void RequestPurgeMemory() override; + void SetMemoryPressureNotificationsSuppressed(bool suppressed) override; // Returns non-null. // It is invalid to call this in an incomplete env where
diff --git a/content/test/data/service_worker/create_service_worker.html b/content/test/data/service_worker/create_service_worker.html index e5dd45b..826d752 100644 --- a/content/test/data/service_worker/create_service_worker.html +++ b/content/test/data/service_worker/create_service_worker.html
@@ -1,24 +1,12 @@ <script> -const params = new URLSearchParams(location.search); -async function run() { - let options = {}; - if (params.get('scope')) - options.scope = params.get('scope'); - - await navigator.serviceWorker.register( - params.get('worker_url'), options); - await navigator.serviceWorker.ready; - document.title = 'DONE'; -} - -async function setup() { +async function register(worker_url, scope) { try { - await run(); + const init = scope ? {scope} : {}; + await navigator.serviceWorker.register(worker_url, init); + await navigator.serviceWorker.ready; + return 'DONE'; } catch (error) { - console.error('ERROR: ' + error); - document.title = 'ERROR'; + return `${error}`; } } - -setup(); </script>
diff --git a/content/test/data/service_worker/fetch_from_page.html b/content/test/data/service_worker/fetch_from_page.html index 5851076..82fbb1b0 100644 --- a/content/test/data/service_worker/fetch_from_page.html +++ b/content/test/data/service_worker/fetch_from_page.html
@@ -1,11 +1,12 @@ <!doctype html> <title>Fetch url specified by a query param</title> <script> -const params = new URLSearchParams(location.search); -async function run() { - const response = await fetch(params.get('url')); - document.body.innerText += await response.text(); - document.title = 'DONE'; +async function fetch_from_page(url) { + try { + const response = await fetch(url); + return await response.text(); + } catch (error) { + return `${error}`; + } } -self.onload = run; </script>
diff --git a/content/test/layouttest_support.cc b/content/test/layouttest_support.cc index abed7a9..09ca3d56a 100644 --- a/content/test/layouttest_support.cc +++ b/content/test/layouttest_support.cc
@@ -390,8 +390,8 @@ ws::command_buffer_metrics::ContextType::FOR_TESTING); context_result = context_provider->BindToCurrentThread(); - // Layout tests can't recover from a fatal failure. - CHECK_NE(context_result, gpu::ContextResult::kFatalFailure); + // Layout tests can't recover from a fatal or surface failure. + CHECK(!gpu::IsFatalOrSurfaceFailure(context_result)); } bool flipped_output_surface = false;
diff --git a/content/test/stub_layer_tree_view_delegate.h b/content/test/stub_layer_tree_view_delegate.h index 83bba53..65dc3b5 100644 --- a/content/test/stub_layer_tree_view_delegate.h +++ b/content/test/stub_layer_tree_view_delegate.h
@@ -20,7 +20,6 @@ void RecordWheelAndTouchScrollingCount(bool has_scrolled_by_wheel, bool has_scrolled_by_touch) override {} void BeginMainFrame(base::TimeTicks frame_time) override {} - void RecordEndOfFrameMetrics(base::TimeTicks) override {} void RequestNewLayerTreeFrameSink( LayerTreeFrameSinkCallback callback) override; void DidCommitAndDrawCompositorFrame() override {}
diff --git a/content/test/test_blink_web_unit_test_support.cc b/content/test/test_blink_web_unit_test_support.cc index ae7fbe5..a0e7571bd 100644 --- a/content/test/test_blink_web_unit_test_support.cc +++ b/content/test/test_blink_web_unit_test_support.cc
@@ -301,12 +301,6 @@ return url_loader_factory_.get(); } -blink::WebThread* TestBlinkWebUnitTestSupport::CurrentThread() { - if (main_thread_->IsCurrentThread()) - return main_thread_; - return BlinkPlatformImpl::CurrentThread(); -} - bool TestBlinkWebUnitTestSupport::IsThreadedAnimationEnabled() { return threaded_animation_; }
diff --git a/content/test/test_blink_web_unit_test_support.h b/content/test/test_blink_web_unit_test_support.h index d1c69bc..75010ad 100644 --- a/content/test/test_blink_web_unit_test_support.h +++ b/content/test/test_blink_web_unit_test_support.h
@@ -53,8 +53,6 @@ blink::WebURLLoaderMockFactory* GetURLLoaderMockFactory() override; - blink::WebThread* CurrentThread() override; - bool IsThreadedAnimationEnabled() override; std::unique_ptr<blink::WebRTCCertificateGenerator>
diff --git a/extensions/browser/BUILD.gn b/extensions/browser/BUILD.gn index ec17cc1..c548631 100644 --- a/extensions/browser/BUILD.gn +++ b/extensions/browser/BUILD.gn
@@ -582,6 +582,7 @@ "extension_api_frame_id_map_unittest.cc", "extension_creator_filter_unittest.cc", "extension_creator_unittest.cc", + "extension_event_histogram_value_unittest.cc", "extension_function_histogram_value_unittest.cc", "extension_icon_image_unittest.cc", "extension_pref_value_map_unittest.cc", @@ -689,6 +690,7 @@ } data = [ + "//extensions/browser/extension_event_histogram_value.h", "//extensions/browser/extension_function_histogram_value.h", "//tools/metrics/histograms/enums.xml", "//extensions/browser/api/declarative_net_request/flat/extension_ruleset.fbs",
diff --git a/extensions/browser/extension_event_histogram_value.h b/extensions/browser/extension_event_histogram_value.h index ad2d4da..247a6c9 100644 --- a/extensions/browser/extension_event_histogram_value.h +++ b/extensions/browser/extension_event_histogram_value.h
@@ -10,437 +10,440 @@ // Short version: // *Never* reorder or delete entries in the |HistogramValue| enumeration. -// When creating a new extension event, add a new entry at the end of the -// enum, just prior to ENUM_BOUNDARY. +// When creating a new extension event, add a new `ENUM = <value>` entry at +// the end of the list, just prior to ENUM_BOUNDARY. // // Long version: See extension_function_histogram_value.h enum HistogramValue { UNKNOWN = 0, - FOR_TEST, // Tests should use this for a stub histogram value (not UNKNOWN). - ACCESSIBILITY_PRIVATE_ON_INTRODUCE_CHROME_VOX, - ACTIVITY_LOG_PRIVATE_ON_EXTENSION_ACTIVITY, - ALARMS_ON_ALARM, - APP_CURRENT_WINDOW_INTERNAL_ON_ALPHA_ENABLED_CHANGED, - APP_CURRENT_WINDOW_INTERNAL_ON_BOUNDS_CHANGED, - APP_CURRENT_WINDOW_INTERNAL_ON_CLOSED, - APP_CURRENT_WINDOW_INTERNAL_ON_FULLSCREENED, - APP_CURRENT_WINDOW_INTERNAL_ON_MAXIMIZED, - APP_CURRENT_WINDOW_INTERNAL_ON_MINIMIZED, - APP_CURRENT_WINDOW_INTERNAL_ON_RESTORED, - APP_CURRENT_WINDOW_INTERNAL_ON_WINDOW_SHOWN_FOR_TESTS, - APP_RUNTIME_ON_EMBED_REQUESTED, - APP_RUNTIME_ON_LAUNCHED, - APP_RUNTIME_ON_RESTARTED, - APP_WINDOW_ON_BOUNDS_CHANGED, - APP_WINDOW_ON_CLOSED, - APP_WINDOW_ON_FULLSCREENED, - APP_WINDOW_ON_MAXIMIZED, - APP_WINDOW_ON_MINIMIZED, - APP_WINDOW_ON_RESTORED, - DELETED_AUDIO_MODEM_ON_RECEIVED, - DELETED_AUDIO_MODEM_ON_TRANSMIT_FAIL, - AUDIO_ON_DEVICE_CHANGED, - AUDIO_ON_DEVICES_CHANGED, - AUDIO_ON_LEVEL_CHANGED, - AUDIO_ON_MUTE_CHANGED, - AUTOFILL_PRIVATE_ON_ADDRESS_LIST_CHANGED, - AUTOFILL_PRIVATE_ON_CREDIT_CARD_LIST_CHANGED, - AUTOMATION_INTERNAL_ON_ACCESSIBILITY_EVENT, - AUTOMATION_INTERNAL_ON_ACCESSIBILITY_TREE_DESTROYED, - BLUETOOTH_LOW_ENERGY_ON_CHARACTERISTIC_VALUE_CHANGED, - BLUETOOTH_LOW_ENERGY_ON_DESCRIPTOR_VALUE_CHANGED, - BLUETOOTH_LOW_ENERGY_ON_SERVICE_ADDED, - BLUETOOTH_LOW_ENERGY_ON_SERVICE_CHANGED, - BLUETOOTH_LOW_ENERGY_ON_SERVICE_REMOVED, - BLUETOOTH_ON_ADAPTER_STATE_CHANGED, - BLUETOOTH_ON_DEVICE_ADDED, - BLUETOOTH_ON_DEVICE_CHANGED, - BLUETOOTH_ON_DEVICE_REMOVED, - BLUETOOTH_PRIVATE_ON_PAIRING, - BLUETOOTH_SOCKET_ON_ACCEPT, - BLUETOOTH_SOCKET_ON_ACCEPT_ERROR, - BLUETOOTH_SOCKET_ON_RECEIVE, - BLUETOOTH_SOCKET_ON_RECEIVE_ERROR, - BOOKMARK_MANAGER_PRIVATE_ON_DRAG_ENTER, - BOOKMARK_MANAGER_PRIVATE_ON_DRAG_LEAVE, - BOOKMARK_MANAGER_PRIVATE_ON_DROP, - BOOKMARK_MANAGER_PRIVATE_ON_META_INFO_CHANGED, - BOOKMARKS_ON_CHANGED, - BOOKMARKS_ON_CHILDREN_REORDERED, - BOOKMARKS_ON_CREATED, - BOOKMARKS_ON_IMPORT_BEGAN, - BOOKMARKS_ON_IMPORT_ENDED, - BOOKMARKS_ON_MOVED, - BOOKMARKS_ON_REMOVED, - BRAILLE_DISPLAY_PRIVATE_ON_DISPLAY_STATE_CHANGED, - BRAILLE_DISPLAY_PRIVATE_ON_KEY_EVENT, - BROWSER_ACTION_ON_CLICKED, - CAST_STREAMING_RTP_STREAM_ON_ERROR, - CAST_STREAMING_RTP_STREAM_ON_STARTED, - CAST_STREAMING_RTP_STREAM_ON_STOPPED, - COMMANDS_ON_COMMAND, - CONTEXT_MENUS_INTERNAL_ON_CLICKED, - CONTEXT_MENUS_ON_CLICKED, - COOKIES_ON_CHANGED, - DELETED_COPRESENCE_ON_MESSAGES_RECEIVED, - DELETED_COPRESENCE_ON_STATUS_UPDATED, - DELETED_COPRESENCE_PRIVATE_ON_CONFIG_AUDIO, - DELETED_COPRESENCE_PRIVATE_ON_DECODE_SAMPLES_REQUEST, - DELETED_COPRESENCE_PRIVATE_ON_ENCODE_TOKEN_REQUEST, - DEBUGGER_ON_DETACH, - DEBUGGER_ON_EVENT, - DECLARATIVE_CONTENT_ON_PAGE_CHANGED, - DECLARATIVE_WEB_REQUEST_ON_MESSAGE, - DECLARATIVE_WEB_REQUEST_ON_REQUEST, - DEVELOPER_PRIVATE_ON_ITEM_STATE_CHANGED, - DEVELOPER_PRIVATE_ON_PROFILE_STATE_CHANGED, - DEVTOOLS_INSPECTED_WINDOW_ON_RESOURCE_ADDED, - DEVTOOLS_INSPECTED_WINDOW_ON_RESOURCE_CONTENT_COMMITTED, - DEVTOOLS_NETWORK_ON_NAVIGATED, - DEVTOOLS_NETWORK_ON_REQUEST_FINISHED, - DOWNLOADS_ON_CHANGED, - DOWNLOADS_ON_CREATED, - DOWNLOADS_ON_DETERMINING_FILENAME, - DOWNLOADS_ON_ERASED, - EASY_UNLOCK_PRIVATE_ON_START_AUTO_PAIRING, - EASY_UNLOCK_PRIVATE_ON_USER_INFO_UPDATED, - DELETED_EXPERIENCE_SAMPLING_PRIVATE_ON_DECISION, - DELETED_EXPERIENCE_SAMPLING_PRIVATE_ON_DISPLAYED, - EXPERIMENTAL_DEVTOOLS_CONSOLE_ON_MESSAGE_ADDED, - EXTENSION_ON_REQUEST, - EXTENSION_ON_REQUEST_EXTERNAL, - EXTENSION_OPTIONS_INTERNAL_ON_CLOSE, - EXTENSION_OPTIONS_INTERNAL_ON_LOAD, - EXTENSION_OPTIONS_INTERNAL_ON_PREFERRED_SIZE_CHANGED, - FEEDBACK_PRIVATE_ON_FEEDBACK_REQUESTED, - FILE_BROWSER_HANDLER_ON_EXECUTE, - FILE_MANAGER_PRIVATE_ON_COPY_PROGRESS, - FILE_MANAGER_PRIVATE_ON_DEVICE_CHANGED, - FILE_MANAGER_PRIVATE_ON_DIRECTORY_CHANGED, - FILE_MANAGER_PRIVATE_ON_DRIVE_CONNECTION_STATUS_CHANGED, - FILE_MANAGER_PRIVATE_ON_DRIVE_SYNC_ERROR, - FILE_MANAGER_PRIVATE_ON_FILE_TRANSFERS_UPDATED, - FILE_MANAGER_PRIVATE_ON_MOUNT_COMPLETED, - FILE_MANAGER_PRIVATE_ON_PREFERENCES_CHANGED, - FILE_SYSTEM_ON_VOLUME_LIST_CHANGED, - FILE_SYSTEM_PROVIDER_ON_ABORT_REQUESTED, - FILE_SYSTEM_PROVIDER_ON_ADD_WATCHER_REQUESTED, - FILE_SYSTEM_PROVIDER_ON_CLOSE_FILE_REQUESTED, - FILE_SYSTEM_PROVIDER_ON_CONFIGURE_REQUESTED, - FILE_SYSTEM_PROVIDER_ON_COPY_ENTRY_REQUESTED, - FILE_SYSTEM_PROVIDER_ON_CREATE_DIRECTORY_REQUESTED, - FILE_SYSTEM_PROVIDER_ON_CREATE_FILE_REQUESTED, - FILE_SYSTEM_PROVIDER_ON_DELETE_ENTRY_REQUESTED, - FILE_SYSTEM_PROVIDER_ON_GET_METADATA_REQUESTED, - FILE_SYSTEM_PROVIDER_ON_MOUNT_REQUESTED, - FILE_SYSTEM_PROVIDER_ON_MOVE_ENTRY_REQUESTED, - FILE_SYSTEM_PROVIDER_ON_OPEN_FILE_REQUESTED, - FILE_SYSTEM_PROVIDER_ON_READ_DIRECTORY_REQUESTED, - FILE_SYSTEM_PROVIDER_ON_READ_FILE_REQUESTED, - FILE_SYSTEM_PROVIDER_ON_REMOVE_WATCHER_REQUESTED, - FILE_SYSTEM_PROVIDER_ON_TRUNCATE_REQUESTED, - FILE_SYSTEM_PROVIDER_ON_UNMOUNT_REQUESTED, - FILE_SYSTEM_PROVIDER_ON_WRITE_FILE_REQUESTED, - FONT_SETTINGS_ON_DEFAULT_FIXED_FONT_SIZE_CHANGED, - FONT_SETTINGS_ON_DEFAULT_FONT_SIZE_CHANGED, - FONT_SETTINGS_ON_FONT_CHANGED, - FONT_SETTINGS_ON_MINIMUM_FONT_SIZE_CHANGED, - DELETED_GCD_PRIVATE_ON_DEVICE_REMOVED, - DELETED_GCD_PRIVATE_ON_DEVICE_STATE_CHANGED, - GCM_ON_MESSAGE, - GCM_ON_MESSAGES_DELETED, - GCM_ON_SEND_ERROR, - HANGOUTS_PRIVATE_ON_HANGOUT_REQUESTED_DEPRECATED, - HID_ON_DEVICE_ADDED, - HID_ON_DEVICE_REMOVED, - HISTORY_ON_VISITED, - HISTORY_ON_VISIT_REMOVED, - HOTWORD_PRIVATE_ON_DELETE_SPEAKER_MODEL, - HOTWORD_PRIVATE_ON_ENABLED_CHANGED, - HOTWORD_PRIVATE_ON_FINALIZE_SPEAKER_MODEL, - HOTWORD_PRIVATE_ON_HOTWORD_SESSION_REQUESTED, - HOTWORD_PRIVATE_ON_HOTWORD_SESSION_STOPPED, - HOTWORD_PRIVATE_ON_HOTWORD_TRIGGERED, - HOTWORD_PRIVATE_ON_MICROPHONE_STATE_CHANGED, - HOTWORD_PRIVATE_ON_SPEAKER_MODEL_EXISTS, - HOTWORD_PRIVATE_ON_SPEAKER_MODEL_SAVED, - IDENTITY_ON_SIGN_IN_CHANGED, - IDENTITY_PRIVATE_ON_WEB_FLOW_REQUEST, - IDLE_ON_STATE_CHANGED, - IMAGE_WRITER_PRIVATE_ON_DEVICE_INSERTED, - IMAGE_WRITER_PRIVATE_ON_DEVICE_REMOVED, - IMAGE_WRITER_PRIVATE_ON_WRITE_COMPLETE, - IMAGE_WRITER_PRIVATE_ON_WRITE_ERROR, - IMAGE_WRITER_PRIVATE_ON_WRITE_PROGRESS, - INPUT_IME_ON_ACTIVATE, - INPUT_IME_ON_BLUR, - INPUT_IME_ON_CANDIDATE_CLICKED, - INPUT_IME_ON_DEACTIVATED, - INPUT_IME_ON_FOCUS, - INPUT_IME_ON_INPUT_CONTEXT_UPDATE, - INPUT_IME_ON_KEY_EVENT, - INPUT_IME_ON_MENU_ITEM_ACTIVATED, - INPUT_IME_ON_RESET, - INPUT_IME_ON_SURROUNDING_TEXT_CHANGED, - INPUT_METHOD_PRIVATE_ON_CHANGED, - INPUT_METHOD_PRIVATE_ON_COMPOSITION_BOUNDS_CHANGED, - INPUT_METHOD_PRIVATE_ON_DICTIONARY_CHANGED, - INPUT_METHOD_PRIVATE_ON_DICTIONARY_LOADED, - INSTANCE_ID_ON_TOKEN_REFRESH, - DELETED_LOCATION_ON_LOCATION_ERROR, - DELETED_LOCATION_ON_LOCATION_UPDATE, - DELETED_LOG_PRIVATE_ON_CAPTURED_EVENTS, - MANAGEMENT_ON_DISABLED, - MANAGEMENT_ON_ENABLED, - MANAGEMENT_ON_INSTALLED, - MANAGEMENT_ON_UNINSTALLED, - MDNS_ON_SERVICE_LIST, - MEDIA_GALLERIES_ON_GALLERY_CHANGED, - MEDIA_GALLERIES_ON_SCAN_PROGRESS, - MEDIA_PLAYER_PRIVATE_ON_NEXT_TRACK, - MEDIA_PLAYER_PRIVATE_ON_PREV_TRACK, - MEDIA_PLAYER_PRIVATE_ON_TOGGLE_PLAY_STATE, - NETWORKING_CONFIG_ON_CAPTIVE_PORTAL_DETECTED, - NETWORKING_PRIVATE_ON_DEVICE_STATE_LIST_CHANGED, - NETWORKING_PRIVATE_ON_NETWORK_LIST_CHANGED, - NETWORKING_PRIVATE_ON_NETWORKS_CHANGED, - NETWORKING_PRIVATE_ON_PORTAL_DETECTION_COMPLETED, - DELETED_NOTIFICATION_PROVIDER_ON_CLEARED, - DELETED_NOTIFICATION_PROVIDER_ON_CREATED, - DELETED_NOTIFICATION_PROVIDER_ON_UPDATED, - NOTIFICATIONS_ON_BUTTON_CLICKED, - NOTIFICATIONS_ON_CLICKED, - NOTIFICATIONS_ON_CLOSED, - NOTIFICATIONS_ON_PERMISSION_LEVEL_CHANGED, - NOTIFICATIONS_ON_SHOW_SETTINGS, - OMNIBOX_ON_INPUT_CANCELLED, - OMNIBOX_ON_INPUT_CHANGED, - OMNIBOX_ON_INPUT_ENTERED, - OMNIBOX_ON_INPUT_STARTED, - PAGE_ACTION_ON_CLICKED, - PASSWORDS_PRIVATE_ON_PASSWORD_EXCEPTIONS_LIST_CHANGED, - PASSWORDS_PRIVATE_ON_PLAINTEXT_PASSWORD_RETRIEVED, - PASSWORDS_PRIVATE_ON_SAVED_PASSWORDS_LIST_CHANGED, - PERMISSIONS_ON_ADDED, - PERMISSIONS_ON_REMOVED, - PRINTER_PROVIDER_ON_GET_CAPABILITY_REQUESTED, - PRINTER_PROVIDER_ON_GET_PRINTERS_REQUESTED, - PRINTER_PROVIDER_ON_GET_USB_PRINTER_INFO_REQUESTED, - PRINTER_PROVIDER_ON_PRINT_REQUESTED, - PROCESSES_ON_CREATED, - PROCESSES_ON_EXITED, - PROCESSES_ON_UNRESPONSIVE, - PROCESSES_ON_UPDATED, - PROCESSES_ON_UPDATED_WITH_MEMORY, - PROXY_ON_PROXY_ERROR, - RUNTIME_ON_BROWSER_UPDATE_AVAILABLE, - RUNTIME_ON_CONNECT, - RUNTIME_ON_CONNECT_EXTERNAL, - RUNTIME_ON_INSTALLED, - RUNTIME_ON_MESSAGE, - RUNTIME_ON_MESSAGE_EXTERNAL, - RUNTIME_ON_RESTART_REQUIRED, - RUNTIME_ON_STARTUP, - RUNTIME_ON_SUSPEND, - RUNTIME_ON_SUSPEND_CANCELED, - RUNTIME_ON_UPDATE_AVAILABLE, - SEARCH_ENGINES_PRIVATE_ON_SEARCH_ENGINES_CHANGED, - SERIAL_ON_RECEIVE, - SERIAL_ON_RECEIVE_ERROR, - SESSIONS_ON_CHANGED, - SETTINGS_PRIVATE_ON_PREFS_CHANGED, - SIGNED_IN_DEVICES_ON_DEVICE_INFO_CHANGE, - SOCKETS_TCP_ON_RECEIVE, - SOCKETS_TCP_ON_RECEIVE_ERROR, - SOCKETS_TCP_SERVER_ON_ACCEPT, - SOCKETS_TCP_SERVER_ON_ACCEPT_ERROR, - SOCKETS_UDP_ON_RECEIVE, - SOCKETS_UDP_ON_RECEIVE_ERROR, - STORAGE_ON_CHANGED, - STREAMS_PRIVATE_ON_EXECUTE_MIME_TYPE_HANDLER, - SYNC_FILE_SYSTEM_ON_FILE_STATUS_CHANGED, - SYNC_FILE_SYSTEM_ON_SERVICE_STATUS_CHANGED, - SYSTEM_DISPLAY_ON_DISPLAY_CHANGED, - SYSTEM_INDICATOR_ON_CLICKED, - SYSTEM_PRIVATE_ON_BRIGHTNESS_CHANGED, - SYSTEM_PRIVATE_ON_SCREEN_UNLOCKED, - SYSTEM_PRIVATE_ON_VOLUME_CHANGED, - SYSTEM_PRIVATE_ON_WOKE_UP, - SYSTEM_STORAGE_ON_ATTACHED, - SYSTEM_STORAGE_ON_DETACHED, - TAB_CAPTURE_ON_STATUS_CHANGED, - TABS_ON_ACTIVATED, - TABS_ON_ACTIVE_CHANGED, - TABS_ON_ATTACHED, - TABS_ON_CREATED, - TABS_ON_DETACHED, - TABS_ON_HIGHLIGHT_CHANGED, - TABS_ON_HIGHLIGHTED, - TABS_ON_MOVED, - TABS_ON_REMOVED, - TABS_ON_REPLACED, - TABS_ON_SELECTION_CHANGED, - TABS_ON_UPDATED, - TABS_ON_ZOOM_CHANGE, - TERMINAL_PRIVATE_ON_PROCESS_OUTPUT, - TEST_ON_MESSAGE, - TTS_ENGINE_ON_PAUSE, - TTS_ENGINE_ON_RESUME, - TTS_ENGINE_ON_SPEAK, - TTS_ENGINE_ON_STOP, - USB_ON_DEVICE_ADDED, - USB_ON_DEVICE_REMOVED, - VIRTUAL_KEYBOARD_PRIVATE_ON_BOUNDS_CHANGED, - VIRTUAL_KEYBOARD_PRIVATE_ON_TEXT_INPUT_BOX_FOCUSED, - VPN_PROVIDER_ON_CONFIG_CREATED, - VPN_PROVIDER_ON_CONFIG_REMOVED, - VPN_PROVIDER_ON_PACKET_RECEIVED, - VPN_PROVIDER_ON_PLATFORM_MESSAGE, - VPN_PROVIDER_ON_UI_EVENT, - WALLPAPER_PRIVATE_ON_WALLPAPER_CHANGED_BY_3RD_PARTY, - WEB_NAVIGATION_ON_BEFORE_NAVIGATE, - WEB_NAVIGATION_ON_COMMITTED, - WEB_NAVIGATION_ON_COMPLETED, - WEB_NAVIGATION_ON_CREATED_NAVIGATION_TARGET, - WEB_NAVIGATION_ON_DOM_CONTENT_LOADED, - WEB_NAVIGATION_ON_ERROR_OCCURRED, - WEB_NAVIGATION_ON_HISTORY_STATE_UPDATED, - WEB_NAVIGATION_ON_REFERENCE_FRAGMENT_UPDATED, - WEB_NAVIGATION_ON_TAB_REPLACED, - WEB_REQUEST_ON_AUTH_REQUIRED, - WEB_REQUEST_ON_BEFORE_REDIRECT, - WEB_REQUEST_ON_BEFORE_REQUEST, - WEB_REQUEST_ON_BEFORE_SEND_HEADERS, - WEB_REQUEST_ON_COMPLETED, - WEB_REQUEST_ON_ERROR_OCCURRED, - WEB_REQUEST_ON_HEADERS_RECEIVED, - WEB_REQUEST_ON_RESPONSE_STARTED, - WEB_REQUEST_ON_SEND_HEADERS, - WEBRTC_AUDIO_PRIVATE_ON_SINKS_CHANGED, - WEBSTORE_ON_DOWNLOAD_PROGRESS, - WEBSTORE_ON_INSTALL_STAGE_CHANGED, - WEBSTORE_WIDGET_PRIVATE_ON_SHOW_WIDGET, - WEBVIEW_TAG_CLOSE, - WEBVIEW_TAG_CONSOLEMESSAGE, - WEBVIEW_TAG_CONTENTLOAD, - WEBVIEW_TAG_DIALOG, - WEBVIEW_TAG_EXIT, - WEBVIEW_TAG_FINDUPDATE, - WEBVIEW_TAG_LOADABORT, - WEBVIEW_TAG_LOADCOMMIT, - WEBVIEW_TAG_LOADREDIRECT, - WEBVIEW_TAG_LOADSTART, - WEBVIEW_TAG_LOADSTOP, - WEBVIEW_TAG_NEWWINDOW, - WEBVIEW_TAG_PERMISSIONREQUEST, - WEBVIEW_TAG_RESPONSIVE, - WEBVIEW_TAG_SIZECHANGED, - WEBVIEW_TAG_UNRESPONSIVE, - WEBVIEW_TAG_ZOOMCHANGE, - WINDOWS_ON_CREATED, - WINDOWS_ON_FOCUS_CHANGED, - WINDOWS_ON_REMOVED, - FILE_SYSTEM_PROVIDER_ON_EXECUTE_ACTION_REQUESTED, - FILE_SYSTEM_PROVIDER_ON_GET_ACTIONS_REQUESTED, - LAUNCHER_SEARCH_PROVIDER_ON_QUERY_STARTED, - LAUNCHER_SEARCH_PROVIDER_ON_QUERY_ENDED, - LAUNCHER_SEARCH_PROVIDER_ON_OPEN_RESULT, - CHROME_WEB_VIEW_INTERNAL_ON_CLICKED, - WEB_VIEW_INTERNAL_CONTEXT_MENUS, - CONTEXT_MENUS, - TTS_ON_EVENT, - LAUNCHER_PAGE_ON_TRANSITION_CHANGED_DEPRECATED, - LAUNCHER_PAGE_ON_POP_SUBPAGE_DEPRECATED, - DIAL_ON_DEVICE_LIST, - DIAL_ON_ERROR, - CAST_CHANNEL_ON_MESSAGE, - CAST_CHANNEL_ON_ERROR, - SCREENLOCK_PRIVATE_ON_CHANGED, - SCREENLOCK_PRIVATE_ON_AUTH_ATTEMPTED, - TYPES_CHROME_SETTING_ON_CHANGE, - DELETED_TYPES_PRIVATE_CHROME_DIRECT_SETTING_ON_CHANGE, - WEB_VIEW_INTERNAL_ON_MESSAGE, - EXTENSION_VIEW_INTERNAL_ON_LOAD_COMMIT, - RUNTIME_ON_REQUEST, - RUNTIME_ON_REQUEST_EXTERNAL, - CHROME_WEB_VIEW_INTERNAL_ON_CONTEXT_MENU_SHOW, - WEB_VIEW_INTERNAL_ON_BEFORE_REQUEST, - WEB_VIEW_INTERNAL_ON_BEFORE_SEND_HEADERS, - WEB_VIEW_INTERNAL_ON_CLOSE, - WEB_VIEW_INTERNAL_ON_COMPLETED, - WEB_VIEW_INTERNAL_ON_CONSOLE_MESSAGE, - WEB_VIEW_INTERNAL_ON_CONTENT_LOAD, - WEB_VIEW_INTERNAL_ON_DIALOG, - WEB_VIEW_INTERNAL_ON_DROP_LINK, - WEB_VIEW_INTERNAL_ON_EXIT, - WEB_VIEW_INTERNAL_ON_EXIT_FULLSCREEN, - WEB_VIEW_INTERNAL_ON_FIND_REPLY, - WEB_VIEW_INTERNAL_ON_FRAME_NAME_CHANGED, - WEB_VIEW_INTERNAL_ON_HEADERS_RECEIVED, - WEB_VIEW_INTERNAL_ON_LOAD_ABORT, - WEB_VIEW_INTERNAL_ON_LOAD_COMMIT, - WEB_VIEW_INTERNAL_ON_LOAD_PROGRESS, - WEB_VIEW_INTERNAL_ON_LOAD_REDIRECT, - WEB_VIEW_INTERNAL_ON_LOAD_START, - WEB_VIEW_INTERNAL_ON_LOAD_STOP, - WEB_VIEW_INTERNAL_ON_NEW_WINDOW, - WEB_VIEW_INTERNAL_ON_PERMISSION_REQUEST, - WEB_VIEW_INTERNAL_ON_RESPONSE_STARTED, - WEB_VIEW_INTERNAL_ON_RESPONSIVE, - WEB_VIEW_INTERNAL_ON_SIZE_CHANGED, - WEB_VIEW_INTERNAL_ON_UNRESPONSIVE, - WEB_VIEW_INTERNAL_ON_ZOOM_CHANGE, - GUEST_VIEW_INTERNAL_ON_RESIZE, - LANGUAGE_SETTINGS_PRIVATE_ON_INPUT_METHOD_ADDED, - LANGUAGE_SETTINGS_PRIVATE_ON_INPUT_METHOD_REMOVED, - LANGUAGE_SETTINGS_PRIVATE_ON_SPELLCHECK_DICTIONARIES_CHANGED, - LANGUAGE_SETTINGS_PRIVATE_ON_CUSTOM_DICTIONARY_CHANGED, - CAST_DEVICES_PRIVATE_ON_UPDATE_DEVICES_REQUESTED, - CAST_DEVICES_PRIVATE_ON_START_CAST, - CAST_DEVICES_PRIVATE_ON_STOP_CAST, - CERTIFICATEPROVIDER_ON_CERTIFICATES_REQUESTED, - CERTIFICATEPROVIDER_ON_SIGN_DIGEST_REQUESTED, - WEB_VIEW_INTERNAL_ON_AUTH_REQUIRED, - WEB_VIEW_INTERNAL_ON_BEFORE_REDIRECT, - WEB_VIEW_INTERNAL_ON_ERROR_OCCURRED, - WEB_VIEW_INTERNAL_ON_SEND_HEADERS, - EASY_UNLOCK_PRIVATE_ON_CONNECTION_STATUS_CHANGED, - EASY_UNLOCK_PRIVATE_ON_DATA_RECEIVED, - EASY_UNLOCK_PRIVATE_ON_SEND_COMPLETED, - DISPLAY_SOURCE_ON_SINKS_UPDATED, - INPUT_IME_ON_COMPOSITION_BOUNDS_CHANGED, - INPUT_METHOD_PRIVATE_ON_IME_MENU_ACTIVATION_CHANGED, - INPUT_METHOD_PRIVATE_ON_IME_MENU_LIST_CHANGED, - INPUT_METHOD_PRIVATE_ON_IME_MENU_ITEMS_CHANGED, - BLUETOOTH_LOW_ENERGY_ON_CHARACTERISTIC_READ_REQUEST, - BLUETOOTH_LOW_ENERGY_ON_CHARACTERISTIC_WRITE_REQUEST, - BLUETOOTH_LOW_ENERGY_ON_DESCRIPTOR_READ_REQUEST, - BLUETOOTH_LOW_ENERGY_ON_DESCRIPTOR_WRITE_REQUEST, - ACCESSIBILITY_PRIVATE_ON_ACCESSIBILITY_GESTURE, - QUICK_UNLOCK_PRIVATE_ON_ACTIVE_MODES_CHANGED, - CLIPBOARD_ON_CLIPBOARD_DATA_CHANGED, - VIRTUAL_KEYBOARD_PRIVATE_ON_KEYBOARD_CLOSED, - FILE_MANAGER_PRIVATE_ON_APPS_UPDATED, - ACCESSIBILITY_PRIVATE_ON_TWO_FINGER_TOUCH_START, - ACCESSIBILITY_PRIVATE_ON_TWO_FINGER_TOUCH_STOP, - MEDIA_PERCEPTION_PRIVATE_ON_MEDIA_PERCEPTION, - NETWORKING_PRIVATE_ON_CERTIFICATE_LISTS_CHANGED, - LOCK_SCREEN_DATA_ON_DATA_ITEMS_AVAILABLE, - WEB_VIEW_INTERNAL_ON_AUDIO_STATE_CHANGED, - AUTOMATION_INTERNAL_ON_ACTION_RESULT, - OMNIBOX_ON_DELETE_SUGGESTION, - VIRTUAL_KEYBOARD_PRIVATE_ON_KEYBOARD_CONFIG_CHANGED, - PASSWORDS_PRIVATE_ON_PASSWORDS_FILE_EXPORT_PROGRESS, - SAFE_BROWSING_PRIVATE_ON_POLICY_SPECIFIED_PASSWORD_REUSE_DETECTED, - SAFE_BROWSING_PRIVATE_ON_POLICY_SPECIFIED_PASSWORD_CHANGED, - SAFE_BROWSING_PRIVATE_ON_DANGEROUS_DOWNLOAD_OPENED, - SAFE_BROWSING_PRIVATE_ON_SECURITY_INTERSTITIAL_SHOWN, - SAFE_BROWSING_PRIVATE_ON_SECURITY_INTERSTITIAL_PROCEEDED, - ACCESSIBILITY_PRIVATE_ON_SELECT_TO_SPEAK_STATE_CHANGE_REQUESTED, - INPUT_METHOD_PRIVATE_ON_FOCUS, - SYSTEM_POWER_SOURCE_ONPOWERCHANGED, - WEB_REQUEST_ON_ACTION_IGNORED, - ARC_APPS_PRIVATE_ON_INSTALLED, + + // Tests should use this for a stub histogram value (not UNKNOWN). + FOR_TEST = 1, + + ACCESSIBILITY_PRIVATE_ON_INTRODUCE_CHROME_VOX = 2, + ACTIVITY_LOG_PRIVATE_ON_EXTENSION_ACTIVITY = 3, + ALARMS_ON_ALARM = 4, + APP_CURRENT_WINDOW_INTERNAL_ON_ALPHA_ENABLED_CHANGED = 5, + APP_CURRENT_WINDOW_INTERNAL_ON_BOUNDS_CHANGED = 6, + APP_CURRENT_WINDOW_INTERNAL_ON_CLOSED = 7, + APP_CURRENT_WINDOW_INTERNAL_ON_FULLSCREENED = 8, + APP_CURRENT_WINDOW_INTERNAL_ON_MAXIMIZED = 9, + APP_CURRENT_WINDOW_INTERNAL_ON_MINIMIZED = 10, + APP_CURRENT_WINDOW_INTERNAL_ON_RESTORED = 11, + APP_CURRENT_WINDOW_INTERNAL_ON_WINDOW_SHOWN_FOR_TESTS = 12, + APP_RUNTIME_ON_EMBED_REQUESTED = 13, + APP_RUNTIME_ON_LAUNCHED = 14, + APP_RUNTIME_ON_RESTARTED = 15, + APP_WINDOW_ON_BOUNDS_CHANGED = 16, + APP_WINDOW_ON_CLOSED = 17, + APP_WINDOW_ON_FULLSCREENED = 18, + APP_WINDOW_ON_MAXIMIZED = 19, + APP_WINDOW_ON_MINIMIZED = 20, + APP_WINDOW_ON_RESTORED = 21, + DELETED_AUDIO_MODEM_ON_RECEIVED = 22, + DELETED_AUDIO_MODEM_ON_TRANSMIT_FAIL = 23, + AUDIO_ON_DEVICE_CHANGED = 24, + AUDIO_ON_DEVICES_CHANGED = 25, + AUDIO_ON_LEVEL_CHANGED = 26, + AUDIO_ON_MUTE_CHANGED = 27, + AUTOFILL_PRIVATE_ON_ADDRESS_LIST_CHANGED = 28, + AUTOFILL_PRIVATE_ON_CREDIT_CARD_LIST_CHANGED = 29, + AUTOMATION_INTERNAL_ON_ACCESSIBILITY_EVENT = 30, + AUTOMATION_INTERNAL_ON_ACCESSIBILITY_TREE_DESTROYED = 31, + BLUETOOTH_LOW_ENERGY_ON_CHARACTERISTIC_VALUE_CHANGED = 32, + BLUETOOTH_LOW_ENERGY_ON_DESCRIPTOR_VALUE_CHANGED = 33, + BLUETOOTH_LOW_ENERGY_ON_SERVICE_ADDED = 34, + BLUETOOTH_LOW_ENERGY_ON_SERVICE_CHANGED = 35, + BLUETOOTH_LOW_ENERGY_ON_SERVICE_REMOVED = 36, + BLUETOOTH_ON_ADAPTER_STATE_CHANGED = 37, + BLUETOOTH_ON_DEVICE_ADDED = 38, + BLUETOOTH_ON_DEVICE_CHANGED = 39, + BLUETOOTH_ON_DEVICE_REMOVED = 40, + BLUETOOTH_PRIVATE_ON_PAIRING = 41, + BLUETOOTH_SOCKET_ON_ACCEPT = 42, + BLUETOOTH_SOCKET_ON_ACCEPT_ERROR = 43, + BLUETOOTH_SOCKET_ON_RECEIVE = 44, + BLUETOOTH_SOCKET_ON_RECEIVE_ERROR = 45, + BOOKMARK_MANAGER_PRIVATE_ON_DRAG_ENTER = 46, + BOOKMARK_MANAGER_PRIVATE_ON_DRAG_LEAVE = 47, + BOOKMARK_MANAGER_PRIVATE_ON_DROP = 48, + BOOKMARK_MANAGER_PRIVATE_ON_META_INFO_CHANGED = 49, + BOOKMARKS_ON_CHANGED = 50, + BOOKMARKS_ON_CHILDREN_REORDERED = 51, + BOOKMARKS_ON_CREATED = 52, + BOOKMARKS_ON_IMPORT_BEGAN = 53, + BOOKMARKS_ON_IMPORT_ENDED = 54, + BOOKMARKS_ON_MOVED = 55, + BOOKMARKS_ON_REMOVED = 56, + BRAILLE_DISPLAY_PRIVATE_ON_DISPLAY_STATE_CHANGED = 57, + BRAILLE_DISPLAY_PRIVATE_ON_KEY_EVENT = 58, + BROWSER_ACTION_ON_CLICKED = 59, + CAST_STREAMING_RTP_STREAM_ON_ERROR = 60, + CAST_STREAMING_RTP_STREAM_ON_STARTED = 61, + CAST_STREAMING_RTP_STREAM_ON_STOPPED = 62, + COMMANDS_ON_COMMAND = 63, + CONTEXT_MENUS_INTERNAL_ON_CLICKED = 64, + CONTEXT_MENUS_ON_CLICKED = 65, + COOKIES_ON_CHANGED = 66, + DELETED_COPRESENCE_ON_MESSAGES_RECEIVED = 67, + DELETED_COPRESENCE_ON_STATUS_UPDATED = 68, + DELETED_COPRESENCE_PRIVATE_ON_CONFIG_AUDIO = 69, + DELETED_COPRESENCE_PRIVATE_ON_DECODE_SAMPLES_REQUEST = 70, + DELETED_COPRESENCE_PRIVATE_ON_ENCODE_TOKEN_REQUEST = 71, + DEBUGGER_ON_DETACH = 72, + DEBUGGER_ON_EVENT = 73, + DECLARATIVE_CONTENT_ON_PAGE_CHANGED = 74, + DECLARATIVE_WEB_REQUEST_ON_MESSAGE = 75, + DECLARATIVE_WEB_REQUEST_ON_REQUEST = 76, + DEVELOPER_PRIVATE_ON_ITEM_STATE_CHANGED = 77, + DEVELOPER_PRIVATE_ON_PROFILE_STATE_CHANGED = 78, + DEVTOOLS_INSPECTED_WINDOW_ON_RESOURCE_ADDED = 79, + DEVTOOLS_INSPECTED_WINDOW_ON_RESOURCE_CONTENT_COMMITTED = 80, + DEVTOOLS_NETWORK_ON_NAVIGATED = 81, + DEVTOOLS_NETWORK_ON_REQUEST_FINISHED = 82, + DOWNLOADS_ON_CHANGED = 83, + DOWNLOADS_ON_CREATED = 84, + DOWNLOADS_ON_DETERMINING_FILENAME = 85, + DOWNLOADS_ON_ERASED = 86, + EASY_UNLOCK_PRIVATE_ON_START_AUTO_PAIRING = 87, + EASY_UNLOCK_PRIVATE_ON_USER_INFO_UPDATED = 88, + DELETED_EXPERIENCE_SAMPLING_PRIVATE_ON_DECISION = 89, + DELETED_EXPERIENCE_SAMPLING_PRIVATE_ON_DISPLAYED = 90, + EXPERIMENTAL_DEVTOOLS_CONSOLE_ON_MESSAGE_ADDED = 91, + EXTENSION_ON_REQUEST = 92, + EXTENSION_ON_REQUEST_EXTERNAL = 93, + EXTENSION_OPTIONS_INTERNAL_ON_CLOSE = 94, + EXTENSION_OPTIONS_INTERNAL_ON_LOAD = 95, + EXTENSION_OPTIONS_INTERNAL_ON_PREFERRED_SIZE_CHANGED = 96, + FEEDBACK_PRIVATE_ON_FEEDBACK_REQUESTED = 97, + FILE_BROWSER_HANDLER_ON_EXECUTE = 98, + FILE_MANAGER_PRIVATE_ON_COPY_PROGRESS = 99, + FILE_MANAGER_PRIVATE_ON_DEVICE_CHANGED = 100, + FILE_MANAGER_PRIVATE_ON_DIRECTORY_CHANGED = 101, + FILE_MANAGER_PRIVATE_ON_DRIVE_CONNECTION_STATUS_CHANGED = 102, + FILE_MANAGER_PRIVATE_ON_DRIVE_SYNC_ERROR = 103, + FILE_MANAGER_PRIVATE_ON_FILE_TRANSFERS_UPDATED = 104, + FILE_MANAGER_PRIVATE_ON_MOUNT_COMPLETED = 105, + FILE_MANAGER_PRIVATE_ON_PREFERENCES_CHANGED = 106, + FILE_SYSTEM_ON_VOLUME_LIST_CHANGED = 107, + FILE_SYSTEM_PROVIDER_ON_ABORT_REQUESTED = 108, + FILE_SYSTEM_PROVIDER_ON_ADD_WATCHER_REQUESTED = 109, + FILE_SYSTEM_PROVIDER_ON_CLOSE_FILE_REQUESTED = 110, + FILE_SYSTEM_PROVIDER_ON_CONFIGURE_REQUESTED = 111, + FILE_SYSTEM_PROVIDER_ON_COPY_ENTRY_REQUESTED = 112, + FILE_SYSTEM_PROVIDER_ON_CREATE_DIRECTORY_REQUESTED = 113, + FILE_SYSTEM_PROVIDER_ON_CREATE_FILE_REQUESTED = 114, + FILE_SYSTEM_PROVIDER_ON_DELETE_ENTRY_REQUESTED = 115, + FILE_SYSTEM_PROVIDER_ON_GET_METADATA_REQUESTED = 116, + FILE_SYSTEM_PROVIDER_ON_MOUNT_REQUESTED = 117, + FILE_SYSTEM_PROVIDER_ON_MOVE_ENTRY_REQUESTED = 118, + FILE_SYSTEM_PROVIDER_ON_OPEN_FILE_REQUESTED = 119, + FILE_SYSTEM_PROVIDER_ON_READ_DIRECTORY_REQUESTED = 120, + FILE_SYSTEM_PROVIDER_ON_READ_FILE_REQUESTED = 121, + FILE_SYSTEM_PROVIDER_ON_REMOVE_WATCHER_REQUESTED = 122, + FILE_SYSTEM_PROVIDER_ON_TRUNCATE_REQUESTED = 123, + FILE_SYSTEM_PROVIDER_ON_UNMOUNT_REQUESTED = 124, + FILE_SYSTEM_PROVIDER_ON_WRITE_FILE_REQUESTED = 125, + FONT_SETTINGS_ON_DEFAULT_FIXED_FONT_SIZE_CHANGED = 126, + FONT_SETTINGS_ON_DEFAULT_FONT_SIZE_CHANGED = 127, + FONT_SETTINGS_ON_FONT_CHANGED = 128, + FONT_SETTINGS_ON_MINIMUM_FONT_SIZE_CHANGED = 129, + DELETED_GCD_PRIVATE_ON_DEVICE_REMOVED = 130, + DELETED_GCD_PRIVATE_ON_DEVICE_STATE_CHANGED = 131, + GCM_ON_MESSAGE = 132, + GCM_ON_MESSAGES_DELETED = 133, + GCM_ON_SEND_ERROR = 134, + HANGOUTS_PRIVATE_ON_HANGOUT_REQUESTED_DEPRECATED = 135, + HID_ON_DEVICE_ADDED = 136, + HID_ON_DEVICE_REMOVED = 137, + HISTORY_ON_VISITED = 138, + HISTORY_ON_VISIT_REMOVED = 139, + HOTWORD_PRIVATE_ON_DELETE_SPEAKER_MODEL = 140, + HOTWORD_PRIVATE_ON_ENABLED_CHANGED = 141, + HOTWORD_PRIVATE_ON_FINALIZE_SPEAKER_MODEL = 142, + HOTWORD_PRIVATE_ON_HOTWORD_SESSION_REQUESTED = 143, + HOTWORD_PRIVATE_ON_HOTWORD_SESSION_STOPPED = 144, + HOTWORD_PRIVATE_ON_HOTWORD_TRIGGERED = 145, + HOTWORD_PRIVATE_ON_MICROPHONE_STATE_CHANGED = 146, + HOTWORD_PRIVATE_ON_SPEAKER_MODEL_EXISTS = 147, + HOTWORD_PRIVATE_ON_SPEAKER_MODEL_SAVED = 148, + IDENTITY_ON_SIGN_IN_CHANGED = 149, + IDENTITY_PRIVATE_ON_WEB_FLOW_REQUEST = 150, + IDLE_ON_STATE_CHANGED = 151, + IMAGE_WRITER_PRIVATE_ON_DEVICE_INSERTED = 152, + IMAGE_WRITER_PRIVATE_ON_DEVICE_REMOVED = 153, + IMAGE_WRITER_PRIVATE_ON_WRITE_COMPLETE = 154, + IMAGE_WRITER_PRIVATE_ON_WRITE_ERROR = 155, + IMAGE_WRITER_PRIVATE_ON_WRITE_PROGRESS = 156, + INPUT_IME_ON_ACTIVATE = 157, + INPUT_IME_ON_BLUR = 158, + INPUT_IME_ON_CANDIDATE_CLICKED = 159, + INPUT_IME_ON_DEACTIVATED = 160, + INPUT_IME_ON_FOCUS = 161, + INPUT_IME_ON_INPUT_CONTEXT_UPDATE = 162, + INPUT_IME_ON_KEY_EVENT = 163, + INPUT_IME_ON_MENU_ITEM_ACTIVATED = 164, + INPUT_IME_ON_RESET = 165, + INPUT_IME_ON_SURROUNDING_TEXT_CHANGED = 166, + INPUT_METHOD_PRIVATE_ON_CHANGED = 167, + INPUT_METHOD_PRIVATE_ON_COMPOSITION_BOUNDS_CHANGED = 168, + INPUT_METHOD_PRIVATE_ON_DICTIONARY_CHANGED = 169, + INPUT_METHOD_PRIVATE_ON_DICTIONARY_LOADED = 170, + INSTANCE_ID_ON_TOKEN_REFRESH = 171, + DELETED_LOCATION_ON_LOCATION_ERROR = 172, + DELETED_LOCATION_ON_LOCATION_UPDATE = 173, + DELETED_LOG_PRIVATE_ON_CAPTURED_EVENTS = 174, + MANAGEMENT_ON_DISABLED = 175, + MANAGEMENT_ON_ENABLED = 176, + MANAGEMENT_ON_INSTALLED = 177, + MANAGEMENT_ON_UNINSTALLED = 178, + MDNS_ON_SERVICE_LIST = 179, + MEDIA_GALLERIES_ON_GALLERY_CHANGED = 180, + MEDIA_GALLERIES_ON_SCAN_PROGRESS = 181, + MEDIA_PLAYER_PRIVATE_ON_NEXT_TRACK = 182, + MEDIA_PLAYER_PRIVATE_ON_PREV_TRACK = 183, + MEDIA_PLAYER_PRIVATE_ON_TOGGLE_PLAY_STATE = 184, + NETWORKING_CONFIG_ON_CAPTIVE_PORTAL_DETECTED = 185, + NETWORKING_PRIVATE_ON_DEVICE_STATE_LIST_CHANGED = 186, + NETWORKING_PRIVATE_ON_NETWORK_LIST_CHANGED = 187, + NETWORKING_PRIVATE_ON_NETWORKS_CHANGED = 188, + NETWORKING_PRIVATE_ON_PORTAL_DETECTION_COMPLETED = 189, + DELETED_NOTIFICATION_PROVIDER_ON_CLEARED = 190, + DELETED_NOTIFICATION_PROVIDER_ON_CREATED = 191, + DELETED_NOTIFICATION_PROVIDER_ON_UPDATED = 192, + NOTIFICATIONS_ON_BUTTON_CLICKED = 193, + NOTIFICATIONS_ON_CLICKED = 194, + NOTIFICATIONS_ON_CLOSED = 195, + NOTIFICATIONS_ON_PERMISSION_LEVEL_CHANGED = 196, + NOTIFICATIONS_ON_SHOW_SETTINGS = 197, + OMNIBOX_ON_INPUT_CANCELLED = 198, + OMNIBOX_ON_INPUT_CHANGED = 199, + OMNIBOX_ON_INPUT_ENTERED = 200, + OMNIBOX_ON_INPUT_STARTED = 201, + PAGE_ACTION_ON_CLICKED = 202, + PASSWORDS_PRIVATE_ON_PASSWORD_EXCEPTIONS_LIST_CHANGED = 203, + PASSWORDS_PRIVATE_ON_PLAINTEXT_PASSWORD_RETRIEVED = 204, + PASSWORDS_PRIVATE_ON_SAVED_PASSWORDS_LIST_CHANGED = 205, + PERMISSIONS_ON_ADDED = 206, + PERMISSIONS_ON_REMOVED = 207, + PRINTER_PROVIDER_ON_GET_CAPABILITY_REQUESTED = 208, + PRINTER_PROVIDER_ON_GET_PRINTERS_REQUESTED = 209, + PRINTER_PROVIDER_ON_GET_USB_PRINTER_INFO_REQUESTED = 210, + PRINTER_PROVIDER_ON_PRINT_REQUESTED = 211, + PROCESSES_ON_CREATED = 212, + PROCESSES_ON_EXITED = 213, + PROCESSES_ON_UNRESPONSIVE = 214, + PROCESSES_ON_UPDATED = 215, + PROCESSES_ON_UPDATED_WITH_MEMORY = 216, + PROXY_ON_PROXY_ERROR = 217, + RUNTIME_ON_BROWSER_UPDATE_AVAILABLE = 218, + RUNTIME_ON_CONNECT = 219, + RUNTIME_ON_CONNECT_EXTERNAL = 220, + RUNTIME_ON_INSTALLED = 221, + RUNTIME_ON_MESSAGE = 222, + RUNTIME_ON_MESSAGE_EXTERNAL = 223, + RUNTIME_ON_RESTART_REQUIRED = 224, + RUNTIME_ON_STARTUP = 225, + RUNTIME_ON_SUSPEND = 226, + RUNTIME_ON_SUSPEND_CANCELED = 227, + RUNTIME_ON_UPDATE_AVAILABLE = 228, + SEARCH_ENGINES_PRIVATE_ON_SEARCH_ENGINES_CHANGED = 229, + SERIAL_ON_RECEIVE = 230, + SERIAL_ON_RECEIVE_ERROR = 231, + SESSIONS_ON_CHANGED = 232, + SETTINGS_PRIVATE_ON_PREFS_CHANGED = 233, + SIGNED_IN_DEVICES_ON_DEVICE_INFO_CHANGE = 234, + SOCKETS_TCP_ON_RECEIVE = 235, + SOCKETS_TCP_ON_RECEIVE_ERROR = 236, + SOCKETS_TCP_SERVER_ON_ACCEPT = 237, + SOCKETS_TCP_SERVER_ON_ACCEPT_ERROR = 238, + SOCKETS_UDP_ON_RECEIVE = 239, + SOCKETS_UDP_ON_RECEIVE_ERROR = 240, + STORAGE_ON_CHANGED = 241, + STREAMS_PRIVATE_ON_EXECUTE_MIME_TYPE_HANDLER = 242, + SYNC_FILE_SYSTEM_ON_FILE_STATUS_CHANGED = 243, + SYNC_FILE_SYSTEM_ON_SERVICE_STATUS_CHANGED = 244, + SYSTEM_DISPLAY_ON_DISPLAY_CHANGED = 245, + SYSTEM_INDICATOR_ON_CLICKED = 246, + SYSTEM_PRIVATE_ON_BRIGHTNESS_CHANGED = 247, + SYSTEM_PRIVATE_ON_SCREEN_UNLOCKED = 248, + SYSTEM_PRIVATE_ON_VOLUME_CHANGED = 249, + SYSTEM_PRIVATE_ON_WOKE_UP = 250, + SYSTEM_STORAGE_ON_ATTACHED = 251, + SYSTEM_STORAGE_ON_DETACHED = 252, + TAB_CAPTURE_ON_STATUS_CHANGED = 253, + TABS_ON_ACTIVATED = 254, + TABS_ON_ACTIVE_CHANGED = 255, + TABS_ON_ATTACHED = 256, + TABS_ON_CREATED = 257, + TABS_ON_DETACHED = 258, + TABS_ON_HIGHLIGHT_CHANGED = 259, + TABS_ON_HIGHLIGHTED = 260, + TABS_ON_MOVED = 261, + TABS_ON_REMOVED = 262, + TABS_ON_REPLACED = 263, + TABS_ON_SELECTION_CHANGED = 264, + TABS_ON_UPDATED = 265, + TABS_ON_ZOOM_CHANGE = 266, + TERMINAL_PRIVATE_ON_PROCESS_OUTPUT = 267, + TEST_ON_MESSAGE = 268, + TTS_ENGINE_ON_PAUSE = 269, + TTS_ENGINE_ON_RESUME = 270, + TTS_ENGINE_ON_SPEAK = 271, + TTS_ENGINE_ON_STOP = 272, + USB_ON_DEVICE_ADDED = 273, + USB_ON_DEVICE_REMOVED = 274, + VIRTUAL_KEYBOARD_PRIVATE_ON_BOUNDS_CHANGED = 275, + VIRTUAL_KEYBOARD_PRIVATE_ON_TEXT_INPUT_BOX_FOCUSED = 276, + VPN_PROVIDER_ON_CONFIG_CREATED = 277, + VPN_PROVIDER_ON_CONFIG_REMOVED = 278, + VPN_PROVIDER_ON_PACKET_RECEIVED = 279, + VPN_PROVIDER_ON_PLATFORM_MESSAGE = 280, + VPN_PROVIDER_ON_UI_EVENT = 281, + WALLPAPER_PRIVATE_ON_WALLPAPER_CHANGED_BY_3RD_PARTY = 282, + WEB_NAVIGATION_ON_BEFORE_NAVIGATE = 283, + WEB_NAVIGATION_ON_COMMITTED = 284, + WEB_NAVIGATION_ON_COMPLETED = 285, + WEB_NAVIGATION_ON_CREATED_NAVIGATION_TARGET = 286, + WEB_NAVIGATION_ON_DOM_CONTENT_LOADED = 287, + WEB_NAVIGATION_ON_ERROR_OCCURRED = 288, + WEB_NAVIGATION_ON_HISTORY_STATE_UPDATED = 289, + WEB_NAVIGATION_ON_REFERENCE_FRAGMENT_UPDATED = 290, + WEB_NAVIGATION_ON_TAB_REPLACED = 291, + WEB_REQUEST_ON_AUTH_REQUIRED = 292, + WEB_REQUEST_ON_BEFORE_REDIRECT = 293, + WEB_REQUEST_ON_BEFORE_REQUEST = 294, + WEB_REQUEST_ON_BEFORE_SEND_HEADERS = 295, + WEB_REQUEST_ON_COMPLETED = 296, + WEB_REQUEST_ON_ERROR_OCCURRED = 297, + WEB_REQUEST_ON_HEADERS_RECEIVED = 298, + WEB_REQUEST_ON_RESPONSE_STARTED = 299, + WEB_REQUEST_ON_SEND_HEADERS = 300, + WEBRTC_AUDIO_PRIVATE_ON_SINKS_CHANGED = 301, + WEBSTORE_ON_DOWNLOAD_PROGRESS = 302, + WEBSTORE_ON_INSTALL_STAGE_CHANGED = 303, + WEBSTORE_WIDGET_PRIVATE_ON_SHOW_WIDGET = 304, + WEBVIEW_TAG_CLOSE = 305, + WEBVIEW_TAG_CONSOLEMESSAGE = 306, + WEBVIEW_TAG_CONTENTLOAD = 307, + WEBVIEW_TAG_DIALOG = 308, + WEBVIEW_TAG_EXIT = 309, + WEBVIEW_TAG_FINDUPDATE = 310, + WEBVIEW_TAG_LOADABORT = 311, + WEBVIEW_TAG_LOADCOMMIT = 312, + WEBVIEW_TAG_LOADREDIRECT = 313, + WEBVIEW_TAG_LOADSTART = 314, + WEBVIEW_TAG_LOADSTOP = 315, + WEBVIEW_TAG_NEWWINDOW = 316, + WEBVIEW_TAG_PERMISSIONREQUEST = 317, + WEBVIEW_TAG_RESPONSIVE = 318, + WEBVIEW_TAG_SIZECHANGED = 319, + WEBVIEW_TAG_UNRESPONSIVE = 320, + WEBVIEW_TAG_ZOOMCHANGE = 321, + WINDOWS_ON_CREATED = 322, + WINDOWS_ON_FOCUS_CHANGED = 323, + WINDOWS_ON_REMOVED = 324, + FILE_SYSTEM_PROVIDER_ON_EXECUTE_ACTION_REQUESTED = 325, + FILE_SYSTEM_PROVIDER_ON_GET_ACTIONS_REQUESTED = 326, + LAUNCHER_SEARCH_PROVIDER_ON_QUERY_STARTED = 327, + LAUNCHER_SEARCH_PROVIDER_ON_QUERY_ENDED = 328, + LAUNCHER_SEARCH_PROVIDER_ON_OPEN_RESULT = 329, + CHROME_WEB_VIEW_INTERNAL_ON_CLICKED = 330, + WEB_VIEW_INTERNAL_CONTEXT_MENUS = 331, + CONTEXT_MENUS = 332, + TTS_ON_EVENT = 333, + LAUNCHER_PAGE_ON_TRANSITION_CHANGED_DEPRECATED = 334, + LAUNCHER_PAGE_ON_POP_SUBPAGE_DEPRECATED = 335, + DIAL_ON_DEVICE_LIST = 336, + DIAL_ON_ERROR = 337, + CAST_CHANNEL_ON_MESSAGE = 338, + CAST_CHANNEL_ON_ERROR = 339, + SCREENLOCK_PRIVATE_ON_CHANGED = 340, + SCREENLOCK_PRIVATE_ON_AUTH_ATTEMPTED = 341, + TYPES_CHROME_SETTING_ON_CHANGE = 342, + DELETED_TYPES_PRIVATE_CHROME_DIRECT_SETTING_ON_CHANGE = 343, + WEB_VIEW_INTERNAL_ON_MESSAGE = 344, + EXTENSION_VIEW_INTERNAL_ON_LOAD_COMMIT = 345, + RUNTIME_ON_REQUEST = 346, + RUNTIME_ON_REQUEST_EXTERNAL = 347, + CHROME_WEB_VIEW_INTERNAL_ON_CONTEXT_MENU_SHOW = 348, + WEB_VIEW_INTERNAL_ON_BEFORE_REQUEST = 349, + WEB_VIEW_INTERNAL_ON_BEFORE_SEND_HEADERS = 350, + WEB_VIEW_INTERNAL_ON_CLOSE = 351, + WEB_VIEW_INTERNAL_ON_COMPLETED = 352, + WEB_VIEW_INTERNAL_ON_CONSOLE_MESSAGE = 353, + WEB_VIEW_INTERNAL_ON_CONTENT_LOAD = 354, + WEB_VIEW_INTERNAL_ON_DIALOG = 355, + WEB_VIEW_INTERNAL_ON_DROP_LINK = 356, + WEB_VIEW_INTERNAL_ON_EXIT = 357, + WEB_VIEW_INTERNAL_ON_EXIT_FULLSCREEN = 358, + WEB_VIEW_INTERNAL_ON_FIND_REPLY = 359, + WEB_VIEW_INTERNAL_ON_FRAME_NAME_CHANGED = 360, + WEB_VIEW_INTERNAL_ON_HEADERS_RECEIVED = 361, + WEB_VIEW_INTERNAL_ON_LOAD_ABORT = 362, + WEB_VIEW_INTERNAL_ON_LOAD_COMMIT = 363, + WEB_VIEW_INTERNAL_ON_LOAD_PROGRESS = 364, + WEB_VIEW_INTERNAL_ON_LOAD_REDIRECT = 365, + WEB_VIEW_INTERNAL_ON_LOAD_START = 366, + WEB_VIEW_INTERNAL_ON_LOAD_STOP = 367, + WEB_VIEW_INTERNAL_ON_NEW_WINDOW = 368, + WEB_VIEW_INTERNAL_ON_PERMISSION_REQUEST = 369, + WEB_VIEW_INTERNAL_ON_RESPONSE_STARTED = 370, + WEB_VIEW_INTERNAL_ON_RESPONSIVE = 371, + WEB_VIEW_INTERNAL_ON_SIZE_CHANGED = 372, + WEB_VIEW_INTERNAL_ON_UNRESPONSIVE = 373, + WEB_VIEW_INTERNAL_ON_ZOOM_CHANGE = 374, + GUEST_VIEW_INTERNAL_ON_RESIZE = 375, + LANGUAGE_SETTINGS_PRIVATE_ON_INPUT_METHOD_ADDED = 376, + LANGUAGE_SETTINGS_PRIVATE_ON_INPUT_METHOD_REMOVED = 377, + LANGUAGE_SETTINGS_PRIVATE_ON_SPELLCHECK_DICTIONARIES_CHANGED = 378, + LANGUAGE_SETTINGS_PRIVATE_ON_CUSTOM_DICTIONARY_CHANGED = 379, + CAST_DEVICES_PRIVATE_ON_UPDATE_DEVICES_REQUESTED = 380, + CAST_DEVICES_PRIVATE_ON_START_CAST = 381, + CAST_DEVICES_PRIVATE_ON_STOP_CAST = 382, + CERTIFICATEPROVIDER_ON_CERTIFICATES_REQUESTED = 383, + CERTIFICATEPROVIDER_ON_SIGN_DIGEST_REQUESTED = 384, + WEB_VIEW_INTERNAL_ON_AUTH_REQUIRED = 385, + WEB_VIEW_INTERNAL_ON_BEFORE_REDIRECT = 386, + WEB_VIEW_INTERNAL_ON_ERROR_OCCURRED = 387, + WEB_VIEW_INTERNAL_ON_SEND_HEADERS = 388, + EASY_UNLOCK_PRIVATE_ON_CONNECTION_STATUS_CHANGED = 389, + EASY_UNLOCK_PRIVATE_ON_DATA_RECEIVED = 390, + EASY_UNLOCK_PRIVATE_ON_SEND_COMPLETED = 391, + DISPLAY_SOURCE_ON_SINKS_UPDATED = 392, + INPUT_IME_ON_COMPOSITION_BOUNDS_CHANGED = 393, + INPUT_METHOD_PRIVATE_ON_IME_MENU_ACTIVATION_CHANGED = 394, + INPUT_METHOD_PRIVATE_ON_IME_MENU_LIST_CHANGED = 395, + INPUT_METHOD_PRIVATE_ON_IME_MENU_ITEMS_CHANGED = 396, + BLUETOOTH_LOW_ENERGY_ON_CHARACTERISTIC_READ_REQUEST = 397, + BLUETOOTH_LOW_ENERGY_ON_CHARACTERISTIC_WRITE_REQUEST = 398, + BLUETOOTH_LOW_ENERGY_ON_DESCRIPTOR_READ_REQUEST = 399, + BLUETOOTH_LOW_ENERGY_ON_DESCRIPTOR_WRITE_REQUEST = 400, + ACCESSIBILITY_PRIVATE_ON_ACCESSIBILITY_GESTURE = 401, + QUICK_UNLOCK_PRIVATE_ON_ACTIVE_MODES_CHANGED = 402, + CLIPBOARD_ON_CLIPBOARD_DATA_CHANGED = 403, + VIRTUAL_KEYBOARD_PRIVATE_ON_KEYBOARD_CLOSED = 404, + FILE_MANAGER_PRIVATE_ON_APPS_UPDATED = 405, + ACCESSIBILITY_PRIVATE_ON_TWO_FINGER_TOUCH_START = 406, + ACCESSIBILITY_PRIVATE_ON_TWO_FINGER_TOUCH_STOP = 407, + MEDIA_PERCEPTION_PRIVATE_ON_MEDIA_PERCEPTION = 408, + NETWORKING_PRIVATE_ON_CERTIFICATE_LISTS_CHANGED = 409, + LOCK_SCREEN_DATA_ON_DATA_ITEMS_AVAILABLE = 410, + WEB_VIEW_INTERNAL_ON_AUDIO_STATE_CHANGED = 411, + AUTOMATION_INTERNAL_ON_ACTION_RESULT = 412, + OMNIBOX_ON_DELETE_SUGGESTION = 413, + VIRTUAL_KEYBOARD_PRIVATE_ON_KEYBOARD_CONFIG_CHANGED = 414, + PASSWORDS_PRIVATE_ON_PASSWORDS_FILE_EXPORT_PROGRESS = 415, + SAFE_BROWSING_PRIVATE_ON_POLICY_SPECIFIED_PASSWORD_REUSE_DETECTED = 416, + SAFE_BROWSING_PRIVATE_ON_POLICY_SPECIFIED_PASSWORD_CHANGED = 417, + SAFE_BROWSING_PRIVATE_ON_DANGEROUS_DOWNLOAD_OPENED = 418, + SAFE_BROWSING_PRIVATE_ON_SECURITY_INTERSTITIAL_SHOWN = 419, + SAFE_BROWSING_PRIVATE_ON_SECURITY_INTERSTITIAL_PROCEEDED = 420, + ACCESSIBILITY_PRIVATE_ON_SELECT_TO_SPEAK_STATE_CHANGE_REQUESTED = 421, + INPUT_METHOD_PRIVATE_ON_FOCUS = 422, + SYSTEM_POWER_SOURCE_ONPOWERCHANGED = 423, + WEB_REQUEST_ON_ACTION_IGNORED = 424, + ARC_APPS_PRIVATE_ON_INSTALLED = 425, // Last entry: Add new entries above, then run: // python tools/metrics/histograms/update_extension_histograms.py ENUM_BOUNDARY
diff --git a/extensions/browser/extension_event_histogram_value_unittest.cc b/extensions/browser/extension_event_histogram_value_unittest.cc new file mode 100644 index 0000000..c16724e --- /dev/null +++ b/extensions/browser/extension_event_histogram_value_unittest.cc
@@ -0,0 +1,54 @@ +// 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 "extensions/browser/extension_event_histogram_value.h" + +#include <map> +#include <set> +#include <string> + +#include "base/files/file_path.h" +#include "base/files/file_util.h" +#include "base/path_service.h" +#include "base/strings/stringprintf.h" +#include "base/test/metrics/histogram_enum_reader.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace extensions { + +// Tests that the ExtensionEvents enum in enums.xml exactly matches the +// C++ enum definition. +TEST(ExtensionEventHistogramValueTest, CheckEnums) { + base::Optional<base::HistogramEnumEntryMap> enums = + base::ReadEnumFromEnumsXml("ExtensionEvents"); + ASSERT_TRUE(enums); + // The number of enums in the histogram entry should be equal to the number of + // enums in the C++ file. + EXPECT_EQ(events::ENUM_BOUNDARY, enums->size()); + + base::FilePath src_root; + ASSERT_TRUE(base::PathService::Get(base::DIR_SOURCE_ROOT, &src_root)); + base::FilePath event_histogram_value = + src_root.AppendASCII("extensions") + .AppendASCII("browser") + .AppendASCII("extension_event_histogram_value.h"); + ASSERT_TRUE(base::PathExists(event_histogram_value)); + + std::string file_contents; + ASSERT_TRUE(base::ReadFileToString(event_histogram_value, &file_contents)); + + for (const auto& entry : *enums) { + // Check that the C++ file has a definition equal to the histogram file. + // NOTE: For now, we do this in a simple, but reasonably effective, manner: + // expecting to find the string "ENTRY = <value>" somewhere in the file. + std::string expected_string = + base::StringPrintf("%s = %d,", entry.second.c_str(), entry.first); + EXPECT_NE(std::string::npos, file_contents.find(expected_string)) + << "Failed to find entry " << entry.second << " with value " + << entry.first << ". Make sure events::HistogramValue and the " + << "ExtensionEvents enum in enums.xml agree with each other."; + } +} + +} // namespace extensions
diff --git a/extensions/renderer/gc_callback_unittest.cc b/extensions/renderer/gc_callback_unittest.cc index 7b1453ac..451be81 100644 --- a/extensions/renderer/gc_callback_unittest.cc +++ b/extensions/renderer/gc_callback_unittest.cc
@@ -72,8 +72,11 @@ v8::Local<v8::FunctionTemplate> unreachable_function = gin::CreateFunctionTemplate(isolate, base::Bind(SetToTrue, callback_invoked)); - return new GCCallback(script_context, object, - unreachable_function->GetFunction(), fallback); + v8::Local<v8::Context> v8_context = isolate->GetCurrentContext(); + return new GCCallback( + script_context, object, + unreachable_function->GetFunction(v8_context).ToLocalChecked(), + fallback); } return new GCCallback(script_context, object, base::Bind(SetToTrue, callback_invoked), fallback);
diff --git a/gin/v8_platform.cc b/gin/v8_platform.cc index 8455560..0f42722c 100644 --- a/gin/v8_platform.cc +++ b/gin/v8_platform.cc
@@ -60,7 +60,14 @@ class EnabledStateObserverImpl final : public base::trace_event::TraceLog::EnabledStateObserver { public: - EnabledStateObserverImpl() = default; + EnabledStateObserverImpl() { + base::trace_event::TraceLog::GetInstance()->AddEnabledStateObserver(this); + } + + ~EnabledStateObserverImpl() override { + base::trace_event::TraceLog::GetInstance()->RemoveEnabledStateObserver( + this); + } void OnTraceLogEnabled() final { base::AutoLock lock(mutex_); @@ -80,12 +87,9 @@ { base::AutoLock lock(mutex_); DCHECK(!observers_.count(observer)); - if (observers_.empty()) { - base::trace_event::TraceLog::GetInstance()->AddEnabledStateObserver( - this); - } observers_.insert(observer); } + // Fire the observer if recording is already in progress. if (base::trace_event::TraceLog::GetInstance()->IsEnabled()) observer->OnTraceEnabled(); @@ -95,10 +99,6 @@ base::AutoLock lock(mutex_); DCHECK(observers_.count(observer) == 1); observers_.erase(observer); - if (observers_.empty()) { - base::trace_event::TraceLog::GetInstance()->RemoveEnabledStateObserver( - this); - } } private:
diff --git a/google_apis/gaia/gaia_auth_fetcher.cc b/google_apis/gaia/gaia_auth_fetcher.cc index ff08dd8..1ae2806 100644 --- a/google_apis/gaia/gaia_auth_fetcher.cc +++ b/google_apis/gaia/gaia_auth_fetcher.cc
@@ -460,9 +460,13 @@ cookies_allowed: NO setting: "This feature cannot be disabled in settings, but if the user " - "signs out of Chrome, this request would not be made.", - policy_exception_justification: - "Essential for Google account management" + "signs out of Chrome, this request would not be made." + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } })"); CreateAndStartGaiaFetcher(request_body_, std::string(), oauth2_revoke_gurl_, kLoadFlagsIgnoreCookies, traffic_annotation); @@ -500,9 +504,13 @@ cookies_allowed: NO setting: "This feature cannot be disabled in settings, but if the user " - "signs out of Chrome, this request would not be made.", - policy_exception_justification: - "Essential for Google account management" + "signs out of Chrome, this request would not be made." + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } })"); CreateAndStartGaiaFetcher(request_body_, std::string(), oauth2_token_gurl_, kLoadFlagsIgnoreCookies, traffic_annotation); @@ -528,9 +536,13 @@ cookies_allowed: NO setting: "This feature cannot be disabled in settings, but if the user " - "signs out of Chrome, this request would not be made.", - policy_exception_justification: - "Essential for Google account management" + "signs out of Chrome, this request would not be made." + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } })"); CreateAndStartGaiaFetcher(request_body_, std::string(), get_user_info_gurl_, kLoadFlagsIgnoreCookies, traffic_annotation); @@ -573,9 +585,13 @@ cookies_store: "user" setting: "This feature cannot be disabled in settings, but if the user " - "signs out of Chrome, this request would not be made.", - policy_exception_justification: - "Essential for Google account management" + "signs out of Chrome, this request would not be made." + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } })"); CreateAndStartGaiaFetcher(std::string(), std::string(), merge_session_gurl_.Resolve(query), @@ -612,9 +628,13 @@ cookies_store: "user" setting: "This feature cannot be disabled in settings, but if the user " - "signs out of Chrome, this request would not be made.", - policy_exception_justification: - "Essential for Google account management" + "signs out of Chrome, this request would not be made." + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } })"); CreateAndStartGaiaFetcher(std::string(), authentication_header, uberauth_token_gurl_, load_flags, @@ -650,9 +670,13 @@ cookies_store: "user" setting: "This feature cannot be disabled in settings, but if the user " - "signs out of Chrome, this request would not be made.", - policy_exception_justification: - "Essential for Google account management" + "signs out of Chrome, this request would not be made." + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } })"); CreateAndStartGaiaFetcher(request_body_, authentication_header, oauth_login_gurl_, net::LOAD_NORMAL, @@ -686,9 +710,13 @@ cookies_store: "user" setting: "This feature cannot be disabled in settings, but if the user " - "signs out of Chrome, this request would not be made.", - policy_exception_justification: - "Essential for Google account management" + "signs out of Chrome, this request would not be made." + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } })"); CreateAndStartGaiaFetcher(" ", // To force an HTTP POST. "Origin: https://www.google.com", @@ -734,9 +762,12 @@ cookies_store: "user" setting: "This feature cannot be disabled in settings, but if the user " - "signs out of Chrome, this request would not be made.", - policy_exception_justification: - "Essential for Google account management" + "signs out of Chrome, this request would not be made." + chrome_policy { + SigninAllowed { + SigninAllowed: false + } + } })"); CreateAndStartGaiaFetcher(" ", // Non-empty to force a POST authorization_header, @@ -766,9 +797,13 @@ cookies_store: "user" setting: "This feature cannot be disabled in settings, but if the user " - "signs out of Chrome, this request would not be made.", - policy_exception_justification: - "Essential for Google account management" + "signs out of Chrome, this request would not be made." + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } })"); CreateAndStartGaiaFetcher(std::string(), std::string(), logout_gurl_, net::LOAD_NORMAL, traffic_annotation); @@ -794,9 +829,13 @@ cookies_allowed: NO setting: "This feature cannot be disabled in settings, but if the user " - "signs out of Chrome, this request would not be made.", - policy_exception_justification: - "Essential for Google account management" + "signs out of Chrome, this request would not be made." + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } })"); CreateAndStartGaiaFetcher(std::string(), std::string(), get_check_connection_info_url_,
diff --git a/google_apis/gaia/gaia_oauth_client.cc b/google_apis/gaia/gaia_oauth_client.cc index 1b377c2c..c6c0221 100644 --- a/google_apis/gaia/gaia_oauth_client.cc +++ b/google_apis/gaia/gaia_oauth_client.cc
@@ -180,9 +180,13 @@ cookies_allowed: NO setting: "This feature cannot be disabled in settings, but if the user " - "signs out of Chrome, this request would not be made.", - policy_exception_justification: - "Essential for Google account management" + "signs out of Chrome, this request would not be made." + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } })")); MakeRequest(TOKENS_FROM_AUTH_CODE, GURL(GaiaUrls::GetInstance()->oauth2_token_url()), post_body, @@ -229,9 +233,13 @@ cookies_allowed: NO setting: "This feature cannot be disabled in settings, but if the user " - "signs out of Chrome, this request would not be made.", - policy_exception_justification: - "Essential for Google account management" + "signs out of Chrome, this request would not be made." + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } })")); MakeRequest(REFRESH_TOKEN, GURL(GaiaUrls::GetInstance()->oauth2_token_url()), post_body, @@ -281,9 +289,13 @@ cookies_allowed: NO setting: "This feature cannot be disabled in settings, but if the user " - "signs out of Chrome, this request would not be made.", - policy_exception_justification: - "Essential for Google account management" + "signs out of Chrome, this request would not be made." + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } })")); std::string auth = "OAuth " + oauth_access_token; MakeRequest(type, GaiaUrls::GetInstance()->oauth_user_info_url(), @@ -323,8 +335,12 @@ setting: "This feature cannot be disabled in settings, but if the user " "signs out of Chrome, this request would not be made." - policy_exception_justification: - "Essential for Google account management" + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } })")); MakeRequest(TOKEN_INFO, GURL(GaiaUrls::GetInstance()->oauth2_token_info_url()), post_body,
diff --git a/google_apis/gaia/oauth2_access_token_fetcher_impl.cc b/google_apis/gaia/oauth2_access_token_fetcher_impl.cc index 1d256de2..49f3e0db 100644 --- a/google_apis/gaia/oauth2_access_token_fetcher_impl.cc +++ b/google_apis/gaia/oauth2_access_token_fetcher_impl.cc
@@ -108,9 +108,13 @@ cookies_allowed: NO setting: "This feature cannot be disabled in settings, but if user signs " - "out of Chrome, this request would not be made.", - policy_exception_justification: - "Essential for Google account management" + "out of Chrome, this request would not be made." + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } })"); auto resource_request = std::make_unique<network::ResourceRequest>();
diff --git a/google_apis/gaia/oauth2_mint_token_flow.cc b/google_apis/gaia/oauth2_mint_token_flow.cc index 04705ab1..a99a51b 100644 --- a/google_apis/gaia/oauth2_mint_token_flow.cc +++ b/google_apis/gaia/oauth2_mint_token_flow.cc
@@ -304,8 +304,12 @@ policy { setting: "This feature cannot be disabled by settings, however the request is " - "made only for signed-in users.", - policy_exception_justification: - "Essential for Google account management" + "made only for signed-in users." + chrome_policy { + SigninAllowed { + policy_options {mode: MANDATORY} + SigninAllowed: false + } + } })"); }
diff --git a/gpu/command_buffer/common/BUILD.gn b/gpu/command_buffer/common/BUILD.gn index 7b419f4..1129d2e3 100644 --- a/gpu/command_buffer/common/BUILD.gn +++ b/gpu/command_buffer/common/BUILD.gn
@@ -70,6 +70,7 @@ "constants.h", "context_creation_attribs.cc", "context_creation_attribs.h", + "context_result.cc", "context_result.h", "debug_marker_manager.cc", "debug_marker_manager.h",
diff --git a/gpu/command_buffer/common/context_result.cc b/gpu/command_buffer/common/context_result.cc new file mode 100644 index 0000000..576e8aa --- /dev/null +++ b/gpu/command_buffer/common/context_result.cc
@@ -0,0 +1,14 @@ +// 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 "gpu/command_buffer/common/context_result.h" + +namespace gpu { + +bool IsFatalOrSurfaceFailure(ContextResult result) { + return result == ContextResult::kFatalFailure || + result == ContextResult::kSurfaceFailure; +} + +} // namespace gpu
diff --git a/gpu/command_buffer/common/context_result.h b/gpu/command_buffer/common/context_result.h index db59266..e8c5461 100644 --- a/gpu/command_buffer/common/context_result.h +++ b/gpu/command_buffer/common/context_result.h
@@ -5,6 +5,8 @@ #ifndef GPU_COMMAND_BUFFER_COMMON_CONTEXT_RESULT_H_ #define GPU_COMMAND_BUFFER_COMMON_CONTEXT_RESULT_H_ +#include "gpu/gpu_export.h" + namespace gpu { // The result of trying to create a gpu context. Also the result of intermediate @@ -20,9 +22,14 @@ // An error occured that will recur in future attempts too with the // same inputs, retrying would not be productive. kFatalFailure, - kLastContextResult = kFatalFailure + // An error occurred using the gpu::SurfaceHandle. Only retry with a new + // SurfaceHandle; treat as kFatalFailure otherwise. + kSurfaceFailure, + kLastContextResult = kSurfaceFailure }; +GPU_EXPORT bool IsFatalOrSurfaceFailure(ContextResult result); + } // namespace gpu #endif // GPU_COMMAND_BUFFER_COMMON_CONTEXT_RESULT_H_
diff --git a/gpu/config/dx_diag_node.cc b/gpu/config/dx_diag_node.cc index 7dcba27..ca9be0d 100644 --- a/gpu/config/dx_diag_node.cc +++ b/gpu/config/dx_diag_node.cc
@@ -12,4 +12,8 @@ DxDiagNode::~DxDiagNode() = default; +bool DxDiagNode::IsEmpty() const { + return values.empty() && children.empty(); +} + } // namespace gpu
diff --git a/gpu/config/dx_diag_node.h b/gpu/config/dx_diag_node.h index 2a14a6b..e9513331 100644 --- a/gpu/config/dx_diag_node.h +++ b/gpu/config/dx_diag_node.h
@@ -19,6 +19,8 @@ DxDiagNode(); DxDiagNode(const DxDiagNode& other); ~DxDiagNode(); + bool IsEmpty() const; + std::map<std::string, std::string> values; std::map<std::string, DxDiagNode> children; };
diff --git a/gpu/ipc/in_process_command_buffer.cc b/gpu/ipc/in_process_command_buffer.cc index 1f3829a..d87fe91 100644 --- a/gpu/ipc/in_process_command_buffer.cc +++ b/gpu/ipc/in_process_command_buffer.cc
@@ -490,8 +490,9 @@ surface_format); if (!surface_ || !surface_->Initialize(surface_format)) { DestroyOnGpuThread(); - LOG(ERROR) << "ContextResult::kFatalFailure: Failed to create surface."; - return gpu::ContextResult::kFatalFailure; + LOG(ERROR) + << "ContextResult::kSurfaceFailure: Failed to create surface."; + return gpu::ContextResult::kSurfaceFailure; } if (params.attribs.enable_swap_timestamps_if_supported && surface_->SupportsSwapTimestamps())
diff --git a/gpu/ipc/service/gles2_command_buffer_stub.cc b/gpu/ipc/service/gles2_command_buffer_stub.cc index b96eed50..3c063c2 100644 --- a/gpu/ipc/service/gles2_command_buffer_stub.cc +++ b/gpu/ipc/service/gles2_command_buffer_stub.cc
@@ -193,8 +193,9 @@ surface_ = gl::init::CreateOffscreenGLSurfaceWithFormat(gfx::Size(), surface_format); if (!surface_) { - LOG(ERROR) << "ContextResult::kFatalFailure: Failed to create surface."; - return gpu::ContextResult::kFatalFailure; + LOG(ERROR) + << "ContextResult::kSurfaceFailure: Failed to create surface."; + return gpu::ContextResult::kSurfaceFailure; } } else { surface_ = default_surface; @@ -217,8 +218,8 @@ weak_ptr_factory_.GetWeakPtr(), surface_handle_, surface_format); if (!surface_ || !surface_->Initialize(surface_format)) { surface_ = nullptr; - LOG(ERROR) << "ContextResult::kFatalFailure: Failed to create surface."; - return gpu::ContextResult::kFatalFailure; + LOG(ERROR) << "ContextResult::kSurfaceFailure: Failed to create surface."; + return gpu::ContextResult::kSurfaceFailure; } if (init_params.attribs.enable_swap_timestamps_if_supported && surface_->SupportsSwapTimestamps())
diff --git a/infra/config/global/cr-buildbucket.cfg b/infra/config/global/cr-buildbucket.cfg index 50284fd..435f717 100644 --- a/infra/config/global/cr-buildbucket.cfg +++ b/infra/config/global/cr-buildbucket.cfg
@@ -1341,6 +1341,21 @@ mixins: "mac-gpu-fyi-ci" } builders { + name: "Mac FYI 10.14 Release (AMD)" + mixins: "mac-gpu-fyi-ci" + mixins: "gpu-slow-bot" + } + builders { + name: "Mac FYI 10.14 Release (Intel)" + mixins: "mac-gpu-fyi-ci" + mixins: "gpu-slow-bot" + } + builders { + name: "Mac FYI 10.14 Release (NVIDIA)" + mixins: "mac-gpu-fyi-ci" + mixins: "gpu-slow-bot" + } + builders { name: "Mac FYI Release (Intel)" mixins: "mac-gpu-fyi-ci" }
diff --git a/infra/config/global/luci-milo.cfg b/infra/config/global/luci-milo.cfg index 1cafd0d..bdc5708 100644 --- a/infra/config/global/luci-milo.cfg +++ b/infra/config/global/luci-milo.cfg
@@ -3474,6 +3474,11 @@ short_name: "rel" } builders { + name: "buildbucket/luci.chromium.ci/Mac FYI 10.14 Release (Intel)" + category: "Mac|Intel|10.14" + short_name: "rel" + } + builders { name: "buildbucket/luci.chromium.ci/Mac Pro FYI Release (AMD)" category: "Mac|AMD|Pro" short_name: "rel" @@ -3499,6 +3504,11 @@ short_name: "exp" } builders { + name: "buildbucket/luci.chromium.ci/Mac FYI 10.14 Release (AMD)" + category: "Mac|AMD|10.14" + short_name: "rel" + } + builders { name: "buildbucket/luci.chromium.ci/Mac FYI Retina Debug (NVIDIA)" category: "Mac|Nvidia" short_name: "dbg" @@ -3514,6 +3524,11 @@ short_name: "exp" } builders { + name: "buildbucket/luci.chromium.ci/Mac FYI 10.14 Release (NVIDIA)" + category: "Mac|Nvidia|10.14" + short_name: "rel" + } + builders { name: "buildbucket/luci.chromium.ci/Mac FYI GPU ASAN Release" category: "Mac" short_name: "asn"
diff --git a/infra/config/global/luci-scheduler.cfg b/infra/config/global/luci-scheduler.cfg index 400ddf77..edf463a 100644 --- a/infra/config/global/luci-scheduler.cfg +++ b/infra/config/global/luci-scheduler.cfg
@@ -1729,6 +1729,39 @@ } job { + id: "Mac FYI 10.14 Release (AMD)" + # Triggered by "GPU FYI Mac Builder" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Mac FYI 10.14 Release (AMD)" + } +} + +job { + id: "Mac FYI 10.14 Release (Intel)" + # Triggered by "GPU FYI Mac Builder" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Mac FYI 10.14 Release (Intel)" + } +} + +job { + id: "Mac FYI 10.14 Release (NVIDIA)" + # Triggered by "GPU FYI Mac Builder" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Mac FYI 10.14 Release (NVIDIA)" + } +} + +job { id: "Mac FYI Experimental Release (Intel)" # Triggered by "GPU FYI Mac Builder". acl_sets: "triggered-by-parent-builders"
diff --git a/ios/chrome/browser/BUILD.gn b/ios/chrome/browser/BUILD.gn index ca998b9..aff3b33 100644 --- a/ios/chrome/browser/BUILD.gn +++ b/ios/chrome/browser/BUILD.gn
@@ -240,7 +240,6 @@ "crash_loop_detection_util_unittest.mm", "install_time_util_unittest.mm", "installation_notifier_unittest.mm", - "ios_chrome_io_thread_unittest.mm", "notification_promo_unittest.cc", ] deps = [
diff --git a/ios/chrome/browser/application_context_impl.cc b/ios/chrome/browser/application_context_impl.cc index b04a404..408cd7a 100644 --- a/ios/chrome/browser/application_context_impl.cc +++ b/ios/chrome/browser/application_context_impl.cc
@@ -59,7 +59,7 @@ #include "services/metrics/public/cpp/ukm_recorder.h" #include "services/network/network_change_manager.h" #include "services/network/public/cpp/network_connection_tracker.h" -#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h" +#include "services/network/public/mojom/network_service.mojom.h" namespace { @@ -146,13 +146,7 @@ sessions::SessionIdGenerator::GetInstance()->Shutdown(); } - if (shared_url_loader_factory_) - shared_url_loader_factory_->Detach(); - - if (network_context_) { - web::WebThread::DeleteSoon(web::WebThread::IO, FROM_HERE, - network_context_owner_.release()); - } + ios_chrome_io_thread_->NetworkTearDown(); } void ApplicationContextImpl::PostDestroyThreads() { @@ -241,28 +235,12 @@ scoped_refptr<network::SharedURLLoaderFactory> ApplicationContextImpl::GetSharedURLLoaderFactory() { - if (!url_loader_factory_) { - auto url_loader_factory_params = - network::mojom::URLLoaderFactoryParams::New(); - url_loader_factory_params->process_id = network::mojom::kBrowserProcessId; - url_loader_factory_params->is_corb_enabled = false; - GetSystemNetworkContext()->CreateURLLoaderFactory( - mojo::MakeRequest(&url_loader_factory_), - std::move(url_loader_factory_params)); - shared_url_loader_factory_ = - base::MakeRefCounted<network::WeakWrapperSharedURLLoaderFactory>( - url_loader_factory_.get()); - } - return shared_url_loader_factory_; + return ios_chrome_io_thread_->GetSharedURLLoaderFactory(); } network::mojom::NetworkContext* ApplicationContextImpl::GetSystemNetworkContext() { - if (!network_context_) { - network_context_owner_ = std::make_unique<web::NetworkContextOwner>( - GetSystemURLRequestContext(), &network_context_); - } - return network_context_.get(); + return ios_chrome_io_thread_->GetSystemNetworkContext(); } const std::string& ApplicationContextImpl::GetApplicationLocale() {
diff --git a/ios/chrome/browser/application_context_impl.h b/ios/chrome/browser/application_context_impl.h index 76bbed4..4b38d92 100644 --- a/ios/chrome/browser/application_context_impl.h +++ b/ios/chrome/browser/application_context_impl.h
@@ -12,8 +12,6 @@ #include "base/memory/ref_counted.h" #include "base/threading/thread_checker.h" #include "ios/chrome/browser/application_context.h" -#include "ios/web/public/network_context_owner.h" -#include "services/network/public/mojom/network_service.mojom.h" namespace base { class CommandLine; @@ -22,7 +20,6 @@ namespace network { class NetworkChangeManager; -class WeakWrapperSharedURLLoaderFactory; } class ApplicationContextImpl : public ApplicationContext { @@ -96,14 +93,6 @@ // Sequenced task runner for local state related I/O tasks. const scoped_refptr<base::SequencedTaskRunner> local_state_task_runner_; - network::mojom::NetworkContextPtr network_context_; - network::mojom::URLLoaderFactoryPtr url_loader_factory_; - scoped_refptr<network::WeakWrapperSharedURLLoaderFactory> - shared_url_loader_factory_; - - // Created on the UI thread, destroyed on the IO thread. - std::unique_ptr<web::NetworkContextOwner> network_context_owner_; - std::unique_ptr<network::NetworkChangeManager> network_change_manager_; std::unique_ptr<network::NetworkConnectionTracker> network_connection_tracker_;
diff --git a/ios/chrome/browser/experimental_flags.h b/ios/chrome/browser/experimental_flags.h index ec449f7..5ff7de1 100644 --- a/ios/chrome/browser/experimental_flags.h +++ b/ios/chrome/browser/experimental_flags.h
@@ -54,10 +54,6 @@ // Whether the 3rd party keyboard omnibox workaround is enabled. bool IsThirdPartyKeyboardWorkaroundEnabled(); -// Whether RecentTabs UI Reboot is enabled. -// TODO (crbug.com/884718): Remove all use of this flag. -bool IsRecentTabsUIRebootEnabled(); - // Whether the Bookmarks UI Reboot is enabled. // TODO (crbug.com/884719): Remove all use of this flag. bool IsBookmarksUIRebootEnabled();
diff --git a/ios/chrome/browser/experimental_flags.mm b/ios/chrome/browser/experimental_flags.mm index 4169263..b401cb2 100644 --- a/ios/chrome/browser/experimental_flags.mm +++ b/ios/chrome/browser/experimental_flags.mm
@@ -126,10 +126,6 @@ return base::FeatureList::IsEnabled(kEnableThirdPartyKeyboardWorkaround); } -bool IsRecentTabsUIRebootEnabled() { - return true; -} - bool IsBookmarksUIRebootEnabled() { return true; }
diff --git a/ios/chrome/browser/ios_chrome_io_thread.h b/ios/chrome/browser/ios_chrome_io_thread.h index ae48424..ec839fcfa 100644 --- a/ios/chrome/browser/ios_chrome_io_thread.h +++ b/ios/chrome/browser/ios_chrome_io_thread.h
@@ -8,6 +8,7 @@ #include <memory> #include "ios/components/io_thread/ios_io_thread.h" +#include "services/network/public/mojom/network_service.mojom.h" class PrefService; @@ -15,6 +16,15 @@ class ChromeNetLog; } // namespace net_log +namespace network { +class SharedURLLoaderFactory; +class WeakWrapperSharedURLLoaderFactory; +} // namespace network + +namespace web { +class NetworkContextOwner; +} + // Contains state associated with, initialized and cleaned up on, and // primarily used on, the IO thread. class IOSChromeIOThread : public io_thread::IOSIOThread { @@ -22,12 +32,25 @@ IOSChromeIOThread(PrefService* local_state, net_log::ChromeNetLog* net_log); ~IOSChromeIOThread() override; + network::mojom::NetworkContext* GetSystemNetworkContext(); + + scoped_refptr<network::SharedURLLoaderFactory> GetSharedURLLoaderFactory(); + + void NetworkTearDown(); + protected: // io_thread::IOSIOThread overrides std::unique_ptr<net::NetworkDelegate> CreateSystemNetworkDelegate() override; std::string GetChannelString() const override; private: + network::mojom::URLLoaderFactoryPtr url_loader_factory_; + scoped_refptr<network::WeakWrapperSharedURLLoaderFactory> + shared_url_loader_factory_; + + network::mojom::NetworkContextPtr network_context_; + std::unique_ptr<web::NetworkContextOwner> network_context_owner_; + DISALLOW_COPY_AND_ASSIGN(IOSChromeIOThread); };
diff --git a/ios/chrome/browser/ios_chrome_io_thread.mm b/ios/chrome/browser/ios_chrome_io_thread.mm index 46262070..5f4136b 100644 --- a/ios/chrome/browser/ios_chrome_io_thread.mm +++ b/ios/chrome/browser/ios_chrome_io_thread.mm
@@ -6,6 +6,8 @@ #include "ios/chrome/browser/net/ios_chrome_network_delegate.h" #include "ios/chrome/common/channel_info.h" +#include "ios/web/public/network_context_owner.h" +#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." @@ -27,3 +29,38 @@ std::string IOSChromeIOThread::GetChannelString() const { return ::GetChannelString(); } + +network::mojom::NetworkContext* IOSChromeIOThread::GetSystemNetworkContext() { + if (!network_context_) { + network_context_owner_ = std::make_unique<web::NetworkContextOwner>( + system_url_request_context_getter(), &network_context_); + } + return network_context_.get(); +} + +scoped_refptr<network::SharedURLLoaderFactory> +IOSChromeIOThread::GetSharedURLLoaderFactory() { + if (!url_loader_factory_) { + auto url_loader_factory_params = + network::mojom::URLLoaderFactoryParams::New(); + url_loader_factory_params->process_id = network::mojom::kBrowserProcessId; + url_loader_factory_params->is_corb_enabled = false; + GetSystemNetworkContext()->CreateURLLoaderFactory( + mojo::MakeRequest(&url_loader_factory_), + std::move(url_loader_factory_params)); + shared_url_loader_factory_ = + base::MakeRefCounted<network::WeakWrapperSharedURLLoaderFactory>( + url_loader_factory_.get()); + } + return shared_url_loader_factory_; +} + +void IOSChromeIOThread::NetworkTearDown() { + if (shared_url_loader_factory_) + shared_url_loader_factory_->Detach(); + + if (network_context_) { + web::WebThread::DeleteSoon(web::WebThread::IO, FROM_HERE, + network_context_owner_.release()); + } +}
diff --git a/ios/chrome/browser/ios_chrome_io_thread_unittest.mm b/ios/chrome/browser/ios_chrome_io_thread_unittest.mm deleted file mode 100644 index 1379e7ee..0000000 --- a/ios/chrome/browser/ios_chrome_io_thread_unittest.mm +++ /dev/null
@@ -1,83 +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 "ios/chrome/browser/ios_chrome_io_thread.h" - -#include "base/run_loop.h" -#include "components/prefs/pref_registry_simple.h" -#include "components/prefs/pref_service.h" -#include "components/prefs/pref_service_factory.h" -#include "components/prefs/testing_pref_store.h" -#include "components/proxy_config/pref_proxy_config_tracker_impl.h" -#include "ios/web/public/test/test_web_thread_bundle.h" -#include "net/test/url_request/url_request_failed_job.h" -#include "net/url_request/url_fetcher.h" -#include "net/url_request/url_fetcher_delegate.h" -#include "net/url_request/url_request_filter.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "testing/gtest_mac.h" -#include "testing/platform_test.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -namespace { - -// A delegate interface for users of URLFetcher. -class TestURLFetcherDelegate : public net::URLFetcherDelegate { - public: - TestURLFetcherDelegate() {} - ~TestURLFetcherDelegate() override {} - - // net::URLFetcherDelegate implementation. - void OnURLFetchComplete(const net::URLFetcher* source) override {} -}; - -} // namespace - -class IOSChromeIOThreadTest : public PlatformTest { - public: - IOSChromeIOThreadTest() - : thread_bundle_(web::TestWebThreadBundle::IO_MAINLOOP) { - net::URLRequestFailedJob::AddUrlHandler(); - } - - ~IOSChromeIOThreadTest() override { - net::URLRequestFilter::GetInstance()->ClearHandlers(); - } - - private: - web::TestWebThreadBundle thread_bundle_; -}; - -TEST_F(IOSChromeIOThreadTest, AssertNoUrlRequests) { - PrefServiceFactory pref_service_factory; - pref_service_factory.set_user_prefs(base::MakeRefCounted<TestingPrefStore>()); - - scoped_refptr<PrefRegistrySimple> pref_registry = new PrefRegistrySimple; - PrefProxyConfigTrackerImpl::RegisterPrefs(pref_registry.get()); - - std::unique_ptr<PrefService> pref_service( - pref_service_factory.Create(pref_registry.get())); - - // Create and init IOSChromeIOThread. - std::unique_ptr<IOSChromeIOThread> ios_chrome_io_thread( - new IOSChromeIOThread(pref_service.get(), nullptr)); - web::WebThreadDelegate* web_thread_delegate = - static_cast<web::WebThreadDelegate*>(ios_chrome_io_thread.get()); - web_thread_delegate->Init(); - - // Create and start fetcher. - TestURLFetcherDelegate fetcher_delegate; - std::unique_ptr<net::URLFetcher> fetcher = net::URLFetcher::Create( - net::URLRequestFailedJob::GetMockHttpUrl(net::ERR_IO_PENDING), - net::URLFetcher::GET, &fetcher_delegate); - fetcher->SetRequestContext( - ios_chrome_io_thread->system_url_request_context_getter()); - fetcher->Start(); - base::RunLoop().RunUntilIdle(); - // Verify that there is no AssertNoUrlRequests triggered during CleanUp. - web_thread_delegate->CleanUp(); -}
diff --git a/ios/chrome/browser/metrics/BUILD.gn b/ios/chrome/browser/metrics/BUILD.gn index 31bd05e..db649ed 100644 --- a/ios/chrome/browser/metrics/BUILD.gn +++ b/ios/chrome/browser/metrics/BUILD.gn
@@ -173,11 +173,11 @@ "//ios/chrome/browser/ui/authentication", "//ios/chrome/browser/ui/authentication:authentication_ui", "//ios/chrome/browser/ui/authentication:eg_test_support", + "//ios/chrome/browser/ui/popup_menu:constants", "//ios/chrome/browser/ui/settings", "//ios/chrome/browser/ui/tab_grid:egtest_support", "//ios/chrome/browser/ui/toolbar/buttons", "//ios/chrome/browser/ui/toolbar/public", - "//ios/chrome/browser/ui/tools_menu/public", "//ios/chrome/test/app:test_support", "//ios/chrome/test/earl_grey:test_support", "//ios/public/provider/chrome/browser/signin:test_support", @@ -203,6 +203,7 @@ "//ios/chrome/browser/tabs", "//ios/chrome/browser/ui", "//ios/chrome/browser/ui/main", + "//ios/chrome/browser/ui/popup_menu:constants", "//ios/chrome/browser/ui/tab_grid:egtest_support", "//ios/chrome/browser/ui/tools_menu/public", "//ios/chrome/browser/web_state_list",
diff --git a/ios/chrome/browser/metrics/tab_usage_recorder_egtest.mm b/ios/chrome/browser/metrics/tab_usage_recorder_egtest.mm index fc88993..120399e 100644 --- a/ios/chrome/browser/metrics/tab_usage_recorder_egtest.mm +++ b/ios/chrome/browser/metrics/tab_usage_recorder_egtest.mm
@@ -15,7 +15,6 @@ #import "ios/chrome/browser/ui/settings/privacy_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/settings_collection_view_controller.h" #import "ios/chrome/browser/ui/toolbar/buttons/toolbar_constants.h" -#include "ios/chrome/browser/ui/tools_menu/public/tools_menu_constants.h" #include "ios/chrome/browser/ui/ui_util.h" #import "ios/chrome/browser/ui/uikit_ui_util.h" #import "ios/chrome/test/app/chrome_test_util.h"
diff --git a/ios/chrome/browser/metrics/tab_usage_recorder_test_util.mm b/ios/chrome/browser/metrics/tab_usage_recorder_test_util.mm index 35edb5636..dbec80a 100644 --- a/ios/chrome/browser/metrics/tab_usage_recorder_test_util.mm +++ b/ios/chrome/browser/metrics/tab_usage_recorder_test_util.mm
@@ -11,6 +11,7 @@ #import "ios/chrome/app/main_controller.h" #import "ios/chrome/browser/tabs/tab_model.h" #import "ios/chrome/browser/ui/main/browser_view_information.h" +#import "ios/chrome/browser/ui/popup_menu/popup_menu_constants.h" #include "ios/chrome/browser/ui/tab_grid/tab_grid_egtest_util.h" #include "ios/chrome/browser/ui/tools_menu/public/tools_menu_constants.h" #include "ios/chrome/browser/ui/ui_util.h"
diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm index b8c17fc5..b814ba4 100644 --- a/ios/chrome/browser/ui/browser_view_controller.mm +++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -208,10 +208,6 @@ #import "ios/chrome/browser/ui/toolbar/toolbar_snapshot_providing.h" #import "ios/chrome/browser/ui/toolbar/toolbar_ui.h" #import "ios/chrome/browser/ui/toolbar/toolbar_ui_broadcasting_util.h" -#import "ios/chrome/browser/ui/tools_menu/public/tools_menu_configuration_provider.h" -#import "ios/chrome/browser/ui/tools_menu/public/tools_menu_presentation_provider.h" -#import "ios/chrome/browser/ui/tools_menu/tools_menu_configuration.h" -#import "ios/chrome/browser/ui/tools_menu/tools_menu_view_item.h" #import "ios/chrome/browser/ui/translate/language_selection_coordinator.h" #include "ios/chrome/browser/ui/ui_feature_flags.h" #include "ios/chrome/browser/ui/ui_util.h" @@ -431,7 +427,6 @@ TabModelObserver, TabStripPresentation, ToolbarHeightProviderForFullscreen, - ToolsMenuConfigurationProvider, UIGestureRecognizerDelegate, UpgradeCenterClient, VoiceSearchBarDelegate, @@ -542,9 +537,6 @@ // Native controller vended to tab before Tab is added to the tab model. __weak id _temporaryNativeController; - // Notifies the toolbar menu of reading list changes. - ReadingListMenuNotifier* _readingListMenuNotifier; - // Coordinator for the share menu (Activity Services). ActivityServiceLegacyCoordinator* _activityServiceCoordinator; @@ -620,8 +612,6 @@ @property(nonatomic, strong, readonly) DialogPresenter* dialogPresenter; // The object that manages keyboard commands on behalf of the BVC. @property(nonatomic, strong, readonly) KeyCommandsProvider* keyCommandsProvider; -// Whether the sharing menu should be enabled. -@property(nonatomic, assign, readonly) BOOL canShowShareMenu; // Helper method to check web controller canShowFindBar method. @property(nonatomic, assign, readonly) BOOL canShowFindBar; // Whether the controller's view is currently available. @@ -1143,12 +1133,6 @@ return _keyCommandsProvider; } -// Whether the sharing menu should be shown. -- (BOOL)canShowShareMenu { - const GURL& URL = [_model currentTab].webState->GetLastCommittedURL(); - return URL.is_valid() && !web::GetWebClient()->IsAppSpecificURL(URL); -} - - (BOOL)canShowFindBar { // Make sure web controller can handle find in page. Tab* tab = [_model currentTab]; @@ -1599,7 +1583,6 @@ self.toolbarInterface = nil; self.tabStripView = nil; _infoBarContainer = nil; - _readingListMenuNotifier = nil; [_model removeObserver:self]; [[UpgradeCenter sharedInstance] unregisterClient:self]; if (_voiceSearchController) @@ -4486,75 +4469,6 @@ return [[_model currentTab].webController wantsLocationBarHintText]; } -#pragma mark - ToolsMenuConfigurationProvider - -- (void)prepareForToolsMenuPresentationByCoordinator: - (ToolsMenuCoordinator*)coordinator { - [self.dispatcher - prepareForPopupMenuPresentation:PopupMenuCommandTypeToolsMenu]; -} - -- (ToolsMenuConfiguration*)menuConfigurationForToolsMenuCoordinator: - (ToolsMenuCoordinator*)coordinator { - ToolsMenuConfiguration* configuration = - [[ToolsMenuConfiguration alloc] initWithDisplayView:[self view] - baseViewController:self]; - configuration.requestStartTime = [NSDate date].timeIntervalSinceReferenceDate; - - if ([_model count] == 0) - [configuration setNoOpenedTabs:YES]; - - if (_isOffTheRecord) - [configuration setInIncognito:YES]; - - if (!_readingListMenuNotifier) { - _readingListMenuNotifier = [[ReadingListMenuNotifier alloc] - initWithReadingList:ReadingListModelFactory::GetForBrowserState( - _browserState)]; - } - - feature_engagement::Tracker* engagementTracker = - feature_engagement::TrackerFactory::GetForBrowserState(_browserState); - if (engagementTracker->ShouldTriggerHelpUI( - feature_engagement::kIPHBadgedReadingListFeature)) { - [configuration setShowReadingListNewBadge:YES]; - [configuration setEngagementTracker:engagementTracker]; - } - [configuration setReadingListMenuNotifier:_readingListMenuNotifier]; - - [configuration setUserAgentType:self.userAgentType]; - - if (self.bubblePresenter.incognitoTabTipBubblePresenter - .triggerFollowUpAction) { - [configuration setHighlightNewIncognitoTabCell:YES]; - self.bubblePresenter.incognitoTabTipBubblePresenter.triggerFollowUpAction = - NO; - } - - return configuration; -} - -- (BOOL)shouldHighlightBookmarkButtonForToolsMenuCoordinator: - (ToolsMenuCoordinator*)coordinator { - return [self.helper isWebStateBookmarked:self.currentWebState]; -} - -- (BOOL)shouldShowFindBarForToolsMenuCoordinator: - (ToolsMenuCoordinator*)coordinator { - return [_model currentTab] ? self.canShowFindBar : NO; -} - -- (BOOL)shouldShowShareMenuForToolsMenuCoordinator: - (ToolsMenuCoordinator*)coordinator { - return [_model currentTab] ? self.canShowShareMenu : NO; -} - -- (BOOL)isTabLoadingForToolsMenuCoordinator:(ToolsMenuCoordinator*)coordinator { - return ([_model currentTab] && !IsIPadIdiom()) - ? [self.helper isToolbarLoading:self.currentWebState] - : NO; -} - #pragma mark - BrowserCommands - (void)goBack {
diff --git a/ios/chrome/browser/ui/history/BUILD.gn b/ios/chrome/browser/ui/history/BUILD.gn index 24ca9b3..e7962c77 100644 --- a/ios/chrome/browser/ui/history/BUILD.gn +++ b/ios/chrome/browser/ui/history/BUILD.gn
@@ -148,6 +148,7 @@ "//ios/chrome/browser/ui:ui", "//ios/chrome/browser/ui/authentication:authentication_ui", "//ios/chrome/browser/ui/authentication:eg_test_support", + "//ios/chrome/browser/ui/popup_menu:constants", "//ios/chrome/browser/ui/settings", "//ios/chrome/browser/ui/table_view", "//ios/chrome/browser/ui/table_view/cells",
diff --git a/ios/chrome/browser/ui/history/history_ui_egtest.mm b/ios/chrome/browser/ui/history/history_ui_egtest.mm index 95cc0a2..cb97c38c 100644 --- a/ios/chrome/browser/ui/history/history_ui_egtest.mm +++ b/ios/chrome/browser/ui/history/history_ui_egtest.mm
@@ -18,10 +18,10 @@ #import "ios/chrome/browser/ui/authentication/signin_earlgrey_utils.h" #import "ios/chrome/browser/ui/authentication/signin_promo_view.h" #import "ios/chrome/browser/ui/history/history_ui_constants.h" +#import "ios/chrome/browser/ui/popup_menu/popup_menu_constants.h" #import "ios/chrome/browser/ui/settings/settings_collection_view_controller.h" #import "ios/chrome/browser/ui/table_view/cells/table_view_url_item.h" #import "ios/chrome/browser/ui/table_view/table_view_navigation_controller_constants.h" -#include "ios/chrome/browser/ui/tools_menu/public/tools_menu_constants.h" #import "ios/chrome/browser/ui/tools_menu/tools_popup_controller.h" #include "ios/chrome/browser/ui/ui_util.h" #import "ios/chrome/browser/ui/util/transparent_link_button.h"
diff --git a/ios/chrome/browser/ui/ntp/recent_tabs/views/BUILD.gn b/ios/chrome/browser/ui/ntp/recent_tabs/views/BUILD.gn index 2804b4ade..67d2c7c6 100644 --- a/ios/chrome/browser/ui/ntp/recent_tabs/views/BUILD.gn +++ b/ios/chrome/browser/ui/ntp/recent_tabs/views/BUILD.gn
@@ -31,17 +31,22 @@ ] deps = [ "//base", + "//components/browser_sync", "//components/resources", "//components/sessions", "//components/strings", + "//components/sync", + "//components/sync_sessions", "//ios/chrome/app/strings", + "//ios/chrome/app/theme:theme_grit", + "//ios/chrome/browser/browser_state", "//ios/chrome/browser/favicon", + "//ios/chrome/browser/sync", "//ios/chrome/browser/ui", "//ios/chrome/browser/ui/commands", "//ios/chrome/browser/ui/fancy_ui", "//ios/chrome/browser/ui/material_components", "//ios/chrome/browser/ui/settings/sync_utils", - "//ios/chrome/browser/ui/tab_switcher:utils", "//ios/chrome/common/favicon", "//ios/third_party/material_components_ios", "//ios/third_party/material_roboto_font_loader_ios",
diff --git a/ios/chrome/browser/ui/ntp/recent_tabs/views/session_tab_data_view.mm b/ios/chrome/browser/ui/ntp/recent_tabs/views/session_tab_data_view.mm index 173618a..4186c09 100644 --- a/ios/chrome/browser/ui/ntp/recent_tabs/views/session_tab_data_view.mm +++ b/ios/chrome/browser/ui/ntp/recent_tabs/views/session_tab_data_view.mm
@@ -12,7 +12,6 @@ #include "ios/chrome/browser/ui/ntp/recent_tabs/synced_sessions.h" #import "ios/chrome/browser/ui/ntp/recent_tabs/views/views_utils.h" #include "ios/chrome/browser/ui/rtl_geometry.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_utils.h" #import "ios/chrome/common/favicon/favicon_attributes.h" #import "ios/chrome/common/favicon/favicon_view.h" #import "ios/chrome/common/ui_util/constraints_ui_util.h" @@ -106,7 +105,7 @@ DCHECK(browserState); [_label setText:text]; self.accessibilityLabel = [_label accessibilityLabel]; - TabSwitcherGetFavicon(url, browserState, ^(FaviconAttributes* attributes) { + recent_tabs::GetFavicon(url, browserState, ^(FaviconAttributes* attributes) { [_favicon configureWithAttributes:attributes]; }); }
diff --git a/ios/chrome/browser/ui/ntp/recent_tabs/views/views_utils.h b/ios/chrome/browser/ui/ntp/recent_tabs/views/views_utils.h index 77628d4..73f5177 100644 --- a/ios/chrome/browser/ui/ntp/recent_tabs/views/views_utils.h +++ b/ios/chrome/browser/ui/ntp/recent_tabs/views/views_utils.h
@@ -7,6 +7,16 @@ #import <UIKit/UIKit.h> +class GURL; +@class FaviconAttributes; +@class UIImage; + +namespace ios { +class ChromeBrowserState; +} // namespace ios + +typedef void (^FaviconGetterCompletionBlock)(FaviconAttributes*); + namespace recent_tabs { // Returns an autoreleased UILabel. @@ -20,6 +30,10 @@ UIColor* GetIconColorBlue(); UIColor* GetIconColorGray(); +// Gets the favicon for |url|, calls |block| when loaded. +void GetFavicon(GURL const& url, + ios::ChromeBrowserState* browserState, + FaviconGetterCompletionBlock block); } // namespace recent_tabs #endif // IOS_CHROME_BROWSER_UI_NTP_RECENT_TABS_VIEWS_VIEWS_UTILS_H_
diff --git a/ios/chrome/browser/ui/ntp/recent_tabs/views/views_utils.mm b/ios/chrome/browser/ui/ntp/recent_tabs/views/views_utils.mm index 4cfd7d9..e8fb17fa 100644 --- a/ios/chrome/browser/ui/ntp/recent_tabs/views/views_utils.mm +++ b/ios/chrome/browser/ui/ntp/recent_tabs/views/views_utils.mm
@@ -5,7 +5,16 @@ #import "ios/chrome/browser/ui/ntp/recent_tabs/views/views_utils.h" #include "base/logging.h" +#include "components/browser_sync/profile_sync_service.h" +#include "components/sync/driver/sync_service.h" +#include "components/sync_sessions/open_tabs_ui_delegate.h" +#include "ios/chrome/browser/browser_state/chrome_browser_state.h" +#import "ios/chrome/browser/favicon/favicon_loader.h" +#include "ios/chrome/browser/favicon/ios_chrome_favicon_loader_factory.h" +#include "ios/chrome/browser/sync/profile_sync_service_factory.h" #import "ios/chrome/browser/ui/uikit_ui_util.h" +#import "ios/chrome/common/favicon/favicon_attributes.h" +#include "ios/chrome/grit/ios_theme_resources.h" #import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -26,10 +35,19 @@ const int kIconColorBlue = 0x4285f4; const int kIconColorGray = 0x5a5a5a; +// Desired width and height of favicon. +const CGFloat kfaviconWidthHeight = 24; +// Minimum favicon pixel size to retrieve. +const CGFloat kfaviconMinWidthHeight = 16; + } // namespace namespace recent_tabs { +UIImage* DefaultFaviconImage() { + return NativeImage(IDR_IOS_OMNIBOX_HTTP); +} + UILabel* CreateMultilineLabel(NSString* text) { UILabel* label = [[UILabel alloc] initWithFrame:CGRectZero]; [label setTranslatesAutoresizingMaskIntoConstraints:NO]; @@ -67,4 +85,49 @@ return UIColorFromRGB(kIconColorGray); } +void GetFavicon(GURL const& url, + ios::ChromeBrowserState* browser_state, + FaviconGetterCompletionBlock block) { + DCHECK(browser_state); + syncer::SyncService* sync_service = + ProfileSyncServiceFactory::GetForBrowserState(browser_state); + sync_sessions::OpenTabsUIDelegate* open_tabs = + sync_service ? sync_service->GetOpenTabsUIDelegate() : NULL; + scoped_refptr<base::RefCountedMemory> favicon; + if (open_tabs && + open_tabs->GetSyncedFaviconForPageURL(url.spec(), &favicon)) { + dispatch_queue_t queue = + dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0); + dispatch_async(queue, ^{ + NSData* pngData = + [NSData dataWithBytes:favicon->front() length:favicon->size()]; + UIImage* image = [[UIImage alloc] initWithData:pngData]; + dispatch_async(dispatch_get_main_queue(), ^{ + // |UIImage initWithData:| may return nil. + if (image) { + block([FaviconAttributes attributesWithImage:image]); + } else { + block([FaviconAttributes attributesWithImage:DefaultFaviconImage()]); + } + }); + }); + block([FaviconAttributes attributesWithImage:DefaultFaviconImage()]); + return; + } + + // Use the FaviconCache if there is no synced favicon. + FaviconLoader* loader = + IOSChromeFaviconLoaderFactory::GetForBrowserState(browser_state); + if (loader) { + FaviconAttributes* attr = + loader->FaviconForUrl(url, kfaviconMinWidthHeight, kfaviconWidthHeight, + /*fallback_to_google_server=*/false, block); + DCHECK(attr); + block(attr); + return; + } + // Finally returns a default image. + block([FaviconAttributes attributesWithImage:DefaultFaviconImage()]); +} + } // namespace recent_tabs
diff --git a/ios/chrome/browser/ui/payments/BUILD.gn b/ios/chrome/browser/ui/payments/BUILD.gn index 6b5816c7..ce5578c 100644 --- a/ios/chrome/browser/ui/payments/BUILD.gn +++ b/ios/chrome/browser/ui/payments/BUILD.gn
@@ -267,6 +267,7 @@ "//ios/chrome/browser/payments", "//ios/chrome/browser/ui/autofill", "//ios/chrome/browser/ui/payments/cells", + "//ios/chrome/browser/ui/popup_menu:constants", "//ios/chrome/browser/ui/tools_menu/public", "//ios/chrome/test/app:test_support", "//ios/chrome/test/earl_grey:test_support",
diff --git a/ios/chrome/browser/ui/payments/payment_request_can_make_payment_egtest.mm b/ios/chrome/browser/ui/payments/payment_request_can_make_payment_egtest.mm index b113189a..932a9b1 100644 --- a/ios/chrome/browser/ui/payments/payment_request_can_make_payment_egtest.mm +++ b/ios/chrome/browser/ui/payments/payment_request_can_make_payment_egtest.mm
@@ -9,7 +9,7 @@ #include "components/prefs/pref_service.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h" #import "ios/chrome/browser/ui/payments/payment_request_egtest_base.h" -#include "ios/chrome/browser/ui/tools_menu/public/tools_menu_constants.h" +#import "ios/chrome/browser/ui/popup_menu/popup_menu_constants.h" #import "ios/chrome/test/app/chrome_test_util.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h"
diff --git a/ios/chrome/browser/ui/popup_menu/BUILD.gn b/ios/chrome/browser/ui/popup_menu/BUILD.gn index 0e4f75c..c0be14d6 100644 --- a/ios/chrome/browser/ui/popup_menu/BUILD.gn +++ b/ios/chrome/browser/ui/popup_menu/BUILD.gn
@@ -150,13 +150,19 @@ testonly = true sources = [ "popup_menu_egtest.mm", + "request_desktop_mobile_site_egtest.mm", ] deps = [ "//base", "//components/strings", + "//ios/chrome/app/strings", + "//ios/chrome/browser/ui:ui_internal", + "//ios/chrome/browser/ui:ui_util", + "//ios/chrome/browser/ui/popup_menu:constants", "//ios/chrome/test/app:test_support", "//ios/chrome/test/earl_grey:test_support", "//ios/web/public/test", "//ios/web/public/test/http_server", + "//ui/base", ] }
diff --git a/ios/chrome/browser/ui/popup_menu/popup_menu_constants.h b/ios/chrome/browser/ui/popup_menu/popup_menu_constants.h index 68abfb7..00fea5b 100644 --- a/ios/chrome/browser/ui/popup_menu/popup_menu_constants.h +++ b/ios/chrome/browser/ui/popup_menu/popup_menu_constants.h
@@ -19,4 +19,54 @@ // Radius for the rounded corner of the popup menu. extern const CGFloat kPopupMenuCornerRadius; +// Tools Menu item IDs. +// Reload item accessibility Identifier. +extern NSString* const kToolsMenuReload; +// Stop item accessibility Identifier. +extern NSString* const kToolsMenuStop; +// New Tab item accessibility Identifier. +extern NSString* const kToolsMenuNewTabId; +// New incognito Tab item accessibility Identifier. +extern NSString* const kToolsMenuNewIncognitoTabId; +// Close all Tabs item accessibility Identifier. +extern NSString* const kToolsMenuCloseAllTabsId; +// Close all incognito Tabs item accessibility Identifier. +extern NSString* const kToolsMenuCloseAllIncognitoTabsId; +// Close the current tab item accessibility Identifier. +extern NSString* const kToolsMenuCloseTabId; +// Bookmarks item accessibility Identifier. +extern NSString* const kToolsMenuBookmarksId; +// Reading List item accessibility Identifier. +extern NSString* const kToolsMenuReadingListId; +// Other Devices item accessibility Identifier. +extern NSString* const kToolsMenuOtherDevicesId; +// History item accessibility Identifier. +extern NSString* const kToolsMenuHistoryId; +// Report an issue item accessibility Identifier. +extern NSString* const kToolsMenuReportAnIssueId; +// Find in Page item accessibility Identifier. +extern NSString* const kToolsMenuFindInPageId; +// Request desktop item accessibility Identifier. +extern NSString* const kToolsMenuRequestDesktopId; +// Settings item accessibility Identifier. +extern NSString* const kToolsMenuSettingsId; +// Help item accessibility Identifier. +extern NSString* const kToolsMenuHelpId; +// Request mobile item accessibility Identifier. +extern NSString* const kToolsMenuRequestMobileId; +// ReadLater item accessibility Identifier. +extern NSString* const kToolsMenuReadLater; +// AddBookmark item accessibility Identifier. +extern NSString* const kToolsMenuAddToBookmarks; +// EditBookmark item accessibility Identifier. +extern NSString* const kToolsMenuEditBookmark; +// SiteInformation item accessibility Identifier. +extern NSString* const kToolsMenuSiteInformation; +// Paste and Go item accessibility Identifier. +extern NSString* const kToolsMenuPasteAndGo; +// Voice Search item accessibility Identifier. +extern NSString* const kToolsMenuVoiceSearch; +// QR Code Search item accessibility Identifier. +extern NSString* const kToolsMenuQRCodeSearch; + #endif // IOS_CHROME_BROWSER_UI_POPUP_MENU_POPUP_MENU_CONSTANTS_H_
diff --git a/ios/chrome/browser/ui/popup_menu/popup_menu_constants.mm b/ios/chrome/browser/ui/popup_menu/popup_menu_constants.mm index 51298375..ad7d7bc4 100644 --- a/ios/chrome/browser/ui/popup_menu/popup_menu_constants.mm +++ b/ios/chrome/browser/ui/popup_menu/popup_menu_constants.mm
@@ -17,3 +17,30 @@ const CGFloat kHighlightAnimationDuration = 0.5; const CGFloat kPopupMenuCornerRadius = 13; + +// Tools menu item IDs. +NSString* const kToolsMenuReload = @"kToolsMenuReload"; +NSString* const kToolsMenuStop = @"kToolsMenuStop"; +NSString* const kToolsMenuNewTabId = @"kToolsMenuNewTabId"; +NSString* const kToolsMenuNewIncognitoTabId = @"kToolsMenuNewIncognitoTabId"; +NSString* const kToolsMenuCloseAllTabsId = @"kToolsMenuCloseAllTabsId"; +NSString* const kToolsMenuCloseAllIncognitoTabsId = + @"kToolsMenuCloseAllIncognitoTabsId"; +NSString* const kToolsMenuCloseTabId = @"kToolsMenuCloseTabId"; +NSString* const kToolsMenuBookmarksId = @"kToolsMenuBookmarksId"; +NSString* const kToolsMenuReadingListId = @"kToolsMenuReadingListId"; +NSString* const kToolsMenuOtherDevicesId = @"kToolsMenuOtherDevicesId"; +NSString* const kToolsMenuHistoryId = @"kToolsMenuHistoryId"; +NSString* const kToolsMenuReportAnIssueId = @"kToolsMenuReportAnIssueId"; +NSString* const kToolsMenuFindInPageId = @"kToolsMenuFindInPageId"; +NSString* const kToolsMenuRequestDesktopId = @"kToolsMenuRequestDesktopId"; +NSString* const kToolsMenuSettingsId = @"kToolsMenuSettingsId"; +NSString* const kToolsMenuHelpId = @"kToolsMenuHelpId"; +NSString* const kToolsMenuRequestMobileId = @"kToolsMenuRequestMobileId"; +NSString* const kToolsMenuReadLater = @"kToolsMenuReadLater"; +NSString* const kToolsMenuAddToBookmarks = @"kToolsMenuAddToBookmarks"; +NSString* const kToolsMenuEditBookmark = @"kToolsMenuEditBookmark"; +NSString* const kToolsMenuSiteInformation = @"kToolsMenuSiteInformation"; +NSString* const kToolsMenuPasteAndGo = @"kToolsMenuPasteAndGo"; +NSString* const kToolsMenuVoiceSearch = @"kToolsMenuVoiceSearch"; +NSString* const kToolsMenuQRCodeSearch = @"kToolsMenuQRCodeSearch";
diff --git a/ios/chrome/browser/ui/popup_menu/popup_menu_egtest.mm b/ios/chrome/browser/ui/popup_menu/popup_menu_egtest.mm index b9b5561..c77ae2b 100644 --- a/ios/chrome/browser/ui/popup_menu/popup_menu_egtest.mm +++ b/ios/chrome/browser/ui/popup_menu/popup_menu_egtest.mm
@@ -5,23 +5,35 @@ #import <XCTest/XCTest.h> #include "base/strings/sys_string_conversions.h" +#import "ios/chrome/browser/ui/popup_menu/popup_menu_constants.h" +#include "ios/chrome/grit/ios_strings.h" +#include "ios/chrome/test/earl_grey/accessibility_util.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey.h" +#import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h" #import "ios/chrome/test/earl_grey/chrome_matchers.h" #import "ios/chrome/test/earl_grey/chrome_test_case.h" #import "ios/web/public/test/http_server/http_server.h" #import "ios/web/public/test/http_server/http_server_util.h" +#include "ios/web/public/test/http_server/http_server_util.h" #include "ios/web/public/test/url_test_util.h" +#include "ui/base/l10n/l10n_util.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." #endif +namespace { +const char kPDFURL[] = "http://ios/testing/data/http_server_files/testpage.pdf"; +} // namespace + // Tests for the popup menus. @interface PopupMenuTestCase : ChromeTestCase @end @implementation PopupMenuTestCase +#pragma mark - TabHistory + // Test that the tab history back and forward menus contain the expected entries // for a series of navigations, and that tapping entries performs the // appropriate navigation. @@ -90,4 +102,43 @@ assertWithMatcher:grey_notNil()]; } +#pragma mark - Tools Menu + +// Tests that the menu is closed when tapping the close button or the scrim. +- (void)testOpenAndCloseToolsMenu { + [ChromeEarlGreyUI openToolsMenu]; + + // A scrim covers the whole window and tapping on this scrim dismisses the + // tools menu. The "Tools Menu" button happens to be outside of the bounds of + // the menu and is a convenient place to tap to activate the scrim. + [[EarlGrey selectElementWithMatcher:chrome_test_util::ToolsMenuButton()] + performAction:grey_tap()]; + + [[EarlGrey selectElementWithMatcher:chrome_test_util::ToolsMenuView()] + assertWithMatcher:grey_notVisible()]; +} + +// Navigates to a pdf page and verifies that the "Find in Page..." tool +// is not enabled +- (void)testNoSearchForPDF { + web::test::SetUpFileBasedHttpServer(); + const GURL URL = web::test::HttpServer::MakeUrl(kPDFURL); + + // Navigate to a mock pdf and verify that the find button is disabled. + [ChromeEarlGrey loadURL:URL]; + [ChromeEarlGreyUI openToolsMenu]; + [[EarlGrey + selectElementWithMatcher:grey_accessibilityID(kToolsMenuFindInPageId)] + assertWithMatcher:grey_accessibilityTrait( + UIAccessibilityTraitNotEnabled)]; +} + +// Open tools menu and verify elements are accessible. +- (void)testAccessibilityOnToolsMenu { + [ChromeEarlGreyUI openToolsMenu]; + chrome_test_util::VerifyAccessibilityForCurrentScreen(); + // Close Tools menu. + [ChromeTestCase removeAnyOpenMenusAndInfoBars]; +} + @end
diff --git a/ios/chrome/browser/ui/tools_menu/request_desktop_mobile_site_egtest.mm b/ios/chrome/browser/ui/popup_menu/request_desktop_mobile_site_egtest.mm similarity index 98% rename from ios/chrome/browser/ui/tools_menu/request_desktop_mobile_site_egtest.mm rename to ios/chrome/browser/ui/popup_menu/request_desktop_mobile_site_egtest.mm index 3328c41..3f5eefc7 100644 --- a/ios/chrome/browser/ui/tools_menu/request_desktop_mobile_site_egtest.mm +++ b/ios/chrome/browser/ui/popup_menu/request_desktop_mobile_site_egtest.mm
@@ -7,10 +7,8 @@ #include "base/strings/sys_string_conversions.h" #include "components/strings/grit/components_strings.h" -#include "ios/chrome/browser/experimental_flags.h" #import "ios/chrome/browser/ui/chrome_web_view_factory.h" #import "ios/chrome/browser/ui/popup_menu/popup_menu_constants.h" -#include "ios/chrome/browser/ui/tools_menu/public/tools_menu_constants.h" #import "ios/chrome/browser/ui/uikit_ui_util.h" #include "ios/chrome/grit/ios_strings.h" #import "ios/chrome/test/earl_grey/accessibility_util.h"
diff --git a/ios/chrome/browser/ui/sad_tab/BUILD.gn b/ios/chrome/browser/ui/sad_tab/BUILD.gn index 53b065c6..2dc0f720 100644 --- a/ios/chrome/browser/ui/sad_tab/BUILD.gn +++ b/ios/chrome/browser/ui/sad_tab/BUILD.gn
@@ -55,6 +55,7 @@ "//base", "//components/strings", "//ios/chrome/app/strings", + "//ios/chrome/browser/ui/popup_menu:constants", "//ios/chrome/browser/ui/tools_menu/public", "//ios/chrome/test/app:test_support", "//ios/chrome/test/earl_grey:test_support",
diff --git a/ios/chrome/browser/ui/sad_tab/sad_tab_view_egtest.mm b/ios/chrome/browser/ui/sad_tab/sad_tab_view_egtest.mm index 61ba632d..3fc9d82 100644 --- a/ios/chrome/browser/ui/sad_tab/sad_tab_view_egtest.mm +++ b/ios/chrome/browser/ui/sad_tab/sad_tab_view_egtest.mm
@@ -6,7 +6,7 @@ #import <XCTest/XCTest.h> #include "components/strings/grit/components_strings.h" -#include "ios/chrome/browser/ui/tools_menu/public/tools_menu_constants.h" +#import "ios/chrome/browser/ui/popup_menu/popup_menu_constants.h" #import "ios/chrome/test/app/chrome_test_util.h" #import "ios/chrome/test/app/navigation_test_util.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey.h"
diff --git a/ios/chrome/browser/ui/tab_switcher/BUILD.gn b/ios/chrome/browser/ui/tab_switcher/BUILD.gn deleted file mode 100644 index bcab8d4..0000000 --- a/ios/chrome/browser/ui/tab_switcher/BUILD.gn +++ /dev/null
@@ -1,180 +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. - -source_set("tab_switcher") { - configs += [ "//build/config/compiler:enable_arc" ] - sources = [ - "tab_model_snapshot.h", - "tab_model_snapshot.mm", - "tab_switcher_button.h", - "tab_switcher_button.mm", - "tab_switcher_cache.h", - "tab_switcher_cache.mm", - "tab_switcher_controller.h", - "tab_switcher_controller.mm", - "tab_switcher_header_cell.h", - "tab_switcher_header_cell.mm", - "tab_switcher_header_view.h", - "tab_switcher_header_view.mm", - "tab_switcher_model.h", - "tab_switcher_model.mm", - "tab_switcher_model_private.h", - "tab_switcher_panel_cell.h", - "tab_switcher_panel_cell.mm", - "tab_switcher_panel_collection_view_layout.h", - "tab_switcher_panel_collection_view_layout.mm", - "tab_switcher_panel_controller.h", - "tab_switcher_panel_controller.mm", - "tab_switcher_panel_overlay_view.h", - "tab_switcher_panel_overlay_view.mm", - "tab_switcher_panel_view.h", - "tab_switcher_panel_view.mm", - "tab_switcher_session_cell_data.h", - "tab_switcher_session_cell_data.mm", - "tab_switcher_session_changes.h", - "tab_switcher_session_changes.mm", - "tab_switcher_transition_context.h", - "tab_switcher_transition_context.mm", - "tab_switcher_view.h", - "tab_switcher_view.mm", - ] - deps = [ - ":utils", - "resources:tabswitcher_full_history", - "resources:tabswitcher_incognito", - "resources:tabswitcher_laptop", - "resources:tabswitcher_menu", - "resources:tabswitcher_new_tab", - "resources:tabswitcher_new_tab_fab", - "resources:tabswitcher_open_tabs", - "resources:tabswitcher_other_devices", - "resources:tabswitcher_overflow_arrow", - "resources:tabswitcher_phone", - "resources:tabswitcher_recently_closed", - "resources:tabswitcher_tab_switcher_button", - "resources:tabswitcher_tab_switcher_count_button", - "resources:tabswitcher_tab_switcher_count_button_pressed", - "resources:tabswitcher_tablet", - "//base", - "//components/browser_sync", - "//components/favicon/ios", - "//components/sessions", - "//components/signin/core/browser", - "//components/sync", - "//components/sync_sessions", - "//ios/chrome/app/strings", - "//ios/chrome/app/theme", - "//ios/chrome/browser", - "//ios/chrome/browser/browser_state", - "//ios/chrome/browser/favicon", - "//ios/chrome/browser/feature_engagement", - "//ios/chrome/browser/metrics:metrics_internal", - "//ios/chrome/browser/sessions", - "//ios/chrome/browser/sessions:serialisation", - "//ios/chrome/browser/signin", - "//ios/chrome/browser/snapshots", - "//ios/chrome/browser/sync", - "//ios/chrome/browser/tabs", - "//ios/chrome/browser/ui", - "//ios/chrome/browser/ui:ui_internal", - "//ios/chrome/browser/ui/authentication", - "//ios/chrome/browser/ui/authentication:authentication_ui", - "//ios/chrome/browser/ui/colors", - "//ios/chrome/browser/ui/commands", - "//ios/chrome/browser/ui/image_util", - "//ios/chrome/browser/ui/keyboard", - "//ios/chrome/browser/ui/main:tab_switcher", - "//ios/chrome/browser/ui/material_components", - "//ios/chrome/browser/ui/ntp/recent_tabs/views", - "//ios/chrome/browser/ui/settings/sync_utils", - "//ios/chrome/browser/ui/signin_interaction/public", - "//ios/chrome/browser/ui/tabs/requirements", - "//ios/chrome/browser/ui/toolbar:toolbar_ui", - "//ios/chrome/browser/web", - "//ios/chrome/browser/web_state_list", - "//ios/chrome/common:ios_app_bundle_id_prefix_buildflags", - "//ios/chrome/common/favicon", - "//ios/public/provider/chrome/browser", - "//ios/third_party/material_components_ios", - "//ios/third_party/material_roboto_font_loader_ios", - "//ios/third_party/material_text_accessibility_ios", - "//ios/web", - "//ui/base", - "//ui/gfx", - "//url", - ] - public_deps = [ - "//ios/chrome/browser/ui/ntp/recent_tabs", - ] - libs = [ - "QuartzCore.framework", - "UIKit.framework", - ] -} - -source_set("utils") { - configs += [ "//build/config/compiler:enable_arc" ] - sources = [ - "tab_switcher_utils.h", - "tab_switcher_utils.mm", - ] - deps = [ - "//base", - "//components/browser_sync", - "//components/sync", - "//components/sync_sessions", - "//ios/chrome/app/strings", - "//ios/chrome/app/theme", - "//ios/chrome/browser/browser_state", - "//ios/chrome/browser/favicon", - "//ios/chrome/browser/sync", - "//ios/chrome/browser/ui", - "//ios/chrome/common/favicon", - "//ui/base", - ] -} - -source_set("egtest_support") { - testonly = true - sources = [ - "tab_switcher_egtest_util.h", - "tab_switcher_egtest_util.mm", - ] - - configs += [ "//build/config/compiler:enable_arc" ] - - deps = [ - "//base", - "//base/test:test_support", - "//ios/chrome/app/strings", - "//ios/chrome/browser/ui/tools_menu/public", - "//ios/chrome/test/app:test_support", - "//ios/chrome/test/earl_grey:test_support", - "//ios/third_party/earl_grey:earl_grey+link", - "//ui/base", - ] -} - -source_set("unit_tests") { - configs += [ "//build/config/compiler:enable_arc" ] - testonly = true - sources = [ - "tab_model_snapshot_unittest.mm", - "tab_switcher_model_unittest.mm", - "tab_switcher_utils_unittest.mm", - ] - deps = [ - ":tab_switcher", - ":utils", - "//base", - "//ios/chrome/browser/browser_state:test_support", - "//ios/chrome/browser/tabs", - "//ios/chrome/browser/ui/ntp/recent_tabs", - "//ios/chrome/browser/web_state_list", - "//ios/chrome/browser/web_state_list:test_support", - "//ios/web/public/test/fakes", - "//testing/gtest", - "//third_party/ocmock", - ] -}
diff --git a/ios/chrome/browser/ui/tab_switcher/OWNERS b/ios/chrome/browser/ui/tab_switcher/OWNERS deleted file mode 100644 index e2b64c4..0000000 --- a/ios/chrome/browser/ui/tab_switcher/OWNERS +++ /dev/null
@@ -1,5 +0,0 @@ -edchin@chromium.org -jif@chromium.org - -# TEAM: ios-directory-owners@chromium.org -# OS: iOS
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/BUILD.gn b/ios/chrome/browser/ui/tab_switcher/resources/BUILD.gn deleted file mode 100644 index 62c0b85..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/BUILD.gn +++ /dev/null
@@ -1,138 +0,0 @@ -# Copyright 2017 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//build/config/ios/asset_catalog.gni") - -imageset("tabswitcher_full_history") { - sources = [ - "tabswitcher_full_history.imageset/Contents.json", - "tabswitcher_full_history.imageset/tabswitcher_full_history.png", - "tabswitcher_full_history.imageset/tabswitcher_full_history@2x.png", - "tabswitcher_full_history.imageset/tabswitcher_full_history@3x.png", - ] -} - -imageset("tabswitcher_incognito") { - sources = [ - "tabswitcher_incognito.imageset/Contents.json", - "tabswitcher_incognito.imageset/tabswitcher_incognito.png", - "tabswitcher_incognito.imageset/tabswitcher_incognito@2x.png", - "tabswitcher_incognito.imageset/tabswitcher_incognito@3x.png", - ] -} - -imageset("tabswitcher_laptop") { - sources = [ - "tabswitcher_laptop.imageset/Contents.json", - "tabswitcher_laptop.imageset/tabswitcher_laptop.png", - "tabswitcher_laptop.imageset/tabswitcher_laptop@2x.png", - "tabswitcher_laptop.imageset/tabswitcher_laptop@3x.png", - ] -} - -imageset("tabswitcher_menu") { - sources = [ - "tabswitcher_menu.imageset/Contents.json", - "tabswitcher_menu.imageset/tabswitcher_menu.png", - "tabswitcher_menu.imageset/tabswitcher_menu@2x.png", - "tabswitcher_menu.imageset/tabswitcher_menu@3x.png", - ] -} - -imageset("tabswitcher_new_tab") { - sources = [ - "tabswitcher_new_tab.imageset/Contents.json", - "tabswitcher_new_tab.imageset/tabswitcher_new_tab.png", - "tabswitcher_new_tab.imageset/tabswitcher_new_tab@2x.png", - "tabswitcher_new_tab.imageset/tabswitcher_new_tab@3x.png", - ] -} - -imageset("tabswitcher_new_tab_fab") { - sources = [ - "tabswitcher_new_tab_fab.imageset/Contents.json", - "tabswitcher_new_tab_fab.imageset/tabswitcher_new_tab_fab.png", - "tabswitcher_new_tab_fab.imageset/tabswitcher_new_tab_fab@2x.png", - "tabswitcher_new_tab_fab.imageset/tabswitcher_new_tab_fab@3x.png", - ] -} - -imageset("tabswitcher_open_tabs") { - sources = [ - "tabswitcher_open_tabs.imageset/Contents.json", - "tabswitcher_open_tabs.imageset/tabswitcher_open_tabs.png", - "tabswitcher_open_tabs.imageset/tabswitcher_open_tabs@2x.png", - "tabswitcher_open_tabs.imageset/tabswitcher_open_tabs@3x.png", - ] -} - -imageset("tabswitcher_other_devices") { - sources = [ - "tabswitcher_other_devices.imageset/Contents.json", - "tabswitcher_other_devices.imageset/tabswitcher_other_devices.png", - "tabswitcher_other_devices.imageset/tabswitcher_other_devices@2x.png", - "tabswitcher_other_devices.imageset/tabswitcher_other_devices@3x.png", - ] -} - -imageset("tabswitcher_overflow_arrow") { - sources = [ - "tabswitcher_overflow_arrow.imageset/Contents.json", - "tabswitcher_overflow_arrow.imageset/tabswitcher_overflow_arrow.png", - "tabswitcher_overflow_arrow.imageset/tabswitcher_overflow_arrow@2x.png", - "tabswitcher_overflow_arrow.imageset/tabswitcher_overflow_arrow@3x.png", - ] -} - -imageset("tabswitcher_phone") { - sources = [ - "tabswitcher_phone.imageset/Contents.json", - "tabswitcher_phone.imageset/tabswitcher_phone.png", - "tabswitcher_phone.imageset/tabswitcher_phone@2x.png", - "tabswitcher_phone.imageset/tabswitcher_phone@3x.png", - ] -} - -imageset("tabswitcher_recently_closed") { - sources = [ - "tabswitcher_recently_closed.imageset/Contents.json", - "tabswitcher_recently_closed.imageset/tabswitcher_recently_closed.png", - "tabswitcher_recently_closed.imageset/tabswitcher_recently_closed@2x.png", - "tabswitcher_recently_closed.imageset/tabswitcher_recently_closed@3x.png", - ] -} - -imageset("tabswitcher_tab_switcher_button") { - sources = [ - "tabswitcher_tab_switcher_button.imageset/Contents.json", - "tabswitcher_tab_switcher_button.imageset/tabswitcher_tab_switcher_button.png", - "tabswitcher_tab_switcher_button.imageset/tabswitcher_tab_switcher_button@2x.png", - "tabswitcher_tab_switcher_button.imageset/tabswitcher_tab_switcher_button@3x.png", - ] -} - -imageset("tabswitcher_tab_switcher_count_button") { - sources = [ - "tabswitcher_tab_switcher_count_button.imageset/Contents.json", - "tabswitcher_tab_switcher_count_button.imageset/tabswitcher_tab_switcher_count_button.png", - "tabswitcher_tab_switcher_count_button.imageset/tabswitcher_tab_switcher_count_button@2x.png", - ] -} - -imageset("tabswitcher_tab_switcher_count_button_pressed") { - sources = [ - "tabswitcher_tab_switcher_count_button_pressed.imageset/Contents.json", - "tabswitcher_tab_switcher_count_button_pressed.imageset/tabswitcher_tab_switcher_count_button_pressed.png", - "tabswitcher_tab_switcher_count_button_pressed.imageset/tabswitcher_tab_switcher_count_button_pressed@2x.png", - ] -} - -imageset("tabswitcher_tablet") { - sources = [ - "tabswitcher_tablet.imageset/Contents.json", - "tabswitcher_tablet.imageset/tabswitcher_tablet.png", - "tabswitcher_tablet.imageset/tabswitcher_tablet@2x.png", - "tabswitcher_tablet.imageset/tabswitcher_tablet@3x.png", - ] -}
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_full_history.imageset/Contents.json b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_full_history.imageset/Contents.json deleted file mode 100644 index 5d40c23..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_full_history.imageset/Contents.json +++ /dev/null
@@ -1,23 +0,0 @@ -{ - "images": [ - { - "idiom": "universal", - "scale": "1x", - "filename": "tabswitcher_full_history.png" - }, - { - "idiom": "universal", - "scale": "2x", - "filename": "tabswitcher_full_history@2x.png" - }, - { - "idiom": "universal", - "scale": "3x", - "filename": "tabswitcher_full_history@3x.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_full_history.imageset/tabswitcher_full_history.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_full_history.imageset/tabswitcher_full_history.png deleted file mode 100644 index d94c2b9b..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_full_history.imageset/tabswitcher_full_history.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_full_history.imageset/tabswitcher_full_history@2x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_full_history.imageset/tabswitcher_full_history@2x.png deleted file mode 100644 index 92fda273..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_full_history.imageset/tabswitcher_full_history@2x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_full_history.imageset/tabswitcher_full_history@3x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_full_history.imageset/tabswitcher_full_history@3x.png deleted file mode 100644 index c4e660c9..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_full_history.imageset/tabswitcher_full_history@3x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_incognito.imageset/Contents.json b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_incognito.imageset/Contents.json deleted file mode 100644 index c067dadc..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_incognito.imageset/Contents.json +++ /dev/null
@@ -1,23 +0,0 @@ -{ - "images": [ - { - "idiom": "universal", - "scale": "1x", - "filename": "tabswitcher_incognito.png" - }, - { - "idiom": "universal", - "scale": "2x", - "filename": "tabswitcher_incognito@2x.png" - }, - { - "idiom": "universal", - "scale": "3x", - "filename": "tabswitcher_incognito@3x.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_incognito.imageset/tabswitcher_incognito.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_incognito.imageset/tabswitcher_incognito.png deleted file mode 100644 index 3254dbc..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_incognito.imageset/tabswitcher_incognito.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_incognito.imageset/tabswitcher_incognito@2x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_incognito.imageset/tabswitcher_incognito@2x.png deleted file mode 100644 index e2134c7f..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_incognito.imageset/tabswitcher_incognito@2x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_incognito.imageset/tabswitcher_incognito@3x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_incognito.imageset/tabswitcher_incognito@3x.png deleted file mode 100644 index eba8f55c..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_incognito.imageset/tabswitcher_incognito@3x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_laptop.imageset/Contents.json b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_laptop.imageset/Contents.json deleted file mode 100644 index 3362943..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_laptop.imageset/Contents.json +++ /dev/null
@@ -1,23 +0,0 @@ -{ - "images": [ - { - "idiom": "universal", - "scale": "1x", - "filename": "tabswitcher_laptop.png" - }, - { - "idiom": "universal", - "scale": "2x", - "filename": "tabswitcher_laptop@2x.png" - }, - { - "idiom": "universal", - "scale": "3x", - "filename": "tabswitcher_laptop@3x.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_laptop.imageset/tabswitcher_laptop.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_laptop.imageset/tabswitcher_laptop.png deleted file mode 100644 index 72dde0e8..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_laptop.imageset/tabswitcher_laptop.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_laptop.imageset/tabswitcher_laptop@2x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_laptop.imageset/tabswitcher_laptop@2x.png deleted file mode 100644 index 2c58442..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_laptop.imageset/tabswitcher_laptop@2x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_laptop.imageset/tabswitcher_laptop@3x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_laptop.imageset/tabswitcher_laptop@3x.png deleted file mode 100644 index 11ece404..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_laptop.imageset/tabswitcher_laptop@3x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_menu.imageset/Contents.json b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_menu.imageset/Contents.json deleted file mode 100644 index 7289ac2..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_menu.imageset/Contents.json +++ /dev/null
@@ -1,23 +0,0 @@ -{ - "images": [ - { - "idiom": "universal", - "scale": "1x", - "filename": "tabswitcher_menu.png" - }, - { - "idiom": "universal", - "scale": "2x", - "filename": "tabswitcher_menu@2x.png" - }, - { - "idiom": "universal", - "scale": "3x", - "filename": "tabswitcher_menu@3x.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_menu.imageset/tabswitcher_menu.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_menu.imageset/tabswitcher_menu.png deleted file mode 100644 index 19f0810..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_menu.imageset/tabswitcher_menu.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_menu.imageset/tabswitcher_menu@2x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_menu.imageset/tabswitcher_menu@2x.png deleted file mode 100644 index 2c2a377..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_menu.imageset/tabswitcher_menu@2x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_menu.imageset/tabswitcher_menu@3x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_menu.imageset/tabswitcher_menu@3x.png deleted file mode 100644 index f3c4d07d..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_menu.imageset/tabswitcher_menu@3x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab.imageset/Contents.json b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab.imageset/Contents.json deleted file mode 100644 index ca669cf..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab.imageset/Contents.json +++ /dev/null
@@ -1,23 +0,0 @@ -{ - "images": [ - { - "idiom": "universal", - "scale": "1x", - "filename": "tabswitcher_new_tab.png" - }, - { - "idiom": "universal", - "scale": "2x", - "filename": "tabswitcher_new_tab@2x.png" - }, - { - "idiom": "universal", - "scale": "3x", - "filename": "tabswitcher_new_tab@3x.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab.imageset/tabswitcher_new_tab.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab.imageset/tabswitcher_new_tab.png deleted file mode 100644 index daf78ca3..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab.imageset/tabswitcher_new_tab.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab.imageset/tabswitcher_new_tab@2x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab.imageset/tabswitcher_new_tab@2x.png deleted file mode 100644 index 2fdbda4..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab.imageset/tabswitcher_new_tab@2x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab.imageset/tabswitcher_new_tab@3x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab.imageset/tabswitcher_new_tab@3x.png deleted file mode 100644 index f62d160c..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab.imageset/tabswitcher_new_tab@3x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab_fab.imageset/Contents.json b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab_fab.imageset/Contents.json deleted file mode 100644 index 89e117e..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab_fab.imageset/Contents.json +++ /dev/null
@@ -1,23 +0,0 @@ -{ - "images": [ - { - "idiom": "universal", - "scale": "1x", - "filename": "tabswitcher_new_tab_fab.png" - }, - { - "idiom": "universal", - "scale": "2x", - "filename": "tabswitcher_new_tab_fab@2x.png" - }, - { - "idiom": "universal", - "scale": "3x", - "filename": "tabswitcher_new_tab_fab@3x.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab_fab.imageset/tabswitcher_new_tab_fab.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab_fab.imageset/tabswitcher_new_tab_fab.png deleted file mode 100644 index 8b1724a5..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab_fab.imageset/tabswitcher_new_tab_fab.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab_fab.imageset/tabswitcher_new_tab_fab@2x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab_fab.imageset/tabswitcher_new_tab_fab@2x.png deleted file mode 100644 index f359f73..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab_fab.imageset/tabswitcher_new_tab_fab@2x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab_fab.imageset/tabswitcher_new_tab_fab@3x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab_fab.imageset/tabswitcher_new_tab_fab@3x.png deleted file mode 100644 index 221f6b3c..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_new_tab_fab.imageset/tabswitcher_new_tab_fab@3x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_open_tabs.imageset/Contents.json b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_open_tabs.imageset/Contents.json deleted file mode 100644 index 4292079b..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_open_tabs.imageset/Contents.json +++ /dev/null
@@ -1,23 +0,0 @@ -{ - "images": [ - { - "idiom": "universal", - "scale": "1x", - "filename": "tabswitcher_open_tabs.png" - }, - { - "idiom": "universal", - "scale": "2x", - "filename": "tabswitcher_open_tabs@2x.png" - }, - { - "idiom": "universal", - "scale": "3x", - "filename": "tabswitcher_open_tabs@3x.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_open_tabs.imageset/tabswitcher_open_tabs.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_open_tabs.imageset/tabswitcher_open_tabs.png deleted file mode 100644 index 5e77c83..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_open_tabs.imageset/tabswitcher_open_tabs.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_open_tabs.imageset/tabswitcher_open_tabs@2x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_open_tabs.imageset/tabswitcher_open_tabs@2x.png deleted file mode 100644 index ce094ca..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_open_tabs.imageset/tabswitcher_open_tabs@2x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_open_tabs.imageset/tabswitcher_open_tabs@3x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_open_tabs.imageset/tabswitcher_open_tabs@3x.png deleted file mode 100644 index b23e038..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_open_tabs.imageset/tabswitcher_open_tabs@3x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_other_devices.imageset/Contents.json b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_other_devices.imageset/Contents.json deleted file mode 100644 index 6f09b6dd..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_other_devices.imageset/Contents.json +++ /dev/null
@@ -1,23 +0,0 @@ -{ - "images": [ - { - "idiom": "universal", - "scale": "1x", - "filename": "tabswitcher_other_devices.png" - }, - { - "idiom": "universal", - "scale": "2x", - "filename": "tabswitcher_other_devices@2x.png" - }, - { - "idiom": "universal", - "scale": "3x", - "filename": "tabswitcher_other_devices@3x.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_other_devices.imageset/tabswitcher_other_devices.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_other_devices.imageset/tabswitcher_other_devices.png deleted file mode 100644 index 8463e888..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_other_devices.imageset/tabswitcher_other_devices.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_other_devices.imageset/tabswitcher_other_devices@2x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_other_devices.imageset/tabswitcher_other_devices@2x.png deleted file mode 100644 index 319ec8bb..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_other_devices.imageset/tabswitcher_other_devices@2x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_other_devices.imageset/tabswitcher_other_devices@3x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_other_devices.imageset/tabswitcher_other_devices@3x.png deleted file mode 100644 index 18f96f6e..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_other_devices.imageset/tabswitcher_other_devices@3x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_overflow_arrow.imageset/Contents.json b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_overflow_arrow.imageset/Contents.json deleted file mode 100644 index b22842e..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_overflow_arrow.imageset/Contents.json +++ /dev/null
@@ -1,23 +0,0 @@ -{ - "images": [ - { - "idiom": "universal", - "scale": "1x", - "filename": "tabswitcher_overflow_arrow.png" - }, - { - "idiom": "universal", - "scale": "2x", - "filename": "tabswitcher_overflow_arrow@2x.png" - }, - { - "idiom": "universal", - "scale": "3x", - "filename": "tabswitcher_overflow_arrow@3x.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_overflow_arrow.imageset/tabswitcher_overflow_arrow.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_overflow_arrow.imageset/tabswitcher_overflow_arrow.png deleted file mode 100644 index f49ee68..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_overflow_arrow.imageset/tabswitcher_overflow_arrow.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_overflow_arrow.imageset/tabswitcher_overflow_arrow@2x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_overflow_arrow.imageset/tabswitcher_overflow_arrow@2x.png deleted file mode 100644 index 8010b4a2..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_overflow_arrow.imageset/tabswitcher_overflow_arrow@2x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_overflow_arrow.imageset/tabswitcher_overflow_arrow@3x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_overflow_arrow.imageset/tabswitcher_overflow_arrow@3x.png deleted file mode 100644 index d11dc61..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_overflow_arrow.imageset/tabswitcher_overflow_arrow@3x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_phone.imageset/Contents.json b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_phone.imageset/Contents.json deleted file mode 100644 index 873d386cf..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_phone.imageset/Contents.json +++ /dev/null
@@ -1,23 +0,0 @@ -{ - "images": [ - { - "idiom": "universal", - "scale": "1x", - "filename": "tabswitcher_phone.png" - }, - { - "idiom": "universal", - "scale": "2x", - "filename": "tabswitcher_phone@2x.png" - }, - { - "idiom": "universal", - "scale": "3x", - "filename": "tabswitcher_phone@3x.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_phone.imageset/tabswitcher_phone.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_phone.imageset/tabswitcher_phone.png deleted file mode 100644 index e63f563..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_phone.imageset/tabswitcher_phone.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_phone.imageset/tabswitcher_phone@2x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_phone.imageset/tabswitcher_phone@2x.png deleted file mode 100644 index 6f8d882..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_phone.imageset/tabswitcher_phone@2x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_phone.imageset/tabswitcher_phone@3x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_phone.imageset/tabswitcher_phone@3x.png deleted file mode 100644 index e36939c8..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_phone.imageset/tabswitcher_phone@3x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_recently_closed.imageset/Contents.json b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_recently_closed.imageset/Contents.json deleted file mode 100644 index 49aa0c7..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_recently_closed.imageset/Contents.json +++ /dev/null
@@ -1,23 +0,0 @@ -{ - "images": [ - { - "idiom": "universal", - "scale": "1x", - "filename": "tabswitcher_recently_closed.png" - }, - { - "idiom": "universal", - "scale": "2x", - "filename": "tabswitcher_recently_closed@2x.png" - }, - { - "idiom": "universal", - "scale": "3x", - "filename": "tabswitcher_recently_closed@3x.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_recently_closed.imageset/tabswitcher_recently_closed.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_recently_closed.imageset/tabswitcher_recently_closed.png deleted file mode 100644 index eb2ca4eff..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_recently_closed.imageset/tabswitcher_recently_closed.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_recently_closed.imageset/tabswitcher_recently_closed@2x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_recently_closed.imageset/tabswitcher_recently_closed@2x.png deleted file mode 100644 index 7019b0e3..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_recently_closed.imageset/tabswitcher_recently_closed@2x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_recently_closed.imageset/tabswitcher_recently_closed@3x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_recently_closed.imageset/tabswitcher_recently_closed@3x.png deleted file mode 100644 index 55f8d3a..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_recently_closed.imageset/tabswitcher_recently_closed@3x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_button.imageset/Contents.json b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_button.imageset/Contents.json deleted file mode 100644 index 0d023928..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_button.imageset/Contents.json +++ /dev/null
@@ -1,23 +0,0 @@ -{ - "images": [ - { - "idiom": "universal", - "scale": "1x", - "filename": "tabswitcher_tab_switcher_button.png" - }, - { - "idiom": "universal", - "scale": "2x", - "filename": "tabswitcher_tab_switcher_button@2x.png" - }, - { - "idiom": "universal", - "scale": "3x", - "filename": "tabswitcher_tab_switcher_button@3x.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_button.imageset/tabswitcher_tab_switcher_button.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_button.imageset/tabswitcher_tab_switcher_button.png deleted file mode 100644 index 2607f64..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_button.imageset/tabswitcher_tab_switcher_button.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_button.imageset/tabswitcher_tab_switcher_button@2x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_button.imageset/tabswitcher_tab_switcher_button@2x.png deleted file mode 100644 index edfba571..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_button.imageset/tabswitcher_tab_switcher_button@2x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_button.imageset/tabswitcher_tab_switcher_button@3x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_button.imageset/tabswitcher_tab_switcher_button@3x.png deleted file mode 100644 index bea5a3d5..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_button.imageset/tabswitcher_tab_switcher_button@3x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_count_button.imageset/Contents.json b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_count_button.imageset/Contents.json deleted file mode 100644 index bee7e72..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_count_button.imageset/Contents.json +++ /dev/null
@@ -1,18 +0,0 @@ -{ - "images": [ - { - "idiom": "universal", - "scale": "1x", - "filename": "tabswitcher_tab_switcher_count_button.png" - }, - { - "idiom": "universal", - "scale": "2x", - "filename": "tabswitcher_tab_switcher_count_button@2x.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_count_button.imageset/tabswitcher_tab_switcher_count_button.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_count_button.imageset/tabswitcher_tab_switcher_count_button.png deleted file mode 100644 index 7fe4381ce..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_count_button.imageset/tabswitcher_tab_switcher_count_button.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_count_button.imageset/tabswitcher_tab_switcher_count_button@2x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_count_button.imageset/tabswitcher_tab_switcher_count_button@2x.png deleted file mode 100644 index 8e23c529..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_count_button.imageset/tabswitcher_tab_switcher_count_button@2x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_count_button_pressed.imageset/Contents.json b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_count_button_pressed.imageset/Contents.json deleted file mode 100644 index b642f12..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_count_button_pressed.imageset/Contents.json +++ /dev/null
@@ -1,18 +0,0 @@ -{ - "images": [ - { - "idiom": "universal", - "scale": "1x", - "filename": "tabswitcher_tab_switcher_count_button_pressed.png" - }, - { - "idiom": "universal", - "scale": "2x", - "filename": "tabswitcher_tab_switcher_count_button_pressed@2x.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_count_button_pressed.imageset/tabswitcher_tab_switcher_count_button_pressed.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_count_button_pressed.imageset/tabswitcher_tab_switcher_count_button_pressed.png deleted file mode 100644 index 6f21d21..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_count_button_pressed.imageset/tabswitcher_tab_switcher_count_button_pressed.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_count_button_pressed.imageset/tabswitcher_tab_switcher_count_button_pressed@2x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_count_button_pressed.imageset/tabswitcher_tab_switcher_count_button_pressed@2x.png deleted file mode 100644 index ce82812..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tab_switcher_count_button_pressed.imageset/tabswitcher_tab_switcher_count_button_pressed@2x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tablet.imageset/Contents.json b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tablet.imageset/Contents.json deleted file mode 100644 index 9e0ac35..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tablet.imageset/Contents.json +++ /dev/null
@@ -1,23 +0,0 @@ -{ - "images": [ - { - "idiom": "universal", - "scale": "1x", - "filename": "tabswitcher_tablet.png" - }, - { - "idiom": "universal", - "scale": "2x", - "filename": "tabswitcher_tablet@2x.png" - }, - { - "idiom": "universal", - "scale": "3x", - "filename": "tabswitcher_tablet@3x.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tablet.imageset/tabswitcher_tablet.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tablet.imageset/tabswitcher_tablet.png deleted file mode 100644 index 3065641..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tablet.imageset/tabswitcher_tablet.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tablet.imageset/tabswitcher_tablet@2x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tablet.imageset/tabswitcher_tablet@2x.png deleted file mode 100644 index 4a7827d..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tablet.imageset/tabswitcher_tablet@2x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tablet.imageset/tabswitcher_tablet@3x.png b/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tablet.imageset/tabswitcher_tablet@3x.png deleted file mode 100644 index 967206aa..0000000 --- a/ios/chrome/browser/ui/tab_switcher/resources/tabswitcher_tablet.imageset/tabswitcher_tablet@3x.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_model_snapshot.h b/ios/chrome/browser/ui/tab_switcher/tab_model_snapshot.h deleted file mode 100644 index 3d0ff15c..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_model_snapshot.h +++ /dev/null
@@ -1,42 +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 IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_MODEL_SNAPSHOT_H_ -#define IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_MODEL_SNAPSHOT_H_ - -#import <Foundation/Foundation.h> - -#include <vector> - -@class TabModel; -@class Tab; - -// Contains an approximate snapshot of the tab model passed to the initializer. -// Used to feed the cells to UICollectionViews, and to compute the changes -// required to update UICollectionViews. -// The changes are computed based on a list of hashes of the tabs. -// One resulting limitation is that there is no differenciation between a tab -// that is partially updated (because the snapshot changed), and a completely -// new tab replacing an older tab. This limitation has little impact because -// very few navigations occur when the tab switcher is shown. -class TabModelSnapshot { - public: - // Default constructor. |tab_model| can be nil. - explicit TabModelSnapshot(TabModel* tab_model); - ~TabModelSnapshot(); - // Returns the list of hashes for every tabs contained in the TabModel during - // the initialization. - std::vector<size_t> const& hashes() const { return hashes_; } - // Returns a list of weak pointers to the tabs. - std::vector<__weak Tab*> const& tabs() const { return tabs_; } - // Returns a hash of the properties of a tab that are visible in the tab - // switcher's UI. - static size_t HashOfTheVisiblePropertiesOfATab(Tab* tab); - - private: - std::vector<__weak Tab*> tabs_; - std::vector<size_t> hashes_; -}; - -#endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_MODEL_SNAPSHOT_H_
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_model_snapshot.mm b/ios/chrome/browser/ui/tab_switcher/tab_model_snapshot.mm deleted file mode 100644 index e91747c..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_model_snapshot.mm +++ /dev/null
@@ -1,42 +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. - -#import "ios/chrome/browser/ui/tab_switcher/tab_model_snapshot.h" - -#include "base/strings/sys_string_conversions.h" -#import "ios/chrome/browser/tabs/legacy_tab_helper.h" -#import "ios/chrome/browser/tabs/tab.h" -#import "ios/chrome/browser/tabs/tab_model.h" -#import "ios/chrome/browser/web_state_list/web_state_list.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -TabModelSnapshot::TabModelSnapshot(TabModel* tab_model) { - if (tab_model) { - DCHECK(tab_model.webStateList); - WebStateList* web_state_list = tab_model.webStateList; - for (int index = 0; index < web_state_list->count(); ++index) { - web::WebState* web_state = web_state_list->GetWebStateAt(index); - Tab* tab = LegacyTabHelper::GetTabForWebState(web_state); - hashes_.push_back(HashOfTheVisiblePropertiesOfATab(tab)); - tabs_.push_back(tab); - } - } -} - -TabModelSnapshot::~TabModelSnapshot() {} - -// static -size_t TabModelSnapshot::HashOfTheVisiblePropertiesOfATab(Tab* tab) { - DCHECK(tab); - std::stringstream ss; - // lastVisitedTimestamp is used as an approximation for whether the tab's - // snapshot changed. - ss << base::SysNSStringToUTF8(tab.tabId) << std::endl - << base::SysNSStringToUTF8(tab.urlDisplayString) << std::endl - << std::hexfloat << tab.lastVisitedTimestamp << std::endl; - return std::hash<std::string>()(ss.str()); -}
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_model_snapshot_unittest.mm b/ios/chrome/browser/ui/tab_switcher/tab_model_snapshot_unittest.mm deleted file mode 100644 index 7032e2bf..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_model_snapshot_unittest.mm +++ /dev/null
@@ -1,120 +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. - -#import "ios/chrome/browser/ui/tab_switcher/tab_model_snapshot.h" - -#import "ios/chrome/browser/tabs/legacy_tab_helper.h" -#import "ios/chrome/browser/tabs/tab.h" -#import "ios/chrome/browser/web_state_list/fake_web_state_list_delegate.h" -#import "ios/chrome/browser/web_state_list/web_state_list.h" -#import "ios/chrome/browser/web_state_list/web_state_opener.h" -#import "ios/web/public/test/fakes/test_web_state.h" -#include "testing/platform_test.h" -#import "third_party/ocmock/OCMock/OCMock.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -@interface TabModelSnapshotTestTabMock : NSObject - -@property(nonatomic, copy) NSString* tabId; -@property(nonatomic, copy) NSString* urlDisplayString; -@property(nonatomic, assign) double lastVisitedTimestamp; - -@end - -@implementation TabModelSnapshotTestTabMock - -@synthesize tabId = _tabId; -@synthesize urlDisplayString = _urlDisplayString; -@synthesize lastVisitedTimestamp = _lastVisitedTimestamp; - -@end - -@interface TabModelSnapshotTestTabModelMock : NSObject -@end - -@implementation TabModelSnapshotTestTabModelMock { - FakeWebStateListDelegate _webStateListDelegate; - std::unique_ptr<WebStateList> _webStateList; -} - -- (instancetype)initWithTabs:(NSArray<Tab*>*)tabs { - if ((self = [super init])) { - _webStateList = std::make_unique<WebStateList>(&_webStateListDelegate); - for (Tab* tab in tabs) { - auto testWebState = std::make_unique<web::TestWebState>(); - LegacyTabHelper::CreateForWebStateForTesting(testWebState.get(), tab); - _webStateList->InsertWebState(0, std::move(testWebState), - WebStateList::INSERT_NO_FLAGS, - WebStateOpener()); - } - } - return self; -} - -- (WebStateList*)webStateList { - return _webStateList.get(); -} - -@end - -namespace { - -class TabModelSnapshotTest : public PlatformTest { - protected: - Tab* TabMock(NSString* tabId, NSString* url, double time) { - TabModelSnapshotTestTabMock* tabMock = - [[TabModelSnapshotTestTabMock alloc] init]; - tabMock.tabId = tabId; - tabMock.urlDisplayString = url; - tabMock.lastVisitedTimestamp = time; - return static_cast<Tab*>(tabMock); - } -}; - -TEST_F(TabModelSnapshotTest, TestSingleHash) { - Tab* tab1 = TabMock(@"id1", @"url1", 12345.6789); - Tab* tab2 = TabMock(@"id2", @"url1", 12345.6789); - Tab* tab3 = TabMock(@"id1", @"url2", 12345.6789); - Tab* tab4 = TabMock(@"id1", @"url1", 12345); - - // Same tab - size_t hash1 = TabModelSnapshot::HashOfTheVisiblePropertiesOfATab(tab1); - size_t hash2 = TabModelSnapshot::HashOfTheVisiblePropertiesOfATab(tab1); - EXPECT_EQ(hash1, hash2); - - // Different ids - size_t hash3 = TabModelSnapshot::HashOfTheVisiblePropertiesOfATab(tab1); - size_t hash4 = TabModelSnapshot::HashOfTheVisiblePropertiesOfATab(tab2); - EXPECT_NE(hash3, hash4); - - // Different urls - size_t hash5 = TabModelSnapshot::HashOfTheVisiblePropertiesOfATab(tab1); - size_t hash6 = TabModelSnapshot::HashOfTheVisiblePropertiesOfATab(tab3); - EXPECT_NE(hash5, hash6); - - // Different timestamps - size_t hash7 = TabModelSnapshot::HashOfTheVisiblePropertiesOfATab(tab1); - size_t hash8 = TabModelSnapshot::HashOfTheVisiblePropertiesOfATab(tab4); - EXPECT_NE(hash7, hash8); -} - -TEST_F(TabModelSnapshotTest, TestSnapshotHashes) { - Tab* tab1 = TabMock(@"id1", @"url1", 12345.6789); - Tab* tab2 = TabMock(@"id2", @"url1", 12345.6789); - - TabModelSnapshotTestTabModelMock* tabModel = - [[TabModelSnapshotTestTabModelMock alloc] initWithTabs:@[ tab1, tab2 ]]; - TabModelSnapshot tabModelSnapshot(static_cast<TabModel*>(tabModel)); - - EXPECT_EQ(tabModelSnapshot.hashes().size(), 2UL); - EXPECT_EQ(tabModelSnapshot.hashes()[0], - TabModelSnapshot::HashOfTheVisiblePropertiesOfATab(tab1)); - EXPECT_EQ(tabModelSnapshot.hashes()[1], - TabModelSnapshot::HashOfTheVisiblePropertiesOfATab(tab2)); -} - -} // namespace
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_button.h b/ios/chrome/browser/ui/tab_switcher/tab_switcher_button.h deleted file mode 100644 index d59ba0f..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_button.h +++ /dev/null
@@ -1,21 +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 IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_BUTTON_H_ -#define IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_BUTTON_H_ - -#import <UIKit/UIKit.h> - -// This class is a UIButton with an inkview. -// Replaces MDCButton, because MDCButton does a lot of blending, which is a -// problem in the tab switcher where almost the entire screen can be filled -// by buttons. -@interface TabSwitcherButton : UIButton - -// Resets the state of the button, in particular the inkview state. -- (void)resetState; - -@end - -#endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_BUTTON_H_
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_button.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_button.mm deleted file mode 100644 index 359a4a5..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_button.mm +++ /dev/null
@@ -1,36 +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 "ios/chrome/browser/ui/tab_switcher/tab_switcher_button.h" - -#import "ios/third_party/material_components_ios/src/components/Ink/src/MaterialInk.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -@interface TabSwitcherButton () { - MDCInkTouchController* _inkTouchController; -} -@end - -@implementation TabSwitcherButton - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - _inkTouchController = [[MDCInkTouchController alloc] initWithView:self]; - [_inkTouchController addInkView]; - // TODO(crbug.com/606807): Adjust the desired ink color. - [_inkTouchController defaultInkView].inkColor = - [[UIColor whiteColor] colorWithAlphaComponent:0.4]; - } - return self; -} - -- (void)resetState { - [_inkTouchController cancelInkTouchProcessing]; -} - -@end
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_cache.h b/ios/chrome/browser/ui/tab_switcher/tab_switcher_cache.h deleted file mode 100644 index 32a87ad8..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_cache.h +++ /dev/null
@@ -1,64 +0,0 @@ -// 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. - -#ifndef IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_CACHE_H_ -#define IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_CACHE_H_ - -#import <UIKit/UIKit.h> - -#import "ios/chrome/browser/tabs/tab_model_observer.h" - -@class Tab; - -typedef void (^SnapshotCompletionBlock)(UIImage*); - -struct PendingSnapshotRequest { - CFTimeInterval requestId; - NSUInteger sessionId; - - PendingSnapshotRequest() : requestId(0), sessionId(0) {} - - void clear() { - requestId = 0; - sessionId = 0; - } -}; - -// A class that provides access to resized snapshots of tabs. The snapshots are -// cached and freed under memory pressure. -@interface TabSwitcherCache : NSObject<TabModelObserver> - -@property(weak, nonatomic, readonly) TabModel* mainTabModel; - -// Request a snapshot for the given |tab| of the given |size|, |completionBlock| -// will be called with the requested snapshot. Must be called from the main -// thread with a non nil |tab|, a non nil |completionBlock|, and a non -// CGSizeZero |size|. -// If the resized snapshot is cached, |completionBlock| is called synchronously. -// Otherwise it is called asynchronously on the main thread. The block's -// execution can be cancelled with |cancelPendingSnapshotRequest:|. -// Requesting a snapshot for a given tab will cancel any previous request for -// that same tab. The completion handler for a cancelled request may never be -// called. -- (PendingSnapshotRequest)requestSnapshotForTab:(Tab*)tab - withSize:(CGSize)size - completionBlock: - (SnapshotCompletionBlock)completionBlock; - -// Updates the snapshot for the given |tab| with |image| resized to |size|. -- (void)updateSnapshotForTab:(Tab*)tab - withImage:(UIImage*)image - size:(CGSize)size; - -// Cancels the request identified by |pendingRequest|. Does nothing if no -// request matches |pendingRequest|. -- (void)cancelPendingSnapshotRequest:(PendingSnapshotRequest)pendingRequest; - -// Sets the main and incognito tab models. -- (void)setMainTabModel:(TabModel*)mainTabModel - otrTabModel:(TabModel*)otrTabModel; - -@end - -#endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_CACHE_H_
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_cache.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_cache.mm deleted file mode 100644 index dda92ef..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_cache.mm +++ /dev/null
@@ -1,303 +0,0 @@ -// 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 "ios/chrome/browser/ui/tab_switcher/tab_switcher_cache.h" - -#include <unordered_map> - -#include "base/logging.h" -#include "base/strings/stringprintf.h" -#include "base/synchronization/lock.h" -#import "ios/chrome/browser/snapshots/snapshot_tab_helper.h" -#import "ios/chrome/browser/tabs/tab.h" -#import "ios/chrome/browser/tabs/tab_model.h" -#import "ios/chrome/browser/ui/uikit_ui_util.h" -#import "ios/chrome/browser/web/page_placeholder_tab_helper.h" -#include "ios/chrome/common/ios_app_bundle_id_prefix_buildflags.h" -#include "ios/web/public/navigation_item.h" -#import "ios/web/public/web_state/web_state.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -namespace { -// The maximum amount of pixels the cache should hold. -NSUInteger kCacheMaxPixelCount = 2048 * 1536 * 4; -// Two floats that are different from less than |kMaxFloatDelta| are considered -// equals. -const CGFloat kMaxFloatDelta = 0.01; -} // namespace - -@interface TabSwitcherCache () -// Clears the cache. Called when a low memory warning was received. -- (void)lowMemoryWarningReceived; -// Returns a autoreleased resized image of |image|. -+ (UIImage*)resizedImage:(UIImage*)image toSize:(CGSize)size; - -@end - -@implementation TabSwitcherCache { - NSCache* _cache; - dispatch_queue_t _cacheQueue; - // The tab models. - __weak TabModel* _mainTabModel; - __weak TabModel* _otrTabModel; - - // Lock protecting the pending requests map. - base::Lock _lock; - std::unordered_map<NSUInteger, PendingSnapshotRequest> _pendingRequests; -} - -@synthesize mainTabModel = _mainTabModel; - -- (instancetype)init { - self = [super init]; - if (self) { - _cache = [[NSCache alloc] init]; - [_cache setTotalCostLimit:kCacheMaxPixelCount]; - NSNotificationCenter* nc = [NSNotificationCenter defaultCenter]; - [nc addObserver:self - selector:@selector(lowMemoryWarningReceived) - name:UIApplicationDidReceiveMemoryWarningNotification - object:nil]; - std::string queueName = - base::StringPrintf("%s.chrome.ios.TabSwitcherCacheQueue", - BUILDFLAG(IOS_APP_BUNDLE_ID_PREFIX)); - _cacheQueue = - dispatch_queue_create(queueName.c_str(), DISPATCH_QUEUE_SERIAL); - } - return self; -} - -- (void)dealloc { - NSNotificationCenter* nc = [NSNotificationCenter defaultCenter]; - [nc removeObserver:self - name:UIApplicationDidReceiveMemoryWarningNotification - object:nil]; - [_mainTabModel removeObserver:self]; - [_otrTabModel removeObserver:self]; -} - -- (PendingSnapshotRequest)requestSnapshotForTab:(Tab*)tab - withSize:(CGSize)size - completionBlock: - (SnapshotCompletionBlock)completionBlock { - DCHECK([NSThread isMainThread]); - DCHECK(tab); - DCHECK(completionBlock); - DCHECK(!CGSizeEqualToSize(size, CGSizeZero)); - PendingSnapshotRequest currentRequest; - UIImage* snapshot = [_cache objectForKey:[self keyForTab:tab]]; - if (snapshot && [snapshot size].width >= size.width) { - // If tab is not in a state to take a snapshot, use the cached snapshot. - if (!tab.webState || !tab.webState->IsWebUsageEnabled() || - PagePlaceholderTabHelper::FromWebState(tab.webState) - ->displaying_placeholder()) { - completionBlock(snapshot); - return currentRequest; - } - - CGSize newSnapshotSize = - SnapshotTabHelper::FromWebState(tab.webState)->GetSnapshotSize(); - CGFloat newSnapshotAreaRatio = - newSnapshotSize.width / newSnapshotSize.height; - CGFloat cachedSnapshotRatio = - [snapshot size].width / [snapshot size].height; - - // Check that the cached snapshot's ratio matches the content area ratio. - if (std::abs(newSnapshotAreaRatio - cachedSnapshotRatio) < kMaxFloatDelta) { - // Cache hit. - completionBlock(snapshot); - return currentRequest; - } - } - - // Cache miss. - currentRequest = [self recordPendingRequestForTab:tab]; - NSString* key = [self keyForTab:tab]; - SnapshotTabHelper::FromWebState(tab.webState) - ->RetrieveColorSnapshot(^(UIImage* snapshot) { - PendingSnapshotRequest requestForSession = - [self pendingRequestForTab:tab]; - // Cancel this request if another one has replaced it for this - // sessionId. - if (currentRequest.requestId != requestForSession.requestId) - return; - dispatch_async(_cacheQueue, ^{ - DCHECK(![NSThread isMainThread]); - UIImage* resizedSnapshot = - [TabSwitcherCache resizedImage:snapshot toSize:size]; - if ([self storeImage:resizedSnapshot - forKey:key - request:currentRequest]) { - dispatch_async(dispatch_get_main_queue(), ^{ - // Cancel this request if another one has replaced it for this - // sessionId. - PendingSnapshotRequest requestForSession = - [self pendingRequestForTab:tab]; - if (currentRequest.requestId != requestForSession.requestId) - return; - completionBlock(resizedSnapshot); - [self removePendingSnapshotRequest:currentRequest]; - }); - } - }); - }); - return currentRequest; -} - -- (void)updateSnapshotForTab:(Tab*)tab - withImage:(UIImage*)image - size:(CGSize)size { - DCHECK([NSThread isMainThread]); - DCHECK(tab); - DCHECK(image); - PendingSnapshotRequest currentRequest = [self recordPendingRequestForTab:tab]; - NSString* key = [self keyForTab:tab]; - - dispatch_async(_cacheQueue, ^{ - DCHECK(![NSThread isMainThread]); - UIImage* resizedSnapshot = - [TabSwitcherCache resizedImage:image toSize:size]; - [self storeImage:resizedSnapshot forKey:key request:currentRequest]; - [self removePendingSnapshotRequest:currentRequest]; - }); -} - -- (void)cancelPendingSnapshotRequest:(PendingSnapshotRequest)pendingRequest { - [self removePendingSnapshotRequest:pendingRequest]; -} - -#pragma mark - Private - -- (NSString*)keyForTab:(Tab*)tab { - DCHECK([NSThread isMainThread]); - return tab.tabId; -} - -- (PendingSnapshotRequest)recordPendingRequestForTab:(Tab*)tab { - PendingSnapshotRequest pendingRequest; - pendingRequest.requestId = [[NSDate date] timeIntervalSince1970]; - pendingRequest.sessionId = [[self keyForTab:tab] hash]; - base::AutoLock guard(_lock); - _pendingRequests[pendingRequest.sessionId] = pendingRequest; - return pendingRequest; -} - -- (PendingSnapshotRequest)pendingRequestForTab:(Tab*)tab { - DCHECK([NSThread isMainThread]); - PendingSnapshotRequest pendingRequest; - if (!tab.webState) - return pendingRequest; - NSUInteger sessionId = [[self keyForTab:tab] hash]; - base::AutoLock guard(_lock); - auto it = _pendingRequests.find(sessionId); - if (it != _pendingRequests.end()) - pendingRequest = it->second; - return pendingRequest; -} - -- (void)removePendingSnapshotRequest:(PendingSnapshotRequest)pendingRequest { - base::AutoLock guard(_lock); - auto itRequest = _pendingRequests.find(pendingRequest.sessionId); - if (itRequest != _pendingRequests.end() && - pendingRequest.requestId == itRequest->second.requestId) { - _pendingRequests.erase(itRequest); - } -} - -- (void)removePendingSnapshotRequestForTab:(Tab*)tab { - base::AutoLock guard(_lock); - auto itRequest = _pendingRequests.find([[self keyForTab:tab] hash]); - if (itRequest != _pendingRequests.end()) - _pendingRequests.erase(itRequest); -} - -- (BOOL)storeImage:(UIImage*)image - forKey:(NSString*)key - request:(PendingSnapshotRequest)request { - DCHECK(request.requestId != 0); - if (!image) - return NO; - - { - base::AutoLock guard(_lock); - auto it = _pendingRequests.find(request.sessionId); - if (it == _pendingRequests.end()) - return NO; - - // Only write the image in cache if the request is still valid. - if (request.requestId != it->second.requestId) - return NO; - } - - const CGFloat screenScale = [[UIScreen mainScreen] scale]; - const NSUInteger cost = - image.size.width * screenScale * image.size.height * screenScale; - [_cache setObject:image forKey:key cost:cost]; - return YES; -} - -+ (UIImage*)resizedImage:(UIImage*)image toSize:(CGSize)size { - DCHECK(image.scale == 1); - CGFloat screenScale = [[UIScreen mainScreen] scale]; - CGSize pixelSize = size; - pixelSize.width *= screenScale; - pixelSize.height *= screenScale; - UIImage* resizedSnapshot = - ResizeImage(image, pixelSize, ProjectionMode::kAspectFillNoClipping, YES); - // Creates a new image with the correct |scale| attribute. - return [[UIImage alloc] initWithCGImage:resizedSnapshot.CGImage - scale:screenScale - orientation:UIImageOrientationUp]; -} - -- (void)lowMemoryWarningReceived { - [_cache removeAllObjects]; -} - -- (void)setMainTabModel:(TabModel*)mainTabModel { - if (mainTabModel == _mainTabModel) { - return; - } - - [_mainTabModel removeObserver:self]; - _mainTabModel = mainTabModel; - [_mainTabModel addObserver:self]; -} - -- (void)setOTRTabModel:(TabModel*)otrTabModel { - if (_otrTabModel == otrTabModel) { - return; - } - - [_otrTabModel removeObserver:self]; - _otrTabModel = otrTabModel; - [_otrTabModel addObserver:self]; -} - -- (void)setMainTabModel:(TabModel*)mainTabModel - otrTabModel:(TabModel*)otrTabModel { - [self setMainTabModel:mainTabModel]; - [self setOTRTabModel:otrTabModel]; -} - -#pragma mark - TabModelObserver - -- (void)tabModel:(TabModel*)model - didRemoveTab:(Tab*)tab - atIndex:(NSUInteger)index { - [self removePendingSnapshotRequestForTab:tab]; - [_cache removeObjectForKey:[self keyForTab:tab]]; -} - -- (void)tabModel:(TabModel*)model - didChangeTabSnapshot:(Tab*)tab - withImage:image { - [self removePendingSnapshotRequestForTab:tab]; - [_cache removeObjectForKey:[self keyForTab:tab]]; -} - -@end
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.h b/ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.h deleted file mode 100644 index 14e4fbf7..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.h +++ /dev/null
@@ -1,36 +0,0 @@ -// 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. - -#ifndef IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_CONTROLLER_H_ -#define IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_CONTROLLER_H_ - -#import <UIKit/UIKit.h> - -#import "ios/chrome/browser/ui/main/tab_switcher.h" - -@protocol ApplicationCommands; -@protocol BrowserCommands; - -namespace ios { -class ChromeBrowserState; -} - -@interface TabSwitcherController : UIViewController<TabSwitcher> - -- (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState - mainTabModel:(TabModel*)mainTabModel - otrTabModel:(TabModel*)otrTabModel - activeTabModel:(TabModel*)activeTabModel - applicationCommandEndpoint:(id<ApplicationCommands>)endpoint; - -// Dispatcher for anything that acts in a "browser" role, with the -// |BrowserCommands| added. It is an extension of the |dispatcher| property -// defined by the TabSwitcher protocol. -@property(nonatomic, readonly) - id<ApplicationCommands, BrowserCommands, OmniboxFocuser, ToolbarCommands> - dispatcher; - -@end - -#endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_CONTROLLER_H_
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.mm deleted file mode 100644 index bef8d3c..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.mm +++ /dev/null
@@ -1,1354 +0,0 @@ -// 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 "ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.h" - -#include "base/ios/block_types.h" -#include "base/metrics/user_metrics.h" -#include "base/metrics/user_metrics_action.h" -#include "base/strings/sys_string_conversions.h" -#include "components/browser_sync/profile_sync_service.h" -#include "components/sessions/core/session_types.h" -#include "components/sessions/core/tab_restore_service_helper.h" -#include "components/sync/driver/sync_service.h" -#include "components/sync_sessions/open_tabs_ui_delegate.h" -#import "ios/chrome/browser/browser_state/chrome_browser_state.h" -#include "ios/chrome/browser/chrome_url_constants.h" -#include "ios/chrome/browser/feature_engagement/tracker_util.h" -#import "ios/chrome/browser/metrics/tab_usage_recorder.h" -#include "ios/chrome/browser/sessions/ios_chrome_tab_restore_service_factory.h" -#include "ios/chrome/browser/sessions/session_util.h" -#include "ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios.h" -#include "ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios_factory.h" -#import "ios/chrome/browser/snapshots/snapshot_tab_helper.h" -#include "ios/chrome/browser/sync/profile_sync_service_factory.h" -#import "ios/chrome/browser/tabs/tab.h" -#import "ios/chrome/browser/tabs/tab_model.h" -#import "ios/chrome/browser/ui/authentication/signin_promo_view_configurator.h" -#import "ios/chrome/browser/ui/authentication/signin_promo_view_consumer.h" -#import "ios/chrome/browser/ui/authentication/signin_promo_view_mediator.h" -#include "ios/chrome/browser/ui/commands/application_commands.h" -#include "ios/chrome/browser/ui/commands/browser_commands.h" -#import "ios/chrome/browser/ui/commands/command_dispatcher.h" -#import "ios/chrome/browser/ui/commands/open_new_tab_command.h" -#import "ios/chrome/browser/ui/commands/show_signin_command.h" -#import "ios/chrome/browser/ui/keyboard/UIKeyCommand+Chrome.h" -#include "ios/chrome/browser/ui/ntp/recent_tabs/synced_sessions.h" -#import "ios/chrome/browser/ui/ntp/recent_tabs/views/signed_in_sync_off_view.h" -#import "ios/chrome/browser/ui/ntp/recent_tabs/views/signed_in_sync_on_no_sessions_view.h" -#import "ios/chrome/browser/ui/settings/sync_utils/sync_presenter.h" -#import "ios/chrome/browser/ui/signin_interaction/public/signin_presenter.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_cache.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_header_view.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_model.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_controller.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_overlay_view.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_view.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_session_cell_data.h" -#include "ios/chrome/browser/ui/tab_switcher/tab_switcher_transition_context.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_view.h" -#import "ios/chrome/browser/ui/tabs/requirements/tab_strip_fold_animation.h" -#import "ios/chrome/browser/ui/toolbar/toolbar_owner.h" -#include "ios/chrome/browser/ui/ui_util.h" -#import "ios/chrome/browser/ui/uikit_ui_util.h" -#import "ios/chrome/browser/web_state_list/web_state_list.h" -#import "ios/chrome/browser/web_state_list/web_state_opener.h" -#include "ios/chrome/grit/ios_strings.h" -#include "ios/chrome/grit/ios_theme_resources.h" -#import "ios/third_party/material_components_ios/src/components/Palettes/src/MaterialPalettes.h" -#import "ios/web/public/navigation_manager.h" -#include "ios/web/public/referrer.h" -#import "ios/web/public/web_state/web_state.h" -#include "ui/base/l10n/l10n_util.h" -#include "ui/base/l10n/l10n_util_mac.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -namespace { - -// Offsets for computing the panels' indexes in the TabSwitcherView. -const int kSignInPromoPanelIndex = 2; -const int kHeaderDistantSessionIndexOffset = 2; -const int kLocalTabsOffTheRecordPanelIndex = 0; -const int kLocalTabsOnTheRecordPanelIndex = 1; -// The duration of the tab switcher toggle animation. -const CGFloat kTransitionAnimationDuration = 0.25; -// The height of the browser view controller header. -const CGFloat kHeaderHeight = 39; - -enum class TabModelType { - MODEL_MAIN, - MODEL_OTR, -}; - -enum class TransitionType { - TRANSITION_PRESENT, - TRANSITION_DISMISS, -}; - -enum class SnapshotViewOption { - SNAPSHOT_VIEW, // Try taking a snapshot view if possible. - CLIENT_RENDERING, // Use [UIView renderInContext:] to render a bitmap and set - // it as the backing store of a view's layer. -}; - -} // namespace - -@interface TabSwitcherController ()<SigninPresenter, - SigninPromoViewConsumer, - SyncPresenter, - TabSwitcherModelDelegate, - TabSwitcherViewDelegate, - TabSwitcherHeaderViewDelegate, - TabSwitcherHeaderViewDataSource, - TabSwitcherPanelControllerDelegate, - TabSwitcherPanelOverlayViewDelegate> { - // weak. - ios::ChromeBrowserState* _browserState; - // weak. - __weak id<TabSwitcherDelegate> _delegate; - // The type of the model that was selected when the tab switcher was toggled. - // Callers can retrieve the associated TabModel with |[self - // onLoadActiveModel]|. - TabModelType _onLoadActiveModelType; - // The view this controller manages. - TabSwitcherView* _tabSwitcherView; - // The list of panels controllers for distant sessions. - NSMutableArray* _controllersOfDistantSessions; - // The panel controllers for the local sessions. - TabSwitcherPanelController* _onTheRecordSession; - TabSwitcherPanelController* _offTheRecordSession; - // The model storing the state of what is shown by the tab switcher. - TabSwitcherModel* _tabSwitcherModel; - // Stores the current sign-in panel type. - TabSwitcherSignInPanelsType _signInPanelType; - // Stores the sign-in panel overlay view. - TabSwitcherPanelOverlayView* _signInPanelOverlayView; - // Cache for the panel's cells. - TabSwitcherCache* _cache; - // Stores the background color of the window when the tab switcher was - // presented. - UIColor* _initialWindowBackgroundColor; - // Indicate whether a previous promo panel header cell should be removed or - // added. - BOOL _shouldRemovePromoPanelHeaderCell; - BOOL _shouldAddPromoPanelHeaderCell; - // Handles command dispatching. - CommandDispatcher* _dispatcher; - // Sign-in promo view mediator for the "Other Devices" tab. - SigninPromoViewMediator* _signinPromoViewMediator; -} - -// Updates the window background color to the tab switcher's background color. -// The original background color can be restored by calling -// -restoreWindowBackgroundColor. -- (void)updateWindowBackgroundColor; - -// Restores the tab switcher's window background color to the value it had -// before presenting it. -- (void)restoreWindowBackgroundColor; - -// Performs the tab switcher transition according to the |transitionType| and -// call the completion block at the end of the transition. The transition will -// be animated according to the |animated| parameter. |completion| block must -// not be nil. -- (void)performTabSwitcherTransition:(TransitionType)transitionType - withModel:(TabModel*)tabModel - animated:(BOOL)animated - withCompletion:(ProceduralBlock)completion; - -// Returns the index of the currently selected panel. -- (NSInteger)currentPanelIndex; - -// Returns the session type of the panel and the given index. -- (TabSwitcherSessionType)sessionTypeForPanelIndex:(NSInteger)panelIndex; - -// Returns the tab model corresponding to the given session type. -// There is no tab model for distant sessions so it returns nil for distant -// sessions type. -- (TabModel*)tabModelForSessionType:(TabSwitcherSessionType)sessionType; - -// Returns the tab model of the currently selected tab. -- (TabModel*)currentSelectedModel; - -// Returns the tab model that was active when the tab switcher was toggled. -- (TabModel*)onLoadActiveModel; - -// Dismisses the tab switcher using the currently selected tab's tab model. -- (void)tabSwitcherDismissWithCurrentSelectedModel; - -// Scrolls the scrollview to show the panel displaying the |selectedTabModel|. -- (void)selectPanelForTabModel:(TabModel*)selectedTabModel; - -// Dismisses the tab switcher and create a new tab using the url, position and -// transition on the given tab model. -- (Tab*)dismissWithNewTabAnimation:(const GURL&)url - atIndex:(NSUInteger)position - transition:(ui::PageTransition)transition - tabModel:(TabModel*)tabModel; -// Add a promo panel corresponding to the panel type argument. -// Should only be called from inititalizer and signInPanelChangedTo:. -- (void)addPromoPanelForSignInPanelType:(TabSwitcherSignInPanelsType)panelType; - -// Updates cells of local panels. -- (void)updateLocalPanelsCells; - -@end - -@implementation TabSwitcherController - -@synthesize animationDelegate = _animationDelegate; -@synthesize transitionContext = _transitionContext; - -- (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState - mainTabModel:(TabModel*)mainTabModel - otrTabModel:(TabModel*)otrTabModel - activeTabModel:(TabModel*)activeTabModel - applicationCommandEndpoint:(id<ApplicationCommands>)endpoint { - DCHECK(mainTabModel); - DCHECK(otrTabModel); - DCHECK(activeTabModel == otrTabModel || activeTabModel == mainTabModel); - self = [super initWithNibName:nil bundle:nil]; - if (self) { - _browserState = browserState; - - _dispatcher = [[CommandDispatcher alloc] init]; - [_dispatcher startDispatchingToTarget:self - forProtocol:@protocol(BrowserCommands)]; - [_dispatcher startDispatchingToTarget:endpoint - forProtocol:@protocol(ApplicationCommands)]; - // -startDispatchingToTarget:forProtocol: doesn't pick up protocols the - // passed protocol conforms to, so ApplicationSettingsCommands is explicitly - // dispatched to the endpoint as well. Since this is potentially - // fragile, DCHECK that it should still work (if the endpoint is nonnull). - DCHECK( - !endpoint || - [endpoint conformsToProtocol:@protocol(ApplicationSettingsCommands)]); - [_dispatcher - startDispatchingToTarget:endpoint - forProtocol:@protocol(ApplicationSettingsCommands)]; - - // self.dispatcher shouldn't be used in this init method, so duplicate the - // typecast to pass dispatcher into child objects. - id<ApplicationCommands, BrowserCommands> passableDispatcher = - static_cast<id<ApplicationCommands, BrowserCommands>>(_dispatcher); - - _onLoadActiveModelType = (activeTabModel == mainTabModel) - ? TabModelType::MODEL_MAIN - : TabModelType::MODEL_OTR; - _cache = [[TabSwitcherCache alloc] init]; - [_cache setMainTabModel:mainTabModel otrTabModel:otrTabModel]; - _tabSwitcherModel = - [[TabSwitcherModel alloc] initWithBrowserState:browserState - delegate:self - mainTabModel:mainTabModel - otrTabModel:otrTabModel - withCache:_cache]; - _controllersOfDistantSessions = [[NSMutableArray alloc] init]; - [self loadTabSwitcherView]; - _onTheRecordSession = [[TabSwitcherPanelController alloc] - initWithModel:_tabSwitcherModel - forLocalSessionOfType:TabSwitcherSessionType::REGULAR_SESSION - withCache:_cache - browserState:_browserState - presenter:self /* id<SigninPresenter, SyncPresenter> */ - dispatcher:passableDispatcher]; - [_onTheRecordSession setDelegate:self]; - _offTheRecordSession = [[TabSwitcherPanelController alloc] - initWithModel:_tabSwitcherModel - forLocalSessionOfType:TabSwitcherSessionType::OFF_THE_RECORD_SESSION - withCache:_cache - browserState:_browserState - presenter:self /* id<SigninPresenter, SyncPresenter> */ - dispatcher:passableDispatcher]; - [_offTheRecordSession setDelegate:self]; - [_tabSwitcherView addPanelView:[_offTheRecordSession view] - atIndex:kLocalTabsOffTheRecordPanelIndex]; - [_tabSwitcherView addPanelView:[_onTheRecordSession view] - atIndex:kLocalTabsOnTheRecordPanelIndex]; - [self addPromoPanelForSignInPanelType:[_tabSwitcherModel signInPanelType]]; - [[_tabSwitcherView headerView] reloadData]; - [_tabSwitcherModel syncedSessionsChanged]; - [self selectPanelForTabModel:[self onLoadActiveModel]]; - } - return self; -} - -#pragma mark - UIViewController - -- (BOOL)prefersStatusBarHidden { - return NO; -} - -- (UIStatusBarStyle)preferredStatusBarStyle { - return UIStatusBarStyleLightContent; -} - -- (CGRect)tabSwitcherInitialFrame { - return [[UIScreen mainScreen] bounds]; -} - -- (void)loadTabSwitcherView { - DCHECK(![_tabSwitcherView superview]); - _tabSwitcherView = - [[TabSwitcherView alloc] initWithFrame:[self tabSwitcherInitialFrame]]; - [_tabSwitcherView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | - UIViewAutoresizingFlexibleHeight]; - [_tabSwitcherView setDelegate:self]; - [[_tabSwitcherView headerView] setDelegate:self]; - [[_tabSwitcherView headerView] setDataSource:self]; -} - -- (void)viewDidLoad { - [super viewDidLoad]; - [self.view setAutoresizingMask:UIViewAutoresizingFlexibleWidth | - UIViewAutoresizingFlexibleHeight]; - [_tabSwitcherView setFrame:self.view.bounds]; - [self.view addSubview:_tabSwitcherView]; -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - [self.dispatcher - setIncognitoContentVisible:([[_tabSwitcherModel otrTabModel] count] > 0)]; -} - -#pragma mark - UIResponder - -- (NSArray*)keyCommands { - __weak TabSwitcherController* weakSelf = self; - return @[ - [UIKeyCommand - cr_keyCommandWithInput:@"t" - modifierFlags:UIKeyModifierCommand - title:l10n_util::GetNSStringWithFixup( - IDS_IOS_TOOLS_MENU_NEW_TAB) - action:^{ - TabSwitcherController* strongSelf = weakSelf; - if (!strongSelf) - return; - if ([strongSelf currentPanelIndex] == - kLocalTabsOffTheRecordPanelIndex) { - [strongSelf openNewTabInPanelAtIndex: - kLocalTabsOffTheRecordPanelIndex]; - } else { - [strongSelf openNewTabInPanelAtIndex: - kLocalTabsOnTheRecordPanelIndex]; - } - }], - [UIKeyCommand - cr_keyCommandWithInput:@"n" - modifierFlags:UIKeyModifierCommand | UIKeyModifierShift - title:l10n_util::GetNSStringWithFixup( - IDS_IOS_TOOLS_MENU_NEW_INCOGNITO_TAB) - action:^{ - [weakSelf openNewTabInPanelAtIndex: - kLocalTabsOffTheRecordPanelIndex]; - }], - [UIKeyCommand - cr_keyCommandWithInput:@"t" - modifierFlags:UIKeyModifierCommand | UIKeyModifierShift - title:l10n_util::GetNSStringWithFixup( - IDS_IOS_KEYBOARD_REOPEN_CLOSED_TAB) - action:^{ - [weakSelf reopenClosedTab]; - }], - [UIKeyCommand - cr_keyCommandWithInput:@"n" - modifierFlags:UIKeyModifierCommand - title:nil - action:^{ - TabSwitcherController* strongSelf = weakSelf; - if (!strongSelf) - return; - if ([strongSelf currentPanelIndex] == - kLocalTabsOffTheRecordPanelIndex) { - [strongSelf openNewTabInPanelAtIndex: - kLocalTabsOffTheRecordPanelIndex]; - } else { - [strongSelf openNewTabInPanelAtIndex: - kLocalTabsOnTheRecordPanelIndex]; - } - }], - ]; -} - -#pragma mark - TabSwitcher protocol implementation - -- (void)restoreInternalStateWithMainTabModel:(TabModel*)mainModel - otrTabModel:(TabModel*)otrModel - activeTabModel:(TabModel*)activeModel { - DCHECK(mainModel); - DCHECK(otrModel); - DCHECK(activeModel == mainModel || activeModel == otrModel); - _onLoadActiveModelType = (activeModel == mainModel) ? TabModelType::MODEL_MAIN - : TabModelType::MODEL_OTR; - [_cache setMainTabModel:mainModel otrTabModel:otrModel]; - [_tabSwitcherModel setMainTabModel:mainModel otrTabModel:otrModel]; - [self selectPanelForTabModel:activeModel]; -} - -- (UIViewController*)viewController { - return self; -} - -- (void)setOtrTabModel:(TabModel*)otrModel { - [_cache setMainTabModel:[_cache mainTabModel] otrTabModel:otrModel]; - [_tabSwitcherModel setMainTabModel:[_tabSwitcherModel mainTabModel] - otrTabModel:otrModel]; -} - -- (void)showWithSelectedTabAnimation { - [self updateWindowBackgroundColor]; - [self performTabSwitcherTransition:TransitionType::TRANSITION_PRESENT - withModel:[self onLoadActiveModel] - animated:YES - withCompletion:^{ - [self.animationDelegate - tabSwitcherPresentationAnimationDidEnd:self]; - [_tabSwitcherView wasShown]; - }]; -} - -- (Tab*)dismissWithNewTabAnimationToModel:(TabModel*)targetModel - withURL:(const GURL&)url - atIndex:(NSUInteger)position - transition:(ui::PageTransition)transition { - if (targetModel == [_tabSwitcherModel mainTabModel]) - [_tabSwitcherView selectPanelAtIndex:kLocalTabsOnTheRecordPanelIndex]; - else - [_tabSwitcherView selectPanelAtIndex:kLocalTabsOffTheRecordPanelIndex]; - return [self dismissWithNewTabAnimation:url - atIndex:position - transition:transition - tabModel:targetModel]; -} - -- (void)setDelegate:(id<TabSwitcherDelegate>)delegate { - _delegate = delegate; - if (delegate == nullptr) - [_tabSwitcherModel setMainTabModel:nil otrTabModel:nil]; -} - -- (id<TabSwitcherDelegate>)delegate { - return _delegate; -} - -- (id<ApplicationCommands, BrowserCommands>)dispatcher { - return static_cast<id<ApplicationCommands, BrowserCommands>>(_dispatcher); -} - -- (void)prepareForDisplayAtSize:(CGSize)size { - // No-op. -} - -#pragma mark - BrowserCommands - -- (void)openNewTab:(OpenNewTabCommand*)command { - // Ensure that the right mode is showing. - NSInteger panelIndex = command.inIncognito ? kLocalTabsOffTheRecordPanelIndex - : kLocalTabsOnTheRecordPanelIndex; - [_tabSwitcherView selectPanelAtIndex:panelIndex]; - - const TabSwitcherSessionType panelSessionType = - (command.inIncognito) ? TabSwitcherSessionType::OFF_THE_RECORD_SESSION - : TabSwitcherSessionType::REGULAR_SESSION; - - TabModel* model = [self tabModelForSessionType:panelSessionType]; - - // Either send or don't send the "New Tab Opened" or "Incognito Tab Opened" to - // the feature_engageament::Tracker based on |command.userInitiated| and - // |command.incognito|. - feature_engagement::NotifyNewTabEventForCommand(model.browserState, command); - - [self dismissWithNewTabAnimation:GURL(kChromeUINewTabURL) - atIndex:NSNotFound - transition:ui::PAGE_TRANSITION_TYPED - tabModel:model]; -} - -#pragma mark - Private - -- (void)updateWindowBackgroundColor { - DCHECK(!_initialWindowBackgroundColor); - _initialWindowBackgroundColor = self.view.window.backgroundColor; - self.view.window.backgroundColor = [[MDCPalette greyPalette] tint900]; -} - -- (void)restoreWindowBackgroundColor { - self.view.window.backgroundColor = _initialWindowBackgroundColor; - _initialWindowBackgroundColor = nil; -} - -- (UIView*)snapshotViewForView:(UIView*)inputView - withModel:(TabModel*)tabModel - option:(SnapshotViewOption)option { - if (inputView) { - if (option == SnapshotViewOption::SNAPSHOT_VIEW) { - UIView* view = [inputView snapshotViewAfterScreenUpdates:NO]; - if (view) - return view; - } - // If the view has just been created, it has not been rendered by Core - // Animation and the snapshot view can't be generated. In that case we - // trigger a client side rendering of the view and use the rendered image - // as the backing store of a view layer. - UIGraphicsBeginImageContextWithOptions(inputView.bounds.size, - inputView.opaque, 0); - [inputView.layer renderInContext:UIGraphicsGetCurrentContext()]; - UIImage* screenshot = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - UIView* view = [[UIView alloc] initWithFrame:CGRectZero]; - [view layer].contents = static_cast<id>(screenshot.CGImage); - return view; - } else { - // When the input view is nil, we can't generate a snapshot so a placeholder - // is returned. - UIColor* backgroundColor = [tabModel isOffTheRecord] - ? [[MDCPalette greyPalette] tint700] - : [[MDCPalette greyPalette] tint100]; - UIView* placeholdView = [[UIView alloc] initWithFrame:CGRectZero]; - placeholdView.backgroundColor = backgroundColor; - return placeholdView; - } -} - -- (TabSwitcherTransitionContextContent*)transitionContextContentForTabModel: - (TabModel*)tabModel { - if ([tabModel isOffTheRecord]) - return self.transitionContext.incognitoContent; - else - return self.transitionContext.regularContent; -} - -- (UIImage*)updateScreenshotForCellIfNeeded:(TabSwitcherLocalSessionCell*)cell - tabModel:(TabModel*)tabModel { - if (cell.snapshot) - return cell.snapshot; - UIColor* backgroundColor = [tabModel isOffTheRecord] - ? [[MDCPalette greyPalette] tint700] - : [UIColor whiteColor]; - CGRect rect = CGRectMake(0, 0, 1, 1); - UIGraphicsBeginImageContextWithOptions(rect.size, YES, 0); - [backgroundColor setFill]; - CGContextFillRect(UIGraphicsGetCurrentContext(), rect); - UIImage* image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - return image; -} - -- (void)performTabSwitcherTransition:(TransitionType)transitionType - withModel:(TabModel*)tabModel - animated:(BOOL)animated - withCompletion:(ProceduralBlock)completion { - switch (transitionType) { - case TransitionType::TRANSITION_PRESENT: - base::RecordAction(base::UserMetricsAction("MobileTabSwitcherPresented")); - break; - case TransitionType::TRANSITION_DISMISS: - base::RecordAction(base::UserMetricsAction("MobileTabSwitcherDismissed")); - break; - } - DCHECK(tabModel); - DCHECK(completion); - DCHECK([self transitionContext]); - [[self view] setUserInteractionEnabled:NO]; - - TabSwitcherTransitionContextContent* transitionContextContent = - [self transitionContextContentForTabModel:tabModel]; - DCHECK(transitionContextContent); - - Tab* selectedTab = [tabModel currentTab]; - - NSInteger selectedTabIndex = [tabModel indexOfTab:selectedTab]; - TabSwitcherLocalSessionCell* selectedCell = nil; - CGRect selectedCellFrame = CGRectZero; - TabSwitcherPanelController* selectedPanel = - [self panelControllerForTabModel:tabModel]; - // Force invalidation and update of the tab switcher view and collection view - // layout to take into account any changes in the size of the view controller - // while the tab switcher was not shown. - if (transitionType == TransitionType::TRANSITION_PRESENT) { - [[self view] layoutIfNeeded]; - [[selectedPanel collectionView].collectionViewLayout invalidateLayout]; - } - if (selectedTabIndex != NSNotFound) { - selectedCell = - [selectedPanel localSessionCellForTabAtIndex:selectedTabIndex]; - selectedCellFrame = - [selectedPanel localSessionCellFrameForTabAtIndex:selectedTabIndex]; - - const CGFloat collectionViewContentOffsetMinY = - [selectedPanel collectionView].contentOffset.y; - const CGFloat collectionViewContentOffsetMaxY = - collectionViewContentOffsetMinY + - [selectedPanel collectionView].bounds.size.height; - const BOOL isCellTotallyHidden = - CGRectGetMaxY(selectedCellFrame) < collectionViewContentOffsetMinY || - CGRectGetMinY(selectedCellFrame) > collectionViewContentOffsetMaxY; - if (transitionType == TransitionType::TRANSITION_PRESENT || - isCellTotallyHidden) { - [selectedPanel scrollTabIndexToVisible:selectedTabIndex - triggerLayout:YES]; - } - } else { - CGRect collectionViewFrame = [selectedPanel.collectionView frame]; - selectedCellFrame = CGRectMake(collectionViewFrame.size.width / 2, - collectionViewFrame.size.height / 2, 0, 0); - } - // Compute initial and final tab frames. - const CGFloat initialTabFrameOriginY = kHeaderHeight + StatusBarHeight(); - CGRect initialTabFrame = - CGRectMake(0, initialTabFrameOriginY, self.view.bounds.size.width, - self.view.bounds.size.height - initialTabFrameOriginY); - CGRect finalTabFrame = - [[selectedPanel collectionView] convertRect:selectedCellFrame - toView:self.view]; - - // Compute initial and final toolbar screenshot frames. - const CGRect initialToolbarFrame = - [[self.delegate tabSwitcherTransitionToolbarOwner] toolbarFrame]; - CGRect initialToolbarScreenshotFrame = CGRectMake( - 0, 0, initialToolbarFrame.size.width, initialToolbarFrame.size.height); - - const CGFloat cellTopBarHeight = tabSwitcherLocalSessionCellTopBarHeight(); - CGRect finalToolbarScreenshotFrame = - CGRectMake(0, 0, selectedCellFrame.size.width, cellTopBarHeight); - - UIImageView* tabScreenshotImageView = - [[UIImageView alloc] initWithFrame:CGRectZero]; - - __weak UIImageView* weakTabScreenshotImageView = tabScreenshotImageView; - - if ([self initialTabModelAndTabIDMatchesTabModel:tabModel - tabID:selectedTab.tabId]) { - tabScreenshotImageView.image = self.transitionContext.tabSnapshotImage; - } else { - // If transitioning to a different tab than the one animated in - // from, a new snapshot should be generated instead of using the transition - // context - tabScreenshotImageView.image = - [self updateScreenshotForCellIfNeeded:selectedCell tabModel:tabModel]; - if (selectedTab) { - SnapshotTabHelper::FromWebState(selectedTab.webState) - ->RetrieveColorSnapshot(^(UIImage* snapshot) { - [weakTabScreenshotImageView setImage:snapshot]; - }); - } - } - - const CGSize tabScreenshotImageSize = tabScreenshotImageView.image.size; - - CGRect initialTabScreenshotFrame = CGRectZero; - const CGSize toolbarSize = - [[self.delegate tabSwitcherTransitionToolbarOwner] toolbarFrame].size; - CGSize initialTabTargetSize = - CGSizeMake(initialTabFrame.size.width, - initialTabFrame.size.height - toolbarSize.height); - CGSize revisedTargetSize = CGSizeZero; - CalculateProjection(tabScreenshotImageSize, initialTabTargetSize, - ProjectionMode::kAspectFill, revisedTargetSize, - initialTabScreenshotFrame); - initialTabScreenshotFrame.origin.y += toolbarSize.height; - - CGSize finalTabTargetSize = - CGSizeMake(selectedCellFrame.size.width, - selectedCellFrame.size.height - cellTopBarHeight); - CGRect finalTabScreenshotFrame; - CalculateProjection(tabScreenshotImageSize, finalTabTargetSize, - ProjectionMode::kAspectFill, revisedTargetSize, - finalTabScreenshotFrame); - finalTabScreenshotFrame.origin.y += cellTopBarHeight; - - UIView<TabStripFoldAnimation>* tabStripPlaceholderView = - [transitionContextContent generateTabStripPlaceholderView]; - tabStripPlaceholderView.clipsToBounds = YES; - tabStripPlaceholderView.backgroundColor = [UIColor clearColor]; - [self.view addSubview:tabStripPlaceholderView]; - - CGRect tabStripInitialFrame = - CGRectMake(0, StatusBarHeight(), self.view.bounds.size.width, - tabStripPlaceholderView.frame.size.height); - CGRect tabStripFinalFrame = - CGRectMake(finalTabFrame.origin.x, - finalTabFrame.origin.y - tabStripInitialFrame.size.height, - finalTabFrame.size.width, tabStripInitialFrame.size.height); - CGRect shadowInitialFrame = - CGRectMake(0, CGRectGetMaxY(initialToolbarScreenshotFrame), - initialToolbarScreenshotFrame.size.width, 2); - CGRect shadowFinalFrame = - CGRectMake(0, CGRectGetMaxY(finalToolbarScreenshotFrame), - finalToolbarScreenshotFrame.size.width, 2); - - if (transitionType == TransitionType::TRANSITION_DISMISS) { - [tabStripPlaceholderView unfoldWithCompletion:nil]; - std::swap(initialTabFrame, finalTabFrame); - std::swap(tabStripInitialFrame, tabStripFinalFrame); - std::swap(shadowInitialFrame, shadowFinalFrame); - std::swap(initialTabScreenshotFrame, finalTabScreenshotFrame); - std::swap(initialToolbarScreenshotFrame, finalToolbarScreenshotFrame); - } else { - [tabStripPlaceholderView foldWithCompletion:^{ - [tabStripPlaceholderView removeFromSuperview]; - }]; - } - - tabStripPlaceholderView.frame = tabStripInitialFrame; - - // Create and setup placeholder view and subviews. - UIView* placeholderView = [[UIView alloc] initWithFrame:initialTabFrame]; - [placeholderView setClipsToBounds:YES]; - [placeholderView setUserInteractionEnabled:NO]; - - tabScreenshotImageView.frame = initialTabScreenshotFrame; - tabScreenshotImageView.contentMode = UIViewContentModeScaleToFill; - tabScreenshotImageView.autoresizingMask = UIViewAutoresizingNone; - [placeholderView addSubview:tabScreenshotImageView]; - - // Try using a snapshot view for dismissal animation because it's faster and - // the collection view has already been rendered. Use a client rendering - // otherwise. - SnapshotViewOption snapshotOption = SnapshotViewOption::SNAPSHOT_VIEW; - if (transitionType == TransitionType::TRANSITION_PRESENT) - snapshotOption = SnapshotViewOption::CLIENT_RENDERING; - - UIView* finalToolbarScreenshotImageView = - [self snapshotViewForView:selectedCell.topBar - withModel:tabModel - option:snapshotOption]; - finalToolbarScreenshotImageView.autoresizingMask = UIViewAutoresizingNone; - finalToolbarScreenshotImageView.frame = initialToolbarScreenshotFrame; - [placeholderView addSubview:finalToolbarScreenshotImageView]; - - UIView* toolbarScreenshotImageView = - transitionContextContent.toolbarSnapshotView; - toolbarScreenshotImageView.autoresizingMask = UIViewAutoresizingNone; - toolbarScreenshotImageView.frame = initialToolbarScreenshotFrame; - [placeholderView addSubview:toolbarScreenshotImageView]; - - UIImageView* toolbarShadowImageView = - [[UIImageView alloc] initWithFrame:shadowInitialFrame]; - [toolbarShadowImageView setAutoresizingMask:UIViewAutoresizingNone]; - [toolbarShadowImageView setImage:NativeImage(IDR_IOS_TOOLBAR_SHADOW)]; - [placeholderView addSubview:toolbarShadowImageView]; - - [self.view addSubview:placeholderView]; - - [selectedCell setHidden:YES]; - toolbarScreenshotImageView.alpha = - (transitionType == TransitionType::TRANSITION_DISMISS) ? 0 : 1.0; - - __weak TabSwitcherController* weakSelf = self; - void (^completionBlock)(BOOL) = ^(BOOL finished) { - TabSwitcherController* strongSelf = weakSelf; - - [tabStripPlaceholderView removeFromSuperview]; - [toolbarScreenshotImageView removeFromSuperview]; - [selectedCell setHidden:NO]; - [placeholderView removeFromSuperview]; - - if (transitionType == TransitionType::TRANSITION_DISMISS) { - [strongSelf restoreWindowBackgroundColor]; - if (finished) { - [strongSelf setTransitionContext:nil]; - } - } - [[strongSelf view] setUserInteractionEnabled:YES]; - completion(); - }; - - ProceduralBlock animationBlock = ^{ - toolbarScreenshotImageView.alpha = - transitionType == TransitionType::TRANSITION_DISMISS ? 1.0 : 0; - tabStripPlaceholderView.frame = tabStripFinalFrame; - toolbarShadowImageView.frame = shadowFinalFrame; - placeholderView.frame = finalTabFrame; - toolbarScreenshotImageView.frame = finalToolbarScreenshotFrame; - finalToolbarScreenshotImageView.frame = finalToolbarScreenshotFrame; - tabScreenshotImageView.frame = finalTabScreenshotFrame; - }; - - [UIView animateWithDuration:animated ? kTransitionAnimationDuration : 0 - delay:0 - options:UIViewAnimationCurveEaseInOut - animations:animationBlock - completion:completionBlock]; -} - -- (BOOL)initialTabModelAndTabIDMatchesTabModel:(nonnull TabModel*)tabModel - tabID:(nonnull NSString*)tabID { - TabModel* initialTabModel = self.transitionContext.initialTabModel; - NSString* initialTabID = - [self transitionContextContentForTabModel:initialTabModel].initialTabID; - return initialTabModel == tabModel && [initialTabID isEqualToString:tabID]; -} - -- (void)updateLocalPanelsCells { - auto mainTabPanel = - [self panelControllerForTabModel:[_tabSwitcherModel mainTabModel]]; - auto otrTabPanel = - [self panelControllerForTabModel:[_tabSwitcherModel otrTabModel]]; - [mainTabPanel reload]; - [otrTabPanel reload]; -} - -- (NSInteger)currentPanelIndex { - return [_tabSwitcherView currentPanelIndex]; -} - -- (int)offsetToDistantSessionPanels { - if (_signInPanelType == TabSwitcherSignInPanelsType::NO_PANEL) { - return kSignInPromoPanelIndex; - } - return kSignInPromoPanelIndex + 1; -} - -- (TabSwitcherSessionType)sessionTypeForPanelIndex:(NSInteger)panelIndex { - if (panelIndex == kLocalTabsOffTheRecordPanelIndex) - return TabSwitcherSessionType::OFF_THE_RECORD_SESSION; - if (panelIndex == kLocalTabsOnTheRecordPanelIndex) - return TabSwitcherSessionType::REGULAR_SESSION; - return TabSwitcherSessionType::DISTANT_SESSION; -} - -- (TabModel*)tabModelForSessionType:(TabSwitcherSessionType)sessionType { - switch (sessionType) { - case TabSwitcherSessionType::REGULAR_SESSION: - return [_tabSwitcherModel mainTabModel]; - break; - case TabSwitcherSessionType::OFF_THE_RECORD_SESSION: - return [_tabSwitcherModel otrTabModel]; - break; - case TabSwitcherSessionType::DISTANT_SESSION: - return nil; - break; - } -} - -- (TabModel*)currentSelectedModel { - const NSInteger currentPanelIndex = [self currentPanelIndex]; - const TabSwitcherSessionType sessionType = - [self sessionTypeForPanelIndex:currentPanelIndex]; - TabModel* model = [self tabModelForSessionType:sessionType]; - if (!model) - model = [self onLoadActiveModel]; - return model; -} - -- (TabModel*)onLoadActiveModel { - switch (_onLoadActiveModelType) { - case TabModelType::MODEL_MAIN: - return [_tabSwitcherModel mainTabModel]; - case TabModelType::MODEL_OTR: - return [_tabSwitcherModel otrTabModel]; - } -} - -- (void)selectPanelForTabModel:(TabModel*)selectedTabModel { - DCHECK(selectedTabModel == [_tabSwitcherModel otrTabModel] || - selectedTabModel == [_tabSwitcherModel mainTabModel]); - NSInteger selectedPanel = - (selectedTabModel == [_tabSwitcherModel otrTabModel]) - ? kLocalTabsOffTheRecordPanelIndex - : kLocalTabsOnTheRecordPanelIndex; - [_tabSwitcherView selectPanelAtIndex:selectedPanel]; -} - -- (TabSwitcherPanelController*)panelControllerForTabModel:(TabModel*)tabModel { - DCHECK(tabModel == [_tabSwitcherModel mainTabModel] || - tabModel == [_tabSwitcherModel otrTabModel]); - if (tabModel == [_tabSwitcherModel mainTabModel]) - return _onTheRecordSession; - if (tabModel == [_tabSwitcherModel otrTabModel]) - return _offTheRecordSession; - return nil; -} - -- (void)tabSwitcherDismissWithModel:(TabModel*)model animated:(BOOL)animated { - DCHECK(model); - [[self presentedViewController] dismissViewControllerAnimated:NO - completion:nil]; - [self.delegate tabSwitcher:self - shouldFinishWithActiveModel:model - focusOmnibox:NO]; - [self performTabSwitcherTransition:TransitionType::TRANSITION_DISMISS - withModel:model - animated:animated - withCompletion:^{ - [self.animationDelegate - tabSwitcherDismissalAnimationDidEnd:self]; - [self.delegate tabSwitcherDismissTransitionDidEnd:self]; - [_tabSwitcherView wasHidden]; - }]; -} - -- (void)tabSwitcherDismissWithCurrentSelectedModel { - TabModel* model = [self currentSelectedModel]; - base::RecordAction(base::UserMetricsAction("MobileTabSwitcherClose")); - [self tabSwitcherDismissWithModel:model animated:YES]; -} - -- (Tab*)dismissWithNewTabAnimation:(const GURL&)URL - atIndex:(NSUInteger)position - transition:(ui::PageTransition)transition - tabModel:(TabModel*)tabModel { - NSUInteger tabIndex = position; - if (position > tabModel.count) - tabIndex = tabModel.count; - - web::NavigationManager::WebLoadParams loadParams(URL); - loadParams.transition_type = transition; - - Tab* tab = [tabModel insertTabWithLoadParams:loadParams - opener:nil - openedByDOM:NO - atIndex:tabIndex - inBackground:NO]; - - [self tabSwitcherDismissWithModel:tabModel animated:YES]; - - return tab; -} - -- (BOOL)isPanelIndexForLocalSession:(NSUInteger)panelIndex { - return panelIndex == kLocalTabsOnTheRecordPanelIndex || - panelIndex == kLocalTabsOffTheRecordPanelIndex; -} - -- (void)openTabWithContentOfDistantTab: - (synced_sessions::DistantTab const*)distantTab { - sync_sessions::OpenTabsUIDelegate* openTabs = - ProfileSyncServiceFactory::GetForBrowserState(_browserState) - ->GetOpenTabsUIDelegate(); - const sessions::SessionTab* toLoad = nullptr; - if (openTabs->GetForeignTab(distantTab->session_tag, distantTab->tab_id, - &toLoad)) { - // Disable user interactions until the tab is inserted to prevent multiple - // concurrent tab model updates. - [_tabSwitcherView setUserInteractionEnabled:NO]; - - TabModel* tabModel = [_tabSwitcherModel mainTabModel]; - WebStateList* webStateList = [tabModel webStateList]; - webStateList->InsertWebState( - webStateList->count(), - session_util::CreateWebStateWithNavigationEntries( - [tabModel browserState], toLoad->current_navigation_index, - toLoad->navigations), - WebStateList::INSERT_FORCE_INDEX | WebStateList::INSERT_ACTIVATE, - WebStateOpener()); - - // Reenable touch events. - [_tabSwitcherView setUserInteractionEnabled:YES]; - [self tabSwitcherDismissWithModel:tabModel animated:YES]; - } -} - -- (void)removePromoPanelHeaderCellIfNeeded { - if (_shouldRemovePromoPanelHeaderCell) { - _shouldRemovePromoPanelHeaderCell = NO; - [[_tabSwitcherView headerView] - removeSessionsAtIndexes:@[ @(kSignInPromoPanelIndex) ]]; - } -} - -- (void)addPromoPanelHeaderCellIfNeeded { - if (_shouldAddPromoPanelHeaderCell) { - _shouldAddPromoPanelHeaderCell = NO; - [[_tabSwitcherView headerView] - insertSessionsAtIndexes:@[ @(kSignInPromoPanelIndex) ]]; - } -} - -- (void)reopenClosedTab { - sessions::TabRestoreService* const tabRestoreService = - IOSChromeTabRestoreServiceFactory::GetForBrowserState(_browserState); - if (!tabRestoreService || tabRestoreService->entries().empty()) - return; - - const std::unique_ptr<sessions::TabRestoreService::Entry>& entry = - tabRestoreService->entries().front(); - // Only handle the TAB type. - if (entry->type != sessions::TabRestoreService::TAB) - return; - - [self.dispatcher openNewTab:[OpenNewTabCommand command]]; - TabRestoreServiceDelegateImplIOS* const delegate = - TabRestoreServiceDelegateImplIOSFactory::GetForBrowserState( - _browserState); - tabRestoreService->RestoreEntryById(delegate, entry->id, - WindowOpenDisposition::CURRENT_TAB); -} - -#pragma mark - TabSwitcherModelDelegate - -- (void)distantSessionsRemovedAtSortedIndexes:(NSArray*)removedIndexes - insertedAtSortedIndexes:(NSArray*)insertedIndexes { - // Update the panels - int offset = [self offsetToDistantSessionPanels]; - - // Iterate in reverse order so that indexes in |removedIndexes| stays synced - // with the indexes in |_controllersOfDistantSessions|. - for (NSNumber* objCIndex in [removedIndexes reverseObjectEnumerator]) { - int index = [objCIndex intValue]; - [_tabSwitcherView removePanelViewAtIndex:index + offset]; - [_controllersOfDistantSessions removeObjectAtIndex:index]; - } - - for (NSNumber* objCIndex in insertedIndexes) { - int index = [objCIndex intValue]; - std::string tag = [_tabSwitcherModel tagOfDistantSessionAtIndex:index]; - TabSwitcherPanelController* panelController = [ - [TabSwitcherPanelController alloc] - initWithModel:_tabSwitcherModel - forDistantSessionWithTag:tag - browserState:_browserState - presenter:self /* id<SigninPresenter, SyncPresenter> */ - dispatcher:self.dispatcher]; - [panelController setDelegate:self]; - [_tabSwitcherView addPanelView:[panelController view] - atIndex:index + offset]; - [_controllersOfDistantSessions insertObject:panelController atIndex:index]; - } - - // Update the header view. - // The header view's content is created using the panel's content. - [[_tabSwitcherView headerView] reloadData]; -} - -- (void)distantSessionMayNeedUpdate:(std::string const&)tag { - for (TabSwitcherPanelController* panel in _controllersOfDistantSessions) { - DCHECK([panel isKindOfClass:[TabSwitcherPanelController class]]); - if ([panel sessionTag] == tag) { - [panel updateCollectionViewIfNeeded]; - return; - } - } -} - -- (void)localSessionMayNeedUpdate:(TabSwitcherSessionType)type { - if (type == TabSwitcherSessionType::REGULAR_SESSION) { - [_onTheRecordSession updateCollectionViewIfNeeded]; - } else { - DCHECK(type == TabSwitcherSessionType::OFF_THE_RECORD_SESSION); - [_offTheRecordSession updateCollectionViewIfNeeded]; - } -} - -- (void)signInPanelChangedTo:(TabSwitcherSignInPanelsType)newPanelType { - if (_signInPanelType == newPanelType) - return; - - // Remove promo panel that is no longer relevant, if any. - if (_signInPanelType != TabSwitcherSignInPanelsType::NO_PANEL) { - _shouldRemovePromoPanelHeaderCell = YES; - BOOL updateScrollView = - [_tabSwitcherView currentPanelIndex] != kSignInPromoPanelIndex; - [_tabSwitcherView removePanelViewAtIndex:kSignInPromoPanelIndex - updateScrollView:updateScrollView]; - _signinPromoViewMediator.consumer = nil; - [_signinPromoViewMediator signinPromoViewRemoved]; - _signinPromoViewMediator = nil; - _signInPanelOverlayView = nil; - } else { - _shouldAddPromoPanelHeaderCell = YES; - } - [self addPromoPanelForSignInPanelType:newPanelType]; -} - -- (void)addPromoPanelForSignInPanelType:(TabSwitcherSignInPanelsType)panelType { - _signInPanelType = panelType; - DCHECK_EQ(nil, _signInPanelOverlayView); - if (panelType != TabSwitcherSignInPanelsType::NO_PANEL) { - _signInPanelOverlayView = [[TabSwitcherPanelOverlayView alloc] - initWithFrame:CGRectZero - browserState:_browserState - presenter:self /* id<SigninPresenter, SyncPresenter> */ - dispatcher:self.dispatcher]; - [_signInPanelOverlayView - setOverlayType:PanelOverlayTypeFromSignInPanelsType(panelType)]; - _signInPanelOverlayView.delegate = self; - if (panelType == TabSwitcherSignInPanelsType::PANEL_USER_SIGNED_OUT) { - DCHECK_NE(nil, _signInPanelOverlayView.signinPromoView); - _signinPromoViewMediator = [[SigninPromoViewMediator alloc] - initWithBrowserState:_browserState - accessPoint:signin_metrics::AccessPoint:: - ACCESS_POINT_TAB_SWITCHER - presenter:self]; - _signinPromoViewMediator.consumer = self; - _signInPanelOverlayView.signinPromoView.delegate = - _signinPromoViewMediator; - [[_signinPromoViewMediator createConfigurator] - configureSigninPromoView:_signInPanelOverlayView.signinPromoView]; - } - [_tabSwitcherView addPanelView:_signInPanelOverlayView - atIndex:kSignInPromoPanelIndex]; - } -} - -- (CGSize)sizeForItemAtIndex:(NSUInteger)index - inSession:(TabSwitcherSessionType)session { - switch (session) { - case TabSwitcherSessionType::OFF_THE_RECORD_SESSION: - return [[_offTheRecordSession view] cellSize]; - case TabSwitcherSessionType::REGULAR_SESSION: - return [[_onTheRecordSession view] cellSize]; - case TabSwitcherSessionType::DISTANT_SESSION: - NOTREACHED(); - return {}; - } -} - -- (BOOL)isSigninInProgress { - return _signinPromoViewMediator.signinInProgress; -} - -#pragma mark - TabSwitcherHeaderViewDelegate - -- (void)tabSwitcherHeaderViewDismiss:(TabSwitcherHeaderView*)view { - [self tabSwitcherDismissWithCurrentSelectedModel]; -} - -- (void)tabSwitcherHeaderViewDidSelectSessionAtIndex:(NSInteger)index { - switch (index) { - case kLocalTabsOffTheRecordPanelIndex: - base::RecordAction(base::UserMetricsAction( - "MobileTabSwitcherHeaderViewSelectIncognitoPanel")); - break; - case kLocalTabsOnTheRecordPanelIndex: - base::RecordAction(base::UserMetricsAction( - "MobileTabSwitcherHeaderViewSelectNonIncognitoPanel")); - break; - default: - base::RecordAction(base::UserMetricsAction( - "MobileTabSwitcherHeaderViewSelectDistantSessionPanel")); - break; - } - [_tabSwitcherView selectPanelAtIndex:index]; -} - -#pragma mark - TabSwitcherHeaderViewDataSource - -- (NSInteger)tabSwitcherHeaderViewSessionCount { - NSInteger promoPanel = (![_tabSwitcherModel distantSessionCount]) ? 1 : 0; - return [_tabSwitcherModel sessionCount] + promoPanel; -} - -- (TabSwitcherSessionCellData*)sessionCellDataAtIndex:(NSUInteger)index { - if (index == kLocalTabsOffTheRecordPanelIndex) { - // If has incognito tabs return incognito cell data. - return [TabSwitcherSessionCellData incognitoSessionCellData]; - } else if (index == kLocalTabsOnTheRecordPanelIndex) { - return [TabSwitcherSessionCellData openTabSessionCellData]; - } else { - if (![_tabSwitcherModel distantSessionCount]) { - // Display promo panel cell if there is no distant sessions. - return [TabSwitcherSessionCellData otherDevicesSessionCellData]; - } else { - index -= kHeaderDistantSessionIndexOffset; - - sync_pb::SyncEnums::DeviceType deviceType = - sync_pb::SyncEnums::TYPE_UNSET; - NSString* cellTitle = nil; - - if (index < _controllersOfDistantSessions.count) { - TabSwitcherPanelController* panel = - [_controllersOfDistantSessions objectAtIndex:index]; - const synced_sessions::DistantSession* distantSession = - [panel distantSession]; - deviceType = distantSession->device_type; - cellTitle = base::SysUTF8ToNSString(distantSession->name); - } - TabSwitcherSessionCellType cellType; - switch (deviceType) { - case sync_pb::SyncEnums::TYPE_PHONE: - cellType = kPhoneRemoteSessionCell; - break; - case sync_pb::SyncEnums::TYPE_TABLET: - cellType = kTabletRemoteSessionCell; - break; - default: - cellType = kLaptopRemoteSessionCell; - break; - } - TabSwitcherSessionCellData* sessionData = - [[TabSwitcherSessionCellData alloc] initWithSessionCellType:cellType]; - sessionData.title = cellTitle; - return sessionData; - } - } -} - -- (NSInteger)tabSwitcherHeaderViewSelectedPanelIndex { - return [_tabSwitcherView currentPanelIndex]; -} - -#pragma mark - TabSwitcherViewDelegate - -- (void)openNewTabInPanelAtIndex:(NSInteger)panelIndex { - CHECK(panelIndex >= 0); - DCHECK([self isPanelIndexForLocalSession:panelIndex]); - BOOL incognito = !(panelIndex == kLocalTabsOnTheRecordPanelIndex); - if (incognito) { - base::RecordAction( - base::UserMetricsAction("MobileTabSwitcherCreateIncognitoTab")); - } else { - base::RecordAction( - base::UserMetricsAction("MobileTabSwitcherCreateNonIncognitoTab")); - } - // Create and execute command to create the tab. - [self.dispatcher - openNewTab:[OpenNewTabCommand commandWithIncognito:incognito]]; -} - -- (NewTabButtonStyle)buttonStyleForPanelAtIndex:(NSInteger)panelIndex { - CHECK(panelIndex >= 0); - switch (panelIndex) { - case kLocalTabsOnTheRecordPanelIndex: - if ([_onTheRecordSession shouldShowNewTabButton]) { - return NewTabButtonStyle::BLUE; - } else { - return NewTabButtonStyle::HIDDEN; - } - case kLocalTabsOffTheRecordPanelIndex: - if ([_offTheRecordSession shouldShowNewTabButton]) { - return NewTabButtonStyle::GRAY; - } else { - return NewTabButtonStyle::HIDDEN; - } - default: - return NewTabButtonStyle::HIDDEN; - } -} - -- (BOOL)shouldShowDismissButtonForPanelAtIndex:(NSInteger)panelIndex { - CHECK(panelIndex >= 0); - switch (panelIndex) { - case kLocalTabsOnTheRecordPanelIndex: - return [[_tabSwitcherModel mainTabModel] count] != 0; - case kLocalTabsOffTheRecordPanelIndex: - return [[_tabSwitcherModel otrTabModel] count] != 0; - default: - return [[self currentSelectedModel] count] != 0; - } -} - -- (void)tabSwitcherViewDelegateDismissTabSwitcher:(TabSwitcherView*)view { - [self tabSwitcherDismissWithCurrentSelectedModel]; -} - -#pragma mark - TabSwitcherPanelControllerDelegate - -- (void)tabSwitcherPanelController: - (TabSwitcherPanelController*)tabSwitcherPanelController - didSelectDistantTab:(synced_sessions::DistantTab*)tab { - DCHECK(tab); - [self openTabWithContentOfDistantTab:tab]; - base::RecordAction( - base::UserMetricsAction("MobileTabSwitcherOpenDistantTab")); -} - -- (void)tabSwitcherPanelController: - (TabSwitcherPanelController*)tabSwitcherPanelController - didSelectLocalTab:(Tab*)tab { - DCHECK(tab); - const TabSwitcherSessionType panelSessionType = - tabSwitcherPanelController.sessionType; - TabModel* tabModel = [self tabModelForSessionType:panelSessionType]; - [tabModel setCurrentTab:tab]; - [self tabSwitcherDismissWithModel:tabModel animated:YES]; - if (panelSessionType == TabSwitcherSessionType::OFF_THE_RECORD_SESSION) { - base::RecordAction( - base::UserMetricsAction("MobileTabSwitcherOpenIncognitoTab")); - } else { - base::RecordAction( - base::UserMetricsAction("MobileTabSwitcherOpenNonIncognitoTab")); - } -} - -- (void)tabSwitcherPanelController: - (TabSwitcherPanelController*)tabSwitcherPanelController - didCloseLocalTab:(Tab*)tab { - DCHECK(tab); - const TabSwitcherSessionType panelSessionType = - tabSwitcherPanelController.sessionType; - TabModel* tabModel = - panelSessionType == TabSwitcherSessionType::OFF_THE_RECORD_SESSION - ? [_tabSwitcherModel otrTabModel] - : [_tabSwitcherModel mainTabModel]; - DCHECK_NE(NSNotFound, static_cast<NSInteger>([tabModel indexOfTab:tab])); - [tabModel closeTab:tab]; - [self.dispatcher - setIncognitoContentVisible:([[_tabSwitcherModel otrTabModel] count] > 0)]; - - if (panelSessionType == TabSwitcherSessionType::OFF_THE_RECORD_SESSION) { - base::RecordAction( - base::UserMetricsAction("MobileTabSwitcherCloseIncognitoTab")); - } else { - base::RecordAction( - base::UserMetricsAction("MobileTabSwitcherCloseNonIncognitoTab")); - } -} - -- (void)tabSwitcherPanelControllerDidUpdateOverlayViewVisibility: - (TabSwitcherPanelController*)tabSwitcherPanelController { - [_tabSwitcherView updateOverlayButtonState]; -} - -#pragma mark - SyncPresenter - -- (void)showReauthenticateSignin { - [self.dispatcher - showSignin: - [[ShowSigninCommand alloc] - initWithOperation:AUTHENTICATION_OPERATION_REAUTHENTICATE - accessPoint:signin_metrics::AccessPoint:: - ACCESS_POINT_UNKNOWN] - baseViewController:self]; -} - -- (void)showSyncSettings { - [self.dispatcher showSyncSettingsFromViewController:self]; -} - -- (void)showSyncPassphraseSettings { - [self.dispatcher showSyncPassphraseSettingsFromViewController:self]; -} - -#pragma mark - SigninPresenter - -- (void)showSignin:(ShowSigninCommand*)command { - [self.dispatcher showSignin:command baseViewController:self]; -} - -#pragma mark - SigninPromoViewConsumer - -- (void)configureSigninPromoWithConfigurator: - (SigninPromoViewConfigurator*)configurator - identityChanged:(BOOL)identityChanged { - DCHECK_NE(nil, _signInPanelOverlayView); - DCHECK_NE(nil, _signInPanelOverlayView.signinPromoView); - [configurator - configureSigninPromoView:_signInPanelOverlayView.signinPromoView]; -} - -- (void)signinDidFinish { - [_tabSwitcherModel syncedSessionsChanged]; -} - -#pragma mark - TabSwitcherPanelOverlayViewDelegate - -- (void)tabSwitcherPanelOverlViewWasShown: - (TabSwitcherPanelOverlayView*)tabSwitcherPanelOverlayView { - [_signinPromoViewMediator signinPromoViewVisible]; -} - -- (void)tabSwitcherPanelOverlViewWasHidden: - (TabSwitcherPanelOverlayView*)tabSwitcherPanelOverlayView { - [_signinPromoViewMediator signinPromoViewHidden]; -} - -@end
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_egtest_util.h b/ios/chrome/browser/ui/tab_switcher/tab_switcher_egtest_util.h deleted file mode 100644 index 737ad55..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_egtest_util.h +++ /dev/null
@@ -1,43 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_EGTEST_UTIL_H_ -#define IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_EGTEST_UTIL_H_ - -@protocol GREYMatcher; - -namespace chrome_test_util { - -// Returns the GREYMatcher for the button that opens the tab switcher. -id<GREYMatcher> TabletTabSwitcherOpenButton(); - -// Returns the GREYMatcher for the button that closes the tab switcher. -id<GREYMatcher> TabletTabSwitcherCloseButton(); - -// Returns the GREYMatcher for the button that creates new non incognito tabs -// from within the tab switcher. -id<GREYMatcher> TabletTabSwitcherNewTabButton(); - -// Returns the GREYMatcher for the button that creates new incognito tabs from -// within the tab switcher. -id<GREYMatcher> TabletTabSwitcherNewIncognitoTabButton(); - -// Returns the GREYMatcher for the button that closes tabs on iPad. -id<GREYMatcher> TabletTabSwitcherCloseTabButton(); - -// Returns the GREYMatcher for the button to go to the non incognito panel in -// the tab switcher. -id<GREYMatcher> TabletTabSwitcherOpenTabsPanelButton(); - -// Returns the GREYMatcher for the button to go to the incognito panel in -// the tab switcher. -id<GREYMatcher> TabletTabSwitcherIncognitoTabsPanelButton(); - -// Returns the GREYMatcher for the button to go to the other devices panel in -// the tab switcher. -id<GREYMatcher> TabletTabSwitcherOtherDevicesPanelButton(); - -} // namespace chrome_test_util - -#endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_EGTEST_UTIL_H_
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_egtest_util.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_egtest_util.mm deleted file mode 100644 index 64ebd09..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_egtest_util.mm +++ /dev/null
@@ -1,59 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_egtest_util.h" - -#import <EarlGrey/EarlGrey.h> - -#include "ios/chrome/browser/ui/tools_menu/public/tools_menu_constants.h" -#include "ios/chrome/grit/ios_strings.h" -#import "ios/chrome/test/app/chrome_test_util.h" -#import "ios/chrome/test/earl_grey/chrome_matchers.h" -#include "ui/base/l10n/l10n_util.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -namespace chrome_test_util { - -id<GREYMatcher> TabletTabSwitcherCloseButton() { - return ButtonWithAccessibilityLabelId(IDS_IOS_TAB_STRIP_LEAVE_TAB_SWITCHER); -} - -id<GREYMatcher> TabletTabSwitcherNewTabButton() { - return grey_allOf( - ButtonWithAccessibilityLabelId(IDS_IOS_TAB_SWITCHER_CREATE_NEW_TAB), - grey_sufficientlyVisible(), nil); -} - -id<GREYMatcher> TabletTabSwitcherNewIncognitoTabButton() { - return grey_allOf(ButtonWithAccessibilityLabelId( - IDS_IOS_TAB_SWITCHER_CREATE_NEW_INCOGNITO_TAB), - grey_sufficientlyVisible(), nil); -} - -id<GREYMatcher> TabletTabSwitcherCloseTabButton() { - return ButtonWithAccessibilityLabelId(IDS_IOS_TOOLS_MENU_CLOSE_TAB); -} - -id<GREYMatcher> TabletTabSwitcherOpenTabsPanelButton() { - NSString* accessibility_label = l10n_util::GetNSStringWithFixup( - IDS_IOS_TAB_SWITCHER_HEADER_NON_INCOGNITO_TABS); - return grey_accessibilityLabel(accessibility_label); -} - -id<GREYMatcher> TabletTabSwitcherIncognitoTabsPanelButton() { - NSString* accessibility_label = l10n_util::GetNSStringWithFixup( - IDS_IOS_TAB_SWITCHER_HEADER_INCOGNITO_TABS); - return grey_accessibilityLabel(accessibility_label); -} - -id<GREYMatcher> TabletTabSwitcherOtherDevicesPanelButton() { - NSString* accessibility_label = l10n_util::GetNSStringWithFixup( - IDS_IOS_TAB_SWITCHER_HEADER_OTHER_DEVICES_TABS); - return grey_accessibilityLabel(accessibility_label); -} - -} // namespace chrome_test_util
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_header_cell.h b/ios/chrome/browser/ui/tab_switcher/tab_switcher_header_cell.h deleted file mode 100644 index 7b30d0669..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_header_cell.h +++ /dev/null
@@ -1,24 +0,0 @@ -// 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. - -#ifndef IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_HEADER_CELL_H_ -#define IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_HEADER_CELL_H_ - -#import <UIKit/UIKit.h> - -@class TabSwitcherSessionCellData; - -// This class is the cell class used in the table view of the tab switcher -// header. -@interface TabSwitcherHeaderCell : UICollectionViewCell - -// Default table view cell identifier. -+ (NSString*)identifier; - -// Load the cell content using the given TabSwitcherSessionCellData object. -- (void)loadSessionCellData:(TabSwitcherSessionCellData*)sessionCellData; - -@end - -#endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_HEADER_CELL_H_
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_header_cell.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_header_cell.mm deleted file mode 100644 index ecd0674..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_header_cell.mm +++ /dev/null
@@ -1,92 +0,0 @@ -// 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 "ios/chrome/browser/ui/tab_switcher/tab_switcher_header_cell.h" - -#include "base/logging.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_session_cell_data.h" -#import "ios/chrome/browser/ui/uikit_ui_util.h" -#import "ios/third_party/material_components_ios/src/components/Palettes/src/MaterialPalettes.h" -#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -namespace { -// View alpha value used when the header cell is not selected. -const CGFloat kInactiveAlpha = 0.54; -const CGFloat kImageViewWidth = 24; -} - -@interface TabSwitcherHeaderCell () { - UIImageView* _imageView; - UILabel* _label; -} -@end - -@implementation TabSwitcherHeaderCell - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - self.backgroundColor = [[MDCPalette greyPalette] tint900]; - [self loadSubviews]; - [self setSelected:NO]; - } - return self; -} - -+ (NSString*)identifier { - return @"TabSwitcherHeaderCell"; -} - -- (NSString*)reuseIdentifier { - return [[self class] identifier]; -} - -- (void)loadSessionCellData:(TabSwitcherSessionCellData*)sessionCellData { - [_imageView setImage:sessionCellData.image]; - [_label setText:sessionCellData.title]; - [self setNeedsLayout]; -} - -- (void)setSelected:(BOOL)selected { - [super setSelected:selected]; - [_imageView setAlpha:selected ? 1. : kInactiveAlpha]; - [_label setAlpha:selected ? 1. : kInactiveAlpha]; - [self setNeedsLayout]; -} - -#pragma mark - Private - -- (void)loadSubviews { - _imageView = [[UIImageView alloc] initWithFrame:CGRectZero]; - [_imageView setContentMode:UIViewContentModeCenter]; - [_imageView setTranslatesAutoresizingMaskIntoConstraints:NO]; - [_imageView setTintColor:[UIColor whiteColor]]; - _label = [[UILabel alloc] initWithFrame:CGRectZero]; - [_label setBackgroundColor:[UIColor clearColor]]; - [_label setTranslatesAutoresizingMaskIntoConstraints:NO]; - [_label setTextColor:[UIColor whiteColor]]; - [_label setFont:[MDCTypography body2Font]]; - - // Configure layout. - // The icon and the title are centered within |contentView|, have a spacing of - // one-third of icon width and the icon is on the leading side of title. - UIStackView* stackView = - [[UIStackView alloc] initWithArrangedSubviews:@[ _imageView, _label ]]; - [stackView setSpacing:kImageViewWidth / 3]; - [self.contentView addSubview:stackView]; - - [stackView setTranslatesAutoresizingMaskIntoConstraints:NO]; - [NSLayoutConstraint activateConstraints:@[ - [self.contentView.centerYAnchor - constraintEqualToAnchor:[stackView centerYAnchor]], - [self.contentView.centerXAnchor - constraintEqualToAnchor:[stackView centerXAnchor]] - ]]; -} - -@end
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_header_view.h b/ios/chrome/browser/ui/tab_switcher/tab_switcher_header_view.h deleted file mode 100644 index 208ec2a..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_header_view.h +++ /dev/null
@@ -1,64 +0,0 @@ -// 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. - -#ifndef IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_HEADER_VIEW_H_ -#define IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_HEADER_VIEW_H_ - -#import <UIKit/UIKit.h> - -#include "base/ios/block_types.h" - -@class TabSwitcherSessionCellData; -@class TabSwitcherHeaderView; - -@protocol TabSwitcherHeaderViewDelegate<NSObject> - -- (void)tabSwitcherHeaderViewDismiss:(TabSwitcherHeaderView*)view; -- (void)tabSwitcherHeaderViewDidSelectSessionAtIndex:(NSInteger)index; -// Called to get the currently selected panel index. Returns NSNotFound when no -// panel is selected. -- (NSInteger)tabSwitcherHeaderViewSelectedPanelIndex; - -@end - -@protocol TabSwitcherHeaderViewDataSource<NSObject> - -- (NSInteger)tabSwitcherHeaderViewSessionCount; -- (TabSwitcherSessionCellData*)sessionCellDataAtIndex:(NSUInteger)index; - -@end - -@interface TabSwitcherHeaderView : UIView - -@property(nonatomic, weak) id<TabSwitcherHeaderViewDelegate> delegate; -@property(nonatomic, weak) id<TabSwitcherHeaderViewDataSource> dataSource; -@property(weak, nonatomic, readonly) UIView* dismissButton; - -// Selects the item at the specified index. -// The delegate is not called. -- (void)selectItemAtIndex:(NSInteger)index; - -// Reload the collection view. -- (void)reloadData; - -// Performs an update on the header view using the passed block. -- (void)performUpdate:(void (^)(TabSwitcherHeaderView* headerView))updateBlock; - -// Performs an update on the header view using the passed block, the completion -// handler block is called at the end of the update animations. -- (void)performUpdate:(void (^)(TabSwitcherHeaderView* headerView))updateBlock - completion:(ProceduralBlock)completion; - -// Updates methods can only be called inside an update block passed to the -// - (void)performUpdate: method. -// Update methods takes arrays of NSNumbers. -- (void)insertSessionsAtIndexes:(NSArray*)indexes; -- (void)removeSessionsAtIndexes:(NSArray*)indexes; - -// Returns the accessibility title of the panel at index |index|. -- (NSString*)panelTitleAtIndex:(NSInteger)index; - -@end - -#endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_HEADER_VIEW_H_
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_header_view.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_header_view.mm deleted file mode 100644 index ed29177..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_header_view.mm +++ /dev/null
@@ -1,401 +0,0 @@ -// 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 "ios/chrome/browser/ui/tab_switcher/tab_switcher_header_view.h" - -#import "base/ios/block_types.h" -#include "base/logging.h" -#include "base/metrics/user_metrics_action.h" -#import "ios/chrome/browser/procedural_block_types.h" -#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" -#include "ios/chrome/browser/ui/rtl_geometry.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_header_cell.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_session_cell_data.h" -#import "ios/chrome/common/ui_util/constraints_ui_util.h" -#include "ios/chrome/grit/ios_strings.h" -#import "ios/third_party/material_components_ios/src/components/Palettes/src/MaterialPalettes.h" -#include "ui/base/l10n/l10n_util.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -namespace { -const CGFloat kCollectionViewTopMargin = 39.0; -const CGFloat kCollectionViewHeight = 56.0; -const CGFloat kDismissButtonWidth = 46.0; -const CGFloat kDismissButtonHeight = 39.0; -const CGFloat kCollectionViewCellWidth = 238; -const CGFloat kActiveSpaceIndicatorHeight = 2; -enum PanelSelectionChangeDirection { RIGHT, LEFT }; -} - -@protocol AccessiblePanelSelectorDelegate -// Scrolls to the panel in the direction |direction|, if possible. -- (void)moveToPanelInDirection:(PanelSelectionChangeDirection)direction; -@end - -// An invisible view that offers VoiceOver control of the panel selection -// UICollectionView. -// Notes: -// Directly subclassing UICollectionView resulted in a tons of unwanted -// interactions with the cells. -// Subclassing UIAccessibilityElement instead of UIView is not possible if -// we want the accessibilityFrame to resize itself using autoresizing masks. -@interface AccessiblePanelSelectorView : UIView { - // The delegate which receives actions. - __weak id<AccessiblePanelSelectorDelegate> _delegate; -} -- (void)setDelegate:(id<AccessiblePanelSelectorDelegate>)delegate; -@end - -@implementation AccessiblePanelSelectorView - -- (void)setDelegate:(id<AccessiblePanelSelectorDelegate>)delegate { - _delegate = delegate; -} - -- (UIAccessibilityTraits)accessibilityTraits { - return [super accessibilityTraits] | UIAccessibilityTraitAdjustable | - UIAccessibilityTraitCausesPageTurn; -} - -- (BOOL)isAccessibilityElement { - return YES; -} - -- (void)accessibilityIncrement { - [_delegate moveToPanelInDirection:RIGHT]; -} - -- (void)accessibilityDecrement { - [_delegate moveToPanelInDirection:LEFT]; -} - -@end - -@interface TabSwitcherHeaderView ()<UICollectionViewDataSource, - UICollectionViewDelegate, - AccessiblePanelSelectorDelegate> { - UICollectionViewFlowLayout* _flowLayout; - UICollectionView* _collectionView; - AccessiblePanelSelectorView* _accessibilityView; - UIButton* _dismissButton; - UIView* _activeSpaceIndicatorView; - - BOOL _performingUpdate; -} - -// Loads and initializes subviews. -- (void)loadSubviews; -// Performs layout of the collection view. -- (void)layoutCollectionView; - -@end - -@implementation TabSwitcherHeaderView - -@synthesize delegate = _delegate; -@synthesize dataSource = _dataSource; - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - self.backgroundColor = [[MDCPalette greyPalette] tint900]; - [self loadSubviews]; - } - return self; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - [self layoutCollectionView]; -} - -- (void)selectItemAtIndex:(NSInteger)index { - NSInteger selectedIndex = [self selectedIndex]; - if (selectedIndex != index) { - [_collectionView - selectItemAtIndexPath:[NSIndexPath indexPathForItem:index inSection:0] - animated:NO - scrollPosition:UICollectionViewScrollPositionNone]; - [self updateSelectionAtIndex:index animated:YES]; - } -} - -- (void)reloadData { - [_collectionView reloadData]; - [_collectionView layoutIfNeeded]; -} - -- (void)performUpdate:(void (^)(TabSwitcherHeaderView* headerView))updateBlock { - [self performUpdate:updateBlock completion:nil]; -} - -- (void)performUpdate:(void (^)(TabSwitcherHeaderView* headerView))updateBlock - completion:(ProceduralBlock)completion { - DCHECK(updateBlock); - - __weak TabSwitcherHeaderView* weakSelf = self; - ProceduralBlock batchUpdates = ^{ - TabSwitcherHeaderView* strongSelf = weakSelf; - if (!strongSelf) - return; - strongSelf->_performingUpdate = YES; - updateBlock(strongSelf); - strongSelf->_performingUpdate = NO; - }; - ProceduralBlockWithBool batchCompletion = ^(BOOL finished) { - // Reestablish selection after the update. - const NSInteger selectedPanelIndex = - [[weakSelf delegate] tabSwitcherHeaderViewSelectedPanelIndex]; - if (selectedPanelIndex != NSNotFound) - [weakSelf selectItemAtIndex:selectedPanelIndex]; - if (completion) - completion(); - }; - - [_collectionView performBatchUpdates:batchUpdates completion:batchCompletion]; -} - -- (void)insertSessionsAtIndexes:(NSArray*)indexes { - DCHECK(_performingUpdate); - [_collectionView - insertItemsAtIndexPaths:[self indexPathArrayWithIndexes:indexes]]; -} - -- (void)removeSessionsAtIndexes:(NSArray*)indexes { - DCHECK(_performingUpdate); - [_collectionView - deleteItemsAtIndexPaths:[self indexPathArrayWithIndexes:indexes]]; -} - -- (UIView*)dismissButton { - return _dismissButton; -} - -#pragma mark - Private - -- (NSInteger)selectedIndex { - NSInteger selectedIndex = NSNotFound; - NSArray* selectedIndexPaths = [_collectionView indexPathsForSelectedItems]; - if (selectedIndexPaths.count) { - NSIndexPath* selectedIndexPath = selectedIndexPaths[0]; - selectedIndex = selectedIndexPath.item; - } - return selectedIndex; -} - -- (NSInteger)itemCount { - return [_collectionView numberOfItemsInSection:0]; -} - -// The UICollectionViewFlowLayout enumerate indexes from right to left when the -// UI is configured in RTL mode. This method always returns the index from value -// for a left to right enumeration order. -- (NSInteger)leftToRightIndexForFlowLayoutIndex:(NSInteger)index { - return UseRTLLayout() ? ([self itemCount] - 1) - index : index; -} - -- (void)updateSelectionAtIndex:(NSInteger)index animated:(BOOL)animated { - const CGRect cellRect = CGRectMake( - [self leftToRightIndexForFlowLayoutIndex:index] * - kCollectionViewCellWidth, - 0, kCollectionViewCellWidth, [_collectionView bounds].size.height); - [_collectionView scrollRectToVisible:cellRect animated:animated]; - [self layoutActiveSpaceIndicatorAnimated:animated]; -} - -- (NSArray*)indexPathArrayWithIndexes:(NSArray*)indexes { - NSMutableArray* array = - [[NSMutableArray alloc] initWithCapacity:indexes.count]; - for (NSNumber* index in indexes) { - [array - addObject:[NSIndexPath indexPathForItem:[index intValue] inSection:0]]; - } - return array; -} - -- (void)loadSubviews { - UICollectionViewFlowLayout* flowLayout = - [[UICollectionViewFlowLayout alloc] init]; - [flowLayout setMinimumLineSpacing:0]; - [flowLayout setMinimumInteritemSpacing:0]; - const CGSize cellSize = - CGSizeMake(kCollectionViewCellWidth, kCollectionViewHeight); - [flowLayout setItemSize:cellSize]; - [flowLayout setScrollDirection:UICollectionViewScrollDirectionHorizontal]; - _flowLayout = flowLayout; - - _collectionView = - [[UICollectionView alloc] initWithFrame:[self collectionViewFrame] - collectionViewLayout:flowLayout]; - [_collectionView setDelegate:self]; - [_collectionView setDataSource:self]; - [_collectionView registerClass:[TabSwitcherHeaderCell class] - forCellWithReuseIdentifier:[TabSwitcherHeaderCell identifier]]; - [_collectionView setShowsVerticalScrollIndicator:NO]; - [_collectionView setShowsHorizontalScrollIndicator:NO]; - [_collectionView setBackgroundColor:[[MDCPalette greyPalette] tint900]]; - [_collectionView setAllowsMultipleSelection:NO]; - [_collectionView setAllowsSelection:YES]; - [_collectionView setIsAccessibilityElement:NO]; - [_collectionView setAccessibilityElementsHidden:YES]; - [self addSubview:_collectionView]; - - _accessibilityView = [[AccessiblePanelSelectorView alloc] - initWithFrame:[self collectionViewFrame]]; - [_accessibilityView - setAutoresizingMask:UIViewAutoresizingFlexibleBottomMargin | - UIViewAutoresizingFlexibleWidth]; - [_accessibilityView setDelegate:self]; - [_accessibilityView setUserInteractionEnabled:NO]; - [self addSubview:_accessibilityView]; - - _dismissButton = [[UIButton alloc] initWithFrame:CGRectZero]; - UIImage* dismissImage = - [UIImage imageNamed:@"tabswitcher_tab_switcher_button"]; - dismissImage = - [dismissImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - [_dismissButton setContentMode:UIViewContentModeCenter]; - [_dismissButton setBackgroundColor:[UIColor clearColor]]; - [_dismissButton setTintColor:[UIColor whiteColor]]; - [_dismissButton setImage:dismissImage forState:UIControlStateNormal]; - [_dismissButton - setAccessibilityLabel:l10n_util::GetNSString( - IDS_IOS_TAB_STRIP_LEAVE_TAB_SWITCHER)]; - - [_dismissButton addTarget:self - action:@selector(dismissButtonTouchUpInside:) - forControlEvents:UIControlEventTouchUpInside]; - [_dismissButton setTranslatesAutoresizingMaskIntoConstraints:NO]; - [self addSubview:_dismissButton]; - - NSArray* constraints = @[ - @"V:|-0-[dismissButton(==buttonHeight)]", - @"H:[dismissButton(==buttonWidth)]-0-|", - ]; - NSDictionary* viewsDictionary = @{ - @"dismissButton" : _dismissButton, - }; - NSDictionary* metrics = @{ - @"buttonHeight" : @(kDismissButtonHeight), - @"buttonWidth" : @(kDismissButtonWidth), - }; - ApplyVisualConstraintsWithMetrics(constraints, viewsDictionary, metrics); - - UIView* activeSpaceIndicatorView = [[UIView alloc] initWithFrame:CGRectZero]; - [activeSpaceIndicatorView - setBackgroundColor:[[MDCPalette cr_bluePalette] tint500]]; - [activeSpaceIndicatorView - setFrame:CGRectMake( - 0, self.bounds.size.height - kActiveSpaceIndicatorHeight, - kCollectionViewCellWidth, kActiveSpaceIndicatorHeight)]; - [self addSubview:activeSpaceIndicatorView]; - _activeSpaceIndicatorView = activeSpaceIndicatorView; -} - -- (void)layoutCollectionView { - NSInteger selectedIndex = [self selectedIndex]; - [_collectionView setFrame:[self collectionViewFrame]]; - if (selectedIndex != NSNotFound) - [self updateSelectionAtIndex:selectedIndex animated:YES]; -} - -- (CGRect)collectionViewFrame { - return CGRectMake(0, kCollectionViewTopMargin, self.bounds.size.width, - kCollectionViewHeight); -} - -- (void)layoutActiveSpaceIndicatorAnimated:(BOOL)animated { - [self setPanelSelectorAccessibility]; - NSInteger selectedIndex = [self selectedIndex]; - if (selectedIndex == NSNotFound) - return; - CGRect indicatorFrame = [_activeSpaceIndicatorView bounds]; - indicatorFrame.origin.y = - self.bounds.size.height - kActiveSpaceIndicatorHeight; - indicatorFrame.origin.x = - kCollectionViewCellWidth * - [self leftToRightIndexForFlowLayoutIndex:selectedIndex] - - [_collectionView contentOffset].x; - if (animated) - [UIView beginAnimations:nil context:NULL]; - [_activeSpaceIndicatorView setFrame:indicatorFrame]; - if (animated) - [UIView commitAnimations]; -} - -- (void)dismissButtonTouchUpInside:(UIButton*)button { - [self.delegate tabSwitcherHeaderViewDismiss:self]; -} - -- (void)setPanelSelectorAccessibility { - NSInteger index = [self selectedIndex]; - if (index != NSNotFound) - [_accessibilityView setAccessibilityLabel:[self panelTitleAtIndex:index]]; -} - -- (NSString*)panelTitleAtIndex:(NSInteger)index { - NSIndexPath* indexPath = [NSIndexPath indexPathForItem:index inSection:0]; - TabSwitcherSessionCellData* sessionCellData = - [[self dataSource] sessionCellDataAtIndex:indexPath.row]; - return sessionCellData.title; -} - -#pragma mark - AccessiblePanelSelectorDelegate - -- (void)moveToPanelInDirection:(PanelSelectionChangeDirection)direction { - NSInteger indexDelta = direction == RIGHT ? 1 : -1; - NSInteger newIndex = [self selectedIndex] + indexDelta; - newIndex = std::max<NSInteger>(newIndex, 0); - newIndex = std::min<NSInteger>( - newIndex, - [self collectionView:_collectionView numberOfItemsInSection:0] - 1); - NSIndexPath* newIndexPath = - [NSIndexPath indexPathForItem:newIndex inSection:0]; - [_collectionView - selectItemAtIndexPath:newIndexPath - animated:NO - scrollPosition:UICollectionViewScrollPositionCenteredHorizontally]; - [self updateSelectionAtIndex:newIndexPath.item animated:NO]; - [[self delegate] - tabSwitcherHeaderViewDidSelectSessionAtIndex:newIndexPath.item]; -} - -#pragma mark - UICollectionViewDataSource - -- (NSInteger)collectionView:(UICollectionView*)collectionView - numberOfItemsInSection:(NSInteger)section { - DCHECK([self dataSource]); - DCHECK(section == 0); - return [[self dataSource] tabSwitcherHeaderViewSessionCount]; -} - -- (UICollectionViewCell*)collectionView:(UICollectionView*)collectionView - cellForItemAtIndexPath:(NSIndexPath*)indexPath { - TabSwitcherHeaderCell* headerCell = [collectionView - dequeueReusableCellWithReuseIdentifier:[TabSwitcherHeaderCell identifier] - forIndexPath:indexPath]; - TabSwitcherSessionCellData* sessionCellData = - [[self dataSource] sessionCellDataAtIndex:indexPath.row]; - [headerCell loadSessionCellData:sessionCellData]; - return headerCell; -} - -#pragma mark - UICollectionViewDelegate - -- (void)collectionView:(UICollectionView*)collectionView - didSelectItemAtIndexPath:(NSIndexPath*)indexPath { - [self updateSelectionAtIndex:indexPath.item animated:YES]; - [[self delegate] tabSwitcherHeaderViewDidSelectSessionAtIndex:indexPath.item]; -} - -#pragma mark - UIScrollViewDelegate - -- (void)scrollViewDidScroll:(UIScrollView*)scrollView { - [self layoutActiveSpaceIndicatorAnimated:NO]; -} - -@end
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_model.h b/ios/chrome/browser/ui/tab_switcher/tab_switcher_model.h deleted file mode 100644 index 14933041..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_model.h +++ /dev/null
@@ -1,106 +0,0 @@ -// 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. - -#ifndef IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_MODEL_H_ -#define IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_MODEL_H_ - -#import <UIKit/UIKit.h> - -#include <string> -#include "base/ios/block_types.h" -#import "ios/chrome/browser/sync/synced_sessions_bridge.h" -#import "ios/chrome/browser/tabs/tab_model_observer.h" -#import "ios/chrome/browser/ui/ntp/recent_tabs/synced_sessions.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_model_snapshot.h" - -class ChromeBrowserState; -@class TabModel; -@class TabSwitcherCache; - -enum class TabSwitcherSignInPanelsType { - PANEL_USER_SIGNED_OUT, - PANEL_USER_SIGNED_IN_SYNC_OFF, - PANEL_USER_SIGNED_IN_SYNC_IN_PROGRESS, - PANEL_USER_SIGNED_IN_SYNC_ON_NO_SESSIONS, - NO_PANEL, -}; - -enum class TabSwitcherSessionType { - OFF_THE_RECORD_SESSION, - REGULAR_SESSION, - DISTANT_SESSION -}; - -// Returns true if the session type is a local session. A local session is a -// "regular session" or an "off the record" session. -bool TabSwitcherSessionTypeIsLocalSession(TabSwitcherSessionType sessionType); - -// Protocol to observe changes to the TabSwitcherModel. -@protocol TabSwitcherModelDelegate<NSObject> -// Called when distant sessions were removed or inserted. |removedIndexes| and -// |insertedIndexes| contains indexes in ascending order. -- (void)distantSessionsRemovedAtSortedIndexes:(NSArray*)removedIndexes - insertedAtSortedIndexes:(NSArray*)insertedIndexes; -// Called when the distant session with the tag |tag| may need to be updated. -- (void)distantSessionMayNeedUpdate:(std::string const&)tag; -// Called when a local session of type |type| needs to be updated. -- (void)localSessionMayNeedUpdate:(TabSwitcherSessionType)type; -// Called when the signed-in panel (if any) must change. -- (void)signInPanelChangedTo:(TabSwitcherSignInPanelsType)panelType; -// Called to retrieve the size of the item at the |index| in |session|. -- (CGSize)sizeForItemAtIndex:(NSUInteger)index - inSession:(TabSwitcherSessionType)session; -// Returns YES if sign-in from Other Devices is in progress. -- (BOOL)isSigninInProgress; -@end - -// This class serves as a bridge between Chrome-level data (CLD), and what is -// presented on screen in the Tab Switcher. -// The CLD is: -// -The "distant sessions", i.e. the list of Chrome instances the user is -// signed-in, and the tabs each of the session contains. -// -The non incognito/incognito tab models. Also known as the "local sessions". -// -// The TabSwitcher observes changes in the CLD, and takes snapshots of its -// state. -// Whenever the delegate can be notified, the TabSwitcher computes a diff -// and notifies the delegate of the changes. -@interface TabSwitcherModel : NSObject<SyncedSessionsObserver, TabModelObserver> - -@property(nonatomic, readonly) TabModel* mainTabModel; -@property(nonatomic, readonly) TabModel* otrTabModel; - -// Default initializer. |browserState| must not be nullptr, |delegate| must not -// be nil. -- (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState - delegate:(id<TabSwitcherModelDelegate>)delegate - mainTabModel:(TabModel*)mainTabModel - otrTabModel:(TabModel*)otrTabModel - withCache:(TabSwitcherCache*)cache; -// Sets the main and incognito tab models, and notify the delegate of changes, -// if any. |mainTabModel| and |otrTabModel| can be nil. -- (void)setMainTabModel:(TabModel*)mainTabModel - otrTabModel:(TabModel*)otrTabModel; -// Returns the browserState. -- (ios::ChromeBrowserState*)browserState; -// Returns the latest data for the local session of type |type|. -- (std::unique_ptr<TabModelSnapshot>)tabModelSnapshotForLocalSession: - (TabSwitcherSessionType)type; -// Returns the latest data for the distant session of tag |tag|. -- (std::unique_ptr<const synced_sessions::DistantSession>)distantSessionForTag: - (std::string const&)tag; - -// Returns the current count of sessions including main and incognito. -- (NSInteger)sessionCount; -// Returns the current count of distant sessions. -- (NSInteger)distantSessionCount; -// Returns the type of the sign in panel. -- (TabSwitcherSignInPanelsType)signInPanelType; -// Returns the tag of the session at index |index|. -- (std::string const&)tagOfDistantSessionAtIndex:(int)index; -// Notifies the delegate that changes occurred for the distant sessions. -- (void)syncedSessionsChanged; -@end - -#endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_MODEL_H_
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_model.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_model.mm deleted file mode 100644 index 0240d9f..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_model.mm +++ /dev/null
@@ -1,411 +0,0 @@ -// 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 "ios/chrome/browser/ui/tab_switcher/tab_switcher_model.h" - -#include <memory> - -#include "components/browser_sync/profile_sync_service.h" -#include "components/sessions/core/session_id.h" -#include "components/signin/core/browser/signin_manager.h" -#include "ios/chrome/browser/browser_state/chrome_browser_state.h" -#include "ios/chrome/browser/signin/signin_manager_factory.h" -#include "ios/chrome/browser/sync/profile_sync_service_factory.h" -#include "ios/chrome/browser/sync/sync_setup_service.h" -#include "ios/chrome/browser/sync/sync_setup_service_factory.h" -#import "ios/chrome/browser/tabs/tab.h" -#import "ios/chrome/browser/tabs/tab_model.h" -#include "ios/chrome/browser/ui/ntp/recent_tabs/synced_sessions.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_model_snapshot.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_cache.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_model_private.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -bool TabSwitcherSessionTypeIsLocalSession(TabSwitcherSessionType sessionType) { - return sessionType == TabSwitcherSessionType::OFF_THE_RECORD_SESSION || - sessionType == TabSwitcherSessionType::REGULAR_SESSION; -} - -namespace { - -class TagAndIndex { - public: - TagAndIndex(std::string const& tag, size_t index) - : tag_(tag), index_(index) {} - std::string tag_; - size_t index_; - bool operator<(const TagAndIndex& other) const { return tag_ < other.tag_; } -}; - -void FillSetUsingSessions(synced_sessions::SyncedSessions const& sessions, - std::set<TagAndIndex>* set) { - DCHECK(set); - DCHECK(set->empty()); - for (size_t i = 0; i < sessions.GetSessionCount(); ++i) { - set->insert(TagAndIndex(sessions.GetSession(i)->tag, i)); - } -} - -} // namespace - -@interface TabSwitcherModel () { - // The browser state. - ios::ChromeBrowserState* _browserState; // weak - // The tab models. - __weak TabModel* _mainTabModel; - __weak TabModel* _otrTabModel; - // The delegate for event callbacks. - __weak id<TabSwitcherModelDelegate> _delegate; - // The synced sessions. Must never be null. - std::unique_ptr<synced_sessions::SyncedSessions> _syncedSessions; - // The synced sessions change observer. - std::unique_ptr<synced_sessions::SyncedSessionsObserverBridge> - _syncedSessionsObserver; - // Snapshots of the |_mainTabModel| and |_otrTabModel|. - std::unique_ptr<TabModelSnapshot> _mainTabModelSnapshot; - std::unique_ptr<TabModelSnapshot> _otrTabModelSnapshot; - // The cache holding resized tabs snapshots. - TabSwitcherCache* _cache; -} - -// Returns the type of the local session corresponding to the given |tabModel|. -// |tabModel| MUST be equal to either |_mainTabModel|, or |_otrTabModel|. -- (TabSwitcherSessionType)typeOfLocalSessionForTabModel:(TabModel*)tabModel; -@end - -@implementation TabSwitcherModel - -@synthesize mainTabModel = _mainTabModel; -@synthesize otrTabModel = _otrTabModel; - -- (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState - delegate:(id<TabSwitcherModelDelegate>)delegate - mainTabModel:(TabModel*)mainTabModel - otrTabModel:(TabModel*)otrTabModel - withCache:(TabSwitcherCache*)cache { - DCHECK(browserState); - DCHECK(delegate); - // TODO(jif): DCHECK |mainTabModel| and |otrTabModel|. - self = [self init]; - if (self) { - _browserState = browserState; - _delegate = delegate; - _syncedSessions.reset(new synced_sessions::SyncedSessions()); - _syncedSessionsObserver.reset( - new synced_sessions::SyncedSessionsObserverBridge(self, _browserState)); - _mainTabModel = mainTabModel; - _otrTabModel = otrTabModel; - _mainTabModelSnapshot.reset(new TabModelSnapshot(mainTabModel)); - _otrTabModelSnapshot.reset(new TabModelSnapshot(otrTabModel)); - [_mainTabModel addObserver:self]; - [_otrTabModel addObserver:self]; - _cache = cache; - } - return self; -} - -- (void)setMainTabModel:(TabModel*)mainTabModel - otrTabModel:(TabModel*)otrTabModel { - [self replaceMainTabModelWithTabModel:mainTabModel]; - [self replaceOTRTabModelWithTabModel:otrTabModel]; -} - -- (void)replaceMainTabModelWithTabModel:(TabModel*)newTabModel { - if (_mainTabModel == newTabModel) - return; - [_mainTabModel removeObserver:self]; - _mainTabModel = newTabModel; - [newTabModel addObserver:self]; - // Calling |tabModelChanged:| may trigger an animated refresh of the - // Tab Switcher's collection view. - // Here in |replaceOldTabModel:withTabModel:| the animation is undesirable. - [UIView performWithoutAnimation:^{ - [self tabModelChanged:newTabModel]; - }]; -} - -- (void)replaceOTRTabModelWithTabModel:(TabModel*)newTabModel { - if (_otrTabModel == newTabModel) - return; - [_otrTabModel removeObserver:self]; - _otrTabModel = newTabModel; - [newTabModel addObserver:self]; - // Calling |tabModelChanged:| may trigger an animated refresh of the - // Tab Switcher's collection view. - // Here in |replaceOldTabModel:withTabModel:| the animation is undesirable. - [UIView performWithoutAnimation:^{ - [self tabModelChanged:newTabModel]; - }]; -} - -- (void)dealloc { - [_mainTabModel removeObserver:self]; - [_otrTabModel removeObserver:self]; -} - -- (NSInteger)sessionCount { - const NSInteger mainTabModelSessionCount = 1; - const NSInteger otrTabModelSessionCount = 1; - return mainTabModelSessionCount + otrTabModelSessionCount + - [self distantSessionCount]; -} - -- (NSInteger)distantSessionCount { - return _syncedSessions->GetSessionCount(); -} - -- (ios::ChromeBrowserState*)browserState { - return _browserState; -} - -- (TabModel*)tabModelForSessionOfType:(TabSwitcherSessionType)type { - DCHECK(type == TabSwitcherSessionType::OFF_THE_RECORD_SESSION || - type == TabSwitcherSessionType::REGULAR_SESSION); - return type == TabSwitcherSessionType::OFF_THE_RECORD_SESSION ? _otrTabModel - : _mainTabModel; -} - -- (NSInteger)numberOfTabsInLocalSessionOfType:(TabSwitcherSessionType)type { - TabModelSnapshot* tabModelSnapshot = [self tabModelSnapshotForSession:type]; - return tabModelSnapshot->tabs().size(); -} - -- (Tab*)tabAtIndex:(NSUInteger)index - inLocalSessionOfType:(TabSwitcherSessionType)type { - TabModelSnapshot* tabModelSnapshot = [self tabModelSnapshotForSession:type]; - return tabModelSnapshot->tabs()[index]; -} - -- (std::unique_ptr<TabModelSnapshot>)tabModelSnapshotForLocalSession: - (TabSwitcherSessionType)type { - TabModel* tm = nullptr; - switch (type) { - case TabSwitcherSessionType::OFF_THE_RECORD_SESSION: - tm = _otrTabModel; - break; - case TabSwitcherSessionType::REGULAR_SESSION: - tm = _mainTabModel; - break; - default: - NOTREACHED(); - break; - } - return std::make_unique<TabModelSnapshot>(tm); -} - -- (std::unique_ptr<const synced_sessions::DistantSession>)distantSessionForTag: - (std::string const&)tag { - syncer::SyncService* syncService = - ProfileSyncServiceFactory::GetForBrowserState(_browserState); - return std::make_unique<synced_sessions::DistantSession>(syncService, tag); -} - -- (std::string const&)tagOfDistantSessionAtIndex:(int)index { - return _syncedSessions->GetSession(index)->tag; -} - -- (TabSwitcherSignInPanelsType)signInPanelType { - if (![self isSignedIn] || [_delegate isSigninInProgress]) - return TabSwitcherSignInPanelsType::PANEL_USER_SIGNED_OUT; - if (![self isSyncTabsEnabled]) - return TabSwitcherSignInPanelsType::PANEL_USER_SIGNED_IN_SYNC_OFF; - if (_syncedSessions->GetSessionCount() != 0) - return TabSwitcherSignInPanelsType::NO_PANEL; - if ([self isFirstSyncCycleCompleted]) { - return TabSwitcherSignInPanelsType:: - PANEL_USER_SIGNED_IN_SYNC_ON_NO_SESSIONS; - } else { - return TabSwitcherSignInPanelsType::PANEL_USER_SIGNED_IN_SYNC_IN_PROGRESS; - } -} - -- (void)syncedSessionsChanged { - syncer::SyncService* syncService = - ProfileSyncServiceFactory::GetForBrowserState(_browserState); - - std::unique_ptr<synced_sessions::SyncedSessions> oldSyncedSessions( - new synced_sessions::SyncedSessions(syncService)); - _syncedSessions.swap(oldSyncedSessions); - - // Notify about change in the sign in panel. - TabSwitcherSignInPanelsType panelType = [self signInPanelType]; - [_delegate signInPanelChangedTo:panelType]; - - if (panelType != TabSwitcherSignInPanelsType::NO_PANEL) { - // Do not show synced sessions. - _syncedSessions.reset(new synced_sessions::SyncedSessions()); - } - - // Notify about changes in the synced sessions. - [TabSwitcherModel notifyDelegate:_delegate - aboutChangeFrom:*oldSyncedSessions - to:*_syncedSessions]; -} - -- (BOOL)isSignedIn { - SigninManager* signin_manager = - ios::SigninManagerFactory::GetForBrowserState(_browserState); - return signin_manager->IsAuthenticated(); -} - -- (BOOL)isSyncTabsEnabled { - DCHECK([self isSignedIn]); - SyncSetupService* service = - SyncSetupServiceFactory::GetForBrowserState(_browserState); - return !service->UserActionIsRequiredToHaveSyncWork(); -} - -- (BOOL)isFirstSyncCycleCompleted { - return _syncedSessionsObserver->IsFirstSyncCycleCompleted(); -} - -+ (void)notifyDelegate:(id<TabSwitcherModelDelegate>)delegate - aboutChangeFrom:(synced_sessions::SyncedSessions&)oldSessions - to:(synced_sessions::SyncedSessions&)newSessions { - // Compute and notify the delegate about removed or inserted sessions. - std::set<TagAndIndex> tagsOfOldSessions; - std::set<TagAndIndex> tagsOfNewSessions; - FillSetUsingSessions(oldSessions, &tagsOfOldSessions); - FillSetUsingSessions(newSessions, &tagsOfNewSessions); - - std::set<TagAndIndex> tagsOfRemovedSessions; - std::set<TagAndIndex> tagsOfInsertedSessions; - std::set_difference( - tagsOfOldSessions.begin(), tagsOfOldSessions.end(), - tagsOfNewSessions.begin(), tagsOfNewSessions.end(), - std::inserter(tagsOfRemovedSessions, tagsOfRemovedSessions.end())); - std::set_difference( - tagsOfNewSessions.begin(), tagsOfNewSessions.end(), - tagsOfOldSessions.begin(), tagsOfOldSessions.end(), - std::inserter(tagsOfInsertedSessions, tagsOfInsertedSessions.end())); - - NSArray* removedIndexesSorted = nil; - NSArray* insertedIndexesSorted = nil; - if (!tagsOfRemovedSessions.empty()) { - NSMutableArray* removedIndexes = [NSMutableArray array]; - for (auto& tagAndIndex : tagsOfRemovedSessions) { - [removedIndexes addObject:[NSNumber numberWithInt:tagAndIndex.index_]]; - } - removedIndexesSorted = - [removedIndexes sortedArrayUsingSelector:@selector(compare:)]; - } - if (!tagsOfInsertedSessions.empty()) { - NSMutableArray* insertedIndexes = [NSMutableArray array]; - for (auto& tagAndIndex : tagsOfInsertedSessions) { - [insertedIndexes addObject:[NSNumber numberWithInt:tagAndIndex.index_]]; - } - insertedIndexesSorted = - [insertedIndexes sortedArrayUsingSelector:@selector(compare:)]; - } - if (removedIndexesSorted || insertedIndexesSorted) { - [delegate distantSessionsRemovedAtSortedIndexes:removedIndexesSorted - insertedAtSortedIndexes:insertedIndexesSorted]; - } - // Compute and notify the delegate about tabs that were removed or inserted - // in the sessions that weren't inserted or deleted. - std::set<TagAndIndex> tagsOfOtherSessions; - std::set_intersection( - tagsOfNewSessions.begin(), tagsOfNewSessions.end(), - tagsOfOldSessions.begin(), tagsOfOldSessions.end(), - std::inserter(tagsOfOtherSessions, tagsOfOtherSessions.end())); - for (TagAndIndex const& tagAndIndexOfSession : tagsOfOtherSessions) { - [delegate distantSessionMayNeedUpdate:tagAndIndexOfSession.tag_]; - } -} - -- (TabSwitcherSessionType)typeOfLocalSessionForTabModel:(TabModel*)tabModel { - DCHECK(tabModel == _mainTabModel || tabModel == _otrTabModel); - if (tabModel == _otrTabModel) - return TabSwitcherSessionType::OFF_THE_RECORD_SESSION; - return TabSwitcherSessionType::REGULAR_SESSION; -} - -- (TabModelSnapshot*)tabModelSnapshotForSession:(TabSwitcherSessionType)type { - switch (type) { - case TabSwitcherSessionType::OFF_THE_RECORD_SESSION: - return _otrTabModelSnapshot.get(); - case TabSwitcherSessionType::REGULAR_SESSION: - return _mainTabModelSnapshot.get(); - default: - NOTREACHED(); - return nullptr; - break; - } -} - -- (void)setTabModelSnapshot:(std::unique_ptr<TabModelSnapshot>)tabModelSnapshot - forSession:(TabSwitcherSessionType)type { - switch (type) { - case TabSwitcherSessionType::OFF_THE_RECORD_SESSION: - _otrTabModelSnapshot = std::move(tabModelSnapshot); - break; - case TabSwitcherSessionType::REGULAR_SESSION: - _mainTabModelSnapshot = std::move(tabModelSnapshot); - break; - default: - NOTREACHED(); - break; - } -} - -- (void)tabModelChanged:(TabModel*)tabModel { - TabSwitcherSessionType sessionType = - [self typeOfLocalSessionForTabModel:tabModel]; - [_delegate localSessionMayNeedUpdate:sessionType]; -} - -#pragma mark - SyncedSessionsObserver - -- (void)reloadSessions { - [self syncedSessionsChanged]; -} - -- (void)onSyncStateChanged { - [self syncedSessionsChanged]; -} - -#pragma mark - TabModelObserver - -- (void)tabModel:(TabModel*)model didChangeTab:(Tab*)tab { - [self tabModelChanged:model]; -} - -- (void)tabModel:(TabModel*)model - didInsertTab:(Tab*)tab - atIndex:(NSUInteger)index - inForeground:(BOOL)fg { - [self tabModelChanged:model]; -} - -- (void)tabModel:(TabModel*)model - didRemoveTab:(Tab*)tab - atIndex:(NSUInteger)index { - [self tabModelChanged:model]; -} - -- (void)tabModel:(TabModel*)model - didMoveTab:(Tab*)tab - fromIndex:(NSUInteger)fromIndex - toIndex:(NSUInteger)toIndex { - [self tabModelChanged:model]; -} - -- (void)tabModel:(TabModel*)model - didReplaceTab:(Tab*)oldTab - withTab:(Tab*)newTab - atIndex:(NSUInteger)index { - [self tabModelChanged:model]; -} - -- (void)tabModel:(TabModel*)model - didChangeTabSnapshot:(Tab*)tab - withImage:(UIImage*)image { - [self tabModelChanged:model]; -} - -@end
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_model_private.h b/ios/chrome/browser/ui/tab_switcher/tab_switcher_model_private.h deleted file mode 100644 index 5b71061..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_model_private.h +++ /dev/null
@@ -1,21 +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 IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_MODEL_PRIVATE_H_ -#define IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_MODEL_PRIVATE_H_ - -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_model.h" - -@interface TabSwitcherModel (TestingSupport) -// Notifies |delegate| about changes from |oldSessions| to |newSessions|, -// including the insertion/deletions of distant sessions, and the -// insertions/deletions/updates of tabs in the distant sessions. -// Does not notify the delegate when the ordering of the distant sessions -// changes. -+ (void)notifyDelegate:(id<TabSwitcherModelDelegate>)delegate - aboutChangeFrom:(synced_sessions::SyncedSessions&)oldSessions - to:(synced_sessions::SyncedSessions&)newSessions; -@end - -#endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_MODEL_PRIVATE_H_
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_model_unittest.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_model_unittest.mm deleted file mode 100644 index af2bf4ce..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_model_unittest.mm +++ /dev/null
@@ -1,437 +0,0 @@ -// 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. - -#include "ios/chrome/browser/ui/tab_switcher/tab_switcher_model.h" - -#include <memory> - -#include "base/strings/utf_string_conversions.h" -#include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" -#include "ios/chrome/browser/ui/ntp/recent_tabs/synced_sessions.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_model_private.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_utils.h" -#include "testing/platform_test.h" -#import "third_party/ocmock/OCMock/OCMock.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -namespace { - -// A lightweight DistantTab. -class LightDT { - public: - LightDT(std::string const& urlSuffix, std::string const& title = "") - : url("http://www.foo.com/" + urlSuffix), title(title) {} - std::string url; - std::string title; -}; - -// A lightweight DistantSession. -struct LightDS { - std::string tag; - std::vector<LightDT> distantTabs; -}; - -// A lightweight SyncedSessions. -using LightSS = std::vector<LightDS>; - -} // namespace - -// Helper class to test calls to the TabSwitcherModelDelegate. -@interface DelegateTester : NSObject<TabSwitcherModelDelegate> -@end - -@implementation DelegateTester { - NSArray* _expectedSessionRemoved; - NSArray* _expectedSessionInserted; - std::set<std::string> _expectedTagsOfTheSessionsNeedingUpdates; -} - -- (void)expectSessionsRemoved:(NSArray*)expectedIndexes { - _expectedSessionRemoved = expectedIndexes; -} - -- (void)expectSessionsInserted:(NSArray*)expectedIndexes { - _expectedSessionInserted = expectedIndexes; -} - -- (void)expectSessionMayNeedUpdate:(std::set<std::string> const&)tags { - _expectedTagsOfTheSessionsNeedingUpdates = tags; -} - -- (void)verify { - EXPECT_EQ(0UL, [_expectedSessionRemoved count]); - EXPECT_EQ(0UL, [_expectedSessionInserted count]); - EXPECT_EQ(0UL, _expectedTagsOfTheSessionsNeedingUpdates.size()); -} - -#pragma mark - TabSwitcherModelDelegate - -- (void)distantSessionsRemovedAtSortedIndexes:(NSArray*)removedIndexes - insertedAtSortedIndexes:(NSArray*)insertedIndexes { - EXPECT_TRUE(removedIndexes == _expectedSessionRemoved || - [removedIndexes isEqualToArray:_expectedSessionRemoved]); - EXPECT_TRUE(insertedIndexes == _expectedSessionInserted || - [insertedIndexes isEqualToArray:_expectedSessionInserted]); - _expectedSessionRemoved = nil; - _expectedSessionInserted = nil; -} - -- (void)distantSessionMayNeedUpdate:(std::string const&)tag { - EXPECT_EQ(1UL, _expectedTagsOfTheSessionsNeedingUpdates.erase(tag)); -} - -- (void)localSessionMayNeedUpdate:(TabSwitcherSessionType)type { - NOTREACHED(); -} - -- (void)signInPanelChangedTo:(TabSwitcherSignInPanelsType)panelType { - NOTREACHED(); -} - -- (CGSize)sizeForItemAtIndex:(NSUInteger)index - inSession:(TabSwitcherSessionType)session { - return CGSizeZero; -} - -- (BOOL)isSigninInProgress { - NOTREACHED(); - return NO; -} - -@end - -namespace { - -class TabSwitcherModelTest : public PlatformTest { - protected: - void SetUp() override { delegate_ = [[DelegateTester alloc] init]; } - - void AddSessionToSessions(synced_sessions::SyncedSessions& sessions, - std::string const& session_tag, - std::vector<size_t> const& tab_ids) { - std::vector<LightDT> light_distant_tabs; - for (size_t tab_id : tab_ids) { - light_distant_tabs.push_back(LightDT(std::to_string(tab_id), "")); - } - AddDetailedSessionToSessions(sessions, session_tag, light_distant_tabs); - } - - std::unique_ptr<synced_sessions::SyncedSessions> syncedSessionsFromTestData( - LightSS const& lightSyncedSessions) { - auto syncedSessions = std::make_unique<synced_sessions::SyncedSessions>(); - for (auto& lightdistantSession : lightSyncedSessions) { - AddDetailedSessionToSessions(*syncedSessions, lightdistantSession.tag, - lightdistantSession.distantTabs); - } - return syncedSessions; - } - - void AddDetailedSessionToSessions( - synced_sessions::SyncedSessions& sessions, - std::string const& session_tag, - std::vector<LightDT> const& light_distant_tabs) { - // Create a new DistantSession and initialize it with |sessionTag| and - // |tabTags|. - auto distant_session = std::make_unique<synced_sessions::DistantSession>(); - distant_session->tag = session_tag; - - for (auto const& light_distant_tab : light_distant_tabs) { - auto temp_tab = std::make_unique<synced_sessions::DistantTab>(); - temp_tab->virtual_url = GURL(light_distant_tab.url); - temp_tab->title = base::ASCIIToUTF16(light_distant_tab.title); - distant_session->tabs.push_back(std::move(temp_tab)); - } - - sessions.AddDistantSessionForTest(std::move(distant_session)); - } - DelegateTester* delegate_; - TabSwitcherModel* model_; -}; - -TEST_F(TabSwitcherModelTest, TestNoDiffs) { - // Test with 2 empty sessions. - synced_sessions::SyncedSessions old_sessions_1; - synced_sessions::SyncedSessions new_sessions_1; - [TabSwitcherModel notifyDelegate:delegate_ - aboutChangeFrom:old_sessions_1 - to:new_sessions_1]; - [delegate_ verify]; - - // Test with 2 identical sessions. - synced_sessions::SyncedSessions old_sessions_2; - synced_sessions::SyncedSessions new_sessions_2; - AddSessionToSessions(old_sessions_2, "Foo", {0, 1}); - AddSessionToSessions(new_sessions_2, "Foo", {0, 1}); - [delegate_ expectSessionMayNeedUpdate:{"Foo"}]; - - [TabSwitcherModel notifyDelegate:delegate_ - aboutChangeFrom:old_sessions_2 - to:new_sessions_2]; - [delegate_ verify]; -} - -TEST_F(TabSwitcherModelTest, TestSessionDiffs) { - // Test with 1 session inserted. - synced_sessions::SyncedSessions old_sessions_1; - synced_sessions::SyncedSessions new_sessions_1; - AddSessionToSessions(new_sessions_1, "Foo", {0}); - [delegate_ expectSessionsInserted:@[ @0 ]]; - [TabSwitcherModel notifyDelegate:delegate_ - aboutChangeFrom:old_sessions_1 - to:new_sessions_1]; - [delegate_ verify]; - - // Test with 2 sessions inserted. - synced_sessions::SyncedSessions old_sessions_2; - synced_sessions::SyncedSessions new_sessions_2; - AddSessionToSessions(old_sessions_2, "Bar", {0}); - AddSessionToSessions(new_sessions_2, "Foo", {0}); - AddSessionToSessions(new_sessions_2, "Bar", {0}); - AddSessionToSessions(new_sessions_2, "Qux", {0}); - [delegate_ expectSessionsInserted:@[ @0, @2 ]]; - [delegate_ expectSessionMayNeedUpdate:{"Bar"}]; - [TabSwitcherModel notifyDelegate:delegate_ - aboutChangeFrom:old_sessions_2 - to:new_sessions_2]; - [delegate_ verify]; - - // Test with 2 sessions removed. - synced_sessions::SyncedSessions old_sessions_3; - synced_sessions::SyncedSessions new_sessions_3; - AddSessionToSessions(old_sessions_3, "Foo", {0}); - AddSessionToSessions(old_sessions_3, "Bar", {0}); - AddSessionToSessions(old_sessions_3, "Qux", {0}); - AddSessionToSessions(new_sessions_3, "Bar", {0}); - [delegate_ expectSessionsRemoved:@[ @0, @2 ]]; - [delegate_ expectSessionMayNeedUpdate:{"Bar"}]; - [TabSwitcherModel notifyDelegate:delegate_ - aboutChangeFrom:old_sessions_3 - to:new_sessions_3]; - [delegate_ verify]; - - // Test with 2 sessions inserted, 2 removed. - synced_sessions::SyncedSessions old_sessions_4; - synced_sessions::SyncedSessions new_sessions_4; - AddSessionToSessions(old_sessions_4, "Deleted1", {0}); - AddSessionToSessions(old_sessions_4, "a", {0}); - AddSessionToSessions(old_sessions_4, "Delete2", {0}); - - AddSessionToSessions(new_sessions_4, "b", {0}); - AddSessionToSessions(new_sessions_4, "a", {0}); - AddSessionToSessions(new_sessions_4, "c", {0}); - [delegate_ expectSessionsRemoved:@[ @0, @2 ]]; - [delegate_ expectSessionsInserted:@[ @0, @2 ]]; - [delegate_ expectSessionMayNeedUpdate:{"a"}]; - - [TabSwitcherModel notifyDelegate:delegate_ - aboutChangeFrom:old_sessions_4 - to:new_sessions_4]; - [delegate_ verify]; -} - -TEST_F(TabSwitcherModelTest, TestTabsSimpleDiffs) { - // Test with 2 tabs added. - synced_sessions::SyncedSessions old_sessions_1; - synced_sessions::SyncedSessions new_sessions_1; - AddSessionToSessions(old_sessions_1, "Bar", {100}); - AddSessionToSessions(old_sessions_1, "Foo", {100}); - AddSessionToSessions(new_sessions_1, "Bar", {100}); - AddSessionToSessions(new_sessions_1, "Foo", {99, 100, 101}); - [delegate_ expectSessionMayNeedUpdate:{"Bar", "Foo"}]; - - [TabSwitcherModel notifyDelegate:delegate_ - aboutChangeFrom:old_sessions_1 - to:new_sessions_1]; - [delegate_ verify]; - - // Test with 2 tabs removed. - synced_sessions::SyncedSessions old_sessions_2; - synced_sessions::SyncedSessions new_sessions_2; - AddSessionToSessions(old_sessions_2, "Bar", {0}); - AddSessionToSessions(old_sessions_2, "Foo", {100, 101, 102}); - AddSessionToSessions(new_sessions_2, "Bar", {0}); - AddSessionToSessions(new_sessions_2, "Foo", {100}); - [delegate_ expectSessionMayNeedUpdate:{"Bar", "Foo"}]; - - [TabSwitcherModel notifyDelegate:delegate_ - aboutChangeFrom:old_sessions_2 - to:new_sessions_2]; - [delegate_ verify]; - - // Test with 2 tabs updated. - synced_sessions::SyncedSessions old_sessions_3; - synced_sessions::SyncedSessions new_sessions_3; - std::vector<LightDT> old_tabs_3; - old_tabs_3.push_back(LightDT("1", "1")); - old_tabs_3.push_back(LightDT("2", "2")); - old_tabs_3.push_back(LightDT("3", "3")); - std::vector<LightDT> new_tabs_3; - new_tabs_3.push_back(LightDT("1", "1 bis")); - new_tabs_3.push_back(LightDT("2", "2")); - new_tabs_3.push_back(LightDT("a", "3")); - AddDetailedSessionToSessions(old_sessions_3, "Foo", old_tabs_3); - AddDetailedSessionToSessions(new_sessions_3, "Foo", new_tabs_3); - [delegate_ expectSessionMayNeedUpdate:{"Foo"}]; - [TabSwitcherModel notifyDelegate:delegate_ - aboutChangeFrom:old_sessions_3 - to:new_sessions_3]; - [delegate_ verify]; -} - -TEST_F(TabSwitcherModelTest, TestTabsDeletionInsertions) { - synced_sessions::SyncedSessions old_sessions; - synced_sessions::SyncedSessions new_sessions; - std::vector<LightDT> old_tabs; - old_tabs.push_back(LightDT("0", "0")); - old_tabs.push_back(LightDT("1", "1")); - old_tabs.push_back(LightDT("2", "2")); - old_tabs.push_back(LightDT("3", "3")); - std::vector<LightDT> new_tabs; - new_tabs.push_back(LightDT("1", "1")); - new_tabs.push_back(LightDT("2", "2")); - new_tabs.push_back(LightDT("3", "3")); - new_tabs.push_back(LightDT("0", "0")); - AddDetailedSessionToSessions(old_sessions, "Foo", old_tabs); - AddDetailedSessionToSessions(new_sessions, "Foo", new_tabs); - [delegate_ expectSessionMayNeedUpdate:{"Foo"}]; - [TabSwitcherModel notifyDelegate:delegate_ - aboutChangeFrom:old_sessions - to:new_sessions]; - [delegate_ verify]; -} - -TEST_F(TabSwitcherModelTest, TestTabsWithInterleavedDiffs) { - synced_sessions::SyncedSessions old_sessions; - synced_sessions::SyncedSessions new_sessions; - std::vector<LightDT> old_tabs; - old_tabs.push_back(LightDT("0", "0")); - old_tabs.push_back(LightDT("1", "1")); // gets deleted - old_tabs.push_back(LightDT("2", "2")); - old_tabs.push_back(LightDT("3", "3")); // gets updated - old_tabs.push_back(LightDT("4", "4")); - old_tabs.push_back(LightDT("6", "6")); - old_tabs.push_back(LightDT("7", "7")); // gets updated - std::vector<LightDT> new_tabs; - new_tabs.push_back(LightDT("0", "0")); - new_tabs.push_back(LightDT("2", "2")); - new_tabs.push_back(LightDT("3", "3 bis")); - new_tabs.push_back(LightDT("4", "4")); - new_tabs.push_back(LightDT("5", "5")); // is inserted - new_tabs.push_back(LightDT("6", "6")); - new_tabs.push_back(LightDT("7", "7 bis")); - AddDetailedSessionToSessions(old_sessions, "Foo", old_tabs); - AddDetailedSessionToSessions(new_sessions, "Foo", new_tabs); - [delegate_ expectSessionMayNeedUpdate:{"Foo"}]; - [TabSwitcherModel notifyDelegate:delegate_ - aboutChangeFrom:old_sessions - to:new_sessions]; - [delegate_ verify]; -} - -// Tests that the reordering of sessions does not result in calls to the -// delegate. -TEST_F(TabSwitcherModelTest, TestReorderingOfSessions) { - std::vector<LightDS> old_sessions_data = { - {"A", {LightDT("a"), LightDT("b")}}, - {"B", {LightDT("a"), LightDT("b")}}, - {"C", {LightDT("a"), LightDT("b")}}, - }; - std::vector<LightDS> new_sessions_data = { - {"C", {LightDT("a"), LightDT("b")}}, - {"A", {LightDT("a"), LightDT("b")}}, - {"B", {LightDT("a"), LightDT("b")}}, - }; - auto old_sessions = syncedSessionsFromTestData(old_sessions_data); - auto new_sessions = syncedSessionsFromTestData(new_sessions_data); - [delegate_ expectSessionMayNeedUpdate:{"A", "B", "C"}]; - [TabSwitcherModel notifyDelegate:delegate_ - aboutChangeFrom:*old_sessions - to:*new_sessions]; - [delegate_ verify]; -} - -// Tests that the reordering of sessions does not result in wrong deletion -// indexes. -TEST_F(TabSwitcherModelTest, TestReorderingOfSessionsWithDeletion) { - std::vector<LightDS> old_sessions_data = { - {"A", {LightDT("a"), LightDT("b"), LightDT("c")}}, - {"B", {LightDT("a"), LightDT("b")}}, // deleted - {"C", {LightDT("a"), LightDT("b")}}, - {"D", {LightDT("a"), LightDT("b")}}, // deleted - }; - std::vector<LightDS> new_sessions_data = { - {"C", {LightDT("a"), LightDT("b")}}, - {"A", {LightDT("a"), LightDT("b"), LightDT("c")}}, - }; - auto old_sessions = syncedSessionsFromTestData(old_sessions_data); - auto new_sessions = syncedSessionsFromTestData(new_sessions_data); - [delegate_ expectSessionsRemoved:@[ @1, @3 ]]; - [delegate_ expectSessionMayNeedUpdate:{"A", "C"}]; - [TabSwitcherModel notifyDelegate:delegate_ - aboutChangeFrom:*old_sessions - to:*new_sessions]; - [delegate_ verify]; -} - -// Tests that the reordering of sessions does not result in wrong insertion -// indexes. -TEST_F(TabSwitcherModelTest, TestReorderingOfSessionsWithInsertion) { - std::vector<LightDS> old_sessions_data = { - {"A", {LightDT("a"), LightDT("b")}}, - {"B", {LightDT("a"), LightDT("b")}}, - {"C", {LightDT("a"), LightDT("b")}}, - }; - std::vector<LightDS> new_sessions_data = { - {"B", {LightDT("a"), LightDT("b")}}, - {"D", {LightDT("a"), LightDT("b")}}, // inserted - {"C", {LightDT("a"), LightDT("b")}}, - {"A", {LightDT("a"), LightDT("b")}}, - {"E", {LightDT("a"), LightDT("b")}}, // inserted - }; - auto old_sessions = syncedSessionsFromTestData(old_sessions_data); - auto new_sessions = syncedSessionsFromTestData(new_sessions_data); - [delegate_ expectSessionsInserted:@[ @1, @4 ]]; - [delegate_ expectSessionMayNeedUpdate:{"A", "B", "C"}]; - [TabSwitcherModel notifyDelegate:delegate_ - aboutChangeFrom:*old_sessions - to:*new_sessions]; - [delegate_ verify]; -} - -TEST_F(TabSwitcherModelTest, TestTabsWithSessionAndTabChanges) { - std::vector<LightDS> old_sessions_data = { - {"0", {LightDT("a"), LightDT("b")}}, - {"1", {LightDT("a"), LightDT("b")}}, // session deleted - {"2", {LightDT("a"), LightDT("b"), LightDT("c")}}, - {"3", {LightDT("b")}}, - {"4", {LightDT("a"), LightDT("b"), LightDT("c")}}, // tab deleted - {"5", {LightDT("a"), LightDT("b")}}, - }; - - std::vector<LightDS> new_sessions_data = { - {"A", {LightDT("a")}}, // session inserted - {"0", {LightDT("a"), LightDT("b")}}, - {"2", {LightDT("A"), LightDT("b"), LightDT("C")}}, // tabs updated - {"3", {LightDT("a"), LightDT("b")}}, // tab inserted - {"4", {LightDT("b")}}, - {"5", {LightDT("a"), LightDT("b")}}, - }; - - auto old_sessions = syncedSessionsFromTestData(old_sessions_data); - auto new_sessions = syncedSessionsFromTestData(new_sessions_data); - - [delegate_ expectSessionMayNeedUpdate:{"0", "2", "3", "4", "5"}]; - [delegate_ expectSessionsRemoved:@[ @1 ]]; - [delegate_ expectSessionsInserted:@[ @0 ]]; - - [TabSwitcherModel notifyDelegate:delegate_ - aboutChangeFrom:*old_sessions - to:*new_sessions]; - [delegate_ verify]; -} - -} // namespace
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.h b/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.h deleted file mode 100644 index aa16928..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.h +++ /dev/null
@@ -1,71 +0,0 @@ -// 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. - -#ifndef IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_PANEL_CELL_H_ -#define IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_PANEL_CELL_H_ - -#import <UIKit/UIKit.h> - -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_model.h" - -class GURL; -@class TabSwitcherCache; -@class Tab; -namespace ios { -class ChromeBrowserState; -} // namespace ios - -CGFloat tabSwitcherLocalSessionCellTopBarHeight(); - -// The accessibility label for the close button for use in test automation. -extern NSString* const kTabSwicherPanelCellCloseButtonAccessibilityID; - -@protocol SessionCellDelegate<NSObject> - -- (TabSwitcherCache*)tabSwitcherCache; -- (void)cellPressed:(UICollectionViewCell*)cell; -- (void)deleteButtonPressedForCell:(UICollectionViewCell*)cell; - -@end - -@interface TabSwitcherSessionCell : UICollectionViewCell - -// Returns the cell's identifier used for the cell's re-use. -+ (NSString*)identifier; - -// The cell delegate. -@property(nonatomic, weak) id<SessionCellDelegate> delegate; - -@end - -// Cell showing information about a local session. -@interface TabSwitcherLocalSessionCell : TabSwitcherSessionCell - -// Getter and setter for the snapshot image. -@property(nonatomic, weak) UIImage* snapshot; - -// Returns the top bar of the cell. The top bar holds the favicon and the tab -// title. -@property(nonatomic, weak, readonly) UIView* topBar; - -// Sets the cell's appearance using information in |tab|. -// The delegate needs to be set before calling this method. -- (void)setAppearanceForTab:(Tab*)tab cellSize:(CGSize)cellSize; - -// Sets the cell's appearance depending on |type|. -- (void)setSessionType:(TabSwitcherSessionType)type; - -@end - -@interface TabSwitcherDistantSessionCell : TabSwitcherSessionCell - -// Sets the cell's title. -- (void)setTitle:(NSString*)title; -// Sets the session's URL to obtain the cell's favicon. -- (void)setSessionGURL:(GURL const&)gurl - withBrowserState:(ios::ChromeBrowserState*)browserState; - -@end - -#endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_PANEL_CELL_H_
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.mm deleted file mode 100644 index cdfa850..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.mm +++ /dev/null
@@ -1,474 +0,0 @@ -// 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 "ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.h" - -#include "components/favicon/ios/web_favicon_driver.h" -#import "ios/chrome/browser/tabs/tab.h" -#import "ios/chrome/browser/ui/fade_truncated_label.h" -#import "ios/chrome/browser/ui/image_util/image_util.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_button.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_cache.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_utils.h" -#import "ios/chrome/browser/ui/uikit_ui_util.h" -#import "ios/chrome/common/favicon/favicon_attributes.h" -#import "ios/chrome/common/ui_util/constraints_ui_util.h" -#include "ios/chrome/grit/ios_strings.h" -#include "ios/chrome/grit/ios_theme_resources.h" -#import "ios/third_party/material_components_ios/src/components/Palettes/src/MaterialPalettes.h" -#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" -#import "ios/third_party/material_text_accessibility_ios/src/src/MDFTextAccessibility.h" -#include "ui/base/l10n/l10n_util.h" -#include "ui/gfx/image/image.h" -#include "url/gurl.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -NSString* const kTabSwicherPanelCellCloseButtonAccessibilityID = - @"TabSwicherPanelCellCloseButton"; - -namespace gfx { -class ImageSkia; -} - -namespace { -const CGFloat kFontSize = 16; -const CGFloat kCellCornerRadius = 2; -const CGFloat kBarHeight = 44; -const CGFloat kTitleLabelTextAlpha = .54; -const CGFloat kNewTabIconAlpha = .87; -} - -CGFloat tabSwitcherLocalSessionCellTopBarHeight() { - return kBarHeight; -} - -@interface TabSwitcherSessionCell () - -// Returns the container view with rounded corners to which all cell subviews -// should be added. -- (UIView*)containerView; - -@end - -@implementation TabSwitcherSessionCell { - UIView* _containerView; - CGSize _cachedShadowSize; -} - -@synthesize delegate = _delegate; - -// Returns the cell's identifier used for the cell's re-use. -+ (NSString*)identifier { - return NSStringFromClass([self class]); -} - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - [self contentView].isAccessibilityElement = YES; - _containerView = [[UIView alloc] initWithFrame:self.bounds]; - [_containerView setAutoresizingMask:UIViewAutoresizingFlexibleHeight | - UIViewAutoresizingFlexibleWidth]; - [[_containerView layer] setCornerRadius:kCellCornerRadius]; - [[_containerView layer] setMasksToBounds:YES]; - [[self contentView] addSubview:_containerView]; - [self updateShadow]; - [[[self contentView] layer] setShouldRasterize:YES]; - [[[self contentView] layer] - setRasterizationScale:[[UIScreen mainScreen] scale]]; - } - return self; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - [self updateShadow]; -} - -- (void)updateShadow { - if (!CGSizeEqualToSize(_cachedShadowSize, self.bounds.size)) { - CGRect offsetedRectangle = CGRectOffset(self.bounds, 0, 6); - UIBezierPath* shadowPath = - [UIBezierPath bezierPathWithRoundedRect:offsetedRectangle - cornerRadius:kCellCornerRadius]; - [[self contentView].layer setShadowPath:shadowPath.CGPath]; - [[self contentView].layer setShadowColor:[UIColor blackColor].CGColor]; - [[self contentView].layer setShadowOpacity:0.5]; - _cachedShadowSize = self.bounds.size; - } -} - -- (UIView*)containerView { - return _containerView; -} - -@end - -@interface TabSwitcherLocalSessionCell () -@property(nonatomic, strong) UILabel* titleLabel; -@property(nonatomic, strong) UIImageView* favicon; -@property(nonatomic, strong) TabSwitcherButton* snapshotButton; -@end - -@implementation TabSwitcherLocalSessionCell { - UIView* _topBar; - UIButton* _closeButton; - UIImageView* _shadow; - UIImageView* _snapshot; - PendingSnapshotRequest _currentPendingSnapshotRequest; -} -@synthesize titleLabel = _titleLabel; -@synthesize favicon = _favicon; -@synthesize snapshotButton = _snapshotButton; - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - // Top bar. - _topBar = [[UIView alloc] initWithFrame:CGRectZero]; - [_topBar setTranslatesAutoresizingMaskIntoConstraints:NO]; - [[self containerView] addSubview:_topBar]; - - // Snapshot view. - _snapshot = [[UIImageView alloc] initWithFrame:CGRectZero]; - [_snapshot setTranslatesAutoresizingMaskIntoConstraints:NO]; - [_snapshot setContentMode:UIViewContentModeScaleAspectFill]; - [_snapshot setClipsToBounds:YES]; - [[self containerView] addSubview:_snapshot]; - - // Cell button. - _snapshotButton = [[TabSwitcherButton alloc] initWithFrame:CGRectZero]; - [_snapshotButton setTranslatesAutoresizingMaskIntoConstraints:NO]; - [_snapshotButton addTarget:self - action:@selector(snapshotPressed) - forControlEvents:UIControlEventTouchUpInside]; - [[self containerView] addSubview:_snapshotButton]; - - // Shadow view. - _shadow = [[UIImageView alloc] initWithFrame:CGRectZero]; - [_shadow setTranslatesAutoresizingMaskIntoConstraints:NO]; - [_shadow setImage:NativeImage(IDR_IOS_TOOLBAR_SHADOW)]; - [[self containerView] addSubview:_shadow]; - - // Constraints on the Top bar, snapshot view, and shadow view. - NSDictionary* viewsDictionary = @{ - @"bar" : _topBar, - @"shadow" : _shadow, - @"snapshot" : _snapshot, - @"snapshotButton" : _snapshotButton, - }; - NSArray* constraints = @[ - @"H:|-0-[bar]-0-|", - @"H:|-0-[shadow]-0-|", - @"H:|-0-[snapshot]-0-|", - @"H:|-0-[snapshotButton]-0-|", - @"V:|-0-[bar(==barHeight)]-0-[snapshot]-0-|", - @"V:[bar]-0-[snapshotButton]-0-|", - @"V:[bar]-0-[shadow]", - ]; - NSDictionary* metrics = - @{ @"barHeight" : @(tabSwitcherLocalSessionCellTopBarHeight()) }; - ApplyVisualConstraintsWithMetrics(constraints, viewsDictionary, metrics); - - // Create and add subviews to the cell bar. - // Title label. - _titleLabel = [[UILabel alloc] initWithFrame:CGRectZero]; - [_titleLabel setTranslatesAutoresizingMaskIntoConstraints:NO]; - [_titleLabel - setFont:[[MDCTypography fontLoader] regularFontOfSize:kFontSize]]; - [_topBar addSubview:_titleLabel]; - - // Favicon. - _favicon = [[UIImageView alloc] initWithFrame:CGRectZero]; - [_favicon setTranslatesAutoresizingMaskIntoConstraints:NO]; - [_topBar addSubview:_favicon]; - - // Close button. - _closeButton = [[UIButton alloc] initWithFrame:CGRectZero]; - _closeButton.accessibilityIdentifier = - kTabSwicherPanelCellCloseButtonAccessibilityID; - [_closeButton - setImage:[[UIImage imageNamed:@"card_close_button"] - imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] - forState:UIControlStateNormal]; - [_closeButton setTranslatesAutoresizingMaskIntoConstraints:NO]; - [_closeButton addTarget:self - action:@selector(closeButtonPressed) - forControlEvents:UIControlEventTouchUpInside]; - [_closeButton setExclusiveTouch:YES]; - [_topBar addSubview:_closeButton]; - - // Constraints on the title label, favicon, and close button. - NSDictionary* barViewsDictionary = @{ - @"favicon" : _favicon, - @"title" : _titleLabel, - @"closeButton" : _closeButton - }; - NSArray* barConstraints = @[ - @"H:|-16-[favicon(==24)]-8-[title]-0-[closeButton(==32)]-8-|", - @"V:[favicon(==24)]", - @"V:[closeButton(==32)]", - ]; - ApplyVisualConstraints(barConstraints, barViewsDictionary); - AddSameCenterYConstraint(_topBar, _favicon); - AddSameCenterYConstraint(_topBar, _titleLabel); - AddSameCenterYConstraint(_topBar, _closeButton); - } - return self; -} - -#pragma mark - Public properties - -- (UIImage*)snapshot { - return _snapshot.image; -} - -- (void)setSnapshot:(UIImage*)snapshot { - _snapshot.image = snapshot; -} - -- (UIView*)topBar { - return _topBar; -} - -#pragma mark - Public methods - -- (void)setAppearanceForTab:(Tab*)tab cellSize:(CGSize)cellSize { - [_titleLabel setText:tab.title]; - [self contentView].accessibilityLabel = tab.title; - - UIImage* tabFavicon = nil; - favicon::FaviconDriver* faviconDriver = - favicon::WebFaviconDriver::FromWebState(tab.webState); - if (faviconDriver && faviconDriver->FaviconIsValid()) { - gfx::Image favicon = faviconDriver->GetFavicon(); - if (!favicon.IsEmpty()) - tabFavicon = favicon.ToUIImage(); - } - - if (!tabFavicon) - tabFavicon = NativeImage(IDR_IOS_OMNIBOX_HTTP); - - [_favicon setImage:tabFavicon]; - - CGSize snapshotSize = cellSize; - snapshotSize.height -= tabSwitcherLocalSessionCellTopBarHeight(); - __weak TabSwitcherLocalSessionCell* weakCell = self; - DCHECK(self.delegate); - DCHECK([self cache]); - _currentPendingSnapshotRequest = - [[self cache] requestSnapshotForTab:tab - withSize:snapshotSize - completionBlock:^(UIImage* image) { - DCHECK([NSThread isMainThread]); - [weakCell setSnapshot:image]; - _currentPendingSnapshotRequest = {}; - }]; -} - -- (void)setSessionType:(TabSwitcherSessionType)type { - UIColor* topBarBackgroundColor; - UIColor* closeButtonTintColor; - UIColor* textColor; - UIColor* snapshotBackgroundColor; - if (type == TabSwitcherSessionType::OFF_THE_RECORD_SESSION) { - topBarBackgroundColor = [[MDCPalette greyPalette] tint700]; - closeButtonTintColor = [[MDCPalette greyPalette] tint100]; - textColor = [[MDCPalette greyPalette] tint100]; - snapshotBackgroundColor = [[MDCPalette greyPalette] tint900]; - } else { - topBarBackgroundColor = [[MDCPalette greyPalette] tint100]; - closeButtonTintColor = [[MDCPalette greyPalette] tint700]; - textColor = [[MDCPalette greyPalette] tint700]; - snapshotBackgroundColor = [UIColor whiteColor]; - } - [_topBar setBackgroundColor:topBarBackgroundColor]; - [[_closeButton imageView] setTintColor:closeButtonTintColor]; - [_titleLabel setTextColor:textColor]; - [_titleLabel setBackgroundColor:topBarBackgroundColor]; - [_snapshot setBackgroundColor:snapshotBackgroundColor]; -} - -#pragma mark - - -- (void)snapshotPressed { - [self.delegate cellPressed:self]; -} - -- (void)closeButtonPressed { - [self.delegate deleteButtonPressedForCell:self]; -} - -- (void)prepareForReuse { - [[self cache] cancelPendingSnapshotRequest:_currentPendingSnapshotRequest]; - _currentPendingSnapshotRequest.clear(); - [_snapshot setImage:nil]; - [_snapshotButton resetState]; - [super prepareForReuse]; -} - -- (TabSwitcherCache*)cache { - return [self.delegate tabSwitcherCache]; -} - -#pragma mark - UIAccessibilityAction - -- (NSArray*)accessibilityCustomActions { - NSMutableArray* customActions = [[NSMutableArray alloc] init]; - UIAccessibilityCustomAction* customAction = - [[UIAccessibilityCustomAction alloc] - initWithName:l10n_util::GetNSString(IDS_IOS_TAB_SWITCHER_CLOSE_TAB) - target:self - selector:@selector(closeButtonPressed)]; - [customActions addObject:customAction]; - return customActions; -} - -@end - -@implementation TabSwitcherDistantSessionCell { - UILabel* _titleLabel; - UIImageView* _favicon; - UIImageView* _newTabIcon; - UIView* _verticallyCenteredView; - TabSwitcherButton* _raisedButton; - NSOperation* _faviconObtainer; -} - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - // Create and add the button that contains all other subviews. - _raisedButton = [[TabSwitcherButton alloc] initWithFrame:CGRectZero]; - [_raisedButton setTranslatesAutoresizingMaskIntoConstraints:NO]; - [_raisedButton addTarget:self - action:@selector(cellPressed) - forControlEvents:UIControlEventTouchUpInside]; - [[self containerView] addSubview:_raisedButton]; - ApplyVisualConstraints(@[ @"H:|-0-[button]-0-|", @"V:|-0-[button]-0-|" ], - @{@"button" : _raisedButton}); - - // Create and add view that will be vertically centered in the space over - // the favicon. - _verticallyCenteredView = [[UIView alloc] initWithFrame:CGRectZero]; - [_verticallyCenteredView setTranslatesAutoresizingMaskIntoConstraints:NO]; - [_verticallyCenteredView setUserInteractionEnabled:NO]; - [_raisedButton addSubview:_verticallyCenteredView]; - - // Create and add title label to |_verticallyCenteredContent|. - _titleLabel = [[UILabel alloc] initWithFrame:CGRectZero]; - [_titleLabel setTranslatesAutoresizingMaskIntoConstraints:NO]; - [_titleLabel setNumberOfLines:5]; - [_titleLabel setTextAlignment:NSTextAlignmentCenter]; - [_titleLabel - setFont:[[MDCTypography fontLoader] regularFontOfSize:kFontSize]]; - [_verticallyCenteredView addSubview:_titleLabel]; - - // Create and add new tab icon to |_verticallyCenteredContent|. - UIImage* newTabIcon = [[UIImage imageNamed:@"tabswitcher_new_tab"] - imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - _newTabIcon = [[UIImageView alloc] initWithImage:newTabIcon]; - [_newTabIcon setAlpha:0]; - [_newTabIcon setTranslatesAutoresizingMaskIntoConstraints:NO]; - [_verticallyCenteredView addSubview:_newTabIcon]; - - // Create and add favicon image container. - _favicon = [[UIImageView alloc] initWithFrame:CGRectZero]; - [_favicon setTranslatesAutoresizingMaskIntoConstraints:NO]; - [_raisedButton addSubview:_favicon]; - - // Add constraints to the button's subviews. - NSDictionary* viewsDictionary = @{ - @"newTabIcon" : _newTabIcon, - @"title" : _titleLabel, - @"favicon" : _favicon, - @"centeredView" : _verticallyCenteredView, - }; - NSArray* constraintsInButton = @[ - @"H:|-0-[centeredView]-0-|", - @"H:[favicon(==16)]", - @"V:|-(>=16)-[centeredView]-(>=16)-[favicon(==16)]-16-|", - ]; - ApplyVisualConstraints(constraintsInButton, viewsDictionary); - AddSameCenterXConstraint(_raisedButton, _favicon); - [_raisedButton addConstraint:[NSLayoutConstraint - constraintWithItem:_verticallyCenteredView - attribute:NSLayoutAttributeCenterY - relatedBy:NSLayoutRelationEqual - toItem:_favicon - attribute:NSLayoutAttributeCenterY - multiplier:0.5 - constant:0]]; - - // Add constraints to the subviews of the vertically centered view. - NSArray* constraintsInVerticallyCenteredView = @[ - @"H:|-16-[title]-16-|", - @"V:|-0-[newTabIcon(==24)]-16-[title(>=16)]-0-|", - ]; - ApplyVisualConstraints(constraintsInVerticallyCenteredView, - viewsDictionary); - AddSameCenterXConstraint(_verticallyCenteredView, _newTabIcon); - } - return self; -} - -- (void)setTitle:(NSString*)titleString { - [_titleLabel setText:titleString]; - [self contentView].accessibilityLabel = titleString; -} - -- (void)setSessionGURL:(GURL const&)gurl - withBrowserState:(ios::ChromeBrowserState*)browserState { - TabSwitcherFaviconGetterCompletionBlock block = - ^(FaviconAttributes* attributes) { - if (attributes.faviconImage) { - UIColor* imageDominantColor = - DominantColorForImage(gfx::Image(attributes.faviconImage), 1.0); - MDCPalette* dominantPalette = - [MDCPalette paletteGeneratedFromColor:imageDominantColor]; - UIColor* backgroundColor = dominantPalette.tint300; - UIColor* textColor = [MDFTextAccessibility - textColorOnBackgroundColor:backgroundColor - targetTextAlpha:kTitleLabelTextAlpha - font:[_titleLabel font]]; - UIColor* iconColor = [MDFTextAccessibility - textColorOnBackgroundColor:backgroundColor - targetTextAlpha:kNewTabIconAlpha - font:[_titleLabel font]]; - [_raisedButton setBackgroundColor:backgroundColor]; - [_titleLabel setTextColor:textColor]; - [_newTabIcon setTintColor:iconColor]; - [_newTabIcon setAlpha:1.0]; - [_favicon setImage:attributes.faviconImage]; - [UIView animateWithDuration:0.2 - animations:^{ - [_raisedButton setAlpha:1.0]; - }]; - } - }; - GURL gurlCopy = gurl; - _faviconObtainer = [NSBlockOperation blockOperationWithBlock:^{ - TabSwitcherGetFavicon(gurlCopy, browserState, block); - }]; - NSOperationQueue* operationQueue = [NSOperationQueue mainQueue]; - [operationQueue addOperation:_faviconObtainer]; -} - -- (void)cellPressed { - [self.delegate cellPressed:self]; -} - -- (void)prepareForReuse { - [_newTabIcon setAlpha:0]; - [_faviconObtainer cancel]; - _faviconObtainer = nil; - [_raisedButton setAlpha:0]; - [_raisedButton resetState]; - [super prepareForReuse]; -} - -@end
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_collection_view_layout.h b/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_collection_view_layout.h deleted file mode 100644 index 6d89451..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_collection_view_layout.h +++ /dev/null
@@ -1,14 +0,0 @@ -// 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. - -#ifndef IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_PANEL_COLLECTION_VIEW_LAYOUT_H_ -#define IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_PANEL_COLLECTION_VIEW_LAYOUT_H_ - -#import <UIKit/UIKit.h> - -@interface TabSwitcherPanelCollectionViewLayout : UICollectionViewFlowLayout - -@end - -#endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_PANEL_COLLECTION_VIEW_LAYOUT_H_
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_collection_view_layout.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_collection_view_layout.mm deleted file mode 100644 index 86d75a231..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_collection_view_layout.mm +++ /dev/null
@@ -1,156 +0,0 @@ -// 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 "ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_collection_view_layout.h" - -#include <algorithm> - -#include "base/logging.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -namespace { -const CGFloat minWidthOfTab = 200; -const CGFloat kInterTabSpacing = 16; -const UIEdgeInsets kCollectionViewEdgeInsets = {16, 16, 16, 16}; -const CGFloat kMaxSizeAsAFactorOfBounds = 0.5; -const CGFloat kMinCellHeightWidthRatio = 0.6; -const CGFloat kMaxCellHeightWidthRatio = 1.8; -} - -@implementation TabSwitcherPanelCollectionViewLayout { - // Keeps track of the inserted and deleted index paths. - NSMutableArray* _deletedIndexPaths; - NSMutableArray* _insertedIndexPaths; -} - -- (int)maxRowCountWithColumnCount:(int)columnCount inBounds:(CGSize)boundsSize { - int cellWidth = (boundsSize.width / columnCount) - (kInterTabSpacing * 2.0); - int minCellHeight = cellWidth * kMinCellHeightWidthRatio; - return boundsSize.height / (minCellHeight + (kInterTabSpacing * 2.0)); -} - -- (void)updateLayoutWithBounds:(CGSize)boundsSize { - // Ignore initial call to |updateLayoutWithBounds| when the frame of the - // collection view is CGRectZero, because it creates very small cells with - // broken constraints. - if (boundsSize.height == 0 && boundsSize.width == 0) - return; - int tabCount = [[self collectionView] numberOfItemsInSection:0]; - // Early return because there's nothing to layout. - if (tabCount == 0) - return; - - int numberOfColumns = 0; - int numberOfRows = 0; - - int maxNumberOfColums = static_cast<int>( - floor(boundsSize.width / (minWidthOfTab + kInterTabSpacing * 2.0))); - // No need to have more columns than tabs. - maxNumberOfColums = std::min(maxNumberOfColums, tabCount); - - if ([self maxRowCountWithColumnCount:maxNumberOfColums inBounds:boundsSize] * - maxNumberOfColums < - tabCount) { - // It is impossible for all the tabs to be shown on screen at once. - // Layout the tabs using the highest density possible, i.e. using the - // maximum number of columns. - numberOfColumns = maxNumberOfColums; - numberOfRows = - [self maxRowCountWithColumnCount:maxNumberOfColums inBounds:boundsSize]; - } else { - // Find the most squarish configuration that allows showing all the tabs. - // A squarish configuration is a layout were the number of rows and columns - // are roughly equal. - - // |bestScore| contains abs(rowCount - columnCount). - // The lower |bestScore| is, the better the configuration is. - int bestScore = INT_MAX; - - int loopStart; - int loopEnd; - int loopDirection; - if (boundsSize.width > boundsSize.height) { - // In landscape, consider in priority layouts with a large number of - // columns. - loopStart = maxNumberOfColums; - loopEnd = 0; - loopDirection = -1; - } else { - // In landscape, consider in priority layouts with a large number of rows, - // i.e. a small number of columns. - loopStart = 1; - loopEnd = maxNumberOfColums + 1; - loopDirection = 1; - } - - int columnCountIterator = loopStart; - while (columnCountIterator != loopEnd) { - // Find the minimum number of rows needed to show |tabCount| tab in - // |columnCount| columns. - int maxRowCount = [self maxRowCountWithColumnCount:columnCountIterator - inBounds:boundsSize]; - int idealRowCount = static_cast<int>( - ceil(static_cast<float>(tabCount) / columnCountIterator)); - if (idealRowCount <= maxRowCount) { - int score = abs(idealRowCount - columnCountIterator); - if (score < bestScore) { - bestScore = score; - numberOfColumns = columnCountIterator; - numberOfRows = idealRowCount; - } - } - columnCountIterator += loopDirection; - } - DCHECK_NE(bestScore, INT_MAX); - } - - DCHECK_NE(numberOfColumns, 0); - DCHECK_NE(numberOfRows, 0); - - // Compute the size of the cells. - CGFloat horizontalFreeSpace = - boundsSize.width - (kInterTabSpacing * 2 * (numberOfColumns - 1)) - - kCollectionViewEdgeInsets.left - kCollectionViewEdgeInsets.right; - CGFloat verticalFreeSpace = - boundsSize.height - (kInterTabSpacing * 2 * (numberOfRows - 1)) - - kCollectionViewEdgeInsets.top - kCollectionViewEdgeInsets.bottom; - CGSize newCellSize = CGSizeMake(horizontalFreeSpace / numberOfColumns, - verticalFreeSpace / numberOfRows); - - // The cells must not be larger than half of the bounds because the @1x - // snapshots would look blurry on retina screens. - newCellSize.width = - std::min(newCellSize.width, boundsSize.width * kMaxSizeAsAFactorOfBounds); - newCellSize.height = std::min(newCellSize.height, - boundsSize.height * kMaxSizeAsAFactorOfBounds); - - // Avoid having cells be too narrow. - newCellSize.height = std::min(newCellSize.height, - newCellSize.width * kMaxCellHeightWidthRatio); - - [self setItemSize:newCellSize]; - - [self setMinimumInteritemSpacing:kInterTabSpacing]; - [self setMinimumLineSpacing:kInterTabSpacing * 2]; - - bool forceVerticalCentering = numberOfRows == 1; - if (forceVerticalCentering) { - UIEdgeInsets insets = kCollectionViewEdgeInsets; - insets.top = (boundsSize.height - newCellSize.height) / 2.0; - insets.bottom = (boundsSize.height - newCellSize.height) / 2.0; - [self setSectionInset:insets]; - } else { - [self setSectionInset:kCollectionViewEdgeInsets]; - } -} - -- (void)prepareLayout { - [super prepareLayout]; - [self updateLayoutWithBounds:[[self collectionView] bounds].size]; -} - -@end
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_controller.h b/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_controller.h deleted file mode 100644 index 66d5ea9..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_controller.h +++ /dev/null
@@ -1,116 +0,0 @@ -// 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. - -#ifndef IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_PANEL_CONTROLLER_H_ -#define IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_PANEL_CONTROLLER_H_ - -#import <UIKit/UIKit.h> - -#include "base/ios/block_types.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_model.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.h" - -@protocol ApplicationCommands; -@protocol BrowserCommands; -@protocol SigninPresenter; -@protocol SyncPresenter; - -namespace ios { -class ChromeBrowserState; -} - -@class TabSwitcherLocalSessionCell; -@class TabSwitcherPanelController; - -@protocol TabSwitcherPanelControllerDelegate<NSObject> - -// Called when the user selects the cell representing the distant tab |tab|. -- (void)tabSwitcherPanelController: - (TabSwitcherPanelController*)tabSwitcherPanelController - didSelectDistantTab:(synced_sessions::DistantTab*)tab; - -// Called when the user selects the cell representing the local tab |tab|. -- (void)tabSwitcherPanelController: - (TabSwitcherPanelController*)tabSwitcherPanelController - didSelectLocalTab:(Tab*)tab; - -// Called when the user pressed the close button on the cell representing the -// local tab |tab|. -- (void)tabSwitcherPanelController: - (TabSwitcherPanelController*)tabSwitcherPanelController - didCloseLocalTab:(Tab*)tab; - -// Called when the overlay view visibility changed. -- (void)tabSwitcherPanelControllerDidUpdateOverlayViewVisibility: - (TabSwitcherPanelController*)tabSwitcherPanelController; - -@end - -@class TabSwitcherPanelView; -// The tab switcher panel controller manages a panel view. -// It can manage either distant or local sessions and uses a TabSwitcherModel -// as its data source. -@class TabSwitcherCache; - -@interface TabSwitcherPanelController : NSObject - -@property(nonatomic, readonly, weak) TabSwitcherPanelView* view; -@property(nonatomic, weak) id<TabSwitcherPanelControllerDelegate> delegate; -@property(nonatomic, readonly) TabSwitcherSessionType sessionType; -@property(nonatomic, readonly, weak) id<SigninPresenter, SyncPresenter> - presenter; -@property(nonatomic, readonly, weak) id<ApplicationCommands, BrowserCommands> - dispatcher; - -// Initializes a controller for a view showing local tabs. |offTheRecord| -// determines whether the tabs will be shown for the incognito browser state or -// not. |model| is used to populate the view and must not be nil. -- (instancetype)initWithModel:(TabSwitcherModel*)model - forLocalSessionOfType:(TabSwitcherSessionType)type - withCache:(TabSwitcherCache*)cache - browserState:(ios::ChromeBrowserState*)browserState - presenter:(id<SigninPresenter, SyncPresenter>)presenter - dispatcher: - (id<ApplicationCommands, BrowserCommands>)dispatcher; - -// Initializes a controller for a view showing the tabs of a distant session. -// |model| is used to populate the view and must not be nil. -- (instancetype)initWithModel:(TabSwitcherModel*)model - forDistantSessionWithTag:(std::string const&)sessionTag - browserState:(ios::ChromeBrowserState*)browserState - presenter:(id<SigninPresenter, SyncPresenter>)presenter - dispatcher: - (id<ApplicationCommands, BrowserCommands>)dispatcher; - -// Tells the controller that the collectionview's content may need to be -// updated. -- (void)updateCollectionViewIfNeeded; - -// Returns the tag of the distant session. -- (std::string)sessionTag; - -// Returns true if the new tab button should be shown. -- (BOOL)shouldShowNewTabButton; - -// Scrolls the collection view so that the tab cell at the given index is -// visible. -- (void)scrollTabIndexToVisible:(NSInteger)index triggerLayout:(BOOL)layout; - -// Returns the cell for the tab at the given index. -// This methods should only be used for animation purpose. -- (TabSwitcherLocalSessionCell*)localSessionCellForTabAtIndex:(NSInteger)index; - -- (CGRect)localSessionCellFrameForTabAtIndex:(NSInteger)index; - -// Reloads cells. -- (void)reload; - -- (UICollectionView*)collectionView; - -// Returns the distantSession owned and displayed by this controller. -- (const synced_sessions::DistantSession*)distantSession; - -@end - -#endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_PANEL_CONTROLLER_H_
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_controller.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_controller.mm deleted file mode 100644 index a2198279..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_controller.mm +++ /dev/null
@@ -1,368 +0,0 @@ -// 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 "ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_controller.h" - -#include "base/logging.h" -#import "base/mac/foundation_util.h" -#include "base/strings/sys_string_conversions.h" -#import "ios/chrome/browser/tabs/tab.h" -#include "ios/chrome/browser/ui/ntp/recent_tabs/synced_sessions.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_cache.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_overlay_view.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_view.h" -#include "ios/chrome/browser/ui/tab_switcher/tab_switcher_session_changes.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -namespace { - -void FillVectorWithHashesUsingDistantSession( - synced_sessions::DistantSession const& session, - std::vector<size_t>* hashes) { - DCHECK(hashes); - DCHECK(hashes->empty()); - for (size_t i = 0; i < session.tabs.size(); ++i) { - hashes->push_back(session.tabs[i]->hashOfUserVisibleProperties()); - } -} - -} // namespace - -@interface TabSwitcherPanelController ()<UICollectionViewDataSource, - UICollectionViewDelegate, - SessionCellDelegate> { - ios::ChromeBrowserState* _browserState; // Weak. - TabSwitcherPanelView* _panelView; - TabSwitcherModel* _model; - std::string _sessionTag; - TabSwitcherSessionType _sessionType; - TabSwitcherCache* _cache; - TabSwitcherPanelOverlayView* _overlayView; - std::unique_ptr<const synced_sessions::DistantSession> _distantSession; - std::unique_ptr<const TabModelSnapshot> _localSession; -} - -// Changes the visibility of the zero tab state overlay view. -- (void)setZeroTabStateOverlayVisible:(BOOL)show; - -@end - -@implementation TabSwitcherPanelController - -@synthesize delegate = _delegate; -@synthesize sessionType = _sessionType; -@synthesize presenter = _presenter; -@synthesize dispatcher = _dispatcher; - -- (instancetype)initWithModel:(TabSwitcherModel*)model - forDistantSessionWithTag:(std::string const&)sessionTag - browserState:(ios::ChromeBrowserState*)browserState - presenter:(id<SigninPresenter, SyncPresenter>)presenter - dispatcher: - (id<ApplicationCommands, BrowserCommands>)dispatcher { - self = [super init]; - if (self) { - DCHECK(model); - _presenter = presenter; - _dispatcher = dispatcher; - _sessionType = TabSwitcherSessionType::DISTANT_SESSION; - _model = model; - _distantSession = [model distantSessionForTag:sessionTag]; - _sessionTag = sessionTag; - _browserState = browserState; - [self loadView]; - } - return self; -} - -- (instancetype)initWithModel:(TabSwitcherModel*)model - forLocalSessionOfType:(TabSwitcherSessionType)sessionType - withCache:(TabSwitcherCache*)cache - browserState:(ios::ChromeBrowserState*)browserState - presenter:(id<SigninPresenter, SyncPresenter>)presenter - dispatcher: - (id<ApplicationCommands, BrowserCommands>)dispatcher { - self = [super init]; - if (self) { - DCHECK(model); - _presenter = presenter; - _dispatcher = dispatcher; - _sessionType = sessionType; - _model = model; - _localSession = [model tabModelSnapshotForLocalSession:sessionType]; - _cache = cache; - _browserState = browserState; - [self loadView]; - } - return self; -} - -- (TabSwitcherPanelView*)view { - return _panelView; -} - -- (std::string)sessionTag { - return _sessionTag; -} - -- (void)setDelegate:(id<TabSwitcherPanelControllerDelegate>)delegate { - _delegate = delegate; - [[_panelView collectionView] performBatchUpdates:nil completion:nil]; -} - -- (BOOL)shouldShowNewTabButton { - if (_sessionType == TabSwitcherSessionType::DISTANT_SESSION) { - return NO; - } else { - return ![self isOverlayVisible]; - } -} - -- (void)updateCollectionViewIfNeeded { - if (_sessionType == TabSwitcherSessionType::DISTANT_SESSION) { - UICollectionView* collectionView = [_panelView collectionView]; - // TODO(crbug.com/633928) Compute TabSwitcherSessionChanges outside of the - // updateBlock. - auto updateBlock = ^{ - std::unique_ptr<const synced_sessions::DistantSession> newDistantSession = - [_model distantSessionForTag:_sessionTag]; - std::vector<size_t> oldTabsHashes; - std::vector<size_t> newTabsHashes; - FillVectorWithHashesUsingDistantSession(*_distantSession.get(), - &oldTabsHashes); - FillVectorWithHashesUsingDistantSession(*newDistantSession.get(), - &newTabsHashes); - TabSwitcherSessionChanges changes(oldTabsHashes, newTabsHashes); - if (changes.HasChanges()) { - _distantSession = std::move(newDistantSession); - [self applyChanges:changes toCollectionView:collectionView]; - } - }; - [collectionView performBatchUpdates:updateBlock completion:nil]; - } else { - UICollectionView* collectionView = [_panelView collectionView]; - auto updateBlock = ^{ - std::unique_ptr<const TabModelSnapshot> newLocalSession = - [_model tabModelSnapshotForLocalSession:_sessionType]; - TabSwitcherSessionChanges changes(_localSession->hashes(), - newLocalSession->hashes()); - if (changes.HasChanges()) { - _localSession = std::move(newLocalSession); - [self applyChanges:changes toCollectionView:collectionView]; - } - }; - [collectionView performBatchUpdates:updateBlock completion:nil]; - } -} - -- (void)applyChanges:(TabSwitcherSessionChanges&)changes - toCollectionView:(UICollectionView*)collectionView { - NSMutableArray* deletedIndexes = [NSMutableArray array]; - NSMutableArray* insertedIndexes = [NSMutableArray array]; - NSMutableArray* updatedIndexes = [NSMutableArray array]; - for (size_t i : changes.deletions()) { - NSInteger deletedTabIndex = static_cast<NSInteger>(i); - [deletedIndexes - addObject:[NSIndexPath indexPathForItem:deletedTabIndex inSection:0]]; - } - for (size_t i : changes.insertions()) { - NSInteger insertedTabIndex = static_cast<NSInteger>(i); - [insertedIndexes - addObject:[NSIndexPath indexPathForItem:insertedTabIndex inSection:0]]; - } - for (size_t i : changes.updates()) { - NSInteger updatedTabIndex = static_cast<NSInteger>(i); - [updatedIndexes - addObject:[NSIndexPath indexPathForItem:updatedTabIndex inSection:0]]; - } - [collectionView deleteItemsAtIndexPaths:deletedIndexes]; - [collectionView insertItemsAtIndexPaths:insertedIndexes]; - [collectionView reloadItemsAtIndexPaths:updatedIndexes]; -} - -- (void)scrollTabIndexToVisible:(NSInteger)index triggerLayout:(BOOL)layout { - [[_panelView collectionView] - scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:index inSection:0] - atScrollPosition:UICollectionViewScrollPositionTop - animated:NO]; - if (layout) - [[_panelView collectionView] layoutIfNeeded]; -} - -- (TabSwitcherLocalSessionCell*)localSessionCellForTabAtIndex:(NSInteger)index { - return (TabSwitcherLocalSessionCell*)[[_panelView collectionView] - cellForItemAtIndexPath:[NSIndexPath indexPathForItem:index inSection:0]]; -} - -- (CGRect)localSessionCellFrameForTabAtIndex:(NSInteger)index { - UICollectionViewLayoutAttributes* attributes = [[_panelView collectionView] - layoutAttributesForItemAtIndexPath:[NSIndexPath indexPathForItem:index - inSection:0]]; - return attributes.frame; -} - -- (void)reload { - [[_panelView collectionView] reloadSections:[NSIndexSet indexSetWithIndex:0]]; -} - -- (UICollectionView*)collectionView { - return [_panelView collectionView]; -} - -#pragma mark - UICollectionViewDataSource - -- (NSInteger)collectionView:(UICollectionView*)collectionView - numberOfItemsInSection:(NSInteger)section { - DCHECK_EQ(section, 0); - if (_sessionType == TabSwitcherSessionType::DISTANT_SESSION) { - CHECK(_distantSession); - return _distantSession->tabs.size(); - } else { - CHECK(_localSession); - NSInteger numberOfTabs = _localSession->tabs().size(); - [self setZeroTabStateOverlayVisible:numberOfTabs == 0]; - return numberOfTabs; - } -} - -- (UICollectionViewCell*)collectionView:(UICollectionView*)collectionView - cellForItemAtIndexPath:(NSIndexPath*)indexPath { - TabSwitcherSessionCell* cell = nil; - NSUInteger tabIndex = indexPath.item; - if (_sessionType == TabSwitcherSessionType::DISTANT_SESSION) { - NSString* identifier = [TabSwitcherDistantSessionCell identifier]; - TabSwitcherDistantSessionCell* panelCell = - base::mac::ObjCCastStrict<TabSwitcherDistantSessionCell>([collectionView - dequeueReusableCellWithReuseIdentifier:identifier - forIndexPath:indexPath]); - cell = panelCell; - - CHECK(_distantSession); - const std::size_t distantSessionTabCount = _distantSession->tabs.size(); - LOG_ASSERT(tabIndex < distantSessionTabCount) - << "tabIndex == " << tabIndex - << " _distantSession->tabs.size() == " << distantSessionTabCount; - synced_sessions::DistantTab* tab = _distantSession->tabs[tabIndex].get(); - CHECK(tab); - [panelCell setTitle:base::SysUTF16ToNSString(tab->title)]; - [panelCell setSessionGURL:tab->virtual_url - withBrowserState:[_model browserState]]; - [panelCell setDelegate:self]; - } else { - NSString* identifier = [TabSwitcherLocalSessionCell identifier]; - TabSwitcherLocalSessionCell* panelCell = - base::mac::ObjCCastStrict<TabSwitcherLocalSessionCell>([collectionView - dequeueReusableCellWithReuseIdentifier:identifier - forIndexPath:indexPath]); - cell = panelCell; - - Tab* tab = _localSession->tabs()[tabIndex]; - [panelCell setSessionType:_sessionType]; - [panelCell setDelegate:self]; - [panelCell setAppearanceForTab:tab cellSize:[_panelView cellSize]]; - } - DCHECK(cell); - return cell; -} - -- (void)collectionView:(UICollectionView*)collectionView - didEndDisplayingCell:(UICollectionViewCell*)cell - forItemAtIndexPath:(NSIndexPath*)indexPath { - // When closing the last tab, accessibility does not realize that there is no - // elements in the collection view and keep the custom action for the tab. So - // reset the delegate of the cell (to avoid crashing if the action is invoked) - // and post a notification that the screen changed to force accessibility to - // re-inspect the whole screen. See http://crbug.com/677374 for crash log. - base::mac::ObjCCastStrict<TabSwitcherSessionCell>(cell).delegate = nil; - UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, - nil); -} - -#pragma mark - SessionCellDelegate - -- (TabSwitcherCache*)tabSwitcherCache { - return _cache; -} - -- (void)cellPressed:(UICollectionViewCell*)cell { - const NSInteger tabIndex = - [[_panelView collectionView] indexPathForCell:cell].item; - - if (_sessionType == TabSwitcherSessionType::DISTANT_SESSION) { - synced_sessions::DistantTab* tab = _distantSession->tabs[tabIndex].get(); - if (tab) - [self.delegate tabSwitcherPanelController:self didSelectDistantTab:tab]; - } else { - Tab* tab = _localSession->tabs()[tabIndex]; - if (tab) - [self.delegate tabSwitcherPanelController:self didSelectLocalTab:tab]; - } -} - -- (void)deleteButtonPressedForCell:(UICollectionViewCell*)cell { - DCHECK(_sessionType != TabSwitcherSessionType::DISTANT_SESSION); - const NSInteger tabIndex = - [[_panelView collectionView] indexPathForCell:cell].item; - Tab* tab = _localSession->tabs()[tabIndex]; - if (tab) - [self.delegate tabSwitcherPanelController:self didCloseLocalTab:tab]; -} - -#pragma mark - Private - -- (BOOL)isOverlayVisible { - return _overlayView && [_overlayView alpha] != 0.0; -} - -- (void)setZeroTabStateOverlayVisible:(BOOL)show { - if (show == [self isOverlayVisible]) - return; - - DCHECK(TabSwitcherSessionTypeIsLocalSession(_sessionType)); - - if (!_overlayView) { - _overlayView = [[TabSwitcherPanelOverlayView alloc] - initWithFrame:[_panelView bounds] - browserState:_browserState - presenter:self.presenter /* id<SigninPresenter, SyncPresenter> */ - dispatcher:self.dispatcher]; - [_overlayView - setOverlayType: - (_sessionType == TabSwitcherSessionType::OFF_THE_RECORD_SESSION) - ? TabSwitcherPanelOverlayType:: - OVERLAY_PANEL_USER_NO_INCOGNITO_TABS - : TabSwitcherPanelOverlayType::OVERLAY_PANEL_USER_NO_OPEN_TABS]; - - [_overlayView setAlpha:0]; - [_overlayView setAutoresizingMask:UIViewAutoresizingFlexibleHeight | - UIViewAutoresizingFlexibleWidth]; - [_panelView addSubview:_overlayView]; - [_overlayView setNeedsLayout]; - } - - [UIView - animateWithDuration:0.25 - animations:^{ - [_overlayView setAlpha:show ? 1.0 : 0.0]; - [self.delegate - tabSwitcherPanelControllerDidUpdateOverlayViewVisibility: - self]; - }]; -} - -- (void)loadView { - _panelView = [[TabSwitcherPanelView alloc] initWithSessionType:_sessionType]; - _panelView.collectionView.dataSource = self; - _panelView.collectionView.delegate = self; -} - -- (synced_sessions::DistantSession const*)distantSession { - return _distantSession.get(); -} - -@end
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_overlay_view.h b/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_overlay_view.h deleted file mode 100644 index e224978..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_overlay_view.h +++ /dev/null
@@ -1,69 +0,0 @@ -// 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. - -#ifndef IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_PANEL_OVERLAY_VIEW_H_ -#define IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_PANEL_OVERLAY_VIEW_H_ - -#import <UIKit/UIKit.h> - -@protocol ApplicationCommands; -@protocol BrowserCommands; -@protocol SigninPresenter; -@class SigninPromoView; -@protocol SyncPresenter; -@class TabSwitcherPanelOverlayView; - -namespace ios { -class ChromeBrowserState; -} - -enum class TabSwitcherPanelOverlayType { - OVERLAY_PANEL_EMPTY, - OVERLAY_PANEL_USER_SIGNED_OUT, - OVERLAY_PANEL_USER_SIGNED_IN_SYNC_OFF, - OVERLAY_PANEL_USER_SIGNED_IN_SYNC_ON_NO_SESSIONS, - OVERLAY_PANEL_USER_SIGNED_IN_SYNC_IN_PROGRESS, - OVERLAY_PANEL_USER_NO_OPEN_TABS, - OVERLAY_PANEL_USER_NO_INCOGNITO_TABS -}; - -enum class TabSwitcherSignInPanelsType; - -TabSwitcherPanelOverlayType PanelOverlayTypeFromSignInPanelsType( - TabSwitcherSignInPanelsType signInPanelType); - -// Delegate protocol for TabSwitcherPanelOverlayView. -@protocol TabSwitcherPanelOverlayViewDelegate<NSObject> - -// Called when TabSwitcherPanelOverlayView is shown. -- (void)tabSwitcherPanelOverlViewWasShown: - (TabSwitcherPanelOverlayView*)tabSwitcherPanelOverlayView; -// Called when TabSwitcherPanelOverlayView is hidden. -- (void)tabSwitcherPanelOverlViewWasHidden: - (TabSwitcherPanelOverlayView*)tabSwitcherPanelOverlayView; - -@end - -@interface TabSwitcherPanelOverlayView : UIView - -@property(nonatomic, assign) TabSwitcherPanelOverlayType overlayType; -@property(nonatomic, readonly, weak) id<SigninPresenter, SyncPresenter> - presenter; -@property(nonatomic, readonly, weak) id<ApplicationCommands, BrowserCommands> - dispatcher; -// Sign-in promo view. Nil if the |overlayType| is not -// |OVERLAY_PANEL_USER_SIGNED_OUT|. -@property(nonatomic, readonly) SigninPromoView* signinPromoView; -// Delegate, can be nil. -@property(nonatomic, weak) id<TabSwitcherPanelOverlayViewDelegate> delegate; - -- (instancetype)initWithFrame:(CGRect)frame - browserState:(ios::ChromeBrowserState*)browserState - presenter:(id<SigninPresenter, SyncPresenter>)presenter - dispatcher: - (id<ApplicationCommands, BrowserCommands>)dispatcher; - -@end - -#endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_PANEL_OVERLAY_VIEW_H_
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_overlay_view.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_overlay_view.mm deleted file mode 100644 index 7be45cb..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_overlay_view.mm +++ /dev/null
@@ -1,479 +0,0 @@ -// 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 "ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_overlay_view.h" - -#include "base/mac/foundation_util.h" -#include "base/metrics/user_metrics.h" -#include "base/metrics/user_metrics_action.h" -#include "components/signin/core/browser/signin_metrics.h" -#include "ios/chrome/browser/experimental_flags.h" -#import "ios/chrome/browser/ui/authentication/signin_promo_view.h" -#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" -#import "ios/chrome/browser/ui/commands/application_commands.h" -#import "ios/chrome/browser/ui/commands/browser_commands.h" -#import "ios/chrome/browser/ui/commands/open_new_tab_command.h" -#import "ios/chrome/browser/ui/material_components/activity_indicator.h" -#import "ios/chrome/browser/ui/settings/sync_utils/sync_presenter.h" -#import "ios/chrome/browser/ui/settings/sync_utils/sync_util.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_model.h" -#import "ios/chrome/common/ui_util/constraints_ui_util.h" -#include "ios/chrome/grit/ios_chromium_strings.h" -#include "ios/chrome/grit/ios_strings.h" -#include "ios/public/provider/chrome/browser/chrome_browser_provider.h" -#import "ios/third_party/material_components_ios/src/components/ActivityIndicator/src/MaterialActivityIndicator.h" -#import "ios/third_party/material_components_ios/src/components/Buttons/src/MaterialButtons.h" -#import "ios/third_party/material_components_ios/src/components/ShadowElevations/src/MaterialShadowElevations.h" -#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" -#include "ui/base/l10n/l10n_util.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -TabSwitcherPanelOverlayType PanelOverlayTypeFromSignInPanelsType( - TabSwitcherSignInPanelsType signInPanelType) { - switch (signInPanelType) { - case TabSwitcherSignInPanelsType::PANEL_USER_SIGNED_OUT: - return TabSwitcherPanelOverlayType::OVERLAY_PANEL_USER_SIGNED_OUT; - case TabSwitcherSignInPanelsType::PANEL_USER_SIGNED_IN_SYNC_OFF: - return TabSwitcherPanelOverlayType::OVERLAY_PANEL_USER_SIGNED_IN_SYNC_OFF; - case TabSwitcherSignInPanelsType::PANEL_USER_SIGNED_IN_SYNC_IN_PROGRESS: - return TabSwitcherPanelOverlayType:: - OVERLAY_PANEL_USER_SIGNED_IN_SYNC_IN_PROGRESS; - case TabSwitcherSignInPanelsType::PANEL_USER_SIGNED_IN_SYNC_ON_NO_SESSIONS: - return TabSwitcherPanelOverlayType:: - OVERLAY_PANEL_USER_SIGNED_IN_SYNC_ON_NO_SESSIONS; - case TabSwitcherSignInPanelsType::NO_PANEL: - return TabSwitcherPanelOverlayType::OVERLAY_PANEL_EMPTY; - } -} - -namespace { -const CGFloat kContainerOriginYOffset = -58.0; -const CGFloat kContainerWidth = 400.0; -const CGFloat kTitleMinimumLineHeight = 32.0; -const CGFloat kSubtitleMinimunLineHeight = 24.0; -} - -@interface TabSwitcherPanelOverlayView () - -// Updates the texts of labels and button according to the current -// |overlayType|. -- (void)updateText; -// Updates the button target and tag according to the current |overlayType|. -- (void)updateButtonTarget; - -@end - -@implementation TabSwitcherPanelOverlayView { - ios::ChromeBrowserState* _browserState; // Weak. - // |_container| should not be shown when |overlayType| is set to - // |OVERLAY_PANEL_USER_SIGNED_OUT|. - UIView* _container; - UILabel* _titleLabel; - UILabel* _subtitleLabel; - MDCButton* _textButton; - MDCButton* _floatingButton; - MDCActivityIndicator* _activityIndicator; - std::string _recordedMetricString; - // |_signinPromoView| should only be shown when |overlayType| is set to - // |OVERLAY_PANEL_USER_SIGNED_OUT|. - SigninPromoView* _signinPromoView; -} - -@synthesize overlayType = _overlayType; -@synthesize presenter = _presenter; -@synthesize dispatcher = _dispatcher; -@synthesize signinPromoView = _signinPromoView; -@synthesize delegate = _delegate; - -- (instancetype)initWithFrame:(CGRect)frame - browserState:(ios::ChromeBrowserState*)browserState - presenter:(id<SigninPresenter, SyncPresenter>)presenter - dispatcher: - (id<ApplicationCommands, BrowserCommands>)dispatcher { - self = [super initWithFrame:frame]; - if (self) { - _browserState = browserState; - _presenter = presenter; - _dispatcher = dispatcher; - // Create and add container. Will be vertically and horizontally centered. - _container = [[UIView alloc] initWithFrame:CGRectZero]; - [_container setTranslatesAutoresizingMaskIntoConstraints:NO]; - [self addSubview:_container]; - - // Create and add title label to the container. - _titleLabel = [[UILabel alloc] initWithFrame:CGRectZero]; - [_titleLabel setTranslatesAutoresizingMaskIntoConstraints:NO]; - [_titleLabel setFont:[MDCTypography headlineFont]]; - [_titleLabel - setTextColor:[UIColor - colorWithWhite:1 - alpha:[MDCTypography headlineFontOpacity]]]; - [_titleLabel setLineBreakMode:NSLineBreakByWordWrapping]; - [_titleLabel setNumberOfLines:0]; - [_titleLabel setTextAlignment:NSTextAlignmentCenter]; - [_container addSubview:_titleLabel]; - - // Create and add subtitle label to the container. - _subtitleLabel = [[UILabel alloc] initWithFrame:CGRectZero]; - [_subtitleLabel setTranslatesAutoresizingMaskIntoConstraints:NO]; - [_subtitleLabel setFont:[MDCTypography subheadFont]]; - [_subtitleLabel - setTextColor:[UIColor - colorWithWhite:1 - alpha:[MDCTypography display1FontOpacity]]]; - [_subtitleLabel setNumberOfLines:0]; - [_container addSubview:_subtitleLabel]; - - // Create and add button to the container. - _textButton = [[MDCRaisedButton alloc] init]; - [_textButton setElevation:MDCShadowElevationNone - forState:UIControlStateNormal]; - MDCPalette* buttonPalette = [MDCPalette cr_bluePalette]; - [_textButton - setInkColor:[[buttonPalette tint300] colorWithAlphaComponent:0.5f]]; - [_textButton setBackgroundColor:[buttonPalette tint500] - forState:UIControlStateNormal]; - [_textButton setBackgroundColor:[UIColor colorWithWhite:0.8f alpha:1.0f] - forState:UIControlStateDisabled]; - [_textButton setTranslatesAutoresizingMaskIntoConstraints:NO]; - [[_textButton imageView] setTintColor:[UIColor whiteColor]]; - [_textButton setTitleColor:[UIColor whiteColor] - forState:UIControlStateNormal]; - [_container addSubview:_textButton]; - - // Create and add floatingButton to the container. - _floatingButton = [[MDCFloatingButton alloc] init]; - [_floatingButton setTranslatesAutoresizingMaskIntoConstraints:NO]; - [[_floatingButton imageView] setTintColor:[UIColor whiteColor]]; - [_container addSubview:_floatingButton]; - - // Create and add activity indicator to the container. - _activityIndicator = - [[MDCActivityIndicator alloc] initWithFrame:CGRectZero]; - [_activityIndicator setCycleColors:ActivityIndicatorBrandedCycleColors()]; - [_activityIndicator setTranslatesAutoresizingMaskIntoConstraints:NO]; - [_container addSubview:_activityIndicator]; - - // Set constraints on all of the container's subviews. - AddSameCenterXConstraint(_container, _titleLabel); - AddSameCenterXConstraint(_container, _subtitleLabel); - NSDictionary* viewsDictionary = @{ - @"title" : _titleLabel, - @"subtitle" : _subtitleLabel, - @"button" : _textButton, - @"floatingButton" : _floatingButton, - @"activityIndicator" : _activityIndicator, - }; - AddSameCenterXConstraint(_container, _textButton); - AddSameCenterXConstraint(_container, _floatingButton); - AddSameCenterXConstraint(_container, _activityIndicator); - NSArray* constraints = @[ - @"V:|-0-[title]-12-[subtitle]-48-[button]-0-|", - @"V:[subtitle]-35-[floatingButton(==48)]-0-|", - @"V:[subtitle]-24-[activityIndicator]", @"H:|-[title]-|", - @"H:|-[subtitle]-|", @"H:[button(>=180)]", @"H:[floatingButton(==48)]" - ]; - ApplyVisualConstraints(constraints, viewsDictionary); - - // Sets the container's width relative to the parent. - ApplyVisualConstraintsWithMetrics( - @[ - @"H:|-(>=0)-[container(==containerWidth@999)]-(>=0)-|", - ], - @{ @"container" : _container }, - @{ @"containerWidth" : @(kContainerWidth) }); - } - return self; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - CGRect containerFrame = [_container frame]; - containerFrame.origin.x = - (self.frame.size.width - containerFrame.size.width) / 2; - containerFrame.origin.y = - (self.frame.size.height - containerFrame.size.height) / 2 + - kContainerOriginYOffset; - [_container setFrame:containerFrame]; -} - -- (void)setOverlayType:(TabSwitcherPanelOverlayType)overlayType { - _overlayType = overlayType; - if (_overlayType == - TabSwitcherPanelOverlayType::OVERLAY_PANEL_USER_SIGNED_OUT) { - [self createSigninPromoViewIfNeeded]; - _container.hidden = YES; - } else { - _container.hidden = NO; - [_signinPromoView removeFromSuperview]; - _signinPromoView = nil; - [self updateText]; - [self updateButtonTarget]; - } -} - -- (void)wasShown { - [self.delegate tabSwitcherPanelOverlViewWasShown:self]; -} - -- (void)wasHidden { - [self.delegate tabSwitcherPanelOverlViewWasHidden:self]; -} - -#pragma mark - Private - -// Creates the sign-in view and its mediator if it doesn't exist. -- (void)createSigninPromoViewIfNeeded { - if (_signinPromoView) - return; - _signinPromoView = - [[SigninPromoView alloc] initWithFrame:CGRectZero - style:SigninPromoViewUILegacy]; - _signinPromoView.translatesAutoresizingMaskIntoConstraints = NO; - _signinPromoView.textLabel.text = - l10n_util::GetNSString(IDS_IOS_SIGNIN_PROMO_RECENT_TABS); - _signinPromoView.textLabel.textColor = [UIColor whiteColor]; - _signinPromoView.textLabel.font = [MDCTypography headlineFont]; - _signinPromoView.textLabel.preferredMaxLayoutWidth = - kContainerWidth - (2 * _signinPromoView.horizontalPadding); - [self addSubview:_signinPromoView]; - ApplyVisualConstraintsWithMetrics( - @[ @"H:[signinPromoView(containerWidth)]" ], - @{ @"signinPromoView" : _signinPromoView }, - @{ @"containerWidth" : @(kContainerWidth) }); - AddSameCenterXConstraint(_signinPromoView, self); - [_signinPromoView.centerYAnchor - constraintEqualToAnchor:self.centerYAnchor - constant:kContainerOriginYOffset] - .active = YES; -} - -- (void)updateText { - DCHECK(_signinPromoView == nil); - NSMutableAttributedString* titleString = nil; - NSMutableAttributedString* subtitleString = nil; - - NSString* buttonTitle = nil; - UIImage* buttonImage = nil; - NSString* buttonAccessibilityLabel = nil; - UIColor* floatingButtonNormalBackgroundColor = nil; - UIColor* floatingButtonDisabledBackgroundColor = nil; - UIColor* floatingButtonInkColor = nil; - BOOL spinnerIsHidden = YES; - switch (self.overlayType) { - case TabSwitcherPanelOverlayType::OVERLAY_PANEL_EMPTY: - break; - case TabSwitcherPanelOverlayType::OVERLAY_PANEL_USER_SIGNED_OUT: - // |_container| and its subviews should not be shown or updated when the - // user is signed out. |_signinPromoView| should be visible. - NOTREACHED(); - break; - case TabSwitcherPanelOverlayType::OVERLAY_PANEL_USER_SIGNED_IN_SYNC_OFF: - titleString = [[NSMutableAttributedString alloc] - initWithString:l10n_util::GetNSString( - IDS_IOS_TAB_SWITCHER_ENABLE_SYNC_TITLE)]; - subtitleString = [[NSMutableAttributedString alloc] - initWithString:l10n_util::GetNSString( - IDS_IOS_TAB_SWITCHER_SYNC_IS_OFF)]; - buttonTitle = - l10n_util::GetNSString(IDS_IOS_TAB_SWITCHER_ENABLE_SYNC_BUTTON); - break; - case TabSwitcherPanelOverlayType:: - OVERLAY_PANEL_USER_SIGNED_IN_SYNC_ON_NO_SESSIONS: - titleString = [[NSMutableAttributedString alloc] - initWithString:l10n_util::GetNSString( - IDS_IOS_TAB_SWITCHER_NO_TABS_TO_SYNC_PROMO)]; - subtitleString = [[NSMutableAttributedString alloc] - initWithString:l10n_util::GetNSString( - IDS_IOS_OPEN_TABS_NO_SESSION_INSTRUCTIONS)]; - break; - case TabSwitcherPanelOverlayType:: - OVERLAY_PANEL_USER_SIGNED_IN_SYNC_IN_PROGRESS: - titleString = [[NSMutableAttributedString alloc] - initWithString:l10n_util::GetNSString( - IDS_IOS_TAB_SWITCHER_SYNC_IN_PROGRESS_PROMO)]; - subtitleString = [[NSMutableAttributedString alloc] - initWithString:l10n_util::GetNSString( - IDS_IOS_TAB_SWITCHER_SYNC_IS_OFF)]; - spinnerIsHidden = NO; - break; - case TabSwitcherPanelOverlayType::OVERLAY_PANEL_USER_NO_OPEN_TABS: - titleString = [[NSMutableAttributedString alloc] - initWithString: - l10n_util::GetNSString( - IDS_IOS_TAB_SWITCHER_NO_LOCAL_NON_INCOGNITO_TABS_TITLE)]; - subtitleString = [[NSMutableAttributedString alloc] - initWithString:l10n_util::GetNSString( - IDS_IOS_TAB_SWITCHER_NO_LOCAL_NON_INCOGNITO_TABS)]; - buttonImage = [UIImage imageNamed:@"tabswitcher_new_tab_fab"]; - buttonImage = [buttonImage - imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - floatingButtonInkColor = - [[[MDCPalette cr_bluePalette] tint300] colorWithAlphaComponent:0.5f]; - floatingButtonNormalBackgroundColor = - [[MDCPalette cr_bluePalette] tint500]; - floatingButtonDisabledBackgroundColor = - [UIColor colorWithWhite:0.8f alpha:1.0f]; - buttonAccessibilityLabel = - l10n_util::GetNSString(IDS_IOS_TAB_SWITCHER_CREATE_NEW_TAB); - break; - case TabSwitcherPanelOverlayType::OVERLAY_PANEL_USER_NO_INCOGNITO_TABS: - titleString = [[NSMutableAttributedString alloc] - initWithString: - l10n_util::GetNSString( - IDS_IOS_TAB_SWITCHER_NO_LOCAL_INCOGNITO_TABS_PROMO)]; - subtitleString = [[NSMutableAttributedString alloc] - initWithString:l10n_util::GetNSString( - IDS_IOS_TAB_SWITCHER_NO_LOCAL_INCOGNITO_TABS)]; - buttonImage = [UIImage imageNamed:@"tabswitcher_new_tab_fab"]; - buttonImage = [buttonImage - imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - - floatingButtonInkColor = - [[[MDCPalette greyPalette] tint300] colorWithAlphaComponent:0.25f]; - floatingButtonNormalBackgroundColor = [[MDCPalette greyPalette] tint500]; - floatingButtonDisabledBackgroundColor = - [UIColor colorWithWhite:0.8f alpha:1.0f]; - buttonAccessibilityLabel = - l10n_util::GetNSString(IDS_IOS_TAB_SWITCHER_CREATE_NEW_INCOGNITO_TAB); - break; - }; - - NSMutableParagraphStyle* titleStyle = [[NSMutableParagraphStyle alloc] init]; - [titleStyle setMinimumLineHeight:kTitleMinimumLineHeight]; - [titleStyle setAlignment:NSTextAlignmentCenter]; - [titleStyle setLineBreakMode:NSLineBreakByWordWrapping]; - [titleString addAttribute:NSParagraphStyleAttributeName - value:titleStyle - range:NSMakeRange(0, [titleString length])]; - [_titleLabel setAttributedText:titleString]; - - NSMutableParagraphStyle* subtitleStyle = - [[NSMutableParagraphStyle alloc] init]; - [subtitleStyle setMinimumLineHeight:kSubtitleMinimunLineHeight]; - [subtitleStyle setAlignment:NSTextAlignmentCenter]; - [subtitleStyle setLineBreakMode:NSLineBreakByWordWrapping]; - [subtitleString addAttribute:NSParagraphStyleAttributeName - value:subtitleStyle - range:NSMakeRange(0, [subtitleString length])]; - [_subtitleLabel setAttributedText:subtitleString]; - - [_textButton setTitle:buttonTitle forState:UIControlStateNormal]; - [_textButton setImage:buttonImage forState:UIControlStateNormal]; - [_floatingButton setTitle:buttonTitle forState:UIControlStateNormal]; - [_floatingButton setImage:buttonImage forState:UIControlStateNormal]; - [_floatingButton setInkColor:floatingButtonInkColor]; - [_floatingButton setBackgroundColor:floatingButtonNormalBackgroundColor - forState:UIControlStateNormal]; - [_floatingButton setBackgroundColor:floatingButtonDisabledBackgroundColor - forState:UIControlStateDisabled]; - - [_floatingButton setAccessibilityLabel:buttonAccessibilityLabel]; - [_activityIndicator setHidden:spinnerIsHidden]; - if (spinnerIsHidden) { - [_activityIndicator stopAnimating]; - } else { - [_activityIndicator startAnimating]; - } -} - -- (void)updateButtonTarget { - DCHECK(_signinPromoView == nil); - NSInteger tag = 0; - SEL selector = nil; - _recordedMetricString = ""; - - BOOL shouldShowTextButton = YES; - BOOL shouldShowFloatingButton = NO; - switch (self.overlayType) { - case TabSwitcherPanelOverlayType::OVERLAY_PANEL_EMPTY: - shouldShowTextButton = NO; - break; - case TabSwitcherPanelOverlayType::OVERLAY_PANEL_USER_SIGNED_OUT: - // |_textButton| and |_container| should not be shown when the user is - // signed out. |_signinPromoView| should be visible. - NOTREACHED(); - break; - case TabSwitcherPanelOverlayType::OVERLAY_PANEL_USER_SIGNED_IN_SYNC_OFF: - selector = @selector(showSyncSettings); - _recordedMetricString = "MobileTabSwitcherEnableSync"; - break; - case TabSwitcherPanelOverlayType:: - OVERLAY_PANEL_USER_SIGNED_IN_SYNC_ON_NO_SESSIONS: - shouldShowTextButton = NO; - break; - case TabSwitcherPanelOverlayType:: - OVERLAY_PANEL_USER_SIGNED_IN_SYNC_IN_PROGRESS: - shouldShowTextButton = NO; - break; - case TabSwitcherPanelOverlayType::OVERLAY_PANEL_USER_NO_OPEN_TABS: - selector = @selector(sendNewTabCommand:); - _recordedMetricString = "MobileTabSwitcherCreateNonIncognitoTab"; - shouldShowTextButton = NO; - shouldShowFloatingButton = YES; - break; - case TabSwitcherPanelOverlayType::OVERLAY_PANEL_USER_NO_INCOGNITO_TABS: - selector = @selector(sendNewIncognitoTabCommand:); - _recordedMetricString = "MobileTabSwitcherCreateIncognitoTab"; - shouldShowTextButton = NO; - shouldShowFloatingButton = YES; - break; - } - - [_textButton setTag:tag]; - [_textButton addTarget:self - action:selector - forControlEvents:UIControlEventTouchUpInside]; - [_textButton addTarget:self - action:@selector(recordMetrics) - forControlEvents:UIControlEventTouchUpInside]; - [_textButton setHidden:!shouldShowTextButton]; - [_floatingButton setTag:tag]; - [_floatingButton addTarget:self - action:selector - forControlEvents:UIControlEventTouchUpInside]; - [_floatingButton addTarget:self - action:@selector(recordMetrics) - forControlEvents:UIControlEventTouchUpInside]; - [_floatingButton setHidden:!shouldShowFloatingButton]; -} - -- (void)showSyncSettings { - SyncSetupService::SyncServiceState syncState = - GetSyncStateForBrowserState(_browserState); - if (ShouldShowSyncSignin(syncState)) { - [self.presenter showReauthenticateSignin]; - } else if (ShouldShowSyncSettings(syncState)) { - [self.presenter showSyncSettings]; - } else if (ShouldShowSyncPassphraseSettings(syncState)) { - [self.presenter showSyncPassphraseSettings]; - } -} - -- (void)sendNewTabCommand:(id)sender { - UIView* view = base::mac::ObjCCast<UIView>(sender); - CGPoint center = [view.superview convertPoint:view.center toView:view.window]; - OpenNewTabCommand* command = - [OpenNewTabCommand commandWithIncognito:NO originPoint:center]; - [self.dispatcher openNewTab:command]; -} - -- (void)sendNewIncognitoTabCommand:(id)sender { - UIView* view = base::mac::ObjCCast<UIView>(sender); - CGPoint center = [view.superview convertPoint:view.center toView:view.window]; - OpenNewTabCommand* command = - [OpenNewTabCommand commandWithIncognito:YES originPoint:center]; - [self.dispatcher openNewTab:command]; -} - -- (void)recordMetrics { - if (!_recordedMetricString.length()) - return; - base::RecordAction(base::UserMetricsAction(_recordedMetricString.c_str())); -} - -@end
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_view.h b/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_view.h deleted file mode 100644 index 3c11453..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_view.h +++ /dev/null
@@ -1,34 +0,0 @@ -// 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. - -#ifndef IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_PANEL_VIEW_H_ -#define IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_PANEL_VIEW_H_ - -#import <UIKit/UIKit.h> - -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_model.h" - -@class TabSwitcherCache; - -@interface TabSwitcherPanelView : UIView - -@property(nonatomic, readonly) UICollectionView* collectionView; - -- (instancetype)initWithSessionType:(TabSwitcherSessionType)sessionType - NS_DESIGNATED_INITIALIZER; - -- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; -- (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; - -// Updates the collectionView's layout to ensure that the optimal amount of tabs -// are displayed. The completion block is called at the end of the layout -// update. -- (void)updateCollectionLayoutWithCompletion:(void (^)(void))completion; - -// Returns the size of the cells displayed in the collectionView. -- (CGSize)cellSize; - -@end - -#endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_PANEL_VIEW_H_
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_view.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_view.mm deleted file mode 100644 index fc480aa5..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_view.mm +++ /dev/null
@@ -1,79 +0,0 @@ -// 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 "ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_view.h" - -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_collection_view_layout.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -@interface TabSwitcherPanelView () { - UICollectionView* _collectionView; - TabSwitcherPanelCollectionViewLayout* _collectionViewLayout; - TabSwitcherSessionType _sessionType; -} - -@end - -@implementation TabSwitcherPanelView - -- (instancetype)initWithSessionType:(TabSwitcherSessionType)sessionType { - self = [super initWithFrame:CGRectZero]; - if (self) { - _sessionType = sessionType; - [self loadSubviews]; - } - return self; -} - -- (instancetype)initWithFrame:(CGRect)frame { - NOTREACHED(); - return nil; -} - -- (instancetype)initWithCoder:(NSCoder*)aDecoder { - NOTREACHED(); - return nil; -} - -- (UICollectionView*)collectionView { - return _collectionView; -} - -- (void)updateCollectionLayoutWithCompletion:(void (^)(void))completion { - [_collectionView performBatchUpdates:nil - completion:^(BOOL) { - if (completion) - completion(); - }]; -} - -- (CGSize)cellSize { - return [_collectionViewLayout itemSize]; -} - -#pragma mark - Private - -- (void)loadSubviews { - _collectionViewLayout = [[TabSwitcherPanelCollectionViewLayout alloc] init]; - _collectionView = - [[UICollectionView alloc] initWithFrame:self.bounds - collectionViewLayout:_collectionViewLayout]; - if (_sessionType == TabSwitcherSessionType::DISTANT_SESSION) { - [_collectionView registerClass:[TabSwitcherDistantSessionCell class] - forCellWithReuseIdentifier:[TabSwitcherDistantSessionCell identifier]]; - } else { - [_collectionView registerClass:[TabSwitcherLocalSessionCell class] - forCellWithReuseIdentifier:[TabSwitcherLocalSessionCell identifier]]; - } - [_collectionView setBackgroundColor:[UIColor clearColor]]; - [self addSubview:_collectionView]; - [_collectionView setAutoresizingMask:UIViewAutoresizingFlexibleHeight | - UIViewAutoresizingFlexibleWidth]; -} - -@end
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_session_cell_data.h b/ios/chrome/browser/ui/tab_switcher/tab_switcher_session_cell_data.h deleted file mode 100644 index d61b101..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_session_cell_data.h +++ /dev/null
@@ -1,40 +0,0 @@ -// 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. - -#ifndef IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_SESSION_CELL_DATA_H_ -#define IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_SESSION_CELL_DATA_H_ - -#import <UIKit/UIKit.h> - -@class TabSwitcherHeaderView; - -enum TabSwitcherSessionCellType { - kIncognitoSessionCell, - kOpenTabSessionCell, - kGenericRemoteSessionCell, - kPhoneRemoteSessionCell, - kTabletRemoteSessionCell, - kLaptopRemoteSessionCell, -}; - -// This class hold the data used to configure the content of a -// TabSwitcherHeaderCell. -@interface TabSwitcherSessionCellData : NSObject - -// Those two methods are used to create incognito and open tab cell data. -// Each method create a SessionCellData object on the first call and returns -// the same instance on further calls. -+ (instancetype)incognitoSessionCellData; -+ (instancetype)openTabSessionCellData; -+ (instancetype)otherDevicesSessionCellData; - -- (instancetype)initWithSessionCellType:(TabSwitcherSessionCellType)type; - -@property(nonatomic, readonly) TabSwitcherSessionCellType type; -@property(nonatomic, copy) NSString* title; -@property(nonatomic, retain) UIImage* image; - -@end - -#endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_SESSION_CELL_DATA_H_
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_session_cell_data.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_session_cell_data.mm deleted file mode 100644 index 34a5722..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_session_cell_data.mm +++ /dev/null
@@ -1,95 +0,0 @@ -// 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 "ios/chrome/browser/ui/tab_switcher/tab_switcher_session_cell_data.h" -#include "ios/chrome/grit/ios_strings.h" -#include "ui/base/l10n/l10n_util.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -@implementation TabSwitcherSessionCellData - -@synthesize type = _type; -@synthesize title = _title; -@synthesize image = _image; - -+ (instancetype)incognitoSessionCellData { - static TabSwitcherSessionCellData* incognitoSessionCellData = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - incognitoSessionCellData = - [[self alloc] initWithSessionCellType:kIncognitoSessionCell]; - }); - return incognitoSessionCellData; -} - -+ (instancetype)openTabSessionCellData { - static TabSwitcherSessionCellData* openTabSessionCellData = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - openTabSessionCellData = - [[self alloc] initWithSessionCellType:kOpenTabSessionCell]; - }); - return openTabSessionCellData; -} - -+ (instancetype)otherDevicesSessionCellData { - static TabSwitcherSessionCellData* otherDevicesSessionCellData = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - otherDevicesSessionCellData = - [[self alloc] initWithSessionCellType:kGenericRemoteSessionCell]; - }); - return otherDevicesSessionCellData; -} - -- (instancetype)initWithSessionCellType:(TabSwitcherSessionCellType)type { - self = [super init]; - if (self) { - _type = type; - [self loadDefaultsForType]; - } - return self; -} - -#pragma mark - Private - -- (void)loadDefaultsForType { - NSString* imageName = nil; - int messageId = 0; - switch (self.type) { - case kIncognitoSessionCell: - imageName = @"tabswitcher_incognito"; - messageId = IDS_IOS_TAB_SWITCHER_HEADER_INCOGNITO_TABS; - break; - case kOpenTabSessionCell: - imageName = @"tabswitcher_open_tabs"; - messageId = IDS_IOS_TAB_SWITCHER_HEADER_NON_INCOGNITO_TABS; - break; - case kGenericRemoteSessionCell: - imageName = @"tabswitcher_other_devices"; - messageId = IDS_IOS_TAB_SWITCHER_HEADER_OTHER_DEVICES_TABS; - break; - case kPhoneRemoteSessionCell: - imageName = @"ntp_opentabs_phone"; - messageId = IDS_IOS_TAB_SWITCHER_HEADER_OTHER_DEVICES_TABS; - break; - case kTabletRemoteSessionCell: - imageName = @"ntp_opentabs_tablet"; - messageId = IDS_IOS_TAB_SWITCHER_HEADER_OTHER_DEVICES_TABS; - break; - case kLaptopRemoteSessionCell: - imageName = @"ntp_opentabs_laptop"; - messageId = IDS_IOS_TAB_SWITCHER_HEADER_OTHER_DEVICES_TABS; - break; - } - [self setTitle:l10n_util::GetNSString(messageId)]; - UIImage* image = [UIImage imageNamed:imageName]; - image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - [self setImage:image]; -} - -@end
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_session_changes.h b/ios/chrome/browser/ui/tab_switcher/tab_switcher_session_changes.h deleted file mode 100644 index 44389529..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_session_changes.h +++ /dev/null
@@ -1,46 +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 IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_SESSION_CHANGES_H_ -#define IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_SESSION_CHANGES_H_ - -#include <vector> - -// This structure represents the changes a session undergoes. -// It is used to update the UICollectionView showing a set of tabs. -class TabSwitcherSessionChanges { - public: - TabSwitcherSessionChanges(std::vector<size_t> const& tabHashesInInitialState, - std::vector<size_t> const& tabHashesInFinalState); - ~TabSwitcherSessionChanges(); - TabSwitcherSessionChanges(const TabSwitcherSessionChanges& sessionChanges) = - delete; - TabSwitcherSessionChanges& operator=( - const TabSwitcherSessionChanges& sessionChanges) = delete; - - std::vector<size_t> const& deletions() const { return deletions_; } - - std::vector<size_t> const& insertions() const { return insertions_; } - - std::vector<size_t> const& updates() const { return updates_; } - - bool HasChanges() const; - - private: - // Those vectors contain indexes of tabs. - // The indexes are relative to a tab model snapshot, or a distant session. - // To be in accordance with the UICollectionView's |performBatchUpdates| - // method: - // -the indexes in |updates| are relative to the previous state of the - // session. - // -the indexes in |deletions| are relative to the previous state of the - // session. - // -the indexes in |insertions| are relative to the final state of the - // session. - std::vector<size_t> deletions_; - std::vector<size_t> insertions_; - std::vector<size_t> updates_; -}; - -#endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_SESSION_CHANGES_H_
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_session_changes.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_session_changes.mm deleted file mode 100644 index 61c9954..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_session_changes.mm +++ /dev/null
@@ -1,25 +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 "ios/chrome/browser/ui/tab_switcher/tab_switcher_session_changes.h" - -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_utils.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -TabSwitcherSessionChanges::TabSwitcherSessionChanges( - std::vector<size_t> const& tabHashesInInitialState, - std::vector<size_t> const& tabHashesInFinalState) { - TabSwitcherMinimalReplacementOperations(tabHashesInInitialState, - tabHashesInFinalState, &updates_, - &deletions_, &insertions_); -} - -TabSwitcherSessionChanges::~TabSwitcherSessionChanges() {} - -bool TabSwitcherSessionChanges::HasChanges() const { - return updates_.size() || deletions_.size() || insertions_.size(); -}
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_transition_context.h b/ios/chrome/browser/ui/tab_switcher/tab_switcher_transition_context.h deleted file mode 100644 index 3e0c88a..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_transition_context.h +++ /dev/null
@@ -1,65 +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 IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_TRANSITION_CONTEXT_H_ -#define IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_TRANSITION_CONTEXT_H_ - -#import <UIKit/UIKit.h> - -@class BrowserViewController; -@class TabModel; -@protocol TabStripFoldAnimation; - -// Holds the informations about a browser view controller that will be used -// to create the transition from the browser view controller to the tab switcher -// and vice versa. -@interface TabSwitcherTransitionContextContent : NSObject - -// Create a transition context content from a browser view controller. -+ (instancetype)tabSwitcherTransitionContextContentFromBVC: - (BrowserViewController*)bvc; - -// Returns a placeholder representing the BVC's tab strip. -- (UIView<TabStripFoldAnimation>*)generateTabStripPlaceholderView; - -// Holds a snapshot view of the browser view controller's toolbar. -@property(nonatomic, retain) UIView* toolbarSnapshotView; - -// The tabID that was in the browser view controller when the transition context -// content was created. Used to understand what might have changed in the model -// when entering and leaving the tab switcher. -@property(nonatomic, copy) NSString* initialTabID; -@end - -// A Tab switcher transition context holds the informations needed to compute -// the transition from a browser view controller to the tab switcher view -// controller. -@interface TabSwitcherTransitionContext : NSObject - -// Create a tab switcher transition context from the current browser view -// controller, the main view controller (regular) and the off the record view -// controller (incognito). -+ (instancetype) -tabSwitcherTransitionContextWithCurrent:(BrowserViewController*)currentBVC - mainBVC:(BrowserViewController*)mainBVC - otrBVC:(BrowserViewController*)otrBVC; - -// The snapshot image of the currently selected tab of the current view -// controller. -@property(nonatomic, retain) UIImage* tabSnapshotImage; -// The tab switcher transition context content for the incognito (or main) -// browser view controller. -@property(nonatomic, retain) - TabSwitcherTransitionContextContent* incognitoContent; -// The tab switcher transition context content for the regular (or off the -// record) browser view controller. -@property(nonatomic, retain) - TabSwitcherTransitionContextContent* regularContent; -// The tab model of the broswser view controller selected when the transition -// context was created. -@property(nonatomic, retain) TabModel* initialTabModel; - -@end - -#endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_TRANSITION_CONTEXT_H_
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_transition_context.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_transition_context.mm deleted file mode 100644 index dcc2df1..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_transition_context.mm +++ /dev/null
@@ -1,106 +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 "ios/chrome/browser/ui/tab_switcher/tab_switcher_transition_context.h" - -#import "ios/chrome/browser/snapshots/snapshot_tab_helper.h" -#import "ios/chrome/browser/tabs/tab.h" -#import "ios/chrome/browser/ui/browser_view_controller.h" -#include "ios/chrome/browser/ui/tab_switcher/tab_switcher_transition_context.h" -#import "ios/chrome/browser/ui/toolbar/toolbar_snapshot_providing.h" -#import "ios/chrome/browser/ui/uikit_ui_util.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -@class BrowserViewController; - -@interface TabSwitcherTransitionContextContent () { - UIView<TabStripFoldAnimation>* _tabStripPlaceholderView; - __weak BrowserViewController* _bvc; -} - -@end - -@implementation TabSwitcherTransitionContextContent { -} - -+ (instancetype)tabSwitcherTransitionContextContentFromBVC: - (BrowserViewController*)bvc { - TabSwitcherTransitionContextContent* transitionContextContent = - [[TabSwitcherTransitionContextContent alloc] init]; - - transitionContextContent.initialTabID = bvc.tabModel.currentTab.tabId; - - if (![bvc isViewLoaded]) { - [bvc loadViewIfNeeded]; - [bvc.view setFrame:[[UIScreen mainScreen] bounds]]; - } - - UIView* toolbarSnapshotView = - [bvc.toolbarSnapshotProvider snapshotForTabSwitcher]; - transitionContextContent.toolbarSnapshotView = toolbarSnapshotView; - transitionContextContent->_bvc = bvc; - return transitionContextContent; -} - -- (UIView<TabStripFoldAnimation>*)generateTabStripPlaceholderView { - return [_bvc tabStripPlaceholderView]; -} - -@synthesize toolbarSnapshotView = _toolbarSnapshotView; -@synthesize initialTabID = _initialTabID; - -- (instancetype)init { - self = [super init]; - if (self) { - } - return self; -} - -@end - -@implementation TabSwitcherTransitionContext { -} - -+ (instancetype) -tabSwitcherTransitionContextWithCurrent:(BrowserViewController*)currentBVC - mainBVC:(BrowserViewController*)mainBVC - otrBVC:(BrowserViewController*)otrBVC { - TabSwitcherTransitionContext* transitionContext = - [[TabSwitcherTransitionContext alloc] init]; - Tab* currentTab = [[currentBVC tabModel] currentTab]; - if (currentTab) { - UIImage* tabSnapshotImage = - SnapshotTabHelper::FromWebState(currentTab.webState) - ->GenerateSnapshot(/*with_overlays=*/true, - /*visible_frame_only=*/true); - [transitionContext setTabSnapshotImage:tabSnapshotImage]; - } - [transitionContext - setIncognitoContent: - [TabSwitcherTransitionContextContent - tabSwitcherTransitionContextContentFromBVC:otrBVC]]; - [transitionContext - setRegularContent: - [TabSwitcherTransitionContextContent - tabSwitcherTransitionContextContentFromBVC:mainBVC]]; - [transitionContext setInitialTabModel:currentBVC.tabModel]; - return transitionContext; -} - -@synthesize tabSnapshotImage = _tabSnapshotImage; -@synthesize incognitoContent = _incognitoContent; -@synthesize regularContent = _regularContent; -@synthesize initialTabModel = _initialTabModel; - -- (instancetype)init { - self = [super init]; - if (self) { - } - return self; -} - -@end
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_utils.h b/ios/chrome/browser/ui/tab_switcher/tab_switcher_utils.h deleted file mode 100644 index 88489917..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_utils.h +++ /dev/null
@@ -1,43 +0,0 @@ -// 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. - -#ifndef IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_UTILS_H_ -#define IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_UTILS_H_ - -#include <vector> - -class GURL; -@class FaviconAttributes; -@class UIImage; - -namespace ios { -class ChromeBrowserState; -} // namespace ios - -typedef void (^TabSwitcherFaviconGetterCompletionBlock)(FaviconAttributes*); - -// Favicon for |url|, calls |block| when loaded. -void TabSwitcherGetFavicon(GURL const& url, - ios::ChromeBrowserState* browserState, - TabSwitcherFaviconGetterCompletionBlock block); - -// Returns the substitutions/deletions/insertions needed to go from |initial| to -// |final|. -// To be in accordance with the UICollectionView's |performBatchUpdates| method: -// -the indexes in |substitutions| are relative to |initial|. -// -the indexes in |deletions| are relative to |initial|. -// -the indexes in |insertions| are relative to |final|. -// -// The returned sequence is chosen with a preference of insertions and deletions -// over substitutions. -// For example, AB => BC could be done with 2 substitutions, but doing -// 1 insertion and 1 deletion is preferable because it better communicates the -// changes to the user in the UICollectionViews. -void TabSwitcherMinimalReplacementOperations(std::vector<size_t> const& initial, - std::vector<size_t> const& final, - std::vector<size_t>* substitutions, - std::vector<size_t>* deletions, - std::vector<size_t>* insertions); - -#endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_UTILS_H_
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_utils.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_utils.mm deleted file mode 100644 index 8927aa1..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_utils.mm +++ /dev/null
@@ -1,197 +0,0 @@ -// 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 "ios/chrome/browser/ui/tab_switcher/tab_switcher_utils.h" - -#import <UIKit/UIKit.h> - -#include "base/logging.h" -#include "components/browser_sync/profile_sync_service.h" -#include "components/sync/driver/sync_service.h" -#include "components/sync_sessions/open_tabs_ui_delegate.h" -#include "ios/chrome/browser/browser_state/chrome_browser_state.h" -#import "ios/chrome/browser/favicon/favicon_loader.h" -#include "ios/chrome/browser/favicon/ios_chrome_favicon_loader_factory.h" -#include "ios/chrome/browser/sync/profile_sync_service_factory.h" -#import "ios/chrome/browser/ui/uikit_ui_util.h" -#import "ios/chrome/common/favicon/favicon_attributes.h" -#include "ios/chrome/grit/ios_theme_resources.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -namespace { - -UIImage* DefaultFaviconImage() { - return NativeImage(IDR_IOS_OMNIBOX_HTTP); -} - -enum BacktrackOperation { NOTHING, SUBSTITUTION, DELETION, INSERTION }; - -BacktrackOperation BacktrackOperationInCostMatrix( - std::vector<std::vector<int>> const& costMatrix, - size_t finalIndex, - size_t initialIndex) { - DCHECK(finalIndex || initialIndex); - DCHECK(initialIndex < costMatrix.size()); - DCHECK(finalIndex < costMatrix[initialIndex].size()); - - if (finalIndex == 0) - return DELETION; - if (initialIndex == 0) - return INSERTION; - - int currentCost = costMatrix[initialIndex][finalIndex]; - - int costBeforeInsertion = costMatrix[initialIndex][finalIndex - 1]; - if (costBeforeInsertion + 1 == currentCost) - return INSERTION; - - int costBeforeDeletion = costMatrix[initialIndex - 1][finalIndex]; - if (costBeforeDeletion + 1 == currentCost) - return DELETION; - - int costBeforeSubstitution = costMatrix[initialIndex - 1][finalIndex - 1]; - if (costBeforeSubstitution == currentCost) - return NOTHING; - - return SUBSTITUTION; -} - -// Desired width and height of favicon. -const CGFloat kfaviconWidthHeight = 24; -// Minimum favicon pixel size to retrieve. -const CGFloat kfaviconMinWidthHeight = 16; - -} // namespace - -void TabSwitcherGetFavicon(GURL const& url, - ios::ChromeBrowserState* browser_state, - TabSwitcherFaviconGetterCompletionBlock block) { - DCHECK(browser_state); - syncer::SyncService* sync_service = - ProfileSyncServiceFactory::GetForBrowserState(browser_state); - sync_sessions::OpenTabsUIDelegate* open_tabs = - sync_service ? sync_service->GetOpenTabsUIDelegate() : NULL; - scoped_refptr<base::RefCountedMemory> favicon; - if (open_tabs && - open_tabs->GetSyncedFaviconForPageURL(url.spec(), &favicon)) { - dispatch_queue_t queue = - dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0); - dispatch_async(queue, ^{ - NSData* pngData = - [NSData dataWithBytes:favicon->front() length:favicon->size()]; - UIImage* image = [[UIImage alloc] initWithData:pngData]; - dispatch_async(dispatch_get_main_queue(), ^{ - // |UIImage initWithData:| may return nil. - if (image) { - block([FaviconAttributes attributesWithImage:image]); - } else { - block([FaviconAttributes attributesWithImage:DefaultFaviconImage()]); - } - }); - }); - block([FaviconAttributes attributesWithImage:DefaultFaviconImage()]); - return; - } - - // Use the FaviconCache if there is no synced favicon. - FaviconLoader* loader = - IOSChromeFaviconLoaderFactory::GetForBrowserState(browser_state); - if (loader) { - FaviconAttributes* attr = - loader->FaviconForUrl(url, kfaviconMinWidthHeight, kfaviconWidthHeight, - /*fallback_to_google_server=*/false, block); - DCHECK(attr); - block(attr); - return; - } - // Finally returns a default image. - block([FaviconAttributes attributesWithImage:DefaultFaviconImage()]); -} - -void TabSwitcherMinimalReplacementOperations(std::vector<size_t> const& initial, - std::vector<size_t> const& final, - std::vector<size_t>* substitutions, - std::vector<size_t>* deletions, - std::vector<size_t>* insertions) { - DCHECK(substitutions); - DCHECK(deletions); - DCHECK(insertions); - DCHECK_EQ(substitutions->size(), 0UL); - DCHECK_EQ(deletions->size(), 0UL); - DCHECK_EQ(insertions->size(), 0UL); - - // The substitutions/deletions/insertions are computed using the Levenshtein - // algorithm. - // https://en.wikipedia.org/wiki/Levenshtein_distance - - const size_t initialSize = initial.size() + 1; - const size_t finalSize = final.size() + 1; - - std::vector<std::vector<int>> costMatrix(initialSize, - std::vector<int>(finalSize)); - - for (size_t i = 1; i < initialSize; i++) - costMatrix[i][0] = i; - for (size_t i = 1; i < finalSize; i++) - costMatrix[0][i] = i; - - // Step 1: Generate cost matrix. - for (size_t initialIndex = 1; initialIndex < initialSize; initialIndex++) { - for (size_t finalIndex = 1; finalIndex < finalSize; finalIndex++) { - if (initial[initialIndex - 1] == final[finalIndex - 1]) { - costMatrix[initialIndex][finalIndex] = - costMatrix[initialIndex - 1][finalIndex - 1]; - } else { - int costAfterSubstitution = - costMatrix[initialIndex - 1][finalIndex - 1] + 1; - int costAfterInsertion = costMatrix[initialIndex][finalIndex - 1] + 1; - int costAfterDeletion = costMatrix[initialIndex - 1][finalIndex] + 1; - costMatrix[initialIndex][finalIndex] = - std::min(std::min(costAfterDeletion, costAfterInsertion), - costAfterSubstitution); - } - } - } - - // Step 2: Backtrack to find the operations (deletion, insertion, - // substitution). - size_t initialIndex = initialSize - 1; - size_t finalIndex = finalSize - 1; - while (initialIndex != 0 || finalIndex != 0) { - BacktrackOperation op = - BacktrackOperationInCostMatrix(costMatrix, finalIndex, initialIndex); - switch (op) { - case SUBSTITUTION: - finalIndex--; - initialIndex--; - // The substitution is relative to |initial|. - substitutions->push_back(initialIndex); - break; - case DELETION: - initialIndex--; - // The deletion is relative to |initial|. - deletions->push_back(initialIndex); - break; - case INSERTION: - finalIndex--; - // The insertion is relative to |final|. - insertions->push_back(finalIndex); - break; - case NOTHING: - finalIndex--; - initialIndex--; - break; - } - } - - // The backtracking results in the indexes of the operations being stored in - // decreasing order. - // For readability, order them in ascending value. - std::reverse(std::begin(*substitutions), std::end(*substitutions)); - std::reverse(std::begin(*deletions), std::end(*deletions)); - std::reverse(std::begin(*insertions), std::end(*insertions)); -}
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_utils_unittest.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_utils_unittest.mm deleted file mode 100644 index debfeda..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_utils_unittest.mm +++ /dev/null
@@ -1,130 +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 "ios/chrome/browser/ui/tab_switcher/tab_switcher_utils.h" - -#include "testing/platform_test.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -class TabSwitcherUtilsTest : public PlatformTest { - protected: - // Checks that the computed updates/deletions/insertions to go from |initial| - // to |final| correctly match the expected updates/deletions/insertions. - void TestLevenshtein(std::vector<size_t> const& initial, - std::vector<size_t> const& final, - std::vector<size_t> const& expectedSubstitutions, - std::vector<size_t> const& expectedDeletions, - std::vector<size_t> const& expectedInsertions) { - std::vector<size_t> substitutions; - std::vector<size_t> deletions; - std::vector<size_t> insertions; - TabSwitcherMinimalReplacementOperations(initial, final, &substitutions, - &deletions, &insertions); - EXPECT_EQ(substitutions, expectedSubstitutions); - EXPECT_EQ(deletions, expectedDeletions); - EXPECT_EQ(insertions, expectedInsertions); - } -}; - -TEST_F(TabSwitcherUtilsTest, TestLevenshteinEmptyVectors) { - std::vector<size_t> initial = {}; - std::vector<size_t> final = {}; - std::vector<size_t> expectedSubstitutions = {}; - std::vector<size_t> expectedDeletions = {}; - std::vector<size_t> expectedInsertions = {}; - TestLevenshtein(initial, final, expectedSubstitutions, expectedDeletions, - expectedInsertions); -} - -TEST_F(TabSwitcherUtilsTest, TestLevenshteinNoChange) { - std::vector<size_t> initial = {1, 2, 3}; - std::vector<size_t> final = {1, 2, 3}; - std::vector<size_t> expectedSubstitutions = {}; - std::vector<size_t> expectedDeletions = {}; - std::vector<size_t> expectedInsertions = {}; - TestLevenshtein(initial, final, expectedSubstitutions, expectedDeletions, - expectedInsertions); -} - -TEST_F(TabSwitcherUtilsTest, TestLevenshteinInsertions) { - std::vector<size_t> initial = {1}; - std::vector<size_t> final = {0, 1, 2}; - std::vector<size_t> expectedSubstitutions = {}; - std::vector<size_t> expectedDeletions = {}; - std::vector<size_t> expectedInsertions = {0, 2}; - TestLevenshtein(initial, final, expectedSubstitutions, expectedDeletions, - expectedInsertions); -} - -TEST_F(TabSwitcherUtilsTest, TestLevenshteinDeletions) { - std::vector<size_t> initial = {0, 1, 2, 3, 4, 5}; - std::vector<size_t> final = {0, 2, 3, 5}; - std::vector<size_t> expectedSubstitutions = {}; - std::vector<size_t> expectedDeletions = {1, 4}; - std::vector<size_t> expectedInsertions = {}; - TestLevenshtein(initial, final, expectedSubstitutions, expectedDeletions, - expectedInsertions); -} - -TEST_F(TabSwitcherUtilsTest, TestLevenshteinFromAndToEmptyVectors) { - std::vector<size_t> empty = {}; - std::vector<size_t> nonEmpty = {0, 1, 2}; - std::vector<size_t> expectedSubstitutions = {}; - std::vector<size_t> expectedDeletions = {}; - std::vector<size_t> expectedInsertions = {0, 1, 2}; - TestLevenshtein(empty, nonEmpty, expectedSubstitutions, expectedDeletions, - expectedInsertions); - - // Tests the reverse transformation. - TestLevenshtein(nonEmpty, empty, expectedSubstitutions, expectedInsertions, - expectedDeletions); -} - -TEST_F(TabSwitcherUtilsTest, TestLevenshteinSubstitutions) { - std::vector<size_t> initial = {0, 1, 2, 3, 4, 5, 6}; - std::vector<size_t> final = {0, 1, 2, 9, 8, 5, 6}; - std::vector<size_t> expectedSubstitutions = {3, 4}; - std::vector<size_t> expectedDeletions = {}; - std::vector<size_t> expectedInsertions = {}; - TestLevenshtein(initial, final, expectedSubstitutions, expectedDeletions, - expectedInsertions); -} - -TEST_F(TabSwitcherUtilsTest, TestLevenshteinInsertionAndDeletions) { - std::vector<size_t> initial = {0, 1, 2, 3, 4, 5, 6, 7}; - std::vector<size_t> final = {0, 1, 8, 9, 2, 3, 4, 7}; - std::vector<size_t> expectedSubstitutions = {}; - std::vector<size_t> expectedDeletions = {5, 6}; - std::vector<size_t> expectedInsertions = {2, 3}; - TestLevenshtein(initial, final, expectedSubstitutions, expectedDeletions, - expectedInsertions); - - // Tests the reverse transformation. - TestLevenshtein(final, initial, expectedSubstitutions, expectedInsertions, - expectedDeletions); -} - -TEST_F(TabSwitcherUtilsTest, TestLevenshteinInsertionAndSubstitutions) { - std::vector<size_t> initial = {0, 1, 2, 3, 4, 5, 6, 7}; - std::vector<size_t> final = {0, 1, 2, 99, 98, 3, 4, 97, 96, 7}; - std::vector<size_t> expectedSubstitutions = {5, 6}; - std::vector<size_t> expectedDeletions = {}; - std::vector<size_t> expectedInsertions = {3, 4}; - TestLevenshtein(initial, final, expectedSubstitutions, expectedDeletions, - expectedInsertions); -} - -TEST_F(TabSwitcherUtilsTest, - TestLevenshteinPreferInsertionsAndDeletionsOverSubstitutions) { - std::vector<size_t> initial = {0, 1}; - std::vector<size_t> final = {1, 2}; - std::vector<size_t> expectedSubstitutions = {}; - std::vector<size_t> expectedDeletions = {0}; - std::vector<size_t> expectedInsertions = {1}; - TestLevenshtein(initial, final, expectedSubstitutions, expectedDeletions, - expectedInsertions); -}
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_view.h b/ios/chrome/browser/ui/tab_switcher/tab_switcher_view.h deleted file mode 100644 index 90e588f..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_view.h +++ /dev/null
@@ -1,55 +0,0 @@ -// 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. - -#ifndef IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_VIEW_H_ -#define IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_VIEW_H_ - -#import <UIKit/UIKit.h> - -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_model.h" - -@class TabSwitcherHeaderView; -@class TabSwitcherView; - -enum class NewTabButtonStyle { UNINITIALIZED, BLUE, GRAY, HIDDEN }; - -@protocol TabSwitcherViewDelegate<NSObject> - -- (void)openNewTabInPanelAtIndex:(NSInteger)panelIndex; -- (NewTabButtonStyle)buttonStyleForPanelAtIndex:(NSInteger)panelIndex; -- (BOOL)shouldShowDismissButtonForPanelAtIndex:(NSInteger)panelIndex; -- (void)tabSwitcherViewDelegateDismissTabSwitcher:(TabSwitcherView*)delegate; - -@end - -@interface TabSwitcherView : UIView<UIScrollViewDelegate> - -@property(nonatomic, readonly, weak) TabSwitcherHeaderView* headerView; -@property(nonatomic, readonly, weak) UIScrollView* scrollView; - -@property(nonatomic, weak) id<TabSwitcherViewDelegate> delegate; - -// Select the panel at the given index, updating both the header and content. -// The panel selection will be animated if VoiceOver is disabled. -- (void)selectPanelAtIndex:(NSInteger)index; -// Adds the view |view| at index |index|. -- (void)addPanelView:(UIView*)view atIndex:(NSUInteger)index; -// Removes the view at index |index| and update scrollview. -- (void)removePanelViewAtIndex:(NSUInteger)index; -// Removes the view at index |index| and update scrollview if |update| is true. -- (void)removePanelViewAtIndex:(NSUInteger)index updateScrollView:(BOOL)update; -// Returns the index of the currently selected panel. -- (NSInteger)currentPanelIndex; -// Updates the state of the tab switcher overlay buttons. -// Overlay buttons are the top right dismiss button and the bottom right new tab -// button. -- (void)updateOverlayButtonState; -// Should be called when the tab switcher was shown. -- (void)wasShown; -// Should be called when the tab switcher was hidden. -- (void)wasHidden; - -@end - -#endif // IOS_CHROME_BROWSER_UI_TAB_SWITCHER_TAB_SWITCHER_VIEW_H_
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_view.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_view.mm deleted file mode 100644 index a9b923f..0000000 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_view.mm +++ /dev/null
@@ -1,400 +0,0 @@ -// 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 "ios/chrome/browser/ui/tab_switcher/tab_switcher_view.h" - -#include "base/logging.h" -#include "base/mac/foundation_util.h" -#include "base/metrics/user_metrics.h" -#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" -#include "ios/chrome/browser/ui/rtl_geometry.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_header_view.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_controller.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_overlay_view.h" -#import "ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_view.h" -#include "ios/chrome/grit/ios_strings.h" -#import "ios/third_party/material_components_ios/src/components/Buttons/src/MaterialButtons.h" -#import "ios/third_party/material_components_ios/src/components/Palettes/src/MaterialPalettes.h" -#include "ui/base/l10n/l10n_util.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -namespace { -const CGFloat kHeaderHeight = 95; -const CGFloat kNewTabButtonMarginFromEdges = 48; -const CGFloat kNewTabButtonWidth = 48; -} - -@interface TabSwitcherView ()<UIScrollViewDelegate> { - TabSwitcherHeaderView* _headerView; - UIScrollView* _scrollView; - MDCButton* _openNewTabButton; - NSMutableArray* _panels; - NewTabButtonStyle _openNewTabButtonStyle; - NSInteger _previousPanelIndex; -} - -// Returns the header view frame. -- (CGRect)headerViewFrame; -// Returns the scrollview frame. -- (CGRect)scrollViewFrame; -// Returns the new tab button frame. -- (CGRect)openNewTabButtonFrame; -// Returns the new tab button frame when hidden. -- (CGRect)openNewTabButtonFrameOffscreen; -// Called when the new tab button is pressed. -- (void)openNewTabButtonPressed; -// Returns the index of the panel presented in |_scrollview|. When two panels -// are visible, it returns the most visible one. -- (NSInteger)currentPageIndex; -// Select the panel at the given index, updating both the header and content. -// The scrollview scroll will be |animated| if requested. -- (void)selectPanelAtIndex:(NSInteger)index animated:(BOOL)animated; -@end - -@implementation TabSwitcherView - -@synthesize delegate = delegate_; - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - _openNewTabButtonStyle = NewTabButtonStyle::UNINITIALIZED; - [self loadSubviews]; - _panels = [[NSMutableArray alloc] init]; - _previousPanelIndex = -1; - } - return self; -} - -- (TabSwitcherHeaderView*)headerView { - return _headerView; -} - -- (UIScrollView*)scrollView { - return _scrollView; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - NSInteger pageIndexBeforeLayout = [self currentPageIndex]; - [CATransaction begin]; - [CATransaction setDisableActions:YES]; - [_headerView setFrame:[self headerViewFrame]]; - [_scrollView setFrame:[self scrollViewFrame]]; - [CATransaction commit]; - [self updateScrollViewContent]; - [self selectPanelAtIndex:pageIndexBeforeLayout animated:NO]; -} - -- (void)selectPanelAtIndex:(NSInteger)index { - [self selectPanelAtIndex:index animated:!UIAccessibilityIsVoiceOverRunning()]; -} - -- (void)addPanelView:(UIView*)view atIndex:(NSUInteger)index { - if (UseRTLLayout()) - [view setTransform:CGAffineTransformMakeScale(-1, 1)]; - [_scrollView addSubview:view]; - [_panels insertObject:view atIndex:index]; - [self updateScrollViewContent]; -} - -- (void)removePanelViewAtIndex:(NSUInteger)index { - [self removePanelViewAtIndex:index updateScrollView:YES]; -} - -- (void)removePanelViewAtIndex:(NSUInteger)index updateScrollView:(BOOL)update { - DCHECK_EQ([[_panels objectAtIndex:index] superview], _scrollView); - [[_panels objectAtIndex:index] removeFromSuperview]; - [_panels removeObjectAtIndex:index]; - - if (_previousPanelIndex > -1) { - NSUInteger previousPanelIndexUnsigned = - static_cast<NSUInteger>(_previousPanelIndex); - if (index < previousPanelIndexUnsigned) - _previousPanelIndex--; - else if (index == previousPanelIndexUnsigned) { - [self panelWasHiddenAtIndex:_previousPanelIndex]; - _previousPanelIndex = -1; - } - } - if (update) - [self updateScrollViewContent]; -} - -- (NSInteger)currentPanelIndex { - return [self currentPageIndex]; -} - -- (void)updateOverlayButtonState { - NSInteger panelIndex = [self currentPageIndex]; - NewTabButtonStyle newButtonStyle = - [delegate_ buttonStyleForPanelAtIndex:panelIndex]; - [self setNewTabButtonStyle:newButtonStyle]; - BOOL dismissButtonVisible = - [self.delegate shouldShowDismissButtonForPanelAtIndex:panelIndex]; - [UIView beginAnimations:nil context:NULL]; - [[_headerView dismissButton] setAlpha:dismissButtonVisible ? 1.0 : 0.0]; - [UIView commitAnimations]; -} - -- (void)wasShown { - [self currentPanelWasShown]; -} - -- (void)wasHidden { - [self panelWasHiddenAtIndex:self.currentPageIndex]; -} - -#pragma mark - Private - -- (void)selectPanelAtIndex:(NSInteger)index animated:(BOOL)animated { - CGPoint pageOffset = CGPointZero; - pageOffset.x = self.bounds.size.width * index; - [_scrollView setContentOffset:pageOffset animated:animated]; - [_headerView selectItemAtIndex:index]; - UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, - nil); -} - -- (NSInteger)currentPageIndex { - if ([_scrollView frame].size.width == 0) - return 0; - NSInteger index = floor( - [_scrollView contentOffset].x / [_scrollView frame].size.width + 0.5); - return std::max<NSInteger>(std::min<NSInteger>(index, [_panels count] - 1), - 0); -} - -- (void)updateHeaderSelection { - [_headerView selectItemAtIndex:[self currentPageIndex]]; -} - -- (CGRect)frameForPanelAtIndex:(NSInteger)index { - CGSize panelSize = [_scrollView frame].size; - CGRect panelFrame = - CGRectMake(panelSize.width * index, 0, panelSize.width, panelSize.height); - return panelFrame; -} - -- (void)updateScrollViewContent { - CGSize panelSize = [_scrollView frame].size; - CGSize currentContentSize = [_scrollView contentSize]; - currentContentSize.width = [_panels count] * panelSize.width; - [_scrollView setContentSize:currentContentSize]; - for (NSUInteger i = 0; i < [_panels count]; i++) { - id panelView = [_panels objectAtIndex:i]; - [panelView setFrame:[self frameForPanelAtIndex:i]]; - } -} - -- (void)loadSubviews { - // Creates and add the header view showing the list of panels. - TabSwitcherHeaderView* headerView = - [[TabSwitcherHeaderView alloc] initWithFrame:[self headerViewFrame]]; - [self addSubview:headerView]; - _headerView = headerView; - - // Creates and add the scrollview containing the panels. - UIScrollView* scrollView = - [[UIScrollView alloc] initWithFrame:[self scrollViewFrame]]; - [scrollView setBackgroundColor:[[MDCPalette greyPalette] tint900]]; - [scrollView setAlwaysBounceHorizontal:YES]; - [scrollView setDelegate:self]; - [scrollView setPagingEnabled:YES]; - [scrollView setDelegate:self]; - if (UseRTLLayout()) - [scrollView setTransform:CGAffineTransformMakeScale(-1, 1)]; - [self addSubview:scrollView]; - _scrollView = scrollView; - - // Creates and add the floating new tab button. - _openNewTabButton = [[MDCFloatingButton alloc] init]; - UIImage* openNewTabButtonImage = - [[UIImage imageNamed:@"tabswitcher_new_tab_fab"] - imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - [_openNewTabButton setImage:openNewTabButtonImage - forState:UIControlStateNormal]; - [[_openNewTabButton imageView] setTintColor:[UIColor whiteColor]]; - [_openNewTabButton setFrame:[self openNewTabButtonFrame]]; - // When the button is positioned with autolayout, the animation of the - // button's position conflicts with other animations. - [_openNewTabButton - setAutoresizingMask:UIViewAutoresizingFlexibleTopMargin | - UIViewAutoresizingFlexibleLeadingMargin()]; - [_openNewTabButton addTarget:self - action:@selector(openNewTabButtonPressed) - forControlEvents:UIControlEventTouchUpInside]; - [self addSubview:_openNewTabButton]; - [self setNewTabButtonStyle:NewTabButtonStyle::GRAY]; -} - -- (CGRect)headerViewFrame { - const CGFloat kStatusBarHeight = - [[UIApplication sharedApplication] statusBarFrame].size.height; - CGRect headerViewFrame = self.bounds; - headerViewFrame.origin.y += kStatusBarHeight; - headerViewFrame.size.height = kHeaderHeight; - return headerViewFrame; -} - -- (CGRect)scrollViewFrame { - CGRect scrollViewFrame = self.bounds; - scrollViewFrame.origin.y = CGRectGetMaxY([self headerViewFrame]); - scrollViewFrame.size.height -= scrollViewFrame.origin.y; - return scrollViewFrame; -} - -- (CGRect)openNewTabButtonFrame { - CGRect buttonFrame = self.bounds; - buttonFrame.origin.y = self.bounds.size.height - - kNewTabButtonMarginFromEdges - kNewTabButtonWidth; - if (UseRTLLayout()) { - buttonFrame.origin.x = kNewTabButtonMarginFromEdges; - } else { - buttonFrame.origin.x = self.bounds.size.width - - kNewTabButtonMarginFromEdges - kNewTabButtonWidth; - } - buttonFrame.size.width = kNewTabButtonWidth; - buttonFrame.size.height = kNewTabButtonWidth; - return buttonFrame; -} - -- (CGRect)openNewTabButtonFrameOffscreen { - CGRect buttonFrame = [self openNewTabButtonFrame]; - buttonFrame.origin.y = self.bounds.size.height + kNewTabButtonWidth; - return buttonFrame; -} - -- (void)openNewTabButtonPressed { - [self.delegate openNewTabInPanelAtIndex:[self currentPageIndex]]; -} - -- (void)setNewTabButtonStyle:(NewTabButtonStyle)newStyle { - if (newStyle == _openNewTabButtonStyle) - return; - _openNewTabButtonStyle = newStyle; - [UIView animateWithDuration:0.25 - animations:^{ - switch (_openNewTabButtonStyle) { - case NewTabButtonStyle::HIDDEN: - [_openNewTabButton setFrame:[self openNewTabButtonFrameOffscreen]]; - break; - case NewTabButtonStyle::BLUE: { - [_openNewTabButton setFrame:[self openNewTabButtonFrame]]; - MDCPalette* palette = [MDCPalette cr_bluePalette]; - [_openNewTabButton - setInkColor:[[palette tint300] colorWithAlphaComponent:0.5f]]; - [_openNewTabButton setBackgroundColor:[palette tint500] - forState:UIControlStateNormal]; - [_openNewTabButton - setBackgroundColor:[UIColor colorWithWhite:0.8f alpha:1.0f] - forState:UIControlStateDisabled]; - [_openNewTabButton - setAccessibilityLabel:l10n_util::GetNSString( - IDS_IOS_TAB_SWITCHER_CREATE_NEW_TAB)]; - break; - } - case NewTabButtonStyle::GRAY: { - [_openNewTabButton setFrame:[self openNewTabButtonFrame]]; - MDCPalette* palette = [MDCPalette greyPalette]; - [_openNewTabButton - setInkColor:[[palette tint300] colorWithAlphaComponent:0.25f]]; - [_openNewTabButton setBackgroundColor:[palette tint500] - forState:UIControlStateNormal]; - [_openNewTabButton - setBackgroundColor:[UIColor colorWithWhite:0.8f alpha:1.0f] - forState:UIControlStateDisabled]; - [_openNewTabButton - setAccessibilityLabel: - l10n_util::GetNSString( - IDS_IOS_TAB_SWITCHER_CREATE_NEW_INCOGNITO_TAB)]; - break; - } - case NewTabButtonStyle::UNINITIALIZED: - NOTREACHED(); - } - } - completion:^(BOOL finished) { - // Informs VoiceOver that the |_openNewTabButton| visibility may have - // changed. - UIAccessibilityPostNotification( - UIAccessibilityLayoutChangedNotification, nil); - }]; -} - -#pragma mark - UIScrollViewDelegate - -- (void)scrollViewDidEndScrollingAnimation:(UIScrollView*)scrollView { - [self updateHeaderSelection]; -} - -- (void)scrollViewDidScroll:(UIScrollView*)scrollView { - if ([scrollView isDragging]) { - [self updateHeaderSelection]; - } - [self updateOverlayButtonState]; - - NSInteger panelIndex = [self currentPanelIndex]; - if (panelIndex != _previousPanelIndex) { - if (_previousPanelIndex != -1) - [self panelWasHiddenAtIndex:_previousPanelIndex]; - [self currentPanelWasShown]; - } - _previousPanelIndex = panelIndex; -} - -- (void)panelWasHiddenAtIndex:(NSUInteger)index { - if (index >= [_panels count]) - return; - id panel = [_panels objectAtIndex:index]; - if ([panel respondsToSelector:@selector(wasHidden)]) - [panel wasHidden]; -} - -- (void)currentPanelWasShown { - id panel = [_panels objectAtIndex:self.currentPanelIndex]; - if ([panel respondsToSelector:@selector(wasShown)]) - [panel wasShown]; -} - -#pragma mark - UIScrollViewAccessibilityDelegate - -- (NSString*)accessibilityScrollStatusForScrollView:(UIScrollView*)scrollView { - NSInteger panelIndex = [self currentPageIndex]; - return [_headerView panelTitleAtIndex:panelIndex]; -} - -#pragma mark - UIAccessibilityAction - -- (BOOL)accessibilityPerformEscape { - // If the Dismiss Button is visible, then the escape gesture triggers the - // dismissal of the tab switcher. - NSInteger panelIndex = [self currentPageIndex]; - if ([self.delegate shouldShowDismissButtonForPanelAtIndex:panelIndex]) { - [delegate_ tabSwitcherViewDelegateDismissTabSwitcher:self]; - return YES; - } - return NO; -} - -- (BOOL)accessibilityPerformMagicTap { - // If the New Tab Button is visible, then the magic tap opens a new tab. - NSInteger panelIndex = [self currentPageIndex]; - NewTabButtonStyle buttonStyle = - [delegate_ buttonStyleForPanelAtIndex:panelIndex]; - switch (buttonStyle) { - case NewTabButtonStyle::BLUE: - case NewTabButtonStyle::GRAY: - [self.delegate openNewTabInPanelAtIndex:panelIndex]; - return YES; - case NewTabButtonStyle::UNINITIALIZED: - case NewTabButtonStyle::HIDDEN: - return NO; - } -} - -@end
diff --git a/ios/chrome/browser/ui/tabs/BUILD.gn b/ios/chrome/browser/ui/tabs/BUILD.gn index efae45ae..cebee0bf 100644 --- a/ios/chrome/browser/ui/tabs/BUILD.gn +++ b/ios/chrome/browser/ui/tabs/BUILD.gn
@@ -28,25 +28,13 @@ deps = [ "resources:open_new_tab_background", "resources:tabstrip_background_tab", - "resources:tabstrip_background_tab_legacy", "resources:tabstrip_foreground_tab", - "resources:tabstrip_foreground_tab_legacy", "resources:tabstrip_incognito_background_tab", - "resources:tabstrip_incognito_background_tab_legacy", "resources:tabstrip_incognito_foreground_tab", - "resources:tabstrip_incognito_foreground_tab_legacy", "resources:tabstrip_new_tab", "resources:tabstrip_new_tab_incognito", - "resources:tabstrip_new_tab_incognito_legacy", "resources:tabstrip_new_tab_incognito_pressed", - "resources:tabstrip_new_tab_incognito_pressed_legacy", - "resources:tabstrip_new_tab_legacy", "resources:tabstrip_new_tab_pressed", - "resources:tabstrip_new_tab_pressed_legacy", - "resources:tabstrip_tab_close_incognito_legacy", - "resources:tabstrip_tab_close_incognito_pressed_legacy", - "resources:tabstrip_tab_close_legacy", - "resources:tabstrip_tab_close_pressed_legacy", "resources:tabstrip_tab_switcher_count_button", "resources:tabstrip_tab_switcher_count_button_pressed", "resources:tabstrip_toggle_button_gradient",
diff --git a/ios/chrome/browser/ui/tabs/resources/BUILD.gn b/ios/chrome/browser/ui/tabs/resources/BUILD.gn index 634843b..db1e1bd3 100644 --- a/ios/chrome/browser/ui/tabs/resources/BUILD.gn +++ b/ios/chrome/browser/ui/tabs/resources/BUILD.gn
@@ -45,38 +45,6 @@ ] } -imageset("tabstrip_background_tab_legacy") { - sources = [ - "tabstrip_background_tab_legacy.imageset/Contents.json", - "tabstrip_background_tab_legacy.imageset/tabstrip_background_tab_legacy@2x~ipad.png", - "tabstrip_background_tab_legacy.imageset/tabstrip_background_tab_legacy~ipad.png", - ] -} - -imageset("tabstrip_foreground_tab_legacy") { - sources = [ - "tabstrip_foreground_tab_legacy.imageset/Contents.json", - "tabstrip_foreground_tab_legacy.imageset/tabstrip_foreground_tab_legacy@2x~ipad.png", - "tabstrip_foreground_tab_legacy.imageset/tabstrip_foreground_tab_legacy~ipad.png", - ] -} - -imageset("tabstrip_incognito_background_tab_legacy") { - sources = [ - "tabstrip_incognito_background_tab_legacy.imageset/Contents.json", - "tabstrip_incognito_background_tab_legacy.imageset/tabstrip_incognito_background_tab_legacy@2x~ipad.png", - "tabstrip_incognito_background_tab_legacy.imageset/tabstrip_incognito_background_tab_legacy~ipad.png", - ] -} - -imageset("tabstrip_incognito_foreground_tab_legacy") { - sources = [ - "tabstrip_incognito_foreground_tab_legacy.imageset/Contents.json", - "tabstrip_incognito_foreground_tab_legacy.imageset/tabstrip_incognito_foreground_tab_legacy@2x~ipad.png", - "tabstrip_incognito_foreground_tab_legacy.imageset/tabstrip_incognito_foreground_tab_legacy~ipad.png", - ] -} - imageset("tabstrip_new_tab") { sources = [ "tabstrip_new_tab.imageset/Contents.json", @@ -109,70 +77,6 @@ ] } -imageset("tabstrip_new_tab_legacy") { - sources = [ - "tabstrip_new_tab_legacy.imageset/Contents.json", - "tabstrip_new_tab_legacy.imageset/tabstrip_new_tab_legacy@2x~ipad.png", - "tabstrip_new_tab_legacy.imageset/tabstrip_new_tab_legacy~ipad.png", - ] -} - -imageset("tabstrip_new_tab_incognito_legacy") { - sources = [ - "tabstrip_new_tab_incognito_legacy.imageset/Contents.json", - "tabstrip_new_tab_incognito_legacy.imageset/tabstrip_new_tab_incognito_legacy@2x~ipad.png", - "tabstrip_new_tab_incognito_legacy.imageset/tabstrip_new_tab_incognito_legacy~ipad.png", - ] -} - -imageset("tabstrip_new_tab_incognito_pressed_legacy") { - sources = [ - "tabstrip_new_tab_incognito_pressed_legacy.imageset/Contents.json", - "tabstrip_new_tab_incognito_pressed_legacy.imageset/tabstrip_new_tab_incognito_pressed_legacy@2x~ipad.png", - "tabstrip_new_tab_incognito_pressed_legacy.imageset/tabstrip_new_tab_incognito_pressed_legacy~ipad.png", - ] -} - -imageset("tabstrip_new_tab_pressed_legacy") { - sources = [ - "tabstrip_new_tab_pressed_legacy.imageset/Contents.json", - "tabstrip_new_tab_pressed_legacy.imageset/tabstrip_new_tab_pressed_legacy@2x~ipad.png", - "tabstrip_new_tab_pressed_legacy.imageset/tabstrip_new_tab_pressed_legacy~ipad.png", - ] -} - -imageset("tabstrip_tab_close_legacy") { - sources = [ - "tabstrip_tab_close_legacy.imageset/Contents.json", - "tabstrip_tab_close_legacy.imageset/tabstrip_tab_close_legacy@2x~ipad.png", - "tabstrip_tab_close_legacy.imageset/tabstrip_tab_close_legacy~ipad.png", - ] -} - -imageset("tabstrip_tab_close_incognito_legacy") { - sources = [ - "tabstrip_tab_close_incognito_legacy.imageset/Contents.json", - "tabstrip_tab_close_incognito_legacy.imageset/tabstrip_tab_close_incognito_legacy@2x~ipad.png", - "tabstrip_tab_close_incognito_legacy.imageset/tabstrip_tab_close_incognito_legacy~ipad.png", - ] -} - -imageset("tabstrip_tab_close_incognito_pressed_legacy") { - sources = [ - "tabstrip_tab_close_incognito_pressed_legacy.imageset/Contents.json", - "tabstrip_tab_close_incognito_pressed_legacy.imageset/tabstrip_tab_close_incognito_pressed_legacy@2x~ipad.png", - "tabstrip_tab_close_incognito_pressed_legacy.imageset/tabstrip_tab_close_incognito_pressed_legacy~ipad.png", - ] -} - -imageset("tabstrip_tab_close_pressed_legacy") { - sources = [ - "tabstrip_tab_close_pressed_legacy.imageset/Contents.json", - "tabstrip_tab_close_pressed_legacy.imageset/tabstrip_tab_close_pressed_legacy@2x~ipad.png", - "tabstrip_tab_close_pressed_legacy.imageset/tabstrip_tab_close_pressed_legacy~ipad.png", - ] -} - imageset("tabstrip_tab_switcher_count_button") { sources = [ "tabstrip_tab_switcher_count_button.imageset/Contents.json",
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_background_tab_legacy.imageset/Contents.json b/ios/chrome/browser/ui/tabs/resources/tabstrip_background_tab_legacy.imageset/Contents.json deleted file mode 100644 index cabc0bb..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_background_tab_legacy.imageset/Contents.json +++ /dev/null
@@ -1,18 +0,0 @@ -{ - "images": [ - { - "idiom": "ipad", - "scale": "2x", - "filename": "tabstrip_background_tab_legacy@2x~ipad.png" - }, - { - "idiom": "ipad", - "scale": "1x", - "filename": "tabstrip_background_tab_legacy~ipad.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_background_tab_legacy.imageset/tabstrip_background_tab_legacy@2x~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_background_tab_legacy.imageset/tabstrip_background_tab_legacy@2x~ipad.png deleted file mode 100644 index 1482690..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_background_tab_legacy.imageset/tabstrip_background_tab_legacy@2x~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_background_tab_legacy.imageset/tabstrip_background_tab_legacy~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_background_tab_legacy.imageset/tabstrip_background_tab_legacy~ipad.png deleted file mode 100644 index 04222a9..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_background_tab_legacy.imageset/tabstrip_background_tab_legacy~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_foreground_tab_legacy.imageset/Contents.json b/ios/chrome/browser/ui/tabs/resources/tabstrip_foreground_tab_legacy.imageset/Contents.json deleted file mode 100644 index 0885894..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_foreground_tab_legacy.imageset/Contents.json +++ /dev/null
@@ -1,18 +0,0 @@ -{ - "images": [ - { - "idiom": "ipad", - "scale": "2x", - "filename": "tabstrip_foreground_tab_legacy@2x~ipad.png" - }, - { - "idiom": "ipad", - "scale": "1x", - "filename": "tabstrip_foreground_tab_legacy~ipad.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_foreground_tab_legacy.imageset/tabstrip_foreground_tab_legacy@2x~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_foreground_tab_legacy.imageset/tabstrip_foreground_tab_legacy@2x~ipad.png deleted file mode 100644 index 8025a33..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_foreground_tab_legacy.imageset/tabstrip_foreground_tab_legacy@2x~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_foreground_tab_legacy.imageset/tabstrip_foreground_tab_legacy~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_foreground_tab_legacy.imageset/tabstrip_foreground_tab_legacy~ipad.png deleted file mode 100644 index 9ed75dd..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_foreground_tab_legacy.imageset/tabstrip_foreground_tab_legacy~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_incognito_background_tab_legacy.imageset/Contents.json b/ios/chrome/browser/ui/tabs/resources/tabstrip_incognito_background_tab_legacy.imageset/Contents.json deleted file mode 100644 index 9b6d6c0..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_incognito_background_tab_legacy.imageset/Contents.json +++ /dev/null
@@ -1,18 +0,0 @@ -{ - "images": [ - { - "idiom": "ipad", - "scale": "2x", - "filename": "tabstrip_incognito_background_tab_legacy@2x~ipad.png" - }, - { - "idiom": "ipad", - "scale": "1x", - "filename": "tabstrip_incognito_background_tab_legacy~ipad.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_incognito_background_tab_legacy.imageset/tabstrip_incognito_background_tab_legacy@2x~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_incognito_background_tab_legacy.imageset/tabstrip_incognito_background_tab_legacy@2x~ipad.png deleted file mode 100644 index 258972c..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_incognito_background_tab_legacy.imageset/tabstrip_incognito_background_tab_legacy@2x~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_incognito_background_tab_legacy.imageset/tabstrip_incognito_background_tab_legacy~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_incognito_background_tab_legacy.imageset/tabstrip_incognito_background_tab_legacy~ipad.png deleted file mode 100644 index 90d3df88..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_incognito_background_tab_legacy.imageset/tabstrip_incognito_background_tab_legacy~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_incognito_foreground_tab_legacy.imageset/Contents.json b/ios/chrome/browser/ui/tabs/resources/tabstrip_incognito_foreground_tab_legacy.imageset/Contents.json deleted file mode 100644 index ce4ae00..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_incognito_foreground_tab_legacy.imageset/Contents.json +++ /dev/null
@@ -1,18 +0,0 @@ -{ - "images": [ - { - "idiom": "ipad", - "scale": "2x", - "filename": "tabstrip_incognito_foreground_tab_legacy@2x~ipad.png" - }, - { - "idiom": "ipad", - "scale": "1x", - "filename": "tabstrip_incognito_foreground_tab_legacy~ipad.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_incognito_foreground_tab_legacy.imageset/tabstrip_incognito_foreground_tab_legacy@2x~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_incognito_foreground_tab_legacy.imageset/tabstrip_incognito_foreground_tab_legacy@2x~ipad.png deleted file mode 100644 index 875c62e2..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_incognito_foreground_tab_legacy.imageset/tabstrip_incognito_foreground_tab_legacy@2x~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_incognito_foreground_tab_legacy.imageset/tabstrip_incognito_foreground_tab_legacy~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_incognito_foreground_tab_legacy.imageset/tabstrip_incognito_foreground_tab_legacy~ipad.png deleted file mode 100644 index adec5e1..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_incognito_foreground_tab_legacy.imageset/tabstrip_incognito_foreground_tab_legacy~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_incognito_legacy.imageset/Contents.json b/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_incognito_legacy.imageset/Contents.json deleted file mode 100644 index 3ca0373..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_incognito_legacy.imageset/Contents.json +++ /dev/null
@@ -1,18 +0,0 @@ -{ - "images": [ - { - "idiom": "ipad", - "scale": "2x", - "filename": "tabstrip_new_tab_incognito_legacy@2x~ipad.png" - }, - { - "idiom": "ipad", - "scale": "1x", - "filename": "tabstrip_new_tab_incognito_legacy~ipad.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_incognito_legacy.imageset/tabstrip_new_tab_incognito_legacy@2x~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_incognito_legacy.imageset/tabstrip_new_tab_incognito_legacy@2x~ipad.png deleted file mode 100644 index 9561dbb6..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_incognito_legacy.imageset/tabstrip_new_tab_incognito_legacy@2x~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_incognito_legacy.imageset/tabstrip_new_tab_incognito_legacy~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_incognito_legacy.imageset/tabstrip_new_tab_incognito_legacy~ipad.png deleted file mode 100644 index 17a5f0d..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_incognito_legacy.imageset/tabstrip_new_tab_incognito_legacy~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_incognito_pressed_legacy.imageset/Contents.json b/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_incognito_pressed_legacy.imageset/Contents.json deleted file mode 100644 index cae8ab6..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_incognito_pressed_legacy.imageset/Contents.json +++ /dev/null
@@ -1,18 +0,0 @@ -{ - "images": [ - { - "idiom": "ipad", - "scale": "2x", - "filename": "tabstrip_new_tab_incognito_pressed_legacy@2x~ipad.png" - }, - { - "idiom": "ipad", - "scale": "1x", - "filename": "tabstrip_new_tab_incognito_pressed_legacy~ipad.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_incognito_pressed_legacy.imageset/tabstrip_new_tab_incognito_pressed_legacy@2x~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_incognito_pressed_legacy.imageset/tabstrip_new_tab_incognito_pressed_legacy@2x~ipad.png deleted file mode 100644 index 227519d..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_incognito_pressed_legacy.imageset/tabstrip_new_tab_incognito_pressed_legacy@2x~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_incognito_pressed_legacy.imageset/tabstrip_new_tab_incognito_pressed_legacy~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_incognito_pressed_legacy.imageset/tabstrip_new_tab_incognito_pressed_legacy~ipad.png deleted file mode 100644 index fdfe7c5..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_incognito_pressed_legacy.imageset/tabstrip_new_tab_incognito_pressed_legacy~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_legacy.imageset/Contents.json b/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_legacy.imageset/Contents.json deleted file mode 100644 index 209f449d..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_legacy.imageset/Contents.json +++ /dev/null
@@ -1,18 +0,0 @@ -{ - "images": [ - { - "idiom": "ipad", - "scale": "2x", - "filename": "tabstrip_new_tab_legacy@2x~ipad.png" - }, - { - "idiom": "ipad", - "scale": "1x", - "filename": "tabstrip_new_tab_legacy~ipad.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_legacy.imageset/tabstrip_new_tab_legacy@2x~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_legacy.imageset/tabstrip_new_tab_legacy@2x~ipad.png deleted file mode 100644 index df09cb2..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_legacy.imageset/tabstrip_new_tab_legacy@2x~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_legacy.imageset/tabstrip_new_tab_legacy~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_legacy.imageset/tabstrip_new_tab_legacy~ipad.png deleted file mode 100644 index e9470e8..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_legacy.imageset/tabstrip_new_tab_legacy~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_pressed_legacy.imageset/Contents.json b/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_pressed_legacy.imageset/Contents.json deleted file mode 100644 index 203c188..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_pressed_legacy.imageset/Contents.json +++ /dev/null
@@ -1,18 +0,0 @@ -{ - "images": [ - { - "idiom": "ipad", - "scale": "2x", - "filename": "tabstrip_new_tab_pressed_legacy@2x~ipad.png" - }, - { - "idiom": "ipad", - "scale": "1x", - "filename": "tabstrip_new_tab_pressed_legacy~ipad.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_pressed_legacy.imageset/tabstrip_new_tab_pressed_legacy@2x~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_pressed_legacy.imageset/tabstrip_new_tab_pressed_legacy@2x~ipad.png deleted file mode 100644 index 6561b2f3..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_pressed_legacy.imageset/tabstrip_new_tab_pressed_legacy@2x~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_pressed_legacy.imageset/tabstrip_new_tab_pressed_legacy~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_pressed_legacy.imageset/tabstrip_new_tab_pressed_legacy~ipad.png deleted file mode 100644 index 889a5d2..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_new_tab_pressed_legacy.imageset/tabstrip_new_tab_pressed_legacy~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_incognito_legacy.imageset/Contents.json b/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_incognito_legacy.imageset/Contents.json deleted file mode 100644 index 1aad8b0..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_incognito_legacy.imageset/Contents.json +++ /dev/null
@@ -1,18 +0,0 @@ -{ - "images": [ - { - "idiom": "ipad", - "scale": "2x", - "filename": "tabstrip_tab_close_incognito_legacy@2x~ipad.png" - }, - { - "idiom": "ipad", - "scale": "1x", - "filename": "tabstrip_tab_close_incognito_legacy~ipad.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_incognito_legacy.imageset/tabstrip_tab_close_incognito_legacy@2x~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_incognito_legacy.imageset/tabstrip_tab_close_incognito_legacy@2x~ipad.png deleted file mode 100644 index 8bbacfe..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_incognito_legacy.imageset/tabstrip_tab_close_incognito_legacy@2x~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_incognito_legacy.imageset/tabstrip_tab_close_incognito_legacy~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_incognito_legacy.imageset/tabstrip_tab_close_incognito_legacy~ipad.png deleted file mode 100644 index d4cfcd705..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_incognito_legacy.imageset/tabstrip_tab_close_incognito_legacy~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_incognito_pressed_legacy.imageset/Contents.json b/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_incognito_pressed_legacy.imageset/Contents.json deleted file mode 100644 index 105b6f9..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_incognito_pressed_legacy.imageset/Contents.json +++ /dev/null
@@ -1,18 +0,0 @@ -{ - "images": [ - { - "idiom": "ipad", - "scale": "2x", - "filename": "tabstrip_tab_close_incognito_pressed_legacy@2x~ipad.png" - }, - { - "idiom": "ipad", - "scale": "1x", - "filename": "tabstrip_tab_close_incognito_pressed_legacy~ipad.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_incognito_pressed_legacy.imageset/tabstrip_tab_close_incognito_pressed_legacy@2x~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_incognito_pressed_legacy.imageset/tabstrip_tab_close_incognito_pressed_legacy@2x~ipad.png deleted file mode 100644 index 168547b3..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_incognito_pressed_legacy.imageset/tabstrip_tab_close_incognito_pressed_legacy@2x~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_incognito_pressed_legacy.imageset/tabstrip_tab_close_incognito_pressed_legacy~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_incognito_pressed_legacy.imageset/tabstrip_tab_close_incognito_pressed_legacy~ipad.png deleted file mode 100644 index 5e567d3c..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_incognito_pressed_legacy.imageset/tabstrip_tab_close_incognito_pressed_legacy~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_legacy.imageset/Contents.json b/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_legacy.imageset/Contents.json deleted file mode 100644 index 540039cd..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_legacy.imageset/Contents.json +++ /dev/null
@@ -1,18 +0,0 @@ -{ - "images": [ - { - "idiom": "ipad", - "scale": "2x", - "filename": "tabstrip_tab_close_legacy@2x~ipad.png" - }, - { - "idiom": "ipad", - "scale": "1x", - "filename": "tabstrip_tab_close_legacy~ipad.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_legacy.imageset/tabstrip_tab_close_legacy@2x~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_legacy.imageset/tabstrip_tab_close_legacy@2x~ipad.png deleted file mode 100644 index d7c9624..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_legacy.imageset/tabstrip_tab_close_legacy@2x~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_legacy.imageset/tabstrip_tab_close_legacy~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_legacy.imageset/tabstrip_tab_close_legacy~ipad.png deleted file mode 100644 index 4734e222..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_legacy.imageset/tabstrip_tab_close_legacy~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_pressed_legacy.imageset/Contents.json b/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_pressed_legacy.imageset/Contents.json deleted file mode 100644 index 03a640c..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_pressed_legacy.imageset/Contents.json +++ /dev/null
@@ -1,18 +0,0 @@ -{ - "images": [ - { - "idiom": "ipad", - "scale": "2x", - "filename": "tabstrip_tab_close_pressed_legacy@2x~ipad.png" - }, - { - "idiom": "ipad", - "scale": "1x", - "filename": "tabstrip_tab_close_pressed_legacy~ipad.png" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -}
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_pressed_legacy.imageset/tabstrip_tab_close_pressed_legacy@2x~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_pressed_legacy.imageset/tabstrip_tab_close_pressed_legacy@2x~ipad.png deleted file mode 100644 index 048d820..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_pressed_legacy.imageset/tabstrip_tab_close_pressed_legacy@2x~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_pressed_legacy.imageset/tabstrip_tab_close_pressed_legacy~ipad.png b/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_pressed_legacy.imageset/tabstrip_tab_close_pressed_legacy~ipad.png deleted file mode 100644 index a9749d71..0000000 --- a/ios/chrome/browser/ui/tabs/resources/tabstrip_tab_close_pressed_legacy.imageset/tabstrip_tab_close_pressed_legacy~ipad.png +++ /dev/null Binary files differ
diff --git a/ios/chrome/browser/ui/tabs/tab_strip_controller.mm b/ios/chrome/browser/ui/tabs/tab_strip_controller.mm index c5e1c1e..2ef33f0 100644 --- a/ios/chrome/browser/ui/tabs/tab_strip_controller.mm +++ b/ios/chrome/browser/ui/tabs/tab_strip_controller.mm
@@ -73,10 +73,6 @@ const CGFloat kTabOverlapForCompactLayout = 30.0; const CGFloat kNewTabOverlap = 13.0; -const CGFloat kNewTabOverlapLegacy = 8.0; -CGFloat NewTabOverlap() { - return IsUIRefreshPhase1Enabled() ? kNewTabOverlap : kNewTabOverlapLegacy; -} const CGFloat kMaxTabWidth = 265.0; const CGFloat kMaxTabWidthForCompactLayout = 225.0; @@ -122,9 +118,7 @@ // Returns the background color. UIColor* BackgroundColor() { - if (IsUIRefreshPhase1Enabled()) - return [UIColor colorWithRed:0.11 green:0.11 blue:0.11 alpha:1.0]; - return [UIColor colorWithRed:0.149 green:0.149 blue:0.164 alpha:1]; + return [UIColor colorWithRed:0.11 green:0.11 blue:0.11 alpha:1.0]; } } // namespace @@ -428,28 +422,14 @@ UIImage* buttonNewTabImage = nil; UIImage* buttonNewTabPressedImage = nil; - if (IsUIRefreshPhase1Enabled()) { - if (_style == INCOGNITO) { - buttonNewTabImage = [UIImage imageNamed:@"tabstrip_new_tab_incognito"]; - buttonNewTabPressedImage = - [UIImage imageNamed:@"tabstrip_new_tab_incognito_pressed"]; - } else { - buttonNewTabImage = [UIImage imageNamed:@"tabstrip_new_tab"]; - buttonNewTabPressedImage = - [UIImage imageNamed:@"tabstrip_new_tab_pressed"]; - } - + if (_style == INCOGNITO) { + buttonNewTabImage = [UIImage imageNamed:@"tabstrip_new_tab_incognito"]; + buttonNewTabPressedImage = + [UIImage imageNamed:@"tabstrip_new_tab_incognito_pressed"]; } else { - if (_style == INCOGNITO) { - buttonNewTabImage = - [UIImage imageNamed:@"tabstrip_new_tab_incognito_legacy"]; - buttonNewTabPressedImage = - [UIImage imageNamed:@"tabstrip_new_tab_incognito_pressed_legacy"]; - } else { - buttonNewTabImage = [UIImage imageNamed:@"tabstrip_new_tab_legacy"]; - buttonNewTabPressedImage = - [UIImage imageNamed:@"tabstrip_new_tab_pressed_legacy"]; - } + buttonNewTabImage = [UIImage imageNamed:@"tabstrip_new_tab"]; + buttonNewTabPressedImage = + [UIImage imageNamed:@"tabstrip_new_tab_pressed"]; } [_buttonNewTab setImage:buttonNewTabImage forState:UIControlStateNormal]; [_buttonNewTab setImage:buttonNewTabPressedImage @@ -1085,12 +1065,10 @@ } - (void)tabModelDidChangeTabCount:(TabModel*)model { - if (IsUIRefreshPhase1Enabled()) { - [_tabSwitcherButton setTitle:TextForTabCount(model.count) - forState:UIControlStateNormal]; - [_tabSwitcherButton - setAccessibilityValue:[NSString stringWithFormat:@"%zd", model.count]]; - } + [_tabSwitcherButton setTitle:TextForTabCount(model.count) + forState:UIControlStateNormal]; + [_tabSwitcherButton + setAccessibilityValue:[NSString stringWithFormat:@"%zd", model.count]]; } #pragma mark - @@ -1099,7 +1077,7 @@ - (CGFloat)tabStripVisibleSpace { CGFloat availableSpace = CGRectGetWidth([_tabStripView bounds]) - CGRectGetWidth([_buttonNewTab frame]) + - NewTabOverlap(); + kNewTabOverlap; return availableSpace; } @@ -1119,15 +1097,12 @@ CGRect buttonFrame = CGRectMake(CGRectGetMaxX(_view.frame) - kTabSwitcherButtonWidth, 0, kTabSwitcherButtonWidth, tabStripHeight); - if (IsUIRefreshPhase1Enabled()) { - _tabSwitcherButton = - [TabStripCenteredButton buttonWithType:UIButtonTypeCustom]; - if (UseRTLLayout()) - [_tabSwitcherButton setTransform:CGAffineTransformMakeScale(-1, 1)]; - [self addTabSwitcherLongPressGesture]; - } else { - _tabSwitcherButton = [UIButton buttonWithType:UIButtonTypeCustom]; - } + _tabSwitcherButton = + [TabStripCenteredButton buttonWithType:UIButtonTypeCustom]; + if (UseRTLLayout()) + [_tabSwitcherButton setTransform:CGAffineTransformMakeScale(-1, 1)]; + [self addTabSwitcherLongPressGesture]; + [_tabSwitcherButton setTintColor:[UIColor whiteColor]]; [_tabSwitcherButton setFrame:buttonFrame]; [_tabSwitcherButton setContentMode:UIViewContentModeCenter]; @@ -1136,10 +1111,8 @@ [_tabSwitcherButton setExclusiveTouch:YES]; [_tabSwitcherButton setImage:tabSwitcherButtonIcon forState:UIControlStateNormal]; - if (IsUIRefreshPhase1Enabled()) { - [_tabSwitcherButton setImage:tabSwitcherButtonIconPressed - forState:UIControlStateHighlighted]; - } + [_tabSwitcherButton setImage:tabSwitcherButtonIconPressed + forState:UIControlStateHighlighted]; [_tabSwitcherButton addTarget:self.dispatcher action:@selector(prepareTabSwitcher) forControlEvents:UIControlEventTouchDown]; @@ -1210,7 +1183,7 @@ // desired width, with the standard overlap, plus the new tab button. CGSize contentSize = CGSizeMake( _currentTabWidth * tabCount - ([self tabOverlap] * (tabCount - 1)) + - CGRectGetWidth([_buttonNewTab frame]) - NewTabOverlap(), + CGRectGetWidth([_buttonNewTab frame]) - kNewTabOverlap, tabHeight); if (CGSizeEqualToSize([_tabStripView contentSize], contentSize)) return; @@ -1628,7 +1601,7 @@ CGRect newTabFrame = [_buttonNewTab frame]; BOOL moveNewTab = (newTabFrame.origin.x != virtualMaxX) && !_buttonNewTab.hidden; - newTabFrame.origin = CGPointMake(virtualMaxX - NewTabOverlap(), 0); + newTabFrame.origin = CGPointMake(virtualMaxX - kNewTabOverlap, 0); if (!animate && moveNewTab) [_buttonNewTab setFrame:newTabFrame];
diff --git a/ios/chrome/browser/ui/tabs/tab_view.mm b/ios/chrome/browser/ui/tabs/tab_view.mm index 702867b1..0956e6960 100644 --- a/ios/chrome/browser/ui/tabs/tab_view.mm +++ b/ios/chrome/browser/ui/tabs/tab_view.mm
@@ -48,7 +48,6 @@ const CGFloat kTabStripLineMargin = 2.5; const CGFloat kTabStripLineHeight = 0.5; const CGFloat kCloseButtonHorizontalShift = 19; -const CGFloat kCloseButtonHorizontalShiftLegacy = 15; const CGFloat kCloseButtonVerticalShift = 4.0; const CGFloat kTitleLeftMargin = 8.0; const CGFloat kTitleRightMargin = 0.0; @@ -351,16 +350,12 @@ @"V:[title(==titleHeight)]", ]; - CGFloat closeButtonHorizontalShift = IsUIRefreshPhase1Enabled() - ? kCloseButtonHorizontalShift - : kCloseButtonHorizontalShiftLegacy; CGFloat faviconLeftInset = kFaviconLeftInset; CGFloat faviconVerticalOffset = kFaviconVerticalOffset; - CGFloat closeButtonVerticalShift = kCloseButtonVerticalShift; NSDictionary* metrics = @{ @"closeButtonSize" : @(kCloseButtonSize), - @"closeButtonHorizontalShift" : @(closeButtonHorizontalShift), - @"closeButtonVerticalShift" : @(closeButtonVerticalShift), + @"closeButtonHorizontalShift" : @(kCloseButtonHorizontalShift), + @"closeButtonVerticalShift" : @(kCloseButtonVerticalShift), @"titleLeftMargin" : @(kTitleLeftMargin), @"titleRightMargin" : @(kTitleRightMargin), @"titleHeight" : @(kFaviconSize), @@ -383,10 +378,9 @@ - (void)updateBackgroundImage:(BOOL)selected { NSString* state = (selected ? @"foreground" : @"background"); - NSString* refresh = (IsUIRefreshPhase1Enabled() ? @"" : @"_legacy"); NSString* incognito = _incognitoStyle ? @"incognito_" : @""; - NSString* imageName = [NSString - stringWithFormat:@"tabstrip_%@%@_tab%@", incognito, state, refresh]; + NSString* imageName = + [NSString stringWithFormat:@"tabstrip_%@%@_tab", incognito, state]; CGFloat leftInset = kTabBackgroundLeftCapInset; UIImage* backgroundImage = StretchableImageFromUIImage([UIImage imageNamed:imageName], leftInset, 0);
diff --git a/ios/chrome/browser/ui/toolbar/BUILD.gn b/ios/chrome/browser/ui/toolbar/BUILD.gn index 33506153..68b9daa0 100644 --- a/ios/chrome/browser/ui/toolbar/BUILD.gn +++ b/ios/chrome/browser/ui/toolbar/BUILD.gn
@@ -134,9 +134,9 @@ "//ios/chrome/browser/ui/omnibox/popup", "//ios/chrome/browser/ui/omnibox/popup:popup_internal", "//ios/chrome/browser/ui/omnibox/popup:popup_internal", + "//ios/chrome/browser/ui/popup_menu:constants", "//ios/chrome/browser/ui/toolbar/buttons", "//ios/chrome/browser/ui/toolbar/clean:toolbar_ui", - "//ios/chrome/browser/ui/tools_menu/public", "//ios/chrome/test/app:test_support", "//ios/chrome/test/earl_grey:test_support", "//ios/testing/earl_grey:earl_grey_support",
diff --git a/ios/chrome/browser/ui/toolbar/toolbar_egtest.mm b/ios/chrome/browser/ui/toolbar/toolbar_egtest.mm index b3155ae..c6c0103 100644 --- a/ios/chrome/browser/ui/toolbar/toolbar_egtest.mm +++ b/ios/chrome/browser/ui/toolbar/toolbar_egtest.mm
@@ -11,8 +11,8 @@ #import "ios/chrome/browser/ui/content_suggestions/ntp_home_constant.h" #import "ios/chrome/browser/ui/ntp/new_tab_page_controller.h" #import "ios/chrome/browser/ui/omnibox/popup/omnibox_popup_row.h" +#import "ios/chrome/browser/ui/popup_menu/popup_menu_constants.h" #import "ios/chrome/browser/ui/toolbar/buttons/toolbar_constants.h" -#include "ios/chrome/browser/ui/tools_menu/public/tools_menu_constants.h" #include "ios/chrome/browser/ui/ui_util.h" #include "ios/chrome/grit/ios_strings.h" #import "ios/chrome/test/app/chrome_test_util.h"
diff --git a/ios/chrome/browser/ui/tools_menu/BUILD.gn b/ios/chrome/browser/ui/tools_menu/BUILD.gn index 8d7e67ee..0192bca 100644 --- a/ios/chrome/browser/ui/tools_menu/BUILD.gn +++ b/ios/chrome/browser/ui/tools_menu/BUILD.gn
@@ -88,29 +88,3 @@ "//testing/gtest", ] } - -source_set("eg_tests") { - configs += [ "//build/config/compiler:enable_arc" ] - testonly = true - sources = [ - "request_desktop_mobile_site_egtest.mm", - "tools_popup_menu_egtest.mm", - ] - deps = [ - ":tools_menu", - "//base", - "//components/strings", - "//ios/chrome/app/strings", - "//ios/chrome/browser:browser", - "//ios/chrome/browser/ui", - "//ios/chrome/browser/ui:ui_internal", - "//ios/chrome/browser/ui/popup_menu:constants", - "//ios/chrome/browser/ui/tools_menu/public", - "//ios/chrome/test/earl_grey:test_support", - "//ios/third_party/earl_grey:earl_grey+link", - "//ios/web/public/test", - "//ios/web/public/test/http_server", - "//ui/base", - ] - libs = [ "XCTest.framework" ] -}
diff --git a/ios/chrome/browser/ui/tools_menu/public/BUILD.gn b/ios/chrome/browser/ui/tools_menu/public/BUILD.gn index 35e5600..19d4767f 100644 --- a/ios/chrome/browser/ui/tools_menu/public/BUILD.gn +++ b/ios/chrome/browser/ui/tools_menu/public/BUILD.gn
@@ -13,6 +13,7 @@ ] deps = [ "//base", + "//ios/chrome/browser/ui/popup_menu:constants", "//ios/web/public", ] }
diff --git a/ios/chrome/browser/ui/tools_menu/public/tools_menu_constants.h b/ios/chrome/browser/ui/tools_menu/public/tools_menu_constants.h index 2315416..e403407 100644 --- a/ios/chrome/browser/ui/tools_menu/public/tools_menu_constants.h +++ b/ios/chrome/browser/ui/tools_menu/public/tools_menu_constants.h
@@ -7,6 +7,8 @@ #import <Foundation/Foundation.h> +#import "ios/chrome/browser/ui/popup_menu/popup_menu_constants.h" + // Tools Menu Notifications. // Notification that the tools menu will be shown. extern NSString* const kToolsMenuWillShowNotification; @@ -17,55 +19,6 @@ // Notification that the tools menu did dismiss. extern NSString* const kToolsMenuDidHideNotification; -// Tools Menu item IDs. -// Reload item accessibility Identifier. -extern NSString* const kToolsMenuReload; -// Stop item accessibility Identifier. -extern NSString* const kToolsMenuStop; -// New Tab item accessibility Identifier. -extern NSString* const kToolsMenuNewTabId; -// New incognito Tab item accessibility Identifier. -extern NSString* const kToolsMenuNewIncognitoTabId; -// Close all Tabs item accessibility Identifier. -extern NSString* const kToolsMenuCloseAllTabsId; -// Close all incognito Tabs item accessibility Identifier. -extern NSString* const kToolsMenuCloseAllIncognitoTabsId; -// Close the current tab item accessibility Identifier. -extern NSString* const kToolsMenuCloseTabId; -// Bookmarks item accessibility Identifier. -extern NSString* const kToolsMenuBookmarksId; -// Reading List item accessibility Identifier. -extern NSString* const kToolsMenuReadingListId; -// Other Devices item accessibility Identifier. -extern NSString* const kToolsMenuOtherDevicesId; -// History item accessibility Identifier. -extern NSString* const kToolsMenuHistoryId; -// Report an issue item accessibility Identifier. -extern NSString* const kToolsMenuReportAnIssueId; -// Find in Page item accessibility Identifier. -extern NSString* const kToolsMenuFindInPageId; -// Request desktop item accessibility Identifier. -extern NSString* const kToolsMenuRequestDesktopId; -// Settings item accessibility Identifier. -extern NSString* const kToolsMenuSettingsId; -// Help item accessibility Identifier. -extern NSString* const kToolsMenuHelpId; -// Request mobile item accessibility Identifier. -extern NSString* const kToolsMenuRequestMobileId; -// ReadLater item accessibility Identifier. -extern NSString* const kToolsMenuReadLater; -// AddBookmark item accessibility Identifier. -extern NSString* const kToolsMenuAddToBookmarks; -// EditBookmark item accessibility Identifier. -extern NSString* const kToolsMenuEditBookmark; -// SiteInformation item accessibility Identifier. -extern NSString* const kToolsMenuSiteInformation; -// Paste and Go item accessibility Identifier. -extern NSString* const kToolsMenuPasteAndGo; -// Voice Search item accessibility Identifier. -extern NSString* const kToolsMenuVoiceSearch; -// QR Code Search item accessibility Identifier. -extern NSString* const kToolsMenuQRCodeSearch; // Identifiers for tools menu items (for metrics purposes). typedef NS_ENUM(int, ToolsMenuItemID) {
diff --git a/ios/chrome/browser/ui/tools_menu/public/tools_menu_constants.mm b/ios/chrome/browser/ui/tools_menu/public/tools_menu_constants.mm index 9c8d8e7c..93e8a67 100644 --- a/ios/chrome/browser/ui/tools_menu/public/tools_menu_constants.mm +++ b/ios/chrome/browser/ui/tools_menu/public/tools_menu_constants.mm
@@ -18,29 +18,3 @@ NSString* const kToolsMenuDidHideNotification = @"kToolsMenuDidHideNotification"; -// Tools menu item IDs. -NSString* const kToolsMenuReload = @"kToolsMenuReload"; -NSString* const kToolsMenuStop = @"kToolsMenuStop"; -NSString* const kToolsMenuNewTabId = @"kToolsMenuNewTabId"; -NSString* const kToolsMenuNewIncognitoTabId = @"kToolsMenuNewIncognitoTabId"; -NSString* const kToolsMenuCloseAllTabsId = @"kToolsMenuCloseAllTabsId"; -NSString* const kToolsMenuCloseAllIncognitoTabsId = - @"kToolsMenuCloseAllIncognitoTabsId"; -NSString* const kToolsMenuCloseTabId = @"kToolsMenuCloseTabId"; -NSString* const kToolsMenuBookmarksId = @"kToolsMenuBookmarksId"; -NSString* const kToolsMenuReadingListId = @"kToolsMenuReadingListId"; -NSString* const kToolsMenuOtherDevicesId = @"kToolsMenuOtherDevicesId"; -NSString* const kToolsMenuHistoryId = @"kToolsMenuHistoryId"; -NSString* const kToolsMenuReportAnIssueId = @"kToolsMenuReportAnIssueId"; -NSString* const kToolsMenuFindInPageId = @"kToolsMenuFindInPageId"; -NSString* const kToolsMenuRequestDesktopId = @"kToolsMenuRequestDesktopId"; -NSString* const kToolsMenuSettingsId = @"kToolsMenuSettingsId"; -NSString* const kToolsMenuHelpId = @"kToolsMenuHelpId"; -NSString* const kToolsMenuRequestMobileId = @"kToolsMenuRequestMobileId"; -NSString* const kToolsMenuReadLater = @"kToolsMenuReadLater"; -NSString* const kToolsMenuAddToBookmarks = @"kToolsMenuAddToBookmarks"; -NSString* const kToolsMenuEditBookmark = @"kToolsMenuEditBookmark"; -NSString* const kToolsMenuSiteInformation = @"kToolsMenuSiteInformation"; -NSString* const kToolsMenuPasteAndGo = @"kToolsMenuPasteAndGo"; -NSString* const kToolsMenuVoiceSearch = @"kToolsMenuVoiceSearch"; -NSString* const kToolsMenuQRCodeSearch = @"kToolsMenuQRCodeSearch";
diff --git a/ios/chrome/browser/ui/tools_menu/tools_menu_model.mm b/ios/chrome/browser/ui/tools_menu/tools_menu_model.mm index f098a76..a06aba02d 100644 --- a/ios/chrome/browser/ui/tools_menu/tools_menu_model.mm +++ b/ios/chrome/browser/ui/tools_menu/tools_menu_model.mm
@@ -8,6 +8,7 @@ #include "ios/chrome/browser/experimental_flags.h" #include "ios/chrome/browser/ui/commands/application_commands.h" #include "ios/chrome/browser/ui/commands/browser_commands.h" +#import "ios/chrome/browser/ui/popup_menu/popup_menu_constants.h" #import "ios/chrome/browser/ui/tools_menu/new_tab_menu_view_item.h" #include "ios/chrome/browser/ui/tools_menu/public/tools_menu_constants.h" #import "ios/chrome/browser/ui/tools_menu/reading_list_menu_view_item.h"
diff --git a/ios/chrome/browser/ui/tools_menu/tools_popup_menu_egtest.mm b/ios/chrome/browser/ui/tools_menu/tools_popup_menu_egtest.mm deleted file mode 100644 index 0f39ac9..0000000 --- a/ios/chrome/browser/ui/tools_menu/tools_popup_menu_egtest.mm +++ /dev/null
@@ -1,89 +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. - -#import <EarlGrey/EarlGrey.h> -#import <XCTest/XCTest.h> - -#include "ios/chrome/browser/ui/tools_menu/public/tools_menu_constants.h" -#import "ios/chrome/browser/ui/uikit_ui_util.h" -#include "ios/chrome/grit/ios_strings.h" -#import "ios/chrome/test/earl_grey/accessibility_util.h" -#import "ios/chrome/test/earl_grey/chrome_earl_grey.h" -#import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h" -#import "ios/chrome/test/earl_grey/chrome_matchers.h" -#import "ios/chrome/test/earl_grey/chrome_test_case.h" -#import "ios/web/public/test/http_server/http_server.h" -#include "ios/web/public/test/http_server/http_server_util.h" -#include "ui/base/l10n/l10n_util.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -namespace { - -const char kPDFURL[] = "http://ios/testing/data/http_server_files/testpage.pdf"; - -// Matcher for the button to find in page. -id<GREYMatcher> FindInPageButton() { - return grey_accessibilityID(kToolsMenuFindInPageId); -} -} // namespace - -// Tests for the tools popup menu. -@interface ToolsPopupMenuTestCase : ChromeTestCase -@end - -@implementation ToolsPopupMenuTestCase - -// Tests that the menu is closed when tapping the close button or the scrim. -- (void)testOpenAndCloseToolsMenu { - [ChromeEarlGreyUI openToolsMenu]; - - // When the UIRefresh flag is enabled, a scrim covers the whole window and - // tapping on this scrim dismisses the tools menu. The "Tools Menu" button - // happens to be outside of the bounds of the menu and is a convenient place - // to tap to activate the scrim. - // - // When the UIRefresh flag is disabled, a scrim is present on phone with the - // |IDS_IOS_TOOLBAR_CLOSE_MENU| accessibility label. On tablet, the tools - // menu button is an item in the tools menu and can be pressed again to close - // the menu. - if (!IsCompactWidth() && !IsUIRefreshPhase1Enabled()) { - [[EarlGrey - selectElementWithMatcher:grey_accessibilityLabel(l10n_util::GetNSString( - IDS_IOS_TOOLBAR_CLOSE_MENU))] - performAction:grey_tap()]; - } else { - [[EarlGrey selectElementWithMatcher:chrome_test_util::ToolsMenuButton()] - performAction:grey_tap()]; - } - - [[EarlGrey selectElementWithMatcher:chrome_test_util::ToolsMenuView()] - assertWithMatcher:grey_notVisible()]; -} - -// Navigates to a pdf page and verifies that the "Find in Page..." tool -// is not enabled -- (void)testNoSearchForPDF { - web::test::SetUpFileBasedHttpServer(); - const GURL URL = web::test::HttpServer::MakeUrl(kPDFURL); - - // Navigate to a mock pdf and verify that the find button is disabled. - [ChromeEarlGrey loadURL:URL]; - [ChromeEarlGreyUI openToolsMenu]; - [[EarlGrey selectElementWithMatcher:FindInPageButton()] - assertWithMatcher:grey_accessibilityTrait( - UIAccessibilityTraitNotEnabled)]; -} - -// Open tools menu and verify elements are accessible. -- (void)testAccessibilityOnToolsMenu { - [ChromeEarlGreyUI openToolsMenu]; - chrome_test_util::VerifyAccessibilityForCurrentScreen(); - // Close Tools menu. - [ChromeTestCase removeAnyOpenMenusAndInfoBars]; -} - -@end
diff --git a/ios/chrome/browser/ui/ui_util.h b/ios/chrome/browser/ui/ui_util.h index e64fbfec8..2d7f761f 100644 --- a/ios/chrome/browser/ui/ui_util.h +++ b/ios/chrome/browser/ui/ui_util.h
@@ -47,10 +47,6 @@ // TODO (crbug.com/884723): Remove all use of this flag. bool IsRefreshLocationBarEnabled(); -// Returns whether the UI Refresh Omnibox Popup presentation will be used. -// TODO (crbug.com/884724): Remove all use of this flag. -bool IsRefreshPopupPresentationEnabled(); - // Returns whether the first phase of the UI refresh will be displayed. // TODO (crbug.com/884725): Remove all use of this flag. bool IsUIRefreshPhase1Enabled();
diff --git a/ios/chrome/browser/ui/ui_util.mm b/ios/chrome/browser/ui/ui_util.mm index 8800d26..e4f8d46 100644 --- a/ios/chrome/browser/ui/ui_util.mm +++ b/ios/chrome/browser/ui/ui_util.mm
@@ -66,10 +66,6 @@ return true; } -bool IsRefreshPopupPresentationEnabled() { - return true; -} - bool IsUIRefreshPhase1Enabled() { return true; }
diff --git a/ios/chrome/test/BUILD.gn b/ios/chrome/test/BUILD.gn index 618cf41b..c8dbf5c 100644 --- a/ios/chrome/test/BUILD.gn +++ b/ios/chrome/test/BUILD.gn
@@ -230,7 +230,6 @@ "//ios/chrome/browser/ui/static_content:unit_tests", "//ios/chrome/browser/ui/tab_grid:unit_tests", "//ios/chrome/browser/ui/tab_grid/grid:unit_tests", - "//ios/chrome/browser/ui/tab_switcher:unit_tests", "//ios/chrome/browser/ui/table_view:unit_tests", "//ios/chrome/browser/ui/table_view/cells:unit_tests", "//ios/chrome/browser/ui/tabs:unit_tests",
diff --git a/ios/chrome/test/earl_grey/BUILD.gn b/ios/chrome/test/earl_grey/BUILD.gn index f87f7a9..3a0801e 100644 --- a/ios/chrome/test/earl_grey/BUILD.gn +++ b/ios/chrome/test/earl_grey/BUILD.gn
@@ -119,7 +119,6 @@ "//ios/chrome/browser/ui/tabs:eg_tests", "//ios/chrome/browser/ui/toolbar:eg_tests", "//ios/chrome/browser/ui/toolbar/adaptive:eg_tests", - "//ios/chrome/browser/ui/tools_menu:eg_tests", "//ios/chrome/browser/ui/webui:eg_tests", ] }
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey_ui.mm b/ios/chrome/test/earl_grey/chrome_earl_grey_ui.mm index 6ef1a93..e03ebff 100644 --- a/ios/chrome/test/earl_grey/chrome_earl_grey_ui.mm +++ b/ios/chrome/test/earl_grey/chrome_earl_grey_ui.mm
@@ -7,12 +7,12 @@ #import "base/test/ios/wait_util.h" #include "components/strings/grit/components_strings.h" #import "ios/chrome/browser/ui/history/history_ui_constants.h" +#import "ios/chrome/browser/ui/popup_menu/popup_menu_constants.h" #import "ios/chrome/browser/ui/settings/accounts_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/clear_browsing_data_ui_constants.h" #import "ios/chrome/browser/ui/settings/privacy_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/settings_collection_view_controller.h" #import "ios/chrome/browser/ui/table_view/cells/table_view_url_item.h" -#import "ios/chrome/browser/ui/tools_menu/public/tools_menu_constants.h" #import "ios/chrome/browser/ui/tools_menu/tools_popup_controller.h" #import "ios/chrome/browser/ui/uikit_ui_util.h" #include "ios/chrome/grit/ios_strings.h"
diff --git a/media/audio/audio_manager_unittest.cc b/media/audio/audio_manager_unittest.cc index 9cfbb127f..b6d7e789 100644 --- a/media/audio/audio_manager_unittest.cc +++ b/media/audio/audio_manager_unittest.cc
@@ -10,6 +10,7 @@ #include <vector> #include "base/bind.h" +#include "base/command_line.h" #include "base/environment.h" #include "base/logging.h" #include "base/run_loop.h" @@ -17,6 +18,7 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/synchronization/waitable_event.h" +#include "base/sys_info.h" #include "base/test/test_message_loop.h" #include "base/threading/thread_task_runner_handle.h" #include "build/build_config.h" @@ -54,6 +56,7 @@ #if defined(USE_CRAS) #include "chromeos/audio/audio_devices_pref_handler_stub.h" #include "chromeos/audio/cras_audio_handler.h" +#include "chromeos/dbus/dbus_switches.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/fake_cras_audio_client.h" #include "media/audio/cras/audio_manager_cras.h" @@ -264,6 +267,12 @@ } void SetUpCrasAudioHandlerWithTestingNodes(const AudioNodeList& audio_nodes) { + if (base::SysInfo::IsRunningOnChromeOS()) { + // Ensure a FakeCrasAudioClient is created, even on a real device or VM. + base::CommandLine::ForCurrentProcess()->AppendSwitch( + chromeos::switches::kDbusStub); + } + chromeos::DBusThreadManager::Initialize(); audio_client_ = static_cast<chromeos::FakeCrasAudioClient*>( chromeos::DBusThreadManager::Get()->GetCrasAudioClient());
diff --git a/media/audio/pulse/audio_manager_pulse.cc b/media/audio/pulse/audio_manager_pulse.cc index 3cd51959..6696198 100644 --- a/media/audio/pulse/audio_manager_pulse.cc +++ b/media/audio/pulse/audio_manager_pulse.cc
@@ -169,12 +169,11 @@ } std::string AudioManagerPulse::GetDefaultOutputDeviceID() { -#if defined(OS_CHROMEOS) + // Do not use the real default output device since it is a fallback + // device rather than a default device. Using the default output device + // reported by Pulse Audio prevents, for example, output redirection + // using the PULSE_SINK environment variable. return AudioManagerBase::GetDefaultOutputDeviceID(); -#else - return pulse::GetRealDefaultDeviceId(input_mainloop_, input_context_, - pulse::RequestType::OUTPUT); -#endif } std::string AudioManagerPulse::GetAssociatedOutputDeviceID(
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc index 41b9d3d..415520e 100644 --- a/net/http/http_network_session.cc +++ b/net/http/http_network_session.cc
@@ -12,7 +12,6 @@ #include "base/compiler_specific.h" #include "base/debug/stack_trace.h" #include "base/logging.h" -#include "base/memory/memory_coordinator_client_registry.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" @@ -275,8 +274,6 @@ new base::MemoryPressureListener(base::BindRepeating( &HttpNetworkSession::OnMemoryPressure, base::Unretained(this)))); } - - base::MemoryCoordinatorClientRegistry::GetInstance()->Register(this); } HttpNetworkSession::~HttpNetworkSession() { @@ -285,7 +282,6 @@ // TODO(bnc): CloseAllSessions() is also called in SpdySessionPool destructor, // one of the two calls should be removed. spdy_session_pool_.CloseAllSessions(); - base::MemoryCoordinatorClientRegistry::GetInstance()->Unregister(this); } void HttpNetworkSession::AddResponseDrainer( @@ -535,8 +531,4 @@ } } -void HttpNetworkSession::OnPurgeMemory() { - CloseIdleConnections(); -} - } // namespace net
diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h index 79b6688..c485d5f 100644 --- a/net/http/http_network_session.h +++ b/net/http/http_network_session.h
@@ -17,7 +17,6 @@ #include "base/bind.h" #include "base/containers/flat_set.h" -#include "base/memory/memory_coordinator_client.h" #include "base/memory/memory_pressure_monitor.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" @@ -80,7 +79,7 @@ const uint32_t kSpdyMaxConcurrentPushedStreams = 1000; // This class holds session objects used by HttpNetworkTransaction objects. -class NET_EXPORT HttpNetworkSession : public base::MemoryCoordinatorClient { +class NET_EXPORT HttpNetworkSession { public: // Self-contained structure with all the simple configuration options // supported by the HttpNetworkSession. @@ -274,7 +273,7 @@ }; HttpNetworkSession(const Params& params, const Context& context); - ~HttpNetworkSession() override; + ~HttpNetworkSession(); HttpAuthCache* http_auth_cache() { return &http_auth_cache_; } SSLClientAuthCache* ssl_client_auth_cache() { @@ -372,9 +371,6 @@ void OnMemoryPressure( base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); - // base::MemoryCoordinatorClient implementation: - void OnPurgeMemory() override; - NetLog* const net_log_; HttpServerProperties* const http_server_properties_; CertVerifier* const cert_verifier_;
diff --git a/net/ssl/ssl_client_session_cache.cc b/net/ssl/ssl_client_session_cache.cc index 4c6a9ad6..4541bbf 100644 --- a/net/ssl/ssl_client_session_cache.cc +++ b/net/ssl/ssl_client_session_cache.cc
@@ -7,7 +7,6 @@ #include <utility> #include "base/containers/flat_set.h" -#include "base/memory/memory_coordinator_client_registry.h" #include "base/strings/stringprintf.h" #include "base/time/clock.h" #include "base/time/default_clock.h" @@ -23,12 +22,10 @@ lookups_since_flush_(0) { memory_pressure_listener_.reset(new base::MemoryPressureListener(base::Bind( &SSLClientSessionCache::OnMemoryPressure, base::Unretained(this)))); - base::MemoryCoordinatorClientRegistry::GetInstance()->Register(this); } SSLClientSessionCache::~SSLClientSessionCache() { Flush(); - base::MemoryCoordinatorClientRegistry::GetInstance()->Unregister(this); } size_t SSLClientSessionCache::size() const { @@ -223,8 +220,4 @@ } } -void SSLClientSessionCache::OnPurgeMemory() { - Flush(); -} - } // namespace net
diff --git a/net/ssl/ssl_client_session_cache.h b/net/ssl/ssl_client_session_cache.h index ad64c80..7002ab5 100644 --- a/net/ssl/ssl_client_session_cache.h +++ b/net/ssl/ssl_client_session_cache.h
@@ -14,7 +14,6 @@ #include "base/bind.h" #include "base/containers/mru_cache.h" #include "base/macros.h" -#include "base/memory/memory_coordinator_client.h" #include "base/memory/memory_pressure_monitor.h" #include "base/synchronization/lock.h" #include "base/threading/thread_checker.h" @@ -31,7 +30,7 @@ namespace net { -class NET_EXPORT SSLClientSessionCache : public base::MemoryCoordinatorClient { +class NET_EXPORT SSLClientSessionCache { public: struct Config { // The maximum number of entries in the cache. @@ -41,7 +40,7 @@ }; explicit SSLClientSessionCache(const Config& config); - ~SSLClientSessionCache() override; + ~SSLClientSessionCache(); // Returns true if |entry| is expired as of |now|. static bool IsExpired(SSL_SESSION* session, time_t now); @@ -91,9 +90,6 @@ bssl::UniquePtr<SSL_SESSION> sessions[2] = {nullptr}; }; - // base::MemoryCoordinatorClient implementation: - void OnPurgeMemory() override; - // Removes all expired sessions from the cache. void FlushExpiredSessions();
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc index e5d03c9..43fab371 100644 --- a/pdf/pdfium/pdfium_engine.cc +++ b/pdf/pdfium/pdfium_engine.cc
@@ -240,7 +240,7 @@ // Map from the standard PDF fonts to TrueType font names. size_t i; - for (i = 0; i < arraysize(kPdfFontSubstitutions); ++i) { + for (i = 0; i < base::size(kPdfFontSubstitutions); ++i) { if (strcmp(face, kPdfFontSubstitutions[i].pdf_name) == 0) { description.set_face(kPdfFontSubstitutions[i].face); if (kPdfFontSubstitutions[i].bold) @@ -251,7 +251,7 @@ } } - if (i == arraysize(kPdfFontSubstitutions)) { + if (i == base::size(kPdfFontSubstitutions)) { // Convert to UTF-8 before calling set_face(). std::string face_utf8; if (base::IsStringUTF8(face)) { @@ -1151,8 +1151,9 @@ g_last_instance_id = client_->GetPluginInstance()->pp_instance(); #endif - return print_.PrintPagesAsPdf(page_ranges, page_range_count, print_settings, - pdf_print_settings, /*raster=*/true); + return ConvertPdfToBufferDev( + print_.PrintPagesAsPdf(page_ranges, page_range_count, print_settings, + pdf_print_settings, /*raster=*/true)); } pp::Buffer_Dev PDFiumEngine::PrintPagesAsPdf( @@ -1174,8 +1175,20 @@ pages_[page_number]->Unload(); } - return print_.PrintPagesAsPdf(page_ranges, page_range_count, print_settings, - pdf_print_settings, /*raster=*/false); + return ConvertPdfToBufferDev( + print_.PrintPagesAsPdf(page_ranges, page_range_count, print_settings, + pdf_print_settings, /*raster=*/false)); +} + +pp::Buffer_Dev PDFiumEngine::ConvertPdfToBufferDev( + const std::vector<uint8_t>& pdf_data) { + pp::Buffer_Dev buffer; + if (!pdf_data.empty()) { + buffer = pp::Buffer_Dev(GetPluginInstance(), pdf_data.size()); + if (!buffer.is_null()) + memcpy(buffer.data(), pdf_data.data(), pdf_data.size()); + } + return buffer; } void PDFiumEngine::KillFormFocus() {
diff --git a/pdf/pdfium/pdfium_engine.h b/pdf/pdfium/pdfium_engine.h index 3781a49..2eee1b7c 100644 --- a/pdf/pdfium/pdfium_engine.h +++ b/pdf/pdfium/pdfium_engine.h
@@ -312,6 +312,8 @@ const PP_PrintSettings_Dev& print_settings, const PP_PdfPrintSettings_Dev& pdf_print_settings); + pp::Buffer_Dev ConvertPdfToBufferDev(const std::vector<uint8_t>& pdf_data); + // Checks if |page| has selected text in a form element. If so, sets that as // the plugin's text selection. void SetFormSelectedText(FPDF_FORMHANDLE form_handle, FPDF_PAGE page);
diff --git a/pdf/pdfium/pdfium_print.cc b/pdf/pdfium/pdfium_print.cc index 81f72b8..8645c558 100644 --- a/pdf/pdfium/pdfium_print.cc +++ b/pdf/pdfium/pdfium_print.cc
@@ -279,13 +279,13 @@ FitContentsToPrintableAreaIfRequired(doc, 1.0, print_settings); } -pp::Buffer_Dev PDFiumPrint::PrintPagesAsPdf( +std::vector<uint8_t> PDFiumPrint::PrintPagesAsPdf( const PP_PrintPageNumberRange_Dev* page_ranges, uint32_t page_range_count, const PP_PrintSettings_Dev& print_settings, const PP_PdfPrintSettings_Dev& pdf_print_settings, bool raster) { - pp::Buffer_Dev buffer; + std::vector<uint8_t> buffer; ScopedFPDFDocument output_doc = CreatePrintPdf( page_ranges, page_range_count, print_settings, pdf_print_settings); if (raster) @@ -371,13 +371,8 @@ ConvertUnit(source_page_height, kPointsPerInch, print_settings.dpi); pp::Size bitmap_size(width_in_pixels, height_in_pixels); - pp::ImageData image = - pp::ImageData(engine_->GetPluginInstance(), - PP_IMAGEDATAFORMAT_BGRA_PREMUL, bitmap_size, false); - - ScopedFPDFBitmap bitmap( - FPDFBitmap_CreateEx(bitmap_size.width(), bitmap_size.height(), - FPDFBitmap_BGRx, image.data(), image.stride())); + ScopedFPDFBitmap bitmap(FPDFBitmap_Create( + bitmap_size.width(), bitmap_size.height(), /*alpha=*/false)); // Clear the bitmap FPDFBitmap_FillRect(bitmap.get(), 0, 0, bitmap_size.width(), @@ -450,17 +445,14 @@ return true; } -pp::Buffer_Dev PDFiumPrint::ConvertDocToBuffer(ScopedFPDFDocument doc) const { +std::vector<uint8_t> PDFiumPrint::ConvertDocToBuffer( + ScopedFPDFDocument doc) const { DCHECK(doc); - pp::Buffer_Dev buffer; + std::vector<uint8_t> buffer; PDFiumMemBufferFileWrite output_file_write; - if (FPDF_SaveAsCopy(doc.get(), &output_file_write, 0)) { - size_t size = output_file_write.size(); - buffer = pp::Buffer_Dev(engine_->GetPluginInstance(), size); - if (!buffer.is_null()) - memcpy(buffer.data(), output_file_write.buffer().data(), size); - } + if (FPDF_SaveAsCopy(doc.get(), &output_file_write, 0)) + buffer = output_file_write.TakeBuffer(); return buffer; }
diff --git a/pdf/pdfium/pdfium_print.h b/pdf/pdfium/pdfium_print.h index 04629973..dd780b0 100644 --- a/pdf/pdfium/pdfium_print.h +++ b/pdf/pdfium/pdfium_print.h
@@ -8,7 +8,6 @@ #include <vector> #include "base/macros.h" -#include "ppapi/cpp/dev/buffer_dev.h" #include "third_party/pdfium/public/cpp/fpdf_scopers.h" #include "third_party/pdfium/public/fpdfview.h" @@ -47,7 +46,7 @@ const gfx::Size& page_size, const gfx::Rect& printable_area); - pp::Buffer_Dev PrintPagesAsPdf( + std::vector<uint8_t> PrintPagesAsPdf( const PP_PrintPageNumberRange_Dev* page_ranges, uint32_t page_range_count, const PP_PrintSettings_Dev& print_settings, @@ -70,7 +69,7 @@ const PP_PrintSettings_Dev& print_settings); bool FlattenPrintData(FPDF_DOCUMENT doc) const; - pp::Buffer_Dev ConvertDocToBuffer(ScopedFPDFDocument doc) const; + std::vector<uint8_t> ConvertDocToBuffer(ScopedFPDFDocument doc) const; PDFiumEngine* const engine_;
diff --git a/printing/backend/win_helper.cc b/printing/backend/win_helper.cc index 9a2ee9f..57951dc 100644 --- a/printing/backend/win_helper.cc +++ b/printing/backend/win_helper.cc
@@ -14,9 +14,9 @@ #include "base/file_version_info.h" #include "base/files/file_path.h" #include "base/logging.h" -#include "base/macros.h" #include "base/memory/free_deleter.h" #include "base/numerics/safe_conversions.h" +#include "base/stl_util.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" @@ -385,10 +385,10 @@ } } - for (size_t i = 0; i < arraysize(info); ++i) { + for (size_t i = 0; i < base::size(info); ++i) { std::replace(info[i].begin(), info[i].end(), ';', ','); driver_info.append(info[i]); - if (i < arraysize(info) - 1) + if (i < base::size(info) - 1) driver_info.append(";"); } return driver_info;
diff --git a/printing/printing_context_system_dialog_win.cc b/printing/printing_context_system_dialog_win.cc index fed742848..f146351 100644 --- a/printing/printing_context_system_dialog_win.cc +++ b/printing/printing_context_system_dialog_win.cc
@@ -4,9 +4,11 @@ #include "printing/printing_context_system_dialog_win.h" +#include <utility> + #include "base/auto_reset.h" -#include "base/macros.h" #include "base/message_loop/message_loop_current.h" +#include "base/stl_util.h" #include "printing/backend/win_helper.h" #include "printing/print_settings_initializer_win.h" #include "skia/ext/skia_utils_win.h" @@ -55,7 +57,7 @@ ranges[0].nFromPage = 1; ranges[0].nToPage = max_pages; dialog_options.nPageRanges = 1; - dialog_options.nMaxPageRanges = arraysize(ranges); + dialog_options.nMaxPageRanges = base::size(ranges); dialog_options.nMinPage = 1; dialog_options.nMaxPage = max_pages; dialog_options.lpPageRanges = ranges;
diff --git a/printing/printing_test.h b/printing/printing_test.h index 9bd43d1..df391958 100644 --- a/printing/printing_test.h +++ b/printing/printing_test.h
@@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_PRINTING_PRINTING_TEST_H__ -#define CHROME_BROWSER_PRINTING_PRINTING_TEST_H__ +#ifndef PRINTING_PRINTING_TEST_H_ +#define PRINTING_PRINTING_TEST_H_ #include <windows.h> #include <winspool.h> #include <string> -#include "base/macros.h" +#include "base/stl_util.h" // Disable the whole test case when executing on a computer that has no printer // installed. @@ -23,7 +23,7 @@ } static std::wstring GetDefaultPrinter() { wchar_t printer_name[MAX_PATH]; - DWORD size = arraysize(printer_name); + DWORD size = base::size(printer_name); BOOL result = ::GetDefaultPrinter(printer_name, &size); if (result == 0) { if (GetLastError() == ERROR_FILE_NOT_FOUND) { @@ -37,4 +37,4 @@ } }; -#endif // CHROME_BROWSER_PRINTING_PRINTING_TEST_H__ +#endif // PRINTING_PRINTING_TEST_H_
diff --git a/remoting/base/BUILD.gn b/remoting/base/BUILD.gn index cc3796bd..b43c596 100644 --- a/remoting/base/BUILD.gn +++ b/remoting/base/BUILD.gn
@@ -23,6 +23,8 @@ "leaky_bucket.cc", "leaky_bucket.h", "name_value_map.h", + "platform_details.cc", + "platform_details.h", "rate_counter.cc", "rate_counter.h", "remoting_bot.cc", @@ -75,6 +77,7 @@ sources -= [ "chromium_url_request.cc", "chromoting_event.cc", + "platform_details.cc", "telemetry_log_writer.cc", "url_request_context_getter.cc", ] @@ -177,6 +180,7 @@ deps = [ ":test_support", + "//base", "//mojo/core/embedder", "//net:test_support", "//third_party/libyuv",
diff --git a/remoting/base/chromoting_event.cc b/remoting/base/chromoting_event.cc index d4c614ee..79deeb7 100644 --- a/remoting/base/chromoting_event.cc +++ b/remoting/base/chromoting_event.cc
@@ -8,6 +8,7 @@ #include "base/strings/stringize_macros.h" #include "base/sys_info.h" #include "remoting/base/name_value_map.h" +#include "remoting/base/platform_details.h" namespace remoting { @@ -185,7 +186,7 @@ void ChromotingEvent::AddSystemInfo() { SetString(kCpuKey, base::SysInfo::OperatingSystemArchitecture()); - SetString(kOsVersionKey, base::SysInfo::OperatingSystemVersion()); + SetString(kOsVersionKey, GetOperatingSystemVersionString()); SetString(kWebAppVersionKey, STRINGIZE(VERSION)); #if defined(OS_LINUX) Os os = Os::CHROMOTING_LINUX;
diff --git a/remoting/base/platform_details.cc b/remoting/base/platform_details.cc new file mode 100644 index 0000000..3a2b52b2 --- /dev/null +++ b/remoting/base/platform_details.cc
@@ -0,0 +1,36 @@ +// 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 "remoting/base/platform_details.h" + +#include "base/sys_info.h" +#include "build/build_config.h" + +#if defined(OS_MACOSX) && !defined(OS_IOS) +#include "base/mac/mac_util.h" +#endif + +namespace remoting { + +// Get the Operating System Version, removing the need to check for OS +// definitions, to keep the format used consistent. +std::string GetOperatingSystemVersionString() { +#if defined(OS_MACOSX) && !defined(OS_IOS) + if (base::mac::IsAtLeastOS10_10()) { + return base::SysInfo::OperatingSystemVersion(); + } else { + // MacOS Hosts prior to 10.10 were reporting incorrect OS versions after the + // removal of the 10.9 and lower checks back in ~M66. Since we don't know + // the exact version in this case, I've chosen a number that is obviously + // not a valid MacOS OS version. That way it will be easier to find if + // someone is unaware of this problem and does a code search to find it. + // See crbug.com/889259 for more context. + return "10.9.9999"; + } +#else + return base::SysInfo::OperatingSystemVersion(); +#endif +} + +} // namespace remoting
diff --git a/remoting/base/platform_details.h b/remoting/base/platform_details.h new file mode 100644 index 0000000..dc0dd9c --- /dev/null +++ b/remoting/base/platform_details.h
@@ -0,0 +1,17 @@ +// 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 REMOTING_BASE_PLATFORM_DETAILS_H_ +#define REMOTING_BASE_PLATFORM_DETAILS_H_ + +#include <string> + +namespace remoting { + +// Returns the OS version in a standard format for any build target. +std::string GetOperatingSystemVersionString(); + +} // namespace remoting + +#endif // REMOTING_BASE_PLATFORM_DETAILS_H_
diff --git a/remoting/host/host_details.cc b/remoting/host/host_details.cc index 4349342..8769d69 100644 --- a/remoting/host/host_details.cc +++ b/remoting/host/host_details.cc
@@ -4,11 +4,13 @@ #include "remoting/host/host_details.h" -#include "base/sys_info.h" #include "build/build_config.h" #if defined(OS_LINUX) #include "base/linux_util.h" +#include "base/sys_info.h" +#else +#include "remoting/base/platform_details.h" #endif namespace remoting { @@ -32,12 +34,12 @@ } // Get the host Operating System Version, removing the need to check for OS -// definitions and keeps the format used consistant. +// definitions and keeps the format used consistent. std::string GetHostOperatingSystemVersion() { #if defined(OS_LINUX) return base::GetLinuxDistro(); #else - return base::SysInfo::OperatingSystemVersion(); + return GetOperatingSystemVersionString(); #endif }
diff --git a/services/network/cors/cors_url_loader.cc b/services/network/cors/cors_url_loader.cc index 16ab076..fc8ab1ae 100644 --- a/services/network/cors/cors_url_loader.cc +++ b/services/network/cors/cors_url_loader.cc
@@ -454,6 +454,22 @@ return; } + // When a request is initiated in a unique opaque origin (e.g., in a sandboxed + // iframe) and the blob is also created in the context, |request_initiator| + // is a unique opaque origin and url::Origin::Create(request_.url) is another + // unique opaque origin. url::Origin::IsSameOriginWith(p, q) returns false + // when both |p| and |q| are opaque, but in this case we want to say that the + // request is a same-origin request. Hence we don't set |fetch_cors_flag_|, + // assuming the request comes from a renderer and the origin is checked there + // (in BaseFetchContext::CanRequest). + // In the future blob URLs will not come here because there will be a + // separate URLLoaderFactory for blobs. + // TODO(yhirano): Remove this logic at the time. + if (request_.url.SchemeIsBlob() && request_.request_initiator->unique() && + url::Origin::Create(request_.url).unique()) { + return; + } + if (request_.request_initiator->IsSameOriginWith( url::Origin::Create(request_.url))) { return;
diff --git a/services/tracing/perfetto/README.md b/services/tracing/perfetto/README.md index af3cc67..58d4a3c5 100644 --- a/services/tracing/perfetto/README.md +++ b/services/tracing/perfetto/README.md
@@ -49,8 +49,8 @@ * Add a new string identifier in [perfetto_service.mojom](/services/tracing/public/mojom/perfetto_service.mojom). * Register the data source in [ProducerHost::OnConnect](/services/tracing/perfetto/producer_host.cc). -* Set up the data source in [ProducerClient::CreateDataSourceInstance](/services/tracing/public/cpp/perfetto/producer_client.cc). -* Tear down the data source in [ProducerClient::TearDownDataSourceInstance](/services/tracing/public/cpp/perfetto/producer_client.cc). +* Set up the data source in [ProducerClient::StartDataSource](/services/tracing/public/cpp/perfetto/producer_client.cc). +* Tear down the data source in [ProducerClient::StopDataSource](/services/tracing/public/cpp/perfetto/producer_client.cc). * For each thread that wants to log a proto, use a separate TraceWriter created using [ProducerClient::CreateTraceWriter](/services/tracing/public/cpp/perfetto/producer_client.cc).
diff --git a/services/tracing/perfetto/perfetto_integration_unittest.cc b/services/tracing/perfetto/perfetto_integration_unittest.cc index 102aa2f2..94c6ce2 100644 --- a/services/tracing/perfetto/perfetto_integration_unittest.cc +++ b/services/tracing/perfetto/perfetto_integration_unittest.cc
@@ -109,9 +109,8 @@ size_t send_packet_count() const { return send_packet_count_; } - void CreateDataSourceInstance( - uint64_t id, - mojom::DataSourceConfigPtr data_source_config) override { + void StartDataSource(uint64_t id, + mojom::DataSourceConfigPtr data_source_config) override { enabled_data_source_ = std::make_unique<TestDataSource>( this, send_packet_count_, data_source_config->trace_config, data_source_config->target_buffer); @@ -121,9 +120,7 @@ } } - void TearDownDataSourceInstance( - uint64_t id, - TearDownDataSourceInstanceCallback callback) override { + void StopDataSource(uint64_t id, StopDataSourceCallback callback) override { enabled_data_source_.reset(); if (client_disabled_callback_) {
diff --git a/services/tracing/perfetto/producer_host.cc b/services/tracing/perfetto/producer_host.cc index 2fbe67a..bc4fc15 100644 --- a/services/tracing/perfetto/producer_host.cc +++ b/services/tracing/perfetto/producer_host.cc
@@ -71,9 +71,8 @@ producer_client_->OnTracingStart(std::move(shm)); } -void ProducerHost::CreateDataSourceInstance( - perfetto::DataSourceInstanceID id, - const perfetto::DataSourceConfig& config) { +void ProducerHost::StartDataSource(perfetto::DataSourceInstanceID id, + const perfetto::DataSourceConfig& config) { // TODO(oysteine): Send full DataSourceConfig, not just the name/target_buffer // and Chrome Tracing string. auto data_source_config = mojom::DataSourceConfig::New(); @@ -81,13 +80,12 @@ data_source_config->target_buffer = config.target_buffer(); data_source_config->trace_config = config.chrome_config().trace_config(); - producer_client_->CreateDataSourceInstance(id, std::move(data_source_config)); + producer_client_->StartDataSource(id, std::move(data_source_config)); } -void ProducerHost::TearDownDataSourceInstance( - perfetto::DataSourceInstanceID id) { +void ProducerHost::StopDataSource(perfetto::DataSourceInstanceID id) { if (producer_client_) { - producer_client_->TearDownDataSourceInstance( + producer_client_->StopDataSource( id, base::BindOnce( [](ProducerHost* producer_host, perfetto::DataSourceInstanceID id) {
diff --git a/services/tracing/perfetto/producer_host.h b/services/tracing/perfetto/producer_host.h index 00efaef..05367bf9 100644 --- a/services/tracing/perfetto/producer_host.h +++ b/services/tracing/perfetto/producer_host.h
@@ -60,11 +60,10 @@ void OnConnect() override; void OnDisconnect() override; - void CreateDataSourceInstance( - perfetto::DataSourceInstanceID id, - const perfetto::DataSourceConfig& config) override; + void StartDataSource(perfetto::DataSourceInstanceID id, + const perfetto::DataSourceConfig& config) override; - void TearDownDataSourceInstance(perfetto::DataSourceInstanceID) override; + void StopDataSource(perfetto::DataSourceInstanceID) override; void OnTracingSetup() override; void Flush(perfetto::FlushRequestID, const perfetto::DataSourceInstanceID* raw_data_source_ids,
diff --git a/services/tracing/public/cpp/perfetto/producer_client.cc b/services/tracing/public/cpp/perfetto/producer_client.cc index 2e2fc068..c759b781 100644 --- a/services/tracing/public/cpp/perfetto/producer_client.cc +++ b/services/tracing/public/cpp/perfetto/producer_client.cc
@@ -138,7 +138,7 @@ } } -void ProducerClient::CreateDataSourceInstance( +void ProducerClient::StartDataSource( uint64_t id, mojom::DataSourceConfigPtr data_source_config) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); @@ -153,9 +153,8 @@ } } -void ProducerClient::TearDownDataSourceInstance( - uint64_t id, - TearDownDataSourceInstanceCallback callback) { +void ProducerClient::StopDataSource(uint64_t id, + StopDataSourceCallback callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); for (auto* data_source : data_sources_) {
diff --git a/services/tracing/public/cpp/perfetto/producer_client.h b/services/tracing/public/cpp/perfetto/producer_client.h index ca7757c..92a050de 100644 --- a/services/tracing/public/cpp/perfetto/producer_client.h +++ b/services/tracing/public/cpp/perfetto/producer_client.h
@@ -39,7 +39,7 @@ // * Add a new data source name in perfetto_service.mojom. // * Register the data source with Perfetto in ProducerHost::OnConnect. // * Construct the new implementation when requested to -// in ProducerClient::CreateDataSourceInstance. +// in ProducerClient::StartDataSource. class COMPONENT_EXPORT(TRACING_CPP) ProducerClient : public mojom::ProducerClient, public perfetto::TracingService::ProducerEndpoint { @@ -96,13 +96,10 @@ // Called through Mojo by the ProducerHost on the service-side to control // tracing and toggle specific DataSources. void OnTracingStart(mojo::ScopedSharedBufferHandle shared_memory) override; - void CreateDataSourceInstance( - uint64_t id, - mojom::DataSourceConfigPtr data_source_config) override; + void StartDataSource(uint64_t id, + mojom::DataSourceConfigPtr data_source_config) override; - void TearDownDataSourceInstance( - uint64_t id, - TearDownDataSourceInstanceCallback callback) override; + void StopDataSource(uint64_t id, StopDataSourceCallback callback) override; void Flush(uint64_t flush_request_id, const std::vector<uint64_t>& data_source_ids) override;
diff --git a/services/tracing/public/mojom/perfetto_service.mojom b/services/tracing/public/mojom/perfetto_service.mojom index 056a94e3..80a4bac 100644 --- a/services/tracing/public/mojom/perfetto_service.mojom +++ b/services/tracing/public/mojom/perfetto_service.mojom
@@ -96,10 +96,10 @@ // TODO(oysteine): Make a TypeTrait for sending the full DataSourceConfig. // Called by Perfetto (via ProducerHost) to request a data source to start // logging. - CreateDataSourceInstance(uint64 id, DataSourceConfig data_source_config); + StartDataSource(uint64 id, DataSourceConfig data_source_config); // Requesting a data source to stop logging again, with the id previously - // sent in the CreateDataSourceInstance call. - TearDownDataSourceInstance(uint64 id) => (); + // sent in the StartDataSource call. + StopDataSource(uint64 id) => (); Flush(uint64 flush_request_id, array<uint64> data_source_ids); };
diff --git a/services/viz/privileged/interfaces/gl/gpu_service.mojom b/services/viz/privileged/interfaces/gl/gpu_service.mojom index 2b686f09..2188a90c 100644 --- a/services/viz/privileged/interfaces/gl/gpu_service.mojom +++ b/services/viz/privileged/interfaces/gl/gpu_service.mojom
@@ -12,6 +12,7 @@ import "components/arc/common/video_encode_accelerator.mojom"; [EnableIf=is_chromeos] import "components/arc/common/video_protected_buffer_allocator.mojom"; +import "gpu/ipc/common/dx_diag_node.mojom"; import "gpu/ipc/common/gpu_info.mojom"; import "gpu/ipc/common/memory_stats.mojom"; import "gpu/ipc/common/surface_handle.mojom"; @@ -76,7 +77,9 @@ GetVideoMemoryUsageStats() => (gpu.mojom.VideoMemoryUsageStats stats); - RequestCompleteGpuInfo() => (gpu.mojom.GpuInfo gpu_info); + [EnableIf=is_win] + RequestCompleteGpuInfo() => (gpu.mojom.DxDiagNode dx_diagnostics); + [EnableIf=is_win] GetGpuSupportedRuntimeVersion() => (gpu.mojom.GpuInfo gpu_info); // Requests that the GPU process query system availability of HDR output and
diff --git a/testing/buildbot/chromium.gpu.fyi.json b/testing/buildbot/chromium.gpu.fyi.json index a678c4a9..96cdbf66 100644 --- a/testing/buildbot/chromium.gpu.fyi.json +++ b/testing/buildbot/chromium.gpu.fyi.json
@@ -5356,6 +5356,1317 @@ } ] }, + "Mac FYI 10.14 Release (AMD)": { + "gtest_tests": [ + { + "args": [ + "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "shards": 4 + }, + "test": "angle_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "angle_unittests" + }, + { + "args": [ + "--enable-gpu", + "--test-launcher-bot-mode", + "--test-launcher-jobs=1", + "--gtest_filter=CastStreamingApiTestWithPixelOutput.EndToEnd*:TabCaptureApiPixelTest.EndToEnd*" + ], + "name": "tab_capture_end2end_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "browser_tests" + }, + { + "args": [ + "--use-gpu-in-tests", + "--use-cmd-decoder=validating" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "gl_tests" + }, + { + "args": [ + "--use-gpu-in-tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "gl_unittests" + }, + { + "args": [ + "--use-gpu-in-tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "gles2_conform_test" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "gpu_unittests" + }, + { + "args": [ + "--gtest_filter=*Detection*", + "--use-gpu-in-tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "services_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "swiftshader_unittests" + } + ], + "isolated_scripts": [ + { + "args": [ + "context_lost", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "context_lost_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "depth_capture", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "depth_capture_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "gpu_process", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "gpu_process_launch_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "hardware_accelerated_feature", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "hardware_accelerated_feature_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "info_collection", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", + "--expected-vendor-id", + "1002", + "--expected-device-id", + "6821" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "info_collection_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "maps", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", + "--dont-restore-color-profile-after-test", + "--os-type", + "mac", + "--build-revision", + "${got_revision}", + "--test-machine-name", + "${buildername}" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "maps_pixel_test", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "pixel", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", + "--dont-restore-color-profile-after-test", + "--refimg-cloud-storage-bucket", + "chromium-gpu-archive/reference-images", + "--os-type", + "mac", + "--build-revision", + "${got_revision}", + "--test-machine-name", + "${buildername}" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "pixel_test", + "non_precommit_args": [ + "--upload-refimg-to-cloud-storage" + ], + "precommit_args": [ + "--download-refimg-from-cloud-storage" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "screenshot_sync", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", + "--dont-restore-color-profile-after-test" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "screenshot_sync_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "trace_test", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "trace_test", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "webgl_conformance", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", + "--webgl-conformance-version=2.0.1", + "--read-abbreviated-json-results-from=../../content/test/data/gpu/webgl2_conformance_tests_output.json" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "webgl2_conformance_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false, + "shards": 20 + } + }, + { + "args": [ + "webgl_conformance", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "webgl_conformance_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false, + "shards": 2 + } + } + ] + }, + "Mac FYI 10.14 Release (Intel)": { + "gtest_tests": [ + { + "args": [ + "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "shards": 4 + }, + "test": "angle_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "angle_unittests" + }, + { + "args": [ + "--enable-gpu", + "--test-launcher-bot-mode", + "--test-launcher-jobs=1", + "--gtest_filter=CastStreamingApiTestWithPixelOutput.EndToEnd*:TabCaptureApiPixelTest.EndToEnd*" + ], + "name": "tab_capture_end2end_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "browser_tests" + }, + { + "args": [ + "--use-gpu-in-tests", + "--use-cmd-decoder=validating" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "gl_tests" + }, + { + "args": [ + "--use-gpu-in-tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "gl_unittests" + }, + { + "args": [ + "--use-gpu-in-tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "gles2_conform_test" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "gpu_unittests" + }, + { + "args": [ + "--gtest_filter=*Detection*", + "--use-gpu-in-tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "services_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "swiftshader_unittests" + } + ], + "isolated_scripts": [ + { + "args": [ + "context_lost", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "context_lost_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "depth_capture", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "depth_capture_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "gpu_process", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "gpu_process_launch_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "hardware_accelerated_feature", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "hardware_accelerated_feature_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "info_collection", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", + "--expected-vendor-id", + "8086", + "--expected-device-id", + "0a2e" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "info_collection_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "maps", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", + "--dont-restore-color-profile-after-test", + "--os-type", + "mac", + "--build-revision", + "${got_revision}", + "--test-machine-name", + "${buildername}" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "maps_pixel_test", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "pixel", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", + "--dont-restore-color-profile-after-test", + "--refimg-cloud-storage-bucket", + "chromium-gpu-archive/reference-images", + "--os-type", + "mac", + "--build-revision", + "${got_revision}", + "--test-machine-name", + "${buildername}" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "pixel_test", + "non_precommit_args": [ + "--upload-refimg-to-cloud-storage" + ], + "precommit_args": [ + "--download-refimg-from-cloud-storage" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "screenshot_sync", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", + "--dont-restore-color-profile-after-test" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "screenshot_sync_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "trace_test", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "trace_test", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "webgl_conformance", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", + "--webgl-conformance-version=2.0.1", + "--read-abbreviated-json-results-from=../../content/test/data/gpu/webgl2_conformance_tests_output.json" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "webgl2_conformance_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false, + "shards": 20 + } + }, + { + "args": [ + "webgl_conformance", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "webgl_conformance_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false, + "shards": 2 + } + } + ] + }, + "Mac FYI 10.14 Release (NVIDIA)": { + "gtest_tests": [ + { + "args": [ + "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:0fe9", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "shards": 4 + }, + "test": "angle_end2end_tests" + }, + { + "args": [ + "--use-gpu-in-tests", + "--test-launcher-retry-limit=0" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:0fe9", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "angle_unittests" + }, + { + "args": [ + "--enable-gpu", + "--test-launcher-bot-mode", + "--test-launcher-jobs=1", + "--gtest_filter=CastStreamingApiTestWithPixelOutput.EndToEnd*:TabCaptureApiPixelTest.EndToEnd*" + ], + "name": "tab_capture_end2end_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:0fe9", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "browser_tests" + }, + { + "args": [ + "--use-gpu-in-tests", + "--use-cmd-decoder=validating" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:0fe9", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "gl_tests" + }, + { + "args": [ + "--use-gpu-in-tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:0fe9", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "gl_unittests" + }, + { + "args": [ + "--use-gpu-in-tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:0fe9", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "gles2_conform_test" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:0fe9", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "gpu_unittests" + }, + { + "args": [ + "--gtest_filter=*Detection*", + "--use-gpu-in-tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:0fe9", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "services_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:0fe9", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ] + }, + "test": "swiftshader_unittests" + } + ], + "isolated_scripts": [ + { + "args": [ + "context_lost", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "context_lost_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:0fe9", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "depth_capture", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "depth_capture_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:0fe9", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "gpu_process", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "gpu_process_launch_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:0fe9", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "hardware_accelerated_feature", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "hardware_accelerated_feature_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:0fe9", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "info_collection", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", + "--expected-vendor-id", + "10de", + "--expected-device-id", + "0fe9" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "info_collection_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:0fe9", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "maps", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", + "--dont-restore-color-profile-after-test", + "--os-type", + "mac", + "--build-revision", + "${got_revision}", + "--test-machine-name", + "${buildername}" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "maps_pixel_test", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:0fe9", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "pixel", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", + "--dont-restore-color-profile-after-test", + "--refimg-cloud-storage-bucket", + "chromium-gpu-archive/reference-images", + "--os-type", + "mac", + "--build-revision", + "${got_revision}", + "--test-machine-name", + "${buildername}" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "pixel_test", + "non_precommit_args": [ + "--upload-refimg-to-cloud-storage" + ], + "precommit_args": [ + "--download-refimg-from-cloud-storage" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:0fe9", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "screenshot_sync", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", + "--dont-restore-color-profile-after-test" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "screenshot_sync_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:0fe9", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "trace_test", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "trace_test", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:0fe9", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false + } + }, + { + "args": [ + "webgl_conformance", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", + "--webgl-conformance-version=2.0.1", + "--read-abbreviated-json-results-from=../../content/test/data/gpu/webgl2_conformance_tests_output.json" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "webgl2_conformance_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:0fe9", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false, + "shards": 20 + } + }, + { + "args": [ + "webgl_conformance", + "--show-stdout", + "--browser=release", + "--passthrough", + "-v", + "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc" + ], + "isolate_name": "telemetry_gpu_integration_test", + "name": "webgl_conformance_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:0fe9", + "os": "Mac-10.14", + "pool": "Chrome-GPU" + } + ], + "idempotent": false, + "shards": 2 + } + } + ] + }, "Mac FYI Debug (Intel)": { "gtest_tests": [ {
diff --git a/testing/buildbot/filters/chromeos.single_process_mash.content_browsertests.filter b/testing/buildbot/filters/chromeos.single_process_mash.content_browsertests.filter index ab9e88f..bb65115 100644 --- a/testing/buildbot/filters/chromeos.single_process_mash.content_browsertests.filter +++ b/testing/buildbot/filters/chromeos.single_process_mash.content_browsertests.filter
@@ -15,6 +15,81 @@ -CompositedScrollingBrowserTest.Scroll3DTransformedScroller +# RWHVAura::CreateDelegatedFrameHostClient skipped. https://crbug.com/877496 +# There are different timeouts due the same root cause above. + +# MainThreadFrameObserver::Wait() times out. +# RWHVAura::CreateDelegatedFrameHostClient skipped. https://crbug.com/877496 +-AccessibilityHitTestingBrowserTest.HitTestingWithPinchZoom +-AutoscrollBrowserTest.AutoscrollDirectionChangeAfterFullyScrolled +-AutoscrollBrowserTest.AutoscrollFlingGSBDeltaHints +-AutoscrollBrowserTest.WheelScrollingWorksAfterAutoscrollCancel +-BrowserSideFlingBrowserTest.TouchpadFling +-BrowserSideFlingBrowserTest.TouchscreenFling +-CompositorEventAckBrowserTest.MouseWheel +-CompositorEventAckBrowserTest.PassiveTouchStartBlockingTouchEnd +-CompositorEventAckBrowserTest.TouchStart +-CompositorEventAckBrowserTest.TouchStartDuringFling +-MainThreadEventQueueBrowserTest.MouseMove +-MainThreadEventQueueBrowserTest.TouchMove +-PointerLockBrowserTest.PointerLockEventRouting +-PointerLockBrowserTest.PointerLockWheelEventRouting +-PointerLockBrowserTest.PointerLockWidgetHidden +-RenderWidgetHostViewBrowserTestBase.CompositorWorksWhenReusingRenderer +-ScreenOrientationOOPIFBrowserTest.ScreenOrientation +-ScrollLatencyBrowserTest.ScrollLatencyNotRecordedIfGSUIgnored +-ScrollLatencyBrowserTest.SmoothWheelScroll +-SitePerProcessBrowserTest.* +-SitePerProcessGestureHitTestBrowserTest.* +-SitePerProcessHitTestBrowserTest.* +-SitePerProcessMouseWheelHitTestBrowserTest.* +-TouchpadPinchBrowserTest.* +-WheelEventListenerBrowserTest.DocumentMouseWheelEventListenersPassiveByDefault +-WheelEventListenerBrowserTest.DocumentWheelEventListenersPassiveByDefault + +# DevToolsVideoConsumerTest::WaitUntilFrameReceived() times out. +# RWHVAura::CreateDelegatedFrameHostClient skipped. https://crbug.com/877496 +-DevToolsVideoConsumerTest.SetMinAndMaxFramesChangesDimensions + +# SurfaceHitTestReadyNotifier::WaitForSurfaceReady() times out. +# RWHVAura::CreateDelegatedFrameHostClient skipped. https://crbug.com/877496 +-SitePerProcessBrowserTouchActionTest.* +-SitePerProcessEmulatedTouchBrowserTest.* +-SitePerProcessHighDPIHitTestBrowserTest.* +-SitePerProcessInternalsHitTestBrowserTest.* +-SitePerProcessNonIntegerScaleFactorHitTestBrowserTest.* +-TouchAccessibilityBrowserTest.TouchExplorationInCrossSiteIframe + +# RenderWidgetHostInputEventRouter::IsViewInMap() never true. +# RWHVAura::CreateDelegatedFrameHostClient skipped. https://crbug.com/877496 +-RenderWidgetHostTouchEmulatorBrowserTest.TouchEmulator +-TouchSelectionForCrossProcessFramesTests/TouchSelectionControllerClientAuraSiteIsolationTest.BasicSelectionIsolatedIframe/0 +-TouchSelectionForCrossProcessFramesTests/TouchSelectionControllerClientAuraSiteIsolationTest.BasicSelectionIsolatedIframe/1 +-TouchSelectionForCrossProcessFramesTests/TouchSelectionControllerClientAuraSiteIsolationTest.BasicSelectionIsolatedScrollMainframe/0 +-TouchSelectionForCrossProcessFramesTests/TouchSelectionControllerClientAuraSiteIsolationTest.BasicSelectionIsolatedScrollMainframe/1 +-WebContentsViewAuraTest.ContentWindowClose + +# RenderWidgetHostViewBrowserTest::WaitForCopySourceReady() times out. +# RWHVAura::CreateDelegatedFrameHostClient skipped. https://crbug.com/877496 +-GLAndSoftwareCompositing/* + +# RenderFrameSubmissionObserver::Wait()/WaitForAnyFrameSubmission() times out. +# RWHVAura::CreateDelegatedFrameHostClient skipped. https://crbug.com/877496 +-TouchActionBrowserTest.* +-TouchInputBrowserTest.* + +# RenderWidgetHostViewAura::CopyFromSurface crashes. +# RWHVAura::CreateDelegatedFrameHostClient skipped. https://crbug.com/877496 +-SnapshotBrowserTest.SingleWindowTest +-WebContentsViewAuraTest.ReplaceStateReloadPushState +-WebContentsViewAuraTest.ScreenshotForSwappedOutRenderViews + +# WebContentsVideoCaptureDeviceBrowserTest::WaitForFrameWithColor() times out. +# RWHVAura::CreateDelegatedFrameHostClient skipped. https://crbug.com/877496 +-WebContentsVideoCaptureDeviceBrowserTest.* +-WebContentsVideoCaptureDeviceBrowserTestP.* + + # DCHECK(!event->IsPointerEvent()) fail. https://crbug.com/884342 -MouseLatencyBrowserTest.CoalescedMouseWheelsCorrectlyTerminated @@ -25,25 +100,24 @@ # -SitePerProcessHitTestBrowserTest.CrossProcessMouseEnterAndLeaveTest/1 # -SitePerProcessInternalsHitTestBrowserTest.NestedLocalNonFastScrollableDivCoordsAreLocal/3 # -SitePerProcessNonIntegerScaleFactorHitTestBrowserTest.NestedSurfaceHitTestTest/1 --SitePerProcessBrowserTouchActionTest.* --SitePerProcessEmulatedTouchBrowserTest.* --SitePerProcessGestureHitTestBrowserTest.* --SitePerProcessHighDPIHitTestBrowserTest.* --SitePerProcessHitTestBrowserTest.* --SitePerProcessInternalsHitTestBrowserTest.* --SitePerProcessMouseWheelHitTestBrowserTest.* --SitePerProcessNonIntegerScaleFactorHitTestBrowserTest.* --TouchAccessibilityBrowserTest.* --TouchSelectionForCrossProcessFramesTests/* # Hit test fails. https://crbug.com/884366 --PointerLockBrowserTest.PointerLockEventRouting --PointerLockBrowserTest.PointerLockWheelEventRouting --SitePerProcessHitTestBrowserTest.* +# Leaving an example of the bug. +# -SitePerProcessHitTestBrowserTest.HitTestNestedFrames/1 -SitePerProcessHitTestDataGenerationBrowserTest.* # ShowWidgetMessageFilter::Wait() times out. https://crbug.com/884369 # Leaving an example of the bug. # -SitePerProcessHitTestBrowserTest.PopupMenuTest/1 + + +# TestTouchSelectionControllerClientAura::Wait() times out. +# https://crbug.com/884389 +-TouchSelectionControllerClientAuraScaleFactorTest.* +-TouchSelectionControllerClientAuraTest.* + + +# The test times out. https://crbug.com/884393 +-WebRtcCaptureFromElementBrowserTest.VerifyCanvasCaptureOffscreenCanvasFrames
diff --git a/testing/buildbot/filters/webui_polymer2_browser_tests.filter b/testing/buildbot/filters/webui_polymer2_browser_tests.filter index 17a8ff0..1306e5a 100644 --- a/testing/buildbot/filters/webui_polymer2_browser_tests.filter +++ b/testing/buildbot/filters/webui_polymer2_browser_tests.filter
@@ -31,10 +31,6 @@ # Tests that fail only on official builds. -CrSettingsIncompatibleApplicationsPageTest.All -# Most of the a11y tests are failing because they use /deep/. Should be -# addressed as part of crbug.com/860069 --SettingsA11ySignOut.* - # ChromeOS only test failures. -ActiveDirectoryJoinTest.TestActiveDirectoryEnrollment_DistinguishedName -ActiveDirectoryJoinTest.TestActiveDirectoryEnrollment_ErrorCard @@ -273,7 +269,7 @@ NetInternalsTest.* NoBackgroundTasksTest.* NTP4WebUITest.* -OpenAudioFiles.* +OpenAudioFiles/* PasswordsAndFormsBrowserTest.* PrintPreviewAdvancedDialogTest.* PrintPreviewAdvancedItemTest.* @@ -300,6 +296,7 @@ RestrictedFileSystemExtensionApiTest.* SandboxStatusUITest.* SettingsA11yManagePasswords.* +SettingsA11ySignOut.* SettingsAccessibilityTest.* SettingsAdvancedPageBrowserTest.* SettingsAnimationBrowserTest.*
diff --git a/testing/buildbot/swarming_mixins.pyl b/testing/buildbot/swarming_mixins.pyl index 789439d..1d95385 100644 --- a/testing/buildbot/swarming_mixins.pyl +++ b/testing/buildbot/swarming_mixins.pyl
@@ -15,11 +15,26 @@ # already exists. { + 'amd_8870m': { + 'dimensions': { + 'gpu': '1002:6821', + } + }, 'arm_tester': { 'dimensions': { 'cpu': 'armv7l-32', } }, + 'gpu_pool': { + 'dimensions': { + 'pool': 'Chrome-GPU', + } + }, + 'intel_iris_5100': { + 'dimensions': { + 'gpu': '8086:0a2e', + } + }, 'linux-trusty': { 'dimensions': { 'os': 'Ubuntu-14.04', @@ -40,6 +55,11 @@ 'os': 'Mac-10.13', } }, + 'mac_10.14': { + 'dimensions': { + 'os': 'Mac-10.14', + } + }, 'mac_mini_10.12': { 'dimensions': { 'gpu': '8086:0a2e', @@ -51,6 +71,11 @@ 'gpu': 'none', } }, + 'nvidia_750m_mac_edition': { + 'dimensions': { + 'gpu': '10de:0fe9', + } + }, 'win10': { 'dimensions': { 'os': 'Windows-10-15063',
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl index 8b6d97a9..2cc9f8e 100644 --- a/testing/buildbot/waterfalls.pyl +++ b/testing/buildbot/waterfalls.pyl
@@ -2164,6 +2164,45 @@ 'gtest_tests': 'gpu_angle_deqp_linux_nvidia_gtests', }, }, + 'Mac FYI 10.14 Release (AMD)': { + 'os_type': 'mac', + 'browser_config': 'release', + 'swarming_mixins': [ + 'amd_8870m', + 'gpu_pool', + 'mac_10.14', + ], + 'test_suites': { + 'gtest_tests': 'gpu_fyi_mac_release_gtests', + 'gpu_telemetry_tests': 'gpu_fyi_mac_release_telemetry_tests', + }, + }, + 'Mac FYI 10.14 Release (Intel)': { + 'os_type': 'mac', + 'browser_config': 'release', + 'swarming_mixins': [ + 'gpu_pool', + 'intel_iris_5100', + 'mac_10.14', + ], + 'test_suites': { + 'gtest_tests': 'gpu_fyi_mac_release_gtests', + 'gpu_telemetry_tests': 'gpu_fyi_mac_release_telemetry_tests', + }, + }, + 'Mac FYI 10.14 Release (NVIDIA)': { + 'os_type': 'mac', + 'browser_config': 'release', + 'swarming_mixins': [ + 'gpu_pool', + 'mac_10.14', + 'nvidia_750m_mac_edition', + ], + 'test_suites': { + 'gtest_tests': 'gpu_fyi_mac_release_gtests', + 'gpu_telemetry_tests': 'gpu_fyi_mac_release_telemetry_tests', + }, + }, 'Mac FYI Debug (Intel)': { 'os_type': 'mac', 'browser_config': 'debug',
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG index 0d14e9a..0cfe23d 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG +++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
@@ -543,12 +543,7 @@ crbug.com/591099 virtual/paint-timing/external/wpt/paint-timing/sibling-painting-first-image.html [ Failure ] crbug.com/591099 virtual/paint-touchaction-rects/fast/events/touch/compositor-touch-hit-rects-continuation.html [ Failure ] crbug.com/591099 virtual/paint-touchaction-rects/fast/events/touch/compositor-touch-hit-rects-list-translate.html [ Failure ] -crbug.com/591099 virtual/paint-touchaction-rects/fast/events/touch/compositor-touch-hit-rects-non-composited-scroll.html [ Failure ] -crbug.com/591099 virtual/paint-touchaction-rects/fast/events/touch/compositor-touch-hit-rects-scroll.html [ Failure ] -crbug.com/591099 virtual/paint-touchaction-rects/fast/events/touch/compositor-touch-hit-rects-table.html [ Failure ] crbug.com/591099 virtual/paint-touchaction-rects/fast/events/touch/compositor-touch-hit-rects.html [ Failure ] -crbug.com/591099 virtual/paint-touchaction-rects/fast/events/touch/touch-rect-assert-first-layer-special.html [ Failure ] -crbug.com/591099 virtual/paint-touchaction-rects/fast/events/touch/touch-rect-crash-on-unpromote-layer.html [ Failure ] crbug.com/591099 virtual/prefer_compositing_to_lcd_text/ [ Skip ] crbug.com/591099 virtual/reporting-api/external/wpt/content-security-policy/reporting-api/reporting-api-doesnt-send-reports-without-violation.https.sub.html [ Pass ] crbug.com/591099 virtual/scroll_customization/ [ Skip ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 7017ec0..f969d80 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -1794,8 +1794,6 @@ crbug.com/867834 virtual/outofblink-cors/http/tests/security/isolatedWorld/cross-origin-xhr.html [ Crash ] # Timeout tests in dictionary order. -crbug.com/867834 virtual/outofblink-cors/external/wpt/service-workers/service-worker/sandboxed-iframe-fetch-event.https.html [ Timeout ] -crbug.com/867834 virtual/outofblink-cors/external/wpt/service-workers/service-worker/worker-in-sandboxed-iframe-by-csp-fetch-event.https.html [ Timeout ] crbug.com/870173 virtual/outofblink-cors/http/tests/security/document-domain-canonicalizes.html [ Timeout ] crbug.com/870173 virtual/outofblink-cors/http/tests/security/secureContexts/authenticated_worker.https.html [ Timeout ] crbug.com/870173 virtual/outofblink-cors/http/tests/security/secureContexts/unauthenticated_worker.html [ Timeout ] @@ -4509,6 +4507,7 @@ crbug.com/807838 external/wpt/service-workers/service-worker/worker-in-sandboxed-iframe-by-csp-fetch-event.https.html [ Crash Pass ] crbug.com/807838 virtual/service-worker-servicification/external/wpt/service-workers/service-worker/worker-in-sandboxed-iframe-by-csp-fetch-event.https.html [ Crash Pass ] +crbug.com/807838 virtual/outofblink-cors/external/wpt/service-workers/service-worker/worker-in-sandboxed-iframe-by-csp-fetch-event.https.html [ Crash Pass ] crbug.com/807838 virtual/outofblink-cors-ns/external/wpt/service-workers/service-worker/worker-in-sandboxed-iframe-by-csp-fetch-event.https.html [ Crash Pass ] crbug.com/862886 external/wpt/service-workers/service-worker/navigation-preload/broken-chunked-encoding.https.html [ Failure ] @@ -5202,11 +5201,6 @@ crbug.com/883860 [ Mac ] external/wpt/service-workers/service-worker/interfaces-sw.https.html [ Failure ] crbug.com/883837 [ Win7 ] http/tests/performance-timing/resource_timing_buffer_full_250.html [ Timeout Pass ] -crbug.com/v8/8186 external/wpt/wasm/jsapi/module/customSections.any.html [ Skip ] -crbug.com/v8/8186 external/wpt/wasm/jsapi/module/customSections.any.worker.html [ Skip ] -crbug.com/v8/8186 virtual/enable_wasm/external/wpt/wasm/jsapi/module/customSections.any.html [ Skip ] -crbug.com/v8/8186 virtual/enable_wasm/external/wpt/wasm/jsapi/module/customSections.any.worker.html [ Skip ] - # Sheriff 2018-09-18 crbug.com/884445 virtual/unified-autoplay/external/wpt/feature-policy/feature-policy-nested-header-policy-disallowed-for-all.https.sub.html [ Pass Timeout ] crbug.com/884445 virtual/video-surface-layer/external/wpt/feature-policy/feature-policy-nested-header-policy-disallowed-for-all.https.sub.html [ Pass Timeout ]
diff --git a/third_party/WebKit/LayoutTests/custom-elements/constructor-may-poach-upgrading-element.html b/third_party/WebKit/LayoutTests/custom-elements/constructor-may-poach-upgrading-element.html index feac93d..fce72a8 100644 --- a/third_party/WebKit/LayoutTests/custom-elements/constructor-may-poach-upgrading-element.html +++ b/third_party/WebKit/LayoutTests/custom-elements/constructor-may-poach-upgrading-element.html
@@ -6,6 +6,10 @@ <script> 'use strict'; +setup({ + allow_uncaught_exception: true, +}); + test_with_window((w) => { let doc = w.document; let e = doc.createElement('a-a');
diff --git a/third_party/WebKit/LayoutTests/custom-elements/spec/construct.html b/third_party/WebKit/LayoutTests/custom-elements/spec/construct.html index 4bae586..11e3fce 100644 --- a/third_party/WebKit/LayoutTests/custom-elements/spec/construct.html +++ b/third_party/WebKit/LayoutTests/custom-elements/spec/construct.html
@@ -9,6 +9,10 @@ <script> 'use strict'; +setup({ + allow_uncaught_exception: true, +}); + test_with_window((w) => { assert_throws(TypeError.prototype, () => { w.HTMLElement(); @@ -142,7 +146,7 @@ } w.customElements.define('a-a', A); let d = w.document.createElement('div'); - assert_reports(w, 'INVALID_STATE_ERR', () => { + assert_reports(window, 'INVALID_STATE_ERR', () => { d.innerHTML = '<a-a>'; }, 'Creating an element that is already constructed marker should report ' + 'InvalidStateError'); @@ -150,7 +154,7 @@ test_with_window((w) => { let errors = []; - w.onerror = function (event, source, lineno, colno, error) { + window.onerror = function (event, source, lineno, colno, error) { errors.push(error.name); return true; };
diff --git a/third_party/WebKit/LayoutTests/custom-elements/spec/create-element-defined-synchronous.html b/third_party/WebKit/LayoutTests/custom-elements/spec/create-element-defined-synchronous.html index d18c14c..fe90db7c 100644 --- a/third_party/WebKit/LayoutTests/custom-elements/spec/create-element-defined-synchronous.html +++ b/third_party/WebKit/LayoutTests/custom-elements/spec/create-element-defined-synchronous.html
@@ -7,6 +7,10 @@ <script> 'use strict'; +setup({ + allow_uncaught_exception: true, +}); + const expectTypeError = TypeError.prototype; const expectNotSupportedError = 'NOT_SUPPORTED_ERR';
diff --git a/third_party/WebKit/LayoutTests/custom-elements/spec/state-failed-upgrade.html b/third_party/WebKit/LayoutTests/custom-elements/spec/state-failed-upgrade.html index 13aaf99..8a6bd21 100644 --- a/third_party/WebKit/LayoutTests/custom-elements/spec/state-failed-upgrade.html +++ b/third_party/WebKit/LayoutTests/custom-elements/spec/state-failed-upgrade.html
@@ -7,6 +7,10 @@ <script> 'use strict'; +setup({ + allow_uncaught_exception: true, +}); + // Custom Element State // https://dom.spec.whatwg.org/#concept-element-custom-element-state @@ -31,7 +35,7 @@ // Set element's custom element state to "failed". // https://html.spec.whatwg.org/multipage/scripting.html#upgrades let container = document.body; - assert_reports(w, error, () => container.appendChild(element)); + assert_reports(window, error, () => container.appendChild(element)); assert_equals(constructorCount, 1, 'constructor should be invoked once'); // "failed" is not "defined"
diff --git a/third_party/WebKit/LayoutTests/custom-elements/spec/upgrade-element.html b/third_party/WebKit/LayoutTests/custom-elements/spec/upgrade-element.html index 2feaf1f..8d728cb64 100644 --- a/third_party/WebKit/LayoutTests/custom-elements/spec/upgrade-element.html +++ b/third_party/WebKit/LayoutTests/custom-elements/spec/upgrade-element.html
@@ -9,6 +9,10 @@ 'use strict' +setup({ + allow_uncaught_exception: true, +}); + // 6. If C non-conformantly uses an API decorated with the [CEReactions] extended attribute, // then the reactions enqueued at the beginning of upgrade will execute during this step, // before C finishes and control returns to this algorithm. @@ -79,7 +83,7 @@ let error_log = []; let doc = w.document; doc.body.appendChild(doc.createElement('a-a')); - w.onerror = function (msg, url, lineNo, columnNo, error) { + window.onerror = function (msg, url, lineNo, columnNo, error) { error_log.push(error.name); return true; };
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/getComputedStyle-insets-absolute-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/getComputedStyle-insets-absolute-expected.txt index 76946d1b..74a91796 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/getComputedStyle-insets-absolute-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/getComputedStyle-insets-absolute-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 324 tests; 180 PASS, 144 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 324 tests; 276 PASS, 48 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS horizontal-tb ltr inside horizontal-tb ltr - Pixels resolve as-is PASS horizontal-tb ltr inside horizontal-tb ltr - Relative lengths are absolutized into pixels PASS horizontal-tb ltr inside horizontal-tb ltr - Percentages are absolutized into pixels @@ -20,37 +20,37 @@ PASS horizontal-tb ltr inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value PASS horizontal-tb ltr inside vertical-lr ltr - Pixels resolve as-is PASS horizontal-tb ltr inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'left' expected "100px" but got "50px" -FAIL horizontal-tb ltr inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'left' expected "98px" but got "48px" +PASS horizontal-tb ltr inside vertical-lr ltr - Percentages are absolutized into pixels +PASS horizontal-tb ltr inside vertical-lr ltr - calc() is absolutized into pixels PASS horizontal-tb ltr inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL horizontal-tb ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "400px" but got "200px" +PASS horizontal-tb ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS horizontal-tb ltr inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS horizontal-tb ltr inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL horizontal-tb ltr inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "15px" but got "30px" PASS horizontal-tb ltr inside vertical-lr rtl - Pixels resolve as-is PASS horizontal-tb ltr inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'left' expected "100px" but got "50px" -FAIL horizontal-tb ltr inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'left' expected "98px" but got "48px" +PASS horizontal-tb ltr inside vertical-lr rtl - Percentages are absolutized into pixels +PASS horizontal-tb ltr inside vertical-lr rtl - calc() is absolutized into pixels PASS horizontal-tb ltr inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL horizontal-tb ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "400px" but got "200px" +PASS horizontal-tb ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS horizontal-tb ltr inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS horizontal-tb ltr inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL horizontal-tb ltr inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "185px" but got "30px" PASS horizontal-tb ltr inside vertical-rl ltr - Pixels resolve as-is PASS horizontal-tb ltr inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'left' expected "100px" but got "50px" -FAIL horizontal-tb ltr inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'left' expected "98px" but got "48px" +PASS horizontal-tb ltr inside vertical-rl ltr - Percentages are absolutized into pixels +PASS horizontal-tb ltr inside vertical-rl ltr - calc() is absolutized into pixels PASS horizontal-tb ltr inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL horizontal-tb ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "400px" but got "200px" +PASS horizontal-tb ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL horizontal-tb ltr inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL horizontal-tb ltr inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" FAIL horizontal-tb ltr inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "15px" but got "30px" PASS horizontal-tb ltr inside vertical-rl rtl - Pixels resolve as-is PASS horizontal-tb ltr inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'left' expected "100px" but got "50px" -FAIL horizontal-tb ltr inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'left' expected "98px" but got "48px" +PASS horizontal-tb ltr inside vertical-rl rtl - Percentages are absolutized into pixels +PASS horizontal-tb ltr inside vertical-rl rtl - calc() is absolutized into pixels PASS horizontal-tb ltr inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL horizontal-tb ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "400px" but got "200px" +PASS horizontal-tb ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL horizontal-tb ltr inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL horizontal-tb ltr inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" FAIL horizontal-tb ltr inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "185px" but got "30px" @@ -74,253 +74,253 @@ PASS horizontal-tb rtl inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value PASS horizontal-tb rtl inside vertical-lr ltr - Pixels resolve as-is PASS horizontal-tb rtl inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'left' expected "100px" but got "50px" -FAIL horizontal-tb rtl inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'left' expected "98px" but got "48px" +PASS horizontal-tb rtl inside vertical-lr ltr - Percentages are absolutized into pixels +PASS horizontal-tb rtl inside vertical-lr ltr - calc() is absolutized into pixels PASS horizontal-tb rtl inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL horizontal-tb rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "400px" but got "200px" +PASS horizontal-tb rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS horizontal-tb rtl inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS horizontal-tb rtl inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL horizontal-tb rtl inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "15px" but got "30px" PASS horizontal-tb rtl inside vertical-lr rtl - Pixels resolve as-is PASS horizontal-tb rtl inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'left' expected "100px" but got "50px" -FAIL horizontal-tb rtl inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'left' expected "98px" but got "48px" +PASS horizontal-tb rtl inside vertical-lr rtl - Percentages are absolutized into pixels +PASS horizontal-tb rtl inside vertical-lr rtl - calc() is absolutized into pixels PASS horizontal-tb rtl inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL horizontal-tb rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "400px" but got "200px" +PASS horizontal-tb rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS horizontal-tb rtl inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS horizontal-tb rtl inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL horizontal-tb rtl inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "185px" but got "30px" PASS horizontal-tb rtl inside vertical-rl ltr - Pixels resolve as-is PASS horizontal-tb rtl inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'left' expected "100px" but got "50px" -FAIL horizontal-tb rtl inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'left' expected "98px" but got "48px" +PASS horizontal-tb rtl inside vertical-rl ltr - Percentages are absolutized into pixels +PASS horizontal-tb rtl inside vertical-rl ltr - calc() is absolutized into pixels PASS horizontal-tb rtl inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL horizontal-tb rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "400px" but got "200px" +PASS horizontal-tb rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL horizontal-tb rtl inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL horizontal-tb rtl inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" FAIL horizontal-tb rtl inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "15px" but got "30px" PASS horizontal-tb rtl inside vertical-rl rtl - Pixels resolve as-is PASS horizontal-tb rtl inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'left' expected "100px" but got "50px" -FAIL horizontal-tb rtl inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'left' expected "98px" but got "48px" +PASS horizontal-tb rtl inside vertical-rl rtl - Percentages are absolutized into pixels +PASS horizontal-tb rtl inside vertical-rl rtl - calc() is absolutized into pixels PASS horizontal-tb rtl inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL horizontal-tb rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "400px" but got "200px" +PASS horizontal-tb rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL horizontal-tb rtl inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL horizontal-tb rtl inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" FAIL horizontal-tb rtl inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "185px" but got "30px" PASS vertical-lr ltr inside horizontal-tb ltr - Pixels resolve as-is PASS vertical-lr ltr inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr ltr inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr ltr inside horizontal-tb ltr - Percentages are absolutized into pixels +PASS vertical-lr ltr inside horizontal-tb ltr - calc() is absolutized into pixels PASS vertical-lr ltr inside horizontal-tb ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr ltr inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained PASS vertical-lr ltr inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr ltr inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-lr ltr inside horizontal-tb ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "15px" but got "30px" PASS vertical-lr ltr inside horizontal-tb rtl - Pixels resolve as-is PASS vertical-lr ltr inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr ltr inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr ltr inside horizontal-tb rtl - Percentages are absolutized into pixels +PASS vertical-lr ltr inside horizontal-tb rtl - calc() is absolutized into pixels PASS vertical-lr ltr inside horizontal-tb rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr ltr inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained PASS vertical-lr ltr inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr ltr inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-lr ltr inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "15px" but got "370px" PASS vertical-lr ltr inside vertical-lr ltr - Pixels resolve as-is PASS vertical-lr ltr inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr ltr inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr ltr inside vertical-lr ltr - Percentages are absolutized into pixels +PASS vertical-lr ltr inside vertical-lr ltr - calc() is absolutized into pixels PASS vertical-lr ltr inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS vertical-lr ltr inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr ltr inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr ltr inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-lr ltr inside vertical-lr rtl - Pixels resolve as-is PASS vertical-lr ltr inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr ltr inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr ltr inside vertical-lr rtl - Percentages are absolutized into pixels +PASS vertical-lr ltr inside vertical-lr rtl - calc() is absolutized into pixels PASS vertical-lr ltr inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS vertical-lr ltr inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr ltr inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr ltr inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-lr ltr inside vertical-rl ltr - Pixels resolve as-is PASS vertical-lr ltr inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr ltr inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr ltr inside vertical-rl ltr - Percentages are absolutized into pixels +PASS vertical-lr ltr inside vertical-rl ltr - calc() is absolutized into pixels PASS vertical-lr ltr inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL vertical-lr ltr inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL vertical-lr ltr inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" PASS vertical-lr ltr inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-lr ltr inside vertical-rl rtl - Pixels resolve as-is PASS vertical-lr ltr inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr ltr inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr ltr inside vertical-rl rtl - Percentages are absolutized into pixels +PASS vertical-lr ltr inside vertical-rl rtl - calc() is absolutized into pixels PASS vertical-lr ltr inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL vertical-lr ltr inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL vertical-lr ltr inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" PASS vertical-lr ltr inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-lr rtl inside horizontal-tb ltr - Pixels resolve as-is PASS vertical-lr rtl inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr rtl inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr rtl inside horizontal-tb ltr - Percentages are absolutized into pixels +PASS vertical-lr rtl inside horizontal-tb ltr - calc() is absolutized into pixels PASS vertical-lr rtl inside horizontal-tb ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr rtl inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained PASS vertical-lr rtl inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr rtl inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-lr rtl inside horizontal-tb ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "15px" but got "30px" PASS vertical-lr rtl inside horizontal-tb rtl - Pixels resolve as-is PASS vertical-lr rtl inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr rtl inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr rtl inside horizontal-tb rtl - Percentages are absolutized into pixels +PASS vertical-lr rtl inside horizontal-tb rtl - calc() is absolutized into pixels PASS vertical-lr rtl inside horizontal-tb rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr rtl inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained PASS vertical-lr rtl inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr rtl inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-lr rtl inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "15px" but got "370px" PASS vertical-lr rtl inside vertical-lr ltr - Pixels resolve as-is PASS vertical-lr rtl inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr rtl inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr rtl inside vertical-lr ltr - Percentages are absolutized into pixels +PASS vertical-lr rtl inside vertical-lr ltr - calc() is absolutized into pixels PASS vertical-lr rtl inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS vertical-lr rtl inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr rtl inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr rtl inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-lr rtl inside vertical-lr rtl - Pixels resolve as-is PASS vertical-lr rtl inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr rtl inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr rtl inside vertical-lr rtl - Percentages are absolutized into pixels +PASS vertical-lr rtl inside vertical-lr rtl - calc() is absolutized into pixels PASS vertical-lr rtl inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS vertical-lr rtl inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr rtl inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr rtl inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-lr rtl inside vertical-rl ltr - Pixels resolve as-is PASS vertical-lr rtl inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr rtl inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr rtl inside vertical-rl ltr - Percentages are absolutized into pixels +PASS vertical-lr rtl inside vertical-rl ltr - calc() is absolutized into pixels PASS vertical-lr rtl inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL vertical-lr rtl inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL vertical-lr rtl inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" PASS vertical-lr rtl inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-lr rtl inside vertical-rl rtl - Pixels resolve as-is PASS vertical-lr rtl inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr rtl inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr rtl inside vertical-rl rtl - Percentages are absolutized into pixels +PASS vertical-lr rtl inside vertical-rl rtl - calc() is absolutized into pixels PASS vertical-lr rtl inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL vertical-lr rtl inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL vertical-lr rtl inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" PASS vertical-lr rtl inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-rl ltr inside horizontal-tb ltr - Pixels resolve as-is PASS vertical-rl ltr inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl ltr inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl ltr inside horizontal-tb ltr - Percentages are absolutized into pixels +PASS vertical-rl ltr inside horizontal-tb ltr - calc() is absolutized into pixels PASS vertical-rl ltr inside horizontal-tb ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl ltr inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained PASS vertical-rl ltr inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl ltr inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-rl ltr inside horizontal-tb ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "15px" but got "30px" PASS vertical-rl ltr inside horizontal-tb rtl - Pixels resolve as-is PASS vertical-rl ltr inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl ltr inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl ltr inside horizontal-tb rtl - Percentages are absolutized into pixels +PASS vertical-rl ltr inside horizontal-tb rtl - calc() is absolutized into pixels PASS vertical-rl ltr inside horizontal-tb rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl ltr inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained PASS vertical-rl ltr inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl ltr inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-rl ltr inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "15px" but got "370px" PASS vertical-rl ltr inside vertical-lr ltr - Pixels resolve as-is PASS vertical-rl ltr inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl ltr inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl ltr inside vertical-lr ltr - Percentages are absolutized into pixels +PASS vertical-rl ltr inside vertical-lr ltr - calc() is absolutized into pixels PASS vertical-rl ltr inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS vertical-rl ltr inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl ltr inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-rl ltr inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "30px" but got "370px" PASS vertical-rl ltr inside vertical-lr rtl - Pixels resolve as-is PASS vertical-rl ltr inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl ltr inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl ltr inside vertical-lr rtl - Percentages are absolutized into pixels +PASS vertical-rl ltr inside vertical-lr rtl - calc() is absolutized into pixels PASS vertical-rl ltr inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS vertical-rl ltr inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl ltr inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-rl ltr inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "30px" but got "370px" PASS vertical-rl ltr inside vertical-rl ltr - Pixels resolve as-is PASS vertical-rl ltr inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl ltr inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl ltr inside vertical-rl ltr - Percentages are absolutized into pixels +PASS vertical-rl ltr inside vertical-rl ltr - calc() is absolutized into pixels PASS vertical-rl ltr inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL vertical-rl ltr inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL vertical-rl ltr inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" FAIL vertical-rl ltr inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "370px" but got "30px" PASS vertical-rl ltr inside vertical-rl rtl - Pixels resolve as-is PASS vertical-rl ltr inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl ltr inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl ltr inside vertical-rl rtl - Percentages are absolutized into pixels +PASS vertical-rl ltr inside vertical-rl rtl - calc() is absolutized into pixels PASS vertical-rl ltr inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL vertical-rl ltr inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL vertical-rl ltr inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" FAIL vertical-rl ltr inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "370px" but got "30px" PASS vertical-rl rtl inside horizontal-tb ltr - Pixels resolve as-is PASS vertical-rl rtl inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl rtl inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl rtl inside horizontal-tb ltr - Percentages are absolutized into pixels +PASS vertical-rl rtl inside horizontal-tb ltr - calc() is absolutized into pixels PASS vertical-rl rtl inside horizontal-tb ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl rtl inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained PASS vertical-rl rtl inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl rtl inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-rl rtl inside horizontal-tb ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "15px" but got "30px" PASS vertical-rl rtl inside horizontal-tb rtl - Pixels resolve as-is PASS vertical-rl rtl inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl rtl inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl rtl inside horizontal-tb rtl - Percentages are absolutized into pixels +PASS vertical-rl rtl inside horizontal-tb rtl - calc() is absolutized into pixels PASS vertical-rl rtl inside horizontal-tb rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl rtl inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained PASS vertical-rl rtl inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl rtl inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-rl rtl inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "15px" but got "370px" PASS vertical-rl rtl inside vertical-lr ltr - Pixels resolve as-is PASS vertical-rl rtl inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl rtl inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl rtl inside vertical-lr ltr - Percentages are absolutized into pixels +PASS vertical-rl rtl inside vertical-lr ltr - calc() is absolutized into pixels PASS vertical-rl rtl inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS vertical-rl rtl inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl rtl inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-rl rtl inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "30px" but got "370px" PASS vertical-rl rtl inside vertical-lr rtl - Pixels resolve as-is PASS vertical-rl rtl inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl rtl inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl rtl inside vertical-lr rtl - Percentages are absolutized into pixels +PASS vertical-rl rtl inside vertical-lr rtl - calc() is absolutized into pixels PASS vertical-rl rtl inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS vertical-rl rtl inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl rtl inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-rl rtl inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "30px" but got "370px" PASS vertical-rl rtl inside vertical-rl ltr - Pixels resolve as-is PASS vertical-rl rtl inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl rtl inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl rtl inside vertical-rl ltr - Percentages are absolutized into pixels +PASS vertical-rl rtl inside vertical-rl ltr - calc() is absolutized into pixels PASS vertical-rl rtl inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL vertical-rl rtl inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL vertical-rl rtl inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" FAIL vertical-rl rtl inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "370px" but got "30px" PASS vertical-rl rtl inside vertical-rl rtl - Pixels resolve as-is PASS vertical-rl rtl inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl rtl inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl rtl inside vertical-rl rtl - Percentages are absolutized into pixels +PASS vertical-rl rtl inside vertical-rl rtl - calc() is absolutized into pixels PASS vertical-rl rtl inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL vertical-rl rtl inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL vertical-rl rtl inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" FAIL vertical-rl rtl inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "370px" but got "30px"
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/getComputedStyle-insets-fixed-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/getComputedStyle-insets-fixed-expected.txt index d7cfc19..921f9ae 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/getComputedStyle-insets-fixed-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/getComputedStyle-insets-fixed-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 324 tests; 180 PASS, 144 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 324 tests; 276 PASS, 48 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS horizontal-tb ltr inside horizontal-tb ltr - Pixels resolve as-is PASS horizontal-tb ltr inside horizontal-tb ltr - Relative lengths are absolutized into pixels PASS horizontal-tb ltr inside horizontal-tb ltr - Percentages are absolutized into pixels @@ -20,37 +20,37 @@ PASS horizontal-tb ltr inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value PASS horizontal-tb ltr inside vertical-lr ltr - Pixels resolve as-is PASS horizontal-tb ltr inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'left' expected "150px" but got "75px" -FAIL horizontal-tb ltr inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'left' expected "148px" but got "73px" +PASS horizontal-tb ltr inside vertical-lr ltr - Percentages are absolutized into pixels +PASS horizontal-tb ltr inside vertical-lr ltr - calc() is absolutized into pixels PASS horizontal-tb ltr inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL horizontal-tb ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "600px" but got "300px" +PASS horizontal-tb ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS horizontal-tb ltr inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS horizontal-tb ltr inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL horizontal-tb ltr inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "127px" but got "254px" PASS horizontal-tb ltr inside vertical-lr rtl - Pixels resolve as-is PASS horizontal-tb ltr inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'left' expected "150px" but got "75px" -FAIL horizontal-tb ltr inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'left' expected "148px" but got "73px" +PASS horizontal-tb ltr inside vertical-lr rtl - Percentages are absolutized into pixels +PASS horizontal-tb ltr inside vertical-lr rtl - calc() is absolutized into pixels PASS horizontal-tb ltr inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL horizontal-tb ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "600px" but got "300px" +PASS horizontal-tb ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS horizontal-tb ltr inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS horizontal-tb ltr inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL horizontal-tb ltr inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "173px" but got "254px" PASS horizontal-tb ltr inside vertical-rl ltr - Pixels resolve as-is PASS horizontal-tb ltr inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'left' expected "150px" but got "75px" -FAIL horizontal-tb ltr inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'left' expected "148px" but got "73px" +PASS horizontal-tb ltr inside vertical-rl ltr - Percentages are absolutized into pixels +PASS horizontal-tb ltr inside vertical-rl ltr - calc() is absolutized into pixels PASS horizontal-tb ltr inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL horizontal-tb ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "600px" but got "300px" +PASS horizontal-tb ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL horizontal-tb ltr inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL horizontal-tb ltr inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" FAIL horizontal-tb ltr inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "127px" but got "254px" PASS horizontal-tb ltr inside vertical-rl rtl - Pixels resolve as-is PASS horizontal-tb ltr inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'left' expected "150px" but got "75px" -FAIL horizontal-tb ltr inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'left' expected "148px" but got "73px" +PASS horizontal-tb ltr inside vertical-rl rtl - Percentages are absolutized into pixels +PASS horizontal-tb ltr inside vertical-rl rtl - calc() is absolutized into pixels PASS horizontal-tb ltr inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL horizontal-tb ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "600px" but got "300px" +PASS horizontal-tb ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL horizontal-tb ltr inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL horizontal-tb ltr inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" FAIL horizontal-tb ltr inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "173px" but got "254px" @@ -74,253 +74,253 @@ PASS horizontal-tb rtl inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value PASS horizontal-tb rtl inside vertical-lr ltr - Pixels resolve as-is PASS horizontal-tb rtl inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'left' expected "150px" but got "75px" -FAIL horizontal-tb rtl inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'left' expected "148px" but got "73px" +PASS horizontal-tb rtl inside vertical-lr ltr - Percentages are absolutized into pixels +PASS horizontal-tb rtl inside vertical-lr ltr - calc() is absolutized into pixels PASS horizontal-tb rtl inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL horizontal-tb rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "600px" but got "300px" +PASS horizontal-tb rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS horizontal-tb rtl inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS horizontal-tb rtl inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL horizontal-tb rtl inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "127px" but got "254px" PASS horizontal-tb rtl inside vertical-lr rtl - Pixels resolve as-is PASS horizontal-tb rtl inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'left' expected "150px" but got "75px" -FAIL horizontal-tb rtl inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'left' expected "148px" but got "73px" +PASS horizontal-tb rtl inside vertical-lr rtl - Percentages are absolutized into pixels +PASS horizontal-tb rtl inside vertical-lr rtl - calc() is absolutized into pixels PASS horizontal-tb rtl inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL horizontal-tb rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "600px" but got "300px" +PASS horizontal-tb rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS horizontal-tb rtl inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS horizontal-tb rtl inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL horizontal-tb rtl inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "173px" but got "254px" PASS horizontal-tb rtl inside vertical-rl ltr - Pixels resolve as-is PASS horizontal-tb rtl inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'left' expected "150px" but got "75px" -FAIL horizontal-tb rtl inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'left' expected "148px" but got "73px" +PASS horizontal-tb rtl inside vertical-rl ltr - Percentages are absolutized into pixels +PASS horizontal-tb rtl inside vertical-rl ltr - calc() is absolutized into pixels PASS horizontal-tb rtl inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL horizontal-tb rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "600px" but got "300px" +PASS horizontal-tb rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL horizontal-tb rtl inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL horizontal-tb rtl inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" FAIL horizontal-tb rtl inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "127px" but got "254px" PASS horizontal-tb rtl inside vertical-rl rtl - Pixels resolve as-is PASS horizontal-tb rtl inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'left' expected "150px" but got "75px" -FAIL horizontal-tb rtl inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'left' expected "148px" but got "73px" +PASS horizontal-tb rtl inside vertical-rl rtl - Percentages are absolutized into pixels +PASS horizontal-tb rtl inside vertical-rl rtl - calc() is absolutized into pixels PASS horizontal-tb rtl inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL horizontal-tb rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "600px" but got "300px" +PASS horizontal-tb rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL horizontal-tb rtl inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL horizontal-tb rtl inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" FAIL horizontal-tb rtl inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "173px" but got "254px" PASS vertical-lr ltr inside horizontal-tb ltr - Pixels resolve as-is PASS vertical-lr ltr inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr ltr inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr ltr inside horizontal-tb ltr - Percentages are absolutized into pixels +PASS vertical-lr ltr inside horizontal-tb ltr - calc() is absolutized into pixels PASS vertical-lr ltr inside horizontal-tb ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr ltr inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained PASS vertical-lr ltr inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr ltr inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-lr ltr inside horizontal-tb ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "127px" but got "254px" PASS vertical-lr ltr inside horizontal-tb rtl - Pixels resolve as-is PASS vertical-lr ltr inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr ltr inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr ltr inside horizontal-tb rtl - Percentages are absolutized into pixels +PASS vertical-lr ltr inside horizontal-tb rtl - calc() is absolutized into pixels PASS vertical-lr ltr inside horizontal-tb rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr ltr inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained PASS vertical-lr ltr inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr ltr inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-lr ltr inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "127px" but got "346px" PASS vertical-lr ltr inside vertical-lr ltr - Pixels resolve as-is PASS vertical-lr ltr inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr ltr inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr ltr inside vertical-lr ltr - Percentages are absolutized into pixels +PASS vertical-lr ltr inside vertical-lr ltr - calc() is absolutized into pixels PASS vertical-lr ltr inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS vertical-lr ltr inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr ltr inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr ltr inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-lr ltr inside vertical-lr rtl - Pixels resolve as-is PASS vertical-lr ltr inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr ltr inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr ltr inside vertical-lr rtl - Percentages are absolutized into pixels +PASS vertical-lr ltr inside vertical-lr rtl - calc() is absolutized into pixels PASS vertical-lr ltr inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS vertical-lr ltr inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr ltr inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr ltr inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-lr ltr inside vertical-rl ltr - Pixels resolve as-is PASS vertical-lr ltr inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr ltr inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr ltr inside vertical-rl ltr - Percentages are absolutized into pixels +PASS vertical-lr ltr inside vertical-rl ltr - calc() is absolutized into pixels PASS vertical-lr ltr inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL vertical-lr ltr inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL vertical-lr ltr inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" PASS vertical-lr ltr inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-lr ltr inside vertical-rl rtl - Pixels resolve as-is PASS vertical-lr ltr inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr ltr inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr ltr inside vertical-rl rtl - Percentages are absolutized into pixels +PASS vertical-lr ltr inside vertical-rl rtl - calc() is absolutized into pixels PASS vertical-lr ltr inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL vertical-lr ltr inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL vertical-lr ltr inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" PASS vertical-lr ltr inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-lr rtl inside horizontal-tb ltr - Pixels resolve as-is PASS vertical-lr rtl inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr rtl inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr rtl inside horizontal-tb ltr - Percentages are absolutized into pixels +PASS vertical-lr rtl inside horizontal-tb ltr - calc() is absolutized into pixels PASS vertical-lr rtl inside horizontal-tb ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr rtl inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained PASS vertical-lr rtl inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr rtl inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-lr rtl inside horizontal-tb ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "127px" but got "254px" PASS vertical-lr rtl inside horizontal-tb rtl - Pixels resolve as-is PASS vertical-lr rtl inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr rtl inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr rtl inside horizontal-tb rtl - Percentages are absolutized into pixels +PASS vertical-lr rtl inside horizontal-tb rtl - calc() is absolutized into pixels PASS vertical-lr rtl inside horizontal-tb rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr rtl inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained PASS vertical-lr rtl inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr rtl inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-lr rtl inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "127px" but got "346px" PASS vertical-lr rtl inside vertical-lr ltr - Pixels resolve as-is PASS vertical-lr rtl inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr rtl inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr rtl inside vertical-lr ltr - Percentages are absolutized into pixels +PASS vertical-lr rtl inside vertical-lr ltr - calc() is absolutized into pixels PASS vertical-lr rtl inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS vertical-lr rtl inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr rtl inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr rtl inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-lr rtl inside vertical-lr rtl - Pixels resolve as-is PASS vertical-lr rtl inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr rtl inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr rtl inside vertical-lr rtl - Percentages are absolutized into pixels +PASS vertical-lr rtl inside vertical-lr rtl - calc() is absolutized into pixels PASS vertical-lr rtl inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS vertical-lr rtl inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr rtl inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr rtl inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-lr rtl inside vertical-rl ltr - Pixels resolve as-is PASS vertical-lr rtl inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr rtl inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr rtl inside vertical-rl ltr - Percentages are absolutized into pixels +PASS vertical-lr rtl inside vertical-rl ltr - calc() is absolutized into pixels PASS vertical-lr rtl inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL vertical-lr rtl inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL vertical-lr rtl inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" PASS vertical-lr rtl inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-lr rtl inside vertical-rl rtl - Pixels resolve as-is PASS vertical-lr rtl inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr rtl inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr rtl inside vertical-rl rtl - Percentages are absolutized into pixels +PASS vertical-lr rtl inside vertical-rl rtl - calc() is absolutized into pixels PASS vertical-lr rtl inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL vertical-lr rtl inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL vertical-lr rtl inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" PASS vertical-lr rtl inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-rl ltr inside horizontal-tb ltr - Pixels resolve as-is PASS vertical-rl ltr inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl ltr inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl ltr inside horizontal-tb ltr - Percentages are absolutized into pixels +PASS vertical-rl ltr inside horizontal-tb ltr - calc() is absolutized into pixels PASS vertical-rl ltr inside horizontal-tb ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl ltr inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained PASS vertical-rl ltr inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl ltr inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-rl ltr inside horizontal-tb ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "127px" but got "254px" PASS vertical-rl ltr inside horizontal-tb rtl - Pixels resolve as-is PASS vertical-rl ltr inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl ltr inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl ltr inside horizontal-tb rtl - Percentages are absolutized into pixels +PASS vertical-rl ltr inside horizontal-tb rtl - calc() is absolutized into pixels PASS vertical-rl ltr inside horizontal-tb rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl ltr inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained PASS vertical-rl ltr inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl ltr inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-rl ltr inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "127px" but got "346px" PASS vertical-rl ltr inside vertical-lr ltr - Pixels resolve as-is PASS vertical-rl ltr inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl ltr inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl ltr inside vertical-lr ltr - Percentages are absolutized into pixels +PASS vertical-rl ltr inside vertical-lr ltr - calc() is absolutized into pixels PASS vertical-rl ltr inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS vertical-rl ltr inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl ltr inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-rl ltr inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "254px" but got "346px" PASS vertical-rl ltr inside vertical-lr rtl - Pixels resolve as-is PASS vertical-rl ltr inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl ltr inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl ltr inside vertical-lr rtl - Percentages are absolutized into pixels +PASS vertical-rl ltr inside vertical-lr rtl - calc() is absolutized into pixels PASS vertical-rl ltr inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS vertical-rl ltr inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl ltr inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-rl ltr inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "254px" but got "346px" PASS vertical-rl ltr inside vertical-rl ltr - Pixels resolve as-is PASS vertical-rl ltr inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl ltr inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl ltr inside vertical-rl ltr - Percentages are absolutized into pixels +PASS vertical-rl ltr inside vertical-rl ltr - calc() is absolutized into pixels PASS vertical-rl ltr inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL vertical-rl ltr inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL vertical-rl ltr inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" FAIL vertical-rl ltr inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "346px" but got "254px" PASS vertical-rl ltr inside vertical-rl rtl - Pixels resolve as-is PASS vertical-rl ltr inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl ltr inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl ltr inside vertical-rl rtl - Percentages are absolutized into pixels +PASS vertical-rl ltr inside vertical-rl rtl - calc() is absolutized into pixels PASS vertical-rl ltr inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL vertical-rl ltr inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL vertical-rl ltr inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" FAIL vertical-rl ltr inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "346px" but got "254px" PASS vertical-rl rtl inside horizontal-tb ltr - Pixels resolve as-is PASS vertical-rl rtl inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl rtl inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl rtl inside horizontal-tb ltr - Percentages are absolutized into pixels +PASS vertical-rl rtl inside horizontal-tb ltr - calc() is absolutized into pixels PASS vertical-rl rtl inside horizontal-tb ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl rtl inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained PASS vertical-rl rtl inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl rtl inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-rl rtl inside horizontal-tb ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "127px" but got "254px" PASS vertical-rl rtl inside horizontal-tb rtl - Pixels resolve as-is PASS vertical-rl rtl inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl rtl inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl rtl inside horizontal-tb rtl - Percentages are absolutized into pixels +PASS vertical-rl rtl inside horizontal-tb rtl - calc() is absolutized into pixels PASS vertical-rl rtl inside horizontal-tb rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl rtl inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained PASS vertical-rl rtl inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl rtl inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-rl rtl inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'top' expected "127px" but got "346px" PASS vertical-rl rtl inside vertical-lr ltr - Pixels resolve as-is PASS vertical-rl rtl inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl rtl inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl rtl inside vertical-lr ltr - Percentages are absolutized into pixels +PASS vertical-rl rtl inside vertical-lr ltr - calc() is absolutized into pixels PASS vertical-rl rtl inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS vertical-rl rtl inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl rtl inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-rl rtl inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "254px" but got "346px" PASS vertical-rl rtl inside vertical-lr rtl - Pixels resolve as-is PASS vertical-rl rtl inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl rtl inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl rtl inside vertical-lr rtl - Percentages are absolutized into pixels +PASS vertical-rl rtl inside vertical-lr rtl - calc() is absolutized into pixels PASS vertical-rl rtl inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS vertical-rl rtl inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl rtl inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value FAIL vertical-rl rtl inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "254px" but got "346px" PASS vertical-rl rtl inside vertical-rl ltr - Pixels resolve as-is PASS vertical-rl rtl inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl rtl inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl rtl inside vertical-rl ltr - Percentages are absolutized into pixels +PASS vertical-rl rtl inside vertical-rl ltr - calc() is absolutized into pixels PASS vertical-rl rtl inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL vertical-rl rtl inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL vertical-rl rtl inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" FAIL vertical-rl rtl inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "346px" but got "254px" PASS vertical-rl rtl inside vertical-rl rtl - Pixels resolve as-is PASS vertical-rl rtl inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl rtl inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl rtl inside vertical-rl rtl - Percentages are absolutized into pixels +PASS vertical-rl rtl inside vertical-rl rtl - calc() is absolutized into pixels PASS vertical-rl rtl inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL vertical-rl rtl inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL vertical-rl rtl inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" FAIL vertical-rl rtl inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "346px" but got "254px"
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/getComputedStyle-insets-relative-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/getComputedStyle-insets-relative-expected.txt deleted file mode 100644 index 46983e5..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/getComputedStyle-insets-relative-expected.txt +++ /dev/null
@@ -1,256 +0,0 @@ -This is a testharness.js-based test. -Found 252 tests; 188 PASS, 64 FAIL, 0 TIMEOUT, 0 NOTRUN. -PASS horizontal-tb ltr inside horizontal-tb ltr - Pixels resolve as-is -PASS horizontal-tb ltr inside horizontal-tb ltr - Relative lengths are absolutized into pixels -PASS horizontal-tb ltr inside horizontal-tb ltr - Percentages are absolutized into pixels -PASS horizontal-tb ltr inside horizontal-tb ltr - calc() is absolutized into pixels -PASS horizontal-tb ltr inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS horizontal-tb ltr inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS horizontal-tb ltr inside horizontal-tb ltr - If opposite sides are 'auto', they resolve to used value -PASS horizontal-tb ltr inside horizontal-tb rtl - Pixels resolve as-is -PASS horizontal-tb ltr inside horizontal-tb rtl - Relative lengths are absolutized into pixels -PASS horizontal-tb ltr inside horizontal-tb rtl - Percentages are absolutized into pixels -PASS horizontal-tb ltr inside horizontal-tb rtl - calc() is absolutized into pixels -PASS horizontal-tb ltr inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS horizontal-tb ltr inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS horizontal-tb ltr inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value -PASS horizontal-tb ltr inside vertical-lr ltr - Pixels resolve as-is -PASS horizontal-tb ltr inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "9.79688px" -FAIL horizontal-tb ltr inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "8.79688px" -PASS horizontal-tb ltr inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS horizontal-tb ltr inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS horizontal-tb ltr inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value -PASS horizontal-tb ltr inside vertical-lr rtl - Pixels resolve as-is -PASS horizontal-tb ltr inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "9.79688px" -FAIL horizontal-tb ltr inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "8.79688px" -PASS horizontal-tb ltr inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS horizontal-tb ltr inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS horizontal-tb ltr inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value -PASS horizontal-tb ltr inside vertical-rl ltr - Pixels resolve as-is -PASS horizontal-tb ltr inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "9.79688px" -FAIL horizontal-tb ltr inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "8.79688px" -PASS horizontal-tb ltr inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS horizontal-tb ltr inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS horizontal-tb ltr inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value -PASS horizontal-tb ltr inside vertical-rl rtl - Pixels resolve as-is -PASS horizontal-tb ltr inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "9.79688px" -FAIL horizontal-tb ltr inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "8.79688px" -PASS horizontal-tb ltr inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS horizontal-tb ltr inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS horizontal-tb ltr inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value -PASS horizontal-tb rtl inside horizontal-tb ltr - Pixels resolve as-is -PASS horizontal-tb rtl inside horizontal-tb ltr - Relative lengths are absolutized into pixels -PASS horizontal-tb rtl inside horizontal-tb ltr - Percentages are absolutized into pixels -PASS horizontal-tb rtl inside horizontal-tb ltr - calc() is absolutized into pixels -PASS horizontal-tb rtl inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS horizontal-tb rtl inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS horizontal-tb rtl inside horizontal-tb ltr - If opposite sides are 'auto', they resolve to used value -PASS horizontal-tb rtl inside horizontal-tb rtl - Pixels resolve as-is -PASS horizontal-tb rtl inside horizontal-tb rtl - Relative lengths are absolutized into pixels -PASS horizontal-tb rtl inside horizontal-tb rtl - Percentages are absolutized into pixels -PASS horizontal-tb rtl inside horizontal-tb rtl - calc() is absolutized into pixels -PASS horizontal-tb rtl inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS horizontal-tb rtl inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS horizontal-tb rtl inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value -PASS horizontal-tb rtl inside vertical-lr ltr - Pixels resolve as-is -PASS horizontal-tb rtl inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "9.79688px" -FAIL horizontal-tb rtl inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "8.79688px" -PASS horizontal-tb rtl inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS horizontal-tb rtl inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS horizontal-tb rtl inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value -PASS horizontal-tb rtl inside vertical-lr rtl - Pixels resolve as-is -PASS horizontal-tb rtl inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "9.79688px" -FAIL horizontal-tb rtl inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "8.79688px" -PASS horizontal-tb rtl inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS horizontal-tb rtl inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS horizontal-tb rtl inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value -PASS horizontal-tb rtl inside vertical-rl ltr - Pixels resolve as-is -PASS horizontal-tb rtl inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "9.79688px" -FAIL horizontal-tb rtl inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "8.79688px" -PASS horizontal-tb rtl inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS horizontal-tb rtl inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS horizontal-tb rtl inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value -PASS horizontal-tb rtl inside vertical-rl rtl - Pixels resolve as-is -PASS horizontal-tb rtl inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "9.79688px" -FAIL horizontal-tb rtl inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "8.79688px" -PASS horizontal-tb rtl inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS horizontal-tb rtl inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS horizontal-tb rtl inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value -PASS vertical-lr ltr inside horizontal-tb ltr - Pixels resolve as-is -PASS vertical-lr ltr inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20.1875px" -FAIL vertical-lr ltr inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19.1875px" -PASS vertical-lr ltr inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-lr ltr inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-lr ltr inside horizontal-tb ltr - If opposite sides are 'auto', they resolve to used value -PASS vertical-lr ltr inside horizontal-tb rtl - Pixels resolve as-is -PASS vertical-lr ltr inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20.1875px" -FAIL vertical-lr ltr inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19.1875px" -PASS vertical-lr ltr inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-lr ltr inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-lr ltr inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value -PASS vertical-lr ltr inside vertical-lr ltr - Pixels resolve as-is -PASS vertical-lr ltr inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-lr ltr inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-lr ltr inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-lr ltr inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-lr ltr inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value -PASS vertical-lr ltr inside vertical-lr rtl - Pixels resolve as-is -PASS vertical-lr ltr inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-lr ltr inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-lr ltr inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-lr ltr inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-lr ltr inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value -PASS vertical-lr ltr inside vertical-rl ltr - Pixels resolve as-is -PASS vertical-lr ltr inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-lr ltr inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-lr ltr inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-lr ltr inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-lr ltr inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value -PASS vertical-lr ltr inside vertical-rl rtl - Pixels resolve as-is -PASS vertical-lr ltr inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-lr ltr inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-lr ltr inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-lr ltr inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-lr ltr inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value -PASS vertical-lr rtl inside horizontal-tb ltr - Pixels resolve as-is -PASS vertical-lr rtl inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20.1875px" -FAIL vertical-lr rtl inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19.1875px" -PASS vertical-lr rtl inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-lr rtl inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-lr rtl inside horizontal-tb ltr - If opposite sides are 'auto', they resolve to used value -PASS vertical-lr rtl inside horizontal-tb rtl - Pixels resolve as-is -PASS vertical-lr rtl inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20.1875px" -FAIL vertical-lr rtl inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19.1875px" -PASS vertical-lr rtl inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-lr rtl inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-lr rtl inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value -PASS vertical-lr rtl inside vertical-lr ltr - Pixels resolve as-is -PASS vertical-lr rtl inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-lr rtl inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-lr rtl inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-lr rtl inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-lr rtl inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value -PASS vertical-lr rtl inside vertical-lr rtl - Pixels resolve as-is -PASS vertical-lr rtl inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-lr rtl inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-lr rtl inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-lr rtl inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-lr rtl inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value -PASS vertical-lr rtl inside vertical-rl ltr - Pixels resolve as-is -PASS vertical-lr rtl inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-lr rtl inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-lr rtl inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-lr rtl inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-lr rtl inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value -PASS vertical-lr rtl inside vertical-rl rtl - Pixels resolve as-is -PASS vertical-lr rtl inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-lr rtl inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-lr rtl inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-lr rtl inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-lr rtl inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value -PASS vertical-rl ltr inside horizontal-tb ltr - Pixels resolve as-is -PASS vertical-rl ltr inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20.1875px" -FAIL vertical-rl ltr inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19.1875px" -PASS vertical-rl ltr inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-rl ltr inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-rl ltr inside horizontal-tb ltr - If opposite sides are 'auto', they resolve to used value -PASS vertical-rl ltr inside horizontal-tb rtl - Pixels resolve as-is -PASS vertical-rl ltr inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20.1875px" -FAIL vertical-rl ltr inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19.1875px" -PASS vertical-rl ltr inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-rl ltr inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-rl ltr inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value -PASS vertical-rl ltr inside vertical-lr ltr - Pixels resolve as-is -PASS vertical-rl ltr inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-rl ltr inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-rl ltr inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-rl ltr inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-rl ltr inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value -PASS vertical-rl ltr inside vertical-lr rtl - Pixels resolve as-is -PASS vertical-rl ltr inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-rl ltr inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-rl ltr inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-rl ltr inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-rl ltr inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value -PASS vertical-rl ltr inside vertical-rl ltr - Pixels resolve as-is -PASS vertical-rl ltr inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-rl ltr inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-rl ltr inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-rl ltr inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-rl ltr inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value -PASS vertical-rl ltr inside vertical-rl rtl - Pixels resolve as-is -PASS vertical-rl ltr inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-rl ltr inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-rl ltr inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-rl ltr inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-rl ltr inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value -PASS vertical-rl rtl inside horizontal-tb ltr - Pixels resolve as-is -PASS vertical-rl rtl inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20.1875px" -FAIL vertical-rl rtl inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19.1875px" -PASS vertical-rl rtl inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-rl rtl inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-rl rtl inside horizontal-tb ltr - If opposite sides are 'auto', they resolve to used value -PASS vertical-rl rtl inside horizontal-tb rtl - Pixels resolve as-is -PASS vertical-rl rtl inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20.1875px" -FAIL vertical-rl rtl inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19.1875px" -PASS vertical-rl rtl inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-rl rtl inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-rl rtl inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value -PASS vertical-rl rtl inside vertical-lr ltr - Pixels resolve as-is -PASS vertical-rl rtl inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-rl rtl inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-rl rtl inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-rl rtl inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-rl rtl inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value -PASS vertical-rl rtl inside vertical-lr rtl - Pixels resolve as-is -PASS vertical-rl rtl inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-rl rtl inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-rl rtl inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-rl rtl inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-rl rtl inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value -PASS vertical-rl rtl inside vertical-rl ltr - Pixels resolve as-is -PASS vertical-rl rtl inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-rl rtl inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-rl rtl inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-rl rtl inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-rl rtl inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value -PASS vertical-rl rtl inside vertical-rl rtl - Pixels resolve as-is -PASS vertical-rl rtl inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-rl rtl inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-rl rtl inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value -PASS vertical-rl rtl inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value -PASS vertical-rl rtl inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/getComputedStyle-insets-sticky-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/getComputedStyle-insets-sticky-expected.txt deleted file mode 100644 index e78c82b..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/getComputedStyle-insets-sticky-expected.txt +++ /dev/null
@@ -1,256 +0,0 @@ -This is a testharness.js-based test. -Found 252 tests; 188 PASS, 64 FAIL, 0 TIMEOUT, 0 NOTRUN. -PASS horizontal-tb ltr inside horizontal-tb ltr - Pixels resolve as-is -PASS horizontal-tb ltr inside horizontal-tb ltr - Relative lengths are absolutized into pixels -PASS horizontal-tb ltr inside horizontal-tb ltr - Percentages are absolutized into pixels -PASS horizontal-tb ltr inside horizontal-tb ltr - calc() is absolutized into pixels -PASS horizontal-tb ltr inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS horizontal-tb ltr inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS horizontal-tb ltr inside horizontal-tb ltr - If opposite sides are 'auto', they resolve as-is -PASS horizontal-tb ltr inside horizontal-tb rtl - Pixels resolve as-is -PASS horizontal-tb ltr inside horizontal-tb rtl - Relative lengths are absolutized into pixels -PASS horizontal-tb ltr inside horizontal-tb rtl - Percentages are absolutized into pixels -PASS horizontal-tb ltr inside horizontal-tb rtl - calc() is absolutized into pixels -PASS horizontal-tb ltr inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS horizontal-tb ltr inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS horizontal-tb ltr inside horizontal-tb rtl - If opposite sides are 'auto', they resolve as-is -PASS horizontal-tb ltr inside vertical-lr ltr - Pixels resolve as-is -PASS horizontal-tb ltr inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "9.79688px" -FAIL horizontal-tb ltr inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "8.79688px" -PASS horizontal-tb ltr inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS horizontal-tb ltr inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS horizontal-tb ltr inside vertical-lr ltr - If opposite sides are 'auto', they resolve as-is -PASS horizontal-tb ltr inside vertical-lr rtl - Pixels resolve as-is -PASS horizontal-tb ltr inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "9.79688px" -FAIL horizontal-tb ltr inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "8.79688px" -PASS horizontal-tb ltr inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS horizontal-tb ltr inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS horizontal-tb ltr inside vertical-lr rtl - If opposite sides are 'auto', they resolve as-is -PASS horizontal-tb ltr inside vertical-rl ltr - Pixels resolve as-is -PASS horizontal-tb ltr inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "9.79688px" -FAIL horizontal-tb ltr inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "8.79688px" -PASS horizontal-tb ltr inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS horizontal-tb ltr inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS horizontal-tb ltr inside vertical-rl ltr - If opposite sides are 'auto', they resolve as-is -PASS horizontal-tb ltr inside vertical-rl rtl - Pixels resolve as-is -PASS horizontal-tb ltr inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "9.79688px" -FAIL horizontal-tb ltr inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "8.79688px" -PASS horizontal-tb ltr inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS horizontal-tb ltr inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS horizontal-tb ltr inside vertical-rl rtl - If opposite sides are 'auto', they resolve as-is -PASS horizontal-tb rtl inside horizontal-tb ltr - Pixels resolve as-is -PASS horizontal-tb rtl inside horizontal-tb ltr - Relative lengths are absolutized into pixels -PASS horizontal-tb rtl inside horizontal-tb ltr - Percentages are absolutized into pixels -PASS horizontal-tb rtl inside horizontal-tb ltr - calc() is absolutized into pixels -PASS horizontal-tb rtl inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS horizontal-tb rtl inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS horizontal-tb rtl inside horizontal-tb ltr - If opposite sides are 'auto', they resolve as-is -PASS horizontal-tb rtl inside horizontal-tb rtl - Pixels resolve as-is -PASS horizontal-tb rtl inside horizontal-tb rtl - Relative lengths are absolutized into pixels -PASS horizontal-tb rtl inside horizontal-tb rtl - Percentages are absolutized into pixels -PASS horizontal-tb rtl inside horizontal-tb rtl - calc() is absolutized into pixels -PASS horizontal-tb rtl inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS horizontal-tb rtl inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS horizontal-tb rtl inside horizontal-tb rtl - If opposite sides are 'auto', they resolve as-is -PASS horizontal-tb rtl inside vertical-lr ltr - Pixels resolve as-is -PASS horizontal-tb rtl inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "9.79688px" -FAIL horizontal-tb rtl inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "8.79688px" -PASS horizontal-tb rtl inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS horizontal-tb rtl inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS horizontal-tb rtl inside vertical-lr ltr - If opposite sides are 'auto', they resolve as-is -PASS horizontal-tb rtl inside vertical-lr rtl - Pixels resolve as-is -PASS horizontal-tb rtl inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "9.79688px" -FAIL horizontal-tb rtl inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "8.79688px" -PASS horizontal-tb rtl inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS horizontal-tb rtl inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS horizontal-tb rtl inside vertical-lr rtl - If opposite sides are 'auto', they resolve as-is -PASS horizontal-tb rtl inside vertical-rl ltr - Pixels resolve as-is -PASS horizontal-tb rtl inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "9.79688px" -FAIL horizontal-tb rtl inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "8.79688px" -PASS horizontal-tb rtl inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS horizontal-tb rtl inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS horizontal-tb rtl inside vertical-rl ltr - If opposite sides are 'auto', they resolve as-is -PASS horizontal-tb rtl inside vertical-rl rtl - Pixels resolve as-is -PASS horizontal-tb rtl inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "9.79688px" -FAIL horizontal-tb rtl inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "8.79688px" -PASS horizontal-tb rtl inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS horizontal-tb rtl inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS horizontal-tb rtl inside vertical-rl rtl - If opposite sides are 'auto', they resolve as-is -PASS vertical-lr ltr inside horizontal-tb ltr - Pixels resolve as-is -PASS vertical-lr ltr inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20.1875px" -FAIL vertical-lr ltr inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19.1875px" -PASS vertical-lr ltr inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-lr ltr inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-lr ltr inside horizontal-tb ltr - If opposite sides are 'auto', they resolve as-is -PASS vertical-lr ltr inside horizontal-tb rtl - Pixels resolve as-is -PASS vertical-lr ltr inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20.1875px" -FAIL vertical-lr ltr inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19.1875px" -PASS vertical-lr ltr inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-lr ltr inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-lr ltr inside horizontal-tb rtl - If opposite sides are 'auto', they resolve as-is -PASS vertical-lr ltr inside vertical-lr ltr - Pixels resolve as-is -PASS vertical-lr ltr inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-lr ltr inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-lr ltr inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-lr ltr inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-lr ltr inside vertical-lr ltr - If opposite sides are 'auto', they resolve as-is -PASS vertical-lr ltr inside vertical-lr rtl - Pixels resolve as-is -PASS vertical-lr ltr inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-lr ltr inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-lr ltr inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-lr ltr inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-lr ltr inside vertical-lr rtl - If opposite sides are 'auto', they resolve as-is -PASS vertical-lr ltr inside vertical-rl ltr - Pixels resolve as-is -PASS vertical-lr ltr inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-lr ltr inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-lr ltr inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-lr ltr inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-lr ltr inside vertical-rl ltr - If opposite sides are 'auto', they resolve as-is -PASS vertical-lr ltr inside vertical-rl rtl - Pixels resolve as-is -PASS vertical-lr ltr inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-lr ltr inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-lr ltr inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-lr ltr inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-lr ltr inside vertical-rl rtl - If opposite sides are 'auto', they resolve as-is -PASS vertical-lr rtl inside horizontal-tb ltr - Pixels resolve as-is -PASS vertical-lr rtl inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20.1875px" -FAIL vertical-lr rtl inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19.1875px" -PASS vertical-lr rtl inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-lr rtl inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-lr rtl inside horizontal-tb ltr - If opposite sides are 'auto', they resolve as-is -PASS vertical-lr rtl inside horizontal-tb rtl - Pixels resolve as-is -PASS vertical-lr rtl inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20.1875px" -FAIL vertical-lr rtl inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19.1875px" -PASS vertical-lr rtl inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-lr rtl inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-lr rtl inside horizontal-tb rtl - If opposite sides are 'auto', they resolve as-is -PASS vertical-lr rtl inside vertical-lr ltr - Pixels resolve as-is -PASS vertical-lr rtl inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-lr rtl inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-lr rtl inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-lr rtl inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-lr rtl inside vertical-lr ltr - If opposite sides are 'auto', they resolve as-is -PASS vertical-lr rtl inside vertical-lr rtl - Pixels resolve as-is -PASS vertical-lr rtl inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-lr rtl inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-lr rtl inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-lr rtl inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-lr rtl inside vertical-lr rtl - If opposite sides are 'auto', they resolve as-is -PASS vertical-lr rtl inside vertical-rl ltr - Pixels resolve as-is -PASS vertical-lr rtl inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-lr rtl inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-lr rtl inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-lr rtl inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-lr rtl inside vertical-rl ltr - If opposite sides are 'auto', they resolve as-is -PASS vertical-lr rtl inside vertical-rl rtl - Pixels resolve as-is -PASS vertical-lr rtl inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-lr rtl inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-lr rtl inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-lr rtl inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-lr rtl inside vertical-rl rtl - If opposite sides are 'auto', they resolve as-is -PASS vertical-rl ltr inside horizontal-tb ltr - Pixels resolve as-is -PASS vertical-rl ltr inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20.1875px" -FAIL vertical-rl ltr inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19.1875px" -PASS vertical-rl ltr inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-rl ltr inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-rl ltr inside horizontal-tb ltr - If opposite sides are 'auto', they resolve as-is -PASS vertical-rl ltr inside horizontal-tb rtl - Pixels resolve as-is -PASS vertical-rl ltr inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20.1875px" -FAIL vertical-rl ltr inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19.1875px" -PASS vertical-rl ltr inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-rl ltr inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-rl ltr inside horizontal-tb rtl - If opposite sides are 'auto', they resolve as-is -PASS vertical-rl ltr inside vertical-lr ltr - Pixels resolve as-is -PASS vertical-rl ltr inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-rl ltr inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-rl ltr inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-rl ltr inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-rl ltr inside vertical-lr ltr - If opposite sides are 'auto', they resolve as-is -PASS vertical-rl ltr inside vertical-lr rtl - Pixels resolve as-is -PASS vertical-rl ltr inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-rl ltr inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-rl ltr inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-rl ltr inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-rl ltr inside vertical-lr rtl - If opposite sides are 'auto', they resolve as-is -PASS vertical-rl ltr inside vertical-rl ltr - Pixels resolve as-is -PASS vertical-rl ltr inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-rl ltr inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-rl ltr inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-rl ltr inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-rl ltr inside vertical-rl ltr - If opposite sides are 'auto', they resolve as-is -PASS vertical-rl ltr inside vertical-rl rtl - Pixels resolve as-is -PASS vertical-rl ltr inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-rl ltr inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-rl ltr inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-rl ltr inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-rl ltr inside vertical-rl rtl - If opposite sides are 'auto', they resolve as-is -PASS vertical-rl rtl inside horizontal-tb ltr - Pixels resolve as-is -PASS vertical-rl rtl inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20.1875px" -FAIL vertical-rl rtl inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19.1875px" -PASS vertical-rl rtl inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-rl rtl inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-rl rtl inside horizontal-tb ltr - If opposite sides are 'auto', they resolve as-is -PASS vertical-rl rtl inside horizontal-tb rtl - Pixels resolve as-is -PASS vertical-rl rtl inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20.1875px" -FAIL vertical-rl rtl inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19.1875px" -PASS vertical-rl rtl inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-rl rtl inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-rl rtl inside horizontal-tb rtl - If opposite sides are 'auto', they resolve as-is -PASS vertical-rl rtl inside vertical-lr ltr - Pixels resolve as-is -PASS vertical-rl rtl inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-rl rtl inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-rl rtl inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-rl rtl inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-rl rtl inside vertical-lr ltr - If opposite sides are 'auto', they resolve as-is -PASS vertical-rl rtl inside vertical-lr rtl - Pixels resolve as-is -PASS vertical-rl rtl inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-rl rtl inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-rl rtl inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-rl rtl inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-rl rtl inside vertical-lr rtl - If opposite sides are 'auto', they resolve as-is -PASS vertical-rl rtl inside vertical-rl ltr - Pixels resolve as-is -PASS vertical-rl rtl inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-rl rtl inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-rl rtl inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-rl rtl inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-rl rtl inside vertical-rl ltr - If opposite sides are 'auto', they resolve as-is -PASS vertical-rl rtl inside vertical-rl rtl - Pixels resolve as-is -PASS vertical-rl rtl inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "10px" but got "20px" -FAIL vertical-rl rtl inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "9px" but got "19px" -PASS vertical-rl rtl inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves as-is -PASS vertical-rl rtl inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves as-is -PASS vertical-rl rtl inside vertical-rl rtl - If opposite sides are 'auto', they resolve as-is -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-form-element/form-autocomplete-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-form-element/form-autocomplete-expected.txt deleted file mode 100644 index 9d2f8769..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-form-element/form-autocomplete-expected.txt +++ /dev/null
@@ -1,63 +0,0 @@ -This is a testharness.js-based test. -Found 59 tests; 0 PASS, 59 FAIL, 0 TIMEOUT, 0 NOTRUN. -FAIL form autocomplete attribute missing assert_equals: expected "on" but got "" -FAIL form autocomplete attribute on assert_equals: expected "on" but got "" -FAIL form autocomplete attribute off assert_equals: expected "off" but got "" -FAIL form autocomplete attribute invalid assert_equals: expected "on" but got "" -FAIL on is an allowed autocomplete field name assert_equals: expected "on" but got " ON\t" -FAIL off is an allowed autocomplete field name assert_equals: expected "off" but got " OFF\t" -FAIL name is an allowed autocomplete field name assert_equals: expected "name" but got " NAME\t" -FAIL honorific-prefix is an allowed autocomplete field name assert_equals: expected "honorific-prefix" but got " HONORIFIC-PREFIX\t" -FAIL given-name is an allowed autocomplete field name assert_equals: expected "given-name" but got " GIVEN-NAME\t" -FAIL additional-name is an allowed autocomplete field name assert_equals: expected "additional-name" but got " ADDITIONAL-NAME\t" -FAIL family-name is an allowed autocomplete field name assert_equals: expected "family-name" but got " FAMILY-NAME\t" -FAIL honorific-suffix is an allowed autocomplete field name assert_equals: expected "honorific-suffix" but got " HONORIFIC-SUFFIX\t" -FAIL nickname is an allowed autocomplete field name assert_equals: expected "nickname" but got " NICKNAME\t" -FAIL username is an allowed autocomplete field name assert_equals: expected "username" but got " USERNAME\t" -FAIL new-password is an allowed autocomplete field name assert_equals: expected "new-password" but got " NEW-PASSWORD\t" -FAIL current-password is an allowed autocomplete field name assert_equals: expected "current-password" but got " CURRENT-PASSWORD\t" -FAIL organization-title is an allowed autocomplete field name assert_equals: expected "organization-title" but got " ORGANIZATION-TITLE\t" -FAIL organization is an allowed autocomplete field name assert_equals: expected "organization" but got " ORGANIZATION\t" -FAIL street-address is an allowed autocomplete field name assert_equals: expected "street-address" but got " STREET-ADDRESS\t" -FAIL address-line1 is an allowed autocomplete field name assert_equals: expected "address-line1" but got " ADDRESS-LINE1\t" -FAIL address-line2 is an allowed autocomplete field name assert_equals: expected "address-line2" but got " ADDRESS-LINE2\t" -FAIL address-line3 is an allowed autocomplete field name assert_equals: expected "address-line3" but got " ADDRESS-LINE3\t" -FAIL address-level4 is an allowed autocomplete field name assert_equals: expected "address-level4" but got " ADDRESS-LEVEL4\t" -FAIL address-level3 is an allowed autocomplete field name assert_equals: expected "address-level3" but got " ADDRESS-LEVEL3\t" -FAIL address-level2 is an allowed autocomplete field name assert_equals: expected "address-level2" but got " ADDRESS-LEVEL2\t" -FAIL address-level1 is an allowed autocomplete field name assert_equals: expected "address-level1" but got " ADDRESS-LEVEL1\t" -FAIL country is an allowed autocomplete field name assert_equals: expected "country" but got " COUNTRY\t" -FAIL country-name is an allowed autocomplete field name assert_equals: expected "country-name" but got " COUNTRY-NAME\t" -FAIL postal-code is an allowed autocomplete field name assert_equals: expected "postal-code" but got " POSTAL-CODE\t" -FAIL cc-name is an allowed autocomplete field name assert_equals: expected "cc-name" but got " CC-NAME\t" -FAIL cc-given-name is an allowed autocomplete field name assert_equals: expected "cc-given-name" but got " CC-GIVEN-NAME\t" -FAIL cc-additional-name is an allowed autocomplete field name assert_equals: expected "cc-additional-name" but got " CC-ADDITIONAL-NAME\t" -FAIL cc-family-name is an allowed autocomplete field name assert_equals: expected "cc-family-name" but got " CC-FAMILY-NAME\t" -FAIL cc-number is an allowed autocomplete field name assert_equals: expected "cc-number" but got " CC-NUMBER\t" -FAIL cc-exp is an allowed autocomplete field name assert_equals: expected "cc-exp" but got " CC-EXP\t" -FAIL cc-exp-month is an allowed autocomplete field name assert_equals: expected "cc-exp-month" but got " CC-EXP-MONTH\t" -FAIL cc-exp-year is an allowed autocomplete field name assert_equals: expected "cc-exp-year" but got " CC-EXP-YEAR\t" -FAIL cc-csc is an allowed autocomplete field name assert_equals: expected "cc-csc" but got " CC-CSC\t" -FAIL cc-type is an allowed autocomplete field name assert_equals: expected "cc-type" but got " CC-TYPE\t" -FAIL transaction-currency is an allowed autocomplete field name assert_equals: expected "transaction-currency" but got " TRANSACTION-CURRENCY\t" -FAIL transaction-amount is an allowed autocomplete field name assert_equals: expected "transaction-amount" but got " TRANSACTION-AMOUNT\t" -FAIL language is an allowed autocomplete field name assert_equals: expected "language" but got " LANGUAGE\t" -FAIL bday is an allowed autocomplete field name assert_equals: expected "bday" but got " BDAY\t" -FAIL bday-day is an allowed autocomplete field name assert_equals: expected "bday-day" but got " BDAY-DAY\t" -FAIL bday-month is an allowed autocomplete field name assert_equals: expected "bday-month" but got " BDAY-MONTH\t" -FAIL bday-year is an allowed autocomplete field name assert_equals: expected "bday-year" but got " BDAY-YEAR\t" -FAIL sex is an allowed autocomplete field name assert_equals: expected "sex" but got " SEX\t" -FAIL url is an allowed autocomplete field name assert_equals: expected "url" but got " URL\t" -FAIL photo is an allowed autocomplete field name assert_equals: expected "photo" but got " PHOTO\t" -FAIL tel is an allowed autocomplete field name assert_equals: expected "tel" but got " TEL\t" -FAIL tel-country-code is an allowed autocomplete field name assert_equals: expected "tel-country-code" but got " TEL-COUNTRY-CODE\t" -FAIL tel-national is an allowed autocomplete field name assert_equals: expected "tel-national" but got " TEL-NATIONAL\t" -FAIL tel-area-code is an allowed autocomplete field name assert_equals: expected "tel-area-code" but got " TEL-AREA-CODE\t" -FAIL tel-local is an allowed autocomplete field name assert_equals: expected "tel-local" but got " TEL-LOCAL\t" -FAIL tel-local-prefix is an allowed autocomplete field name assert_equals: expected "tel-local-prefix" but got " TEL-LOCAL-PREFIX\t" -FAIL tel-local-suffix is an allowed autocomplete field name assert_equals: expected "tel-local-suffix" but got " TEL-LOCAL-SUFFIX\t" -FAIL tel-extension is an allowed autocomplete field name assert_equals: expected "tel-extension" but got " TEL-EXTENSION\t" -FAIL email is an allowed autocomplete field name assert_equals: expected "email" but got " EMAIL\t" -FAIL impp is an allowed autocomplete field name assert_equals: expected "impp" but got " IMPP\t" -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-form-element/form-autocomplete.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-form-element/form-autocomplete.html index 5c1d05b..618aa0a 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-form-element/form-autocomplete.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-form-element/form-autocomplete.html
@@ -42,10 +42,10 @@ }, desc); } - autocompletetest(document.forms.missing_attribute, ["on", "on", "on", "off", ""], "form autocomplete attribute missing"); - autocompletetest(document.forms.autocomplete_on, ["on", "on", "on", "off", ""], "form autocomplete attribute on"); - autocompletetest(document.forms.autocomplete_off, ["off", "off", "on", "off", ""], "form autocomplete attribute off"); - autocompletetest(document.forms.autocomplete_invalid, ["on", "on", "on", "off", ""], "form autocomplete attribute invalid"); + autocompletetest(document.forms.missing_attribute, ["on", "", "on", "off", ""], "form autocomplete attribute missing"); + autocompletetest(document.forms.autocomplete_on, ["on", "", "on", "off", ""], "form autocomplete attribute on"); + autocompletetest(document.forms.autocomplete_off, ["off", "", "on", "off", ""], "form autocomplete attribute off"); + autocompletetest(document.forms.autocomplete_invalid, ["on", "", "on", "off", ""], "form autocomplete attribute invalid"); var keywords = [ "on", "off", "name", "honorific-prefix", "given-name", "additional-name", "family-name", "honorific-suffix", "nickname", "username", "new-password", "current-password", "organization-title", "organization", "street-address", "address-line1", "address-line2", "address-line3", "address-level4", "address-level3", "address-level2", "address-level1", "country", "country-name", "postal-code", "cc-name", "cc-given-name", "cc-additional-name", "cc-family-name", "cc-number", "cc-exp", "cc-exp-month", "cc-exp-year", "cc-csc", "cc-type", "transaction-currency", "transaction-amount", "language", "bday", "bday-day", "bday-month", "bday-year", "sex", "url", "photo", "tel", "tel-country-code", "tel-national", "tel-area-code", "tel-local", "tel-local-prefix", "tel-local-suffix", "tel-extension", "email", "impp" ]; @@ -58,4 +58,59 @@ assert_equals(input.autocomplete, keyword); }, keyword + " is an allowed autocomplete field name"); }); + + +test(() => { + const select = document.createElement("select"); + select.setAttribute("autocomplete", " \n"); + assert_equals(select.autocomplete, ""); +}, "Test whitespace-only attribute value"); + +test(() => { + const select = document.createElement("select"); + + select.setAttribute("autocomplete", "foo off"); + assert_equals(select.autocomplete, ""); + + // Normal category; max=3 + select.setAttribute("autocomplete", "foo section-foo billing name"); + assert_equals(select.autocomplete, ""); + + // Contact category; max=4 + select.setAttribute("autocomplete", "foo section-bar billing work name"); + assert_equals(select.autocomplete, ""); +}, "Test maximum number of tokens"); + +test(() => { + const textarea = document.createElement("textarea"); + + textarea.setAttribute("autocomplete", "call-sign"); + assert_equals(textarea.autocomplete, ""); +}, "Unknown field"); + +test(() => { + const hidden = document.createElement("input"); + hidden.type = "hidden"; + hidden.setAttribute("autocomplete", "on"); + assert_equals(hidden.autocomplete, ""); + hidden.setAttribute("autocomplete", "off"); + assert_equals(hidden.autocomplete, ""); +}, "Test 'wearing the autofill anchor mantle' with off/on"); + +test(() => { + const textarea = document.createElement("textarea"); + + textarea.setAttribute("autocomplete", " HOME\ntel"); + assert_equals(textarea.autocomplete, "home tel"); + + textarea.setAttribute("autocomplete", "shipping country"); + assert_equals(textarea.autocomplete, "shipping country"); + + textarea.setAttribute("autocomplete", "billing work email"); + assert_equals(textarea.autocomplete, "billing work email"); + + textarea.setAttribute("autocomplete", " section-FOO bday"); + assert_equals(textarea.autocomplete, "section-foo bday"); +}, "Serialize combinations of section, mode, contact, and field"); + </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-redirect.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-redirect.https-expected.txt index 28a5b78..10b1fd1 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-redirect.https-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-redirect.https-expected.txt
@@ -11,7 +11,6 @@ PASS SW-fallbacked redirect to same-origin other-scope. PASS SW-fallbacked redirect to other-origin out-scope. PASS SW-fallbacked redirect to other-origin in-scope. -PASS SW-fallbacked redirect to other-origin and back to same-origin. PASS SW-generated redirect to same-origin out-scope. FAIL SW-generated redirect to same-origin out-scope with a hash fragment. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F#ref"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F"] FAIL SW-generated redirect to same-origin out-scope with different hash fragments. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F%23ref2#ref"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F%23ref2"]
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-redirect.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-redirect.https.html index edd3712..0490f2b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-redirect.https.html +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-redirect.https.html
@@ -1,11 +1,6 @@ <!DOCTYPE html> <title>Service Worker: Navigation redirection</title> <meta name="timeout" content="long"> -<!-- empty variant tests document.location and intercepted URLs --> -<meta name="variant" content=""> -<!-- client variant tests the Clients API (resultingClientId and Client.url) --> -<meta name="variant" content="?client"> - <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/common/get-host-info.sub.js"></script> @@ -81,215 +76,38 @@ assert_object_equals(urls, expected_urls, 'Intercepted URLs should match.'); } -// Checks |clients| returned from a worker. Only the client matching -// |expected_final_client_tag| should be found. Returns true if a client was -// found. Note that the final client is not necessarily found by this worker, -// if the client is cross-origin. -// -// |clients| is an object like: -// {x: {found: true, id: id1, url: url1}, b: {found: false}} -function check_clients(clients, - expected_id, - expected_url, - expected_final_client_tag, - worker_name) { - let found = false; - Object.keys(clients).forEach(key => { - const info = clients[key]; - if (info.found) { - assert_true(expected_final_client_tag, - `${worker_name} client tag exists`); - assert_equals(key, expected_final_client_tag, - `${worker_name} client tag matches`); - assert_equals(info.id, expected_id, `${worker_name} client id`); - assert_equals(info.url, expected_url, `${worker_name} client url`); - found = true; - } - }); - return found; -} - -function check_resulting_client_ids(infos, expected_infos, actual_ids, worker) { - assert_equals(infos.length, expected_infos.length, - `request length for ${worker}`); - for (var i = 0; i < infos.length; i++) { - const tag = expected_infos[i].resultingClientIdTag; - const url = expected_infos[i].url; - const actual_id = infos[i].resultingClientId; - const expected_id = actual_ids[tag]; - assert_equals(typeof(actual_id), 'string', - `resultingClientId for ${url} request to ${worker}`); - if (expected_id) { - assert_equals(requestInfos[0], expected_id, - `resultingClientId for ${url} request to ${worker}`); - } else { - actual_ids[key] = actual_id; - } - } -} - // Creates an iframe and navigates to |url|, which is expected to start a chain // of redirects. // - |expected_last_url| is the expected window.location after the // navigation. -// // - |expected_request_infos| is the expected requests that the service workers // were dispatched fetch events for. The format is: // [ -// [ -// // Requests received by workers[0]. -// {url: url1, resultingClientIdTag: 'a'}, -// {url: url2, resultingClientIdTag: 'a'} -// ], -// [ -// // Requests received by workers[1]. -// {url: url3, resultingClientIdTag: 'a'} -// ], -// [ -// // Requests received by the cross-origin worker. -// {url: url4, resultingClientIdTag: 'x'} -// {url: url5, resultingClientIdTag: 'x'} -// ] +// [{url: url1}, {url: url2}], // requests from workers[0], +// [{url: url1}, // requests from workers[1], +// [{url: url1}, {url: url2}] // requests from cross-origin worker // ] -// Here, |url| is |event.request.url| and |resultingClientIdTag| represents -// |event.resultingClientId|. Since the actual client ids are not known -// beforehand, the expectation isn't the literal expected value, but all equal -// tags must map to the same actual id. -// -// - |expected_final_client_tag| is the resultingClientIdTag that is -// expected to map to the created client's id. This is null if there -// is no such tag, which can happen when the final request was a cross-origin -// redirect to out-scope, so no worker received a fetch event whose -// resultingClientId is the id of the resulting client. -// -// In the example above: -// - workers[0] receives two requests with the same resultingClientId. -// - workers[1] receives one request also with that resultingClientId. -// - The cross-origin worker receives two requests with the same -// resultingClientId which differs from the previous one. -// - Assuming |expected_final_client_tag| is 'x', then the created -// client has the id seen by the cross-origin worker above. function redirect_test(url, expected_last_url, expected_request_infos, - expected_final_client_tag, test_name) { promise_test(async t => { + const message_promise = new Promise(resolve => { + // A message with ID 'last_url' will be sent from the iframe. + message_resolvers['last_url'] = resolve; + }); const frame = await with_iframe(url); t.add_cleanup(() => { frame.remove(); }); - // Switch on variant. - if (document.location.search == '?client') { - return client_variant_test(url, expected_last_url, expected_request_infos, - expected_final_client_tag, test_name); - } - - return default_variant_test(url, expected_last_url, expected_request_infos, - expected_final_client_tag, test_name); - }, test_name); -} - -// The default variant tests the request interception chain and -// resulting document.location. -async function default_variant_test(url, - expected_last_url, - expected_request_infos, - expected_final_client_tag, - test_name) { - const message_promise = new Promise(resolve => { - // A message with ID 'last_url' will be sent from the iframe. - message_resolvers['last_url'] = resolve; - }); - - const expected_intercepted_urls = expected_request_infos.map( - requests_for_worker => { - return requests_for_worker.map(info => { - return info.url; + const expected_intercepted_urls = expected_request_infos.map(requests => { + return requests.map(info => { + return info.url; + }); }); - }); - await check_all_intercepted_urls(expected_intercepted_urls); - const last_url = await message_promise; - assert_equals(last_url, expected_last_url, 'Last URL should match.'); -} - -// The "client" variant tests the Clients API using resultingClientId. -async function client_variant_test(url, - expected_last_url, - expected_request_infos, - expected_final_client_tag, - test_name) { - // A message with ID 'last_url' will be sent from the iframe, but this - // variant doesn't use it. Just define a resolver so it doesn't crash. - message_resolvers['last_url'] = () => {}; - - // Request infos is an array like: - // [ - // [{url: url1, resultingClientIdTag: tag1}], - // [{url: url2, resultingClientIdTag: tag2}], - // [{url: url3: resultingClientIdTag: tag3}] - // ] - const requestInfos = await get_all_request_infos(); - - // We check the actual infos against the expected ones, and learn the - // actual ids as we go. - const actual_ids = {}; - check_resulting_client_ids(requestInfos[0], - expected_request_infos[0], - actual_ids, - 'worker0'); - check_resulting_client_ids(requestInfos[1], - expected_request_infos[1], - actual_ids, - 'worker1'); - check_resulting_client_ids(requestInfos[2], - expected_request_infos[2], - actual_ids, - 'crossOriginWorker'); - - // Now |actual_ids| maps tag to actual id: - // {x: id1, b: id2, c: id3} - // Ask each worker to try to resolve the actual ids to clients. - // Only |expected_final_client_tag| should resolve to a client. - const client_infos = await get_all_clients(actual_ids); - - // Client infos is an object like: - // { - // worker0: {x: {found: true, id: id1, url: url1}, b: {found: false}}, - // worker1: {x: {found: true, id: id1, url: url1}}, - // crossOriginWorker: {x: {found: false}}, {b: {found: false}} - // } - // - // Now check each client info. check_clients() verifies each info: only - // |expected_final_client_tag| should ever be found and the found client - // should have the expected url and id. A wrinkle is that not all workers - // will find the client, if they are cross-origin to the client. This - // means check_clients() trivially passes if no clients are found. So - // additionally check that at least one worker found the client (|found|), - // if that was expected (|expect_found|). - let found = false; - const expect_found = !!expected_final_client_tag; - const expected_id = actual_ids[expected_final_client_tag]; - found = check_clients(client_infos.worker0, - expected_id, - expected_last_url, - expected_final_client_tag, - 'worker0'); - found = check_clients(client_infos.worker1, - expected_id, - expected_last_url, - expected_final_client_tag, - 'worker1') || found; - found = check_clients(client_infos.crossOriginWorker, - expected_id, - expected_last_url, - expected_final_client_tag, - 'crossOriginWorker') || found; - assert_equals(found, expect_found, 'client found'); - - if (!expect_found) { - // TODO(falken): Ask the other origin frame if it has a client of the - // expected URL. - } + await check_all_intercepted_urls(expected_intercepted_urls); + const last_url = await message_promise; + assert_equals(last_url, expected_last_url, 'Last URL should match.'); + }, test_name); } window.addEventListener('message', on_message, false); @@ -315,27 +133,6 @@ }); } -async function get_all_clients(actual_ids) { - const client_infos = {}; - client_infos['worker0'] = await get_clients(workers[0], actual_ids); - client_infos['worker1'] = await get_clients(workers[1], actual_ids); - client_infos['crossOriginWorker'] = - await send_to_iframe(other_origin_frame, - {command: 'get_clients', actual_ids}); - return client_infos; -} - -function get_clients(worker, actual_ids) { - return new Promise(resolve => { - var channel = new MessageChannel(); - channel.port1.onmessage = (msg) => { - resolve(msg.data.clients); - }; - worker.postMessage({command: 'getClients', actual_ids, port: channel.port2}, - [channel.port2]); - }); -} - // Returns an array of the URLs that |worker| received fetch events for: // [url1, url2] async function get_intercepted_urls(worker) { @@ -345,10 +142,7 @@ // Returns the requests that |worker| received fetch events for. The return // value is an array of format: -// [ -// {url: url1, resultingClientId: id}, -// {url: url2, resultingClientId: id} -// ] +// [{url: url1}, {url: url2}] function get_request_infos(worker) { return new Promise(resolve => { var channel = new MessageChannel(); @@ -360,29 +154,6 @@ }); } -// Returns an array of the requests the workers received fetch events for: -// [ -// // Requests from workers[0]. -// [ -// {url: url1, resultingClientIdTag: tag1}, -// {url: url2, resultingClientIdTag: tag1} -// ], -// -// // Requests from workers[1]. -// [{url: url3, resultingClientIdTag: tag2}], -// -// // Requests from the cross-origin worker. -// [] -// ] -async function get_all_request_infos() { - const request_infos = []; - request_infos.push(await get_request_infos(workers[0])); - request_infos.push(await get_request_infos(workers[1])); - request_infos.push(await send_to_iframe(other_origin_frame, - {command: 'get_request_infos'})); - return request_infos; -} - let url; let url1; let url2; @@ -392,8 +163,7 @@ redirect_test( OUT_SCOPE + 'url=' + encodeURIComponent(url), url, - [[{url, resultingClientIdTag: 'x'}], [], []], - 'x', + [[{url}], [], []], 'Normal redirect to same-origin scope.'); @@ -401,33 +171,30 @@ redirect_test( OUT_SCOPE + 'url=' + encodeURIComponent(SCOPE1) + '#ref', url, - [[{url, resultingClientIdTag: 'x'}], [], []], - 'x', + [[{url}], [], []], 'Normal redirect to same-origin scope with a hash fragment.'); url = SCOPE1 + '#ref2'; redirect_test( OUT_SCOPE + 'url=' + encodeURIComponent(url) + '#ref', url, - [[{url, resultingClientIdTag: 'x'}], [], []], - 'x', + [[{url}], [], []], 'Normal redirect to same-origin scope with different hash fragments.'); url = OTHER_ORIGIN_SCOPE; redirect_test( OUT_SCOPE + 'url=' + encodeURIComponent(url), url, - [[], [], [{url, resultingClientIdTag: 'x'}]], - 'x', + [[], [], [{url}]], 'Normal redirect to other-origin scope.'); + // SW fallbacked redirect. SW doesn't handle the fetch request. url = SCOPE1 + 'url=' + encodeURIComponent(OUT_SCOPE); redirect_test( url, OUT_SCOPE, - [[{url, resultingClientIdTag: 'x'}], [], []], - 'x', + [[{url}], [], []], 'SW-fallbacked redirect to same-origin out-scope.'); url1 = SCOPE1 + 'url=' + encodeURIComponent(SCOPE1); @@ -435,15 +202,7 @@ redirect_test( url1, url2, - [ - [ - {url: url1, resultingClientIdTag: 'x'}, - {url: url2, resultingClientIdTag: 'x'} - ], - [], - [] - ], - 'x', + [[{url: url1}, {url: url2}], [], []], 'SW-fallbacked redirect to same-origin same-scope.'); url1 = SCOPE1 + 'url=' + encodeURIComponent(SCOPE1) + '#ref'; @@ -451,15 +210,7 @@ redirect_test( url1, url2, - [ - [ - {url: url1, resultingClientIdTag: 'x'}, - {url: url2, resultingClientIdTag: 'x'} - ], - [], - [] - ], - 'x', + [[{url: url1}, {url: url2}], [], []], 'SW-fallbacked redirect to same-origin same-scope with a hash fragment.'); url1 = SCOPE1 + 'url=' + encodeURIComponent(SCOPE1 + '#ref2') + '#ref'; @@ -467,15 +218,7 @@ redirect_test( url1, url2, - [ - [ - {url: url1, resultingClientIdTag: 'x'}, - {url: url2, resultingClientIdTag: 'x'} - ], - [], - [] - ], - 'x', + [[{url: url1}, {url: url2}], [], []], 'SW-fallbacked redirect to same-origin same-scope with different hash ' + 'fragments.'); @@ -484,12 +227,7 @@ redirect_test( url1, url2, - [ - [{url: url1, resultingClientIdTag: 'x'}], - [{url: url2, resultingClientIdTag: 'x'}], - [] - ], - 'x', + [[{url: url1}], [{url: url2}], []], 'SW-fallbacked redirect to same-origin other-scope.'); url1 = SCOPE1 + 'url=' + encodeURIComponent(OTHER_ORIGIN_OUT_SCOPE); @@ -497,8 +235,7 @@ redirect_test( url1, url2, - [[{url: url1, resultingClientIdTag: 'a'}], [], []], - 'x', + [[{url: url1}], [], []], 'SW-fallbacked redirect to other-origin out-scope.'); url1 = SCOPE1 + 'url=' + encodeURIComponent(OTHER_ORIGIN_SCOPE); @@ -506,32 +243,10 @@ redirect_test( url1, url2, - [ - [{url: url1, resultingClientIdTag: 'a'}], - [], - [{url: url2, resultingClientIdTag: 'x'}] - ], - 'x', + [[{url: url1}], [], [{url: url2}]], 'SW-fallbacked redirect to other-origin in-scope.'); -url3 = SCOPE1; -url2 = OTHER_ORIGIN_SCOPE + 'url=' + encodeURIComponent(url3); -url1 = SCOPE1 + 'url=' + encodeURIComponent(url2); -redirect_test( - url1, - url3, - [ - [ - {url: url1, resultingClientIdTag: 'a'}, - {url: url3, resultingClientIdTag: 'x'} - ], - [], - [{url: url2, resultingClientIdTag: 'b'}] - ], - 'x', - 'SW-fallbacked redirect to other-origin and back to same-origin.'); - // SW generated redirect. // SW: event.respondWith(Response.redirect(params['url'])); url1 = SCOPE1 + 'sw=gen&url=' + encodeURIComponent(OUT_SCOPE); @@ -539,8 +254,7 @@ redirect_test( url1, url2, - [[{url: url1, resultingClientIdTag: 'a'}], [], []], - null, + [[{url: url1}], [], []], 'SW-generated redirect to same-origin out-scope.'); url1 = SCOPE1 + 'sw=gen&url=' + encodeURIComponent(OUT_SCOPE) + '#ref'; @@ -548,8 +262,7 @@ redirect_test( url1, url2, - [[{url: url1, resultingClientIdTag: 'x'}], [], []], - 'x', + [[{url: url1}], [], []], 'SW-generated redirect to same-origin out-scope with a hash fragment.'); url1 = SCOPE1 + 'sw=gen&url=' + encodeURIComponent(OUT_SCOPE + '#ref2') + '#ref'; @@ -557,8 +270,7 @@ redirect_test( url1, url2, - [[{url: url1, resultingClientIdTag: 'x'}], [], []], - 'x', + [[{url: url1}], [], []], 'SW-generated redirect to same-origin out-scope with different hash ' + 'fragments.'); @@ -567,15 +279,7 @@ redirect_test( url1, url2, - [ - [ - {url: url1, resultingClientIdTag: 'x'}, - {url: url2, resultingClientIdTag: 'x'} - ], - [], - [] - ], - 'x', + [[{url: url1}, {url: url2}], [], []], 'SW-generated redirect to same-origin same-scope.'); url1 = SCOPE1 + 'sw=gen&url=' + encodeURIComponent(SCOPE2); @@ -583,12 +287,7 @@ redirect_test( url1, url2, - [ - [{url: url1, resultingClientIdTag: 'x'}], - [{url: url2, resultingClientIdTag: 'x'}], - [] - ], - 'x', + [[{url: url1}], [{url: url2}], []], 'SW-generated redirect to same-origin other-scope.'); url1 = SCOPE1 + 'sw=gen&url=' + encodeURIComponent(OTHER_ORIGIN_OUT_SCOPE); @@ -596,8 +295,7 @@ redirect_test( url1, url2, - [[{url: url1, resultingClientIdTag: 'a'}], [], []], - null, + [[{url: url1}], [], []], 'SW-generated redirect to other-origin out-scope.'); url1 = SCOPE1 + 'sw=gen&url=' + encodeURIComponent(OTHER_ORIGIN_SCOPE); @@ -606,11 +304,10 @@ url1, url2, [ - [{url: url1, resultingClientIdTag: 'a'}], + [{url: url1}], [], - [{url: url2, resultingClientIdTag: 'x'}] + [{url: url2}] ], - 'x', 'SW-generated redirect to other-origin in-scope.'); @@ -621,8 +318,7 @@ redirect_test( url1, url2, - [[{url: url1, resultingClientIdTag: 'x'}], [], []], - 'x', + [[{url: url1}], [], []], 'SW-fetched redirect to same-origin out-scope.'); url1 = SCOPE1 + 'sw=fetch&url=' + encodeURIComponent(SCOPE1); @@ -630,15 +326,7 @@ redirect_test( url1, url2, - [ - [ - {url: url1, resultingClientIdTag: 'x'}, - {url: url2, resultingClientIdTag: 'x'} - ], - [], - [] - ], - 'x', + [[{url: url1}, {url: url2}], [], []], 'SW-fetched redirect to same-origin same-scope.'); url1 = SCOPE1 + 'sw=fetch&url=' + encodeURIComponent(SCOPE2); @@ -647,11 +335,10 @@ url1, url2, [ - [{url: url1, resultingClientIdTag: 'x'}], - [{url: url2, resultingClientIdTag: 'x'}], + [{url: url1}], + [{url: url2}], [] ], - 'x', 'SW-fetched redirect to same-origin other-scope.'); url1 = SCOPE1 + 'sw=fetch&url=' + encodeURIComponent(OTHER_ORIGIN_OUT_SCOPE); @@ -659,8 +346,7 @@ redirect_test( url1, url2, - [[{url: url1, resultingClientIdTag: 'a'}], [], []], - null, + [[{url: url1}], [], []], 'SW-fetched redirect to other-origin out-scope.'); url1 = SCOPE1 + 'sw=fetch&url=' + encodeURIComponent(OTHER_ORIGIN_SCOPE); @@ -669,11 +355,10 @@ url1, url2, [ - [{url: url1, resultingClientIdTag: 'a'}], + [{url: url1}], [], - [{url: url2, resultingClientIdTag: 'x'}] + [{url: url2}] ], - 'x', 'SW-fetched redirect to other-origin in-scope.'); @@ -685,8 +370,7 @@ redirect_test( url1, url2, - [[{url: url1, resultingClientIdTag: 'x'}], [], []], - 'x', + [[{url: url1}], [], []], 'Redirect to same-origin out-scope with opaque redirect response.'); url1 = SCOPE1 + 'sw=manual&url=' + encodeURIComponent(SCOPE1); @@ -694,15 +378,7 @@ redirect_test( url1, url2, - [ - [ - {url: url1, resultingClientIdTag: 'x'}, - {url: url2, resultingClientIdTag: 'x'} - ], - [], - [] - ], - 'x', + [[{url: url1}, {url: url2}], [], []], 'Redirect to same-origin same-scope with opaque redirect response.'); url1 = SCOPE1 + 'sw=manual&url=' + encodeURIComponent(SCOPE2); @@ -710,12 +386,7 @@ redirect_test( url1, url2, - [ - [{url: url1, resultingClientIdTag: 'x'}], - [{url: url2, resultingClientIdTag: 'x'}], - [] - ], - 'x', + [[{url: url1}], [{url: url2}], []], 'Redirect to same-origin other-scope with opaque redirect response.'); url1 = SCOPE1 + 'sw=manual&url=' + encodeURIComponent(OTHER_ORIGIN_OUT_SCOPE); @@ -723,8 +394,7 @@ redirect_test( url1, url2, - [[{url: url1, resultingClientIdTag: 'a'}], [], []], - null, + [[{url: url1}], [], []], 'Redirect to other-origin out-scope with opaque redirect response.'); url1 = SCOPE1 + 'sw=manual&url=' + encodeURIComponent(OTHER_ORIGIN_SCOPE); @@ -732,18 +402,12 @@ redirect_test( url1, url2, - [ - [{url: url1, resultingClientIdTag: 'a'}], - [], - [{url: url2, resultingClientIdTag: 'x'}] - ], - 'x', + [[{url: url1}], [], [{url: url2}]], 'Redirect to other-origin in-scope with opaque redirect response.'); url= SCOPE1 + 'sw=manual&noLocationRedirect'; redirect_test( - url, url, [[{url, resultingClientIdTag: 'x'}], [], []], - 'x', + url, url, [[{url}], [], []], 'No location redirect response.'); @@ -754,8 +418,7 @@ redirect_test( url1, url2, - [[{url: url1, resultingClientIdTag: 'x'}], [], []], - 'x', + [[{url: url1}], [], []], 'Redirect to same-origin out-scope with opaque redirect response which ' + 'is passed through Cache.'); @@ -765,14 +428,10 @@ url1, url2, [ - [ - {url: url1, resultingClientIdTag: 'x'}, - {url: url2, resultingClientIdTag: 'x'} - ], + [{url: url1}, {url: url2}], [], [] ], - 'x', 'Redirect to same-origin same-scope with opaque redirect response which ' + 'is passed through Cache.'); @@ -782,11 +441,10 @@ url1, url2, [ - [{url: url1, resultingClientIdTag: 'x'}], - [{url: url2, resultingClientIdTag: 'x'}], + [{url: url1}], + [{url: url2}], [] ], - 'x', 'Redirect to same-origin other-scope with opaque redirect response which ' + 'is passed through Cache.'); @@ -796,8 +454,7 @@ redirect_test( url1, url2, - [[{url: url1, resultingClientIdTag: 'a'}], [], []], - null, + [[{url: url1}], [], []], 'Redirect to other-origin out-scope with opaque redirect response which ' + 'is passed through Cache.'); @@ -808,11 +465,10 @@ url1, url2, [ - [{url: url1, resultingClientIdTag: 'a'}], + [{url: url1}], [], - [{url: url2, resultingClientIdTag: 'x'}], + [{url: url2}], ], - 'x', 'Redirect to other-origin in-scope with opaque redirect response which ' + 'is passed through Cache.'); @@ -820,8 +476,7 @@ redirect_test( url, url, - [[{url, resultingClientIdTag: 'x'}], [], []], - 'x', + [[{url}], [], []], 'No location redirect response via Cache.'); // Clean up the test environment. This promise_test() needs to be the last one.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-redirect.https_client-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-redirect.https_client-expected.txt deleted file mode 100644 index 8856e57f..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-redirect.https_client-expected.txt +++ /dev/null
@@ -1,41 +0,0 @@ -This is a testharness.js-based test. -PASS initialize global state -FAIL Normal redirect to same-origin scope. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py? request to worker0 expected "string" but got "undefined" -FAIL Normal redirect to same-origin scope with a hash fragment. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?#ref request to worker0 expected "string" but got "undefined" -FAIL Normal redirect to same-origin scope with different hash fragments. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?#ref2 request to worker0 expected "string" but got "undefined" -FAIL Normal redirect to other-origin scope. assert_equals: resultingClientId for https://www1.web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py? request to crossOriginWorker expected "string" but got "undefined" -FAIL SW-fallbacked redirect to same-origin out-scope. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F request to worker0 expected "string" but got "undefined" -FAIL SW-fallbacked redirect to same-origin same-scope. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F request to worker0 expected "string" but got "undefined" -FAIL SW-fallbacked redirect to same-origin same-scope with a hash fragment. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F#ref request to worker0 expected "string" but got "undefined" -FAIL SW-fallbacked redirect to same-origin same-scope with different hash fragments. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F%23ref2#ref request to worker0 expected "string" but got "undefined" -FAIL SW-fallbacked redirect to same-origin other-scope. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope2.py%3F request to worker0 expected "string" but got "undefined" -FAIL SW-fallbacked redirect to other-origin out-scope. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fwww1.web-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F request to worker0 expected "string" but got "undefined" -FAIL SW-fallbacked redirect to other-origin in-scope. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fwww1.web-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F request to worker0 expected "string" but got "undefined" -FAIL SW-fallbacked redirect to other-origin and back to same-origin. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fwww1.web-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3Furl%3Dhttps%253A%252F%252Fweb-platform.test%253A8444%252Fservice-workers%252Fservice-worker%252Fresources%252Fnavigation-redirect-scope1.py%253F request to worker0 expected "string" but got "undefined" -FAIL SW-generated redirect to same-origin out-scope. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F request to worker0 expected "string" but got "undefined" -FAIL SW-generated redirect to same-origin out-scope with a hash fragment. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F#ref request to worker0 expected "string" but got "undefined" -FAIL SW-generated redirect to same-origin out-scope with different hash fragments. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F%23ref2#ref request to worker0 expected "string" but got "undefined" -FAIL SW-generated redirect to same-origin same-scope. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F request to worker0 expected "string" but got "undefined" -FAIL SW-generated redirect to same-origin other-scope. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope2.py%3F request to worker0 expected "string" but got "undefined" -FAIL SW-generated redirect to other-origin out-scope. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fwww1.web-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F request to worker0 expected "string" but got "undefined" -FAIL SW-generated redirect to other-origin in-scope. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fwww1.web-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F request to worker0 expected "string" but got "undefined" -FAIL SW-fetched redirect to same-origin out-scope. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=fetch&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F request to worker0 expected "string" but got "undefined" -FAIL SW-fetched redirect to same-origin same-scope. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=fetch&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F request to worker0 expected "string" but got "undefined" -FAIL SW-fetched redirect to same-origin other-scope. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=fetch&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope2.py%3F request to worker0 expected "string" but got "undefined" -FAIL SW-fetched redirect to other-origin out-scope. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=fetch&url=https%3A%2F%2Fwww1.web-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F request to worker0 expected "string" but got "undefined" -FAIL SW-fetched redirect to other-origin in-scope. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=fetch&url=https%3A%2F%2Fwww1.web-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F request to worker0 expected "string" but got "undefined" -FAIL Redirect to same-origin out-scope with opaque redirect response. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=manual&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F request to worker0 expected "string" but got "undefined" -FAIL Redirect to same-origin same-scope with opaque redirect response. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=manual&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F request to worker0 expected "string" but got "undefined" -FAIL Redirect to same-origin other-scope with opaque redirect response. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=manual&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope2.py%3F request to worker0 expected "string" but got "undefined" -FAIL Redirect to other-origin out-scope with opaque redirect response. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=manual&url=https%3A%2F%2Fwww1.web-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F request to worker0 expected "string" but got "undefined" -FAIL Redirect to other-origin in-scope with opaque redirect response. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=manual&url=https%3A%2F%2Fwww1.web-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F request to worker0 expected "string" but got "undefined" -FAIL No location redirect response. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=manual&noLocationRedirect request to worker0 expected "string" but got "undefined" -FAIL Redirect to same-origin out-scope with opaque redirect response which is passed through Cache. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=manualThroughCache&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F request to worker0 expected "string" but got "undefined" -FAIL Redirect to same-origin same-scope with opaque redirect response which is passed through Cache. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=manualThroughCache&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F request to worker0 expected "string" but got "undefined" -FAIL Redirect to same-origin other-scope with opaque redirect response which is passed through Cache. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=manualThroughCache&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope2.py%3F request to worker0 expected "string" but got "undefined" -FAIL Redirect to other-origin out-scope with opaque redirect response which is passed through Cache. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=manualThroughCache&url=https%3A%2F%2Fwww1.web-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F request to worker0 expected "string" but got "undefined" -FAIL Redirect to other-origin in-scope with opaque redirect response which is passed through Cache. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=manualThroughCache&url=https%3A%2F%2Fwww1.web-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F request to worker0 expected "string" but got "undefined" -FAIL No location redirect response via Cache. assert_equals: resultingClientId for https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=manualThroughCache&noLocationRedirect request to worker0 expected "string" but got "undefined" -PASS clean up global state -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/navigation-redirect-other-origin.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/navigation-redirect-other-origin.html index d82571d1a..0d2825f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/navigation-redirect-other-origin.html +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/navigation-redirect-other-origin.html
@@ -44,20 +44,6 @@ }); } -function get_clients(worker, actual_ids) { - return new Promise(function(resolve) { - var channel = new MessageChannel(); - channel.port1.onmessage = (msg) => { - resolve(msg.data.clients); - }; - worker.postMessage({ - command: 'getClients', - actual_ids, - port: channel.port2 - }, [channel.port2]); - }); -} - window.addEventListener('message', on_message, false); function on_message(e) { @@ -73,11 +59,6 @@ .then(function(data) { send_result(e.data.id, data); }); - } else if (command == 'get_clients') { - get_clients(worker, e.data.message.actual_ids) - .then(function(data) { - send_result(e.data.id, data); - }); } else if (command == 'unregister') { registration.unregister() .then(function() {
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/redirect-worker.js b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/redirect-worker.js index f3ac411..bf0a3a8 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/redirect-worker.js +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/redirect-worker.js
@@ -5,13 +5,6 @@ var waitUntilPromiseList = []; -// Sends the requests seen by this worker. The output is: -// { -// requestInfos: [ -// {url: url1, resultingClientId: id1}, -// {url: url2, resultingClientId: id2}, -// ] -// } async function getRequestInfos(event) { // Wait for fetch events to finish. await Promise.all(waitUntilPromiseList); @@ -22,11 +15,8 @@ const requestList = await cache.keys(); const requestInfos = []; for (let i = 0; i < requestList.length; i++) { - const response = await cache.match(requestList[i]); - const body = await response.json(); requestInfos[i] = { url: requestList[i].url, - resultingClientId: body.resultingClientId }; } await caches.delete(cacheName); @@ -34,51 +24,13 @@ event.data.port.postMessage({requestInfos}); } -// Sends the results of clients.get(id) from this worker. The -// input is: -// { -// actual_ids: {a: id1, b: id2, x: id3} -// } -// -// The output is: -// { -// clients: { -// a: {found: false}, -// b: {found: false}, -// x: { -// id: id3, -// url: url1, -// found: true -// } -// } -// } -async function getClients(event) { - // |actual_ids| is like: - // {a: id1, b: id2, x: id3} - const actual_ids = event.data.actual_ids; - const result = {} - for (let key of Object.keys(actual_ids)) { - const id = actual_ids[key]; - const client = await self.clients.get(id); - if (client === undefined) { - result[key] = {found: false}; - return; - } - result[key] = {found: true, url: client.url, id: client.id}; - } - event.data.port.postMessage({clients: result}); -} - self.addEventListener('message', async function(event) { if (event.data.command == 'getRequestInfos') { event.waitUntil(getRequestInfos(event)); return; } - if (event.data.command == 'getClients') { - event.waitUntil(getClients(event)); - return; - } + // TODO(falken): Add a getClientInfos command to test Clients API. }); function get_query_params(url) { @@ -97,11 +49,7 @@ self.addEventListener('fetch', function(event) { var waitUntilPromise = caches.open(cacheName).then(function(cache) { - const responseBody = {}; - responseBody['resultingClientId'] = event.resultingClientId; - const headers = new Headers({'Content-Type': 'application/json'}); - const response = new Response(JSON.stringify(responseBody), {headers}); - return cache.put(event.request, response); + return cache.put(event.request, new Response()); }); event.waitUntil(waitUntilPromise);
diff --git a/third_party/WebKit/LayoutTests/external/wpt/wasm/jsapi/module/customSections.any-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/wasm/jsapi/module/customSections.any-expected.txt index bfa81f6..10fcc31 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/wasm/jsapi/module/customSections.any-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/wasm/jsapi/module/customSections.any-expected.txt
@@ -4,8 +4,9 @@ PASS Branding PASS Empty module PASS Empty module: array caching -FAIL Custom sections WebAssembly.Module(): Wasm decoding failed: unexpected section: name @+33 +PASS Custom sections PASS Custom sections with surrogate pairs FAIL Custom sections with U+FFFD assert_equals: expected 1 but got 0 +PASS Stray argument Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/wasm/jsapi/module/customSections.any.worker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/wasm/jsapi/module/customSections.any.worker-expected.txt index bfa81f6..10fcc31 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/wasm/jsapi/module/customSections.any.worker-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/wasm/jsapi/module/customSections.any.worker-expected.txt
@@ -4,8 +4,9 @@ PASS Branding PASS Empty module PASS Empty module: array caching -FAIL Custom sections WebAssembly.Module(): Wasm decoding failed: unexpected section: name @+33 +PASS Custom sections PASS Custom sections with surrogate pairs FAIL Custom sections with U+FFFD assert_equals: expected 1 but got 0 +PASS Stray argument Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/element-attribute-js-null-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/element-attribute-js-null-expected.txt index 8f59ea3..f9b7c9e 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/element-attribute-js-null-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/element-attribute-js-null-expected.txt
@@ -131,7 +131,7 @@ TEST SUCCEEDED: The value was the string 'null'. [tested HTMLInputElement.accept] TEST SUCCEEDED: The value was the string 'null'. [tested HTMLInputElement.align] TEST SUCCEEDED: The value was the string 'null'. [tested HTMLInputElement.alt] -TEST SUCCEEDED: The value was the string 'null'. [tested HTMLInputElement.autocomplete] +TEST SUCCEEDED: The value was the empty string. [tested HTMLInputElement.autocomplete] TEST SUCCEEDED: The value was the string 'null'. [tested HTMLInputElement.defaultValue] TEST SUCCEEDED: The value was the string 'null'. [tested HTMLInputElement.dirName] TEST SUCCEEDED: The value was the string 'null' resolved as a URL. [tested HTMLInputElement.formAction]
diff --git a/third_party/WebKit/LayoutTests/fast/dom/element-attribute-js-null.html b/third_party/WebKit/LayoutTests/fast/dom/element-attribute-js-null.html index f8aa398e..95ae99d8 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/element-attribute-js-null.html +++ b/third_party/WebKit/LayoutTests/fast/dom/element-attribute-js-null.html
@@ -327,7 +327,7 @@ {name: 'accept', expectedNull: 'null'}, {name: 'align', expectedNull: 'null'}, {name: 'alt', expectedNull: 'null'}, - {name: 'autocomplete', expectedNull: 'null'}, + {name: 'autocomplete', expectedNull: ''}, {name: 'defaultValue', expectedNull: 'null'}, {name: 'dirName', expectedNull: 'null'}, {name: 'formAction', expectedNull: 'null', isUrl: true},
diff --git a/third_party/WebKit/LayoutTests/fast/forms/autocomplete-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/autocomplete-expected.txt index c6905aafa..c723fde0 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/autocomplete-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/autocomplete-expected.txt
@@ -11,7 +11,7 @@ PASS form.setAttribute('autocomplete', 'on'); form.autocomplete is "on" PASS field.setAttribute('autocomplete', 'on'); field.autocomplete is "on" PASS form.setAttribute('autocomplete', 'indeterminate'); form.autocomplete is "on" -PASS field.setAttribute('autocomplete', 'indeterminate'); field.autocomplete is "indeterminate" +PASS field.setAttribute('autocomplete', 'indeterminate'); field.autocomplete is "" PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/forms/autocomplete.html b/third_party/WebKit/LayoutTests/fast/forms/autocomplete.html index 1d40eeb..bb25884f 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/autocomplete.html +++ b/third_party/WebKit/LayoutTests/fast/forms/autocomplete.html
@@ -21,7 +21,7 @@ shouldBeEqualToString("form.setAttribute('autocomplete', 'on'); form.autocomplete", "on"); shouldBeEqualToString("field.setAttribute('autocomplete', 'on'); field.autocomplete", "on"); shouldBeEqualToString("form.setAttribute('autocomplete', 'indeterminate'); form.autocomplete", "on"); - shouldBeEqualToString("field.setAttribute('autocomplete', 'indeterminate'); field.autocomplete", "indeterminate"); + shouldBeEqualToString("field.setAttribute('autocomplete', 'indeterminate'); field.autocomplete", ""); finishJSTest(); } </script>
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/external/wpt/css/cssom/getComputedStyle-insets-absolute-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/external/wpt/css/cssom/getComputedStyle-insets-absolute-expected.txt index 205d1cd..6e81d7d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/external/wpt/css/cssom/getComputedStyle-insets-absolute-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/external/wpt/css/cssom/getComputedStyle-insets-absolute-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 324 tests; 192 PASS, 132 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 324 tests; 288 PASS, 36 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS horizontal-tb ltr inside horizontal-tb ltr - Pixels resolve as-is PASS horizontal-tb ltr inside horizontal-tb ltr - Relative lengths are absolutized into pixels PASS horizontal-tb ltr inside horizontal-tb ltr - Percentages are absolutized into pixels @@ -20,37 +20,37 @@ PASS horizontal-tb ltr inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value PASS horizontal-tb ltr inside vertical-lr ltr - Pixels resolve as-is PASS horizontal-tb ltr inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'left' expected "100px" but got "50px" -FAIL horizontal-tb ltr inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'left' expected "98px" but got "48px" +PASS horizontal-tb ltr inside vertical-lr ltr - Percentages are absolutized into pixels +PASS horizontal-tb ltr inside vertical-lr ltr - calc() is absolutized into pixels PASS horizontal-tb ltr inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL horizontal-tb ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "400px" but got "200px" +PASS horizontal-tb ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS horizontal-tb ltr inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS horizontal-tb ltr inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS horizontal-tb ltr inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value PASS horizontal-tb ltr inside vertical-lr rtl - Pixels resolve as-is PASS horizontal-tb ltr inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'left' expected "100px" but got "50px" -FAIL horizontal-tb ltr inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'left' expected "98px" but got "48px" +PASS horizontal-tb ltr inside vertical-lr rtl - Percentages are absolutized into pixels +PASS horizontal-tb ltr inside vertical-lr rtl - calc() is absolutized into pixels PASS horizontal-tb ltr inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL horizontal-tb ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "400px" but got "200px" +PASS horizontal-tb ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS horizontal-tb ltr inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS horizontal-tb ltr inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS horizontal-tb ltr inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value PASS horizontal-tb ltr inside vertical-rl ltr - Pixels resolve as-is PASS horizontal-tb ltr inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'left' expected "100px" but got "50px" -FAIL horizontal-tb ltr inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'left' expected "98px" but got "48px" +PASS horizontal-tb ltr inside vertical-rl ltr - Percentages are absolutized into pixels +PASS horizontal-tb ltr inside vertical-rl ltr - calc() is absolutized into pixels PASS horizontal-tb ltr inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL horizontal-tb ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "400px" but got "200px" +PASS horizontal-tb ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL horizontal-tb ltr inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL horizontal-tb ltr inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" FAIL horizontal-tb ltr inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "370px" but got "30px" PASS horizontal-tb ltr inside vertical-rl rtl - Pixels resolve as-is PASS horizontal-tb ltr inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'left' expected "100px" but got "50px" -FAIL horizontal-tb ltr inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'left' expected "98px" but got "48px" +PASS horizontal-tb ltr inside vertical-rl rtl - Percentages are absolutized into pixels +PASS horizontal-tb ltr inside vertical-rl rtl - calc() is absolutized into pixels PASS horizontal-tb ltr inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL horizontal-tb ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "400px" but got "200px" +PASS horizontal-tb ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL horizontal-tb ltr inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL horizontal-tb ltr inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" FAIL horizontal-tb ltr inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "370px" but got "30px" @@ -74,253 +74,253 @@ PASS horizontal-tb rtl inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value PASS horizontal-tb rtl inside vertical-lr ltr - Pixels resolve as-is PASS horizontal-tb rtl inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'left' expected "100px" but got "50px" -FAIL horizontal-tb rtl inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'left' expected "98px" but got "48px" +PASS horizontal-tb rtl inside vertical-lr ltr - Percentages are absolutized into pixels +PASS horizontal-tb rtl inside vertical-lr ltr - calc() is absolutized into pixels PASS horizontal-tb rtl inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL horizontal-tb rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "400px" but got "200px" +PASS horizontal-tb rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS horizontal-tb rtl inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS horizontal-tb rtl inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS horizontal-tb rtl inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value PASS horizontal-tb rtl inside vertical-lr rtl - Pixels resolve as-is PASS horizontal-tb rtl inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'left' expected "100px" but got "50px" -FAIL horizontal-tb rtl inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'left' expected "98px" but got "48px" +PASS horizontal-tb rtl inside vertical-lr rtl - Percentages are absolutized into pixels +PASS horizontal-tb rtl inside vertical-lr rtl - calc() is absolutized into pixels PASS horizontal-tb rtl inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL horizontal-tb rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "400px" but got "200px" +PASS horizontal-tb rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS horizontal-tb rtl inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS horizontal-tb rtl inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS horizontal-tb rtl inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value PASS horizontal-tb rtl inside vertical-rl ltr - Pixels resolve as-is PASS horizontal-tb rtl inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'left' expected "100px" but got "50px" -FAIL horizontal-tb rtl inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'left' expected "98px" but got "48px" +PASS horizontal-tb rtl inside vertical-rl ltr - Percentages are absolutized into pixels +PASS horizontal-tb rtl inside vertical-rl ltr - calc() is absolutized into pixels PASS horizontal-tb rtl inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL horizontal-tb rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "400px" but got "200px" +PASS horizontal-tb rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL horizontal-tb rtl inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL horizontal-tb rtl inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" FAIL horizontal-tb rtl inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "370px" but got "30px" PASS horizontal-tb rtl inside vertical-rl rtl - Pixels resolve as-is PASS horizontal-tb rtl inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'left' expected "100px" but got "50px" -FAIL horizontal-tb rtl inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'left' expected "98px" but got "48px" +PASS horizontal-tb rtl inside vertical-rl rtl - Percentages are absolutized into pixels +PASS horizontal-tb rtl inside vertical-rl rtl - calc() is absolutized into pixels PASS horizontal-tb rtl inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL horizontal-tb rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "400px" but got "200px" +PASS horizontal-tb rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL horizontal-tb rtl inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL horizontal-tb rtl inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" FAIL horizontal-tb rtl inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "370px" but got "30px" PASS vertical-lr ltr inside horizontal-tb ltr - Pixels resolve as-is PASS vertical-lr ltr inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr ltr inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr ltr inside horizontal-tb ltr - Percentages are absolutized into pixels +PASS vertical-lr ltr inside horizontal-tb ltr - calc() is absolutized into pixels PASS vertical-lr ltr inside horizontal-tb ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr ltr inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained PASS vertical-lr ltr inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr ltr inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr ltr inside horizontal-tb ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-lr ltr inside horizontal-tb rtl - Pixels resolve as-is PASS vertical-lr ltr inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr ltr inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr ltr inside horizontal-tb rtl - Percentages are absolutized into pixels +PASS vertical-lr ltr inside horizontal-tb rtl - calc() is absolutized into pixels PASS vertical-lr ltr inside horizontal-tb rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr ltr inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained PASS vertical-lr ltr inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr ltr inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr ltr inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-lr ltr inside vertical-lr ltr - Pixels resolve as-is PASS vertical-lr ltr inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr ltr inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr ltr inside vertical-lr ltr - Percentages are absolutized into pixels +PASS vertical-lr ltr inside vertical-lr ltr - calc() is absolutized into pixels PASS vertical-lr ltr inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS vertical-lr ltr inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr ltr inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr ltr inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-lr ltr inside vertical-lr rtl - Pixels resolve as-is PASS vertical-lr ltr inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr ltr inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr ltr inside vertical-lr rtl - Percentages are absolutized into pixels +PASS vertical-lr ltr inside vertical-lr rtl - calc() is absolutized into pixels PASS vertical-lr ltr inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS vertical-lr ltr inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr ltr inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr ltr inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-lr ltr inside vertical-rl ltr - Pixels resolve as-is PASS vertical-lr ltr inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr ltr inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr ltr inside vertical-rl ltr - Percentages are absolutized into pixels +PASS vertical-lr ltr inside vertical-rl ltr - calc() is absolutized into pixels PASS vertical-lr ltr inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL vertical-lr ltr inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL vertical-lr ltr inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" FAIL vertical-lr ltr inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "370px" but got "30px" PASS vertical-lr ltr inside vertical-rl rtl - Pixels resolve as-is PASS vertical-lr ltr inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr ltr inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr ltr inside vertical-rl rtl - Percentages are absolutized into pixels +PASS vertical-lr ltr inside vertical-rl rtl - calc() is absolutized into pixels PASS vertical-lr ltr inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL vertical-lr ltr inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL vertical-lr ltr inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" FAIL vertical-lr ltr inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "370px" but got "30px" PASS vertical-lr rtl inside horizontal-tb ltr - Pixels resolve as-is PASS vertical-lr rtl inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr rtl inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr rtl inside horizontal-tb ltr - Percentages are absolutized into pixels +PASS vertical-lr rtl inside horizontal-tb ltr - calc() is absolutized into pixels PASS vertical-lr rtl inside horizontal-tb ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr rtl inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained PASS vertical-lr rtl inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr rtl inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr rtl inside horizontal-tb ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-lr rtl inside horizontal-tb rtl - Pixels resolve as-is PASS vertical-lr rtl inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr rtl inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr rtl inside horizontal-tb rtl - Percentages are absolutized into pixels +PASS vertical-lr rtl inside horizontal-tb rtl - calc() is absolutized into pixels PASS vertical-lr rtl inside horizontal-tb rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr rtl inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained PASS vertical-lr rtl inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr rtl inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr rtl inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-lr rtl inside vertical-lr ltr - Pixels resolve as-is PASS vertical-lr rtl inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr rtl inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr rtl inside vertical-lr ltr - Percentages are absolutized into pixels +PASS vertical-lr rtl inside vertical-lr ltr - calc() is absolutized into pixels PASS vertical-lr rtl inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS vertical-lr rtl inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr rtl inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr rtl inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-lr rtl inside vertical-lr rtl - Pixels resolve as-is PASS vertical-lr rtl inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr rtl inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr rtl inside vertical-lr rtl - Percentages are absolutized into pixels +PASS vertical-lr rtl inside vertical-lr rtl - calc() is absolutized into pixels PASS vertical-lr rtl inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS vertical-lr rtl inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr rtl inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr rtl inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-lr rtl inside vertical-rl ltr - Pixels resolve as-is PASS vertical-lr rtl inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr rtl inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr rtl inside vertical-rl ltr - Percentages are absolutized into pixels +PASS vertical-lr rtl inside vertical-rl ltr - calc() is absolutized into pixels PASS vertical-lr rtl inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL vertical-lr rtl inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL vertical-lr rtl inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" FAIL vertical-lr rtl inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "370px" but got "30px" PASS vertical-lr rtl inside vertical-rl rtl - Pixels resolve as-is PASS vertical-lr rtl inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-lr rtl inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-lr rtl inside vertical-rl rtl - Percentages are absolutized into pixels +PASS vertical-lr rtl inside vertical-rl rtl - calc() is absolutized into pixels PASS vertical-lr rtl inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-lr rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL vertical-lr rtl inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL vertical-lr rtl inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" FAIL vertical-lr rtl inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "370px" but got "30px" PASS vertical-rl ltr inside horizontal-tb ltr - Pixels resolve as-is PASS vertical-rl ltr inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl ltr inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl ltr inside horizontal-tb ltr - Percentages are absolutized into pixels +PASS vertical-rl ltr inside horizontal-tb ltr - calc() is absolutized into pixels PASS vertical-rl ltr inside horizontal-tb ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl ltr inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained PASS vertical-rl ltr inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl ltr inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-rl ltr inside horizontal-tb ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-rl ltr inside horizontal-tb rtl - Pixels resolve as-is PASS vertical-rl ltr inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl ltr inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl ltr inside horizontal-tb rtl - Percentages are absolutized into pixels +PASS vertical-rl ltr inside horizontal-tb rtl - calc() is absolutized into pixels PASS vertical-rl ltr inside horizontal-tb rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl ltr inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained PASS vertical-rl ltr inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl ltr inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-rl ltr inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-rl ltr inside vertical-lr ltr - Pixels resolve as-is PASS vertical-rl ltr inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl ltr inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl ltr inside vertical-lr ltr - Percentages are absolutized into pixels +PASS vertical-rl ltr inside vertical-lr ltr - calc() is absolutized into pixels PASS vertical-rl ltr inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS vertical-rl ltr inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl ltr inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-rl ltr inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-rl ltr inside vertical-lr rtl - Pixels resolve as-is PASS vertical-rl ltr inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl ltr inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl ltr inside vertical-lr rtl - Percentages are absolutized into pixels +PASS vertical-rl ltr inside vertical-lr rtl - calc() is absolutized into pixels PASS vertical-rl ltr inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS vertical-rl ltr inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl ltr inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-rl ltr inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-rl ltr inside vertical-rl ltr - Pixels resolve as-is PASS vertical-rl ltr inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl ltr inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl ltr inside vertical-rl ltr - Percentages are absolutized into pixels +PASS vertical-rl ltr inside vertical-rl ltr - calc() is absolutized into pixels PASS vertical-rl ltr inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL vertical-rl ltr inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL vertical-rl ltr inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" FAIL vertical-rl ltr inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "370px" but got "30px" PASS vertical-rl ltr inside vertical-rl rtl - Pixels resolve as-is PASS vertical-rl ltr inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl ltr inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl ltr inside vertical-rl rtl - Percentages are absolutized into pixels +PASS vertical-rl ltr inside vertical-rl rtl - calc() is absolutized into pixels PASS vertical-rl ltr inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL vertical-rl ltr inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL vertical-rl ltr inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" FAIL vertical-rl ltr inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "370px" but got "30px" PASS vertical-rl rtl inside horizontal-tb ltr - Pixels resolve as-is PASS vertical-rl rtl inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl rtl inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl rtl inside horizontal-tb ltr - Percentages are absolutized into pixels +PASS vertical-rl rtl inside horizontal-tb ltr - calc() is absolutized into pixels PASS vertical-rl rtl inside horizontal-tb ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl rtl inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained PASS vertical-rl rtl inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl rtl inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-rl rtl inside horizontal-tb ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-rl rtl inside horizontal-tb rtl - Pixels resolve as-is PASS vertical-rl rtl inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl rtl inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl rtl inside horizontal-tb rtl - Percentages are absolutized into pixels +PASS vertical-rl rtl inside horizontal-tb rtl - calc() is absolutized into pixels PASS vertical-rl rtl inside horizontal-tb rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl rtl inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained PASS vertical-rl rtl inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl rtl inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-rl rtl inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-rl rtl inside vertical-lr ltr - Pixels resolve as-is PASS vertical-rl rtl inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl rtl inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl rtl inside vertical-lr ltr - Percentages are absolutized into pixels +PASS vertical-rl rtl inside vertical-lr ltr - calc() is absolutized into pixels PASS vertical-rl rtl inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS vertical-rl rtl inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl rtl inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-rl rtl inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-rl rtl inside vertical-lr rtl - Pixels resolve as-is PASS vertical-rl rtl inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl rtl inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl rtl inside vertical-lr rtl - Percentages are absolutized into pixels +PASS vertical-rl rtl inside vertical-lr rtl - calc() is absolutized into pixels PASS vertical-rl rtl inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS vertical-rl rtl inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl rtl inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-rl rtl inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-rl rtl inside vertical-rl ltr - Pixels resolve as-is PASS vertical-rl rtl inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl rtl inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl rtl inside vertical-rl ltr - Percentages are absolutized into pixels +PASS vertical-rl rtl inside vertical-rl ltr - calc() is absolutized into pixels PASS vertical-rl rtl inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL vertical-rl rtl inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL vertical-rl rtl inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" FAIL vertical-rl rtl inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "370px" but got "30px" PASS vertical-rl rtl inside vertical-rl rtl - Pixels resolve as-is PASS vertical-rl rtl inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "20px" but got "40px" -FAIL vertical-rl rtl inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "19px" but got "39px" +PASS vertical-rl rtl inside vertical-rl rtl - Percentages are absolutized into pixels +PASS vertical-rl rtl inside vertical-rl rtl - calc() is absolutized into pixels PASS vertical-rl rtl inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "200px" but got "400px" +PASS vertical-rl rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL vertical-rl rtl inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "396px" but got "4px" FAIL vertical-rl rtl inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "398px" but got "2px" FAIL vertical-rl rtl inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "370px" but got "30px"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/external/wpt/css/cssom/getComputedStyle-insets-fixed-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/external/wpt/css/cssom/getComputedStyle-insets-fixed-expected.txt index 5b930a3..5da0d30 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/external/wpt/css/cssom/getComputedStyle-insets-fixed-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/external/wpt/css/cssom/getComputedStyle-insets-fixed-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 324 tests; 192 PASS, 132 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 324 tests; 288 PASS, 36 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS horizontal-tb ltr inside horizontal-tb ltr - Pixels resolve as-is PASS horizontal-tb ltr inside horizontal-tb ltr - Relative lengths are absolutized into pixels PASS horizontal-tb ltr inside horizontal-tb ltr - Percentages are absolutized into pixels @@ -20,37 +20,37 @@ PASS horizontal-tb ltr inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value PASS horizontal-tb ltr inside vertical-lr ltr - Pixels resolve as-is PASS horizontal-tb ltr inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'left' expected "150px" but got "75px" -FAIL horizontal-tb ltr inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'left' expected "148px" but got "73px" +PASS horizontal-tb ltr inside vertical-lr ltr - Percentages are absolutized into pixels +PASS horizontal-tb ltr inside vertical-lr ltr - calc() is absolutized into pixels PASS horizontal-tb ltr inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL horizontal-tb ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "600px" but got "300px" +PASS horizontal-tb ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS horizontal-tb ltr inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS horizontal-tb ltr inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS horizontal-tb ltr inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value PASS horizontal-tb ltr inside vertical-lr rtl - Pixels resolve as-is PASS horizontal-tb ltr inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'left' expected "150px" but got "75px" -FAIL horizontal-tb ltr inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'left' expected "148px" but got "73px" +PASS horizontal-tb ltr inside vertical-lr rtl - Percentages are absolutized into pixels +PASS horizontal-tb ltr inside vertical-lr rtl - calc() is absolutized into pixels PASS horizontal-tb ltr inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL horizontal-tb ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "600px" but got "300px" +PASS horizontal-tb ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS horizontal-tb ltr inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS horizontal-tb ltr inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS horizontal-tb ltr inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value PASS horizontal-tb ltr inside vertical-rl ltr - Pixels resolve as-is PASS horizontal-tb ltr inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'left' expected "150px" but got "75px" -FAIL horizontal-tb ltr inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'left' expected "148px" but got "73px" +PASS horizontal-tb ltr inside vertical-rl ltr - Percentages are absolutized into pixels +PASS horizontal-tb ltr inside vertical-rl ltr - calc() is absolutized into pixels PASS horizontal-tb ltr inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL horizontal-tb ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "600px" but got "300px" +PASS horizontal-tb ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL horizontal-tb ltr inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL horizontal-tb ltr inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" FAIL horizontal-tb ltr inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "346px" but got "254px" PASS horizontal-tb ltr inside vertical-rl rtl - Pixels resolve as-is PASS horizontal-tb ltr inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb ltr inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'left' expected "150px" but got "75px" -FAIL horizontal-tb ltr inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'left' expected "148px" but got "73px" +PASS horizontal-tb ltr inside vertical-rl rtl - Percentages are absolutized into pixels +PASS horizontal-tb ltr inside vertical-rl rtl - calc() is absolutized into pixels PASS horizontal-tb ltr inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL horizontal-tb ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "600px" but got "300px" +PASS horizontal-tb ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL horizontal-tb ltr inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL horizontal-tb ltr inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" FAIL horizontal-tb ltr inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "346px" but got "254px" @@ -74,253 +74,253 @@ PASS horizontal-tb rtl inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value PASS horizontal-tb rtl inside vertical-lr ltr - Pixels resolve as-is PASS horizontal-tb rtl inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'left' expected "150px" but got "75px" -FAIL horizontal-tb rtl inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'left' expected "148px" but got "73px" +PASS horizontal-tb rtl inside vertical-lr ltr - Percentages are absolutized into pixels +PASS horizontal-tb rtl inside vertical-lr ltr - calc() is absolutized into pixels PASS horizontal-tb rtl inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL horizontal-tb rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "600px" but got "300px" +PASS horizontal-tb rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS horizontal-tb rtl inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS horizontal-tb rtl inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS horizontal-tb rtl inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value PASS horizontal-tb rtl inside vertical-lr rtl - Pixels resolve as-is PASS horizontal-tb rtl inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'left' expected "150px" but got "75px" -FAIL horizontal-tb rtl inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'left' expected "148px" but got "73px" +PASS horizontal-tb rtl inside vertical-lr rtl - Percentages are absolutized into pixels +PASS horizontal-tb rtl inside vertical-lr rtl - calc() is absolutized into pixels PASS horizontal-tb rtl inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL horizontal-tb rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "600px" but got "300px" +PASS horizontal-tb rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS horizontal-tb rtl inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS horizontal-tb rtl inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS horizontal-tb rtl inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value PASS horizontal-tb rtl inside vertical-rl ltr - Pixels resolve as-is PASS horizontal-tb rtl inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'left' expected "150px" but got "75px" -FAIL horizontal-tb rtl inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'left' expected "148px" but got "73px" +PASS horizontal-tb rtl inside vertical-rl ltr - Percentages are absolutized into pixels +PASS horizontal-tb rtl inside vertical-rl ltr - calc() is absolutized into pixels PASS horizontal-tb rtl inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL horizontal-tb rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "600px" but got "300px" +PASS horizontal-tb rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL horizontal-tb rtl inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL horizontal-tb rtl inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" FAIL horizontal-tb rtl inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "346px" but got "254px" PASS horizontal-tb rtl inside vertical-rl rtl - Pixels resolve as-is PASS horizontal-tb rtl inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL horizontal-tb rtl inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'left' expected "150px" but got "75px" -FAIL horizontal-tb rtl inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'left' expected "148px" but got "73px" +PASS horizontal-tb rtl inside vertical-rl rtl - Percentages are absolutized into pixels +PASS horizontal-tb rtl inside vertical-rl rtl - calc() is absolutized into pixels PASS horizontal-tb rtl inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL horizontal-tb rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'left' expected "600px" but got "300px" +PASS horizontal-tb rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL horizontal-tb rtl inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL horizontal-tb rtl inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" FAIL horizontal-tb rtl inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "346px" but got "254px" PASS vertical-lr ltr inside horizontal-tb ltr - Pixels resolve as-is PASS vertical-lr ltr inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr ltr inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr ltr inside horizontal-tb ltr - Percentages are absolutized into pixels +PASS vertical-lr ltr inside horizontal-tb ltr - calc() is absolutized into pixels PASS vertical-lr ltr inside horizontal-tb ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr ltr inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained PASS vertical-lr ltr inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr ltr inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr ltr inside horizontal-tb ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-lr ltr inside horizontal-tb rtl - Pixels resolve as-is PASS vertical-lr ltr inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr ltr inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr ltr inside horizontal-tb rtl - Percentages are absolutized into pixels +PASS vertical-lr ltr inside horizontal-tb rtl - calc() is absolutized into pixels PASS vertical-lr ltr inside horizontal-tb rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr ltr inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained PASS vertical-lr ltr inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr ltr inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr ltr inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-lr ltr inside vertical-lr ltr - Pixels resolve as-is PASS vertical-lr ltr inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr ltr inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr ltr inside vertical-lr ltr - Percentages are absolutized into pixels +PASS vertical-lr ltr inside vertical-lr ltr - calc() is absolutized into pixels PASS vertical-lr ltr inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS vertical-lr ltr inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr ltr inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr ltr inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-lr ltr inside vertical-lr rtl - Pixels resolve as-is PASS vertical-lr ltr inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr ltr inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr ltr inside vertical-lr rtl - Percentages are absolutized into pixels +PASS vertical-lr ltr inside vertical-lr rtl - calc() is absolutized into pixels PASS vertical-lr ltr inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS vertical-lr ltr inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr ltr inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr ltr inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-lr ltr inside vertical-rl ltr - Pixels resolve as-is PASS vertical-lr ltr inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr ltr inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr ltr inside vertical-rl ltr - Percentages are absolutized into pixels +PASS vertical-lr ltr inside vertical-rl ltr - calc() is absolutized into pixels PASS vertical-lr ltr inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL vertical-lr ltr inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL vertical-lr ltr inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" FAIL vertical-lr ltr inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "346px" but got "254px" PASS vertical-lr ltr inside vertical-rl rtl - Pixels resolve as-is PASS vertical-lr ltr inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr ltr inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr ltr inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr ltr inside vertical-rl rtl - Percentages are absolutized into pixels +PASS vertical-lr ltr inside vertical-rl rtl - calc() is absolutized into pixels PASS vertical-lr ltr inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL vertical-lr ltr inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL vertical-lr ltr inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" FAIL vertical-lr ltr inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "346px" but got "254px" PASS vertical-lr rtl inside horizontal-tb ltr - Pixels resolve as-is PASS vertical-lr rtl inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr rtl inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr rtl inside horizontal-tb ltr - Percentages are absolutized into pixels +PASS vertical-lr rtl inside horizontal-tb ltr - calc() is absolutized into pixels PASS vertical-lr rtl inside horizontal-tb ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr rtl inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained PASS vertical-lr rtl inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr rtl inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr rtl inside horizontal-tb ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-lr rtl inside horizontal-tb rtl - Pixels resolve as-is PASS vertical-lr rtl inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr rtl inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr rtl inside horizontal-tb rtl - Percentages are absolutized into pixels +PASS vertical-lr rtl inside horizontal-tb rtl - calc() is absolutized into pixels PASS vertical-lr rtl inside horizontal-tb rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr rtl inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained PASS vertical-lr rtl inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr rtl inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr rtl inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-lr rtl inside vertical-lr ltr - Pixels resolve as-is PASS vertical-lr rtl inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr rtl inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr rtl inside vertical-lr ltr - Percentages are absolutized into pixels +PASS vertical-lr rtl inside vertical-lr ltr - calc() is absolutized into pixels PASS vertical-lr rtl inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS vertical-lr rtl inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr rtl inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr rtl inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-lr rtl inside vertical-lr rtl - Pixels resolve as-is PASS vertical-lr rtl inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr rtl inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr rtl inside vertical-lr rtl - Percentages are absolutized into pixels +PASS vertical-lr rtl inside vertical-lr rtl - calc() is absolutized into pixels PASS vertical-lr rtl inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS vertical-lr rtl inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-lr rtl inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-lr rtl inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-lr rtl inside vertical-rl ltr - Pixels resolve as-is PASS vertical-lr rtl inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr rtl inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr rtl inside vertical-rl ltr - Percentages are absolutized into pixels +PASS vertical-lr rtl inside vertical-rl ltr - calc() is absolutized into pixels PASS vertical-lr rtl inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL vertical-lr rtl inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL vertical-lr rtl inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" FAIL vertical-lr rtl inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "346px" but got "254px" PASS vertical-lr rtl inside vertical-rl rtl - Pixels resolve as-is PASS vertical-lr rtl inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-lr rtl inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-lr rtl inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-lr rtl inside vertical-rl rtl - Percentages are absolutized into pixels +PASS vertical-lr rtl inside vertical-rl rtl - calc() is absolutized into pixels PASS vertical-lr rtl inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL vertical-lr rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-lr rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL vertical-lr rtl inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL vertical-lr rtl inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" FAIL vertical-lr rtl inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "346px" but got "254px" PASS vertical-rl ltr inside horizontal-tb ltr - Pixels resolve as-is PASS vertical-rl ltr inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl ltr inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl ltr inside horizontal-tb ltr - Percentages are absolutized into pixels +PASS vertical-rl ltr inside horizontal-tb ltr - calc() is absolutized into pixels PASS vertical-rl ltr inside horizontal-tb ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl ltr inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained PASS vertical-rl ltr inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl ltr inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-rl ltr inside horizontal-tb ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-rl ltr inside horizontal-tb rtl - Pixels resolve as-is PASS vertical-rl ltr inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl ltr inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl ltr inside horizontal-tb rtl - Percentages are absolutized into pixels +PASS vertical-rl ltr inside horizontal-tb rtl - calc() is absolutized into pixels PASS vertical-rl ltr inside horizontal-tb rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl ltr inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained PASS vertical-rl ltr inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl ltr inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-rl ltr inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-rl ltr inside vertical-lr ltr - Pixels resolve as-is PASS vertical-rl ltr inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl ltr inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl ltr inside vertical-lr ltr - Percentages are absolutized into pixels +PASS vertical-rl ltr inside vertical-lr ltr - calc() is absolutized into pixels PASS vertical-rl ltr inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl ltr inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS vertical-rl ltr inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl ltr inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-rl ltr inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-rl ltr inside vertical-lr rtl - Pixels resolve as-is PASS vertical-rl ltr inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl ltr inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl ltr inside vertical-lr rtl - Percentages are absolutized into pixels +PASS vertical-rl ltr inside vertical-lr rtl - calc() is absolutized into pixels PASS vertical-rl ltr inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl ltr inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS vertical-rl ltr inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl ltr inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-rl ltr inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-rl ltr inside vertical-rl ltr - Pixels resolve as-is PASS vertical-rl ltr inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl ltr inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl ltr inside vertical-rl ltr - Percentages are absolutized into pixels +PASS vertical-rl ltr inside vertical-rl ltr - calc() is absolutized into pixels PASS vertical-rl ltr inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl ltr inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL vertical-rl ltr inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL vertical-rl ltr inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" FAIL vertical-rl ltr inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "346px" but got "254px" PASS vertical-rl ltr inside vertical-rl rtl - Pixels resolve as-is PASS vertical-rl ltr inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl ltr inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl ltr inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl ltr inside vertical-rl rtl - Percentages are absolutized into pixels +PASS vertical-rl ltr inside vertical-rl rtl - calc() is absolutized into pixels PASS vertical-rl ltr inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl ltr inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL vertical-rl ltr inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL vertical-rl ltr inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" FAIL vertical-rl ltr inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "346px" but got "254px" PASS vertical-rl rtl inside horizontal-tb ltr - Pixels resolve as-is PASS vertical-rl rtl inside horizontal-tb ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside horizontal-tb ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl rtl inside horizontal-tb ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl rtl inside horizontal-tb ltr - Percentages are absolutized into pixels +PASS vertical-rl rtl inside horizontal-tb ltr - calc() is absolutized into pixels PASS vertical-rl rtl inside horizontal-tb ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl rtl inside horizontal-tb ltr - Percentages absolutize the computed value when overconstrained PASS vertical-rl rtl inside horizontal-tb ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl rtl inside horizontal-tb ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-rl rtl inside horizontal-tb ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-rl rtl inside horizontal-tb rtl - Pixels resolve as-is PASS vertical-rl rtl inside horizontal-tb rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside horizontal-tb rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl rtl inside horizontal-tb rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl rtl inside horizontal-tb rtl - Percentages are absolutized into pixels +PASS vertical-rl rtl inside horizontal-tb rtl - calc() is absolutized into pixels PASS vertical-rl rtl inside horizontal-tb rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl rtl inside horizontal-tb rtl - Percentages absolutize the computed value when overconstrained PASS vertical-rl rtl inside horizontal-tb rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl rtl inside horizontal-tb rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-rl rtl inside horizontal-tb rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-rl rtl inside vertical-lr ltr - Pixels resolve as-is PASS vertical-rl rtl inside vertical-lr ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-lr ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl rtl inside vertical-lr ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl rtl inside vertical-lr ltr - Percentages are absolutized into pixels +PASS vertical-rl rtl inside vertical-lr ltr - calc() is absolutized into pixels PASS vertical-rl rtl inside vertical-lr ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl rtl inside vertical-lr ltr - Percentages absolutize the computed value when overconstrained PASS vertical-rl rtl inside vertical-lr ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl rtl inside vertical-lr ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-rl rtl inside vertical-lr ltr - If opposite sides are 'auto', they resolve to used value PASS vertical-rl rtl inside vertical-lr rtl - Pixels resolve as-is PASS vertical-rl rtl inside vertical-lr rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-lr rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl rtl inside vertical-lr rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl rtl inside vertical-lr rtl - Percentages are absolutized into pixels +PASS vertical-rl rtl inside vertical-lr rtl - calc() is absolutized into pixels PASS vertical-rl rtl inside vertical-lr rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl rtl inside vertical-lr rtl - Percentages absolutize the computed value when overconstrained PASS vertical-rl rtl inside vertical-lr rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value PASS vertical-rl rtl inside vertical-lr rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value PASS vertical-rl rtl inside vertical-lr rtl - If opposite sides are 'auto', they resolve to used value PASS vertical-rl rtl inside vertical-rl ltr - Pixels resolve as-is PASS vertical-rl rtl inside vertical-rl ltr - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-rl ltr - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl rtl inside vertical-rl ltr - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl rtl inside vertical-rl ltr - Percentages are absolutized into pixels +PASS vertical-rl rtl inside vertical-rl ltr - calc() is absolutized into pixels PASS vertical-rl rtl inside vertical-rl ltr - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl rtl inside vertical-rl ltr - Percentages absolutize the computed value when overconstrained FAIL vertical-rl rtl inside vertical-rl ltr - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL vertical-rl rtl inside vertical-rl ltr - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" FAIL vertical-rl rtl inside vertical-rl ltr - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "346px" but got "254px" PASS vertical-rl rtl inside vertical-rl rtl - Pixels resolve as-is PASS vertical-rl rtl inside vertical-rl rtl - Relative lengths are absolutized into pixels -FAIL vertical-rl rtl inside vertical-rl rtl - Percentages are absolutized into pixels assert_equals: 'top' expected "30px" but got "60px" -FAIL vertical-rl rtl inside vertical-rl rtl - calc() is absolutized into pixels assert_equals: 'top' expected "29px" but got "59px" +PASS vertical-rl rtl inside vertical-rl rtl - Percentages are absolutized into pixels +PASS vertical-rl rtl inside vertical-rl rtl - calc() is absolutized into pixels PASS vertical-rl rtl inside vertical-rl rtl - Pixels resolve as-is when overconstrained -FAIL vertical-rl rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained assert_equals: 'top' expected "300px" but got "600px" +PASS vertical-rl rtl inside vertical-rl rtl - Percentages absolutize the computed value when overconstrained FAIL vertical-rl rtl inside vertical-rl rtl - If start side is 'auto' and end side is not, 'auto' resolves to used value assert_equals: 'left' expected "596px" but got "4px" FAIL vertical-rl rtl inside vertical-rl rtl - If end side is 'auto' and start side is not, 'auto' resolves to used value assert_equals: 'right' expected "598px" but got "2px" FAIL vertical-rl rtl inside vertical-rl rtl - If opposite sides are 'auto', they resolve to used value assert_equals: 'left' expected "346px" but got "254px"
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/page/add-script-to-evaluate-in-world-expected.txt b/third_party/WebKit/LayoutTests/inspector-protocol/page/add-script-to-evaluate-in-world-expected.txt deleted file mode 100644 index ff925137..0000000 --- a/third_party/WebKit/LayoutTests/inspector-protocol/page/add-script-to-evaluate-in-world-expected.txt +++ /dev/null
@@ -1,14 +0,0 @@ -Tests that Page.addScriptToEvaluateOnNewDocument is executed in the given world -Adding scripts -world#0 -message from 0 -world#1 -message from 1 -world#2 -message from 2 -world#3 -message from 3 -world#4 -message from 4 -Removing scripts -
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/page/add-script-to-evaluate-in-world.js b/third_party/WebKit/LayoutTests/inspector-protocol/page/add-script-to-evaluate-in-world.js deleted file mode 100644 index 436034f..0000000 --- a/third_party/WebKit/LayoutTests/inspector-protocol/page/add-script-to-evaluate-in-world.js +++ /dev/null
@@ -1,33 +0,0 @@ -(async function(testRunner) { - const {page, session, dp} = await testRunner.startBlank( - 'Tests that Page.addScriptToEvaluateOnNewDocument is executed in the given world'); - dp.Runtime.enable(); - dp.Page.enable(); - - const scriptIds = []; - dp.Runtime.onConsoleAPICalled(msg => testRunner.log(msg.params.args[0].value)); - dp.Runtime.onExecutionContextCreated(msg => { - if (msg.params.context.name.includes('world')) - testRunner.log(msg.params.context.name); - }); - - testRunner.log('Adding scripts'); - for (let i = 0; i < 5; ++i) { - const result = await dp.Page.addScriptToEvaluateOnNewDocument({source: ` - console.log('message from ${i}');`, worldName: `world#${i}`}); - scriptIds.push(result.result.identifier); - } - - await session.navigate('../resources/blank.html'); - - testRunner.log('Removing scripts'); - for (let identifier of scriptIds) { - const response = await dp.Page.removeScriptToEvaluateOnNewDocument({identifier}); - if (!response.result) - testRunner.log('Failed script removal'); - } - - await session.navigate('../resources/blank.html'); - - testRunner.completeTest(); -})
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/page/add-script-to-evaluate-on-load-expected.txt b/third_party/WebKit/LayoutTests/inspector-protocol/page/add-script-to-evaluate-on-load-expected.txt index bed3d35..1d2fb125 100644 --- a/third_party/WebKit/LayoutTests/inspector-protocol/page/add-script-to-evaluate-on-load-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector-protocol/page/add-script-to-evaluate-on-load-expected.txt
@@ -1,9 +1,17 @@ Tests that Page.addScriptToEvaluateOnLoad is executed in the order of addition -Adding scripts message from 0 message from 1 message from 2 message from 3 message from 4 -Removing scripts +message from 5 +message from 6 +message from 7 +message from 8 +message from 9 +message from 10 +message from 11 +message from 12 +message from 13 +message from 14
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/page/add-script-to-evaluate-on-load.js b/third_party/WebKit/LayoutTests/inspector-protocol/page/add-script-to-evaluate-on-load.js index 7cd3114..024683c7 100644 --- a/third_party/WebKit/LayoutTests/inspector-protocol/page/add-script-to-evaluate-on-load.js +++ b/third_party/WebKit/LayoutTests/inspector-protocol/page/add-script-to-evaluate-on-load.js
@@ -4,27 +4,13 @@ dp.Runtime.enable(); dp.Page.enable(); - const scriptIds = []; dp.Runtime.onConsoleAPICalled(msg => testRunner.log(msg.params.args[0].value)); - testRunner.log('Adding scripts'); - for (let i = 0; i < 5; ++i) { - const result = await dp.Page.addScriptToEvaluateOnNewDocument({source: ` + for (let i = 0; i < 15; ++i) { + await dp.Page.addScriptToEvaluateOnNewDocument({source: ` console.log('message from ${i}'); `}); - scriptIds.push(result.result.identifier); } - await session.navigate('../resources/blank.html'); - - testRunner.log('Removing scripts'); - for (let identifier of scriptIds) { - const response = await dp.Page.removeScriptToEvaluateOnNewDocument({identifier}); - if (!response.result) - testRunner.log('Failed script removal'); - } - - await session.navigate('../resources/blank.html'); - testRunner.completeTest(); })
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/imperative-api-notslotchange.html b/third_party/WebKit/LayoutTests/shadow-dom/imperative-api-notslotchange.html index f1f2363..2d82028 100644 --- a/third_party/WebKit/LayoutTests/shadow-dom/imperative-api-notslotchange.html +++ b/third_party/WebKit/LayoutTests/shadow-dom/imperative-api-notslotchange.html
@@ -9,11 +9,15 @@ <script> const test = async_test('slotchange event must not be fired'); let eventCount = 0; + let anothereventCount = 0; + let host; let slot1; + let slot2; let child1; + let child2; test.step(function () { - const host = document.createElement('div'); + host = document.createElement('div'); document.body.appendChild(host); const shadowRoot = host.attachShadow({mode: 'open', slotting: 'manual'}); @@ -24,22 +28,59 @@ }); shadowRoot.appendChild(slot1); + + slot2 = document.createElement('slot'); + + slot2.addEventListener('slotchange', function (event) { + anothereventCount++; + }); + + shadowRoot.appendChild(slot2); + child1 = document.createElement('div'); + child2 = document.createElement('div'); + host.appendChild(child1); - slot1.assign([child1]); + + slot1.assign([]); + slot2.assign([child2]); + + assert_equals(eventCount, 0, 'slotchange event must not be fired synchronously'); + assert_equals(anothereventCount, 0, 'slotchange event must not be fired synchronously'); }); setTimeout(function () { test.step(function () { - assert_equals(eventCount, 1, 'slotchange event must be fired when node is assigned'); + assert_equals(eventCount, 0, 'slotchange event must not be fired when the slot is assigned none'); + assert_equals(anothereventCount, 0, 'slotchange event must not be fired when the slot is assigned nodes that is not the host\'s child'); slot1.assign([child1]); + slot2.assign([]); }); setTimeout(function () { test.step(function () { - assert_equals(eventCount, 1, 'slotchange event must not be fired when slot is assigned same node'); + assert_equals(eventCount, 1, 'slotchange must be fired exactly once after the assigned nodes changed'); + assert_equals(anothereventCount, 0, 'slotchange must not be fired when deleted nodes that is not the host\'s child'); + + slot1.assign([child1]); + slot2.assign([child1]); }); - test.done(); + + setTimeout(function () { + test.step(function () { + assert_equals(eventCount, 1, 'slotchange event must not be fired when the slot is assigned same node'); + assert_equals(anothereventCount, 0, 'slotchange event must not be fired when it is assigned nodes that is assigned another slot'); + + slot2.assign([]); + }); + + setTimeout(function () { + test.step(function () { + assert_equals(anothereventCount, 0, 'slotchange event must not be fired when deleted nodes that is assigned another slot'); + }); + test.done(); + }, 1); + }, 1); }, 1); }, 1); </script>
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/imperative-api-notslotchangefornotassignfunction.html b/third_party/WebKit/LayoutTests/shadow-dom/imperative-api-notslotchangefornotassignfunction.html new file mode 100644 index 0000000..effd9004 --- /dev/null +++ b/third_party/WebKit/LayoutTests/shadow-dom/imperative-api-notslotchangefornotassignfunction.html
@@ -0,0 +1,105 @@ +<!DOCTYPE html> +<html> +<head> +<script src="../resources/testharness.js"></script> +<script src="../resources/testharnessreport.js"></script> +</head> +<body> +<div id="log"></div> +<script> + const test = async_test('slotchange event must not be fired'); + let eventCount = 0; + let anothereventCount = 0; + let theothereventCount = 0; + let host; + let slot1; + let slot2; + let slot3; + let child1; + let child2; + let child3; + let shadowRoot; + + test.step(function () { + host = document.createElement('div'); + document.body.appendChild(host); + + shadowRoot = host.attachShadow({mode: 'open', slotting: 'manual'}); + slot1 = document.createElement('slot'); + + slot1.addEventListener('slotchange', function (event) { + eventCount++; + }); + + slot2 = document.createElement('slot'); + + slot2.addEventListener('slotchange', function (event) { + anothereventCount++; + }); + + slot3 = document.createElement('slot'); + + slot3.addEventListener('slotchange', function (event) { + theothereventCount++; + }); + + child1 = document.createElement('div'); + child2 = document.createElement('div'); + + host.appendChild(child1); + + slot1.assign([child1]); + slot2.assign([child1]); + slot3.assign([child2]); + shadowRoot.appendChild(slot1); + shadowRoot.appendChild(slot2); + + assert_equals(eventCount, 0, 'slotchange event must not be fired synchronously'); + assert_equals(anothereventCount, 0, 'slotchange event must not be fired synchronously'); + assert_equals(theothereventCount, 0, 'slotchange event must not be fired synchronously'); + }); + + setTimeout(function () { + test.step(function () { + assert_equals(eventCount, 1, 'slotchange must be fired exactly once after the assigned nodes changed'); + assert_equals(anothereventCount, 0, 'slotchange event must not be fired when slot that have nodes that is assigned another slot is appended.'); + assert_equals(theothereventCount, 0, 'slotchange event must not be fired when slot that have nodes that is not host\'s child is appended.'); + slot2.remove(); + slot1.assign([child2]); + slot3.remove(); + }); + + setTimeout(function () { + test.step(function () { + assert_equals(eventCount, 2, 'slotchange must be fired exactly once after the assigned nodes changed'); + assert_equals(anothereventCount, 0, 'slotchange event must not be fired when slot that have nodes that is assigned another slot is removed.'); + assert_equals(theothereventCount, 0, 'slotchange event must not be fired when slot that have nodes that is not host\'s child is removed.'); + + slot2.assign([]); + shadowRoot.appendChild(slot2); + shadowRoot.appendChild(slot3); + host.appendChild(child2); + }); + + setTimeout(function () { + test.step(function () { + assert_equals(eventCount, 3, 'slotchange must be fired exactly once after the assigned nodes changed'); + assert_equals(anothereventCount, 0, 'slotchange event must not be fired when slot that has no child is appended'); + assert_equals(theothereventCount, 0, 'slotchange event must not be fired when child that assigned another slot is appended'); + + child2.remove() + }); + + setTimeout(function () { + test.step(function () { + assert_equals(eventCount, 4, 'slotchange must be fired exactly once after the assigned nodes changed'); + assert_equals(theothereventCount, 0, 'slotchange event must not be fired when child that is assigned another slot is deleted'); + }); + test.done(); + }, 1); + }, 1); + }, 1); + }, 1); +</script> +</body> +</html>
diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h index e98560a..306e811 100644 --- a/third_party/blink/public/platform/platform.h +++ b/third_party/blink/public/platform/platform.h
@@ -424,20 +424,24 @@ // Threads ------------------------------------------------------- - // Creates an embedder-defined thread. - virtual std::unique_ptr<WebThread> CreateThread( - const WebThreadCreationParams&); + // Thread creation is no longer customizable in Platform. CreateThread() + // always creates a new physical thread for Blink. Platform maintains + // the thread-local storage containing each WebThread object, so that + // CurrentThread() could return the correct thread object. + // + // TODO(yutak): These non-virtual functions should be moved to somewhere + // else, because they no longer require embedder's implementation. + + // Creates a new thread. This may be called from a non-main thread (e.g. + // nested Web workers). + std::unique_ptr<WebThread> CreateThread(const WebThreadCreationParams&); // Creates a WebAudio-specific thread with the elevated priority. Do NOT use // for any other purpose. - virtual std::unique_ptr<WebThread> CreateWebAudioThread(); + std::unique_ptr<WebThread> CreateWebAudioThread(); // Returns an interface to the current thread. - // - // The default implementation only works on the main thread. If your - // application supports multi-thread, you *must* override this function - // as well as CreateThread(). - virtual WebThread* CurrentThread(); + WebThread* CurrentThread(); // Returns a blame context for attributing top-level work which does not // belong to a particular frame scope. @@ -736,6 +740,8 @@ // depending on memory pressure. virtual void RequestPurgeMemory() {} + virtual void SetMemoryPressureNotificationsSuppressed(bool suppressed) {} + // V8 Context Snapshot -------------------------------------------------- // This method returns true only when @@ -744,11 +750,16 @@ virtual bool IsTakingV8ContextSnapshot() { return false; } protected: + void RegisterExtraThreadToTLS(WebThread*); + WebThread* main_thread_; private: static void InitializeCommon(Platform* platform); + void WaitUntilWebThreadTLSUpdate(WebThread*); + void UpdateWebThreadTLS(WebThread* thread, base::WaitableEvent* event); + // Platform owns the main thread in most cases. The pointer value is the same // as main_thread_ if this variable is non-null. // @@ -756,6 +767,11 @@ // overrides the old Platform. In this case, main_thread_ points to the old // Platform's main thread. See testing_platform_support.h for this. std::unique_ptr<WebThread> owned_main_thread_; + + // We can't use WTF stuff here. Ultimately these should go away (see comments + // near CreateThread()), though. + base::ThreadLocalStorage::Slot current_thread_slot_; + base::Lock create_thread_lock_; }; } // namespace blink
diff --git a/third_party/blink/public/platform/scheduler/child/webthread_base.h b/third_party/blink/public/platform/scheduler/child/webthread_base.h index 59b7cce..5b787fb 100644 --- a/third_party/blink/public/platform/scheduler/child/webthread_base.h +++ b/third_party/blink/public/platform/scheduler/child/webthread_base.h
@@ -29,8 +29,10 @@ public: ~WebThreadBase() override; + // CreateWorkerThread() may be called from a non-main thread. static std::unique_ptr<WebThreadBase> CreateWorkerThread( const WebThreadCreationParams& params); + static std::unique_ptr<WebThreadBase> CreateCompositorThread( const WebThreadCreationParams& params);
diff --git a/third_party/blink/public/web/web_widget.h b/third_party/blink/public/web/web_widget.h index 025c15bf..069c531 100644 --- a/third_party/blink/public/web/web_widget.h +++ b/third_party/blink/public/web/web_widget.h
@@ -84,13 +84,9 @@ // Called to update imperative animation state. This should be called before // paint, although the client can rate-limit these calls. - // |last_frame_time| is in seconds. + // |lastFrameTimeMonotonic| is in seconds. virtual void BeginFrame(base::TimeTicks last_frame_time) {} - // Called when a main frame time metric should be emitted, along with - // any metrics that depend upon the main frame total time. - virtual void RecordEndOfFrameMetrics(base::TimeTicks frame_begin_time) {} - // Called to run through the entire set of document lifecycle phases needed // to render a frame of the web widget. This MUST be called before Paint, // and it may result in calls to WebWidgetClient::didInvalidateRect.
diff --git a/third_party/blink/renderer/bindings/core/v8/BUILD.gn b/third_party/blink/renderer/bindings/core/v8/BUILD.gn index c13fc30..389eeacf1 100644 --- a/third_party/blink/renderer/bindings/core/v8/BUILD.gn +++ b/third_party/blink/renderer/bindings/core/v8/BUILD.gn
@@ -130,6 +130,8 @@ generated_core_callback_function_files = [ "$bindings_core_v8_output_dir/v8_blob_callback.cc", "$bindings_core_v8_output_dir/v8_blob_callback.h", + "$bindings_core_v8_output_dir/v8_custom_element_constructor.cc", + "$bindings_core_v8_output_dir/v8_custom_element_constructor.h", "$bindings_core_v8_output_dir/v8_frame_request_callback.cc", "$bindings_core_v8_output_dir/v8_frame_request_callback.h", "$bindings_core_v8_output_dir/v8_function.cc",
diff --git a/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.cc b/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.cc index 4a6beae0..a7aba318 100644 --- a/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.cc +++ b/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.cc
@@ -5,9 +5,11 @@ #include "third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.h" #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_custom_element_constructor.h" #include "third_party/blink/renderer/bindings/core/v8/v8_custom_element_registry.h" #include "third_party/blink/renderer/bindings/core/v8/v8_element.h" #include "third_party/blink/renderer/bindings/core/v8/v8_error_handler.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_function.h" #include "third_party/blink/renderer/bindings/core/v8/v8_script_runner.h" #include "third_party/blink/renderer/bindings/core/v8/v8_throw_dom_exception.h" #include "third_party/blink/renderer/core/dom/document.h" @@ -29,7 +31,7 @@ ScriptCustomElementDefinition* ScriptCustomElementDefinition::ForConstructor( ScriptState* script_state, CustomElementRegistry* registry, - const v8::Local<v8::Value>& constructor) { + v8::Local<v8::Value> constructor) { V8PerContextData* per_context_data = script_state->PerContextData(); // TODO(yukishiino): Remove this check when crbug.com/583429 is fixed. if (UNLIKELY(!per_context_data)) @@ -72,11 +74,11 @@ CustomElementRegistry* registry, const CustomElementDescriptor& descriptor, CustomElementDefinition::Id id, - const v8::Local<v8::Object>& constructor, - const v8::Local<v8::Function>& connected_callback, - const v8::Local<v8::Function>& disconnected_callback, - const v8::Local<v8::Function>& adopted_callback, - const v8::Local<v8::Function>& attribute_changed_callback, + V8CustomElementConstructor* constructor, + V8Function* connected_callback, + V8Function* disconnected_callback, + V8Function* adopted_callback, + V8Function* attribute_changed_callback, HashSet<AtomicString>&& observed_attributes, CSSStyleSheet* default_style_sheet) { ScriptCustomElementDefinition* definition = new ScriptCustomElementDefinition( @@ -89,9 +91,9 @@ v8::Integer::NewFromUnsigned(script_state->GetIsolate(), id); auto private_id = script_state->PerContextData()->GetPrivateCustomElementDefinitionId(); - CHECK( - constructor->SetPrivate(script_state->GetContext(), private_id, id_value) - .ToChecked()); + CHECK(constructor->CallbackObject() + ->SetPrivate(script_state->GetContext(), private_id, id_value) + .ToChecked()); return definition; } @@ -99,36 +101,30 @@ ScriptCustomElementDefinition::ScriptCustomElementDefinition( ScriptState* script_state, const CustomElementDescriptor& descriptor, - const v8::Local<v8::Object>& constructor, - const v8::Local<v8::Function>& connected_callback, - const v8::Local<v8::Function>& disconnected_callback, - const v8::Local<v8::Function>& adopted_callback, - const v8::Local<v8::Function>& attribute_changed_callback, + V8CustomElementConstructor* constructor, + V8Function* connected_callback, + V8Function* disconnected_callback, + V8Function* adopted_callback, + V8Function* attribute_changed_callback, HashSet<AtomicString>&& observed_attributes, CSSStyleSheet* default_style_sheet) : CustomElementDefinition(descriptor, default_style_sheet, std::move(observed_attributes)), script_state_(script_state), - constructor_(script_state->GetIsolate(), constructor) { - v8::Isolate* isolate = script_state->GetIsolate(); - if (!connected_callback.IsEmpty()) - connected_callback_.Set(isolate, connected_callback); - if (!disconnected_callback.IsEmpty()) - disconnected_callback_.Set(isolate, disconnected_callback); - if (!adopted_callback.IsEmpty()) - adopted_callback_.Set(isolate, adopted_callback); - if (!attribute_changed_callback.IsEmpty()) - attribute_changed_callback_.Set(isolate, attribute_changed_callback); -} + constructor_(constructor), + connected_callback_(connected_callback), + disconnected_callback_(disconnected_callback), + adopted_callback_(adopted_callback), + attribute_changed_callback_(attribute_changed_callback) {} void ScriptCustomElementDefinition::Trace(Visitor* visitor) { - visitor->Trace(constructor_.Cast<v8::Value>()); - visitor->Trace(connected_callback_.Cast<v8::Value>()); - visitor->Trace(disconnected_callback_.Cast<v8::Value>()); - visitor->Trace(adopted_callback_.Cast<v8::Value>()); - visitor->Trace(attribute_changed_callback_.Cast<v8::Value>()); visitor->Trace(script_state_); + visitor->Trace(constructor_); + visitor->Trace(connected_callback_); + visitor->Trace(disconnected_callback_); + visitor->Trace(adopted_callback_); + visitor->Trace(attribute_changed_callback_); CustomElementDefinition::Trace(visitor); } @@ -239,21 +235,17 @@ } Element* ScriptCustomElementDefinition::CallConstructor() { - v8::Isolate* isolate = script_state_->GetIsolate(); - DCHECK(ScriptState::Current(isolate) == script_state_); - ExecutionContext* execution_context = ExecutionContext::From(script_state_); - v8::Local<v8::Value> result; - if (!V8ScriptRunner::CallAsConstructor(isolate, Constructor(), - execution_context, 0, nullptr) - .ToLocal(&result)) { + ScriptValue result; + if (!constructor_->Construct().To(&result)) { return nullptr; } - return V8Element::ToImplWithTypeCheck(isolate, result); + + return V8Element::ToImplWithTypeCheck(constructor_->GetIsolate(), + result.V8Value()); } v8::Local<v8::Object> ScriptCustomElementDefinition::Constructor() const { - DCHECK(!constructor_.IsEmpty()); - return constructor_.NewLocal(script_state_->GetIsolate()); + return constructor_->CallbackObject(); } // CustomElementDefinition @@ -262,66 +254,47 @@ } bool ScriptCustomElementDefinition::HasConnectedCallback() const { - return !connected_callback_.IsEmpty(); + return connected_callback_; } bool ScriptCustomElementDefinition::HasDisconnectedCallback() const { - return !disconnected_callback_.IsEmpty(); + return disconnected_callback_; } bool ScriptCustomElementDefinition::HasAdoptedCallback() const { - return !adopted_callback_.IsEmpty(); -} - -void ScriptCustomElementDefinition::RunCallback( - v8::Local<v8::Function> callback, - Element* element, - int argc, - v8::Local<v8::Value> argv[]) { - DCHECK(ScriptState::Current(script_state_->GetIsolate()) == script_state_); - v8::Isolate* isolate = script_state_->GetIsolate(); - - // Invoke custom element reactions - // https://html.spec.whatwg.org/multipage/scripting.html#invoke-custom-element-reactions - // If this throws any exception, then report the exception. - v8::TryCatch try_catch(isolate); - try_catch.SetVerbose(true); - - ExecutionContext* execution_context = ExecutionContext::From(script_state_); - v8::Local<v8::Value> element_handle = - ToV8(element, script_state_->GetContext()->Global(), isolate); - V8ScriptRunner::CallFunction(callback, execution_context, element_handle, - argc, argv, isolate); + return adopted_callback_; } void ScriptCustomElementDefinition::RunConnectedCallback(Element* element) { - if (!script_state_->ContextIsValid()) + if (!connected_callback_) return; - ScriptState::Scope scope(script_state_); - v8::Isolate* isolate = script_state_->GetIsolate(); - RunCallback(connected_callback_.NewLocal(isolate), element); + + connected_callback_->InvokeAndReportException(element, Vector<ScriptValue>()); } void ScriptCustomElementDefinition::RunDisconnectedCallback(Element* element) { - if (!script_state_->ContextIsValid()) + if (!disconnected_callback_) return; - ScriptState::Scope scope(script_state_); - v8::Isolate* isolate = script_state_->GetIsolate(); - RunCallback(disconnected_callback_.NewLocal(isolate), element); + + disconnected_callback_->InvokeAndReportException(element, + Vector<ScriptValue>()); } void ScriptCustomElementDefinition::RunAdoptedCallback(Element* element, Document* old_owner, Document* new_owner) { - if (!script_state_->ContextIsValid()) + if (!adopted_callback_) return; - ScriptState::Scope scope(script_state_); - v8::Isolate* isolate = script_state_->GetIsolate(); - v8::Local<v8::Value> argv[] = { - ToV8(old_owner, script_state_->GetContext()->Global(), isolate), - ToV8(new_owner, script_state_->GetContext()->Global(), isolate)}; - RunCallback(adopted_callback_.NewLocal(isolate), element, base::size(argv), - argv); + + ScriptState* script_state = adopted_callback_->CallbackRelevantScriptState(); + if (!script_state->ContextIsValid()) + return; + ScriptState::Scope scope(script_state); + Vector<ScriptValue> args({ + ScriptValue(script_state, ToV8(old_owner, script_state)), + ScriptValue(script_state, ToV8(new_owner, script_state)), + }); + adopted_callback_->InvokeAndReportException(element, args); } void ScriptCustomElementDefinition::RunAttributeChangedCallback( @@ -329,17 +302,22 @@ const QualifiedName& name, const AtomicString& old_value, const AtomicString& new_value) { - if (!script_state_->ContextIsValid()) + if (!attribute_changed_callback_) return; - ScriptState::Scope scope(script_state_); - v8::Isolate* isolate = script_state_->GetIsolate(); - v8::Local<v8::Value> argv[] = { - V8String(isolate, name.LocalName()), V8StringOrNull(isolate, old_value), - V8StringOrNull(isolate, new_value), - V8StringOrNull(isolate, name.NamespaceURI()), - }; - RunCallback(attribute_changed_callback_.NewLocal(isolate), element, - base::size(argv), argv); + + v8::Isolate* isolate = attribute_changed_callback_->GetIsolate(); + ScriptState* script_state = + attribute_changed_callback_->CallbackRelevantScriptState(); + if (!script_state->ContextIsValid()) + return; + ScriptState::Scope scope(script_state); + Vector<ScriptValue> args({ + ScriptValue(script_state, V8String(isolate, name.LocalName())), + ScriptValue(script_state, V8StringOrNull(isolate, old_value)), + ScriptValue(script_state, V8StringOrNull(isolate, new_value)), + ScriptValue(script_state, V8StringOrNull(isolate, name.NamespaceURI())), + }); + attribute_changed_callback_->InvokeAndReportException(element, args); } } // namespace blink
diff --git a/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.h b/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.h index 611de74f..2c72214 100644 --- a/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.h +++ b/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.h
@@ -17,6 +17,8 @@ class CustomElementDescriptor; class CustomElementRegistry; +class V8CustomElementConstructor; +class V8Function; class CORE_EXPORT ScriptCustomElementDefinition final : public CustomElementDefinition { @@ -26,18 +28,18 @@ static ScriptCustomElementDefinition* ForConstructor( ScriptState*, CustomElementRegistry*, - const v8::Local<v8::Value>& constructor); + v8::Local<v8::Value> constructor); static ScriptCustomElementDefinition* Create( ScriptState*, CustomElementRegistry*, const CustomElementDescriptor&, CustomElementDefinition::Id, - const v8::Local<v8::Object>& constructor, - const v8::Local<v8::Function>& connected_callback, - const v8::Local<v8::Function>& disconnected_callback, - const v8::Local<v8::Function>& adopted_callback, - const v8::Local<v8::Function>& attribute_changed_callback, + V8CustomElementConstructor* constructor, + V8Function* connected_callback, + V8Function* disconnected_callback, + V8Function* adopted_callback, + V8Function* attribute_changed_callback, HashSet<AtomicString>&& observed_attributes, CSSStyleSheet*); @@ -65,16 +67,15 @@ const AtomicString& new_value) override; private: - ScriptCustomElementDefinition( - ScriptState*, - const CustomElementDescriptor&, - const v8::Local<v8::Object>& constructor, - const v8::Local<v8::Function>& connected_callback, - const v8::Local<v8::Function>& disconnected_callback, - const v8::Local<v8::Function>& adopted_callback, - const v8::Local<v8::Function>& attribute_changed_callback, - HashSet<AtomicString>&& observed_attributes, - CSSStyleSheet*); + ScriptCustomElementDefinition(ScriptState*, + const CustomElementDescriptor&, + V8CustomElementConstructor* constructor, + V8Function* connected_callback, + V8Function* disconnected_callback, + V8Function* adopted_callback, + V8Function* attribute_changed_callback, + HashSet<AtomicString>&& observed_attributes, + CSSStyleSheet*); // Implementations of |CustomElementDefinition| ScriptValue GetConstructorForScript() final; @@ -83,22 +84,17 @@ // Calls the constructor. The script scope, etc. must already be set up. Element* CallConstructor(); - void RunCallback(v8::Local<v8::Function>, - Element*, - int argc = 0, - v8::Local<v8::Value> argv[] = nullptr); - HTMLElement* HandleCreateElementSyncException(Document&, const QualifiedName& tag_name, v8::Isolate*, ExceptionState&); Member<ScriptState> script_state_; - TraceWrapperV8Reference<v8::Object> constructor_; - TraceWrapperV8Reference<v8::Function> connected_callback_; - TraceWrapperV8Reference<v8::Function> disconnected_callback_; - TraceWrapperV8Reference<v8::Function> adopted_callback_; - TraceWrapperV8Reference<v8::Function> attribute_changed_callback_; + TraceWrapperMember<V8CustomElementConstructor> constructor_; + TraceWrapperMember<V8Function> connected_callback_; + TraceWrapperMember<V8Function> disconnected_callback_; + TraceWrapperMember<V8Function> adopted_callback_; + TraceWrapperMember<V8Function> attribute_changed_callback_; }; } // namespace blink
diff --git a/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition_builder.cc b/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition_builder.cc index 9896762..a990781f 100644 --- a/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition_builder.cc +++ b/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition_builder.cc
@@ -9,7 +9,10 @@ #include "third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.h" #include "third_party/blink/renderer/bindings/core/v8/script_value.h" #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_custom_element_constructor.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_function.h" #include "third_party/blink/renderer/core/css/css_style_sheet.h" +#include "third_party/blink/renderer/platform/bindings/callback_method_retriever.h" #include "third_party/blink/renderer/platform/bindings/dom_wrapper_world.h" #include "third_party/blink/renderer/platform/bindings/exception_state.h" #include "third_party/blink/renderer/platform/bindings/script_state.h" @@ -21,22 +24,17 @@ ScriptState* script_state, CustomElementRegistry* registry, CSSStyleSheet* default_style_sheet, - const ScriptValue& constructor, + V8CustomElementConstructor* constructor, ExceptionState& exception_state) : script_state_(script_state), + exception_state_(exception_state), registry_(registry), default_style_sheet_(default_style_sheet), - constructor_value_(constructor.V8Value()), - exception_state_(exception_state) {} + constructor_(constructor) {} bool ScriptCustomElementDefinitionBuilder::CheckConstructorIntrinsics() { DCHECK(script_state_->World().IsMainWorld()); - // The signature of CustomElementRegistry.define says this is a - // Function - // https://html.spec.whatwg.org/multipage/scripting.html#customelementsregistry - CHECK(constructor_value_->IsFunction()); - constructor_ = constructor_value_.As<v8::Object>(); if (!constructor_->IsConstructor()) { exception_state_.ThrowTypeError( "constructor argument is not a constructor"); @@ -46,8 +44,8 @@ } bool ScriptCustomElementDefinitionBuilder::CheckConstructorNotRegistered() { - if (!ScriptCustomElementDefinition::ForConstructor(script_state_, registry_, - constructor_)) + if (!ScriptCustomElementDefinition::ForConstructor( + script_state_, registry_, constructor_->CallbackObject())) return true; // Constructor is already registered. @@ -57,99 +55,78 @@ return false; } -bool ScriptCustomElementDefinitionBuilder::ValueForName( - v8::Isolate* isolate, - v8::Local<v8::Context>& context, - const v8::TryCatch& try_catch, - const v8::Local<v8::Object>& object, - const StringView& name, - v8::Local<v8::Value>& value) const { - v8::Local<v8::String> name_string = V8AtomicString(isolate, name); - if (!object->Get(context, name_string).ToLocal(&value)) { - exception_state_.RethrowV8Exception(try_catch.Exception()); - return false; - } - return script_state_->ContextIsValid(); -} - -bool ScriptCustomElementDefinitionBuilder::CheckPrototype() { - v8::Isolate* isolate = script_state_->GetIsolate(); - v8::Local<v8::Context> context = script_state_->GetContext(); - v8::TryCatch try_catch(isolate); - v8::Local<v8::Value> prototype_value; - if (!ValueForName(isolate, context, try_catch, constructor_, "prototype", - prototype_value)) - return false; - if (!prototype_value->IsObject()) { - exception_state_.ThrowTypeError("constructor prototype is not an object"); - return false; - } - prototype_ = prototype_value.As<v8::Object>(); - // If retrieving the prototype destroyed the context, indicate that - // defining the element should not proceed. - return true; -} - -bool ScriptCustomElementDefinitionBuilder::CallableForName( - v8::Isolate* isolate, - v8::Local<v8::Context>& context, - const v8::TryCatch& try_catch, - const StringView& name, - v8::Local<v8::Function>& callback) const { - v8::Local<v8::Value> value; - if (!ValueForName(isolate, context, try_catch, prototype_, name, value)) - return false; - // "undefined" means "omitted", which is valid. - if (value->IsUndefined()) - return true; - if (!value->IsFunction()) { - exception_state_.ThrowTypeError(String::Format( - "\"%s\" is not a callable object", name.ToString().Ascii().data())); - return false; - } - callback = value.As<v8::Function>(); - return true; -} - -bool ScriptCustomElementDefinitionBuilder::RetrieveObservedAttributes( - v8::Isolate* isolate, - v8::Local<v8::Context>& context, - const v8::TryCatch& try_catch) { - v8::Local<v8::Value> observed_attributes_value; - if (!ValueForName(isolate, context, try_catch, constructor_, - "observedAttributes", observed_attributes_value)) - return false; - if (observed_attributes_value->IsUndefined()) - return true; - Vector<String> list = NativeValueTraits<IDLSequence<IDLString>>::NativeValue( - isolate, observed_attributes_value, exception_state_); - if (exception_state_.HadException() || !script_state_->ContextIsValid()) - return false; - if (list.IsEmpty()) - return true; - observed_attributes_.ReserveCapacityForSize(list.size()); - for (const auto& attribute : list) - observed_attributes_.insert(AtomicString(attribute)); - return true; -} - bool ScriptCustomElementDefinitionBuilder::RememberOriginalProperties() { - // Spec requires to use values of these properties at the point - // CustomElementDefinition is built, even if JS changes them afterwards. - v8::Isolate* isolate = script_state_->GetIsolate(); - v8::Local<v8::Context> context = script_state_->GetContext(); - v8::TryCatch try_catch(isolate); - return CallableForName(isolate, context, try_catch, "connectedCallback", - connected_callback_) && - CallableForName(isolate, context, try_catch, "disconnectedCallback", - disconnected_callback_) && - CallableForName(isolate, context, try_catch, "adoptedCallback", - adopted_callback_) && - CallableForName(isolate, context, try_catch, - "attributeChangedCallback", - attribute_changed_callback_) && - (attribute_changed_callback_.IsEmpty() || - RetrieveObservedAttributes(isolate, context, try_catch)); + // https://html.spec.whatwg.org/C/custom-elements.html#element-definition + // step 10. Run the following substeps while catching any exceptions: + CallbackMethodRetriever retriever(constructor_); + + retriever.GetPrototypeObject(exception_state_); + if (exception_state_.HadException()) + return false; + + v8_connected_callback_ = + retriever.GetMethodOrUndefined("connectedCallback", exception_state_); + if (exception_state_.HadException()) + return false; + if (v8_connected_callback_->IsFunction()) { + connected_callback_ = + V8Function::Create(v8_connected_callback_.As<v8::Function>()); + } + v8_disconnected_callback_ = + retriever.GetMethodOrUndefined("disconnectedCallback", exception_state_); + if (exception_state_.HadException()) + return false; + if (v8_disconnected_callback_->IsFunction()) { + disconnected_callback_ = + V8Function::Create(v8_disconnected_callback_.As<v8::Function>()); + } + v8_adopted_callback_ = + retriever.GetMethodOrUndefined("adoptedCallback", exception_state_); + if (exception_state_.HadException()) + return false; + if (v8_adopted_callback_->IsFunction()) { + adopted_callback_ = + V8Function::Create(v8_adopted_callback_.As<v8::Function>()); + } + v8_attribute_changed_callback_ = retriever.GetMethodOrUndefined( + "attributeChangedCallback", exception_state_); + if (exception_state_.HadException()) + return false; + if (v8_attribute_changed_callback_->IsFunction()) { + attribute_changed_callback_ = + V8Function::Create(v8_attribute_changed_callback_.As<v8::Function>()); + } + + // step 10.6. If the value of the entry in lifecycleCallbacks with key + // "attributeChangedCallback" is not null, then: + if (attribute_changed_callback_) { + v8::Isolate* isolate = script_state_->GetIsolate(); + v8::Local<v8::Context> current_context = isolate->GetCurrentContext(); + v8::TryCatch try_catch(script_state_->GetIsolate()); + v8::Local<v8::Value> v8_observed_attributes; + + if (!constructor_->CallbackObject() + ->Get(current_context, + V8AtomicString(isolate, "observedAttributes")) + .ToLocal(&v8_observed_attributes)) { + exception_state_.RethrowV8Exception(try_catch.Exception()); + return false; + } + + if (v8_observed_attributes->IsUndefined()) + return true; + + const Vector<String>& observed_attrs = + NativeValueTraits<IDLSequence<IDLString>>::NativeValue( + isolate, v8_observed_attributes, exception_state_); + if (exception_state_.HadException()) + return false; + observed_attributes_.ReserveCapacityForSize(observed_attrs.size()); + for (const auto& attribute : observed_attrs) + observed_attributes_.insert(AtomicString(attribute)); + } + + return true; } CustomElementDefinition* ScriptCustomElementDefinitionBuilder::Build(
diff --git a/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition_builder.h b/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition_builder.h index a6c6f98..f794d60 100644 --- a/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition_builder.h +++ b/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition_builder.h
@@ -23,7 +23,8 @@ class CustomElementRegistry; class ExceptionState; class ScriptState; -class ScriptValue; +class V8CustomElementConstructor; +class V8Function; class CORE_EXPORT ScriptCustomElementDefinitionBuilder : public CustomElementDefinitionBuilder { @@ -31,51 +32,37 @@ WTF_MAKE_NONCOPYABLE(ScriptCustomElementDefinitionBuilder); public: - ScriptCustomElementDefinitionBuilder( - ScriptState*, - CustomElementRegistry*, - CSSStyleSheet*, - const ScriptValue& constructor_script_value, - ExceptionState&); + ScriptCustomElementDefinitionBuilder(ScriptState*, + CustomElementRegistry*, + CSSStyleSheet*, + V8CustomElementConstructor* constructor, + ExceptionState&); ~ScriptCustomElementDefinitionBuilder() = default; bool CheckConstructorIntrinsics() override; bool CheckConstructorNotRegistered() override; - bool CheckPrototype() override; bool RememberOriginalProperties() override; CustomElementDefinition* Build(const CustomElementDescriptor&, CustomElementDefinition::Id) override; private: - static ScriptCustomElementDefinitionBuilder* stack_; - Member<ScriptState> script_state_; + ExceptionState& exception_state_; Member<CustomElementRegistry> registry_; const Member<CSSStyleSheet> default_style_sheet_; - v8::Local<v8::Value> constructor_value_; - v8::Local<v8::Object> constructor_; - v8::Local<v8::Object> prototype_; - v8::Local<v8::Function> connected_callback_; - v8::Local<v8::Function> disconnected_callback_; - v8::Local<v8::Function> adopted_callback_; - v8::Local<v8::Function> attribute_changed_callback_; + const Member<V8CustomElementConstructor> constructor_; + // These v8::Local handles on stack make the function objects alive until we + // finish building the CustomElementDefinition and wrapper-tracing on it gets + // available. + v8::Local<v8::Value> v8_connected_callback_; + v8::Local<v8::Value> v8_disconnected_callback_; + v8::Local<v8::Value> v8_adopted_callback_; + v8::Local<v8::Value> v8_attribute_changed_callback_; + Member<V8Function> connected_callback_; + Member<V8Function> disconnected_callback_; + Member<V8Function> adopted_callback_; + Member<V8Function> attribute_changed_callback_; HashSet<AtomicString> observed_attributes_; - ExceptionState& exception_state_; - - bool ValueForName(v8::Isolate*, - v8::Local<v8::Context>&, - const v8::TryCatch&, - const v8::Local<v8::Object>&, - const StringView&, - v8::Local<v8::Value>&) const; - bool CallableForName(v8::Isolate*, - v8::Local<v8::Context>&, - const v8::TryCatch&, - const StringView&, - v8::Local<v8::Function>&) const; - bool RetrieveObservedAttributes(v8::Isolate*, - v8::Local<v8::Context>&, - const v8::TryCatch&); }; } // namespace blink
diff --git a/third_party/blink/renderer/bindings/scripts/v8_types.py b/third_party/blink/renderer/bindings/scripts/v8_types.py index 5b90f734..dec01b8 100644 --- a/third_party/blink/renderer/bindings/scripts/v8_types.py +++ b/third_party/blink/renderer/bindings/scripts/v8_types.py
@@ -86,7 +86,12 @@ 'DataView', 'SharedArrayBuffer', ])) - +# We have an unfortunate hack that treats types whose name ends with +# 'Constructor' as aliases to IDL interface object. This white list is used to +# disable the hack. +_CALLBACK_CONSTRUCTORS = frozenset(( + 'CustomElementConstructor', +)) IdlType.is_array_buffer_or_view = property( lambda self: self.base_type in ARRAY_BUFFER_AND_VIEW_TYPES) @@ -458,7 +463,8 @@ # and these do not have header files, as they are part of the generated # bindings for the interface return set() - if base_idl_type.endswith('Constructor'): + if (base_idl_type.endswith('Constructor') and + base_idl_type not in _CALLBACK_CONSTRUCTORS): # FIXME: replace with a [ConstructorAttribute] extended attribute base_idl_type = idl_type.constructor_type_name if idl_type.is_custom_callback_function:
diff --git a/third_party/blink/renderer/core/animation/effect_stack_test.cc b/third_party/blink/renderer/core/animation/effect_stack_test.cc index d06ab0e..0ccd068 100644 --- a/third_party/blink/renderer/core/animation/effect_stack_test.cc +++ b/third_party/blink/renderer/core/animation/effect_stack_test.cc
@@ -176,8 +176,6 @@ // Because we will be forcing a naive GC that assumes there are no Oilpan // objects on the stack (e.g. passes BlinkGC::kNoHeapPointersOnStack), we have // to keep the ActiveInterpolationsMap in a Persistent. - // TODO(crbug.com/876331): We should be able to use a PersistentHeapHashMap - // here, but the operator=, copy, and move overloads do not work properly. Persistent<ActiveInterpolationsMap> interpolations; UpdateTimeline(TimeDelta::FromSeconds(11));
diff --git a/third_party/blink/renderer/core/animation/scroll_timeline.cc b/third_party/blink/renderer/core/animation/scroll_timeline.cc index ca0e67b0..5cd324d 100644 --- a/third_party/blink/renderer/core/animation/scroll_timeline.cc +++ b/third_party/blink/renderer/core/animation/scroll_timeline.cc
@@ -15,9 +15,10 @@ namespace blink { namespace { -using ActiveScrollTimelineSet = PersistentHeapHashCountedSet<WeakMember<Node>>; +using ActiveScrollTimelineSet = HeapHashCountedSet<WeakMember<Node>>; ActiveScrollTimelineSet& GetActiveScrollTimelineSet() { - DEFINE_STATIC_LOCAL(ActiveScrollTimelineSet, set, ()); + DEFINE_STATIC_LOCAL(ActiveScrollTimelineSet, set, + (new ActiveScrollTimelineSet)); return set; }
diff --git a/third_party/blink/renderer/core/css/css_crossfade_value.cc b/third_party/blink/renderer/core/css/css_crossfade_value.cc index 707c838..9d019aa 100644 --- a/third_party/blink/renderer/core/css/css_crossfade_value.cc +++ b/third_party/blink/renderer/core/css/css_crossfade_value.cc
@@ -35,26 +35,26 @@ namespace blink { namespace cssvalue { -static bool SubimageIsPending(CSSValue* value) { - if (value->IsImageValue()) - return ToCSSImageValue(value)->IsCachePending(); +static bool SubimageIsPending(const CSSValue& value) { + if (value.IsImageValue()) + return ToCSSImageValue(value).IsCachePending(); - if (value->IsImageGeneratorValue()) - return ToCSSImageGeneratorValue(value)->IsPending(); + if (value.IsImageGeneratorValue()) + return ToCSSImageGeneratorValue(value).IsPending(); NOTREACHED(); return false; } -static bool SubimageKnownToBeOpaque(CSSValue* value, +static bool SubimageKnownToBeOpaque(const CSSValue& value, const Document& document, const ComputedStyle& style) { - if (value->IsImageValue()) - return ToCSSImageValue(value)->KnownToBeOpaque(document, style); + if (value.IsImageValue()) + return ToCSSImageValue(value).KnownToBeOpaque(document, style); - if (value->IsImageGeneratorValue()) - return ToCSSImageGeneratorValue(value)->KnownToBeOpaque(document, style); + if (value.IsImageGeneratorValue()) + return ToCSSImageGeneratorValue(value).KnownToBeOpaque(document, style); NOTREACHED(); @@ -98,11 +98,11 @@ return cached_image->GetImage(); } -static KURL UrlForCSSValue(const CSSValue* value) { - if (!value->IsImageValue()) +static KURL UrlForCSSValue(const CSSValue& value) { + if (!value.IsImageValue()) return KURL(); - return KURL(ToCSSImageValue(*value).Url()); + return KURL(ToCSSImageValue(value).Url()); } CSSCrossfadeValue::CSSCrossfadeValue(CSSValue* from_value, @@ -189,14 +189,13 @@ } bool CSSCrossfadeValue::IsPending() const { - return SubimageIsPending(from_value_.Get()) || - SubimageIsPending(to_value_.Get()); + return SubimageIsPending(*from_value_) || SubimageIsPending(*to_value_); } bool CSSCrossfadeValue::KnownToBeOpaque(const Document& document, const ComputedStyle& style) const { - return SubimageKnownToBeOpaque(from_value_.Get(), document, style) && - SubimageKnownToBeOpaque(to_value_.Get(), document, style); + return SubimageKnownToBeOpaque(*from_value_, document, style) && + SubimageKnownToBeOpaque(*to_value_, document, style); } void CSSCrossfadeValue::LoadSubimages(const Document& document) { @@ -240,13 +239,15 @@ scoped_refptr<Image> from_image_ref(from_image); scoped_refptr<Image> to_image_ref(to_image); - if (from_image->IsSVGImage()) + if (from_image->IsSVGImage()) { from_image_ref = SVGImageForContainer::Create( - ToSVGImage(from_image), size, 1, UrlForCSSValue(from_value_.Get())); + ToSVGImage(from_image), size, 1, UrlForCSSValue(*from_value_)); + } - if (to_image->IsSVGImage()) - to_image_ref = SVGImageForContainer::Create( - ToSVGImage(to_image), size, 1, UrlForCSSValue(to_value_.Get())); + if (to_image->IsSVGImage()) { + to_image_ref = SVGImageForContainer::Create(ToSVGImage(to_image), size, 1, + UrlForCSSValue(*to_value_)); + } return CrossfadeGeneratedImage::Create(from_image_ref, to_image_ref, percentage_value_->GetFloatValue(),
diff --git a/third_party/blink/renderer/core/css/css_style_rule.cc b/third_party/blink/renderer/core/css/css_style_rule.cc index e709aff..eedc5dac 100644 --- a/third_party/blink/renderer/core/css/css_style_rule.cc +++ b/third_party/blink/renderer/core/css/css_style_rule.cc
@@ -33,11 +33,10 @@ namespace blink { -using SelectorTextCache = - PersistentHeapHashMap<WeakMember<const CSSStyleRule>, String>; +using SelectorTextCache = HeapHashMap<WeakMember<const CSSStyleRule>, String>; static SelectorTextCache& GetSelectorTextCache() { - DEFINE_STATIC_LOCAL(SelectorTextCache, cache, ()); + DEFINE_STATIC_LOCAL(SelectorTextCache, cache, (new SelectorTextCache)); return cache; }
diff --git a/third_party/blink/renderer/core/css/properties/computed_style_utils.cc b/third_party/blink/renderer/core/css/properties/computed_style_utils.cc index 547b35f..bb3dfcc 100644 --- a/third_party/blink/renderer/core/css/properties/computed_style_utils.cc +++ b/third_party/blink/renderer/core/css/properties/computed_style_utils.cc
@@ -514,18 +514,23 @@ const CSSProperty& property, const LayoutObject* layout_object) { std::pair<const Length*, const Length*> positions; + bool is_horizontal_property; switch (property.PropertyID()) { case CSSPropertyLeft: positions = std::make_pair(&style.Left(), &style.Right()); + is_horizontal_property = true; break; case CSSPropertyRight: positions = std::make_pair(&style.Right(), &style.Left()); + is_horizontal_property = true; break; case CSSPropertyTop: positions = std::make_pair(&style.Top(), &style.Bottom()); + is_horizontal_property = false; break; case CSSPropertyBottom: positions = std::make_pair(&style.Bottom(), &style.Top()); + is_horizontal_property = false; break; default: NOTREACHED(); @@ -539,8 +544,8 @@ if (offset.IsPercentOrCalc() && layout_object && layout_object->IsBox() && layout_object->IsPositioned()) { LayoutUnit containing_block_size = - (property.IDEquals(CSSPropertyLeft) || - property.IDEquals(CSSPropertyRight)) + is_horizontal_property == + layout_object->ContainingBlock()->IsHorizontalWritingMode() ? ToLayoutBox(layout_object) ->ContainingBlockLogicalWidthForContent() : ToLayoutBox(layout_object) @@ -567,8 +572,8 @@ if (opposite.IsPercentOrCalc()) { if (layout_object->IsBox()) { LayoutUnit containing_block_size = - (property.IDEquals(CSSPropertyLeft) || - property.IDEquals(CSSPropertyRight)) + is_horizontal_property == layout_object->ContainingBlock() + ->IsHorizontalWritingMode() ? ToLayoutBox(layout_object) ->ContainingBlockLogicalWidthForContent() : ToLayoutBox(layout_object)
diff --git a/third_party/blink/renderer/core/css/resolver/css_variable_resolver.cc b/third_party/blink/renderer/core/css/resolver/css_variable_resolver.cc index 12607fd..769dc7d 100644 --- a/third_party/blink/renderer/core/css/resolver/css_variable_resolver.cc +++ b/third_party/blink/renderer/core/css/resolver/css_variable_resolver.cc
@@ -532,11 +532,11 @@ Options options; if (inherited_variables_) { - for (auto& variable : inherited_variables_->registered_data_) + for (auto& variable : *inherited_variables_->registered_data_) ValueForCustomProperty(variable.key, options); } if (non_inherited_variables_) { - for (auto& variable : non_inherited_variables_->registered_data_) + for (auto& variable : *non_inherited_variables_->registered_data_) ValueForCustomProperty(variable.key, options); } }
diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc index 58813ca..fcab90ce 100644 --- a/third_party/blink/renderer/core/dom/document.cc +++ b/third_party/blink/renderer/core/dom/document.cc
@@ -292,8 +292,7 @@ #include "third_party/blink/renderer/platform/wtf/time.h" #ifndef NDEBUG -using WeakDocumentSet = - blink::PersistentHeapHashSet<blink::WeakMember<blink::Document>>; +using WeakDocumentSet = blink::HeapHashSet<blink::WeakMember<blink::Document>>; static WeakDocumentSet& liveDocumentSet(); #endif @@ -7636,7 +7635,7 @@ #ifndef NDEBUG static WeakDocumentSet& liveDocumentSet() { - DEFINE_STATIC_LOCAL(WeakDocumentSet, set, ()); + DEFINE_STATIC_LOCAL(WeakDocumentSet, set, (new WeakDocumentSet)); return set; }
diff --git a/third_party/blink/renderer/core/dom/document.idl b/third_party/blink/renderer/core/dom/document.idl index 3ef2906..072e5a8 100644 --- a/third_party/blink/renderer/core/dom/document.idl +++ b/third_party/blink/renderer/core/dom/document.idl
@@ -173,7 +173,7 @@ // Custom Elements // https://w3c.github.io/webcomponents/spec/custom/#extensions-to-document-interface-to-register // FIXME: The registerElement return type should be Function. - [RuntimeEnabled=CustomElementsV0, CallWith=ScriptState, CustomElementCallbacks, RaisesException, DeprecateAs=DocumentRegisterElement] CustomElementConstructor registerElement(DOMString type, optional ElementRegistrationOptions options); + [RuntimeEnabled=CustomElementsV0, CallWith=ScriptState, CustomElementCallbacks, RaisesException, DeprecateAs=DocumentRegisterElement] any registerElement(DOMString type, optional ElementRegistrationOptions options); // https://w3c.github.io/webcomponents/spec/custom/#extensions-to-document-interface-to-instantiate // FIXME: The typeExtension arguments should not be nullable. [CustomElementCallbacks, PerWorldBindings, RaisesException, ImplementedAs=CreateElementForBinding] Element createElement(DOMString localName, (DOMString or Dictionary)? options);
diff --git a/third_party/blink/renderer/core/dom/node.cc b/third_party/blink/renderer/core/dom/node.cc index 1502662..17537d8 100644 --- a/third_party/blink/renderer/core/dom/node.cc +++ b/third_party/blink/renderer/core/dom/node.cc
@@ -2107,10 +2107,9 @@ } using EventTargetDataMap = - PersistentHeapHashMap<WeakMember<Node>, - TraceWrapperMember<EventTargetData>>; + HeapHashMap<WeakMember<Node>, TraceWrapperMember<EventTargetData>>; static EventTargetDataMap& GetEventTargetDataMap() { - DEFINE_STATIC_LOCAL(EventTargetDataMap, map, ()); + DEFINE_STATIC_LOCAL(EventTargetDataMap, map, (new EventTargetDataMap)); return map; }
diff --git a/third_party/blink/renderer/core/dom/slot_assignment.h b/third_party/blink/renderer/core/dom/slot_assignment.h index 6e239a3..31facab 100644 --- a/third_party/blink/renderer/core/dom/slot_assignment.h +++ b/third_party/blink/renderer/core/dom/slot_assignment.h
@@ -84,16 +84,13 @@ const AtomicString& slot_name, SlotMutationType); - // For Non-Incremental Shadow DOM - void RecalcAssignmentForDistribution(); - HeapVector<Member<HTMLSlotElement>> slots_; Member<TreeOrderedMap> slot_map_; WeakMember<ShadowRoot> owner_; HeapHashMap<Member<Node>, HeapVector<Member<HTMLSlotElement>>> node_to_assigned_slot_candidate_in_tree_order_; unsigned needs_collect_slots_ : 1; - unsigned needs_assignment_recalc_ : 1; // For Incremental Shadow DOM + unsigned needs_assignment_recalc_ : 1; unsigned slot_count_ : 30; };
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 c6c7154..f23aeb9f 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -1570,14 +1570,6 @@ PageWidgetDelegate::Animate(*page_, last_frame_time); } -void WebViewImpl::RecordEndOfFrameMetrics(base::TimeTicks frame_begin_time) { - if (!MainFrameImpl()) - return; - - MainFrameImpl()->GetFrame()->View()->RecordEndOfFrameMetrics( - frame_begin_time); -} - void WebViewImpl::UpdateLifecycle(LifecycleUpdate requested_update) { TRACE_EVENT0("blink", "WebViewImpl::updateAllLifecyclePhases"); if (!MainFrameImpl())
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h index b1399b1..42be0ae 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.h +++ b/third_party/blink/renderer/core/exported/web_view_impl.h
@@ -116,7 +116,6 @@ void SetSuppressFrameRequestsWorkaroundFor704763Only(bool) override; void BeginFrame(base::TimeTicks last_frame_time) override; - void RecordEndOfFrameMetrics(base::TimeTicks frame_begin_time) override; void UpdateLifecycle(LifecycleUpdate requested_update) override; void UpdateAllLifecyclePhasesAndCompositeForTesting() override;
diff --git a/third_party/blink/renderer/core/frame/BUILD.gn b/third_party/blink/renderer/core/frame/BUILD.gn index 3bd04766..8b0e7cc 100644 --- a/third_party/blink/renderer/core/frame/BUILD.gn +++ b/third_party/blink/renderer/core/frame/BUILD.gn
@@ -88,8 +88,6 @@ "local_frame.cc", "local_frame.h", "local_frame_client.h", - "local_frame_ukm_aggregator.cc", - "local_frame_ukm_aggregator.h", "local_frame_view.cc", "local_frame_view.h", "location.cc",
diff --git a/third_party/blink/renderer/core/frame/fullscreen_controller.cc b/third_party/blink/renderer/core/frame/fullscreen_controller.cc index 1a86366..4cd4d33 100644 --- a/third_party/blink/renderer/core/frame/fullscreen_controller.cc +++ b/third_party/blink/renderer/core/frame/fullscreen_controller.cc
@@ -64,7 +64,8 @@ } FullscreenController::FullscreenController(WebViewImpl* web_view_base) - : web_view_base_(web_view_base) {} + : web_view_base_(web_view_base), + pending_frames_(new PendingFullscreenSet) {} void FullscreenController::DidEnterFullscreen() { // |Browser::EnterFullscreenModeForTab()| can enter fullscreen without going @@ -80,7 +81,7 @@ state_ = State::kFullscreen; // Notify all pending local frames in order that we have entered fullscreen. - for (LocalFrame* frame : pending_frames_) { + for (LocalFrame* frame : *pending_frames_) { if (frame) { if (Document* document = frame->GetDocument()) Fullscreen::DidEnterFullscreen(*document); @@ -95,7 +96,7 @@ if (Document* document = ToLocalFrame(frame)->GetDocument()) Fullscreen::DidEnterFullscreen(*document); } - pending_frames_.clear(); + pending_frames_->clear(); // TODO(foolip): If the top level browsing context (main frame) ends up with // no fullscreen element, exit fullscreen again to recover. @@ -162,7 +163,7 @@ web_view_base_->BackgroundColorOverride(); } - pending_frames_.insert(&frame); + pending_frames_->insert(&frame); // If already entering fullscreen, just wait. if (state_ == State::kEnteringFullscreen)
diff --git a/third_party/blink/renderer/core/frame/fullscreen_controller.h b/third_party/blink/renderer/core/frame/fullscreen_controller.h index 01f3b82..5a061e02 100644 --- a/third_party/blink/renderer/core/frame/fullscreen_controller.h +++ b/third_party/blink/renderer/core/frame/fullscreen_controller.h
@@ -93,9 +93,8 @@ bool initial_background_color_override_enabled_ = false; RGBA32 initial_background_color_override_ = Color::kTransparent; - using PendingFullscreenSet = - PersistentHeapLinkedHashSet<WeakMember<LocalFrame>>; - PendingFullscreenSet pending_frames_; + using PendingFullscreenSet = HeapLinkedHashSet<WeakMember<LocalFrame>>; + Persistent<PendingFullscreenSet> pending_frames_; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/frame/local_dom_window.cc b/third_party/blink/renderer/core/frame/local_dom_window.cc index 62ceb16..bc97baf2 100644 --- a/third_party/blink/renderer/core/frame/local_dom_window.cc +++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
@@ -187,16 +187,17 @@ added_listener, disabler_type); } -using DOMWindowSet = PersistentHeapHashCountedSet<WeakMember<LocalDOMWindow>>; +using DOMWindowSet = HeapHashCountedSet<WeakMember<LocalDOMWindow>>; static DOMWindowSet& WindowsWithUnloadEventListeners() { - DEFINE_STATIC_LOCAL(DOMWindowSet, windows_with_unload_event_listeners, ()); + DEFINE_STATIC_LOCAL(DOMWindowSet, windows_with_unload_event_listeners, + (new DOMWindowSet)); return windows_with_unload_event_listeners; } static DOMWindowSet& WindowsWithBeforeUnloadEventListeners() { DEFINE_STATIC_LOCAL(DOMWindowSet, windows_with_before_unload_event_listeners, - ()); + (new DOMWindowSet)); return windows_with_before_unload_event_listeners; }
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc index c46f76f..99f2111c 100644 --- a/third_party/blink/renderer/core/frame/local_frame.cc +++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -950,7 +950,7 @@ !GetSecurityContext()->IsSandboxed(kSandboxTopNavigation) && target_frame == Tree().Top()) { DEFINE_STATIC_LOCAL(EnumerationHistogram, framebust_histogram, - ("WebCore.Framebust", 8)); + ("WebCore.Framebust2", 8)); const unsigned kUserGestureBit = 0x1; const unsigned kAllowedBit = 0x2; const unsigned kAdBit = 0x4;
diff --git a/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.cc b/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.cc deleted file mode 100644 index d967442..0000000 --- a/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.cc +++ /dev/null
@@ -1,230 +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 "third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.h" - -#include "services/metrics/public/cpp/ukm_entry_builder.h" -#include "services/metrics/public/cpp/ukm_recorder.h" -#include "third_party/blink/renderer/platform/histogram.h" -#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" -#include "third_party/blink/renderer/platform/wtf/time.h" -#include "third_party/blink/renderer/platform/wtf/vector.h" - -namespace blink { - -LocalFrameUkmAggregator::ScopedUkmHierarchicalTimer::ScopedUkmHierarchicalTimer( - LocalFrameUkmAggregator* aggregator, - size_t metric_index) - : aggregator_(aggregator), - metric_index_(metric_index), - start_time_(CurrentTimeTicks()) {} - -LocalFrameUkmAggregator::ScopedUkmHierarchicalTimer::ScopedUkmHierarchicalTimer( - ScopedUkmHierarchicalTimer&& other) - : aggregator_(other.aggregator_), - metric_index_(other.metric_index_), - start_time_(other.start_time_) { - other.aggregator_ = nullptr; -} - -LocalFrameUkmAggregator::ScopedUkmHierarchicalTimer:: - ~ScopedUkmHierarchicalTimer() { - if (aggregator_ && base::TimeTicks::IsHighResolution()) { - aggregator_->RecordSample(metric_index_, start_time_, CurrentTimeTicks()); - } -} - -LocalFrameUkmAggregator::LocalFrameUkmAggregator(int64_t source_id, - ukm::UkmRecorder* recorder) - : source_id_(source_id), - recorder_(recorder), - event_name_("Blink.UpdateTime"), - event_frequency_(TimeDelta::FromSeconds(30)), - last_flushed_time_(CurrentTimeTicks()) { - // Record average and worst case for the primary metric. - primary_metric_.worst_case_metric_name = "MainFrame.WorstCase"; - primary_metric_.average_metric_name = "MainFrame.Average"; - - // Define the UMA for the primary metric. - primary_metric_.uma_counter.reset( - new CustomCountHistogram("Blink.MainFrame.UpdateTime", 0, 10000000, 50)); - - // Set up the substrings to create the UMA names - const String uma_preamble = "Blink."; - const String uma_postscript = ".UpdateTime"; - const String uma_ratio_preamble = "Blink.MainFrame."; - const String uma_ratio_postscript = "Ratio"; - - // Set up sub-strings for the bucketed UMA metrics - Vector<String> threshold_substrings; - if (!bucket_thresholds_.size()) { - threshold_substrings.push_back(".All"); - } else { - threshold_substrings.push_back( - String::Format(".LessThan%lums", - (unsigned long)bucket_thresholds_[0].InMilliseconds())); - for (wtf_size_t i = 1; i < bucket_thresholds_.size(); ++i) { - threshold_substrings.push_back(String::Format( - ".%lumsTo%lums", - (unsigned long)bucket_thresholds_[i - 1].InMilliseconds(), - (unsigned long)bucket_thresholds_[i].InMilliseconds())); - } - threshold_substrings.push_back(String::Format( - ".MoreThan%lums", - (unsigned long)bucket_thresholds_[bucket_thresholds_.size() - 1] - .InMilliseconds())); - } - - // Populate all the sub-metrics. - absolute_metric_records_.ReserveInitialCapacity(kCount); - ratio_metric_records_.ReserveInitialCapacity(kCount); - for (unsigned i = 0; i < (unsigned)kCount; ++i) { - const auto& metric_name = metric_strings_[i]; - - // Absolute records report the absolute time for each metric, both - // average and worst case. They have an associated UMA too that we - // own and allocate here. - auto& absolute_record = absolute_metric_records_.emplace_back(); - absolute_record.worst_case_metric_name = metric_name; - absolute_record.worst_case_metric_name.append(".WorstCase"); - absolute_record.average_metric_name = metric_name; - absolute_record.average_metric_name.append(".Average"); - auto uma_name = uma_preamble; - uma_name.append(metric_name); - uma_name.append(uma_postscript); - absolute_record.uma_counter.reset( - new CustomCountHistogram(uma_name.Utf8().data(), 0, 10000000, 50)); - - // Ratio records report the ratio of each metric to the primary metric, - // average and worst case. UMA counters are also associated with the - // ratios and we allocate and own them here. - auto& ratio_record = ratio_metric_records_.emplace_back(); - ratio_record.worst_case_metric_name = metric_name; - ratio_record.worst_case_metric_name.append(".WorstCaseRatio"); - ratio_record.average_metric_name = metric_name; - ratio_record.average_metric_name.append(".AverageRatio"); - for (auto bucket_substring : threshold_substrings) { - String uma_name = uma_ratio_preamble; - uma_name.append(metric_name); - uma_name.append(uma_ratio_postscript); - uma_name.append(bucket_substring); - ratio_record.uma_counters_per_bucket.push_back( - std::make_unique<CustomCountHistogram>(uma_name.Utf8().data(), 0, - 10000000, 50)); - } - } -} - -LocalFrameUkmAggregator::~LocalFrameUkmAggregator() { - Flush(TimeTicks()); -} - -LocalFrameUkmAggregator::ScopedUkmHierarchicalTimer -LocalFrameUkmAggregator::GetScopedTimer(size_t metric_index) { - return ScopedUkmHierarchicalTimer(this, metric_index); -} - -void LocalFrameUkmAggregator::RecordSample(size_t metric_index, - TimeTicks start, - TimeTicks end) { - TimeDelta duration = end - start; - - // Append the duration to the appropriate metrics record. - DCHECK_LT(metric_index, absolute_metric_records_.size()); - auto& record = absolute_metric_records_[metric_index]; - if (duration > record.worst_case_duration) - record.worst_case_duration = duration; - record.total_duration += duration; - ++record.sample_count; - - // Record the UMA - record.uma_counter->CountMicroseconds(duration); - - // Just record the duration for ratios. We compute the ratio later - // when we know the frame time. - ratio_metric_records_[metric_index].interval_duration += duration; -} - -void LocalFrameUkmAggregator::RecordPrimarySample(TimeTicks start, - TimeTicks end) { - FlushIfNeeded(end); - - TimeDelta duration = end - start; - - // Record UMA - primary_metric_.uma_counter->CountMicroseconds(duration); - - if (duration.is_zero()) - return; - - // Record primary time information - if (duration > primary_metric_.worst_case_duration) - primary_metric_.worst_case_duration = duration; - primary_metric_.total_duration += duration; - ++primary_metric_.sample_count; - - // Compute all the dependent metrics, after finding which bucket we're in - // for UMA data. - size_t bucket_index = bucket_thresholds_.size(); - for (size_t i = 0; i < bucket_index; ++i) { - if (duration < bucket_thresholds_[i]) { - bucket_index = i; - } - } - - for (auto& record : ratio_metric_records_) { - double ratio = - record.interval_duration.InMicrosecondsF() / duration.InMicrosecondsF(); - if (ratio > record.worst_case_ratio) - record.worst_case_ratio = ratio; - record.total_ratio += ratio; - ++record.sample_count; - record.uma_counters_per_bucket[bucket_index]->Count(floor(ratio * 100.0)); - record.interval_duration = TimeDelta(); - } - - has_data_ = true; -} - -void LocalFrameUkmAggregator::FlushIfNeeded(TimeTicks current_time) { - if (current_time >= last_flushed_time_ + event_frequency_) - Flush(current_time); -} - -void LocalFrameUkmAggregator::Flush(TimeTicks current_time) { - last_flushed_time_ = current_time; - if (!has_data_) - return; - DCHECK(primary_metric_.sample_count); - - ukm::UkmEntryBuilder builder(source_id_, event_name_.Utf8().data()); - builder.SetMetric(primary_metric_.worst_case_metric_name.Utf8().data(), - primary_metric_.worst_case_duration.InMicroseconds()); - builder.SetMetric(primary_metric_.average_metric_name.Utf8().data(), - primary_metric_.total_duration.InMicroseconds() / - static_cast<int64_t>(primary_metric_.sample_count)); - for (auto& record : absolute_metric_records_) { - if (record.sample_count == 0) - continue; - builder.SetMetric(record.worst_case_metric_name.Utf8().data(), - record.worst_case_duration.InMicroseconds()); - builder.SetMetric(record.average_metric_name.Utf8().data(), - record.total_duration.InMicroseconds() / - static_cast<int64_t>(record.sample_count)); - } - for (auto& record : ratio_metric_records_) { - if (record.sample_count == 0) - continue; - builder.SetMetric(record.worst_case_metric_name.Utf8().data(), - record.worst_case_ratio); - builder.SetMetric( - record.average_metric_name.Utf8().data(), - record.total_ratio / static_cast<float>(record.sample_count)); - record.reset(); - } - builder.Record(recorder_); - has_data_ = false; -} - -} // namespace blink
diff --git a/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.h b/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.h deleted file mode 100644 index 546b61a5..0000000 --- a/third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.h +++ /dev/null
@@ -1,216 +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 THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_LOCAL_FRAME_UKM_AGGREGATOR_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_LOCAL_FRAME_UKM_AGGREGATOR_H_ - -#include "third_party/blink/renderer/platform/platform_export.h" -#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" -#include "third_party/blink/renderer/platform/wtf/time.h" - -namespace ukm { -class UkmRecorder; -} - -namespace blink { -class CustomCountHistogram; - -// This class aggregaties and records time based UKM and UMA metrics -// for LocalFrameView. The simplest way to use it is via the -// SCOPED_UMA_AND_UKM_HIERARCHICAL_TIMER macro in LocalFrameView combined -// with LocalFrameView::RecordEndOfFrameMetrics. -// -// It takes the following constructor parameters: -// - source_id: UKM Source ID associated with the events. -// - recorder: UkmRecorder which will handle the events -// -// The aggregator manages all of the UKM and UMA names for LocalFrameView. -// It constructs and takes ownership the UMA counters when constructed -// itself. We do this to localize all UMA and UKM metrics in one place, so -// that adding a metric is localized to the cc file of this class, protected -// from errors that might arise when adding names in multiple places. -// -// After the aggregator is created, one can create ScopedUkmHierarchicalTimer -// objects that will measure the time, in microseconds, from creation until -// the object is destroyed for sub-metrics. When destroyed, it will record -// a sample into the aggregator and the current frame's accumulated time for -// that metric, and report UMA values. -// -// See the MetricNames enum below for the set of metrics recorded. Add an -// entry to that enum to add a new metric. -// -// When the primary timed execution completes, this aggregator stores the -// primary time and computes metrics that depend on it. The results are -// aggregated. UMA metrics are updated at this time. A UKM event is -// generated in one of two situations: -// - If a sample is added that lies in the next event frequency interval (this -// will generate an event for the previous interval) -// - If the aggregator is destroyed (this will generate an event for any -// remaining samples in the aggregator) -// -// Note that no event is generated if there were no primary samples in an -// interval. -// -// Sample usage (see also SCOPED_UMA_AND_UKM_HIERARCHICAL_TIMER): -// std::unique_ptr<UkmHierarchicalTimeAggregator> aggregator( -// new UkmHierarchicalTimeAggregator( -// GetSourceId(), -// GetUkmRecorder()); -// -// ... -// { -// auto timer = -// aggregator->GetScopedTimer(static_cast<size_t>( -// LocalFrameUkmAggregator::MetricNames::kMetric2)); -// ... -// } -// // At this point an sample for kMetric2 is recorded. -// ... -// // When the primary time completes -// aggregator->RecordPrimaryMetric(time_delta); -// // This records a primary sample and the sub-metrics that depend on it. -// // It may generate an event. -// ... -// // Destroying an aggregator will generate an event as well if there were -// // samples. -// aggregator.reset(); -// -// In the example above, the event name is "my_event". It will measure 14 -// metrics: -// "primary_metric.Average", "primary_metric.WorstCase", -// "sub_metric1.Average", "sub_metric1.WorstCase", -// "sub_metric2.Average", "sub_metric2.WorstCase", -// "sub_metric3.Average", "sub_metric3.WorstCase" -// "sub_metric1.AverageRatio", "sub_metric1.WorstCaseRatio", -// "sub_metric2.AverageRatio", "sub_metric2.WorstCaseRatio", -// "sub_metric3.AverageRatio", "sub_metric3.WorstCaseRation" -// -// It will report 13 UMA values: -// "primary_uma_counter", -// "sub_uma_metric1", "sub_uma_metric2", "sub_uma_metric3", -// "sub_uma_ratio1.LessThan1ms", "sub_uma_ratio1.1msTo5ms", -// "sub_uma_ratio1.MoreThan5ms", "sub_uma_ratio2.LessThan1ms", -// "sub_uma_ratio2.1msTo5ms", "sub_uma_ratio2.MoreThan5ms", -// "sub_uma_ratio3.LessThan1ms", "sub_uma_ratio3.1msTo5ms", -// "sub_uma_ratio3.MoreThan5ms" -// -// Note that these have to be specified in the appropriate ukm.xml file -// and histograms.xml file. Runtime errors indicate missing or mis-named -// metrics. -// -// If the source_id/recorder changes then a new -// UkmHierarchicalTimeAggregator has to be created. -class LocalFrameUkmAggregator { - public: - // Changing these values requires changing the names of metrics specified - // below. For every metric name added here, add an entry in the - // metric_strings_ array below. - enum { - kCompositing, - kCompositingCommit, - kIntersectionObservation, - kPaint, - kPrePaint, - kStyleAndLayout, - kCount - }; - - private: - // Add an entry in this arrray every time a new metric is added. - const String metric_strings_[kCount] = { - "Compositing", "CompositingCommit", "IntersectionObservation", - "Paint", "PrePaint", "StyleAndLayout"}; - - // Modify this array if the UMA ratio metrics should be bucketed in a - // different way. - const Vector<TimeDelta> bucket_thresholds_ = {TimeDelta::FromMilliseconds(1), - TimeDelta::FromMilliseconds(5)}; - - public: - // This class will start a timer upon creation, which will end when the - // object is destroyed. Upon destruction it will record a sample into the - // aggregator that created the scoped timer. It will also record an event - // into the histogram counter. - class ScopedUkmHierarchicalTimer { - public: - ScopedUkmHierarchicalTimer(ScopedUkmHierarchicalTimer&&); - ~ScopedUkmHierarchicalTimer(); - - private: - friend class LocalFrameUkmAggregator; - - ScopedUkmHierarchicalTimer(LocalFrameUkmAggregator*, size_t metric_index); - - LocalFrameUkmAggregator* aggregator_; - const size_t metric_index_; - const TimeTicks start_time_; - - DISALLOW_COPY_AND_ASSIGN(ScopedUkmHierarchicalTimer); - }; - - LocalFrameUkmAggregator(int64_t source_id, ukm::UkmRecorder*); - ~LocalFrameUkmAggregator(); - - // Create a scoped timer with the index of the metric. Note the index must - // correspond to the matching index in metric_names. - ScopedUkmHierarchicalTimer GetScopedTimer(size_t metric_index); - - // Record a primary sample, that also computes the ratios for the - // sub-metrics and may generate an event. - void RecordPrimarySample(TimeTicks start, TimeTicks end); - - private: - struct AbsoluteMetricRecord { - String worst_case_metric_name; - String average_metric_name; - std::unique_ptr<CustomCountHistogram> uma_counter; - TimeDelta total_duration; - TimeDelta worst_case_duration; - size_t sample_count = 0u; - - void reset() { - total_duration = TimeDelta(); - worst_case_duration = TimeDelta(); - sample_count = 0u; - } - }; - - struct RatioMetricRecord { - String worst_case_metric_name; - String average_metric_name; - Vector<std::unique_ptr<CustomCountHistogram>> uma_counters_per_bucket; - TimeDelta interval_duration; - double total_ratio; - double worst_case_ratio; - size_t sample_count; - - void reset() { - interval_duration = TimeDelta(); - total_ratio = 0; - worst_case_ratio = 0; - sample_count = 0u; - } - }; - - void RecordSample(size_t metric_index, TimeTicks start, TimeTicks end); - void FlushIfNeeded(TimeTicks current_time); - void Flush(TimeTicks current_time); - - const int64_t source_id_; - ukm::UkmRecorder* const recorder_; - const String event_name_; - const TimeDelta event_frequency_; - AbsoluteMetricRecord primary_metric_; - Vector<AbsoluteMetricRecord> absolute_metric_records_; - Vector<RatioMetricRecord> ratio_metric_records_; - TimeTicks last_flushed_time_; - - bool has_data_ = false; - - DISALLOW_COPY_AND_ASSIGN(LocalFrameUkmAggregator); -}; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_LOCAL_FRAME_UKM_AGGREGATOR_H_
diff --git a/third_party/blink/renderer/core/frame/local_frame_view.cc b/third_party/blink/renderer/core/frame/local_frame_view.cc index 7f5033b..3101fa06 100644 --- a/third_party/blink/renderer/core/frame/local_frame_view.cc +++ b/third_party/blink/renderer/core/frame/local_frame_view.cc
@@ -55,7 +55,6 @@ #include "third_party/blink/renderer/core/frame/link_highlights.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/local_frame_client.h" -#include "third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.h" #include "third_party/blink/renderer/core/frame/location.h" #include "third_party/blink/renderer/core/frame/page_scale_constraints_set.h" #include "third_party/blink/renderer/core/frame/remote_frame.h" @@ -142,6 +141,7 @@ #include "third_party/blink/renderer/platform/scheduler/public/frame_scheduler.h" #include "third_party/blink/renderer/platform/scroll/scroll_alignment.h" #include "third_party/blink/renderer/platform/transforms/transform_state.h" +#include "third_party/blink/renderer/platform/ukm_time_aggregator.h" #include "third_party/blink/renderer/platform/wtf/std_lib_extras.h" #include "third_party/blink/renderer/platform/wtf/time.h" @@ -170,23 +170,37 @@ constexpr size_t kCssFragmentIdentifierPrefixLength = base::size(kCssFragmentIdentifierPrefix); +// Changing these values requires changing the names generated in +// EnsureUkmTimeAggregator(). +enum class UkmMetricNames { + kCompositing, + kCompositingCommit, + kIntersectionObservation, + kPaint, + kPrePaint, + kStyleAndLayout, + kCount +}; + } // namespace -// Defines a UKM that is part of a hierarchical ukm, recorded in -// microseconds equal to the duration of the current lexical scope after -// declaration of the macro. Example usage: +// Defines an UMA and a UKM, recorded in microseconds equal to the duration of +// the current lexical scope after declaration of the macro. Example usage: // // void LocalFrameView::DoExpensiveThing() { -// SCOPED_UMA_AND_UKM_TIMER(kUkmEnumName); +// SCOPED_UMA_AND_UKM_TIMER(UmaName, kUkmEnumName); // // Do computation of expensive thing // // } // -// |ukm_enum| should be an entry in LocalFrameUkmAggregator's enum of -// metric names (which in turn corresponds to names in from ukm.xml). -#define SCOPED_UMA_AND_UKM_TIMER(ukm_enum) \ - auto scoped_ukm_hierarchical_timer = \ - EnsureUkmAggregator().GetScopedTimer(static_cast<size_t>(ukm_enum)); +// |uma_name| should be the full name of an UMA defined +// in histograms.xml. |ukm_enum| should be an entry in UkmMetricNames +// (which in turn come from ukm.xml). +#define SCOPED_UMA_AND_UKM_TIMER(uma_name, ukm_enum) \ + DEFINE_STATIC_LOCAL_IMPL(CustomCountHistogram, scoped_uma_counter, \ + (uma_name, 0, 10000000, 50), false); \ + auto scoped_ukm_uma_timer = EnsureUkmTimeAggregator().GetScopedTimer( \ + static_cast<size_t>(ukm_enum), &scoped_uma_counter); using namespace HTMLNames; @@ -393,7 +407,7 @@ ClearPrintContext(); - ukm_aggregator_.reset(); + ukm_time_aggregator_.reset(); jank_tracker_->Dispose(); #if DCHECK_IS_ON() @@ -2249,11 +2263,6 @@ DocumentLifecycle::kLayoutClean); } -void LocalFrameView::RecordEndOfFrameMetrics(base::TimeTicks frame_begin_time) { - LocalFrameUkmAggregator& ukm_aggregator = EnsureUkmAggregator(); - ukm_aggregator.RecordPrimarySample(frame_begin_time, CurrentTimeTicks()); -} - void LocalFrameView::ScheduleVisualUpdateForPaintInvalidationIfNeeded() { LocalFrame& local_frame_root = GetFrame().LocalFrameRoot(); if (local_frame_root.View()->current_update_lifecycle_phases_target_state_ < @@ -2406,7 +2415,8 @@ if (target_state == DocumentLifecycle::kPaintClean) { TRACE_EVENT0("blink,benchmark", "LocalFrameView::UpdateViewportIntersectionsForSubtree"); - SCOPED_UMA_AND_UKM_TIMER(LocalFrameUkmAggregator::kIntersectionObservation); + SCOPED_UMA_AND_UKM_TIMER("Blink.IntersectionObservation.UpdateTime", + UkmMetricNames::kIntersectionObservation); UpdateViewportIntersectionsForSubtree(); } @@ -2523,7 +2533,8 @@ DCHECK(layout_view); if (!RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) { - SCOPED_UMA_AND_UKM_TIMER(LocalFrameUkmAggregator::kCompositing); + SCOPED_UMA_AND_UKM_TIMER("Blink.Compositing.UpdateTime", + UkmMetricNames::kCompositing); layout_view->Compositor()->UpdateIfNeededRecursive(target_state); } else { ForAllNonThrottledLocalFrameViews([](LocalFrameView& frame_view) { @@ -2567,7 +2578,8 @@ }); { - SCOPED_UMA_AND_UKM_TIMER(LocalFrameUkmAggregator::kPrePaint); + SCOPED_UMA_AND_UKM_TIMER("Blink.PrePaint.UpdateTime", + UkmMetricNames::kPrePaint); PrePaintTreeWalk().WalkTree(*this); } @@ -2782,7 +2794,7 @@ void LocalFrameView::PaintTree() { TRACE_EVENT0("blink,benchmark", "LocalFrameView::paintTree"); - SCOPED_UMA_AND_UKM_TIMER(LocalFrameUkmAggregator::kPaint); + SCOPED_UMA_AND_UKM_TIMER("Blink.Paint.UpdateTime", UkmMetricNames::kPaint); DCHECK(GetFrame().IsLocalRoot()); @@ -2922,7 +2934,8 @@ paint_artifact_compositor_->RootLayer(), &GetFrame()); } - SCOPED_UMA_AND_UKM_TIMER(LocalFrameUkmAggregator::kCompositingCommit); + SCOPED_UMA_AND_UKM_TIMER("Blink.CompositingCommit.UpdateTime", + UkmMetricNames::kCompositingCommit); paint_artifact_compositor_->Update( paint_controller_->GetPaintArtifactShared(), composited_element_ids, @@ -2938,7 +2951,8 @@ } void LocalFrameView::UpdateStyleAndLayoutIfNeededRecursive() { - SCOPED_UMA_AND_UKM_TIMER(LocalFrameUkmAggregator::kStyleAndLayout); + SCOPED_UMA_AND_UKM_TIMER("Blink.StyleAndLayout.UpdateTime", + UkmMetricNames::kStyleAndLayout); UpdateStyleAndLayoutIfNeededRecursiveInternal(); } @@ -4429,13 +4443,18 @@ std::max<float>(1.0, GetChromeClient()->WindowToViewportScalar(1))); } -LocalFrameUkmAggregator& LocalFrameView::EnsureUkmAggregator() { - if (!ukm_aggregator_) { - ukm_aggregator_.reset( - new LocalFrameUkmAggregator(frame_->GetDocument()->UkmSourceID(), - frame_->GetDocument()->UkmRecorder())); +UkmTimeAggregator& LocalFrameView::EnsureUkmTimeAggregator() { + if (!ukm_time_aggregator_) { + ukm_time_aggregator_.reset(new UkmTimeAggregator( + "Blink.UpdateTime", frame_->GetDocument()->UkmSourceID(), + frame_->GetDocument()->UkmRecorder(), + // Note that changing the order or values of the following vector + // requires changing the UkmMetricNames enum. + {"Compositing", "CompositingCommit", "IntersectionObservation", "Paint", + "PrePaint", "StyleAndLayout"}, + TimeDelta::FromSeconds(30))); } - return *ukm_aggregator_; + return *ukm_time_aggregator_; } } // namespace blink
diff --git a/third_party/blink/renderer/core/frame/local_frame_view.h b/third_party/blink/renderer/core/frame/local_frame_view.h index ee208c45..75ef8d7 100644 --- a/third_party/blink/renderer/core/frame/local_frame_view.h +++ b/third_party/blink/renderer/core/frame/local_frame_view.h
@@ -86,7 +86,7 @@ class ScrollingCoordinatorContext; class TracedValue; class TransformState; -class LocalFrameUkmAggregator; +class UkmTimeAggregator; class WebPluginContainerImpl; struct AnnotatedRegionValue; struct IntrinsicSizingInfo; @@ -349,9 +349,6 @@ // desired state. bool UpdateLifecycleToLayoutClean(); - // Record any UMA and UKM metrics that depend on the end of a main frame. - void RecordEndOfFrameMetrics(base::TimeTicks frame_begin_time); - void ScheduleVisualUpdateForPaintInvalidationIfNeeded(); bool InvalidateViewportConstrainedObjects(); @@ -827,7 +824,7 @@ void LayoutFromRootObject(LayoutObject& root); - LocalFrameUkmAggregator& EnsureUkmAggregator(); + UkmTimeAggregator& EnsureUkmTimeAggregator(); LayoutSize size_; @@ -962,7 +959,7 @@ MainThreadScrollingReasons main_thread_scrolling_reasons_; - std::unique_ptr<LocalFrameUkmAggregator> ukm_aggregator_; + std::unique_ptr<UkmTimeAggregator> ukm_time_aggregator_; Member<PrintContext> print_context_;
diff --git a/third_party/blink/renderer/core/frame/web_frame_widget_impl.h b/third_party/blink/renderer/core/frame/web_frame_widget_impl.h index e2b061c..a2a5d40 100644 --- a/third_party/blink/renderer/core/frame/web_frame_widget_impl.h +++ b/third_party/blink/renderer/core/frame/web_frame_widget_impl.h
@@ -67,9 +67,6 @@ class WebMouseWheelEvent; class WebFrameWidgetImpl; -using WebFrameWidgetsSet = - PersistentHeapHashSet<WeakMember<WebFrameWidgetImpl>>; - class WebFrameWidgetImpl final : public WebFrameWidgetBase, public PageWidgetEventHandler { public:
diff --git a/third_party/blink/renderer/core/frame/web_view_frame_widget.cc b/third_party/blink/renderer/core/frame/web_view_frame_widget.cc index 27558a3..16207dde 100644 --- a/third_party/blink/renderer/core/frame/web_view_frame_widget.cc +++ b/third_party/blink/renderer/core/frame/web_view_frame_widget.cc
@@ -38,37 +38,32 @@ } void WebViewFrameWidget::Resize(const WebSize& size) { - web_view_->Resize(size); + return web_view_->Resize(size); } void WebViewFrameWidget::ResizeVisualViewport(const WebSize& size) { - web_view_->ResizeVisualViewport(size); + return web_view_->ResizeVisualViewport(size); } void WebViewFrameWidget::DidEnterFullscreen() { - web_view_->DidEnterFullscreen(); + return web_view_->DidEnterFullscreen(); } void WebViewFrameWidget::DidExitFullscreen() { - web_view_->DidExitFullscreen(); + return web_view_->DidExitFullscreen(); } void WebViewFrameWidget::SetSuppressFrameRequestsWorkaroundFor704763Only( bool suppress_frame_requests) { - web_view_->SetSuppressFrameRequestsWorkaroundFor704763Only( + return web_view_->SetSuppressFrameRequestsWorkaroundFor704763Only( suppress_frame_requests); } void WebViewFrameWidget::BeginFrame(base::TimeTicks last_frame_time) { - web_view_->BeginFrame(last_frame_time); -} - -void WebViewFrameWidget::RecordEndOfFrameMetrics( - base::TimeTicks frame_begin_time) { - web_view_->RecordEndOfFrameMetrics(frame_begin_time); + return web_view_->BeginFrame(last_frame_time); } void WebViewFrameWidget::UpdateLifecycle(LifecycleUpdate requested_update) { - web_view_->UpdateLifecycle(requested_update); + return web_view_->UpdateLifecycle(requested_update); } void WebViewFrameWidget::UpdateAllLifecyclePhasesAndCompositeForTesting() { @@ -77,20 +72,20 @@ void WebViewFrameWidget::PaintContent(cc::PaintCanvas* canvas, const WebRect& view_port) { - web_view_->PaintContent(canvas, view_port); + return web_view_->PaintContent(canvas, view_port); } void WebViewFrameWidget::LayoutAndPaintAsync(base::OnceClosure callback) { - web_view_->LayoutAndPaintAsync(std::move(callback)); + return web_view_->LayoutAndPaintAsync(std::move(callback)); } void WebViewFrameWidget::CompositeAndReadbackAsync( base::OnceCallback<void(const SkBitmap&)> callback) { - web_view_->CompositeAndReadbackAsync(std::move(callback)); + return web_view_->CompositeAndReadbackAsync(std::move(callback)); } void WebViewFrameWidget::ThemeChanged() { - web_view_->ThemeChanged(); + return web_view_->ThemeChanged(); } WebInputEventResult WebViewFrameWidget::HandleInputEvent( @@ -103,7 +98,7 @@ } void WebViewFrameWidget::SetCursorVisibilityState(bool is_visible) { - web_view_->SetCursorVisibilityState(is_visible); + return web_view_->SetCursorVisibilityState(is_visible); } void WebViewFrameWidget::ApplyViewportDeltas( @@ -112,24 +107,24 @@ const WebFloatSize& elastic_overscroll_delta, float scale_factor, float browser_controls_shown_ratio_delta) { - web_view_->ApplyViewportDeltas(visual_viewport_delta, layout_viewport_delta, - elastic_overscroll_delta, scale_factor, - browser_controls_shown_ratio_delta); + return web_view_->ApplyViewportDeltas( + visual_viewport_delta, layout_viewport_delta, elastic_overscroll_delta, + scale_factor, browser_controls_shown_ratio_delta); } void WebViewFrameWidget::RecordWheelAndTouchScrollingCount( bool has_scrolled_by_wheel, bool has_scrolled_by_touch) { - web_view_->RecordWheelAndTouchScrollingCount(has_scrolled_by_wheel, - has_scrolled_by_touch); + return web_view_->RecordWheelAndTouchScrollingCount(has_scrolled_by_wheel, + has_scrolled_by_touch); } void WebViewFrameWidget::MouseCaptureLost() { - web_view_->MouseCaptureLost(); + return web_view_->MouseCaptureLost(); } void WebViewFrameWidget::SetFocus(bool enable) { - web_view_->SetFocus(enable); + return web_view_->SetFocus(enable); } bool WebViewFrameWidget::SelectionBounds(WebRect& anchor, @@ -142,7 +137,7 @@ } void WebViewFrameWidget::WillCloseLayerTreeView() { - web_view_->WillCloseLayerTreeView(); + return web_view_->WillCloseLayerTreeView(); } SkColor WebViewFrameWidget::BackgroundColor() const { @@ -157,12 +152,12 @@ cc::BrowserControlsState constraints, cc::BrowserControlsState current, bool animate) { - web_view_->UpdateBrowserControlsState(constraints, current, animate); + return web_view_->UpdateBrowserControlsState(constraints, current, animate); } void WebViewFrameWidget::SetVisibilityState( mojom::PageVisibilityState visibility_state) { - web_view_->SetVisibilityState(visibility_state, false); + return web_view_->SetVisibilityState(visibility_state, false); } void WebViewFrameWidget::SetBackgroundColorOverride(SkColor color) { @@ -170,7 +165,7 @@ } void WebViewFrameWidget::ClearBackgroundColorOverride() { - web_view_->ClearBackgroundColorOverride(); + return web_view_->ClearBackgroundColorOverride(); } void WebViewFrameWidget::SetBaseBackgroundColorOverride(SkColor color) { @@ -178,7 +173,7 @@ } void WebViewFrameWidget::ClearBaseBackgroundColorOverride() { - web_view_->ClearBaseBackgroundColorOverride(); + return web_view_->ClearBaseBackgroundColorOverride(); } void WebViewFrameWidget::SetBaseBackgroundColor(SkColor color) {
diff --git a/third_party/blink/renderer/core/frame/web_view_frame_widget.h b/third_party/blink/renderer/core/frame/web_view_frame_widget.h index 1659cf7e..16ee4b60 100644 --- a/third_party/blink/renderer/core/frame/web_view_frame_widget.h +++ b/third_party/blink/renderer/core/frame/web_view_frame_widget.h
@@ -48,7 +48,6 @@ void DidExitFullscreen() override; void SetSuppressFrameRequestsWorkaroundFor704763Only(bool) final; void BeginFrame(base::TimeTicks last_frame_time) override; - void RecordEndOfFrameMetrics(base::TimeTicks frame_begin_time) override; void UpdateLifecycle(LifecycleUpdate requested_update) override; void UpdateAllLifecyclePhasesAndCompositeForTesting() override; void PaintContent(cc::PaintCanvas*, const WebRect& view_port) override;
diff --git a/third_party/blink/renderer/core/html/custom/custom_element_definition_builder.h b/third_party/blink/renderer/core/html/custom/custom_element_definition_builder.h index d6110d4..efc56d56 100644 --- a/third_party/blink/renderer/core/html/custom/custom_element_definition_builder.h +++ b/third_party/blink/renderer/core/html/custom/custom_element_definition_builder.h
@@ -35,10 +35,6 @@ // registry. Return false if processing should not proceed. virtual bool CheckConstructorNotRegistered() = 0; - // Checking the prototype may destroy the window. Return false if - // processing should not proceed. - virtual bool CheckPrototype() = 0; - // Cache properties for build to use. Return false if processing // should not proceed. virtual bool RememberOriginalProperties() = 0;
diff --git a/third_party/blink/renderer/core/html/custom/custom_element_registry.cc b/third_party/blink/renderer/core/html/custom/custom_element_registry.cc index 76b09c3..ca9fedf 100644 --- a/third_party/blink/renderer/core/html/custom/custom_element_registry.cc +++ b/third_party/blink/renderer/core/html/custom/custom_element_registry.cc
@@ -106,7 +106,7 @@ CustomElementDefinition* CustomElementRegistry::define( ScriptState* script_state, const AtomicString& name, - const ScriptValue& constructor, + V8CustomElementConstructor* constructor, const ElementDefinitionOptions& options, ExceptionState& exception_state) { CSSStyleSheet* style_sheet = nullptr; @@ -115,11 +115,12 @@ style_sheet = options.style(); ScriptCustomElementDefinitionBuilder builder(script_state, this, style_sheet, constructor, exception_state); - return define(name, builder, options, exception_state); + return DefineInternal(script_state, name, builder, options, exception_state); } // http://w3c.github.io/webcomponents/spec/custom/#dfn-element-definition -CustomElementDefinition* CustomElementRegistry::define( +CustomElementDefinition* CustomElementRegistry::DefineInternal( + ScriptState* script_state, const AtomicString& name, CustomElementDefinitionBuilder& builder, const ElementDefinitionOptions& options, @@ -170,9 +171,6 @@ local_name = extends; } - // TODO(dominicc): Add a test where the prototype getter destroys - // the context. - // 8. If this CustomElementRegistry's element definition is // running flag is set, then throw a "NotSupportedError" // DOMException and abort these steps. @@ -188,11 +186,7 @@ // running flag. base::AutoReset<bool> defining(&element_definition_is_running_, true); - // 10.1-2 - if (!builder.CheckPrototype()) - return nullptr; - - // 10.3-6 + // 10. Run the following substeps while catching any exceptions: ... if (!builder.RememberOriginalProperties()) return nullptr; @@ -203,6 +197,16 @@ // (|defining|'s destructor does this.) } + // During step 10, property getters might have detached the frame. Abort in + // the case. + if (!script_state->ContextIsValid()) { + // Intentionally do not throw an exception so that, when Blink will support + // detached frames, the behavioral change whether Blink throws or not will + // not be observable from author. + // TODO(yukishiino): Support detached frames. + return nullptr; + } + CustomElementDescriptor descriptor(name, local_name); if (UNLIKELY(definitions_.size() >= std::numeric_limits<CustomElementDefinition::Id>::max()))
diff --git a/third_party/blink/renderer/core/html/custom/custom_element_registry.h b/third_party/blink/renderer/core/html/custom/custom_element_registry.h index 7ff0b9ca..a323e28b 100644 --- a/third_party/blink/renderer/core/html/custom/custom_element_registry.h +++ b/third_party/blink/renderer/core/html/custom/custom_element_registry.h
@@ -29,6 +29,7 @@ class ScriptState; class ScriptValue; class V0CustomElementRegistrationContext; +class V8CustomElementConstructor; class CORE_EXPORT CustomElementRegistry final : public ScriptWrappable { DEFINE_WRAPPERTYPEINFO(); @@ -40,12 +41,7 @@ CustomElementDefinition* define(ScriptState*, const AtomicString& name, - const ScriptValue& constructor, - const ElementDefinitionOptions&, - ExceptionState&); - - CustomElementDefinition* define(const AtomicString& name, - CustomElementDefinitionBuilder&, + V8CustomElementConstructor* constructor, const ElementDefinitionOptions&, ExceptionState&); @@ -71,10 +67,14 @@ void Trace(blink::Visitor*) override; private: - friend class CustomElementRegistryTest; - CustomElementRegistry(const LocalDOMWindow*); + CustomElementDefinition* DefineInternal(ScriptState*, + const AtomicString& name, + CustomElementDefinitionBuilder&, + const ElementDefinitionOptions&, + ExceptionState&); + bool V0NameIsDefined(const AtomicString& name); void CollectCandidates(const CustomElementDescriptor&, @@ -106,6 +106,11 @@ TraceWrapperMember<CustomElementReactionStack> reaction_stack_; + FRIEND_TEST_ALL_PREFIXES( + CustomElementTest, + CreateElement_TagNameCaseHandlingCreatingCustomElement); + friend class CustomElementRegistryTest; + DISALLOW_COPY_AND_ASSIGN(CustomElementRegistry); };
diff --git a/third_party/blink/renderer/core/html/custom/custom_element_registry.idl b/third_party/blink/renderer/core/html/custom/custom_element_registry.idl index 51426df..aab5cdf 100644 --- a/third_party/blink/renderer/core/html/custom/custom_element_registry.idl +++ b/third_party/blink/renderer/core/html/custom/custom_element_registry.idl
@@ -3,10 +3,10 @@ // found in the LICENSE file. interface CustomElementRegistry { - // TODO(yukishiino): |constructor| should be of callback function type - // (should be: callback T = any ()). - [CallWith=ScriptState, CEReactions, CustomElementCallbacks, RaisesException, MeasureAs=CustomElementRegistryDefine] void define(DOMString name, CallbackFunctionTreatedAsScriptValue constructor, optional ElementDefinitionOptions options); + [CallWith=ScriptState, CEReactions, CustomElementCallbacks, RaisesException, MeasureAs=CustomElementRegistryDefine] void define(DOMString name, CustomElementConstructor constructor, optional ElementDefinitionOptions options); any get(DOMString name); [CallWith=ScriptState,RaisesException] Promise<void> whenDefined(DOMString name); [CEReactions] void upgrade(Node root); }; + +callback CustomElementConstructor = any ();
diff --git a/third_party/blink/renderer/core/html/custom/custom_element_registry_test.cc b/third_party/blink/renderer/core/html/custom/custom_element_registry_test.cc index f729a62..6baa77b 100644 --- a/third_party/blink/renderer/core/html/custom/custom_element_registry_test.cc +++ b/third_party/blink/renderer/core/html/custom/custom_element_registry_test.cc
@@ -41,6 +41,14 @@ return *GetFrame().DomWindow()->customElements(); } + CustomElementDefinition* Define(const AtomicString& name, + CustomElementDefinitionBuilder& builder, + const ElementDefinitionOptions& options, + ExceptionState& exception_state) { + return Registry().DefineInternal(GetScriptState(), name, builder, options, + exception_state); + } + ScriptState* GetScriptState() { return ToScriptStateForMainWorld(&GetFrame()); } @@ -276,8 +284,7 @@ NonThrowableExceptionState should_not_throw; { CEReactionsScope reactions; - Registry().define("a-a", builder, ElementDefinitionOptions(), - should_not_throw); + Define("a-a", builder, ElementDefinitionOptions(), should_not_throw); } LogUpgradeDefinition* definition = static_cast<LogUpgradeDefinition*>(Registry().DefinitionForName("a-a")); @@ -319,8 +326,7 @@ NonThrowableExceptionState should_not_throw; { CEReactionsScope reactions; - Registry().define("a-a", builder, ElementDefinitionOptions(), - should_not_throw); + Define("a-a", builder, ElementDefinitionOptions(), should_not_throw); } LogUpgradeDefinition* definition = static_cast<LogUpgradeDefinition*>(Registry().DefinitionForName("a-a")); @@ -355,8 +361,7 @@ NonThrowableExceptionState should_not_throw; { CEReactionsScope reactions; - Registry().define("a-a", builder, ElementDefinitionOptions(), - should_not_throw); + Define("a-a", builder, ElementDefinitionOptions(), should_not_throw); } LogUpgradeDefinition* definition = static_cast<LogUpgradeDefinition*>(Registry().DefinitionForName("a-a")); @@ -383,8 +388,7 @@ NonThrowableExceptionState should_not_throw; { CEReactionsScope reactions; - Registry().define("a-a", builder, ElementDefinitionOptions(), - should_not_throw); + Define("a-a", builder, ElementDefinitionOptions(), should_not_throw); } LogUpgradeDefinition* definition = static_cast<LogUpgradeDefinition*>(Registry().DefinitionForName("a-a")); @@ -413,12 +417,12 @@ TEST_F(CustomElementRegistryTest, lookupCustomElementDefinition) { NonThrowableExceptionState should_not_throw; TestCustomElementDefinitionBuilder builder; - CustomElementDefinition* definition_a = Registry().define( - "a-a", builder, ElementDefinitionOptions(), should_not_throw); + CustomElementDefinition* definition_a = + Define("a-a", builder, ElementDefinitionOptions(), should_not_throw); ElementDefinitionOptions options; options.setExtends("div"); CustomElementDefinition* definition_b = - Registry().define("b-b", builder, options, should_not_throw); + Define("b-b", builder, options, should_not_throw); // look up defined autonomous custom element CustomElementDefinition* definition = Registry().DefinitionFor( CustomElementDescriptor(CustomElementDescriptor("a-a", "a-a"))); @@ -446,7 +450,7 @@ options.setStyle(sheet); TestCustomElementDefinitionBuilder builder(sheet); CustomElementDefinition* definition_a = - Registry().define("a-a", builder, options, should_not_throw); + Define("a-a", builder, options, should_not_throw); EXPECT_EQ(definition_a, Registry().DefinitionForName("a-a")); EXPECT_NE(nullptr, Registry().DefinitionForName("a-a")->DefaultStyleSheet()); StyleSheetContents* contents = @@ -482,8 +486,8 @@ NonThrowableExceptionState should_not_throw; TestCustomElementDefinitionBuilder builder; CustomElementDefinition* definition_embedder = - Registry().define("embeddercustomelement", builder, - ElementDefinitionOptions(), should_not_throw); + Define("embeddercustomelement", builder, ElementDefinitionOptions(), + should_not_throw); CustomElementDefinition* definition = Registry().DefinitionFor(CustomElementDescriptor( "embeddercustomelement", "embeddercustomelement")); @@ -503,9 +507,9 @@ // is disallowed. TestCustomElementDefinitionBuilder builder; - CustomElementDefinition* definition_embedder = Registry().define( - "embeddercustomelement", builder, ElementDefinitionOptions(), - IGNORE_EXCEPTION_FOR_TESTING); + CustomElementDefinition* definition_embedder = + Define("embeddercustomelement", builder, ElementDefinitionOptions(), + IGNORE_EXCEPTION_FOR_TESTING); CustomElementDefinition* definition = Registry().DefinitionFor(CustomElementDescriptor( "embeddercustomelement", "embeddercustomelement"));
diff --git a/third_party/blink/renderer/core/html/custom/custom_element_test.cc b/third_party/blink/renderer/core/html/custom/custom_element_test.cc index bcae421a..97f0af7 100644 --- a/third_party/blink/renderer/core/html/custom/custom_element_test.cc +++ b/third_party/blink/renderer/core/html/custom/custom_element_test.cc
@@ -6,7 +6,9 @@ #include <ios> #include <memory> + #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h" #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/html/custom/custom_element_definition.h" @@ -215,14 +217,15 @@ CreateElement_TagNameCaseHandlingCreatingCustomElement) { // register a definition std::unique_ptr<DummyPageHolder> holder(DummyPageHolder::Create()); + ScriptState* script_state = ToScriptStateForMainWorld(&holder->GetFrame()); CustomElementRegistry* registry = holder->GetFrame().DomWindow()->customElements(); NonThrowableExceptionState should_not_throw; { CEReactionsScope reactions; TestCustomElementDefinitionBuilder builder; - registry->define("a-a", builder, ElementDefinitionOptions(), - should_not_throw); + registry->DefineInternal(script_state, "a-a", builder, + ElementDefinitionOptions(), should_not_throw); } CustomElementDefinition* definition = registry->DefinitionFor(CustomElementDescriptor("a-a", "a-a"));
diff --git a/third_party/blink/renderer/core/html/custom/custom_element_test_helpers.h b/third_party/blink/renderer/core/html/custom/custom_element_test_helpers.h index 5573d93..c39f3960 100644 --- a/third_party/blink/renderer/core/html/custom/custom_element_test_helpers.h +++ b/third_party/blink/renderer/core/html/custom/custom_element_test_helpers.h
@@ -38,7 +38,6 @@ bool CheckConstructorIntrinsics() override { return true; } bool CheckConstructorNotRegistered() override { return true; } - bool CheckPrototype() override { return true; } bool RememberOriginalProperties() override { return true; } CustomElementDefinition* Build(const CustomElementDescriptor&, CustomElementDefinition::Id) override;
diff --git a/third_party/blink/renderer/core/html/forms/html_form_control_element_with_state.cc b/third_party/blink/renderer/core/html/forms/html_form_control_element_with_state.cc index 0cae0aab..3971c46 100644 --- a/third_party/blink/renderer/core/html/forms/html_form_control_element_with_state.cc +++ b/third_party/blink/renderer/core/html/forms/html_form_control_element_with_state.cc
@@ -28,10 +28,91 @@ #include "third_party/blink/renderer/core/frame/local_frame_client.h" #include "third_party/blink/renderer/core/html/forms/form_controller.h" #include "third_party/blink/renderer/core/html/forms/html_form_element.h" +#include "third_party/blink/renderer/core/input_type_names.h" #include "third_party/blink/renderer/core/page/chrome_client.h" namespace blink { +namespace { + +enum class AutoCompleteCategory { + kNone, + kOff, + kAutomatic, + kNormal, + kContact, +}; + +AutoCompleteCategory GetAutoCompleteCategory(const AtomicString& token) { + using Map = HashMap<AtomicString, AutoCompleteCategory>; + DEFINE_STATIC_LOCAL( + Map, category_map, + ({ + {"off", AutoCompleteCategory::kOff}, + {"on", AutoCompleteCategory::kAutomatic}, + + {"name", AutoCompleteCategory::kNormal}, + {"honorific-prefix", AutoCompleteCategory::kNormal}, + {"given-name", AutoCompleteCategory::kNormal}, + {"additional-name", AutoCompleteCategory::kNormal}, + {"family-name", AutoCompleteCategory::kNormal}, + {"honorific-suffix", AutoCompleteCategory::kNormal}, + {"nickname", AutoCompleteCategory::kNormal}, + {"organization-title", AutoCompleteCategory::kNormal}, + {"username", AutoCompleteCategory::kNormal}, + {"new-password", AutoCompleteCategory::kNormal}, + {"current-password", AutoCompleteCategory::kNormal}, + {"organization", AutoCompleteCategory::kNormal}, + {"street-address", AutoCompleteCategory::kNormal}, + {"address-line1", AutoCompleteCategory::kNormal}, + {"address-line2", AutoCompleteCategory::kNormal}, + {"address-line3", AutoCompleteCategory::kNormal}, + {"address-level4", AutoCompleteCategory::kNormal}, + {"address-level3", AutoCompleteCategory::kNormal}, + {"address-level2", AutoCompleteCategory::kNormal}, + {"address-level1", AutoCompleteCategory::kNormal}, + {"country", AutoCompleteCategory::kNormal}, + {"country-name", AutoCompleteCategory::kNormal}, + {"postal-code", AutoCompleteCategory::kNormal}, + {"cc-name", AutoCompleteCategory::kNormal}, + {"cc-given-name", AutoCompleteCategory::kNormal}, + {"cc-additional-name", AutoCompleteCategory::kNormal}, + {"cc-family-name", AutoCompleteCategory::kNormal}, + {"cc-number", AutoCompleteCategory::kNormal}, + {"cc-exp", AutoCompleteCategory::kNormal}, + {"cc-exp-month", AutoCompleteCategory::kNormal}, + {"cc-exp-year", AutoCompleteCategory::kNormal}, + {"cc-csc", AutoCompleteCategory::kNormal}, + {"cc-type", AutoCompleteCategory::kNormal}, + {"transaction-currency", AutoCompleteCategory::kNormal}, + {"transaction-amount", AutoCompleteCategory::kNormal}, + {"language", AutoCompleteCategory::kNormal}, + {"bday", AutoCompleteCategory::kNormal}, + {"bday-day", AutoCompleteCategory::kNormal}, + {"bday-month", AutoCompleteCategory::kNormal}, + {"bday-year", AutoCompleteCategory::kNormal}, + {"sex", AutoCompleteCategory::kNormal}, + {"url", AutoCompleteCategory::kNormal}, + {"photo", AutoCompleteCategory::kNormal}, + + {"tel", AutoCompleteCategory::kContact}, + {"tel-country-code", AutoCompleteCategory::kContact}, + {"tel-national", AutoCompleteCategory::kContact}, + {"tel-area-code", AutoCompleteCategory::kContact}, + {"tel-local", AutoCompleteCategory::kContact}, + {"tel-local-prefix", AutoCompleteCategory::kContact}, + {"tel-local-suffix", AutoCompleteCategory::kContact}, + {"tel-extension", AutoCompleteCategory::kContact}, + {"email", AutoCompleteCategory::kContact}, + {"impp", AutoCompleteCategory::kContact}, + })); + + auto iter = category_map.find(token); + return iter == category_map.end() ? AutoCompleteCategory::kNone : iter->value; +} + +} // anonymous namespace + HTMLFormControlElementWithState::HTMLFormControlElementWithState( const QualifiedName& tag_name, Document& doc) @@ -60,6 +141,149 @@ return Form()->ShouldAutocomplete(); } +bool HTMLFormControlElementWithState::IsWearingAutofillAnchorMantle() const { + return FormControlType() == InputTypeNames::hidden; +} + +String HTMLFormControlElementWithState::IDLExposedAutofillValue() const { + // TODO(tkent): Share the code with autofill::FormStructure:: + // ParseFieldTypesFromAutocompleteAttributes(). + + // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-processing-model + // 1. If the element has no autocomplete attribute, then jump to the step + // labeled default. + const AtomicString& value = FastGetAttribute(HTMLNames::autocompleteAttr); + if (value.IsNull()) + return g_empty_string; + + // 2. Let tokens be the result of splitting the attribute's value on ASCII + // whitespace. + SpaceSplitString tokens(value.LowerASCII()); + if (tokens.size() == 0) + return g_empty_string; + + // 4. Let index be the index of the last token in tokens. + wtf_size_t index = tokens.size() - 1; + + // 5. If the indexth token in tokens is not an ASCII case-insensitive + // match for one of the tokens given in the first column of the + // following table, or if the number of tokens in tokens is greater + // than the maximum number given in the cell in the second column of + // that token's row, then jump to the step labeled default. Otherwise, + // let field be the string given in the cell of the first column of + // the matching row, and let category be the value of the cell in the + // third column of that same row. + AtomicString token = tokens[index]; + AutoCompleteCategory category = GetAutoCompleteCategory(token); + wtf_size_t max_tokens; + switch (category) { + case AutoCompleteCategory::kNone: + max_tokens = 0; + break; + case AutoCompleteCategory::kOff: + case AutoCompleteCategory::kAutomatic: + max_tokens = 1; + break; + case AutoCompleteCategory::kNormal: + max_tokens = 3; + break; + case AutoCompleteCategory::kContact: + max_tokens = 4; + break; + } + if (tokens.size() > max_tokens) + return g_empty_string; + AtomicString field = token; + + // 6. If category is Off or Automatic but the element's autocomplete attribute + // is wearing the autofill anchor mantle, then jump to the step labeled + // default. + if ((category == AutoCompleteCategory::kOff || + category == AutoCompleteCategory::kAutomatic) && + IsWearingAutofillAnchorMantle()) { + return g_empty_string; + } + + // 7. If category is Off, let the element's autofill field name be the string + // "off", let its autofill hint set be empty, and let its IDL-exposed autofill + // value be the string "off". Then, return. + if (category == AutoCompleteCategory::kOff) + return "off"; + + // 8. If category is Automatic, let the element's autofill field name be the + // string "on", let its autofill hint set be empty, and let its IDL-exposed + // autofill value be the string "on". Then, return. + if (category == AutoCompleteCategory::kAutomatic) + return "on"; + + // 11. Let IDL value have the same value as field. + String idl_value = field; + // 12. If the indexth token in tokens is the first entry, then skip to the + // step labeled done. + if (index != 0) { + // 13. Decrement index by one. + --index; + // 14. If category is Contact and the indexth token in tokens is an ASCII + // case-insensitive match for one of the strings in the following list, ... + if (category == AutoCompleteCategory::kContact) { + AtomicString contact = tokens[index]; + if (contact == "home" || contact == "work" || contact == "mobile" || + contact == "fax" || contact == "pager") { + // 14.4. Let IDL value be the concatenation of contact, a U+0020 SPACE + // character, and the previous value of IDL value (which at this point + // will always be field). + idl_value = contact + " " + idl_value; + // 14.5. If the indexth entry in tokens is the first entry, then skip to + // the step labeled done. + if (index == 0) { + return idl_value; + } + // 14.6. Decrement index by one. + --index; + } + } + + // 15. If the indexth token in tokens is an ASCII case-insensitive match for + // one of the strings in the following list, ... + AtomicString mode = tokens[index]; + if (mode == "shipping" || mode == "billing") { + // 15.4. Let IDL value be the concatenation of mode, a U+0020 SPACE + // character, and the previous value of IDL value (which at this point + // will either be field or the concatenation of contact, a space, and + // field). + idl_value = mode + " " + idl_value; + // 15.5 If the indexth entry in tokens is the first entry, then skip to + // the step labeled done. + if (index == 0) { + return idl_value; + } + // 15.6. Decrement index by one. + --index; + } + + // 16. If the indexth entry in tokens is not the first entry, then jump to + // the step labeled default. + if (index != 0) + return g_empty_string; + // 17. If the first eight characters of the indexth token in tokens are not + // an ASCII case-insensitive match for the string "section-", then jump to + // the step labeled default. + AtomicString section = tokens[index]; + if (!section.StartsWith("section-")) + return g_empty_string; + // 20. Let IDL value be the concatenation of section, a U+0020 SPACE + // character, and the previous value of IDL value. + idl_value = section + " " + idl_value; + } + // 24. Let the element's IDL-exposed autofill value be IDL value. + return idl_value; +} + +void HTMLFormControlElementWithState::setIDLExposedAutofillValue( + const String& autocomplete_value) { + setAttribute(HTMLNames::autocompleteAttr, AtomicString(autocomplete_value)); +} + void HTMLFormControlElementWithState::NotifyFormStateChanged() { // This can be called during fragment parsing as a result of option // selection before the document is active (or even in a frame).
diff --git a/third_party/blink/renderer/core/html/forms/html_form_control_element_with_state.h b/third_party/blink/renderer/core/html/forms/html_form_control_element_with_state.h index c993384..67485f09 100644 --- a/third_party/blink/renderer/core/html/forms/html_form_control_element_with_state.h +++ b/third_party/blink/renderer/core/html/forms/html_form_control_element_with_state.h
@@ -48,6 +48,10 @@ bool CanContainRangeEndPoint() const final { return false; } virtual bool ShouldAutocomplete() const; + // Implementations of 'autocomplete' IDL attribute. + String IDLExposedAutofillValue() const; + void setIDLExposedAutofillValue(const String& autocomplete_value); + virtual bool ShouldSaveAndRestoreFormControlState() const; virtual FormControlState SaveFormControlState() const; // The specified FormControlState must have at least one string value. @@ -71,6 +75,9 @@ private: bool ShouldForceLegacyLayout() const final { return true; } + // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-anchor-mantle + bool IsWearingAutofillAnchorMantle() const; + // Pointers for DoublyLinkedListNode<HTMLFormControlElementWithState>. This // is used for adding an instance to a list of form controls stored in // DocumentState. Each instance is only added to its containing document's
diff --git a/third_party/blink/renderer/core/html/forms/html_input_element.idl b/third_party/blink/renderer/core/html/forms/html_input_element.idl index 880bb6a5..0500484 100644 --- a/third_party/blink/renderer/core/html/forms/html_input_element.idl +++ b/third_party/blink/renderer/core/html/forms/html_input_element.idl
@@ -32,7 +32,7 @@ ] interface HTMLInputElement : HTMLElement { [CEReactions, Reflect] attribute DOMString accept; [CEReactions, Reflect] attribute DOMString alt; - [CEReactions, Reflect] attribute DOMString autocomplete; + [CEReactions, ImplementedAs=IDLExposedAutofillValue] attribute DOMString autocomplete; [CEReactions, Reflect] attribute boolean autofocus; [CEReactions, Reflect=checked] attribute boolean defaultChecked; attribute boolean checked;
diff --git a/third_party/blink/renderer/core/html/forms/html_select_element.idl b/third_party/blink/renderer/core/html/forms/html_select_element.idl index 05e4a37..3f0616e 100644 --- a/third_party/blink/renderer/core/html/forms/html_select_element.idl +++ b/third_party/blink/renderer/core/html/forms/html_select_element.idl
@@ -22,7 +22,7 @@ // https://html.spec.whatwg.org/#the-select-element [HTMLConstructor] interface HTMLSelectElement : HTMLElement { - [CEReactions, Reflect] attribute DOMString autocomplete; + [CEReactions, ImplementedAs=IDLExposedAutofillValue] attribute DOMString autocomplete; [CEReactions, Reflect] attribute boolean autofocus; [CEReactions, Reflect] attribute boolean disabled; [ImplementedAs=formOwner] readonly attribute HTMLFormElement? form;
diff --git a/third_party/blink/renderer/core/html/forms/html_text_area_element.idl b/third_party/blink/renderer/core/html/forms/html_text_area_element.idl index edeecbf..781b614 100644 --- a/third_party/blink/renderer/core/html/forms/html_text_area_element.idl +++ b/third_party/blink/renderer/core/html/forms/html_text_area_element.idl
@@ -22,7 +22,7 @@ // https://html.spec.whatwg.org/#the-textarea-element [HTMLConstructor] interface HTMLTextAreaElement : HTMLElement { - [CEReactions, Reflect] attribute DOMString autocomplete; + [CEReactions, ImplementedAs=IDLExposedAutofillValue] attribute DOMString autocomplete; [CEReactions, Reflect] attribute boolean autofocus; [CEReactions] attribute unsigned long cols; [CEReactions, Reflect] attribute DOMString dirName;
diff --git a/third_party/blink/renderer/core/html/html_frame_owner_element.cc b/third_party/blink/renderer/core/html/html_frame_owner_element.cc index 93c9b11..2cf841f 100644 --- a/third_party/blink/renderer/core/html/html_frame_owner_element.cc +++ b/third_party/blink/renderer/core/html/html_frame_owner_element.cc
@@ -52,9 +52,9 @@ namespace { -using PluginSet = PersistentHeapHashSet<Member<WebPluginContainerImpl>>; +using PluginSet = HeapHashSet<Member<WebPluginContainerImpl>>; PluginSet& PluginsPendingDispose() { - DEFINE_STATIC_LOCAL(PluginSet, set, ()); + DEFINE_STATIC_LOCAL(PluginSet, set, (new PluginSet)); return set; }
diff --git a/third_party/blink/renderer/core/html/imports/html_imports_controller.cc b/third_party/blink/renderer/core/html/imports/html_imports_controller.cc index 8b00c2e..76282a0 100644 --- a/third_party/blink/renderer/core/html/imports/html_imports_controller.cc +++ b/third_party/blink/renderer/core/html/imports/html_imports_controller.cc
@@ -44,9 +44,16 @@ : root_(HTMLImportTreeRoot::Create(&master)) {} void HTMLImportsController::Dispose() { - for (const auto& loader : loaders_) - loader->Dispose(); - loaders_.clear(); + // TODO(tkent): We copy loaders_ before iteration to avoid crashes. + // This copy should be unnecessary. loaders_ is not modified during + // the iteration. Also, null-check for |loader| should be + // unnecessary. crbug.com/843151. + LoaderList list; + list.swap(loaders_); + for (const auto& loader : list) { + if (loader) + loader->Dispose(); + } if (root_) { root_->Dispose();
diff --git a/third_party/blink/renderer/core/inspector/browser_protocol.pdl b/third_party/blink/renderer/core/inspector/browser_protocol.pdl index 4d09e6d..a5a10da7 100644 --- a/third_party/blink/renderer/core/inspector/browser_protocol.pdl +++ b/third_party/blink/renderer/core/inspector/browser_protocol.pdl
@@ -4870,10 +4870,6 @@ command addScriptToEvaluateOnNewDocument parameters string source - # If specified, creates an isolated world with the given name and evaluates given script in it. - # This world name will be used as the ExecutionContextDescription::name when the corresponding - # event is emitted. - experimental optional string worldName returns # Identifier of the added script. ScriptIdentifier identifier
diff --git a/third_party/blink/renderer/core/inspector/inspector_page_agent.cc b/third_party/blink/renderer/core/inspector/inspector_page_agent.cc index d90a3946..2d55dfb5 100644 --- a/third_party/blink/renderer/core/inspector/inspector_page_agent.cc +++ b/third_party/blink/renderer/core/inspector/inspector_page_agent.cc
@@ -70,8 +70,6 @@ #include "third_party/blink/renderer/core/probe/core_probes.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/platform/bindings/dom_wrapper_world.h" -#include "third_party/blink/renderer/platform/json/json_parser.h" -#include "third_party/blink/renderer/platform/json/json_values.h" #include "third_party/blink/renderer/platform/loader/fetch/memory_cache.h" #include "third_party/blink/renderer/platform/loader/fetch/resource.h" #include "third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h" @@ -550,29 +548,23 @@ return Response::OK(); } -Response InspectorPageAgent::addScriptToEvaluateOnNewDocument( - const String& source, - Maybe<String> world_name, - String* identifier) { +Response InspectorPageAgent::addScriptToEvaluateOnLoad(const String& source, + String* identifier) { std::vector<WTF::String> keys = scripts_to_evaluate_on_load_.Keys(); auto result = std::max_element( keys.begin(), keys.end(), [](const WTF::String& a, const WTF::String& b) { return Decimal::FromString(a) < Decimal::FromString(b); }); if (result == keys.end()) { - *identifier = String::Number(1); + scripts_to_evaluate_on_load_.Set(String::Number(1), source); } else { - *identifier = String::Number(Decimal::FromString(*result).ToDouble() + 1); + scripts_to_evaluate_on_load_.Set( + String::Number(Decimal::FromString(*result).ToDouble() + 1), source); } - - std::unique_ptr<JSONObject> script = JSONObject::Create(); - script->SetString("source", source); - script->SetString("world_name", world_name.fromMaybe("")); - scripts_to_evaluate_on_load_.Set(*identifier, script->ToJSONString()); return Response::OK(); } -Response InspectorPageAgent::removeScriptToEvaluateOnNewDocument( +Response InspectorPageAgent::removeScriptToEvaluateOnLoad( const String& identifier) { if (scripts_to_evaluate_on_load_.Get(identifier).IsNull()) return Response::Error("Script not found"); @@ -580,15 +572,15 @@ return Response::OK(); } -Response InspectorPageAgent::addScriptToEvaluateOnLoad(const String& source, - String* identifier) { - return addScriptToEvaluateOnNewDocument(source, Maybe<String>(""), - identifier); +Response InspectorPageAgent::addScriptToEvaluateOnNewDocument( + const String& source, + String* identifier) { + return addScriptToEvaluateOnLoad(source, identifier); } -Response InspectorPageAgent::removeScriptToEvaluateOnLoad( +Response InspectorPageAgent::removeScriptToEvaluateOnNewDocument( const String& identifier) { - return removeScriptToEvaluateOnNewDocument(identifier); + return removeScriptToEvaluateOnLoad(identifier); } Response InspectorPageAgent::setLifecycleEventsEnabled(bool enabled) { @@ -851,45 +843,10 @@ return Decimal::FromString(a) < Decimal::FromString(b); }); - HashMap<String, int> world_id_by_name; for (const WTF::String& key : keys) { - const String script = scripts_to_evaluate_on_load_.Get(key); - std::unique_ptr<JSONObject> object = JSONObject::From(ParseJSON(script)); - String source; - DCHECK(object->GetString("source", &source)); - String world_name; - DCHECK(object->GetString("world_name", &world_name)); - - if (world_name.IsEmpty()) { - frame->GetScriptController().ExecuteScriptInMainWorld(source); - continue; - } - - auto it = world_id_by_name.find(world_name); - int world_id = 0; - if (it != world_id_by_name.end()) { - world_id = it->value; - } else { - scoped_refptr<DOMWrapperWorld> world = - frame->GetScriptController().CreateNewInspectorIsolatedWorld( - world_name); - if (!world) - continue; - world_id = world->GetWorldId(); - world_id_by_name.Set(world_name, world_id); - - scoped_refptr<SecurityOrigin> security_origin = - frame->GetSecurityContext()->GetSecurityOrigin()->IsolatedCopy(); - security_origin->GrantUniversalAccess(); - DOMWrapperWorld::SetIsolatedWorldSecurityOrigin(world_id, - security_origin); - } - - v8::HandleScope handle_scope(V8PerIsolateData::MainThreadIsolate()); - frame->GetScriptController().ExecuteScriptInIsolatedWorld( - world_id, source, KURL(), kNotSharableCrossOrigin); + const WTF::String& script = scripts_to_evaluate_on_load_.Get(key); + frame->GetScriptController().ExecuteScriptInMainWorld(script); } - if (!script_to_evaluate_on_load_once_.IsEmpty()) { frame->GetScriptController().ExecuteScriptInMainWorld( script_to_evaluate_on_load_once_);
diff --git a/third_party/blink/renderer/core/inspector/inspector_page_agent.h b/third_party/blink/renderer/core/inspector/inspector_page_agent.h index f099ed6..7348b4d 100644 --- a/third_party/blink/renderer/core/inspector/inspector_page_agent.h +++ b/third_party/blink/renderer/core/inspector/inspector_page_agent.h
@@ -115,7 +115,6 @@ const String& identifier) override; protocol::Response addScriptToEvaluateOnNewDocument( const String& source, - Maybe<String> world_name, String* identifier) override; protocol::Response removeScriptToEvaluateOnNewDocument( const String& identifier) override;
diff --git a/third_party/blink/renderer/core/layout/layout_box.cc b/third_party/blink/renderer/core/layout/layout_box.cc index fc2c1af..eb627d8 100644 --- a/third_party/blink/renderer/core/layout/layout_box.cc +++ b/third_party/blink/renderer/core/layout/layout_box.cc
@@ -2112,7 +2112,8 @@ return ContainingBlockLogicalHeightForContent(kExcludeMarginBorderPadding); LayoutBoxModelObject* cb = ToLayoutBoxModelObject(Container()); - LayoutUnit height = ContainingBlockLogicalHeightForPositioned(cb); + LayoutUnit height = ContainingBlockLogicalHeightForPositioned( + cb, /* check_for_perpendicular_writing_mode */ false); if (IsInFlowPositioned()) height -= cb->PaddingLogicalHeight(); return height;
diff --git a/third_party/blink/renderer/core/layout/layout_inline.cc b/third_party/blink/renderer/core/layout/layout_inline.cc index 4216b39..c4794ff 100644 --- a/third_party/blink/renderer/core/layout/layout_inline.cc +++ b/third_party/blink/renderer/core/layout/layout_inline.cc
@@ -1456,6 +1456,8 @@ LayoutObject* child, MarkingBehavior marking_behavior) { if (IsInLayoutNGInlineFormattingContext()) { + // TODO(yosin): We should move |SetAncestorLineBoxDirty()| into + // |DirtyLinesFromChangedChild()| like legacy layout. SetAncestorLineBoxDirty(); NGPaintFragment::DirtyLinesFromChangedChild(child); return;
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.cc b/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.cc index 42df221..1527997d 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.cc
@@ -395,6 +395,11 @@ return ToNGInlineNode(node).ItemsData(false).items; } +TouchAction NGPhysicalFragment::EffectiveWhitelistedTouchAction() const { + DCHECK(GetLayoutObject()); + return GetLayoutObject()->EffectiveWhitelistedTouchAction(); +} + UBiDiLevel NGPhysicalFragment::BidiLevel() const { NOTREACHED(); return 0;
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h b/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h index e8d7f1e..cf5af893 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h +++ b/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h
@@ -13,6 +13,7 @@ #include "third_party/blink/renderer/core/layout/ng/geometry/ng_physical_size.h" #include "third_party/blink/renderer/core/layout/ng/ng_break_token.h" #include "third_party/blink/renderer/core/layout/ng/ng_style_variant.h" +#include "third_party/blink/renderer/platform/graphics/touch_action.h" #include "third_party/blink/renderer/platform/wtf/ref_counted.h" #include <unicode/ubidi.h> @@ -177,6 +178,10 @@ void PropagateContentsInkOverflow(NGPhysicalOffsetRect*, NGPhysicalOffset) const; + // The whitelisted touch action is the union of the effective touch action + // (from style) and blocking touch event handlers. + TouchAction EffectiveWhitelistedTouchAction() const; + // Returns the bidi level of a text or atomic inline fragment. virtual UBiDiLevel BidiLevel() const;
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_resource_filter.cc b/third_party/blink/renderer/core/layout/svg/layout_svg_resource_filter.cc index 74444393..66fad9a82 100644 --- a/third_party/blink/renderer/core/layout/svg/layout_svg_resource_filter.cc +++ b/third_party/blink/renderer/core/layout/svg/layout_svg_resource_filter.cc
@@ -43,14 +43,14 @@ } LayoutSVGResourceFilter::LayoutSVGResourceFilter(SVGFilterElement* node) - : LayoutSVGResourceContainer(node) {} + : LayoutSVGResourceContainer(node), filter_(new FilterMap) {} LayoutSVGResourceFilter::~LayoutSVGResourceFilter() = default; void LayoutSVGResourceFilter::DisposeFilterMap() { - for (auto& entry : filter_) + for (auto& entry : *filter_) entry.value->Dispose(); - filter_.clear(); + filter_->clear(); } void LayoutSVGResourceFilter::WillBeDestroyed() { @@ -76,11 +76,11 @@ } bool LayoutSVGResourceFilter::RemoveClientFromCache(SVGResourceClient& client) { - auto entry = filter_.find(&client); - if (entry == filter_.end()) + auto entry = filter_->find(&client); + if (entry == filter_->end()) return false; entry->value->Dispose(); - filter_.erase(entry); + filter_->erase(entry); return true; } @@ -110,7 +110,7 @@ const QualifiedName& attribute) { LayoutObject* object = primitive.GetLayoutObject(); - for (auto& filter : filter_) { + for (auto& filter : *filter_) { FilterData* filter_data = filter.value.Get(); if (filter_data->state_ != FilterData::kReadyToPaint) continue;
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_resource_filter.h b/third_party/blink/renderer/core/layout/svg/layout_svg_resource_filter.h index 0152f3e..c93abbf6 100644 --- a/third_party/blink/renderer/core/layout/svg/layout_svg_resource_filter.h +++ b/third_party/blink/renderer/core/layout/svg/layout_svg_resource_filter.h
@@ -94,11 +94,11 @@ LayoutSVGResourceType ResourceType() const override { return kResourceType; } FilterData* GetFilterDataForClient(const SVGResourceClient* client) { - return filter_.at(const_cast<SVGResourceClient*>(client)); + return filter_->at(const_cast<SVGResourceClient*>(client)); } void SetFilterDataForClient(const SVGResourceClient* client, FilterData* filter_data) { - filter_.Set(const_cast<SVGResourceClient*>(client), filter_data); + filter_->Set(const_cast<SVGResourceClient*>(client), filter_data); } protected: @@ -107,9 +107,8 @@ private: void DisposeFilterMap(); - using FilterMap = - PersistentHeapHashMap<Member<SVGResourceClient>, Member<FilterData>>; - FilterMap filter_; + using FilterMap = HeapHashMap<Member<SVGResourceClient>, Member<FilterData>>; + Persistent<FilterMap> filter_; }; DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGResourceFilter, IsSVGResourceFilter());
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_resource_gradient.cc b/third_party/blink/renderer/core/layout/svg/layout_svg_resource_gradient.cc index db3bf84..1eb83b1 100644 --- a/third_party/blink/renderer/core/layout/svg/layout_svg_resource_gradient.cc +++ b/third_party/blink/renderer/core/layout/svg/layout_svg_resource_gradient.cc
@@ -28,11 +28,12 @@ LayoutSVGResourceGradient::LayoutSVGResourceGradient(SVGGradientElement* node) : LayoutSVGResourcePaintServer(node), - should_collect_gradient_attributes_(true) {} + should_collect_gradient_attributes_(true), + gradient_map_(new GradientMap) {} void LayoutSVGResourceGradient::RemoveAllClientsFromCache( bool mark_for_invalidation) { - gradient_map_.clear(); + gradient_map_->clear(); should_collect_gradient_attributes_ = true; ToSVGGradientElement(*GetElement()).InvalidateDependentGradients(); MarkAllClientsForInvalidation( @@ -42,10 +43,10 @@ bool LayoutSVGResourceGradient::RemoveClientFromCache( SVGResourceClient& client) { - auto entry = gradient_map_.find(&client); - if (entry == gradient_map_.end()) + auto entry = gradient_map_->find(&client); + if (entry == gradient_map_->end()) return false; - gradient_map_.erase(entry); + gradient_map_->erase(entry); return true; } @@ -72,7 +73,7 @@ return SVGPaintServer::Invalid(); std::unique_ptr<GradientData>& gradient_data = - gradient_map_.insert(&client, nullptr).stored_value->value; + gradient_map_->insert(&client, nullptr).stored_value->value; if (!gradient_data) gradient_data = std::make_unique<GradientData>();
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_resource_gradient.h b/third_party/blink/renderer/core/layout/svg/layout_svg_resource_gradient.h index 896308a..6b97469 100644 --- a/third_party/blink/renderer/core/layout/svg/layout_svg_resource_gradient.h +++ b/third_party/blink/renderer/core/layout/svg/layout_svg_resource_gradient.h
@@ -62,9 +62,9 @@ private: bool should_collect_gradient_attributes_ : 1; - using GradientMap = PersistentHeapHashMap<Member<const SVGResourceClient>, - std::unique_ptr<GradientData>>; - GradientMap gradient_map_; + using GradientMap = HeapHashMap<Member<const SVGResourceClient>, + std::unique_ptr<GradientData>>; + Persistent<GradientMap> gradient_map_; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_resource_pattern.cc b/third_party/blink/renderer/core/layout/svg/layout_svg_resource_pattern.cc index d66bc48b..61a7258 100644 --- a/third_party/blink/renderer/core/layout/svg/layout_svg_resource_pattern.cc +++ b/third_party/blink/renderer/core/layout/svg/layout_svg_resource_pattern.cc
@@ -48,11 +48,12 @@ LayoutSVGResourcePattern::LayoutSVGResourcePattern(SVGPatternElement* node) : LayoutSVGResourcePaintServer(node), should_collect_pattern_attributes_(true), - attributes_wrapper_(PatternAttributesWrapper::Create()) {} + attributes_wrapper_(PatternAttributesWrapper::Create()), + pattern_map_(new PatternMap) {} void LayoutSVGResourcePattern::RemoveAllClientsFromCache( bool mark_for_invalidation) { - pattern_map_.clear(); + pattern_map_->clear(); should_collect_pattern_attributes_ = true; MarkAllClientsForInvalidation( mark_for_invalidation ? SVGResourceClient::kPaintInvalidation @@ -61,10 +62,10 @@ bool LayoutSVGResourcePattern::RemoveClientFromCache( SVGResourceClient& client) { - auto entry = pattern_map_.find(&client); - if (entry == pattern_map_.end()) + auto entry = pattern_map_->find(&client); + if (entry == pattern_map_->end()) return false; - pattern_map_.erase(entry); + pattern_map_->erase(entry); return true; } @@ -77,10 +78,10 @@ // invalidation (painting animated images may trigger layout invals which // delete our map entry). Hopefully that will be addressed at some point, and // then we can optimize the lookup. - if (PatternData* current_data = pattern_map_.at(&client)) + if (PatternData* current_data = pattern_map_->at(&client)) return current_data; - return pattern_map_.Set(&client, BuildPatternData(object_bounding_box)) + return pattern_map_->Set(&client, BuildPatternData(object_bounding_box)) .stored_value->value.get(); }
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_resource_pattern.h b/third_party/blink/renderer/core/layout/svg/layout_svg_resource_pattern.h index 322b3cef..e293f39 100644 --- a/third_party/blink/renderer/core/layout/svg/layout_svg_resource_pattern.h +++ b/third_party/blink/renderer/core/layout/svg/layout_svg_resource_pattern.h
@@ -78,9 +78,9 @@ // same => we should be able to cache a single display list per // LayoutSVGResourcePattern + one Pattern(shader) for each client -- this // would avoid re-recording when multiple clients share the same pattern. - using PatternMap = PersistentHeapHashMap<Member<const SVGResourceClient>, - std::unique_ptr<PatternData>>; - PatternMap pattern_map_; + using PatternMap = HeapHashMap<Member<const SVGResourceClient>, + std::unique_ptr<PatternData>>; + Persistent<PatternMap> pattern_map_; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/page/page.cc b/third_party/blink/renderer/core/page/page.cc index fefde21..a29412cd 100644 --- a/third_party/blink/renderer/core/page/page.cc +++ b/third_party/blink/renderer/core/page/page.cc
@@ -89,12 +89,12 @@ // Set of all live pages; includes internal Page objects that are // not observable from scripts. static Page::PageSet& AllPages() { - DEFINE_STATIC_LOCAL(Page::PageSet, pages, ()); + DEFINE_STATIC_LOCAL(Page::PageSet, pages, (new Page::PageSet)); return pages; } Page::PageSet& Page::OrdinaryPages() { - DEFINE_STATIC_LOCAL(Page::PageSet, pages, ()); + DEFINE_STATIC_LOCAL(Page::PageSet, pages, (new Page::PageSet)); return pages; }
diff --git a/third_party/blink/renderer/core/page/page.h b/third_party/blink/renderer/core/page/page.h index 0c09b2c..8d2baa9 100644 --- a/third_party/blink/renderer/core/page/page.h +++ b/third_party/blink/renderer/core/page/page.h
@@ -114,7 +114,7 @@ void CloseSoon(); bool IsClosing() const { return is_closing_; } - using PageSet = PersistentHeapHashSet<WeakMember<Page>>; + using PageSet = HeapHashSet<WeakMember<Page>>; // Return the current set of full-fledged, ordinary pages. // Each created and owned by a WebView.
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 d60eacd..4155af7 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
@@ -191,6 +191,32 @@ PaintOverflowControlsIfNeeded(info, paint_offset); } +void NGBoxFragmentPainter::RecordHitTestData(const PaintInfo& paint_info, + const LayoutPoint& paint_offset) { + // Hit test display items are only needed for compositing. This flag is used + // for for printing and drag images which do not need hit testing. + if (paint_info.GetGlobalPaintFlags() & kGlobalPaintFlattenCompositingLayers) + return; + + const NGPhysicalFragment& physical_fragment = PhysicalFragment(); + auto touch_action = physical_fragment.EffectiveWhitelistedTouchAction(); + if (touch_action == TouchAction::kTouchActionAuto) + return; + + // TODO(pdr): If we are painting the background into the scrolling contents + // layer, we need to use the overflow rect instead of the border box rect. We + // may want to move the call to RecordTouchActionRect into + // BoxPainter::PaintBoxDecorationBackgroundWithRect and share the logic + // the background painting code already uses. + NGPhysicalOffsetRect border_box = physical_fragment.LocalRect(); + if (physical_fragment.IsInline()) + border_box.offset += box_fragment_.InlineOffsetToContainerBox(); + border_box.offset += NGPhysicalOffset(paint_offset); + HitTestData::RecordTouchActionRect( + paint_info.context, box_fragment_, + TouchActionRect(border_box.ToLayoutRect(), touch_action)); +} + void NGBoxFragmentPainter::PaintObject( const PaintInfo& paint_info, const LayoutPoint& paint_offset, @@ -208,6 +234,9 @@ style.HasBoxDecorationBackground()) PaintBoxDecorationBackground(paint_info, paint_offset); + if (RuntimeEnabledFeatures::PaintTouchActionRectsEnabled()) + RecordHitTestData(paint_info, paint_offset); + // Record the scroll hit test after the background so background squashing // is not affected. Hit test order would be equivalent if this were // immediately before the background.
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 f41c5b1e8..269fbdd 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
@@ -115,6 +115,9 @@ const LayoutPoint& paint_offset); void PaintCarets(const PaintInfo&, const LayoutPoint& paint_offset); + void RecordHitTestData(const PaintInfo& paint_info, + const LayoutPoint& paint_offset); + bool IsInSelfHitTestingPhase(HitTestAction) const; bool VisibleToHitTestRequest(const HitTestRequest&) const;
diff --git a/third_party/blink/renderer/core/paint/ng/ng_paint_fragment.cc b/third_party/blink/renderer/core/paint/ng/ng_paint_fragment.cc index 7edc072..f839265 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_paint_fragment.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_paint_fragment.cc
@@ -159,7 +159,8 @@ NGPaintFragment* parent) : physical_fragment_(std::move(fragment)), offset_(offset), - parent_(parent) { + parent_(parent), + is_dirty_inline_(false) { DCHECK(physical_fragment_); } @@ -432,6 +433,11 @@ } void NGPaintFragment::DirtyLinesFromChangedChild(LayoutObject* child) { + if (child->IsInline()) { + LayoutBlockFlow* const block = child->EnclosingNGBlockFlow(); + if (block && block->PaintFragment()) + MarkLineBoxesDirtyFor(*child); + } if (!child->IsInLayoutNGInlineFormattingContext()) return; // We should rest first inline fragment for following tests: @@ -532,6 +538,91 @@ return nullptr; } +void NGPaintFragment::MarkLineBoxesDirtyFor(const LayoutObject& layout_object) { + DCHECK(layout_object.IsInline()) << layout_object; + if (TryMarkLineBoxDirtyFor(layout_object)) + return; + if (layout_object.IsLayoutInline()) { + bool marked = false; + for (LayoutObject* runner = layout_object.NextInPreOrder(&layout_object); + runner; runner = runner->NextInPreOrder(&layout_object)) { + if (runner->IsFloatingOrOutOfFlowPositioned()) + continue; + if (TryMarkLineBoxDirtyFor(*runner)) + marked = true; + } + if (marked) + return; + } + // Since |layout_object| isn't in fragment tree, check both following and + // preceding siblings. + bool marked = false; + for (LayoutObject* next = layout_object.NextSibling(); next; + next = next->NextSibling()) { + if (next->IsFloatingOrOutOfFlowPositioned()) + continue; + // |next| may not be in inline formatting context, e.g. <object>. + if (TryMarkLineBoxDirtyFor(*next)) { + marked = true; + break; + } + } + for (LayoutObject* previous = layout_object.PreviousSibling(); previous; + previous = previous->PreviousSibling()) { + if (previous->IsFloatingOrOutOfFlowPositioned()) + continue; + // |previous| may not be in inline formatting context, e.g. <object>. + if (TryMarkLineBoxDirtyFor(*previous)) { + marked = true; + break; + } + } + if (marked) + return; + // There is no siblings, try parent. + const LayoutObject& parent = *layout_object.Parent(); + if (parent.IsInline()) + return MarkLineBoxesDirtyFor(parent); + if (!parent.IsLayoutNGMixin()) + return; + const LayoutBlockFlow& block = ToLayoutBlockFlow(parent); + if (!block.PaintFragment()) { + // We have not yet layout. + return; + } + // We inserted |layout_object| into empty block. + block.PaintFragment()->FirstLineBox()->is_dirty_inline_ = true; +} + +void NGPaintFragment::MarkLineBoxDirty() { + for (NGPaintFragment* fragment : + NGPaintFragmentTraversal::InclusiveAncestorsOf(*this)) { + if (fragment->is_dirty_inline_) + return; + fragment->is_dirty_inline_ = true; + if (fragment->PhysicalFragment().IsLineBox()) + return; + } + NOTREACHED() << this; // Should have a line box ancestor. +} + +bool NGPaintFragment::TryMarkLineBoxDirtyFor( + const LayoutObject& layout_object) { + if (!layout_object.IsInLayoutNGInlineFormattingContext()) + return false; + const auto& range = InlineFragmentsFor(&layout_object); + if (range.IsEmpty()) + return false; + NGPaintFragment* last_parent = nullptr; + for (NGPaintFragment* fragment : range) { + if (last_parent == fragment->Parent()) + continue; + fragment->MarkLineBoxDirty(); + last_parent = fragment->Parent(); + } + return true; +} + void NGPaintFragment::SetShouldDoFullPaintInvalidationRecursively() { if (LayoutObject* layout_object = GetLayoutObject()) layout_object->SetShouldDoFullPaintInvalidation();
diff --git a/third_party/blink/renderer/core/paint/ng/ng_paint_fragment.h b/third_party/blink/renderer/core/paint/ng/ng_paint_fragment.h index d2fafd8..8495ce7 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_paint_fragment.h +++ b/third_party/blink/renderer/core/paint/ng/ng_paint_fragment.h
@@ -83,6 +83,9 @@ // Returns the container line box for inline fragments. const NGPaintFragment* ContainerLineBox() const; + // Returns true if this fragment is line box and marked dirty. + bool IsDirty() const { return is_dirty_inline_; } + // Returns offset to its container box for inline and line box fragments. const NGPhysicalOffset& InlineOffsetToContainerBox() const { DCHECK(PhysicalFragment().IsInline() || PhysicalFragment().IsLineBox()); @@ -255,6 +258,7 @@ NGPaintFragment* parent, scoped_refptr<NGPaintFragment> previous_instance, bool* populate_children); + void PopulateDescendants( const NGPhysicalOffset inline_offset_to_container_box, HashMap<const LayoutObject*, NGPaintFragment*>* last_fragment_map); @@ -269,6 +273,16 @@ PositionWithAffinity PositionForPointInInlineLevelBox( const NGPhysicalOffset&) const; + // Dirty line boxes containing |layout_object|. + static void MarkLineBoxesDirtyFor(const LayoutObject& layout_object); + + // Mark this line box was changed, in order to re-use part of an inline + // formatting context. + void MarkLineBoxDirty(); + + // Returns true when associated fragment of |layout_object| has line box. + static bool TryMarkLineBoxDirtyFor(const LayoutObject& layout_object); + // // Following fields are computed in the layout phase. // @@ -285,6 +299,12 @@ NGPaintFragment* next_for_same_layout_object_ = nullptr; NGPhysicalOffset inline_offset_to_container_box_; + // For a line box, this indicates it is dirty. This helps to determine if the + // fragment is re-usable when part of an inline formatting context is changed. + // For an inline box, this flag helps to avoid traversing up to its line box + // every time. + unsigned is_dirty_inline_ : 1; + // // Following fields are computed in the pre-paint phase. //
diff --git a/third_party/blink/renderer/core/paint/ng/ng_paint_fragment_test.cc b/third_party/blink/renderer/core/paint/ng/ng_paint_fragment_test.cc index 1710a6c..359f408 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_paint_fragment_test.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_paint_fragment_test.cc
@@ -456,4 +456,115 @@ EXPECT_EQ(LayoutRect(180, 40, 10, 30), text3.VisualRect()); } +TEST_F(NGPaintFragmentTest, MarkLineBoxesDirtyByRemoveBr) { + SetBodyInnerHTML( + "<div id=container>line 1<br>line 2<br id=target>line 3<br>" + "</div>"); + Element& target = *GetDocument().getElementById("target"); + target.remove(); + const NGPaintFragment& container = *GetPaintFragmentByElementId("container"); + EXPECT_FALSE(container.Children()[0]->IsDirty()); + EXPECT_TRUE(container.Children()[1]->IsDirty()); + EXPECT_FALSE(container.Children()[2]->IsDirty()); +} + +TEST_F(NGPaintFragmentTest, MarkLineBoxesDirtyByRemoveChild) { + SetBodyInnerHTML( + "<div id=container>line 1<br><b id=target>line 2</b><br>line 3<br>" + "</div>"); + Element& target = *GetDocument().getElementById("target"); + target.remove(); + const NGPaintFragment& container = *GetPaintFragmentByElementId("container"); + EXPECT_TRUE(container.Children()[0]->IsDirty()); + EXPECT_TRUE(container.Children()[1]->IsDirty()); + EXPECT_FALSE(container.Children()[2]->IsDirty()); +} + +TEST_F(NGPaintFragmentTest, MarkLineBoxesDirtyByRemoveSpanWithBr) { + SetBodyInnerHTML( + "<div id=container>line 1<br>line 2<span id=target><br></span>line 3<br>" + "</div>"); + // |target| is a culled inline box. There is no fragment in fragment tree. + Element& target = *GetDocument().getElementById("target"); + target.remove(); + const NGPaintFragment& container = *GetPaintFragmentByElementId("container"); + EXPECT_FALSE(container.Children()[0]->IsDirty()); + EXPECT_TRUE(container.Children()[1]->IsDirty()); + EXPECT_TRUE(container.Children()[2]->IsDirty()); +} + +TEST_F(NGPaintFragmentTest, MarkLineBoxesDirtyByInsertAtStart) { + SetBodyInnerHTML( + "<div id=container>line 1<br><b id=target>line 2</b><br>line 3<br>" + "</div>"); + const NGPaintFragment& container = *GetPaintFragmentByElementId("container"); + const scoped_refptr<const NGPaintFragment> line1 = container.Children()[0]; + ASSERT_TRUE(line1->PhysicalFragment().IsLineBox()) << line1; + const scoped_refptr<const NGPaintFragment> line2 = container.Children()[1]; + ASSERT_TRUE(line2->PhysicalFragment().IsLineBox()) << line2; + const scoped_refptr<const NGPaintFragment> line3 = container.Children()[2]; + ASSERT_TRUE(line3->PhysicalFragment().IsLineBox()) << line3; + Element& target = *GetDocument().getElementById("target"); + target.parentNode()->insertBefore(Text::Create(GetDocument(), "XYZ"), + &target); + GetDocument().UpdateStyleAndLayout(); + + EXPECT_TRUE(line1->IsDirty()); + EXPECT_TRUE(line2->IsDirty()); + EXPECT_FALSE(line3->IsDirty()); +} + +TEST_F(NGPaintFragmentTest, MarkLineBoxesDirtyByInsertAtLast) { + SetBodyInnerHTML( + "<div id=container>line 1<br><b id=target>line 2</b><br>line 3<br>" + "</div>"); + const NGPaintFragment& container = *GetPaintFragmentByElementId("container"); + const scoped_refptr<const NGPaintFragment> line1 = container.Children()[0]; + ASSERT_TRUE(line1->PhysicalFragment().IsLineBox()) << line1; + const scoped_refptr<const NGPaintFragment> line2 = container.Children()[1]; + ASSERT_TRUE(line2->PhysicalFragment().IsLineBox()) << line2; + const scoped_refptr<const NGPaintFragment> line3 = container.Children()[2]; + ASSERT_TRUE(line3->PhysicalFragment().IsLineBox()) << line3; + Element& target = *GetDocument().getElementById("target"); + target.parentNode()->appendChild(Text::Create(GetDocument(), "XYZ")); + GetDocument().UpdateStyleAndLayout(); + + EXPECT_FALSE(line1->IsDirty()); + EXPECT_FALSE(line2->IsDirty()); + EXPECT_TRUE(line3->IsDirty()); +} + +TEST_F(NGPaintFragmentTest, MarkLineBoxesDirtyByInsertAtMiddle) { + SetBodyInnerHTML( + "<div id=container>line 1<br><b id=target>line 2</b><br>line 3<br>" + "</div>"); + const NGPaintFragment& container = *GetPaintFragmentByElementId("container"); + const scoped_refptr<const NGPaintFragment> line1 = container.Children()[0]; + ASSERT_TRUE(line1->PhysicalFragment().IsLineBox()) << line1; + const scoped_refptr<const NGPaintFragment> line2 = container.Children()[1]; + ASSERT_TRUE(line2->PhysicalFragment().IsLineBox()) << line2; + const scoped_refptr<const NGPaintFragment> line3 = container.Children()[2]; + ASSERT_TRUE(line3->PhysicalFragment().IsLineBox()) << line3; + Element& target = *GetDocument().getElementById("target"); + target.parentNode()->insertBefore(Text::Create(GetDocument(), "XYZ"), + target.nextSibling()); + GetDocument().UpdateStyleAndLayout(); + + EXPECT_TRUE(line1->IsDirty()); + EXPECT_TRUE(line2->IsDirty()); + EXPECT_FALSE(line3->IsDirty()); +} + +TEST_F(NGPaintFragmentTest, MarkLineBoxesDirtyByTextSetData) { + SetBodyInnerHTML( + "<div id=container>line 1<br><b id=target>line 2</b><br>line " + "3<br></div>"); + Element& target = *GetDocument().getElementById("target"); + ToText(*target.firstChild()).setData("abc"); + const NGPaintFragment& container = *GetPaintFragmentByElementId("container"); + EXPECT_FALSE(container.Children()[0]->IsDirty()); + EXPECT_TRUE(container.Children()[1]->IsDirty()); + EXPECT_FALSE(container.Children()[2]->IsDirty()); +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/scroll/scrollbar_theme_mac.mm b/third_party/blink/renderer/core/scroll/scrollbar_theme_mac.mm index f67fa198..5ceea1d6 100644 --- a/third_party/blink/renderer/core/scroll/scrollbar_theme_mac.mm +++ b/third_party/blink/renderer/core/scroll/scrollbar_theme_mac.mm
@@ -97,19 +97,18 @@ namespace blink { -typedef PersistentHeapHashSet<WeakMember<Scrollbar>> ScrollbarSet; +typedef HeapHashSet<WeakMember<Scrollbar>> ScrollbarSet; static ScrollbarSet& GetScrollbarSet() { - DEFINE_STATIC_LOCAL(ScrollbarSet, set, ()); + DEFINE_STATIC_LOCAL(ScrollbarSet, set, (new ScrollbarSet)); return set; } -typedef PersistentHeapHashMap<WeakMember<Scrollbar>, - RetainPtr<BlinkScrollbarObserver>> +typedef HeapHashMap<WeakMember<Scrollbar>, RetainPtr<BlinkScrollbarObserver>> ScrollbarPainterMap; static ScrollbarPainterMap& GetScrollbarPainterMap() { - DEFINE_STATIC_LOCAL(ScrollbarPainterMap, map, ()); + DEFINE_STATIC_LOCAL(ScrollbarPainterMap, map, (new ScrollbarPainterMap)); return map; }
diff --git a/third_party/blink/renderer/core/style/style_inherited_variables.cc b/third_party/blink/renderer/core/style/style_inherited_variables.cc index 4da904a..3c4be35 100644 --- a/third_party/blink/renderer/core/style/style_inherited_variables.cc +++ b/third_party/blink/renderer/core/style/style_inherited_variables.cc
@@ -30,13 +30,20 @@ return true; } +StyleInheritedVariables::StyleInheritedVariables() + : registered_data_(new HeapHashMap<AtomicString, Member<CSSValue>>), + root_(nullptr), + needs_resolution_(false) {} + StyleInheritedVariables::StyleInheritedVariables( StyleInheritedVariables& other) { if (!other.root_) { + registered_data_ = new HeapHashMap<AtomicString, Member<CSSValue>>; root_ = &other; } else { data_ = other.data_; - registered_data_ = other.registered_data_; + registered_data_ = new HeapHashMap<AtomicString, Member<CSSValue>>( + *other.registered_data_); root_ = other.root_; } needs_resolution_ = other.needs_resolution_; @@ -56,13 +63,13 @@ const AtomicString& name, const CSSValue* parsed_value) { needs_resolution_ = true; - registered_data_.Set(name, const_cast<CSSValue*>(parsed_value)); + registered_data_->Set(name, const_cast<CSSValue*>(parsed_value)); } const CSSValue* StyleInheritedVariables::RegisteredVariable( const AtomicString& name) const { - auto result = registered_data_.find(name); - if (result != registered_data_.end()) + auto result = registered_data_->find(name); + if (result != registered_data_->end()) return result->value.Get(); if (root_) return root_->RegisteredVariable(name); @@ -71,8 +78,8 @@ void StyleInheritedVariables::RemoveVariable(const AtomicString& name) { data_.Set(name, nullptr); - auto iterator = registered_data_.find(name); - if (iterator != registered_data_.end()) { + auto iterator = registered_data_->find(name); + if (iterator != registered_data_->end()) { iterator->value = nullptr; } else if (root_ && root_->RegisteredVariable(name)) { SetRegisteredVariable(name, nullptr);
diff --git a/third_party/blink/renderer/core/style/style_inherited_variables.h b/third_party/blink/renderer/core/style/style_inherited_variables.h index 5242c2b0..2c7613b 100644 --- a/third_party/blink/renderer/core/style/style_inherited_variables.h +++ b/third_party/blink/renderer/core/style/style_inherited_variables.h
@@ -53,13 +53,13 @@ void ClearNeedsResolution() { needs_resolution_ = false; } private: - StyleInheritedVariables() : root_(nullptr), needs_resolution_(false) {} + StyleInheritedVariables(); StyleInheritedVariables(StyleInheritedVariables& other); friend class CSSVariableResolver; HashMap<AtomicString, scoped_refptr<CSSVariableData>> data_; - PersistentHeapHashMap<AtomicString, Member<CSSValue>> registered_data_; + Persistent<HeapHashMap<AtomicString, Member<CSSValue>>> registered_data_; scoped_refptr<StyleInheritedVariables> root_; bool needs_resolution_; };
diff --git a/third_party/blink/renderer/core/style/style_non_inherited_variables.cc b/third_party/blink/renderer/core/style/style_non_inherited_variables.cc index d72b824..e13afe9 100644 --- a/third_party/blink/renderer/core/style/style_non_inherited_variables.cc +++ b/third_party/blink/renderer/core/style/style_non_inherited_variables.cc
@@ -31,18 +31,23 @@ const AtomicString& name, const CSSValue* parsed_value) { needs_resolution_ = true; - registered_data_.Set(name, const_cast<CSSValue*>(parsed_value)); + registered_data_->Set(name, const_cast<CSSValue*>(parsed_value)); } void StyleNonInheritedVariables::RemoveVariable(const AtomicString& name) { data_.Set(name, nullptr); - registered_data_.Set(name, nullptr); + registered_data_->Set(name, nullptr); } +StyleNonInheritedVariables::StyleNonInheritedVariables() + : registered_data_(new HeapHashMap<AtomicString, Member<CSSValue>>), + needs_resolution_(false) {} + StyleNonInheritedVariables::StyleNonInheritedVariables( StyleNonInheritedVariables& other) { data_ = other.data_; - registered_data_ = other.registered_data_; + registered_data_ = + new HeapHashMap<AtomicString, Member<CSSValue>>(*other.registered_data_); needs_resolution_ = other.needs_resolution_; }
diff --git a/third_party/blink/renderer/core/style/style_non_inherited_variables.h b/third_party/blink/renderer/core/style/style_non_inherited_variables.h index 112fa39eb..c2cb303 100644 --- a/third_party/blink/renderer/core/style/style_non_inherited_variables.h +++ b/third_party/blink/renderer/core/style/style_non_inherited_variables.h
@@ -45,7 +45,7 @@ void SetRegisteredVariable(const AtomicString&, const CSSValue*); const CSSValue* RegisteredVariable(const AtomicString& name) const { - return registered_data_.at(name); + return registered_data_->at(name); } HashSet<AtomicString> GetCustomPropertyNames() const; @@ -54,13 +54,13 @@ void ClearNeedsResolution() { needs_resolution_ = false; } private: - StyleNonInheritedVariables() : needs_resolution_(false) {} + StyleNonInheritedVariables(); StyleNonInheritedVariables(StyleNonInheritedVariables&); friend class CSSVariableResolver; HashMap<AtomicString, scoped_refptr<CSSVariableData>> data_; - PersistentHeapHashMap<AtomicString, Member<CSSValue>> registered_data_; + Persistent<HeapHashMap<AtomicString, Member<CSSValue>>> registered_data_; bool needs_resolution_; };
diff --git a/third_party/blink/renderer/devtools/front_end/profiler/HeapProfileView.js b/third_party/blink/renderer/devtools/front_end/profiler/HeapProfileView.js index 78d5314..5660455 100644 --- a/third_party/blink/renderer/devtools/front_end/profiler/HeapProfileView.js +++ b/third_party/blink/renderer/devtools/front_end/profiler/HeapProfileView.js
@@ -173,9 +173,13 @@ return; const profile = new Profiler.SamplingHeapProfileHeader(heapProfilerModel, this); this.setProfileBeingRecorded(profile); - SDK.targetManager.suspendAllTargets(); this.addProfile(profile); profile.updateStatus(Common.UIString('Recording\u2026')); + + const icon = UI.Icon.create('smallicon-warning'); + icon.title = Common.UIString('Heap profiler is recording'); + UI.inspectorView.setPanelIcon('heap_profiler', icon); + this._recording = true; this._startSampling(); } @@ -194,8 +198,7 @@ recordedProfile.updateStatus(''); this.setProfileBeingRecorded(null); } - - await SDK.targetManager.resumeAllTargets(); + UI.inspectorView.setPanelIcon('heap_profiler', null); this.dispatchEventToListeners(Profiler.ProfileType.Events.ProfileComplete, recordedProfile); }
diff --git a/third_party/blink/renderer/modules/animationworklet/animation_worklet_thread_test.cc b/third_party/blink/renderer/modules/animationworklet/animation_worklet_thread_test.cc index 93fba8c4..4bf67b5 100644 --- a/third_party/blink/renderer/modules/animationworklet/animation_worklet_thread_test.cc +++ b/third_party/blink/renderer/modules/animationworklet/animation_worklet_thread_test.cc
@@ -28,7 +28,6 @@ #include "third_party/blink/renderer/platform/cross_thread_functional.h" #include "third_party/blink/renderer/platform/loader/fetch/access_control_status.h" #include "third_party/blink/renderer/platform/loader/fetch/resource_loader_options.h" -#include "third_party/blink/renderer/platform/testing/testing_platform_support.h" #include "third_party/blink/renderer/platform/testing/unit_test_helpers.h" #include "third_party/blink/renderer/platform/waitable_event.h" #include "third_party/blink/renderer/platform/web_thread_supporting_gc.h" @@ -37,17 +36,6 @@ namespace blink { namespace { -class AnimationWorkletTestPlatform : public TestingPlatformSupport { - public: - // Need to override the thread creating support so we can actually run - // Animation Worklet code that would go on a backing thread in non-test - // code. i.e. most tests remove the extra threads, but we need this one. - std::unique_ptr<WebThread> CreateThread( - const blink::WebThreadCreationParams& params) override { - return old_platform_->CreateThread(params); - } -}; - class TestAnimationWorkletProxyClient : public AnimationWorkletProxyClient { public: TestAnimationWorkletProxyClient() @@ -127,7 +115,6 @@ } std::unique_ptr<WorkerReportingProxy> reporting_proxy_; - ScopedTestingPlatformSupport<AnimationWorkletTestPlatform> platform_; }; TEST_F(AnimationWorkletThreadTest, Basic) {
diff --git a/third_party/blink/renderer/modules/indexeddb/idb_transaction_test.cc b/third_party/blink/renderer/modules/indexeddb/idb_transaction_test.cc index 732ed6a1..6e0e414 100644 --- a/third_party/blink/renderer/modules/indexeddb/idb_transaction_test.cc +++ b/third_party/blink/renderer/modules/indexeddb/idb_transaction_test.cc
@@ -122,11 +122,13 @@ EXPECT_CALL(*backend, Close()).Times(1); BuildTransaction(scope, std::move(backend)); - PersistentHeapHashSet<WeakMember<IDBTransaction>> live_transactions; - live_transactions.insert(transaction_); + Persistent<HeapHashSet<WeakMember<IDBTransaction>>> live_transactions = + new HeapHashSet<WeakMember<IDBTransaction>>; + ; + live_transactions->insert(transaction_); ThreadState::Current()->CollectAllGarbage(); - EXPECT_EQ(1u, live_transactions.size()); + EXPECT_EQ(1u, live_transactions->size()); Persistent<IDBRequest> request = IDBRequest::Create(scope.GetScriptState(), store_.Get(), @@ -136,7 +138,7 @@ request.Clear(); // The transaction is holding onto the request. ThreadState::Current()->CollectAllGarbage(); - EXPECT_EQ(1u, live_transactions.size()); + EXPECT_EQ(1u, live_transactions->size()); // This will generate an Abort() call to the back end which is dropped by the // fake proxy, so an explicit OnAbort call is made. @@ -147,7 +149,7 @@ store_.Clear(); ThreadState::Current()->CollectAllGarbage(); - EXPECT_EQ(0U, live_transactions.size()); + EXPECT_EQ(0U, live_transactions->size()); } TEST_F(IDBTransactionTest, ContextDestroyedAfterDone) { @@ -156,11 +158,13 @@ EXPECT_CALL(*backend, Close()).Times(1); BuildTransaction(scope, std::move(backend)); - PersistentHeapHashSet<WeakMember<IDBTransaction>> live_transactions; - live_transactions.insert(transaction_); + Persistent<HeapHashSet<WeakMember<IDBTransaction>>> live_transactions = + new HeapHashSet<WeakMember<IDBTransaction>>; + ; + live_transactions->insert(transaction_); ThreadState::Current()->CollectAllGarbage(); - EXPECT_EQ(1U, live_transactions.size()); + EXPECT_EQ(1U, live_transactions->size()); Persistent<IDBRequest> request = IDBRequest::Create(scope.GetScriptState(), store_.Get(), @@ -172,7 +176,7 @@ request.Clear(); // The transaction is holding onto the request. ThreadState::Current()->CollectAllGarbage(); - EXPECT_EQ(1U, live_transactions.size()); + EXPECT_EQ(1U, live_transactions->size()); // This will generate an Abort() call to the back end which is dropped by the // fake proxy, so an explicit OnAbort call is made. @@ -184,10 +188,10 @@ // The request completed, so it has enqueued a success event. Discard the // event, so that the transaction can go away. - EXPECT_EQ(1U, live_transactions.size()); + EXPECT_EQ(1U, live_transactions->size()); ThreadState::Current()->CollectAllGarbage(); - EXPECT_EQ(0U, live_transactions.size()); + EXPECT_EQ(0U, live_transactions->size()); } TEST_F(IDBTransactionTest, ContextDestroyedWithQueuedResult) { @@ -196,11 +200,13 @@ EXPECT_CALL(*backend, Close()).Times(1); BuildTransaction(scope, std::move(backend)); - PersistentHeapHashSet<WeakMember<IDBTransaction>> live_transactions; - live_transactions.insert(transaction_); + Persistent<HeapHashSet<WeakMember<IDBTransaction>>> live_transactions = + new HeapHashSet<WeakMember<IDBTransaction>>; + ; + live_transactions->insert(transaction_); ThreadState::Current()->CollectAllGarbage(); - EXPECT_EQ(1U, live_transactions.size()); + EXPECT_EQ(1U, live_transactions->size()); Persistent<IDBRequest> request = IDBRequest::Create(scope.GetScriptState(), store_.Get(), @@ -211,7 +217,7 @@ request.Clear(); // The transaction is holding onto the request. ThreadState::Current()->CollectAllGarbage(); - EXPECT_EQ(1U, live_transactions.size()); + EXPECT_EQ(1U, live_transactions->size()); // This will generate an Abort() call to the back end which is dropped by the // fake proxy, so an explicit OnAbort call is made. @@ -224,7 +230,7 @@ url_loader_mock_factory_->ServeAsynchronousRequests(); ThreadState::Current()->CollectAllGarbage(); - EXPECT_EQ(0U, live_transactions.size()); + EXPECT_EQ(0U, live_transactions->size()); } TEST_F(IDBTransactionTest, ContextDestroyedWithTwoQueuedResults) { @@ -233,11 +239,13 @@ EXPECT_CALL(*backend, Close()).Times(1); BuildTransaction(scope, std::move(backend)); - PersistentHeapHashSet<WeakMember<IDBTransaction>> live_transactions; - live_transactions.insert(transaction_); + Persistent<HeapHashSet<WeakMember<IDBTransaction>>> live_transactions = + new HeapHashSet<WeakMember<IDBTransaction>>; + ; + live_transactions->insert(transaction_); ThreadState::Current()->CollectAllGarbage(); - EXPECT_EQ(1U, live_transactions.size()); + EXPECT_EQ(1U, live_transactions->size()); Persistent<IDBRequest> request1 = IDBRequest::Create(scope.GetScriptState(), store_.Get(), @@ -253,7 +261,7 @@ request1.Clear(); // The transaction is holding onto the requests. request2.Clear(); ThreadState::Current()->CollectAllGarbage(); - EXPECT_EQ(1U, live_transactions.size()); + EXPECT_EQ(1U, live_transactions->size()); // This will generate an Abort() call to the back end which is dropped by the // fake proxy, so an explicit OnAbort call is made. @@ -266,7 +274,7 @@ url_loader_mock_factory_->ServeAsynchronousRequests(); ThreadState::Current()->CollectAllGarbage(); - EXPECT_EQ(0U, live_transactions.size()); + EXPECT_EQ(0U, live_transactions->size()); } TEST_F(IDBTransactionTest, DocumentShutdownWithQueuedAndBlockedResults) { @@ -277,11 +285,13 @@ EXPECT_CALL(*backend, Close()).Times(1); BuildTransaction(scope, std::move(backend)); - PersistentHeapHashSet<WeakMember<IDBTransaction>> live_transactions; - live_transactions.insert(transaction_); + Persistent<HeapHashSet<WeakMember<IDBTransaction>>> live_transactions = + new HeapHashSet<WeakMember<IDBTransaction>>; + ; + live_transactions->insert(transaction_); ThreadState::Current()->CollectAllGarbage(); - EXPECT_EQ(1U, live_transactions.size()); + EXPECT_EQ(1U, live_transactions->size()); Persistent<IDBRequest> request1 = IDBRequest::Create(scope.GetScriptState(), store_.Get(), @@ -297,7 +307,7 @@ request1.Clear(); // The transaction is holding onto the requests. request2.Clear(); ThreadState::Current()->CollectAllGarbage(); - EXPECT_EQ(1U, live_transactions.size()); + EXPECT_EQ(1U, live_transactions->size()); // This will generate an Abort() call to the back end which is dropped by the // fake proxy, so an explicit OnAbort call is made. @@ -310,7 +320,7 @@ url_loader_mock_factory_->ServeAsynchronousRequests(); ThreadState::Current()->CollectAllGarbage(); - EXPECT_EQ(0U, live_transactions.size()); + EXPECT_EQ(0U, live_transactions->size()); } TEST_F(IDBTransactionTest, TransactionFinish) { @@ -320,22 +330,24 @@ EXPECT_CALL(*backend, Close()).Times(1); BuildTransaction(scope, std::move(backend)); - PersistentHeapHashSet<WeakMember<IDBTransaction>> live_transactions; - live_transactions.insert(transaction_); + Persistent<HeapHashSet<WeakMember<IDBTransaction>>> live_transactions = + new HeapHashSet<WeakMember<IDBTransaction>>; + ; + live_transactions->insert(transaction_); ThreadState::Current()->CollectAllGarbage(); - EXPECT_EQ(1U, live_transactions.size()); + EXPECT_EQ(1U, live_transactions->size()); DeactivateNewTransactions(scope.GetIsolate()); ThreadState::Current()->CollectAllGarbage(); - EXPECT_EQ(1U, live_transactions.size()); + EXPECT_EQ(1U, live_transactions->size()); transaction_.Clear(); store_.Clear(); ThreadState::Current()->CollectAllGarbage(); - EXPECT_EQ(1U, live_transactions.size()); + EXPECT_EQ(1U, live_transactions->size()); // Stop the context, so events don't get queued (which would keep the // transaction alive). @@ -348,7 +360,7 @@ // OnAbort() should have cleared the transaction's reference to the database. ThreadState::Current()->CollectAllGarbage(); - EXPECT_EQ(0U, live_transactions.size()); + EXPECT_EQ(0U, live_transactions->size()); } } // namespace
diff --git a/third_party/blink/renderer/modules/mediasource/media_source_registry.cc b/third_party/blink/renderer/modules/mediasource/media_source_registry.cc index 950e2164..84c35851 100644 --- a/third_party/blink/renderer/modules/mediasource/media_source_registry.cc +++ b/third_party/blink/renderer/modules/mediasource/media_source_registry.cc
@@ -49,27 +49,28 @@ MediaSource* source = static_cast<MediaSource*>(registrable); source->AddedToRegistry(); - media_sources_.Set(url.GetString(), source); + media_sources_->Set(url.GetString(), source); } void MediaSourceRegistry::UnregisterURL(const KURL& url) { DCHECK(IsMainThread()); - PersistentHeapHashMap<String, Member<MediaSource>>::iterator iter = - media_sources_.find(url.GetString()); - if (iter == media_sources_.end()) + HeapHashMap<String, Member<MediaSource>>::iterator iter = + media_sources_->find(url.GetString()); + if (iter == media_sources_->end()) return; MediaSource* source = iter->value; - media_sources_.erase(iter); + media_sources_->erase(iter); source->RemovedFromRegistry(); } URLRegistrable* MediaSourceRegistry::Lookup(const String& url) { DCHECK(IsMainThread()); - return url.IsNull() ? nullptr : media_sources_.at(url); + return url.IsNull() ? nullptr : media_sources_->at(url); } -MediaSourceRegistry::MediaSourceRegistry() { +MediaSourceRegistry::MediaSourceRegistry() + : media_sources_(new HeapHashMap<String, Member<MediaSource>>) { HTMLMediaSource::SetRegistry(this); }
diff --git a/third_party/blink/renderer/modules/mediasource/media_source_registry.h b/third_party/blink/renderer/modules/mediasource/media_source_registry.h index 0bfa569..84b1ec57 100644 --- a/third_party/blink/renderer/modules/mediasource/media_source_registry.h +++ b/third_party/blink/renderer/modules/mediasource/media_source_registry.h
@@ -55,7 +55,7 @@ private: MediaSourceRegistry(); - PersistentHeapHashMap<String, Member<MediaSource>> media_sources_; + Persistent<HeapHashMap<String, Member<MediaSource>>> media_sources_; }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_registry.cc b/third_party/blink/renderer/modules/mediastream/media_stream_registry.cc index 7a6715dd..db5b71d3 100644 --- a/third_party/blink/renderer/modules/mediastream/media_stream_registry.cc +++ b/third_party/blink/renderer/modules/mediastream/media_stream_registry.cc
@@ -43,27 +43,29 @@ URLRegistrable* stream) { DCHECK(&stream->Registry() == this); DCHECK(IsMainThread()); - stream_descriptors_.Set(url.GetString(), - static_cast<MediaStream*>(stream)->Descriptor()); + stream_descriptors_->Set(url.GetString(), + static_cast<MediaStream*>(stream)->Descriptor()); } void MediaStreamRegistry::UnregisterURL(const KURL& url) { DCHECK(IsMainThread()); - stream_descriptors_.erase(url.GetString()); + stream_descriptors_->erase(url.GetString()); } bool MediaStreamRegistry::Contains(const String& url) { DCHECK(IsMainThread()); - return stream_descriptors_.Contains(url); + return stream_descriptors_->Contains(url); } MediaStreamDescriptor* MediaStreamRegistry::LookupMediaStreamDescriptor( const String& url) { DCHECK(IsMainThread()); - return stream_descriptors_.at(url); + return stream_descriptors_->at(url); } -MediaStreamRegistry::MediaStreamRegistry() { +MediaStreamRegistry::MediaStreamRegistry() + : stream_descriptors_( + new HeapHashMap<String, Member<MediaStreamDescriptor>>) { HTMLMediaElement::SetMediaStreamRegistry(this); }
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_registry.h b/third_party/blink/renderer/modules/mediastream/media_stream_registry.h index 367ad4f0..8f34641 100644 --- a/third_party/blink/renderer/modules/mediastream/media_stream_registry.h +++ b/third_party/blink/renderer/modules/mediastream/media_stream_registry.h
@@ -51,7 +51,7 @@ private: MediaStreamRegistry(); - PersistentHeapHashMap<String, Member<MediaStreamDescriptor>> + Persistent<HeapHashMap<String, Member<MediaStreamDescriptor>>> stream_descriptors_; };
diff --git a/third_party/blink/renderer/modules/storage/cached_storage_area.cc b/third_party/blink/renderer/modules/storage/cached_storage_area.cc index 0cf5180..745a744 100644 --- a/third_party/blink/renderer/modules/storage/cached_storage_area.cc +++ b/third_party/blink/renderer/modules/storage/cached_storage_area.cc
@@ -96,7 +96,7 @@ bool CachedStorageArea::SetItem(const String& key, const String& value, Source* source) { - DCHECK(areas_.Contains(source)); + DCHECK(areas_->Contains(source)); // A quick check to reject obviously overbudget items to avoid priming the // cache. @@ -123,7 +123,7 @@ optional_old_value = StringToUint8Vector(old_value, value_format); KURL page_url = source->GetPageUrl(); - String source_id = areas_.at(source); + String source_id = areas_->at(source); blink::WebScopedVirtualTimePauser virtual_time_pauser = source->CreateWebScopedVirtualTimePauser( @@ -137,7 +137,7 @@ weak_factory_.GetWeakPtr(), key, std::move(virtual_time_pauser))); if (IsSessionStorage() && old_value != value) { - for (const auto& area : areas_) { + for (const auto& area : *areas_) { if (area.key != source) area.key->EnqueueStorageEvent(key, old_value, value, page_url); } @@ -146,7 +146,7 @@ } void CachedStorageArea::RemoveItem(const String& key, Source* source) { - DCHECK(areas_.Contains(source)); + DCHECK(areas_->Contains(source)); EnsureLoaded(); String old_value; @@ -167,7 +167,7 @@ optional_old_value = StringToUint8Vector(old_value, value_format); KURL page_url = source->GetPageUrl(); - String source_id = areas_.at(source); + String source_id = areas_->at(source); blink::WebScopedVirtualTimePauser virtual_time_pauser = source->CreateWebScopedVirtualTimePauser( @@ -180,7 +180,7 @@ weak_factory_.GetWeakPtr(), key, std::move(virtual_time_pauser))); if (IsSessionStorage()) { - for (const auto& area : areas_) { + for (const auto& area : *areas_) { if (area.key != source) area.key->EnqueueStorageEvent(key, old_value, String(), page_url); } @@ -188,7 +188,7 @@ } void CachedStorageArea::Clear(Source* source) { - DCHECK(areas_.Contains(source)); + DCHECK(areas_->Contains(source)); bool already_empty = false; if (IsSessionStorage()) { @@ -202,7 +202,7 @@ ignore_all_mutations_ = true; KURL page_url = source->GetPageUrl(); - String source_id = areas_.at(source); + String source_id = areas_->at(source); blink::WebScopedVirtualTimePauser virtual_time_pauser = source->CreateWebScopedVirtualTimePauser( @@ -214,7 +214,7 @@ WTF::Bind(&CachedStorageArea::OnClearComplete, weak_factory_.GetWeakPtr(), std::move(virtual_time_pauser))); if (IsSessionStorage() && !already_empty) { - for (const auto& area : areas_) { + for (const auto& area : *areas_) { if (area.key != source) area.key->EnqueueStorageEvent(String(), String(), String(), page_url); } @@ -223,7 +223,7 @@ String CachedStorageArea::RegisterSource(Source* source) { String id = String::Number(base::RandUint64()); - areas_.insert(source, id); + areas_->insert(source, id); return id; } @@ -235,6 +235,7 @@ mojo_area_(area.get()), mojo_area_ptr_(std::move(area)), binding_(this), + areas_(new HeapHashMap<WeakMember<Source>, String>), weak_factory_(this) { mojom::blink::StorageAreaObserverAssociatedPtrInfo ptr_info; binding_.Bind(mojo::MakeRequest(&ptr_info), std::move(ipc_runner)); @@ -249,6 +250,7 @@ mojo_area_(area.get()), mojo_area_associated_ptr_(std::move(area)), binding_(this), + areas_(new HeapHashMap<WeakMember<Source>, String>), weak_factory_(this) { mojom::blink::StorageAreaObserverAssociatedPtrInfo ptr_info; binding_.Bind(mojo::MakeRequest(&ptr_info), std::move(ipc_runner)); @@ -287,7 +289,7 @@ Uint8VectorToString(key, FormatOption::kLocalStorageDetectFormat); bool from_local_area = false; - for (const auto& area : areas_) { + for (const auto& area : *areas_) { if (area.value == storage_area_id) { from_local_area = true; } else { @@ -316,7 +318,7 @@ UnpackSource(source, &page_url, &storage_area_id); bool from_local_area = false; - for (const auto& area : areas_) { + for (const auto& area : *areas_) { if (area.value == storage_area_id) { from_local_area = true; } else { @@ -361,7 +363,7 @@ Uint8VectorToString(new_value, FormatOption::kLocalStorageDetectFormat); bool from_local_area = false; - for (const auto& area : areas_) { + for (const auto& area : *areas_) { if (area.value == storage_area_id) { from_local_area = true; } else {
diff --git a/third_party/blink/renderer/modules/storage/cached_storage_area.h b/third_party/blink/renderer/modules/storage/cached_storage_area.h index 006552e..4c8d346 100644 --- a/third_party/blink/renderer/modules/storage/cached_storage_area.h +++ b/third_party/blink/renderer/modules/storage/cached_storage_area.h
@@ -158,7 +158,7 @@ mojo_area_associated_ptr_; mojo::AssociatedBinding<mojom::blink::StorageAreaObserver> binding_; - PersistentHeapHashMap<WeakMember<Source>, String> areas_; + Persistent<HeapHashMap<WeakMember<Source>, String>> areas_; base::WeakPtrFactory<CachedStorageArea> weak_factory_;
diff --git a/third_party/blink/renderer/modules/webaudio/audio_context_autoplay_test.cc b/third_party/blink/renderer/modules/webaudio/audio_context_autoplay_test.cc index 93af831..c57484b 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_context_autoplay_test.cc +++ b/third_party/blink/renderer/modules/webaudio/audio_context_autoplay_test.cc
@@ -84,11 +84,6 @@ AudioHardwareSampleRate(), AudioHardwareBufferSize()); } - std::unique_ptr<WebThread> CreateThread( - const WebThreadCreationParams& params) override { - return old_platform_->CreateThread(params); - } - double AudioHardwareSampleRate() override { return 44100; } size_t AudioHardwareBufferSize() override { return 128; } };
diff --git a/third_party/blink/renderer/modules/webaudio/audio_context_test.cc b/third_party/blink/renderer/modules/webaudio/audio_context_test.cc index 6f994307..b0f898a 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_context_test.cc +++ b/third_party/blink/renderer/modules/webaudio/audio_context_test.cc
@@ -72,11 +72,6 @@ AudioHardwareSampleRate(), buffer_size); } - std::unique_ptr<WebThread> CreateThread( - const WebThreadCreationParams& params) override { - return old_platform_->CreateThread(params); - } - double AudioHardwareSampleRate() override { return 44100; } size_t AudioHardwareBufferSize() override { return 128; } };
diff --git a/third_party/blink/renderer/modules/webdatabase/database_manager.cc b/third_party/blink/renderer/modules/webdatabase/database_manager.cc index b0e4bc7..919a6e19 100644 --- a/third_party/blink/renderer/modules/webdatabase/database_manager.cc +++ b/third_party/blink/renderer/modules/webdatabase/database_manager.cc
@@ -49,7 +49,7 @@ return *g_database_manager; } -DatabaseManager::DatabaseManager() = default; +DatabaseManager::DatabaseManager() : context_map_(new ContextMap) {} DatabaseManager::~DatabaseManager() = default; @@ -61,7 +61,7 @@ DCHECK_LE(database_context_registered_count_, database_context_instance_count_); #endif - return context_map_.at(context); + return context_map_->at(context); } DatabaseContext* DatabaseManager::DatabaseContextFor( @@ -74,7 +74,7 @@ void DatabaseManager::RegisterDatabaseContext( DatabaseContext* database_context) { ExecutionContext* context = database_context->GetExecutionContext(); - context_map_.Set(context, database_context); + context_map_->Set(context, database_context); #if DCHECK_IS_ON() database_context_registered_count_++; #endif @@ -83,11 +83,11 @@ void DatabaseManager::UnregisterDatabaseContext( DatabaseContext* database_context) { ExecutionContext* context = database_context->GetExecutionContext(); - DCHECK(context_map_.at(context)); + DCHECK(context_map_->at(context)); #if DCHECK_IS_ON() database_context_registered_count_--; #endif - context_map_.erase(context); + context_map_->erase(context); } #if DCHECK_IS_ON()
diff --git a/third_party/blink/renderer/modules/webdatabase/database_manager.h b/third_party/blink/renderer/modules/webdatabase/database_manager.h index 1bf4d650..3b2a790 100644 --- a/third_party/blink/renderer/modules/webdatabase/database_manager.h +++ b/third_party/blink/renderer/modules/webdatabase/database_manager.h
@@ -102,13 +102,12 @@ static void LogErrorMessage(ExecutionContext*, const String& message); - // m_contextMap can have two or more entries even though we don't support + // context_map_ can have two or more entries even though we don't support // Web SQL on workers because single Blink process can have multiple main // contexts. - typedef PersistentHeapHashMap<Member<ExecutionContext>, - Member<DatabaseContext>> + typedef HeapHashMap<Member<ExecutionContext>, Member<DatabaseContext>> ContextMap; - ContextMap context_map_; + Persistent<ContextMap> context_map_; #if DCHECK_IS_ON() int database_context_registered_count_ = 0; int database_context_instance_count_ = 0;
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn index 8b05ed3..48e4fe1c 100644 --- a/third_party/blink/renderer/platform/BUILD.gn +++ b/third_party/blink/renderer/platform/BUILD.gn
@@ -412,6 +412,8 @@ "bindings/callback_function_base.h", "bindings/callback_interface_base.cc", "bindings/callback_interface_base.h", + "bindings/callback_method_retriever.cc", + "bindings/callback_method_retriever.h", "bindings/custom_wrappable.h", "bindings/dom_data_store.h", "bindings/dom_wrapper_map.h", @@ -1355,6 +1357,8 @@ "transforms/transformation_matrix.h", "transforms/translate_transform_operation.cc", "transforms/translate_transform_operation.h", + "ukm_time_aggregator.cc", + "ukm_time_aggregator.h", "uuid.cc", "uuid.h", "waitable_event.cc", @@ -1793,6 +1797,7 @@ "transforms/rotation_test.cc", "transforms/transform_operations_test.cc", "transforms/transformation_matrix_test.cc", + "ukm_time_aggregator_test.cc", "uuid_test.cc", "web_icon_sizes_parser_test.cc", "web_screen_info_test.cc",
diff --git a/third_party/blink/renderer/platform/bindings/callback_method_retriever.cc b/third_party/blink/renderer/platform/bindings/callback_method_retriever.cc new file mode 100644 index 0000000..2394eec --- /dev/null +++ b/third_party/blink/renderer/platform/bindings/callback_method_retriever.cc
@@ -0,0 +1,64 @@ +// 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/renderer/platform/bindings/callback_method_retriever.h" + +#include "third_party/blink/renderer/platform/bindings/callback_function_base.h" +#include "third_party/blink/renderer/platform/bindings/exception_state.h" +#include "third_party/blink/renderer/platform/bindings/v8_binding.h" + +namespace blink { + +CallbackMethodRetriever::CallbackMethodRetriever( + CallbackFunctionBase* constructor) + : constructor_(constructor), + isolate_(constructor_->GetIsolate()), + current_context_(isolate_->GetCurrentContext()) { + DCHECK(constructor_->IsConstructor()); +} + +void CallbackMethodRetriever::GetPrototypeObject( + ExceptionState& exception_state) { + // https://html.spec.whatwg.org/C/custom-elements.html#element-definition + // step 10.1. Let prototype be Get(constructor, "prototype"). Rethrow any + // exceptions. + v8::TryCatch try_catch(isolate_); + v8::Local<v8::Value> prototype; + if (!constructor_->CallbackObject() + ->Get(current_context_, V8AtomicString(isolate_, "prototype")) + .ToLocal(&prototype)) { + exception_state.RethrowV8Exception(try_catch.Exception()); + return; + } + // step 10.2. If Type(prototype) is not Object, then throw a TypeError + // exception. + if (!prototype->IsObject()) { + exception_state.ThrowTypeError("constructor prototype is not an object"); + return; + } + prototype_object_ = prototype.As<v8::Object>(); +} + +v8::Local<v8::Value> CallbackMethodRetriever::GetFunctionOrUndefined( + v8::Local<v8::Object> object, + const StringView& property, + ExceptionState& exception_state) { + DCHECK(prototype_object_->IsObject()); + + v8::TryCatch try_catch(isolate_); + v8::Local<v8::Value> value; + if (!object->Get(current_context_, V8AtomicString(isolate_, property)) + .ToLocal(&value)) { + exception_state.RethrowV8Exception(try_catch.Exception()); + return v8::Local<v8::Function>(); + } + if (!value->IsUndefined() && !value->IsFunction()) { + exception_state.ThrowTypeError( + String::Format("\"%s\" is not a function", property.Characters8())); + return v8::Local<v8::Function>(); + } + return value; +} + +} // namespace blink
diff --git a/third_party/blink/renderer/platform/bindings/callback_method_retriever.h b/third_party/blink/renderer/platform/bindings/callback_method_retriever.h new file mode 100644 index 0000000..1207dbe81 --- /dev/null +++ b/third_party/blink/renderer/platform/bindings/callback_method_retriever.h
@@ -0,0 +1,67 @@ +// 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 THIRD_PARTY_BLINK_RENDERER_PLATFORM_BINDINGS_CALLBACK_METHOD_RETRIEVER_H_ +#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_BINDINGS_CALLBACK_METHOD_RETRIEVER_H_ + +#include "third_party/blink/renderer/platform/bindings/callback_function_base.h" +#include "third_party/blink/renderer/platform/heap/handle.h" +#include "v8/include/v8.h" + +namespace blink { + +class CallbackFunctionBase; +class ExceptionState; + +// Helper class to run step 10 of custom element definition, which part of the +// algorithm is expected to be defined in Web IDL so that other standards can +// apply the same algorithm. +// +// https://html.spec.whatwg.org/C/custom-elements.html#element-definition +// step 10. Run the following substeps while catching any exceptions: ... +class PLATFORM_EXPORT CallbackMethodRetriever { + STACK_ALLOCATED(); + + public: + explicit CallbackMethodRetriever(CallbackFunctionBase* constructor); + + // Get the prototype object from the callback function. Must be invoked prior + // to GetMethod or GetStaticMethod. + void GetPrototypeObject(ExceptionState&); + + // Returns a function extracted from the prototype chain, or undefined. + // Throws if the property is neither of function nor undefined. + v8::Local<v8::Value> GetMethodOrUndefined(const StringView& method_name, + ExceptionState& exception_state) { + return GetFunctionOrUndefined(prototype_object_, method_name, + exception_state); + } + + // Returns a function extracted from the callback function, or undefined. + // Throws if the property is neither of function nor undefined. + v8::Local<v8::Value> GetStaticMethodOrUndefined( + const StringView& method_name, + ExceptionState& exception_state) { + return GetFunctionOrUndefined(constructor_->CallbackObject(), method_name, + exception_state); + } + + private: + // Gets |property| from |object|. Throws an exception if the property is + // neither of function nor undefined. + v8::Local<v8::Value> GetFunctionOrUndefined(v8::Local<v8::Object> object, + const StringView& property, + ExceptionState&); + + Member<CallbackFunctionBase> constructor_; + v8::Isolate* isolate_; + v8::Local<v8::Context> current_context_; + v8::Local<v8::Object> prototype_object_; + + DISALLOW_COPY_AND_ASSIGN(CallbackMethodRetriever); +}; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_BINDINGS_CALLBACK_METHOD_RETRIEVER_H_
diff --git a/third_party/blink/renderer/platform/exported/platform.cc b/third_party/blink/renderer/platform/exported/platform.cc index 4aa9849..8105683 100644 --- a/third_party/blink/renderer/platform/exported/platform.cc +++ b/third_party/blink/renderer/platform/exported/platform.cc
@@ -33,12 +33,14 @@ #include <memory> #include "base/single_thread_task_runner.h" +#include "base/synchronization/waitable_event.h" #include "base/threading/thread_task_runner_handle.h" #include "base/trace_event/memory_dump_manager.h" #include "services/service_manager/public/cpp/connector.h" #include "services/service_manager/public/cpp/interface_provider.h" #include "third_party/blink/public/platform/interface_provider.h" #include "third_party/blink/public/platform/modules/webmidi/web_midi_accessor.h" +#include "third_party/blink/public/platform/scheduler/child/webthread_base.h" #include "third_party/blink/public/platform/scheduler/web_thread_scheduler.h" #include "third_party/blink/public/platform/web_canvas_capture_handler.h" #include "third_party/blink/public/platform/web_graphics_context_3d_provider.h" @@ -51,6 +53,7 @@ #include "third_party/blink/public/platform/web_storage_namespace.h" #include "third_party/blink/public/platform/web_thread.h" #include "third_party/blink/public/platform/websocket_handshake_throttle.h" +#include "third_party/blink/renderer/platform/cross_thread_functional.h" #include "third_party/blink/renderer/platform/font_family_names.h" #include "third_party/blink/renderer/platform/fonts/font_cache_memory_dump_provider.h" #include "third_party/blink/renderer/platform/heap/blink_gc_memory_dump_provider.h" @@ -170,6 +173,8 @@ g_platform = platform; g_platform->owned_main_thread_ = main_thread_scheduler->CreateMainThread(); g_platform->main_thread_ = g_platform->owned_main_thread_.get(); + DCHECK(!g_platform->current_thread_slot_.Get()); + g_platform->current_thread_slot_.Set(g_platform->main_thread_); InitializeCommon(platform); } @@ -179,6 +184,8 @@ g_platform = platform; g_platform->owned_main_thread_ = std::make_unique<SimpleMainThread>(); g_platform->main_thread_ = g_platform->owned_main_thread_.get(); + DCHECK(!g_platform->current_thread_slot_.Get()); + g_platform->current_thread_slot_.Set(g_platform->main_thread_); InitializeCommon(platform); } @@ -240,6 +247,12 @@ platform->main_thread_ = platform->owned_main_thread_.get(); } + // Set only the main thread to TLS for the new platform. This is OK for the + // testing purposes. The TLS slot may already be set when + // ScopedTestingPlatformSupport tries to revert to the old platform. + if (!platform->current_thread_slot_.Get()) + platform->current_thread_slot_.Set(platform->main_thread_); + g_platform = platform; } @@ -266,9 +279,7 @@ } WebThread* Platform::CurrentThread() { - DCHECK(main_thread_); - DCHECK(WTF::IsMainThread()); - return main_thread_; + return static_cast<WebThread*>(current_thread_slot_.Get()); } service_manager::Connector* Platform::GetConnector() { @@ -296,11 +307,43 @@ std::unique_ptr<WebThread> Platform::CreateThread( const WebThreadCreationParams& params) { - return nullptr; + std::unique_ptr<scheduler::WebThreadBase> thread = + scheduler::WebThreadBase::CreateWorkerThread(params); + thread->Init(); + WaitUntilWebThreadTLSUpdate(thread.get()); + return std::move(thread); } std::unique_ptr<WebThread> Platform::CreateWebAudioThread() { - return nullptr; + WebThreadCreationParams params(WebThreadType::kWebAudioThread); + // WebAudio uses a thread with |DISPLAY| priority to avoid glitch when the + // system is under the high pressure. Note that the main browser thread also + // runs with same priority. (see: crbug.com/734539) + params.thread_options.priority = base::ThreadPriority::DISPLAY; + return CreateThread(params); +} + +void Platform::WaitUntilWebThreadTLSUpdate(WebThread* thread) { + base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); + // This cross-thread posting is guaranteed to be safe. + PostCrossThreadTask(*thread->GetTaskRunner(), FROM_HERE, + CrossThreadBind(&Platform::UpdateWebThreadTLS, + WTF::CrossThreadUnretained(this), + WTF::CrossThreadUnretained(thread), + WTF::CrossThreadUnretained(&event))); + event.Wait(); +} + +void Platform::UpdateWebThreadTLS(WebThread* thread, + base::WaitableEvent* event) { + DCHECK(!current_thread_slot_.Get()); + current_thread_slot_.Set(thread); + event->Signal(); +} + +void Platform::RegisterExtraThreadToTLS(WebThread* thread) { + WaitUntilWebThreadTLSUpdate(thread); } std::unique_ptr<WebGraphicsContext3DProvider>
diff --git a/third_party/blink/renderer/platform/heap/heap_allocator.h b/third_party/blink/renderer/platform/heap/heap_allocator.h index 7b5bbc05..d66766a 100644 --- a/third_party/blink/renderer/platform/heap/heap_allocator.h +++ b/third_party/blink/renderer/platform/heap/heap_allocator.h
@@ -141,15 +141,9 @@ size, IsEagerlyFinalizedType<Metadata>::value)); } -#if defined(OS_WIN) && defined(COMPILER_MSVC) - // MSVC eagerly instantiates the unused 'operator delete', - // provide a version that asserts and fails at run-time if - // used. - // Elsewhere we expect compilation to fail if 'delete' is - // attempted used and instantiated with a HeapAllocator-based - // object, as HeapAllocator::free is not provided. + // Compilers sometimes eagerly instantiates the unused 'operator delete', so + // we provide a version that asserts and fails at run-time if used. static void Free(void*) { NOTREACHED(); } -#endif template <typename T> static void* NewArray(size_t bytes) {
diff --git a/third_party/blink/renderer/platform/heap/heap_test.cc b/third_party/blink/renderer/platform/heap/heap_test.cc index ae8aafd7..d5120f3 100644 --- a/third_party/blink/renderer/platform/heap/heap_test.cc +++ b/third_party/blink/renderer/platform/heap/heap_test.cc
@@ -4092,79 +4092,6 @@ #endif } -TEST(HeapTest, PersistentHeapCollectionTypes) { - IntWrapper::destructor_calls_ = 0; - - typedef PersistentHeapHashSet<Member<IntWrapper>> PSet; - typedef PersistentHeapListHashSet<Member<IntWrapper>> PListSet; - typedef PersistentHeapLinkedHashSet<Member<IntWrapper>> PLinkedSet; - typedef PersistentHeapHashMap<Member<IntWrapper>, Member<IntWrapper>> PMap; - typedef PersistentHeapHashMap<WeakMember<IntWrapper>, Member<IntWrapper>> - WeakPMap; - typedef PersistentHeapDeque<Member<IntWrapper>> PDeque; - - ClearOutOldGarbage(); - { - PDeque p_deque; - PSet p_set; - PListSet p_list_set; - PLinkedSet p_linked_set; - PMap p_map; - WeakPMap wp_map; - - IntWrapper* two(IntWrapper::Create(2)); - IntWrapper* four(IntWrapper::Create(4)); - IntWrapper* five(IntWrapper::Create(5)); - IntWrapper* six(IntWrapper::Create(6)); - IntWrapper* seven(IntWrapper::Create(7)); - IntWrapper* eight(IntWrapper::Create(8)); - IntWrapper* nine(IntWrapper::Create(9)); - Persistent<IntWrapper> ten(IntWrapper::Create(10)); - IntWrapper* eleven(IntWrapper::Create(11)); - - p_deque.push_back(seven); - p_deque.push_back(two); - - p_set.insert(four); - p_list_set.insert(eight); - p_linked_set.insert(nine); - p_map.insert(five, six); - wp_map.insert(ten, eleven); - - PreciselyCollectGarbage(); - EXPECT_EQ(0, IntWrapper::destructor_calls_); - - EXPECT_EQ(2u, p_deque.size()); - EXPECT_EQ(seven, p_deque.front()); - EXPECT_EQ(seven, p_deque.TakeFirst()); - EXPECT_EQ(two, p_deque.front()); - - EXPECT_EQ(1u, p_deque.size()); - - EXPECT_EQ(1u, p_set.size()); - EXPECT_TRUE(p_set.Contains(four)); - - EXPECT_EQ(1u, p_list_set.size()); - EXPECT_TRUE(p_list_set.Contains(eight)); - - EXPECT_EQ(1u, p_linked_set.size()); - EXPECT_TRUE(p_linked_set.Contains(nine)); - - EXPECT_EQ(1u, p_map.size()); - EXPECT_EQ(six, p_map.at(five)); - - EXPECT_EQ(1u, wp_map.size()); - EXPECT_EQ(eleven, wp_map.at(ten)); - ten.Clear(); - PreciselyCollectGarbage(); - EXPECT_EQ(0u, wp_map.size()); - } - - // Collect previous roots. - PreciselyCollectGarbage(); - EXPECT_EQ(9, IntWrapper::destructor_calls_); -} - TEST(HeapTest, CollectionNesting) { ClearOutOldGarbage(); int* key = &IntWrapper::destructor_calls_; @@ -4225,10 +4152,11 @@ PreciselyCollectGarbage(); EXPECT_EQ(2, UseMixin::trace_count_); - PersistentHeapHashSet<WeakMember<Mixin>> weak_map; - weak_map.insert(UseMixin::Create()); + Persistent<HeapHashSet<WeakMember<Mixin>>> weak_map = + new HeapHashSet<WeakMember<Mixin>>; + weak_map->insert(UseMixin::Create()); PreciselyCollectGarbage(); - EXPECT_EQ(0u, weak_map.size()); + EXPECT_EQ(0u, weak_map->size()); } TEST(HeapTest, CollectionNesting2) { @@ -4314,20 +4242,23 @@ ClearOutOldGarbage(); SimpleFinalizedObject::destructor_calls_ = 0; { - PersistentHeapDeque<VectorObject, 2> inline_deque; - PersistentHeapDeque<VectorObject> outline_deque; + Persistent<HeapDeque<VectorObject, 2>> inline_deque = + new HeapDeque<VectorObject, 2>; + Persistent<HeapDeque<VectorObject>> outline_deque = + new HeapDeque<VectorObject>; VectorObject i1, i2; - inline_deque.push_back(i1); - inline_deque.push_back(i2); + inline_deque->push_back(i1); + inline_deque->push_back(i2); VectorObject o1, o2; - outline_deque.push_back(o1); - outline_deque.push_back(o2); + outline_deque->push_back(o1); + outline_deque->push_back(o2); - PersistentHeapDeque<VectorObjectInheritedTrace> deque_inherited_trace; + Persistent<HeapDeque<VectorObjectInheritedTrace>> deque_inherited_trace = + new HeapDeque<VectorObjectInheritedTrace>; VectorObjectInheritedTrace it1, it2; - deque_inherited_trace.push_back(it1); - deque_inherited_trace.push_back(it2); + deque_inherited_trace->push_back(it1); + deque_inherited_trace->push_back(it2); PreciselyCollectGarbage(); EXPECT_EQ(0, SimpleFinalizedObject::destructor_calls_);
diff --git a/third_party/blink/renderer/platform/heap/incremental_marking_test.cc b/third_party/blink/renderer/platform/heap/incremental_marking_test.cc index 6686d7c..f9987a3d 100644 --- a/third_party/blink/renderer/platform/heap/incremental_marking_test.cc +++ b/third_party/blink/renderer/platform/heap/incremental_marking_test.cc
@@ -1757,46 +1757,6 @@ driver.FinishGC(); } -TEST(IncrementalMarkingTest, SlotDestruction) { - IncrementalMarkingTestDriver driver(ThreadState::Current()); - HeapCompact::ScheduleCompactionGCForTesting(true); - Vector<MovableReference*> ref(6); - - { - Object* obj = Object::Create(); - PersistentHeapHashSet<Member<Object>> p_hashset; - PersistentHeapHashMap<Member<Object>, Member<Object>> p_hashmap; - PersistentHeapLinkedHashSet<Member<Object>> p_linkedhashset; - PersistentHeapListHashSet<Member<Object>> p_listhashset; - PersistentHeapHashCountedSet<Member<Object>> p_hashcountedset; - PersistentHeapDeque<Member<Object>> p_deque; - - p_hashset.insert(obj); - p_hashmap.insert(obj, obj); - p_linkedhashset.insert(obj); - p_listhashset.insert(obj); - p_hashcountedset.insert(obj); - p_deque.push_back(obj); - - ref[0] = reinterpret_cast<MovableReference*>(&p_hashset); - ref[1] = reinterpret_cast<MovableReference*>(&p_hashmap); - ref[2] = reinterpret_cast<MovableReference*>(&p_linkedhashset); - ref[3] = reinterpret_cast<MovableReference*>(&p_listhashset); - ref[4] = reinterpret_cast<MovableReference*>(&p_hashcountedset); - ref[5] = reinterpret_cast<MovableReference*>(&p_deque); - - driver.Start(); - driver.FinishSteps(); - - for (size_t i = 0; i < ref.size(); ++i) { - EXPECT_TRUE(driver.GetTracedSlot().Contains(ref[i])); - } - } - for (size_t i = 0; i < ref.size(); ++i) { - EXPECT_FALSE(driver.GetTracedSlot().Contains(ref[i])); - } -} - } // namespace incremental_marking_test } // namespace blink
diff --git a/third_party/blink/renderer/platform/heap/persistent.h b/third_party/blink/renderer/platform/heap/persistent.h index ca9b85f..e8bf8c4a 100644 --- a/third_party/blink/renderer/platform/heap/persistent.h +++ b/third_party/blink/renderer/platform/heap/persistent.h
@@ -431,11 +431,11 @@ // // We have to construct and destruct WeakPersistent in the same thread. // -// Note that collections of WeakPersistents are not supported. Use a persistent -// collection of WeakMembers instead. +// Note that collections of WeakPersistents are not supported. Use a collection +// of WeakMembers instead. // // HashSet<WeakPersistent<T>> m_set; // wrong -// PersistentHeapHashSet<WeakMember<T>> m_set; // correct +// Persistent<HeapHashSet<WeakMember<T>>> m_set; // correct template <typename T> class WeakPersistent : public PersistentBase<T, @@ -601,158 +601,6 @@ } }; -template <typename Collection> -class PersistentHeapCollectionBase : public Collection { - // We overload the various new and delete operators with using the WTF - // PartitionAllocator to ensure persistent heap collections are always - // allocated off-heap. This allows persistent collections to be used in - // DEFINE_STATIC_LOCAL et. al. - USE_ALLOCATOR(PersistentHeapCollectionBase, WTF::PartitionAllocator); - IS_PERSISTENT_REFERENCE_TYPE(); - - public: - PersistentHeapCollectionBase() { Initialize(); } - - PersistentHeapCollectionBase(const PersistentHeapCollectionBase& other) - : Collection(other) { - Initialize(); - } - - template <typename OtherCollection> - PersistentHeapCollectionBase(const OtherCollection& other) - : Collection(other) { - Initialize(); - } - - ~PersistentHeapCollectionBase() { Uninitialize(); } - - // Override so we don't copy persistent_node_. - PersistentHeapCollectionBase& operator=( - const PersistentHeapCollectionBase& other) { - Collection::operator=(other); - return *this; - } - - // See PersistentBase::registerAsStaticReference() comment. - PersistentHeapCollectionBase* RegisterAsStaticReference() { - if (persistent_node_) { - DCHECK(ThreadState::Current()); - ThreadState::Current()->RegisterStaticPersistentNode( - persistent_node_, - &PersistentHeapCollectionBase<Collection>::ClearPersistentNode); - LEAK_SANITIZER_IGNORE_OBJECT(this); - } - return this; - } - - private: - template <typename VisitorDispatcher> - void TracePersistent(VisitorDispatcher visitor) { - static_assert(sizeof(Collection), "Collection must be fully defined"); - visitor->Trace(*static_cast<Collection*>(this)); - } - - // Used when the registered PersistentNode of this object is - // released during ThreadState shutdown, clearing the association. - static void ClearPersistentNode(void* self) { - PersistentHeapCollectionBase<Collection>* collection = - (reinterpret_cast<PersistentHeapCollectionBase<Collection>*>(self)); - collection->Uninitialize(); - collection->clear(); - } - - NO_SANITIZE_ADDRESS - void Initialize() { - CHECK(IsMainThread()) << "Persistent heap collections are disabled on " - "non-main threads. Put the heap collection in a " - "Persistent instead."; - // FIXME: Derive affinity based on the collection. - ThreadState* state = ThreadState::Current(); - DCHECK(state->CheckThread()); - persistent_node_ = state->GetPersistentRegion()->AllocatePersistentNode( - this, - TraceMethodDelegate<PersistentHeapCollectionBase<Collection>, - &PersistentHeapCollectionBase< - Collection>::TracePersistent>::Trampoline); -#if DCHECK_IS_ON() - state_ = state; -#endif - } - - void Uninitialize() { - if (!persistent_node_) - return; - ThreadState* state = ThreadState::Current(); - DCHECK(state->CheckThread()); - // Persistent handle must be created and destructed in the same thread. -#if DCHECK_IS_ON() - DCHECK_EQ(state_, state); -#endif - HeapCompact* compactor = state->Heap().Compaction(); - if (compactor->IsCompacting()) { - compactor->RemoveSlot( - reinterpret_cast<MovableReference*>(this->GetBufferSlot())); - } - state->FreePersistentNode(state->GetPersistentRegion(), persistent_node_); - persistent_node_ = nullptr; - } - - PersistentNode* persistent_node_; -#if DCHECK_IS_ON() - ThreadState* state_; -#endif -}; - -template <typename KeyArg, - typename MappedArg, - typename HashArg = typename DefaultHash<KeyArg>::Hash, - typename KeyTraitsArg = HashTraits<KeyArg>, - typename MappedTraitsArg = HashTraits<MappedArg>> -class PersistentHeapHashMap - : public PersistentHeapCollectionBase<HeapHashMap<KeyArg, - MappedArg, - HashArg, - KeyTraitsArg, - MappedTraitsArg>> {}; - -template <typename ValueArg, - typename HashArg = typename DefaultHash<ValueArg>::Hash, - typename TraitsArg = HashTraits<ValueArg>> -class PersistentHeapHashSet : public PersistentHeapCollectionBase< - HeapHashSet<ValueArg, HashArg, TraitsArg>> {}; - -template <typename ValueArg, - typename HashArg = typename DefaultHash<ValueArg>::Hash, - typename TraitsArg = HashTraits<ValueArg>> -class PersistentHeapLinkedHashSet - : public PersistentHeapCollectionBase< - HeapLinkedHashSet<ValueArg, HashArg, TraitsArg>> {}; - -template <typename ValueArg, - wtf_size_t inlineCapacity = 0, - typename HashArg = typename DefaultHash<ValueArg>::Hash> -class PersistentHeapListHashSet - : public PersistentHeapCollectionBase< - HeapListHashSet<ValueArg, inlineCapacity, HashArg>> {}; - -template <typename ValueArg, - typename HashFunctions = typename DefaultHash<ValueArg>::Hash, - typename Traits = HashTraits<ValueArg>> -class PersistentHeapHashCountedSet - : public PersistentHeapCollectionBase< - HeapHashCountedSet<ValueArg, HashFunctions, Traits>> {}; - -template <typename T, wtf_size_t inlineCapacity = 0> -class PersistentHeapDeque - : public PersistentHeapCollectionBase<HeapDeque<T, inlineCapacity>> { - public: - PersistentHeapDeque() = default; - - template <wtf_size_t otherCapacity> - PersistentHeapDeque(const HeapDeque<T, otherCapacity>& other) - : PersistentHeapCollectionBase<HeapDeque<T, inlineCapacity>>(other) {} -}; - template <typename T> Persistent<T> WrapPersistent(T* value) { // There is no technical need to require a complete type here. However, types
diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc index c9a4049f..e310341e 100644 --- a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc +++ b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc
@@ -178,7 +178,8 @@ } static ResourceFetcher::ResourceFetcherSet& MainThreadFetchersSet() { - DEFINE_STATIC_LOCAL(ResourceFetcher::ResourceFetcherSet, fetchers, ()); + DEFINE_STATIC_LOCAL(ResourceFetcher::ResourceFetcherSet, fetchers, + (new ResourceFetcher::ResourceFetcherSet)); return fetchers; }
diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h index c1c3ea70..5fd0adc6 100644 --- a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h +++ b/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h
@@ -185,7 +185,7 @@ void SetStaleWhileRevalidateEnabled(bool enabled); - using ResourceFetcherSet = PersistentHeapHashSet<WeakMember<ResourceFetcher>>; + using ResourceFetcherSet = HeapHashSet<WeakMember<ResourceFetcher>>; static const ResourceFetcherSet& MainThreadFetchers(); private:
diff --git a/third_party/blink/renderer/platform/scheduler/main_thread/page_scheduler_impl.cc b/third_party/blink/renderer/platform/scheduler/main_thread/page_scheduler_impl.cc index 47c4dc9d..c713c6f9 100644 --- a/third_party/blink/renderer/platform/scheduler/main_thread/page_scheduler_impl.cc +++ b/third_party/blink/renderer/platform/scheduler/main_thread/page_scheduler_impl.cc
@@ -252,6 +252,7 @@ PageLifecycleState::kHiddenForegrounded); } } + Platform::Current()->SetMemoryPressureNotificationsSuppressed(frozen); } void PageSchedulerImpl::SetKeepActive(bool keep_active) {
diff --git a/third_party/blink/renderer/platform/testing/testing_platform_support.cc b/third_party/blink/renderer/platform/testing/testing_platform_support.cc index e7ed1644..bcab704 100644 --- a/third_party/blink/renderer/platform/testing/testing_platform_support.cc +++ b/third_party/blink/renderer/platform/testing/testing_platform_support.cc
@@ -108,10 +108,6 @@ return WebString::FromUTF8("en-US"); } -WebThread* TestingPlatformSupport::CurrentThread() { - return old_platform_ ? old_platform_->CurrentThread() : nullptr; -} - WebBlobRegistry* TestingPlatformSupport::GetBlobRegistry() { return old_platform_ ? old_platform_->GetBlobRegistry() : nullptr; }
diff --git a/third_party/blink/renderer/platform/testing/testing_platform_support.h b/third_party/blink/renderer/platform/testing/testing_platform_support.h index 0c3b42b..87cfa93 100644 --- a/third_party/blink/renderer/platform/testing/testing_platform_support.h +++ b/third_party/blink/renderer/platform/testing/testing_platform_support.h
@@ -48,7 +48,6 @@ } namespace blink { -class WebThread; // A base class to override Platform methods for testing. You can override the // behavior by subclassing TestingPlatformSupport or using @@ -61,7 +60,6 @@ // Platform: WebString DefaultLocale() override; - WebThread* CurrentThread() override; WebBlobRegistry* GetBlobRegistry() override; std::unique_ptr<WebIDBFactory> CreateIdbFactory() override; WebURLLoaderMockFactory* GetURLLoaderMockFactory() override;
diff --git a/third_party/blink/renderer/platform/testing/testing_platform_support_with_custom_scheduler.cc b/third_party/blink/renderer/platform/testing/testing_platform_support_with_custom_scheduler.cc index 79c3ff0..01af9a3 100644 --- a/third_party/blink/renderer/platform/testing/testing_platform_support_with_custom_scheduler.cc +++ b/third_party/blink/renderer/platform/testing/testing_platform_support_with_custom_scheduler.cc
@@ -29,16 +29,16 @@ } // namespace -TestingPlatformSupportWithCustomScheduler :: +TestingPlatformSupportWithCustomScheduler:: TestingPlatformSupportWithCustomScheduler(ThreadScheduler* scheduler) - : thread_(std::make_unique<ThreadWithCustomScheduler>(scheduler)) {} - -TestingPlatformSupportWithCustomScheduler :: - ~TestingPlatformSupportWithCustomScheduler() {} - -WebThread* TestingPlatformSupportWithCustomScheduler::CurrentThread() { - DCHECK(WTF::IsMainThread()); - return thread_.get(); + : thread_(std::make_unique<ThreadWithCustomScheduler>(scheduler)) { + // If main_thread_ is set, Platform::SetCurrentPlatformForTesting() properly + // sets up the platform so Platform::CurrentThread() would return the + // thread specified here. + main_thread_ = thread_.get(); } +TestingPlatformSupportWithCustomScheduler:: + ~TestingPlatformSupportWithCustomScheduler() {} + } // namespace blink
diff --git a/third_party/blink/renderer/platform/testing/testing_platform_support_with_custom_scheduler.h b/third_party/blink/renderer/platform/testing/testing_platform_support_with_custom_scheduler.h index 828a0af..d800c76 100644 --- a/third_party/blink/renderer/platform/testing/testing_platform_support_with_custom_scheduler.h +++ b/third_party/blink/renderer/platform/testing/testing_platform_support_with_custom_scheduler.h
@@ -26,8 +26,6 @@ ThreadScheduler* scheduler); ~TestingPlatformSupportWithCustomScheduler() override; - WebThread* CurrentThread() override; - private: std::unique_ptr<WebThread> thread_;
diff --git a/third_party/blink/renderer/platform/testing/testing_platform_support_with_mock_scheduler.cc b/third_party/blink/renderer/platform/testing/testing_platform_support_with_mock_scheduler.cc index 790a429..0fdccdce 100644 --- a/third_party/blink/renderer/platform/testing/testing_platform_support_with_mock_scheduler.cc +++ b/third_party/blink/renderer/platform/testing/testing_platform_support_with_mock_scheduler.cc
@@ -10,29 +10,10 @@ #include "third_party/blink/public/platform/scheduler/child/webthread_base.h" #include "third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.h" #include "third_party/blink/renderer/platform/waitable_event.h" -#include "third_party/blink/renderer/platform/wtf/thread_specific.h" #include "third_party/blink/renderer/platform/wtf/time.h" namespace blink { -namespace { - -struct ThreadLocalStorage { - WebThread* current_thread = nullptr; -}; - -ThreadLocalStorage* GetThreadLocalStorage() { - DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<ThreadLocalStorage>, tls, ()); - return tls; -} - -void PrepareCurrentThread(WaitableEvent* event, WebThread* thread) { - GetThreadLocalStorage()->current_thread = thread; - event->Signal(); -} - -} // namespace - TestingPlatformSupportWithMockScheduler:: TestingPlatformSupportWithMockScheduler() : test_task_runner_(base::MakeRefCounted<base::TestMockTimeTaskRunner>( @@ -47,6 +28,7 @@ scheduler_ = std::make_unique<scheduler::MainThreadSchedulerImpl>( std::move(sequence_manager), base::nullopt); thread_ = scheduler_->CreateMainThread(); + main_thread_ = thread_.get(); // Set the work batch size to one so TakePendingTasks behaves as expected. scheduler_->GetSchedulerHelperForTesting()->SetWorkBatchSizeForTesting(1); @@ -59,31 +41,6 @@ scheduler_->Shutdown(); } -std::unique_ptr<WebThread> -TestingPlatformSupportWithMockScheduler::CreateThread( - const WebThreadCreationParams& params) { - std::unique_ptr<scheduler::WebThreadBase> thread = - scheduler::WebThreadBase::CreateWorkerThread(params); - thread->Init(); - WaitableEvent event; - thread->GetTaskRunner()->PostTask( - FROM_HERE, base::BindOnce(PrepareCurrentThread, base::Unretained(&event), - base::Unretained(thread.get()))); - event.Wait(); - return std::move(thread); -} - -WebThread* TestingPlatformSupportWithMockScheduler::CurrentThread() { - DCHECK_EQ(thread_->IsCurrentThread(), IsMainThread()); - - if (thread_->IsCurrentThread()) { - return thread_.get(); - } - ThreadLocalStorage* storage = GetThreadLocalStorage(); - DCHECK(storage->current_thread); - return storage->current_thread; -} - void TestingPlatformSupportWithMockScheduler::RunSingleTask() { base::circular_deque<base::TestPendingTask> tasks = test_task_runner_->TakePendingTasks();
diff --git a/third_party/blink/renderer/platform/testing/testing_platform_support_with_mock_scheduler.h b/third_party/blink/renderer/platform/testing/testing_platform_support_with_mock_scheduler.h index 785f456..dd64425f 100644 --- a/third_party/blink/renderer/platform/testing/testing_platform_support_with_mock_scheduler.h +++ b/third_party/blink/renderer/platform/testing/testing_platform_support_with_mock_scheduler.h
@@ -35,11 +35,6 @@ TestingPlatformSupportWithMockScheduler(); ~TestingPlatformSupportWithMockScheduler() override; - // Platform: - std::unique_ptr<WebThread> CreateThread( - const WebThreadCreationParams&) override; - WebThread* CurrentThread() override; - // Runs a single task. void RunSingleTask();
diff --git a/tools/cygprofile/profile_android_startup.py b/tools/cygprofile/profile_android_startup.py index 49c97337..fc75e81 100755 --- a/tools/cygprofile/profile_android_startup.py +++ b/tools/cygprofile/profile_android_startup.py
@@ -440,7 +440,8 @@ """ print 'Pulling profile data...' self._SetUpHostFolders() - self._device.PullFile(self._DEVICE_PROFILE_DIR, self._host_profile_dir) + self._device.PullFile(self._DEVICE_PROFILE_DIR, self._host_profile_dir, + timeout=300) # Temporary workaround/investigation: if (for unknown reason) 'adb pull' of # the directory 'orderfile' '.../Release/profile_data' produces
diff --git a/tools/metrics/actions/actions.xml b/tools/metrics/actions/actions.xml index fdfd30f..54351111 100644 --- a/tools/metrics/actions/actions.xml +++ b/tools/metrics/actions/actions.xml
@@ -440,7 +440,7 @@ </action> <action name="AboutFlags_top-chrome-md@1"> - <obsolete>Deprecated in favor of Launch.FlagsAtStartup histogram.</obsolete> + <obsolete>Deprecated in favor of Launch.FlagsAtStartup histogram.</obsolete> <owner>tbuckley@chromium.org</owner> <owner>tdanderson@chromium.org</owner> <description> @@ -450,7 +450,7 @@ </action> <action name="AboutFlags_top-chrome-md@2"> - <obsolete>Deprecated in favor of Launch.FlagsAtStartup histogram.</obsolete> + <obsolete>Deprecated in favor of Launch.FlagsAtStartup histogram.</obsolete> <owner>tbuckley@chromium.org</owner> <owner>tdanderson@chromium.org</owner> <description> @@ -460,7 +460,7 @@ </action> <action name="AboutFlags_top-chrome-md@3"> - <obsolete>Deprecated in favor of Launch.FlagsAtStartup histogram.</obsolete> + <obsolete>Deprecated in favor of Launch.FlagsAtStartup histogram.</obsolete> <owner>tbuckley@chromium.org</owner> <owner>tdanderson@chromium.org</owner> <description> @@ -10478,8 +10478,8 @@ <owner>donnd@chromium.org</owner> <description> User chose to process text using one of the assist actions available in the - mobile action bar. These actions trigger an intent to interacte with - another activity, e.g. Translate. + mobile action bar. These actions trigger an intent to interacte with another + activity, e.g. Translate. </description> </action> @@ -10626,22 +10626,21 @@ <action name="MobileComeToForeground"> <owner>tedchoc@chromium.org</owner> <description> - Chrome has come to the foreground. Only emitted if the foreground content - is an Activity that views web content, e.g., not settings. This will be - emitted everytime the Activity goes from entirely hidden to at least - partially visible. Partially visible means that at least some portion of - the Activity is visible, but the Activity is not interactable, e.g. being - covered by the share dialog, javascript alert dialogs, the voice input - dialog, etc. + Chrome has come to the foreground. Only emitted if the foreground content is + an Activity that views web content, e.g., not settings. This will be emitted + everytime the Activity goes from entirely hidden to at least partially + visible. Partially visible means that at least some portion of the Activity + is visible, but the Activity is not interactable, e.g. being covered by the + share dialog, javascript alert dialogs, the voice input dialog, etc. Please note, this has the potential to be called many times for a given - session. For further details, see the Android activity concept of onPause + session. For further details, see the Android activity concept of onPause and onResume for a better understanding of what circumstances can trigger this. Session tracking is based on the same visibility concept, but a session can span multiple live Android Activities, while this metric will be logged when - each applicable Activity goes to the foreground (per above). Since session + each applicable Activity goes to the foreground (per above). Since session tracking uses onPause and onResume, this metric is also tied to that to ensure we capture the event. </description> @@ -10805,7 +10804,7 @@ <description> Records when the system started a VIEW intent on a navigation click. This happens when there is another application in the system that's not a browser - and that can handle this URL (e.g. Maps app for http://maps.google.com/ + and that can handle this URL (e.g. Maps app for http://maps.google.com/ url). </description> </action> @@ -10871,7 +10870,7 @@ <action name="MobileFreTOSLinkTapped"> <owner>justincohen@chromium.org</owner> <description> - User tapped on the TOS link on the first run welcome view. This metric is + User tapped on the TOS link on the first run welcome view. This metric is only recorded if and after the TOS are accepted. This metric is specific to iOS. </description> @@ -10880,22 +10879,22 @@ <action name="MobileGoToBackground"> <owner>tedchoc@chromium.org</owner> <description> - Chrome has gone to the background. Only emitted if the previously + Chrome has gone to the background. Only emitted if the previously foregrounded content was an Activity that views web content, e.g., not - settings. Chrome may be partially visible at this point, but is not - directly in the foreground/interactable. Partially visible means that at - least some portion of the Activity is visible, but the Activity is not - interactable, e.g. being covered by the share dialog, javascript alert - dialogs, the voice input dialog, etc. + settings. Chrome may be partially visible at this point, but is not directly + in the foreground/interactable. Partially visible means that at least some + portion of the Activity is visible, but the Activity is not interactable, + e.g. being covered by the share dialog, javascript alert dialogs, the voice + input dialog, etc. Please note, this has the potential to be called many times for a given - session. For further details, see the Android activity concept of onPause + session. For further details, see the Android activity concept of onPause and onResume for a better understanding of what circumstances can trigger this. Session tracking is based on the same visibility concept, but a session can span multiple live Android Activities, while this metric will be logged when - each applicable Activity goes to the background (per above). Since session + each applicable Activity goes to the background (per above). Since session tracking uses onPause and onResume, this metric is also tied to that to ensure we capture the event. </description> @@ -11066,9 +11065,9 @@ <action name="MobileMenuReload"> <owner>tedchoc@chromium.org</owner> <description> - User pressed the reload option in the app menu. This was added in M55. - Prior to M55, the menu reload counts were combined with the toolbar counts, - which were all reported as MobileToolbarReload. + User pressed the reload option in the app menu. This was added in M55. Prior + to M55, the menu reload counts were combined with the toolbar counts, which + were all reported as MobileToolbarReload. </description> </action> @@ -11380,13 +11379,13 @@ <action name="MobileOmniboxSearch"> <obsolete> - Removed Sep 2016 because the name kept misleading people. Replaced with + Removed Sep 2016 because the name kept misleading people. Replaced with MobileOmniboxUse, which has the same semantics. </obsolete> <owner>mpearson@chromium.org</owner> <owner>tedchoc@chromium.org</owner> <description> - User used the omnibox to go somewhere. The action doesn't have to lead to a + User used the omnibox to go somewhere. The action doesn't have to lead to a search page (except on iOS, where this is only recorded for search-type navigations). </description> @@ -11396,7 +11395,7 @@ <owner>mpearson@chromium.org</owner> <owner>tedchoc@chromium.org</owner> <description> - User used the omnibox to go somewhere. The action doesn't have to lead to a + User used the omnibox to go somewhere. The action doesn't have to lead to a search page. </description> </action> @@ -11540,9 +11539,9 @@ <action name="MobileReceivedExternalIntent"> <owner>tedchoc@chromium.org</owner> <description> - A VIEW intent was received by the tabbed mode activity. This will combine - intents sent by external application as well as Chrome itself. This does - not cover all intent types handled by Chrome. Use + A VIEW intent was received by the tabbed mode activity. This will combine + intents sent by external application as well as Chrome itself. This does not + cover all intent types handled by Chrome. Use MobileTabbedModeViewIntentFromApp and MobileTabbedModeViewIntentFromChrome for a complete picture. </description> @@ -11559,7 +11558,7 @@ <action name="MobileReceivedExternalIntent.Chrome"> <owner>tedchoc@chromium.org</owner> <description> - A VIEW intent was received by the tabbed mode activity from Chrome. This is + A VIEW intent was received by the tabbed mode activity from Chrome. This is only recorded for intent types that are also allowed from external apps. </description> </action> @@ -11735,7 +11734,7 @@ <action name="MobileStartup.MainIntentReceived"> <owner>tedchoc@chromium.org</owner> <description> - An ACTION_MAIN intent was received by Chrome. This is the best indicator we + An ACTION_MAIN intent was received by Chrome. This is the best indicator we have to signal the user tapped on the Chrome icon from the launcher. </description> </action> @@ -11927,8 +11926,8 @@ <action name="MobileToolbarReload"> <owner>tedchoc@chromium.org</owner> <description> - User pressed the reload icon in the toolbar. Pre-M55, MobileToolbarReload - accounted for all reload actions. M55+, this metric only refers to reloads + User pressed the reload icon in the toolbar. Pre-M55, MobileToolbarReload + accounted for all reload actions. M55+, this metric only refers to reloads that occurred from the toolbar. </description> </action> @@ -14793,11 +14792,11 @@ <owner>vasilii@chromium.org</owner> <description> The user submitted a password form, but the website appeared to reject the - credentials. This action reflects the password manager component's logic - for whether or not to offer to save a password. At the time of writing, - failure means that either the form submission was canceled with a failure - message, or the form submission succeeded, but the user was directed back to - a page that still contained a login form. + credentials. This action reflects the password manager component's logic for + whether or not to offer to save a password. At the time of writing, failure + means that either the form submission was canceled with a failure message, + or the form submission succeeded, but the user was directed back to a page + that still contained a login form. </description> </action> @@ -14815,8 +14814,8 @@ <owner>vasilii@chromium.org</owner> <description> The user submitted a password form and the website appeared to accept the - credentials. This action reflects the password manager component's logic - for whether or not to offer to save a password. + credentials. This action reflects the password manager component's logic for + whether or not to offer to save a password. </description> </action> @@ -19343,7 +19342,7 @@ <description> User hit the "X" button to close the tab. The return button is an explicit "close this tab and return to the previous app" button - that may appear to the left of the Omnibox. This is different from regular + that may appear to the left of the Omnibox. This is different from regular tab closing buttons because those doesn't send the user back to the previous app. </description>
diff --git a/tools/metrics/common/pretty_print_xml.py b/tools/metrics/common/pretty_print_xml.py index f883284c..712bbd9 100644 --- a/tools/metrics/common/pretty_print_xml.py +++ b/tools/metrics/common/pretty_print_xml.py
@@ -56,7 +56,9 @@ if paragraphs[-1] and not l.strip(): paragraphs.append([]) else: - paragraphs[-1].append(l) + # Replace runs of repeated whitespace with a single space. + transformed_line = ' '.join(l.split()) + paragraphs[-1].append(transformed_line) # Remove trailing empty paragraph if present. if paragraphs and not paragraphs[-1]: paragraphs = paragraphs[:-1]
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index f672dcec..7d871b2 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -7817,7 +7817,7 @@ <enum name="ContextMenuIOSCopyImage"> <summary> - Events of Copy Image from context menu under iOS. Enum0 is the entrance of + Events of Copy Image from context menu under iOS. Enum0 is the entrance of an image copy process; Enum1~3 are correlated and they are recorded in the callback of fetching image data; Enum4~5 are correlated and they are recorded in the callback of popping up waiting alert. There is no gurantee @@ -8785,7 +8785,7 @@ <enum name="CrashVisibility"> <summary> This enum describes the timing of a renderer crash in relation to whether a - sad frame was visible. Whether a subframe is "visible" is + sad frame was visible. Whether a subframe is "visible" is currently defined as 1) in visible, non-occluded WebContents and 2) with a non-empty viewport intersection rect. </summary> @@ -13925,7 +13925,7 @@ </int> <int value="15" label="Auto-enrollment not supported (unused)"> UNUSED: Auto-enrollment is not supported for the mode supplied by the - server. This presently means trying to auto-enroll in kiosk mode. + server. This presently means trying to auto-enroll in kiosk mode. </int> <int value="16" label="Install attributes timeout"> Lockbox initialization took too long to complete. @@ -14615,7 +14615,7 @@ <summary> Status codes produced by the policy loaders that pull policy settings from the platform-specific management infrastructure, such as Windows Group - Policy. Defined as PolicyLoadStatus in + Policy. Defined as PolicyLoadStatus in components/policy/core/common/policy_load_status.h. </summary> <int value="0" label="STARTED"> @@ -17360,8 +17360,8 @@ <enum name="ExtensionUnpackFailureReason"> <summary> - Reasons the sandboxed extension unpacker can fail. See enum FailureReason - in src/chrome/browser/extensions/sandboxed_extension_unpacker.h . + Reasons the sandboxed extension unpacker can fail. See enum FailureReason in + src/chrome/browser/extensions/sandboxed_extension_unpacker.h . </summary> <int value="0" label="COULD_NOT_GET_TEMP_DIRECTORY"/> <int value="1" label="COULD_NOT_CREATE_TEMP_DIRECTORY"/> @@ -21503,6 +21503,16 @@ label="Only permitted for framebusting, user gesture, not an ad frame"/> <int value="2" label="Allowed navigation, no user gesture, not an ad frame"/> <int value="3" label="Allowed navigation, user gesture, not an ad frame"/> +</enum> + +<enum name="FramebustPermissionsPlusAds"> + <int value="0" + label="Only permitted for framebusting, no user gesture, not an ad + frame"/> + <int value="1" + label="Only permitted for framebusting, user gesture, not an ad frame"/> + <int value="2" label="Allowed navigation, no user gesture, not an ad frame"/> + <int value="3" label="Allowed navigation, user gesture, not an ad frame"/> <int value="4" label="Only permitted for framebusting, no user gesture, ad frame"/> <int value="5" @@ -24411,15 +24421,15 @@ Failure from sql::Recovery::Recovered(). </int> <int value="9" label="RECOVERY_EVENT_INVARIANT_RANK"> - Rows were deleted because |url_rank| and |last_forced| didn't agree. Does + Rows were deleted because |url_rank| and |last_forced| didn't agree. Does not prevent recovery. </int> <int value="10" label="RECOVERY_EVENT_INVARIANT_REDIRECT"> - Rows were deleted because |redirects| did not contain |url|. Does not + Rows were deleted because |redirects| did not contain |url|. Does not prevent recovery. </int> <int value="11" label="RECOVERY_EVENT_INVARIANT_CONTIGUOUS"> - |url_rank| was renumbered due to missing rows. Does not prevent recovery. + |url_rank| was renumbered due to missing rows. Does not prevent recovery. </int> </enum> @@ -24812,7 +24822,7 @@ <enum name="HttpStreamFactoryJobState"> <summary> - State of HttpStreamFactoryJob. See net::HttpStreamFactoryImpl::Job::State + State of HttpStreamFactoryJob. See net::HttpStreamFactoryImpl::Job::State for more details </summary> <int value="0" label="START"/> @@ -28728,6 +28738,7 @@ <int value="-1535758690" label="AutoplayIgnoreWebAudio:disabled"/> <int value="-1532035450" label="DragTabsInTabletMode:disabled"/> <int value="-1532014193" label="disable-encryption-migration"/> + <int value="-1528455406" label="OmniboxPedalSuggestions:enabled"/> <int value="-1520855274" label="PWAFullCodeCache:disabled"/> <int value="-1517418368" label="AutofillUpstreamUpdatePromptExplanation:disabled"/> @@ -29835,6 +29846,7 @@ <int value="664591021" label="EnableContinueReading:enabled"/> <int value="665409384" label="AutofillToolkitViewsCreditCardDialogsMac:enabled"/> + <int value="673588373" label="OmniboxPedalSuggestions:disabled"/> <int value="679931272" label="DcheckIsFatal:enabled"/> <int value="680070635" label="enable-fullscreen-handwriting-virtual-keyboard:disabled"/> @@ -30475,6 +30487,7 @@ <int value="1915178511" label="disable-blink-features"/> <int value="1924192543" label="ProactiveTabFreezeAndDiscard:enabled"/> <int value="1925627218" label="FullscreenToolbarReveal:disabled"/> + <int value="1926524951" label="SystemWebApps:disabled"/> <int value="1927218315" label="ShelfNewUi:disabled"/> <int value="1927259098" label="TranslateLanguageByULP:enabled"/> <int value="1928407249" label="NewPhotoPicker:enabled"/> @@ -30593,6 +30606,7 @@ <int value="2137599770" label="enable-win32k-renderer-lockdown"/> <int value="2138146331" label="OmniboxVoiceSearchAlwaysVisible:enabled"/> <int value="2139048614" label="UseSurfaceLayerForVideo:enabled"/> + <int value="2141067485" label="SystemWebApps:enabled"/> <int value="2141463681" label="enable-offer-upload-credit-cards"/> <int value="2142979536" label="EnableManualFallbacksFilling:disabled"/> </enum> @@ -33971,7 +33985,7 @@ <enum name="NetFilterType"> <summary> - Specific content decoding filter. See net::Filter::FilterType for more + Specific content decoding filter. See net::Filter::FilterType for more details </summary> <obsolete> @@ -33988,8 +34002,8 @@ <enum name="NetFilterType2"> <summary> - Specific content decoding filter. See net::SourceStream::SourceType for - more details + Specific content decoding filter. See net::SourceStream::SourceType for more + details </summary> <int value="0" label="Brotli"/> <int value="1" label="Deflate"/> @@ -35306,7 +35320,7 @@ <enum name="NetworkDhcpClientStatus"> <int value="0" label="Arp Gateway"> The DHCP client will attempt to identify the default gateway using a unicast - ARP to the gateway's MAC address. This may help speed up the re-connection + ARP to the gateway's MAC address. This may help speed up the re-connection process. </int> <int value="1" label="Arp Self"> @@ -37196,15 +37210,15 @@ Forced crash due to view not in a window requiring a window </int> <int value="3" label="EXCEPTION_NSURL_INIT_NIL"> - Whitelisted exception for bug 85463. Suspect ImageKit conversions for media + Whitelisted exception for bug 85463. Suspect ImageKit conversions for media browser in open or save panel. </int> <int value="4" label="EXCEPTION_NSDATADETECTOR_NIL_STRING"> - Whitelisted exception for bug 316759. Suspect background address detection, + Whitelisted exception for bug 316759. Suspect background address detection, field unknown. </int> <int value="5" label="EXCEPTION_NSREGULAREXPRESSION_NIL_STRING"> - Whitelisted exception for bug 466076. Suspect background address detection, + Whitelisted exception for bug 466076. Suspect background address detection, field unknown. </int> </enum> @@ -37408,8 +37422,8 @@ <enum name="OverscrollNavigationType"> <summary> - Type of the overscroll gesture based on direction and source (i.e. - touchpad vs. touch screen). + Type of the overscroll gesture based on direction and source (i.e. touchpad + vs. touch screen). </summary> <int value="0" label="None">Did not scroll</int> <int value="1" label="Forward Touchpad">Scrolled forward using touchpad</int> @@ -42698,25 +42712,25 @@ <enum name="ResolutionUnspecWasteCategory"> <int value="0" label="AF_WASTE_IPV4_ONLY"> - Running in a IPv4-only configuration. No waste. + Running in a IPv4-only configuration. No waste. </int> <int value="1" label="AF_WASTE_CACHE_IPV4"> - Cache contained an UNSPEC result for this IPv4 lookup. Waste. + Cache contained an UNSPEC result for this IPv4 lookup. Waste. </int> <int value="2" label="AF_WASTE_CACHE_UNSPEC"> - Cache contained an IPv4 result for this UNSPEC lookup. Waste. + Cache contained an IPv4 result for this UNSPEC lookup. Waste. </int> <int value="3" label="AF_WASTE_JOB_IPV4"> - Job pool contained an UNSPEC job for this IPv4 lookup. Waste. + Job pool contained an UNSPEC job for this IPv4 lookup. Waste. </int> <int value="4" label="AF_WASTE_JOB_UNSPEC"> - Job pool contained an IPv4 job for this UNSPEC lookup. Waste. + Job pool contained an IPv4 job for this UNSPEC lookup. Waste. </int> <int value="5" label="AF_WASTE_NONE_IPV4"> - A new job was needed for this IPv4 lookup. No waste. + A new job was needed for this IPv4 lookup. No waste. </int> <int value="6" label="AF_WASTE_NONE_UNSPEC"> - A new job was needed for this UNSPEC lookup. No waste. + A new job was needed for this UNSPEC lookup. No waste. </int> </enum> @@ -46168,16 +46182,16 @@ sql::Recovery::Backup() (helper for Recovered()) completely successfully. </int> <int value="7" label="RECOVERY_FAILED_BACKUP_INIT"> - Failed sqlite3_backup_init(). Error code in Sqlite.RecoveryHandle. + Failed sqlite3_backup_init(). Error code in Sqlite.RecoveryHandle. </int> <int value="8" label="RECOVERY_FAILED_BACKUP_STEP"> - Failed sqlite3_backup_step(). Error code in Sqlite.RecoveryStep. + Failed sqlite3_backup_step(). Error code in Sqlite.RecoveryStep. </int> <int value="9" label="RECOVERY_SUCCESS_AUTORECOVER"> sql::Recovery::AutoRecoverTable() completed successfully. </int> <int value="10" label="RECOVERY_FAILED_AUTORECOVER_UNRECOGNIZED_TYPE"> - Failed sqlite3_backup_step(). Error code in Sqlite.RecoveryStep. + Failed sqlite3_backup_step(). Error code in Sqlite.RecoveryStep. </int> <int value="11" label="RECOVERY_FAILED_AUTORECOVER_MISSING_TABLE"> AutoRecoverTable() could not find the target table. @@ -46523,12 +46537,12 @@ <enum name="SSLErrorCauses"> <int value="0" label="CLOCK_PAST: System clock set early"> This cause is recorded if the SSL error is CERT_DATE_INVALID and Chrome had - reason to believe that the system clock was behind. Methods of detecting + reason to believe that the system clock was behind. Methods of detecting clock inaccuracy have changed over time. </int> <int value="1" label="CLOCK_FUTURE: System clock set late"> This cause is recorded if the SSL error is CERT_DATE_INVALID and Chrome had - reason to believe that the system clock was behind. Methods of detecting + reason to believe that the system clock was behind. Methods of detecting clock inaccuracy have changed over time. </int> <int value="2" label="WWW_SUBDOMAIN_MATCH: (Deprecated)">
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 88aabe2..8d217027 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -1638,14 +1638,14 @@ <owner>jming@chromium.org</owner> <owner>xingliu@chromium.org</owner> <summary> - Records instances of DownloadForegroundService stops. The number of - expected stops (stopped) and unexpected stops (task removed, low memory, - etc) can be compared to get a sense of how often the service crashes to see - how it handles restarts. For example, the number of times the service is - stopped because of low memory can be compared to the number of times the - service has been destroyed to see how frequently it occurs. Or, the number - of start sticky's will indicate how often the service is able to restart due - to an unexpected stop. + Records instances of DownloadForegroundService stops. The number of expected + stops (stopped) and unexpected stops (task removed, low memory, etc) can be + compared to get a sense of how often the service crashes to see how it + handles restarts. For example, the number of times the service is stopped + because of low memory can be compared to the number of times the service has + been destroyed to see how frequently it occurs. Or, the number of start + sticky's will indicate how often the service is able to restart due to an + unexpected stop. </summary> </histogram> @@ -1654,7 +1654,7 @@ <owner>jming@chromium.org</owner> <owner>xingliu@chromium.org</owner> <summary> - Records instances of DownloadNotificationService stops. The number of + Records instances of DownloadNotificationService stops. The number of expected stops (stopped) and unexpected stops (task removed, low memory, etc) can be compared to get a sense of how often the service crashes to see how it handles restarts. For example, the number of times the service is @@ -2119,9 +2119,9 @@ <summary> The percentage of out-of-memory decoding failures, per batch of photos decoded. Intended to help identify if there are browsers where decoding - fails 100% of the time. Be wary at looking at other numbers in the + fails 100% of the time. Be wary at looking at other numbers in the histogram, as a value emitted at, say, 50% may represent one failure in a - two-item decoding or 50 failures in a hundred-item decoding. These are + two-item decoding or 50 failures in a hundred-item decoding. These are qualitatively different experiences for a user. </summary> </histogram> @@ -2132,9 +2132,9 @@ <summary> The percentage of runtime error decoding failures, per batch of photos decoded. Intended to help identify if there are browsers where decoding - fails 100% of the time. Be wary at looking at other numbers in the + fails 100% of the time. Be wary at looking at other numbers in the histogram, as a value emitted at, say, 50% may represent one failure in a - two-item decoding or 50 failures in a hundred-item decoding. These are + two-item decoding or 50 failures in a hundred-item decoding. These are qualitatively different experiences for a user. </summary> </histogram> @@ -2621,12 +2621,12 @@ <owner>dtrainor@chromium.org</owner> <summary> When a user closes a tab an undo toast will popup on certain devices giving - the user the chance to undo closing that tab. This stat tracks how the user - interacts with that UI and what actions they take. A cold start means that - the undo bar wasn't showing when it was triggered to show again. A warm - start means that it was. Warm starts can happen when the user closes - multiple tabs close together. When the undo bar is dismissed, all closes - that were queued up to be undone are committed. This can happen either by a + the user the chance to undo closing that tab. This stat tracks how the user + interacts with that UI and what actions they take. A cold start means that + the undo bar wasn't showing when it was triggered to show again. A warm + start means that it was. Warm starts can happen when the user closes + multiple tabs close together. When the undo bar is dismissed, all closes + that were queued up to be undone are committed. This can happen either by a timeout or by an action by the user to move to another part of the UI. </summary> </histogram> @@ -2651,7 +2651,7 @@ <owner>dominickn@chromium.org</owner> <summary> App banners promote an application related to the current website, and are - requested specifically through the current page's HTML. This stat tracks + requested specifically through the current page's HTML. This stat tracks usage of the BeforeInstallPromptEvent, which allows developers to control when an app banner appears. The events in this histogram are not mutually exclusive - for example, preventDefault() must be called if prompt() is @@ -2663,9 +2663,9 @@ <owner>dfalcantara@chromium.org</owner> <summary> App banners promote an application related to the current website, and are - requested specifically through the current page's HTML. This stat tracks - the different ways that an app banner left the screen, e.g. through an - automatic dismissal after navigation or an explicit user action. + requested specifically through the current page's HTML. This stat tracks the + different ways that an app banner left the screen, e.g. through an automatic + dismissal after navigation or an explicit user action. </summary> </histogram> @@ -2673,7 +2673,7 @@ <owner>dfalcantara@chromium.org</owner> <summary> App banners promote an application related to the current website, and are - requested specifically through the current page's HTML. This stat tracks + requested specifically through the current page's HTML. This stat tracks when an app banner was requested and how the request was handled, e.g. the user blocked its appearance or the banner was ultimately created. </summary> @@ -2684,8 +2684,8 @@ <owner>dominickn@chromium.org</owner> <summary> App banners promote an application related to the current website, and are - requested specifically through the current page's HTML. This stat tracks - the status code logged by the app banner system as it processes a site's + requested specifically through the current page's HTML. This stat tracks the + status code logged by the app banner system as it processes a site's eligibility for an app banner. Every request for a banner will be logged in a bucket of this histogram. </summary> @@ -2695,7 +2695,7 @@ <owner>dfalcantara@chromium.org</owner> <summary> App banners promote an application related to the current website, and are - requested specifically through the current page's HTML. This stat tracks + requested specifically through the current page's HTML. This stat tracks when a user triggers an install dialog for the app promoted by the banner, as well as whether or not the user ultimately decided to install the app. </summary> @@ -2705,9 +2705,9 @@ <owner>dominickn@chromium.org</owner> <summary> App banners promote an application related to the current website, and are - requested specifically through the current page's HTML. This stat tracks - the number of minutes between the first recorded visit to an origin and the - time when the banner is actually shown. + requested specifically through the current page's HTML. This stat tracks the + number of minutes between the first recorded visit to an origin and the time + when the banner is actually shown. </summary> </histogram> @@ -2715,7 +2715,7 @@ <owner>dominickn@chromium.org</owner> <summary> App banners promote an application related to the current website, and are - requested specifically through the current page's HTML. This stat + requested specifically through the current page's HTML. This stat specifically tracks a user's response to a displayed banner. </summary> </histogram> @@ -3945,14 +3945,14 @@ <owner>elijahtaylor@google.com</owner> <owner>shihuis@google.com</owner> <summary> - Whether ARC is enabled or not. Before M56 this was collected only on login - and when ARC was enabled or disabled. From M56 forward this is collected + Whether ARC is enabled or not. Before M56 this was collected only on login + and when ARC was enabled or disabled. From M56 forward this is collected during every metrics recording interval, so it is in every record uploaded - to the server. This is required because this value is used to categorize - all other data in the dashboard as collected with ARC enabled or not. This - is true even for users who are running on ecryptfs and skipped Ext4 - migration; even though ARC Apps do not run until migration is complete on N - or later systems. + to the server. This is required because this value is used to categorize all + other data in the dashboard as collected with ARC enabled or not. This is + true even for users who are running on ecryptfs and skipped Ext4 migration; + even though ARC Apps do not run until migration is complete on N or later + systems. </summary> </histogram> @@ -4051,8 +4051,8 @@ enum="DeprecatedAcceleratorUsage"> <owner>afakhry@chromium.org</owner> <summary> - The lock screen action has two accelerators: - Ctrl+Shift+L which is - deprecated. - Search+L which is new. This histogram shows the number of + The lock screen action has two accelerators: - Ctrl+Shift+L which is + deprecated. - Search+L which is new. This histogram shows the number of times each accelerator (deprecated and new) is used. </summary> </histogram> @@ -4065,8 +4065,8 @@ <owner>afakhry@chromium.org</owner> <summary> The switch to the next IME action has two accelerators: - Shift+Alt which is - deprecated. - Ctrl+Shift+Space which is new. This histogram shows the - number of times each accelerator (deprecated and new) is used. + deprecated. - Ctrl+Shift+Space which is new. This histogram shows the number + of times each accelerator (deprecated and new) is used. </summary> </histogram> @@ -4074,8 +4074,8 @@ enum="DeprecatedAcceleratorUsage"> <owner>afakhry@chromium.org</owner> <summary> - Showing the IME menu bubble has two accelerators: - Alt+Shift+K which is - deprecated. - Search+Shift+K which is new. This histogram shows the number + Showing the IME menu bubble has two accelerators: - Alt+Shift+K which is + deprecated. - Search+Shift+K which is new. This histogram shows the number of times each accelerator (deprecated and new) is used. </summary> </histogram> @@ -4084,8 +4084,8 @@ enum="DeprecatedAcceleratorUsage"> <owner>afakhry@chromium.org</owner> <summary> - Opening the task manager has two accelerators: - Shift+Esc which is - deprecated. - Search+Esc which is new. This histogram shows the number of + Opening the task manager has two accelerators: - Shift+Esc which is + deprecated. - Search+Esc which is new. This histogram shows the number of times each accelerator (deprecated and new) is used. </summary> </histogram> @@ -4095,7 +4095,7 @@ <owner>afakhry@chromium.org</owner> <summary> Toggling the high contrast display mode has two accelerators: - - Search+Shift+H which is deprecated. - Ctrl+Search+H which is new. This + Search+Shift+H which is deprecated. - Ctrl+Search+H which is new. This histogram shows the number of times each accelerator (deprecated and new) is used. </summary> @@ -6418,7 +6418,7 @@ <owner>isherman@chromium.org</owner> <summary> Whether the Mac AddressBook was available on the *first* attempt to read - data from it. This is only recorded once per Chrome profile. + data from it. This is only recorded once per Chrome profile. </summary> </histogram> @@ -6626,7 +6626,7 @@ <owner>isherman@chromium.org</owner> <summary> Measures the adoption of the HTML autocomplete type hint specification (see - http://is.gd/whatwg_autocomplete for more details). For each fillable form + http://is.gd/whatwg_autocomplete for more details). For each fillable form detected, logs whether that form includes author-specified type hints. </summary> </histogram> @@ -7174,7 +7174,7 @@ <owner>isherman@chromium.org</owner> <summary> The quality of Autofill's heuristic field type detection, broken down by the - specific field type. Fields with multiple possible types (based on the + specific field type. Fields with multiple possible types (based on the stored Autofill data) are logged as having ambiguous type. </summary> </histogram> @@ -7197,7 +7197,7 @@ <owner>isherman@chromium.org</owner> <summary> The overall quality of the Autofill field type predictions, broken down by - the specific field type. Fields with multiple possible types (based on the + the specific field type. Fields with multiple possible types (based on the stored Autofill data) are logged as having ambiguous type. </summary> </histogram> @@ -7220,7 +7220,7 @@ <owner>isherman@chromium.org</owner> <summary> The quality of the Autofill server's field type detection, broken down by - the specific field type. Fields with multiple possible types (based on the + the specific field type. Fields with multiple possible types (based on the stored Autofill data) are logged as having ambiguous type. </summary> </histogram> @@ -7520,7 +7520,7 @@ <owner>jsaul@google.com</owner> <summary> Metric to measure if a submitted card's expiration date matches the same - server card's expiration date (unmasked or not). Cards are considered to be + server card's expiration date (unmasked or not). Cards are considered to be the same if they have the same card number (if unmasked) or if they have the same network and last four digits (if masked). </summary> @@ -7644,7 +7644,7 @@ <summary> Time the user waited before abandoning an unmasking operation. In such a scenario, the user is cancelling a pending unmasking operation (possibly - because it is taking too long). The time measured here corresponds to the + because it is taking too long). The time measured here corresponds to the time between the user clicking the "Verify" button and then clicking "Cancel". </summary> @@ -7731,7 +7731,7 @@ <owner>isherman@chromium.org</owner> <summary> Measures the frequency of various events in the Autofill user interaction - flow. By comparing frequencies, we can compute several interesting + flow. By comparing frequencies, we can compute several interesting "user happiness" metrics. </summary> </histogram> @@ -8443,7 +8443,7 @@ <histogram name="Blink.Binding.InitializeWindowProxy" units="microseconds"> <obsolete> - Deprecated as of 10/2016. This metric was split into two metrics depending + Deprecated as of 10/2016. This metric was split into two metrics depending if it figures time for main windows. </obsolete> <owner>peria@chromium.org</owner> @@ -9030,7 +9030,7 @@ <owner>drott@chromium.org</owner> <summary> Tracks adoption ratio of variable fonts compared to conventional (in the - sense of non-variable) web fonts. Recorded at the time of instantiating a + sense of non-variable) web fonts. Recorded at the time of instantiating a Skia SkTypeface from the successfully decoded web font blob. </summary> </histogram> @@ -9112,77 +9112,6 @@ </summary> </histogram> -<histogram base="true" name="Blink.MainFrame.CompositingCommitRatio" units="%"> - <owner>paint-dev@chromium.org</owner> -<!-- Name completed by histogram_suffixes name="BlinkMainFrameUpdateTimeSuffixes" --> - - <summary> - The percentage of time between a BeginMainFrame and paint results commit in - Blink that is used for committing paint results to the compositor. - </summary> -</histogram> - -<histogram base="true" name="Blink.MainFrame.CompositingRatio" units="%"> - <owner>paint-dev@chromium.org</owner> -<!-- Name completed by histogram_suffixes name="BlinkMainFrameUpdateTimeSuffixes" --> - - <summary> - The percentage of time between a BeginMainFrame and paint results commit in - Blink that is used for computing Compositing. - </summary> -</histogram> - -= -<histogram base="true" name="Blink.MainFrame.IntersectionRatio" units="%"> - <owner>paint-dev@chromium.org</owner> -<!-- Name completed by histogram_suffixes name="BlinkMainFrameUpdateTimeSuffixes" --> - - <summary> - The percentage of time between a BeginMainFrame and paint results commit in - Blink that is used for computing Intersection Observations. - </summary> -</histogram> - -<histogram base="true" name="Blink.MainFrame.PaintRatio" units="%"> - <owner>paint-dev@chromium.org</owner> -<!-- Name completed by histogram_suffixes name="BlinkMainFrameUpdateTimeSuffixes" --> - - <summary> - The percentage of time between a BeginMainFrame and paint results commit in - Blink that is used for computing Paint. - </summary> -</histogram> - -<histogram base="true" name="Blink.MainFrame.PrePaintRatio" units="%"> - <owner>paint-dev@chromium.org</owner> -<!-- Name completed by histogram_suffixes name="BlinkMainFrameUpdateTimeSuffixes" --> - - <summary> - The percentage of time between a BeginMainFrame and paint results commit in - Blink that is used for computing PrePaint. - </summary> -</histogram> - -<histogram base="true" name="Blink.MainFrame.StyleAndLayoutRatio" units="%"> - <owner>paint-dev@chromium.org</owner> -<!-- Name completed by histogram_suffixes name="BlinkMainFrameUpdateTimeSuffixes" --> - - <summary> - The percentage of time between a BeginMainFrame and paint results commit in - Blink that is used for computing Style and Layout. - </summary> -</histogram> - -<histogram name="Blink.MainFrame.UpdateTime" units="microseconds"> - <owner>paint-dev@chromium.org</owner> - <summary> - Time between a BeginMainFrame and paint results commit in Blink. - - This histogram will not record metrics on machines with low-resolution - clocks. - </summary> -</histogram> - <histogram name="Blink.MediaDocument.DownloadButton" enum="MediaDocumentDownloadButtonType"> <obsolete> @@ -9569,10 +9498,10 @@ </summary> <details> The first time a CSS property is parsed on a page, the histogram is updated - to increment the counter. Each histogram bucket corresponds to a CSS + to increment the counter. Each histogram bucket corresponds to a CSS property (eg. width, border-radius). The exception is the 'Total pages measured' bucket - this counts the number of pages that CSS properties were - counted on. When a page navigation occurs the page count bucket is + counted on. When a page navigation occurs the page count bucket is incremented and tracking of the set of which properties have been seen is reset. @@ -9716,8 +9645,8 @@ under OOPIF. The 'Total pages measured' bucket is incremented each time a new SVG image - is created. Note that the same SVG image can be used across multiple tabs - in a single renderer but this counts as a single usage. See + is created. Note that the same SVG image can be used across multiple tabs in + a single renderer but this counts as a single usage. See http://crbug.com/236262. </details> </histogram> @@ -9733,9 +9662,9 @@ under OOPIF. Count of how many SVG images use various features. The PageVisits bucket is - incremented each time a new SVG image is created. Note that the same SVG + incremented each time a new SVG image is created. Note that the same SVG image can be used across multiple tabs in a single renderer but this counts - as a single usage. See http://crbug.com/236262. + as a single usage. See http://crbug.com/236262. </details> </histogram> @@ -9774,7 +9703,7 @@ <owner>rajendrant@chromium.org</owner> <owner>bengr@chromium.org</owner> <summary> - Milliseconds spent waiting for an above the fold image element to load. 0ms + Milliseconds spent waiting for an above the fold image element to load. 0ms is recorded if the image is already loaded by the time user scrolls to it. EffectiveConnectionType (2G, 3G, etc) is recorded as suffix to this histogram. @@ -9786,7 +9715,7 @@ <owner>rajendrant@chromium.org</owner> <owner>bengr@chromium.org</owner> <summary> - Milliseconds spent waiting for a below the fold image element to load. 0ms + Milliseconds spent waiting for a below the fold image element to load. 0ms is recorded if the image is already loaded by the time user scrolls to it. EffectiveConnectionType (2G, 3G, etc) is recorded as suffix to this histogram. @@ -9893,7 +9822,7 @@ <histogram name="BlinkGC.ObjectSizeFreedByHeapCompaction" units="KB"> <owner>haraken@chromium.org</owner> <summary> - The total size of objects freed by BlinkGC's heap compaction. This is + The total size of objects freed by BlinkGC's heap compaction. This is recorded once following each compaction. </summary> </histogram> @@ -9912,7 +9841,7 @@ <owner>haraken@chromium.org</owner> <owner>hpayer@chromium.org</owner> <summary> - Duration of memory coalesce operation in the Blink GC. Reported once per + Duration of memory coalesce operation in the Blink GC. Reported once per coalesce operation. </summary> </histogram> @@ -11434,7 +11363,7 @@ <histogram name="Cast.Network.Down.Duration.In.Seconds" units="seconds"> <owner>cast-analytics@google.com</owner> <summary> - Records the time the network has been down on a Cast device. Recorded when + Records the time the network has been down on a Cast device. Recorded when network goes up. </summary> </histogram> @@ -11442,7 +11371,7 @@ <histogram name="Cast.Network.Up.Duration.In.Minutes" units="minutes"> <owner>cast-analytics@google.com</owner> <summary> - Records the time the network has been up on a Cast device. Recorded when + Records the time the network has been up on a Cast device. Recorded when network goes down. </summary> </histogram> @@ -11593,7 +11522,7 @@ The latency between when a Cast V2 connection is established and the first message is received on that connection. "Unknown" is the peer type, which is not known at this point in the CastV2 connection - establishment. Naming conforms to the CastV2 sender-side histogram naming + establishment. Naming conforms to the CastV2 sender-side histogram naming convention "CastV2.[action].[name].[peer_type]". </summary> </histogram> @@ -11605,7 +11534,7 @@ On accepting a Cast V2 transport socket connection, if an error is encountered, the error code is logged here. "Unknown" is the peer type, which is not known at this point in the CastV2 connection - establishment. "SslHandshake.Error" is the name of the action. + establishment. "SslHandshake.Error" is the name of the action. Naming conforms to the CastV2 sender-side histogram naming convention "CastV2.[action].[name].[peer_type]". </summary> @@ -11616,7 +11545,7 @@ <summary> The time taken to do the handshake during Cast V2 transport socket creation. "Unknown" is the peer type, which is not known at this point in - the CastV2 connection establishment. Naming conforms to the CastV2 + the CastV2 connection establishment. Naming conforms to the CastV2 sender-side histogram naming convention "CastV2.[action].[name].[peer_type]". </summary> @@ -12035,7 +11964,7 @@ <owner>gab@chromium.org</owner> <summary> Track set of Windows errors inside the meessage loop/pump system, where - system calls fail, and we try to gracefully recover. These errors should + system calls fail, and we try to gracefully recover. These errors should really never happen, so we should be sure to look closer if they do. </summary> </histogram> @@ -12814,8 +12743,8 @@ <owner>mpearson@chromium.org</owner> <summary> Whether Android's Clipboard.java successfully constructed a hasher to hash - clipboard entries. Recorded on construction of the class, which happens - only on startup. + clipboard entries. Recorded on construction of the class, which happens only + on startup. </summary> </histogram> @@ -13905,7 +13834,7 @@ <owner>chrishtr@chromium.org</owner> <summary> Total visible area of layers drawn that frame that are mask layers and also - are simple rounded corner masks. A sample is recorded on the first draw per + are simple rounded corner masks. A sample is recorded on the first draw per commit. </summary> </histogram> @@ -13916,8 +13845,8 @@ <owner>chrishtr@chromium.org</owner> <summary> Percent of visible area of layers drawn that frame that are mask layers and - also are simple rounded corner masks. A sample is recorded on the first - draw per commit. + also are simple rounded corner masks. A sample is recorded on the first draw + per commit. </summary> </histogram> @@ -13927,7 +13856,7 @@ <owner>chrishtr@chromium.org</owner> <summary> Percent of layers drawn that frame that are mask layers and also are simple - rounded corner masks. A sample is recorded on the first draw per commit. + rounded corner masks. A sample is recorded on the first draw per commit. </summary> </histogram> @@ -14717,7 +14646,7 @@ <summary> For pages that trigger Safe Browsing triggered popup blocker (in warn or enforce modes), records the position in the redirect chain for the page the - activation was triggered by. If SubresourceFilterConsiderRedirects is + activation was triggered by. If SubresourceFilterConsiderRedirects is disabled, then always returns "Only navigation". </summary> </histogram> @@ -14860,12 +14789,12 @@ <owner>mpearson@chromium.org</owner> <summary> Recorded when a context menu is shown, sliced by whether a web contents was - present. (It generally should be; indeed, this code path should not be - followed when it is absent. For instance, invoking a context menu from the + present. (It generally should be; indeed, this code path should not be + followed when it is absent. For instance, invoking a context menu from the new tab page or from the sad tab page will not cause an emission to this - histogram.) Note that this refers to link context menus, not the + histogram.) Note that this refers to link context menus, not the cut-copy-paste context menus that can appear during long presses on text on - a web page or long presses in the omnibox. The value of this histogram for + a web page or long presses in the omnibox. The value of this histogram for "present" could be usefully compared with the total count of ContextMenu.SelectedOption to determine the clickthrough rate for context menus. @@ -16004,7 +15933,7 @@ <owner>dspaid@chromium.org</owner> <summary> The status of the user home directory migration from ecryptfs to - ext4-crypto. This is logged once at the end of each migration. + ext4-crypto. This is logged once at the end of each migration. </summary> </histogram> @@ -16042,7 +15971,7 @@ <owner>dspaid@chromium.org</owner> <summary> The total amount of free disk space on the system when the user started the - migration from ecryptfs to ext4-crypto. This is only logged when the user + migration from ecryptfs to ext4-crypto. This is only logged when the user encounters an insufficient space error. </summary> </histogram> @@ -16062,9 +15991,9 @@ <owner>dspaid@chromium.org</owner> <summary> The total number of bytes of xattr data that we are trying to store on a - file when we receive an insufficient space error. This includes both xattr + file when we receive an insufficient space error. This includes both xattr data already present on the file as well as the new xattr we are trying to - set. This is only logged during ecryptfs to ext4-crypto migration if we + set. This is only logged during ecryptfs to ext4-crypto migration if we receive an insufficient space error when setting a new extended attribute. </summary> </histogram> @@ -16074,7 +16003,7 @@ <owner>dspaid@chromium.org</owner> <summary> The status of the user home directory migration from ecryptfs to - ext4-crypto. This is logged once at the start of each migration. + ext4-crypto. This is logged once at the start of each migration. </summary> </histogram> @@ -16082,7 +16011,7 @@ <owner>hashimoto@chromium.org</owner> <summary> The total byte count (MB) of the data in a user's home directory which is - being migrated from ecryptfs to ext4-crypto. This is logged once when a new + being migrated from ecryptfs to ext4-crypto. This is logged once when a new migration starts. </summary> </histogram> @@ -16091,7 +16020,7 @@ <owner>hashimoto@chromium.org</owner> <summary> The total file count in a user's home directory which is being migrated from - ecryptfs to ext4-crypto. This is logged once when a new migration starts. + ecryptfs to ext4-crypto. This is logged once when a new migration starts. </summary> </histogram> @@ -16164,7 +16093,7 @@ <histogram name="Cryptohome.HomedirEncryptionType" enum="HomedirEncryptionType"> <owner>dspaid@chromium.org</owner> <summary> - The encryption type used for a user's cryptohome directory. This is logged + The encryption type used for a user's cryptohome directory. This is logged each time the cryptohome is mounted. </summary> </histogram> @@ -16255,7 +16184,7 @@ <owner>dspaid@chromium.org</owner> <summary> The amount of time (ms) for the user's home directory to be migrated from - ecryptfs to ext4-crypto. If the migration is interrupted and subsequently + ecryptfs to ext4-crypto. If the migration is interrupted and subsequently resumed (such as due to power loss) then no value is recorded for either attempt. </summary> @@ -17761,7 +17690,7 @@ <summary> Whether the response headers of the warm up URL had Chrome Proxy via header. Recorded only when non-null response headers were available when the fetch - of warm up URL concludes. + of warm up URL concludes. </summary> </histogram> @@ -17787,7 +17716,7 @@ <summary> Proxy scheme of the proxy server via which the warm up URL was fetched. Recorded only when non-null response headers were available when the fetch - of warm up URL concludes. + of warm up URL concludes. </summary> </histogram> @@ -18645,7 +18574,7 @@ <summary> DeprecatedInvlalidatorRegistrar is crashing on the browser shut down. The reason for the crash is that not all invalidation handlers de-registister - themselves. Histogram records the type of the handler which hasn't + themselves. Histogram records the type of the handler which hasn't unregistered itself. Analyzing the histogram will allow us to understand, which handlers are causing the crash. </summary> @@ -18728,7 +18657,7 @@ Chrome iOS app. This will only be logged if at least one promotion was shown to the user on the last 7 days and if at least one SMS was sent. If multiple SMSs were sent (at any time), it uses the time from the most recently sent - one. If the is negative due to bad clock on one of the clients it will be + one. If the is negative due to bad clock on one of the clients it will be logged as 0. SMSToSigninTime will be prefixed by the entry point promotion name that was responsible for the SMS sending. </summary> @@ -18783,7 +18712,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> TBD - Not run automatically yet, so this is just a placeholder for future - metrics collection. Any samples collected here represent users running + metrics collection. Any samples collected here represent users running diagnostics manually. </summary> </histogram> @@ -18793,7 +18722,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Shows the success and failure rates of the DiskSpace recovery step that runs - on recovery startups. The recovery step attempts to guarantee the DiskSpace + on recovery startups. The recovery step attempts to guarantee the DiskSpace test, which checks that the disk space in the volume where the user data directory normally lives is not dangerously low, would pass on the next startup. @@ -18805,7 +18734,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> TBD - Not run automatically yet, so this is just a placeholder for future - metrics collection. Any samples collected here represent users running + metrics collection. Any samples collected here represent users running diagnostics manually. </summary> </histogram> @@ -18850,7 +18779,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> TBD - Not run automatically yet, so this is just a placeholder for future - metrics collection. Any samples collected here represent users running + metrics collection. Any samples collected here represent users running diagnostics manually. </summary> </histogram> @@ -18909,9 +18838,9 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Shows the success and failure rates of the SQLiteIntegrityAppCache recovery - step that runs on recovery startups. The recovery step attempts to - guarantee the SQLiteIntegrityAppCache test, which checks the integrity of - the App Cache database, would pass on the next startup. + step that runs on recovery startups. The recovery step attempts to guarantee + the SQLiteIntegrityAppCache test, which checks the integrity of the App + Cache database, would pass on the next startup. </summary> </histogram> @@ -18934,9 +18863,9 @@ <owner>shess@chromium.org</owner> <summary> Shows the success and failure rates of the SQLiteIntegrityCookie recovery - step that runs on recovery startups. The recovery step attempts to - guarantee the SQLiteIntegrityCookie test, which checks the integrity of the - Cookie database, would pass on the next startup. + step that runs on recovery startups. The recovery step attempts to guarantee + the SQLiteIntegrityCookie test, which checks the integrity of the Cookie + database, would pass on the next startup. </summary> </histogram> @@ -18945,7 +18874,7 @@ <owner>shess@chromium.org</owner> <summary> Shows the success and failure rates of the SQLiteIntegrityDatabaseTracker - recovery step that runs on recovery startups. The recovery step attempts to + recovery step that runs on recovery startups. The recovery step attempts to guarantee the SQLiteIntegrityDatabaseTracker test, which checks the integrity of the Database Tracker database, would pass on the next startup. </summary> @@ -18956,9 +18885,9 @@ <owner>shess@chromium.org</owner> <summary> Shows the success and failure rates of the SQLiteIntegrityFavicons recovery - step that runs on recovery startups. The recovery step attempts to - guarantee the SQLiteIntegrityFavicons test, which checks the integrity of - the Favicons database, would pass on the next startup. + step that runs on recovery startups. The recovery step attempts to guarantee + the SQLiteIntegrityFavicons test, which checks the integrity of the Favicons + database, would pass on the next startup. </summary> </histogram> @@ -18967,9 +18896,9 @@ <owner>shess@chromium.org</owner> <summary> Shows the success and failure rates of the SQLiteIntegrityHistory recovery - step that runs on recovery startups. The recovery step attempts to - guarantee the SQLiteIntegrityHistory test, which checks the integrity of the - History database, would pass on the next startup. + step that runs on recovery startups. The recovery step attempts to guarantee + the SQLiteIntegrityHistory test, which checks the integrity of the History + database, would pass on the next startup. </summary> </histogram> @@ -18978,9 +18907,9 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Shows the success and failure rates of the SQLiteIntegrityNSSCert recovery - step that runs on recovery startups. The recovery step attempts to - guarantee the SQLiteIntegrityNSSCert test, which checks the integrity of the - NSS Certificate database, would pass on the next startup. + step that runs on recovery startups. The recovery step attempts to guarantee + the SQLiteIntegrityNSSCert test, which checks the integrity of the NSS + Certificate database, would pass on the next startup. </summary> </histogram> @@ -18989,9 +18918,9 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Shows the success and failure rates of the SQLiteIntegrityNSSKey recovery - step that runs on recovery startups. The recovery step attempts to - guarantee the SQLiteIntegrityNSSKey test, which checks the integrity of the - NSS Key database, would pass on the next startup. + step that runs on recovery startups. The recovery step attempts to guarantee + the SQLiteIntegrityNSSKey test, which checks the integrity of the NSS Key + database, would pass on the next startup. </summary> </histogram> @@ -19003,7 +18932,7 @@ <owner>shess@chromium.org</owner> <summary> Shows the success and failure rates of the SQLiteIntegrityThumbnails - recovery step that runs on recovery startups. The recovery step attempts to + recovery step that runs on recovery startups. The recovery step attempts to guarantee the SQLiteIntegrityThumbnails test, which checks the integrity of the Thumbnails database, would pass on the next startup. </summary> @@ -19014,9 +18943,9 @@ <owner>shess@chromium.org</owner> <summary> Shows the success and failure rates of the SQLiteIntegrityTopSites recovery - step that runs on recovery startups. The recovery step attempts to - guarantee the SQLiteIntegrityTopSites test, which checks the integrity of - the TopSites database, would pass on the next startup. + step that runs on recovery startups. The recovery step attempts to guarantee + the SQLiteIntegrityTopSites test, which checks the integrity of the TopSites + database, would pass on the next startup. </summary> </histogram> @@ -19025,9 +18954,9 @@ <owner>shess@chromium.org</owner> <summary> Shows the success and failure rates of the SQLiteIntegrityWebData recovery - step that runs on recovery startups. The recovery step attempts to - guarantee the SQLiteIntegrityWebData test, which checks the integrity of the - Web Data database, would pass on the next startup. + step that runs on recovery startups. The recovery step attempts to guarantee + the SQLiteIntegrityWebData test, which checks the integrity of the Web Data + database, would pass on the next startup. </summary> </histogram> @@ -19036,7 +18965,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> TBD - Not run automatically yet, so this is just a placeholder for future - metrics collection. Any samples collected here represent users running + metrics collection. Any samples collected here represent users running diagnostics manually. </summary> </histogram> @@ -19045,8 +18974,8 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Count of the number of times diagnostics recovery is invoked or not, and how - it was invoked. A sample is added to this histogram once for each startup - of Chrome. + it was invoked. A sample is added to this histogram once for each startup of + Chrome. </summary> </histogram> @@ -19057,7 +18986,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> TBD - Not run automatically yet, so this is just a placeholder for future - metrics collection. Any samples collected here represent users running + metrics collection. Any samples collected here represent users running diagnostics manually. </summary> </histogram> @@ -19067,7 +18996,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Shows the success and failure rates of diagnostics for the DiskSpace test - that runs on recovery startups. The DiskSpace test checks that the disk + that runs on recovery startups. The DiskSpace test checks that the disk space in the volume where the user data directory normally lives is not dangerously low. </summary> @@ -19078,7 +19007,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> TBD - Not run automatically yet, so this is just a placeholder for future - metrics collection. Any samples collected here represent users running + metrics collection. Any samples collected here represent users running diagnostics manually. </summary> </histogram> @@ -19088,7 +19017,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Shows the success and failure rates of diagnostics for the JSONBookmarks - test that runs on recovery startups. The JSONBookmarks test checks to make + test that runs on recovery startups. The JSONBookmarks test checks to make sure that the JSON encoded bookmarks file is properly formed. </summary> </histogram> @@ -19098,7 +19027,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Shows the success and failure rates of diagnostics for the JSONLocalState - test that runs on recovery startups. The JSONLocalState test checks to make + test that runs on recovery startups. The JSONLocalState test checks to make sure that the JSON encoded Local State file is properly formed. </summary> </histogram> @@ -19108,8 +19037,8 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Shows the success and failure rates of diagnostics for the JSONPreferences - test that runs on recovery startups. The JSONPreferences test checks to - make sure that the Preferences file is properly formed. + test that runs on recovery startups. The JSONPreferences test checks to make + sure that the Preferences file is properly formed. </summary> </histogram> @@ -19120,7 +19049,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> TBD - Not run automatically yet, so this is just a placeholder for future - metrics collection. Any samples collected here represent users running + metrics collection. Any samples collected here represent users running diagnostics manually. </summary> </histogram> @@ -19130,7 +19059,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Shows the success and failure rates of diagnostics for the PathDictionaries - test that runs on recovery startups. The PathDictionaries test checks makes + test that runs on recovery startups. The PathDictionaries test checks makes sure that the path to the Dictionaries folder exists and has the right permissions. </summary> @@ -19141,7 +19070,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Shows the success and failure rates of diagnostics for the PathLocalState - test that runs on recovery startups. The PathLocalState test checks makes + test that runs on recovery startups. The PathLocalState test checks makes sure that the path to the Local State folder exists and has the right permissions. </summary> @@ -19152,7 +19081,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Shows the success and failure rates of diagnostics for the PathResources - test that runs on recovery startups. The PathResources test checks makes + test that runs on recovery startups. The PathResources test checks makes sure that the path to the Resources folder exists and has the right permissions. </summary> @@ -19176,7 +19105,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Shows the success and failure rates of the SQLiteIntegrityAppCache test that - runs on recovery startups. The test checks the integrity of the App Cache + runs on recovery startups. The test checks the integrity of the App Cache database. </summary> </histogram> @@ -19189,7 +19118,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Shows the success and failure rates of the SQLiteIntegrityArchivedHistory - test that runs on recovery startups. The test checks the integrity of the + test that runs on recovery startups. The test checks the integrity of the Archived History database. </summary> </histogram> @@ -19199,7 +19128,7 @@ <owner>shess@chromium.org</owner> <summary> Shows the success and failure rates of the SQLiteIntegrityCookie test that - runs on recovery startups. The test checks the integrity of the Cookie + runs on recovery startups. The test checks the integrity of the Cookie database. </summary> </histogram> @@ -19209,7 +19138,7 @@ <owner>shess@chromium.org</owner> <summary> Shows the success and failure rates of the SQLiteIntegrityDatabaseTracker - test that runs on recovery startups. The test checks the integrity of the + test that runs on recovery startups. The test checks the integrity of the Database Tracker database. </summary> </histogram> @@ -19219,7 +19148,7 @@ <owner>shess@chromium.org</owner> <summary> Shows the success and failure rates of the SQLiteIntegrityFavicons test that - runs on recovery startups. The test checks the integrity of the Favicons + runs on recovery startups. The test checks the integrity of the Favicons database. </summary> </histogram> @@ -19229,7 +19158,7 @@ <owner>shess@chromium.org</owner> <summary> Shows the success and failure rates of the SQLiteIntegrityHistory test that - runs on recovery startups. The test checks the integrity of the History + runs on recovery startups. The test checks the integrity of the History database. </summary> </histogram> @@ -19239,7 +19168,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Shows the success and failure rates of the SQLiteIntegrityNSSCert test that - runs on recovery startups. The test checks the integrity of the NSS + runs on recovery startups. The test checks the integrity of the NSS Certificate database. </summary> </histogram> @@ -19249,7 +19178,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Shows the success and failure rates of the SQLiteIntegrityNSSKey test that - runs on recovery startups. The test checks the integrity of the NSS Key + runs on recovery startups. The test checks the integrity of the NSS Key database. </summary> </histogram> @@ -19262,7 +19191,7 @@ <owner>shess@chromium.org</owner> <summary> Shows the success and failure rates of the SQLiteIntegrityThumbnails test - that runs on recovery startups. The test checks the integrity of the + that runs on recovery startups. The test checks the integrity of the Thumbnails database. </summary> </histogram> @@ -19272,7 +19201,7 @@ <owner>shess@chromium.org</owner> <summary> Shows the success and failure rates of the SQLiteIntegrityTopSites test that - runs on recovery startups. The test checks the integrity of the TopSites + runs on recovery startups. The test checks the integrity of the TopSites database. </summary> </histogram> @@ -19282,7 +19211,7 @@ <owner>shess@chromium.org</owner> <summary> Shows the success and failure rates of the SQLiteIntegrityWebData test that - runs on recovery startups. The test checks the integrity of the Web Data + runs on recovery startups. The test checks the integrity of the Web Data database. </summary> </histogram> @@ -19292,7 +19221,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> TBD - Not run automatically yet, so this is just a placeholder for future - metrics collection. Any samples collected here represent users running + metrics collection. Any samples collected here represent users running diagnostics manually. </summary> </histogram> @@ -19301,7 +19230,7 @@ <owner>shess@chromium.org</owner> <summary> Histogram comparing the various types of diagnostic test failures when - diagnostic tests are run. Note that some types of test failures cause the + diagnostic tests are run. Note that some types of test failures cause the rest of the tests to be skipped. </summary> </histogram> @@ -19631,7 +19560,7 @@ <summary> Measures the wall clock time spent reading a certificate chain. The starting time is when the read command is issued, and the ending time is when all of - the certificates in the chain have been read into memory. + the certificates in the chain have been read into memory. </summary> </histogram> @@ -19987,7 +19916,7 @@ When either a pre-resolution was not done recently enough to provide benefit, or the corresponding pre-resolution is still pending, this histogram shows the duration of time used to resolve a hostname as not - existing during a failed attempt to navigate to (GET) a URL. In newer + existing during a failed attempt to navigate to (GET) a URL. In newer versions, if the hostname has never been found as a link during a page scan, and it has a referring URL, then it is added to referrer list data structure (hoping we'll do better next time). @@ -20003,7 +19932,7 @@ When either a pre-resolution was not done recently enough to provide benefit, or the corresponding pre-resolution is still pending, this histogram shows the duration of the duration of time used to resolve a - hostname to navigate to (GET) a URL. In newer versions, if the hostname has + hostname to navigate to (GET) a URL. In newer versions, if the hostname has never been found as a link during a page scan, and it has a referring URL, then it is added to referrer list data structure (hoping we'll do better next time). @@ -20166,7 +20095,7 @@ <owner>mgersh@chromium.org</owner> <summary> The duration of time used (most recently) to pre-resolve a hostname, when - the prefetched resolution was apparently evicted from the cache. The + the prefetched resolution was apparently evicted from the cache. The included samples only list pre-resolution times when the later navigations/fetches took in excess of 15ms. </summary> @@ -20179,7 +20108,7 @@ <owner>mgersh@chromium.org</owner> <summary> The duration of time used (most recently) to pre-resolve a hostname, when - the prefetched resolution was apparently evicted from the cache. The + the prefetched resolution was apparently evicted from the cache. The included samples only list pre-resolution times when the later navigations/fetches took in excess of 15ms. </summary> @@ -20200,13 +20129,13 @@ <owner>mgersh@chromium.org</owner> <summary> The duration of time used by the DNS pre-resolving threads to resolve a host - name via the network. Any resolutions that are faster than 15ms are + name via the network. Any resolutions that are faster than 15ms are considered to be local cache hits, not requiring network access, and are not included in this histogram. This histogram is most useful for estimating the typical cost of a name resolution, but it also estimates the total number of - network-based resolutions induced by this feature. Not all these - resolutions prove helpful (i.e., the user does not always actually visit the - resolved hostnames). + network-based resolutions induced by this feature. Not all these resolutions + prove helpful (i.e., the user does not always actually visit the resolved + hostnames). </summary> </histogram> @@ -20225,17 +20154,17 @@ <owner>mgersh@chromium.org</owner> <summary> The duration of time saved due to DNS pre-resolving in the "name not - found" case. Time "savings" shown in the histogram are + found" case. Time "savings" shown in the histogram are defined to be the difference between the DNS pre-resolution duration, and - the DNS resolution duration seen during a navigation. These cache hits only + the DNS resolution duration seen during a navigation. These cache hits only list events where the DNS pre-resolve duration for a host was in excess of 15ms (i.e., the network was consulted), and the actual DNS resolution (when a user attempted to navigate to a link with the same host name) took less than 15ms (i.e., the network was not consulted), which means the gain was a - result of a "cache hit" in the OS cache. For some users with - LANs, all negative results (even when the DNS cache might otherwise help) - take about 2.5 seconds (due to timeouts for netbios broadcasts), and hence - no savings are possible (or shown) for such users in this category. + result of a "cache hit" in the OS cache. For some users with LANs, + all negative results (even when the DNS cache might otherwise help) take + about 2.5 seconds (due to timeouts for netbios broadcasts), and hence no + savings are possible (or shown) for such users in this category. </summary> </histogram> @@ -20257,7 +20186,7 @@ found" case, and induced by either a page scan for a link or an omnibox entry by the user. Time "savings" shown in the histogram are defined to be the difference between the DNS pre-resolution duration, and - the DNS resolution duration seen during a navigation. These cache hits only + the DNS resolution duration seen during a navigation. These cache hits only list events where the DNS pre-resolve duration for a host was in excess of 15ms (i.e., the network was consulted), and the actual DNS resolution (when a user attempted to navigate to a link with the same host name) took less @@ -20273,7 +20202,7 @@ <owner>mgersh@chromium.org</owner> <summary> The duration of time spent by a proposed resolution waiting in the queue to - be resolved. This number is in addition to any DNS resolution time that may + be resolved. This number is in addition to any DNS resolution time that may come later. </summary> </histogram> @@ -20288,7 +20217,7 @@ found" case, and induced by predicting (using referrer lists) that a resolution was needed. Time "savings" shown in the histogram are defined to be the difference between the DNS pre-resolution duration, and - the DNS resolution duration seen during a navigation. These cache hits only + the DNS resolution duration seen during a navigation. These cache hits only list events where the DNS pre-resolve duration for a host was in excess of 15ms (i.e., the network was consulted), and the actual DNS resolution (when a user attempted to navigate to a link with the same host name) took less @@ -20301,13 +20230,13 @@ <owner>mgersh@chromium.org</owner> <summary> The duration of time used by the DNS pre-resolving threads to resolve a host - name via the network. Any resolutions that are faster than 15ms are + name via the network. Any resolutions that are faster than 15ms are considered to be local cache hits, not requiring network access, and are not included in this histogram. This histogram is most useful for estimating the typical cost of a name resolution, but it also estimates the total number of - network-based resolutions induced by this feature. Not all these - resolutions prove helpful (i.e., the user does not always actually visit the - resolved hostnames). + network-based resolutions induced by this feature. Not all these resolutions + prove helpful (i.e., the user does not always actually visit the resolved + hostnames). </summary> </histogram> @@ -20319,7 +20248,7 @@ <summary> When, due to congestion avoidance, a queued pre-resolution is abandoned (recycled) without actually being resolved, this histograms records the age - in the queue of that entry. Only times over 2 seconds are recorded in this + in the queue of that entry. Only times over 2 seconds are recorded in this histogram. </summary> </histogram> @@ -20332,7 +20261,7 @@ <summary> When, due to congestion avoidance, a queued pre-resolution is abandoned (recycled) without actually being resolved, this histograms records the age - in the queue of that entry. Only times less than or equal to 2 seconds are + in the queue of that entry. Only times less than or equal to 2 seconds are recorded in this histogram. </summary> </histogram> @@ -20353,7 +20282,7 @@ </obsolete> <owner>mgersh@chromium.org</owner> <summary> - Duration of time taken in OS resolutions for actual navigations. Note that + Duration of time taken in OS resolutions for actual navigations. Note that cached OS resolutions may provide low (0ms?) resolution times. </summary> </histogram> @@ -20388,7 +20317,7 @@ </obsolete> <owner>mgersh@chromium.org</owner> <summary> - Duration of time taken in speculative OS resolutions. Note that cached OS + Duration of time taken in speculative OS resolutions. Note that cached OS resolutions may provide low (0ms?) resolution times. </summary> </histogram> @@ -20399,7 +20328,7 @@ </obsolete> <owner>mgersh@chromium.org</owner> <summary> - Duration of time taken in speculative OS resolution that succeeded. Note + Duration of time taken in speculative OS resolution that succeeded. Note that cached resolutions may provide low (0ms?) resolution times. </summary> </histogram> @@ -20411,7 +20340,7 @@ <owner>mgersh@chromium.org</owner> <summary> Duration of time taken in OS resolutions that succeeded and were requested - for actual navigations. Note that cached resolutions may provide low (0ms?) + for actual navigations. Note that cached resolutions may provide low (0ms?) resolution times. </summary> </histogram> @@ -20543,16 +20472,15 @@ <summary> In some cases, such as when content arrives with embedded references to other servers, the prefetch system can't (or doesn't) attempt to pre-resolve - the hostnames. As an example, a visit to www.cnn.com will fetch content - with references to about 12 additional hostnames, none of which are - currently anticipated. Such resolutions are termed "Unexpected - Resolutions," and the durations associated with those DNS resolutions - are shown below. Future features may attempt to learn (from prior - experience locally, or from server provided hints), what secondary hostname - resolutions should be done when a primary resolution (or navigation) takes - place. This histogram shows what the potential savings are that - "remain on the table" until we employ some of these more advanced - features. + the hostnames. As an example, a visit to www.cnn.com will fetch content with + references to about 12 additional hostnames, none of which are currently + anticipated. Such resolutions are termed "Unexpected Resolutions," + and the durations associated with those DNS resolutions are shown below. + Future features may attempt to learn (from prior experience locally, or from + server provided hints), what secondary hostname resolutions should be done + when a primary resolution (or navigation) takes place. This histogram shows + what the potential savings are that "remain on the table" until we + employ some of these more advanced features. </summary> </histogram> @@ -20565,15 +20493,15 @@ In some cases, such as when content arrives with embedded references to other servers, or when a page (such as one in SSL) preclude scanning and prefetching, the prefetch system can't (or doesn't) attempt to pre-resolve - the hostnames. As an example, a visit to www.cnn.com will fetch content - with references to about 12 additional hostnames, none of which might be - anticipated. Similarly, clicking on a link in an SSL page won't be + the hostnames. As an example, a visit to www.cnn.com will fetch content with + references to about 12 additional hostnames, none of which might be + anticipated. Similarly, clicking on a link in an SSL page won't be anticipated (since scanning in not allowed by default). Such resolutions are termed "Unexpected Resolutions," and the durations associated with - those navigation induced DNS resolutions are shown below. If a referring - URL is available for the navigation, the relationship to the referring URL - was recorded, and future navigations to the referring hostname would have - induced a pre-resolution of hostname that caused an entry below. Such any + those navigation induced DNS resolutions are shown below. If a referring URL + is available for the navigation, the relationship to the referring URL was + recorded, and future navigations to the referring hostname would have + induced a pre-resolution of hostname that caused an entry below. Such any entry may facilitate future listing in the ReferredPositiveHit histogram. </summary> </histogram> @@ -20635,7 +20563,7 @@ <histogram name="DnsProbe.Probe.Result" enum="DnsProbe.ObsoleteProbeResult"> <obsolete> - Renamed 7/2013 to DnsProbe.ProbeResult. (Also switched to the full + Renamed 7/2013 to DnsProbe.ProbeResult. (Also switched to the full DnsProbe.ProbeStatus enum.) </obsolete> <owner>mgersh@chromium.org</owner> @@ -20969,7 +20897,7 @@ <owner>mattm@chromium.org</owner> <summary> Counts of SSL client sockets broken down by support for Domain Bound - Certificates TLS extension. Counts only connections with full handshakes, + Certificates TLS extension. Counts only connections with full handshakes, resumed sessions are not counted. </summary> </histogram> @@ -21608,7 +21536,7 @@ <histogram name="Download.BandwidthOverallBytesPerSecond"> <owner>dtrainor@chromium.org</owner> <summary> - Overall bandwidth seen for the download. Note that this is measured at the + Overall bandwidth seen for the download. Note that this is measured at the point at which the file is written, and so will not take into account the time costs of activities that occur after file write is completed (e.g. safe browsing scanning). @@ -21622,7 +21550,7 @@ <owner>dtrainor@chromium.org</owner> <summary> The percentage of the potential bandwidth actually used (per read) of a - download. An entry of 100% implies that Chrome was the limiting factor in + download. An entry of 100% implies that Chrome was the limiting factor in download speed. </summary> </histogram> @@ -21757,7 +21685,7 @@ <owner>felt@chromium.org</owner> <summary> A download which was marked DANGEROUS_FILE was discarded without the user - directly choosing, because the browser was closed. Grouped by the file + directly choosing, because the browser was closed. Grouped by the file extension. </summary> </histogram> @@ -21795,7 +21723,7 @@ <owner>xingliu@chromium.org</owner> <summary> Records whether the download database is available when database startup - completes, before starting any pending downloads. If the database is + completes, before starting any pending downloads. If the database is available, it will provide the next download id. Or no download history will be persisted. </summary> @@ -21887,7 +21815,7 @@ <owner>felt@chromium.org</owner> <summary> A download which was marked dangerous was discarded without the user - directly choosing, because the browser was closed. Grouped by the type of + directly choosing, because the browser was closed. Grouped by the type of danger. </summary> </histogram> @@ -21899,8 +21827,8 @@ <owner>dtrainor@chromium.org</owner> <summary> The percentage of the available disk bandwidth that was used by the - download. 100% indicates that the disk bandwidth was the limiting factor - for the download. + download. 100% indicates that the disk bandwidth was the limiting factor for + the download. </summary> </histogram> @@ -22437,8 +22365,8 @@ <owner>dtrainor@chromium.org</owner> <summary> The maximum bandwidth (per read) that Chrome could have provided for the - download. If the actual bandwidth equals the potential bandwidth, that - means that Chrome was the limiting factor for download bandwidth. + download. If the actual bandwidth equals the potential bandwidth, that means + that Chrome was the limiting factor for download bandwidth. </summary> </histogram> @@ -22449,7 +22377,7 @@ <owner>asanka@chromium.org</owner> <summary> The percentage of the lifetime of the DownloadResourceHandler for which it - was blocked by downstream flow control. 0% indicates that the network + was blocked by downstream flow control. 0% indicates that the network bandwidth was the limiting factor for the download. </summary> </histogram> @@ -22512,7 +22440,7 @@ <owner>dtrainor@chromium.org</owner> <summary> Records how many resumptions have taken place at the time of resumption for - a download in the Download Service. This differs from + a download in the Download Service. This differs from Download.Service.Entry.RetryCount, which records restarts. </summary> </histogram> @@ -22521,7 +22449,7 @@ <owner>dtrainor@chromium.org</owner> <summary> Records how many attempts have taken place at the time of a retry for a - download in the Download Service. This differs from + download in the Download Service. This differs from Download.Service.Entry.ResumptionCount, which records resumptions not complete restarts. </summary> @@ -22745,8 +22673,8 @@ <owner>shaktisahu@chromium.org</owner> <summary> The download service uses a single code path for both downloading and - uploading data. This metric records whether a given request includes upload - data. It is recorded upon starting a download or upload, immediately after + uploading data. This metric records whether a given request includes upload + data. It is recorded upon starting a download or upload, immediately after the client indicates whether the request includes upload data. </summary> </histogram> @@ -22913,7 +22841,7 @@ <owner>dtrainor@chromium.org</owner> <owner>felt@chromium.org</owner> <summary> - User chose to discard a download which was marked dangerous. Grouped by the + User chose to discard a download which was marked dangerous. Grouped by the type of danger. </summary> </histogram> @@ -23146,14 +23074,14 @@ <histogram name="Drive.NumberOfRegularFiles"> <owner>joshwoodward@google.com</owner> <summary> - Number of regualr files on Drive. Logged when Drive is first accessed. + Number of regualr files on Drive. Logged when Drive is first accessed. </summary> </histogram> <histogram name="Drive.NumberOfTotalFiles"> <owner>joshwoodward@google.com</owner> <summary> - Number of total files (regualr files + hosted documents) on Drive. Logged + Number of total files (regualr files + hosted documents) on Drive. Logged when Drive is first accessed. </summary> </histogram> @@ -23180,7 +23108,7 @@ <summary> Time spent to perform an incremental search for auto completion of files on Drive. This time is collected for every partial query the user types for - auto completion. For instance, if the user types "faq", + auto completion. For instance, if the user types "faq", incremental searches are performed for "f", "fa", and "faq" respectively. @@ -23355,7 +23283,7 @@ <details> The exponentially weighted averaging formula is: - rollingRssi = (1 - weight) * rollingRssi + weight * currentRssi; + rollingRssi = (1 - weight) * rollingRssi + weight * currentRssi; RSSI readings are inherently noisy, so this averaging gives a smoothed RSSI value to work with as a heuristic for proximity. @@ -23417,7 +23345,7 @@ how the EasyUnlock feature gets developed and deployed across platforms. This value is logged only once during the lifetime of the Chrome process, - shortly after it starts up. If a Bluetooth USB adapter is inserted after + shortly after it starts up. If a Bluetooth USB adapter is inserted after that point, the change will not be registered until Chrome restarts. </details> </histogram> @@ -24053,8 +23981,8 @@ <summary> Whether loading of device policy from file on an enterprise-enrolled (checked against install_attributes.pb) Chrome OS device yields an - enterprise policy with a DM token. Filled once during session startup, - after first successful device policy read. + enterprise policy with a DM token. Filled once during session startup, after + first successful device policy read. </summary> </histogram> @@ -24075,7 +24003,7 @@ <histogram name="Enterprise.EnrollmentRecovery" enum="EnterpriseEnrollmentType"> <owner>tnagel@chromium.org</owner> <summary> - Events related to Chrome OS enterprise enrollment recovery. Note that this + Events related to Chrome OS enterprise enrollment recovery. Note that this only covers cases in which prior to recovery, the "private owner" of the device had UMA stats enabled. </summary> @@ -27183,7 +27111,7 @@ <owner>rbyers@chromium.org</owner> <summary> The gesture-events recognized and dispatched for UI components owned by the - browser. This histogram was created as part of separating gesture events + browser. This histogram was created as part of separating gesture events between the browser and Ash (crbug.com/826476). The enums are extracted from Ash.GestureTarget. </summary> @@ -27659,7 +27587,7 @@ <summary> The number of times the keyboard lock exit bubble was re-shown during a session of keyboard lock mode due to the user pressing the escape key - repeatedly. This metric does not count reshows due to inactivity. Recorded + repeatedly. This metric does not count reshows due to inactivity. Recorded at the end of the session if the simplified-fullscreen-ui flag is enabled. </summary> </histogram> @@ -28698,7 +28626,7 @@ the extension type. This is a temporary metric - probably okay to remove it in M66, after we've - gathered sufficient UMA data in M65. See also http://crbug.com/718489. + gathered sufficient UMA data in M65. See also http://crbug.com/718489. </summary> </histogram> @@ -28712,7 +28640,7 @@ of VIEW_TYPE_BACKGROUND_CONTENTS. This is a temporary metric - probably okay to remove it in M66, after we've - gathered sufficient UMA data in M65. See also http://crbug.com/718489. + gathered sufficient UMA data in M65. See also http://crbug.com/718489. </summary> </histogram> @@ -28724,7 +28652,7 @@ the extension view type of the source frame. This is a temporary metric - probably okay to remove it in M66, after we've - gathered sufficient UMA data in M65. See also http://crbug.com/718489. + gathered sufficient UMA data in M65. See also http://crbug.com/718489. </summary> </histogram> @@ -28740,7 +28668,7 @@ pages (of VIEW_TYPE_BACKGROUND_CONTENTS type). This is a temporary metric - probably okay to remove it in M66, after we've - gathered sufficient UMA data in M65. See also http://crbug.com/718489. + gathered sufficient UMA data in M65. See also http://crbug.com/718489. </summary> </histogram> @@ -29475,7 +29403,7 @@ <owner>mfoltz@chromium.org</owner> <summary> Recorded every time an event is dispatched to a *component* extension with a - suspended event page. Otherwise identical to + suspended event page. Otherwise identical to Extensions.Events.DispatchWithSuspendedEventPage. </summary> </histogram> @@ -29513,7 +29441,7 @@ page that was suspended. This implies that firing this event woke up the event page. The event may or may not have been dispatched to the event page itself, for example it may have been dispatched to its popup, but regardless - it will wake the event page. When this metric is recorded, + it will wake the event page. When this metric is recorded, Extensions.Events.Dispatch will also be recorded. </summary> </histogram> @@ -31340,7 +31268,7 @@ </obsolete> <summary> Emitted when QuotaExceededError was called due to an extension using too - many bytes for a given setting. The number has no natural numerator + many bytes for a given setting. The number has no natural numerator (normalizing factor) and thus is not particularly useful. </summary> </histogram> @@ -31351,8 +31279,8 @@ </obsolete> <summary> Emitted when QuotaExceededError was called due to an extension using too - many keys. The number has no natural numerator (normalizing factor) and - thus is not particularly useful. + many keys. The number has no natural numerator (normalizing factor) and thus + is not particularly useful. </summary> </histogram> @@ -31362,7 +31290,7 @@ </obsolete> <summary> Emitted when QuotaExceededError was called due to an extension using too - many bytes. The number has no natural numerator (normalizing factor) and + many bytes. The number has no natural numerator (normalizing factor) and thus is not particularly useful. </summary> </histogram> @@ -31373,7 +31301,7 @@ <summary> When the web-accessible resource check in ChromeContentBrowserClientExtensionsPart::ShouldAllowOpenURL fails, this - records the reason for the failure. This check is performed on navigations + records the reason for the failure. This check is performed on navigations that utilize the OpenURL path as well as on transfers. </summary> </histogram> @@ -32931,9 +32859,9 @@ <owner>pkl@chromium.org</owner> <summary> WARNING: The list of actions used to identify new tasks hasn't been - attentively updated for several years (as of 2017). Some actions that - should likely be considered new tasks are probably missing. Take this - histogram with a grain of salt. + attentively updated for several years (as of 2017). Some actions that should + likely be considered new tasks are probably missing. Take this histogram + with a grain of salt. The amount of time (in seconds) that the app was in the background before the user started it @@ -32946,8 +32874,8 @@ <summary> The amount of time (in minutes) that the app was in the background before the user started it (via an ACTION_MAIN intent) and performed a user action - that describes the intent of resuming the app. Only recorded if the action - took place within the first 10 seconds of starting Chrome. The actions are + that describes the intent of resuming the app. Only recorded if the action + took place within the first 10 seconds of starting Chrome. The actions are further described in the FirstUserActionTypes suffix. </summary> </histogram> @@ -32957,9 +32885,9 @@ <owner>pkl@chromium.org</owner> <summary> WARNING: The list of actions used to identify new tasks hasn't been - attentively updated for several years (as of 2017). Some actions that - should likely be considered new tasks are probably missing. Take this - histogram with a grain of salt. + attentively updated for several years (as of 2017). Some actions that should + likely be considered new tasks are probably missing. Take this histogram + with a grain of salt. On handsets, the type of the first user action performed after the app was started or unbackgrounded. @@ -32971,9 +32899,9 @@ <owner>pkl@chromium.org</owner> <summary> WARNING: The list of actions used to identify new tasks hasn't been - attentively updated for several years (as of 2017). Some actions that - should likely be considered new tasks are probably missing. Take this - histogram with a grain of salt. + attentively updated for several years (as of 2017). Some actions that should + likely be considered new tasks are probably missing. Take this histogram + with a grain of salt. On tablets, the type of the first user action performed after the app was started or unbackgrounded. @@ -33583,7 +33511,7 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - Number of regualr files on Drive. Logged when Drive is first accessed. + Number of regualr files on Drive. Logged when Drive is first accessed. </summary> </histogram> @@ -33593,7 +33521,7 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - Number of total files (regualr files + hosted documents) on Drive. Logged + Number of total files (regualr files + hosted documents) on Drive. Logged when Drive is first accessed. </summary> </histogram> @@ -34045,7 +33973,7 @@ <histogram name="GPU.AcceleratedSurfaceRefreshRate" units="hz"> <owner>vmiura@chromium.org</owner> <summary> - Refresh rate of the display in Hz. This is recorded every time we present a + Refresh rate of the display in Hz. This is recorded every time we present a frame. </summary> </histogram> @@ -34053,7 +33981,7 @@ <histogram name="GPU.ANGLE.Buffer11CPUMemoryMB" units="MB"> <owner>cwallez@chromium.org</owner> <summary> - The sum of the size of the CPU-side memory allocations of Buffer11's copies + The sum of the size of the CPU-side memory allocations of Buffer11's copies (vs. GPU memory allocations). These allocations are used when modifying the buffer data on the CPU or when transfering to GPU memory via DMA. </summary> @@ -34949,9 +34877,8 @@ <histogram name="GPU.ProgramCache.LoadBinarySuccess" enum="BooleanSuccess"> <owner>vmiura@chromium.org</owner> <summary> - Records if the call to glProgramBinary was successful. This can - legitimately fail if the driver wants chrome to re-link and re-cache the gpu - program. + Records if the call to glProgramBinary was successful. This can legitimately + fail if the driver wants chrome to re-link and re-cache the gpu program. </summary> </histogram> @@ -34965,7 +34892,7 @@ <histogram name="GPU.ProgramCache.MemorySizeAfterKb" units="KB"> <owner>vmiura@chromium.org</owner> <summary> - Records the total in-memory cache size, before a program is cached. Can be + Records the total in-memory cache size, before a program is cached. Can be used with GPU.ProgramCache.MemorySizeBeforeKb to find the maximum cache size distribution. </summary> @@ -34974,7 +34901,7 @@ <histogram name="GPU.ProgramCache.MemorySizeBeforeKb" units="KB"> <owner>vmiura@chromium.org</owner> <summary> - Records the total in-memory cache size, after a program is cached. Can be + Records the total in-memory cache size, after a program is cached. Can be used with GPU.ProgramCache.MemorySizeAfterKb to find the maximum cache size distribution. </summary> @@ -35406,10 +35333,10 @@ <owner>asvitkine@chromium.org</owner> <summary> The number of inconsistency events found when examining a single histogram's - data in a browser for transmission via UMA. Inconsistent data is NOT - transmitted via UMA. Each type of inconsistency is a bit, and all bits - found in one histogram examination are added together to summarize the - inconsistent event. Note that the same inconsistency MAY appear time and + data in a browser for transmission via UMA. Inconsistent data is NOT + transmitted via UMA. Each type of inconsistency is a bit, and all bits found + in one histogram examination are added together to summarize the + inconsistent event. Note that the same inconsistency MAY appear time and again as the same corrupt histogram is examined for each potenital UMA upload. </summary> @@ -35422,10 +35349,10 @@ <owner>asvitkine@chromium.org</owner> <summary> The number of inconsistency events found when examining a single histogram's - data in a browser for transmission via UMA. Inconsistent data is NOT - transmitted via UMA. Each type of inconsistency is a bit, and all bits - found in one histogram examination are added together to summarize the - inconsistent event. Note that the same inconsistency will only appear at + data in a browser for transmission via UMA. Inconsistent data is NOT + transmitted via UMA. Each type of inconsistency is a bit, and all bits found + in one histogram examination are added together to summarize the + inconsistent event. Note that the same inconsistency will only appear at most one time for each histogram in a single process (i.e., duplicate corruption in a single histogram is not noted in this chart.) </summary> @@ -35438,10 +35365,10 @@ <owner>asvitkine@chromium.org</owner> <summary> The number of inconsistency events found when examining a single histogram's - data in a child process for transmission via UMA. Inconsistent data is NOT - transmitted via UMA. Each type of inconsistency is a bit, and all bits - found in one histogram examination are added together to summarize the - inconsistent event. Note that the same inconsistency MAY appear time and + data in a child process for transmission via UMA. Inconsistent data is NOT + transmitted via UMA. Each type of inconsistency is a bit, and all bits found + in one histogram examination are added together to summarize the + inconsistent event. Note that the same inconsistency MAY appear time and again as the same corrupt histogram is examined for each potenital UMA upload. </summary> @@ -35455,10 +35382,10 @@ <owner>asvitkine@chromium.org</owner> <summary> The number of inconsistency events found when examining a single histogram's - data in a child process for transmission via UMA. Inconsistent data is NOT - transmitted via UMA. Each type of inconsistency is a bit, and all bits - found in one histogram examination are added together to summarize the - inconsistent event. Note that the same inconsistency will only appear at + data in a child process for transmission via UMA. Inconsistent data is NOT + transmitted via UMA. Each type of inconsistency is a bit, and all bits found + in one histogram examination are added together to summarize the + inconsistent event. Note that the same inconsistency will only appear at most one time for each histogram in a single process (i.e., duplicate corruption in a single histogram is not noted in this chart.) </summary> @@ -35471,11 +35398,11 @@ <owner>asvitkine@chromium.org</owner> <summary> The number of inconsistency events found when examining a single histogram's - data in a renderer for transmission to the browser. Inconsistent data is - NOT transmitted to the browser. Each type of inconsistency is a bit, and - all bits found in one histogram examination are added together to summarize - the inconsistent event. Note that the same inconsistency MAY appear time - and again as the same corrupt histogram is examined for each potenital UMA + data in a renderer for transmission to the browser. Inconsistent data is NOT + transmitted to the browser. Each type of inconsistency is a bit, and all + bits found in one histogram examination are added together to summarize the + inconsistent event. Note that the same inconsistency MAY appear time and + again as the same corrupt histogram is examined for each potenital UMA upload. </summary> </histogram> @@ -35488,11 +35415,11 @@ <owner>asvitkine@chromium.org</owner> <summary> The number of inconsistency events found when examining a single histogram's - data in a renderer for transmission to the browser. Inconsistent data is - NOT transmitted to the browser. Each type of inconsistency is a bit, and - all bits found in one histogram examination are added together to summarize - the inconsistent event. Note that the same inconsistency will only appear - at most one time for each histogram in a single renderer process (i.e., + data in a renderer for transmission to the browser. Inconsistent data is NOT + transmitted to the browser. Each type of inconsistency is a bit, and all + bits found in one histogram examination are added together to summarize the + inconsistent event. Note that the same inconsistency will only appear at + most one time for each histogram in a single renderer process (i.e., duplicate corruption in a single histogram is not noted in this chart.) </summary> </histogram> @@ -35523,7 +35450,7 @@ <owner>asvitkine@chromium.org</owner> <summary> The amount of discrepancy found when examining a single histogram's data in - the browser process for transmission via UMA. Inconsistent data is NOT + the browser process for transmission via UMA. Inconsistent data is NOT transmitted via UMA. </summary> </histogram> @@ -35532,7 +35459,7 @@ <owner>asvitkine@chromium.org</owner> <summary> The amount of discrepancy found when examining a single histogram's data in - a child process for transmission via UMA. Inconsistent data is NOT + a child process for transmission via UMA. Inconsistent data is NOT transmitted via UMA. </summary> </histogram> @@ -35758,7 +35685,7 @@ <histogram name="History.DeleteFTSIndexDatabases" expires_after="2018-08-30"> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - Count of "History Index *" databases deleted. These databases + Count of "History Index *" databases deleted. These databases stored the full-text-search data for history, which was removed at r213442, this histogram tracks cleanup. </summary> @@ -35805,8 +35732,8 @@ <owner>rpop@google.com</owner> <summary> Size of the recovered Favicons database relative to the original corrupt - database. Recovery is VACUUM-like, so the resulting database should always - be smaller. Substantial 100% results would indicate empty databases being + database. Recovery is VACUUM-like, so the resulting database should always + be smaller. Substantial 100% results would indicate empty databases being recovered, substantial low% results would indicate very little data being recovered. </summary> @@ -36155,8 +36082,8 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Size of the recovered TopSites database relative to the original corrupt - database. Recovery is VACUUM-like, so the resulting database should always - be smaller. Substantial 100% results would indicate empty databases being + database. Recovery is VACUUM-like, so the resulting database should always + be smaller. Substantial 100% results would indicate empty databases being recovered, substantial low% results would indicate very little data being recovered. </summary> @@ -37492,8 +37419,8 @@ <owner>zeuthen@chromium.org</owner> <summary> Absolute wall-clock time duration it took for the update to complete from - the time an update first began. It includes not just the time the device - was up, but also includes the time the device spent sleeping. + the time an update first began. It includes not just the time the device was + up, but also includes the time the device spent sleeping. </summary> </histogram> @@ -37501,7 +37428,7 @@ <owner>zeuthen@chromium.org</owner> <summary> Uptime duration it took for the update to complete from the time an update - first began. It does not include the time the device spent sleeping, but it + first began. It does not include the time the device spent sleeping, but it does include the uptime spent in waiting for the hourly update checks to happen. </summary> @@ -37912,13 +37839,13 @@ <obsolete> Removed in September 2016 because (i) this measurement was somewhat wrong, (ii) it's difficult to understand the data, and (iii) there are better ways - to answer the same question. The measurement is somewhat wrong because + to answer the same question. The measurement is somewhat wrong because reloads, link drops, and pasting URLs and pressing enter are all incorrectly - logged to the URLtoQuery histogram, not the URLtoURL histogram. Futhermore, + logged to the URLtoQuery histogram, not the URLtoURL histogram. Futhermore, this histogram is difficult to analyze because it's not broken up by input - length. Short URLs can by random chance have a sizable percentage match - with a query. Finally, there are better source for data like this; ask - mpearson for details. + length. Short URLs can by random chance have a sizable percentage match with + a query. Finally, there are better source for data like this; ask mpearson + for details. </obsolete> <owner>mpearson@chromium.org</owner> <summary> @@ -37931,11 +37858,11 @@ <histogram name="InstantExtended.PercentageMatchV2_URLtoURL" units="%"> <obsolete> Removed in September 2016 because (i) this measurement was somewhat wrong, - and (ii) there are better ways to answer the same question. The measurement + and (ii) there are better ways to answer the same question. The measurement is somewhat wrong because reloads, link drops, and pasting URLs and pressing enter are all incorrectly logged to the URLtoQuery histogram, not the - URLtoURL histogram. Furthermore, there are better source for data like - this; ask mpearson for details. + URLtoURL histogram. Furthermore, there are better source for data like this; + ask mpearson for details. </obsolete> <owner>mpearson@chromium.org</owner> <summary> @@ -38498,7 +38425,7 @@ <owner>felt@chromium.org</owner> <summary> The time between the SSL interstitial display and the user decision, which - may be either accept or deny. This is only recorded for overridable SSL + may be either accept or deny. This is only recorded for overridable SSL warnings with a CERT_AUTHORITY_INVALID warning. Timing begins when user first focuses on the page. </summary> @@ -38519,7 +38446,7 @@ <owner>felt@chromium.org</owner> <summary> The time between the SSL interstitial display and the user decision, which - may be either accept or deny. This is only recorded for overridable SSL + may be either accept or deny. This is only recorded for overridable SSL warnings with a CERT_COMMON_NAME_INVALID warning. Timing begins when user first focuses on the page. </summary> @@ -38532,8 +38459,8 @@ <owner>felt@chromium.org</owner> <summary> The time between the SSL interstitial display and the user decision, which - may be either accept or deny. This is only recorded for overridable SSL - warnings with a CERT_DATE_INVALID warning. Timing begins when user first + may be either accept or deny. This is only recorded for overridable SSL + warnings with a CERT_DATE_INVALID warning. Timing begins when user first focuses on the page. </summary> </histogram> @@ -38553,7 +38480,7 @@ <owner>felt@chromium.org</owner> <summary> User decision when presented with a security interstitial, on a site that - the user had previously visited. As of M44, subresource interstitials were + the user had previously visited. As of M44, subresource interstitials were split into their own entries. As of M52, social_engineering_ads* and social_engineering_landing* interstitial reasons are split into their own entries from phishing*. @@ -38564,7 +38491,7 @@ enum="SecurityInterstitialInteraction"> <owner>felt@chromium.org</owner> <summary> - User interactions with a security interstitial. As of M44, subresource + User interactions with a security interstitial. As of M44, subresource interstitials were split into their own entries. As of M52, social_engineering_ads* and social_engineering_landing* interstitial reasons are split into their own entries from phishing*. @@ -38803,8 +38730,8 @@ <owner>felt@chromium.org</owner> <summary> The time between the SSL interstitial display and the user decision, when - the user accepts the SSL warning. This is only recorded for overridable SSL - warnings. Timing begins when user first focuses on the page. + the user accepts the SSL warning. This is only recorded for overridable SSL + warnings. Timing begins when user first focuses on the page. </summary> </histogram> @@ -38842,8 +38769,8 @@ <histogram name="interstitial.ssl_error_type" enum="SSLErrorTypes"> <owner>felt@chromium.org</owner> <summary> - The type of SSL error that the user encounters. This is recorded for all - SSL warnings, regardless of whether they are overridable. + The type of SSL error that the user encounters. This is recorded for all SSL + warnings, regardless of whether they are overridable. </summary> </histogram> @@ -38916,8 +38843,8 @@ <owner>felt@chromium.org</owner> <summary> The time between the SSL interstitial display and the user decision, when - the user rejects the SSL warning. This is only recorded for overridable SSL - warnings. Timing begins when user first focuses on the page. + the user rejects the SSL warning. This is only recorded for overridable SSL + warnings. Timing begins when user first focuses on the page. </summary> </histogram> @@ -40097,7 +40024,7 @@ <histogram name="Linux.X11.ServerRTT" units="microseconds"> <owner>thomasanderson@chromium.org</owner> <summary> - RTT between Chrome and the X11 server. Tracked in X11EventSource by + RTT between Chrome and the X11 server. Tracked in X11EventSource by measuring the latency to receive a property event after changing a property. Warning: This metric may include reports from clients with low-resolution @@ -40617,7 +40544,7 @@ enum="WebURLRequestPriority"> <owner>tbansal@chromium.org</owner> <summary> - Original Blink priority of the request that belongs to an iframe. Recorded + Original Blink priority of the request that belongs to an iframe. Recorded for every request fetched via Blink, but only when the experiment to lower the priority of iframes is enabled. </summary> @@ -41452,7 +41379,7 @@ <summary> Reflects how regularly browser issues audio requests to renderer. Depends on how well the system buffer size the browser side renders audio at and the - buffer size it requests from renderer are aligned. When zero, it means + buffer size it requests from renderer are aligned. When zero, it means renderer buffer size is a multiple of system buffer size, and render calls from browser to renderer are issued evenly. When -1, it means the renderer buffer size is larger than system buffer size, but is not an exact multiple @@ -41460,7 +41387,7 @@ positive, floor(value/2) reflects the number of extra consecutive render requests issued by browser to renderer each time to fulfill the system audio render request; if (value/2) is not integer, then plus one more extra call - is issued periodically. The metric is recorded on the edge between browser + is issued periodically. The metric is recorded on the edge between browser and renderer. On Mac the system buffer size may vary dynamically, the metric does not capture that: only the buffer size mismatch introduced by audio output device configuration is captured. @@ -41471,7 +41398,7 @@ <owner>tommi@chromium.org</owner> <summary> The number of frames audio is actually rendered at if the number is - different from the desired number of frames. If the desired frame size is + different from the desired number of frames. If the desired frame size is used, this value will be 0. Typically, Chrome will want to use a 10ms buffer (e.g. 480 frames for a sample rate of 48kHz), but we might have to render audio 256 frames at a time. This histogram gives us an indication as to how @@ -42214,9 +42141,9 @@ <histogram name="Media.AVDA.FrameSentAsOverlay" enum="BooleanFrameAsOverlay"> <owner>liberato@chromium.org</owner> <summary> - Record a count for each frame sent to the client by AVDA. True counts - indicate that the frame was an overlay (SurfaceView). False counts are for - Non Overlay frames. This will be deprecated in favor of + Record a count for each frame sent to the client by AVDA. True counts + indicate that the frame was an overlay (SurfaceView). False counts are for + Non Overlay frames. This will be deprecated in favor of Media.AVDA.FrameInformation in M63. </summary> </histogram> @@ -42239,7 +42166,7 @@ <owner>liberato@chromium.org</owner> <summary> Number of times that AVDA stopped decoding because MediaCodec failed to - provide a FORMAT_CHANGED message before sending decoded frames back. True + provide a FORMAT_CHANGED message before sending decoded frames back. True counts indicate instances where FORMAT_CHANGE was missed, while false instances indicate any MediaCodec initialization by AVDA. </summary> @@ -42263,7 +42190,7 @@ <owner>liberato@chromium.org</owner> <summary> Number of times that AVDA's deferred rendering encountered a virtual GL - context. True counts indicate virtual, false counts indicate not. + context. True counts indicate virtual, false counts indicate not. </summary> </histogram> @@ -42317,7 +42244,7 @@ <owner>mfoltz@chromium.org</owner> <summary> The average number of delayed and dropped frames for the ChromeCast - application. Reported every 5 seconds. + application. Reported every 5 seconds. </summary> </histogram> @@ -42642,8 +42569,8 @@ <owner>sandersd@chromium.org</owner> <summary> This enum measures how often each of the various DXVAVDA PictureBuffer - display mechanisms are used. Each count represents the mechanism selected - at the end of DXVA::Initialize; i.e., there is one count per decoder. + display mechanisms are used. Each count represents the mechanism selected at + the end of DXVA::Initialize; i.e., there is one count per decoder. </summary> </histogram> @@ -43149,7 +43076,7 @@ </obsolete> <owner>halliwell@chromium.org</owner> <summary> - The average number of displayed frames for the Fling application. Reported + The average number of displayed frames for the Fling application. Reported every 5 seconds. </summary> </histogram> @@ -43660,7 +43587,7 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - The audio bit rate as reported by the Netflix application. May be reported + The audio bit rate as reported by the Netflix application. May be reported multiple times as network conditions change during playback. </summary> </histogram> @@ -43684,7 +43611,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> The average number of delayed and dropped frames for the Netflix - application. Reported every 5 seconds. + application. Reported every 5 seconds. </summary> </histogram> @@ -43705,7 +43632,7 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - Video bit rate as reported by the Netflix application. May be reported + Video bit rate as reported by the Netflix application. May be reported multiple times as network conditions change during playback. </summary> </histogram> @@ -43716,7 +43643,7 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - Video height as reported by the Netflix application. May be reported + Video height as reported by the Netflix application. May be reported multiple times as network conditions change during playback. </summary> </histogram> @@ -43802,7 +43729,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> The average number of delayed and dropped frames for the PlayMovies - application. Reported every 5 seconds. + application. Reported every 5 seconds. </summary> </histogram> @@ -45222,7 +45149,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> The average number of delayed and dropped frames for the YouTube - application. Reported every 5 seconds. + application. Reported every 5 seconds. </summary> </histogram> @@ -45770,8 +45697,8 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The private working set used by the browser process. Recorded once per UMA - ping. Note the existence of Memory.Browser.Large, which doesn't have + The private working set used by the browser process. Recorded once per UMA + ping. Note the existence of Memory.Browser.Large, which doesn't have overflow issues. TODO(rkaplow): This should be replaced with Memory.Browser.Large2 in M54. </summary> @@ -45784,7 +45711,7 @@ <owner>bashi@chromium.org</owner> <owner>kouhei@chromium.org</owner> <summary> - The total committed memory used by the browser process. Recorded once per + The total committed memory used by the browser process. Recorded once per UMA ping. </summary> </histogram> @@ -45796,7 +45723,7 @@ </obsolete> <owner>erikchen@chromium.org</owner> <summary> - The private working set used by the browser process. Recorded once per UMA + The private working set used by the browser process. Recorded once per UMA ping. </summary> </histogram> @@ -45808,7 +45735,7 @@ <owner>bashi@chromium.org</owner> <owner>kouhei@chromium.org</owner> <summary> - The private working set used by the browser process. Recorded once per UMA + The private working set used by the browser process. Recorded once per UMA ping. </summary> </histogram> @@ -45854,8 +45781,8 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The private working set used by each chrome:// renderer process. Each - process provides one sample. Recorded once per process per UMA ping. + The private working set used by each chrome:// renderer process. Each + process provides one sample. Recorded once per process per UMA ping. </summary> </histogram> @@ -45867,7 +45794,7 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The count of active chrome:// renderer processes. Recorded once per UMA + The count of active chrome:// renderer processes. Recorded once per UMA ping. </summary> </histogram> @@ -45881,7 +45808,7 @@ <owner>hajimehoshi@chromium.org</owner> <summary> This records the frequency with which JavaScript source strings are - compressed and decompressed in foreground and background tabs. Compressing + compressed and decompressed in foreground and background tabs. Compressing runs 10 seconds after the tab goes background and decompressing runs when JavaScript source string is required (e.g. V8 starts to compile). This measurement is a preparation to introduce CompressibleString class for @@ -46132,9 +46059,9 @@ <owner>erikchen@chromium.org</owner> <summary> The physical footprint of the GPU process on macOS. Other measurements fail - to correctly account for OpenGL memory usage. This metric also has flaws - and is not intended for permanent use. It's an emergency measure added to - help debug https://crbug.com/713854. Recorded once per UMA ping. + to correctly account for OpenGL memory usage. This metric also has flaws and + is not intended for permanent use. It's an emergency measure added to help + debug https://crbug.com/713854. Recorded once per UMA ping. </summary> </histogram> @@ -46441,8 +46368,8 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The private working set used by each extension process. Each process - provides one sample. Recorded once per process per UMA ping. + The private working set used by each extension process. Each process + provides one sample. Recorded once per process per UMA ping. </summary> </histogram> @@ -46468,7 +46395,7 @@ <owner>creis@chromium.org</owner> <owner>nasko@chromium.org</owner> <summary> - The count of active extension processes. Recorded once per UMA ping. + The count of active extension processes. Recorded once per UMA ping. </summary> </histogram> @@ -46501,8 +46428,7 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The private working set used by the GPU process. Recorded once per UMA - ping. + The private working set used by the GPU process. Recorded once per UMA ping. </summary> </histogram> @@ -46539,9 +46465,9 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - System-wide graphics driver memory consumption. Recorded on Chrome OS for + System-wide graphics driver memory consumption. Recorded on Chrome OS for platforms where it is exposed by the kernel (for example, Intel i915 and - Exynos Mali). Recorded once per UMA ping. + Exynos Mali). Recorded once per UMA ping. </summary> </histogram> @@ -46587,8 +46513,8 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The private working set used by each Native Client loader process. Each - process provides one sample. Recorded once per process per UMA ping. + The private working set used by each Native Client loader process. Each + process provides one sample. Recorded once per process per UMA ping. </summary> </histogram> @@ -46600,8 +46526,8 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The private working set used by each Native Client broker process. Each - process provides one sample. Recorded once per process per UMA ping. + The private working set used by each Native Client broker process. Each + process provides one sample. Recorded once per process per UMA ping. </summary> </histogram> @@ -46685,7 +46611,7 @@ <owner>dcastagna@chromium.org</owner> <owner>primiano@chromium.org</owner> <summary> - The total number of open file descriptors opened per process. Recorded once + The total number of open file descriptors opened per process. Recorded once per UMA ping. </summary> </histogram> @@ -46696,7 +46622,7 @@ <owner>dcastagna@chromium.org</owner> <owner>primiano@chromium.org</owner> <summary> - The limit of open file descriptors that can be opened per process. Recorded + The limit of open file descriptors that can be opened per process. Recorded once per UMA ping. </summary> </histogram> @@ -46710,7 +46636,7 @@ <owner>kouhei@chromium.org</owner> <summary> The count of other various utility processes (nacl, gpu, sandbox, zygote, - utility). Recorded once per UMA ping. + utility). Recorded once per UMA ping. </summary> </histogram> @@ -46721,7 +46647,7 @@ <owner>thestig@chromium.org</owner> <summary> The private working set used by each Pepper Flash plugin process. Each - plugin process provides one sample. Recorded once per process per UMA ping. + plugin process provides one sample. Recorded once per process per UMA ping. </summary> </histogram> @@ -46733,8 +46659,8 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The private working set used by each Pepper plugin process. Each plugin - process provides one sample. Recorded once per process per UMA ping. + The private working set used by each Pepper plugin process. Each plugin + process provides one sample. Recorded once per process per UMA ping. </summary> </histogram> @@ -46746,8 +46672,8 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The private working set used by each Pepper plugin broker process. Each - process provides one sample. Recorded once per process per UMA ping. + The private working set used by each Pepper plugin broker process. Each + process provides one sample. Recorded once per process per UMA ping. </summary> </histogram> @@ -46760,7 +46686,7 @@ <owner>kouhei@chromium.org</owner> <summary> The count of Pepper plugin broker processes, recorded once per metrics - services (UMA) update. See MetricsReportingScheduler for details. + services (UMA) update. See MetricsReportingScheduler for details. </summary> </histogram> @@ -46772,7 +46698,7 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The count of active Pepper plugin processes. Recorded once per UMA ping. + The count of active Pepper plugin processes. Recorded once per UMA ping. </summary> </histogram> @@ -46784,8 +46710,8 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The private working set used by each plugin process. Each plugin process - provides one sample. Recorded once per process per UMA ping. + The private working set used by each plugin process. Each plugin process + provides one sample. Recorded once per process per UMA ping. </summary> </histogram> @@ -46797,7 +46723,7 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The count of active plugin processes. Recorded once per UMA ping. + The count of active plugin processes. Recorded once per UMA ping. </summary> </histogram> @@ -46822,7 +46748,7 @@ <owner>creis@chromium.org</owner> <owner>nasko@chromium.org</owner> <summary> - The count of all active processes. Recorded once per UMA ping. + The count of all active processes. Recorded once per UMA ping. </summary> </histogram> @@ -46833,7 +46759,7 @@ <owner>hajimehoshi@chromium.org</owner> <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> - <summary>The current process limit. Recorded once per UMA ping.</summary> + <summary>The current process limit. Recorded once per UMA ping.</summary> </histogram> <histogram name="Memory.Renderer" units="KB"> @@ -46844,9 +46770,9 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The private working set used by each renderer process. Each renderer - process provides one sample. Recorded once per UMA ping. TODO(rkaplow): - This should be replaced with Memory.Renderer.Large2 in M54. + The private working set used by each renderer process. Each renderer process + provides one sample. Recorded once per UMA ping. TODO(rkaplow): This should + be replaced with Memory.Renderer.Large2 in M54. </summary> </histogram> @@ -46857,8 +46783,8 @@ <owner>bashi@chromium.org</owner> <owner>kouhei@chromium.org</owner> <summary> - The total committed memory used by each renderer process. Each renderer - process provides one sample. Recorded once per process per UMA ping. + The total committed memory used by each renderer process. Each renderer + process provides one sample. Recorded once per process per UMA ping. </summary> </histogram> @@ -46866,9 +46792,9 @@ <owner>hajimehoshi@chromium.org</owner> <summary> The esitimated memory size which would be reduced when reusing disk cache is - implemented. If it is 100% sure that the encoded data is in disk cache, the - same data in memory can be dropped to reduce memory usage. This is - rencorded when an ImageResource is pruned. See crbug/664437. + implemented. If it is 100% sure that the encoded data is in disk cache, the + same data in memory can be dropped to reduce memory usage. This is rencorded + when an ImageResource is pruned. See crbug/664437. </summary> </histogram> @@ -46879,8 +46805,8 @@ <owner>bashi@chromium.org</owner> <owner>kouhei@chromium.org</owner> <summary> - The private working set used by each renderer process. Each renderer - process provides one sample. Recorded once per process per UMA ping. + The private working set used by each renderer process. Each renderer process + provides one sample. Recorded once per process per UMA ping. </summary> </histogram> @@ -46913,8 +46839,8 @@ <summary> The private working set used by each renderer process, including all renderer types, i.e. this includes Chrome renderer, extensions renderer, as - well as regular renderer processes. Each renderer process provides one - sample. Recorded once per process per UMA ping. + well as regular renderer processes. Each renderer process provides one + sample. Recorded once per process per UMA ping. </summary> </histogram> @@ -46929,8 +46855,8 @@ <summary> The total committed memory used by each renderer process, including all renderer types, i.e. this includes Chrome renderer, extensions renderer, as - well as regular renderer processes. Each renderer process provides one - sample. Recorded once per process per UMA ping. + well as regular renderer processes. Each renderer process provides one + sample. Recorded once per process per UMA ping. </summary> </histogram> @@ -46943,13 +46869,13 @@ <owner>kouhei@chromium.org</owner> <summary> Growth speed of the private working set used by each renderer process per 30 - minutes. The usage and growth speed is recorded at most every 30 minutes, - not every exact 30 minutes. If the interval is longer than 30 minutes, it - is normalized to a speed KB per 30 minutes. Each renderer process provides - one sample. Recorded once per UMA log unless this is the first time the UMA - log is recorded after startup of the renderer, 30 minutes have not passed - from the last recording of the renderer or the usage goes down. If the usage - goes down, the amount of the shrink will be recorded in the + minutes. The usage and growth speed is recorded at most every 30 minutes, + not every exact 30 minutes. If the interval is longer than 30 minutes, it is + normalized to a speed KB per 30 minutes. Each renderer process provides one + sample. Recorded once per UMA log unless this is the first time the UMA log + is recorded after startup of the renderer, 30 minutes have not passed from + the last recording of the renderer or the usage goes down. If the usage goes + down, the amount of the shrink will be recorded in the Memory.RendererShrinkIn30Min histogram. </summary> </histogram> @@ -46958,8 +46884,8 @@ <owner>creis@chromium.org</owner> <owner>nasko@chromium.org</owner> <summary> - The count of active renderer processes. Recorded once per UMA ping. - Excludes renderers hosting chrome-extension:// and/or chrome:// URLs. + The count of active renderer processes. Recorded once per UMA ping. Excludes + renderers hosting chrome-extension:// and/or chrome:// URLs. Computed based on OS data. @@ -46977,13 +46903,13 @@ <owner>kouhei@chromium.org</owner> <summary> Shrink speed of the private working set used by each renderer process per 30 - minutes. The usage and shrink speed is recorded at most every 30 minutes, - not every exact 30 minutes. If the interval is longer than 30 minutes, it - is normalized to a speed KB per 30 minutes. Each renderer process provides - one sample. Recorded once per UMA log unless this is the first time the UMA - log is recorded after startup of the renderer, 30 minutes have not passed - from the last recording of the renderer or the usage goes up. If the usage - goes up, the amount of the growth will be recorded in the + minutes. The usage and shrink speed is recorded at most every 30 minutes, + not every exact 30 minutes. If the interval is longer than 30 minutes, it is + normalized to a speed KB per 30 minutes. Each renderer process provides one + sample. Recorded once per UMA log unless this is the first time the UMA log + is recorded after startup of the renderer, 30 minutes have not passed from + the last recording of the renderer or the usage goes up. If the usage goes + up, the amount of the growth will be recorded in the Memory.RendererGrowthIn30Min histogram. </summary> </histogram> @@ -46994,7 +46920,7 @@ <owner>lukasza@chromium.org</owner> <owner>nasko@chromium.org</owner> <summary> - The count of all renderer processes. Recorded once per UMA ping. Covers all + The count of all renderer processes. Recorded once per UMA ping. Covers all renderer processes, including ones hosting web content (i.e. http(s):// and/or file://), extensions (i.e. chrome-extension://) and WebUI (i.e. chrome://). @@ -47012,7 +46938,7 @@ <owner>lukasza@chromium.org</owner> <owner>nasko@chromium.org</owner> <summary> - The count of active renderer processes. Recorded once per UMA ping. Covers + The count of active renderer processes. Recorded once per UMA ping. Covers all renderer processes, including ones hosting web content (i.e. http(s):// and/or file://), extensions (i.e. chrome-extension://) and WebUI (i.e. chrome://). @@ -47030,8 +46956,8 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The private working set used by each sandbox helper process. Each sandbox - helper process provides one sample. Recorded once per process per UMA ping. + The private working set used by each sandbox helper process. Each sandbox + helper process provides one sample. Recorded once per process per UMA ping. </summary> </histogram> @@ -47190,7 +47116,7 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The swap used by the browser process. Recorded once per UMA ping if the + The swap used by the browser process. Recorded once per UMA ping if the system has swapped. </summary> </histogram> @@ -47203,8 +47129,8 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The swap used by each chrome:// renderer process. Each process provides one - sample. Recorded once per process per UMA ping if the system has swapped. + The swap used by each chrome:// renderer process. Each process provides one + sample. Recorded once per process per UMA ping if the system has swapped. </summary> </histogram> @@ -47242,7 +47168,7 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The swap used by each extension process. Each process provides one sample. + The swap used by each extension process. Each process provides one sample. Recorded once per process per UMA ping if the system has swapped. </summary> </histogram> @@ -47255,7 +47181,7 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The swap used by the GPU process. Recorded once per UMA ping if the system + The swap used by the GPU process. Recorded once per UMA ping if the system has swapped. </summary> </histogram> @@ -47281,7 +47207,7 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The amount of memory that is used by swap, including bookkeeping. Recorded + The amount of memory that is used by swap, including bookkeeping. Recorded once per UMA ping if the system has swapped. </summary> </histogram> @@ -47294,8 +47220,8 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The swap used by each Native Client loader process. Each process provides - one sample. Recorded once per process per UMA ping if the system has + The swap used by each Native Client loader process. Each process provides + one sample. Recorded once per process per UMA ping if the system has swapped. </summary> </histogram> @@ -47308,8 +47234,8 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The swap used by each Native Client broker process. Each process provides - one sample. Recorded once per process per UMA ping if the system has + The swap used by each Native Client broker process. Each process provides + one sample. Recorded once per process per UMA ping if the system has swapped. </summary> </histogram> @@ -47322,7 +47248,7 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The number of reads from swap. Recorded once per UMA ping if the system has + The number of reads from swap. Recorded once per UMA ping if the system has swapped. </summary> </histogram> @@ -47335,7 +47261,7 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The number of writes to swap. Recorded once per UMA ping if the system has + The number of writes to swap. Recorded once per UMA ping if the system has swapped. </summary> </histogram> @@ -47348,8 +47274,8 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The amount of memory that was swapped out. Recorded once per UMA ping if - the system has swapped. + The amount of memory that was swapped out. Recorded once per UMA ping if the + system has swapped. </summary> </histogram> @@ -47361,8 +47287,8 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The swap used by each Pepper plugin process. Each plugin process provides - one sample. Recorded once per process per UMA ping if the system has + The swap used by each Pepper plugin process. Each plugin process provides + one sample. Recorded once per process per UMA ping if the system has swapped. </summary> </histogram> @@ -47375,8 +47301,8 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The swap used by each Pepper plugin broker process. Each process provides - one sample. Recorded once per process per UMA ping if the system has + The swap used by each Pepper plugin broker process. Each process provides + one sample. Recorded once per process per UMA ping if the system has swapped. </summary> </histogram> @@ -47389,8 +47315,8 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The swap used by each plugin process. Each plugin process provides one - sample. Recorded once per process per UMA ping if the system has swapped. + The swap used by each plugin process. Each plugin process provides one + sample. Recorded once per process per UMA ping if the system has swapped. </summary> </histogram> @@ -47402,8 +47328,8 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The swap used by each renderer process. Each renderer process provides one - sample. Recorded once per process per UMA ping if the system has swapped. + The swap used by each renderer process. Each renderer process provides one + sample. Recorded once per process per UMA ping if the system has swapped. </summary> </histogram> @@ -47415,8 +47341,8 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The swap used by each sandbox helper process. Each sandbox helper process - provides one sample. Recorded once per process per UMA ping if the system + The swap used by each sandbox helper process. Each sandbox helper process + provides one sample. Recorded once per process per UMA ping if the system has swapped. </summary> </histogram> @@ -47457,8 +47383,8 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The swap used by each utility process. Each utility process provides one - sample. Recorded once per process per UMA ping if the system has swapped. + The swap used by each utility process. Each utility process provides one + sample. Recorded once per process per UMA ping if the system has swapped. </summary> </histogram> @@ -47467,8 +47393,8 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The swap used by each worker process. Each worker process provides one - sample. Recorded once per process per UMA ping if the system has swapped. + The swap used by each worker process. Each worker process provides one + sample. Recorded once per process per UMA ping if the system has swapped. </summary> </histogram> @@ -47480,7 +47406,7 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The swap used by the zygote process. Recorded once per UMA ping if the + The swap used by the zygote process. Recorded once per UMA ping if the system has swapped. </summary> </histogram> @@ -47547,8 +47473,8 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The private working set used by each utility process. Each utility process - provides one sample. Recorded once per process per UMA ping. + The private working set used by each utility process. Each utility process + provides one sample. Recorded once per process per UMA ping. </summary> </histogram> @@ -47581,8 +47507,8 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The private working set used by each worker process. Each worker process - provides one sample. Recorded once per process per UMA ping. + The private working set used by each worker process. Each worker process + provides one sample. Recorded once per process per UMA ping. </summary> </histogram> @@ -47594,7 +47520,7 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The count of active worker processes. Recorded once per UMA ping. + The count of active worker processes. Recorded once per UMA ping. </summary> </histogram> @@ -47606,8 +47532,8 @@ <owner>kenjibaheux@google.com</owner> <owner>kouhei@chromium.org</owner> <summary> - The private working set used by the zygote process. Each zygote process - provides one sample. Recorded once per process per UMA ping. + The private working set used by the zygote process. Each zygote process + provides one sample. Recorded once per process per UMA ping. </summary> </histogram> @@ -47840,7 +47766,7 @@ <owner>dtrainor@chromium.org</owner> <summary> Android: Represents the type of notification that was last shown before the - user disabled notification permissions on Chrome. This is only logged the + user disabled notification permissions on Chrome. This is only logged the first time we attempt to show a notification and fail. </summary> </histogram> @@ -48000,7 +47926,7 @@ <owner>dtrainor@chromium.org</owner> <summary> Android: Records the situation where we try to fix a standalone downloads - summary notification, which shouldn't be visible to the user. True if the + summary notification, which shouldn't be visible to the user. True if the notification was a foreground notification, in which case we can't dismiss it and need to attempt a more drastic workaround. False if it was a normal notification and we can dismiss it easily (this is okay and expected @@ -48032,7 +47958,7 @@ <owner>justincohen@chromium.org</owner> <summary> iOS: Records the status of the privacy page after user taps on the privacy - link on the first run welcome view. This metric is only recorded if and + link on the first run welcome view. This metric is only recorded if and after the TOS are accepted. This metric is specific to iOS. </summary> </histogram> @@ -48042,8 +47968,8 @@ <summary> Android: Records which states of the "first run experience" have been reached. Each bucket represents a state and recorded everytime the - state changed. Pages can be double counted if the user goes backwards in - the flow. + state changed. Pages can be double counted if the user goes backwards in the + flow. </summary> </histogram> @@ -48264,7 +48190,7 @@ <owner>dtrainor@chromium.org</owner> <summary> Android: Number of instances of Chrome currently open during a MultiWindow - session. Emitted every time Chrome is paused. Only emitted on Android + session. Emitted every time Chrome is paused. Only emitted on Android MultiWindow devices. A MultiWindow session is any period of time that Chrome was not used in a @@ -48648,7 +48574,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> For each click handled by an HTML anchor tag link, whether Blink saw a - mousedown event preceding it. This is only measured for clicks handled by + mousedown event preceding it. This is only measured for clicks handled by the anchor tag's default click event handler. </summary> </histogram> @@ -49351,7 +49277,7 @@ <owner>bradnelson@chromium.org</owner> <summary> The size of the main .nexe file that is the result of translating a Portable - Native Client .pexe bitcode file. This reflects the amount of cache + Native Client .pexe bitcode file. This reflects the amount of cache consumed. </summary> </histogram> @@ -49370,7 +49296,7 @@ <owner>sehr@chromium.org</owner> <owner>bradnelson@chromium.org</owner> <summary> - The time it took to load the NaCl module into sel_ldr. Normalized by the + The time it took to load the NaCl module into sel_ldr. Normalized by the size of the .nexe, in megabytes. </summary> </histogram> @@ -49404,7 +49330,7 @@ <summary> The time it took between the Native Client plugin initialization and when proxied execution of the NaCl module begins. This is the general startup - overhead of running as a NaCl module vs a trusted PPAPI plugin. Normalized + overhead of running as a NaCl module vs a trusted PPAPI plugin. Normalized by the size of the .nexe, in megabytes. </summary> </histogram> @@ -49445,8 +49371,8 @@ <owner>bradnelson@chromium.org</owner> <summary> The time it took between the Native Client plugin initialization and when - the NaCl module is ready to be used. Normalized by the size of the .nexe, - in megabytes. + the NaCl module is ready to be used. Normalized by the size of the .nexe, in + megabytes. </summary> </histogram> @@ -50106,7 +50032,7 @@ before the NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50122,7 +50048,7 @@ before the NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50154,7 +50080,7 @@ connection, before the NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50170,7 +50096,7 @@ connection, before the NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50187,7 +50113,7 @@ NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50203,7 +50129,7 @@ type, before the NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50219,7 +50145,7 @@ before the NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50235,7 +50161,7 @@ data. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50251,7 +50177,7 @@ data. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50267,7 +50193,7 @@ data. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50283,7 +50209,7 @@ network data. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50299,7 +50225,7 @@ network data. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50314,7 +50240,7 @@ Time between disconnecting and receiving the first network data. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50330,7 +50256,7 @@ network data. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50346,7 +50272,7 @@ data. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50362,7 +50288,7 @@ NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50378,7 +50304,7 @@ NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50394,7 +50320,7 @@ NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50410,7 +50336,7 @@ before the NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50426,7 +50352,7 @@ before the NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50443,7 +50369,7 @@ connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50459,7 +50385,7 @@ before the NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50475,7 +50401,7 @@ the NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50491,7 +50417,7 @@ NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50507,7 +50433,7 @@ NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50523,7 +50449,7 @@ NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50539,7 +50465,7 @@ NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50555,7 +50481,7 @@ NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50572,7 +50498,7 @@ detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50588,7 +50514,7 @@ the NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50604,7 +50530,7 @@ NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50620,7 +50546,7 @@ NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50636,7 +50562,7 @@ NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50652,7 +50578,7 @@ NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50668,7 +50594,7 @@ NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50684,7 +50610,7 @@ NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50700,7 +50626,7 @@ connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50716,7 +50642,7 @@ NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -50732,7 +50658,7 @@ NetworkChangeNotifier detected a connectivity change. This metric is recorded when the NetworkChangeNotifier detects a - connectivity change. This will miss data from users whose connection type + connectivity change. This will miss data from users whose connection type never changes and will be biased to users whose connection type changes frequently. </summary> @@ -51060,7 +50986,7 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - The count of unacknowledged ResourceMsg_DataReceived messages. This message + The count of unacknowledged ResourceMsg_DataReceived messages. This message is sent once per chunk of data read from the network. </summary> </histogram> @@ -51855,7 +51781,7 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - The amount of time taken before we failed to resolve the Comodo test DNS + The amount of time taken before we failed to resolve the Comodo test DNS record. This is an experiment, run in conjuction with Comodo, to test the viability of a DNS based certificate revocation mechanism. </summary> @@ -51904,7 +51830,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> The uncompressed number of bytes received per request that was not - compressed but appears to have been compressible. Only includes requests + compressed but appears to have been compressible. Only includes requests which did not go through an explicit proxy and did not go over SSL. </summary> </histogram> @@ -51938,7 +51864,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> The uncompressed number of bytes received per request that was not - compressed but appears to have been compressible. Only includes requests + compressed but appears to have been compressible. Only includes requests sent through a proxy without SSL. </summary> </histogram> @@ -51972,7 +51898,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> The uncompressed number of bytes received per request that was not - compressed but appears to have been compressible. Only includes requests + compressed but appears to have been compressible. Only includes requests sent over SSL. </summary> </histogram> @@ -51980,7 +51906,7 @@ <histogram name="Net.ConnectionInfo.MainFrame" enum="ConnectionInfo"> <owner>bnc@chromium.org</owner> <summary> - Application protocol used for main frame resources. Logged by the renderer + Application protocol used for main frame resources. Logged by the renderer only for request that accessed the network and have received response headers. </summary> @@ -51990,7 +51916,7 @@ <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 + frame). Logged by the renderer only for request that accessed the network and have received response headers. </summary> </histogram> @@ -52081,7 +52007,7 @@ <owner>agl@chromium.org</owner> <summary> Nonzero if the HTTP request was to a server which requires SSL version - fallback. The value indicates the SSL version the request fell back on. + fallback. The value indicates the SSL version the request fell back on. </summary> </histogram> @@ -52126,7 +52052,7 @@ <histogram name="net.CookieBackingStoreUpdateResults" enum="BackingStoreResults"> <obsolete> - Initial typo; only here to get results from builds before r59117. See + Initial typo; only here to get results from builds before r59117. See "Cookie." group. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> @@ -52138,7 +52064,7 @@ <histogram name="net.CookieBetweenAccessIntervalMinutes" units="minutes"> <obsolete> - Initial typo; only here to get results from builds before r59117. See + Initial typo; only here to get results from builds before r59117. See "Cookie." group. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> @@ -52147,7 +52073,7 @@ <histogram name="net.CookieCount"> <obsolete> - Initial typo; only here to get results from builds before r59117. See + Initial typo; only here to get results from builds before r59117. See "Cookie." group. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> @@ -52159,7 +52085,7 @@ <histogram name="net.CookieDeletionCause" enum="CookieDeletionCause"> <obsolete> - Initial typo; only here to get results from builds before r59117. See + Initial typo; only here to get results from builds before r59117. See "Cookie." group. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> @@ -52170,7 +52096,7 @@ <histogram name="net.CookieDomainCount"> <obsolete> - Initial typo; only here to get results from builds before r59117. See + Initial typo; only here to get results from builds before r59117. See "Cookie." group. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> @@ -52193,7 +52119,7 @@ <histogram name="net.CookieEtldp1Count"> <obsolete> - Initial typo; only here to get results from builds before r59117. See + Initial typo; only here to get results from builds before r59117. See "Cookie." group. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> @@ -52205,7 +52131,7 @@ <histogram name="net.CookieEvictedLastAccessMinutes" units="minutes"> <obsolete> - Initial typo; only here to get results from builds before r59117. See + Initial typo; only here to get results from builds before r59117. See "Cookie." group. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> @@ -52217,7 +52143,7 @@ <histogram name="net.CookieExpirationDurationMinutes" units="minutes"> <obsolete> - Initial typo; only here to get results from builds before r59117. See + Initial typo; only here to get results from builds before r59117. See "Cookie." group. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> @@ -52226,7 +52152,7 @@ <histogram name="net.CookieTimeGet"> <obsolete> - Initial typo; only here to get results from builds before r59117. See + Initial typo; only here to get results from builds before r59117. See "Cookie." group. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> @@ -52237,7 +52163,7 @@ <histogram name="net.CookieTimeLoad"> <obsolete> - Initial typo; only here to get results from builds before r59117. See + Initial typo; only here to get results from builds before r59117. See "Cookie." group. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> @@ -52421,7 +52347,7 @@ <owner>bolian@chromium.org</owner> <summary> The total content size in KB of all long-bypassed HTTP response bodies in - the previous calendar day while the data reduction proxy setting was + the previous calendar day while the data reduction proxy setting was enabled. The metric is reported when the first response in the current day is received. </summary> @@ -53115,11 +53041,11 @@ <histogram name="Net.DownloadBandwidth"> <obsolete> - Deprecated as of 03/2015. No longer generated. + Deprecated as of 03/2015. No longer generated. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - Kbps on download streams exceeding 25KB. Measures from the beginning of the + Kbps on download streams exceeding 25KB. Measures from the beginning of the first byte received until the end of flowing data. </summary> </histogram> @@ -53195,7 +53121,7 @@ <owner>mmenke@chromium.org</owner> <summary> Positive net error codes that requests for pages end with, including net::OK - and net::ERR_ABORTED. This only counts loads in "main frames" for + and net::ERR_ABORTED. This only counts loads in "main frames" for https://www.google.com. Subresources or main frame navigations to other origins are not included. </summary> @@ -53205,7 +53131,7 @@ <owner>mmenke@chromium.org</owner> <summary> Positive net error codes that requests for pages end with, including net::OK - and net::ERR_ABORTED. This only counts loads in "main frames" for + and net::ERR_ABORTED. This only counts loads in "main frames" for https://www.google.com (it does not for example count the error codes for subresoures on a page). It excludes main frame navigations that are converted to downloads (unless they fail / are aborted before it's known @@ -53273,7 +53199,7 @@ <owner>mmenke@chromium.org</owner> <summary> Positive net error codes that requests for pages end with, including net::OK - and net::ERR_ABORTED. This only counts loads in "main frames" (it + and net::ERR_ABORTED. This only counts loads in "main frames" (it does not for example count the error codes for subresoures on a page). </summary> </histogram> @@ -53282,7 +53208,7 @@ <owner>mmenke@chromium.org</owner> <summary> Positive net error codes that requests for pages end with, including net::OK - and net::ERR_ABORTED. This only counts loads in "main frames" (it + and net::ERR_ABORTED. This only counts loads in "main frames" (it does not for example count the error codes for subresoures on a page). It excludes main frame navigations that are converted to downloads (unless they fail / are aborted before it's known that they would be a download), and @@ -53332,7 +53258,7 @@ <owner>svaldez@chromium.org</owner> <summary> Positive net error codes that requests for pages end with, including net::OK - and net::ERR_ABORTED. This only counts loads in "main frames" for + and net::ERR_ABORTED. This only counts loads in "main frames" for endpoints used in the initial TLS 1.3 deployment. Subresources or main frame navigations to other origins are not included. </summary> @@ -53343,7 +53269,7 @@ <owner>svaldez@chromium.org</owner> <summary> Positive net error codes that requests for pages end with, including net::OK - and net::ERR_ABORTED. This only counts loads in "main frames" for + and net::ERR_ABORTED. This only counts loads in "main frames" for endpoints used in the initial TLS 1.3 deployment. Subresources or main frame navigations to other origins are not included. </summary> @@ -53356,7 +53282,7 @@ </obsolete> <owner>mmenke@chromium.org</owner> <summary> - Temporary histogram to investigate http://crbug.com/500556. Records which + Temporary histogram to investigate http://crbug.com/500556. Records which button on the network error page was pushed when either the URL Blink reports for the page is not the internal error page URL or the NetErrorHelper core has no error information for the current page (or both). @@ -53370,11 +53296,11 @@ </obsolete> <owner>mmenke@chromium.org</owner> <summary> - Temporary histogram to investigate http://crbug.com/500556. Records - whether, when the handler for a button press on the network error page runs, - which of the following are or are not true: The URL Blink reports for the - page is not the internal error page URL or the NetErrorHelper core has no - error information for the current page. + Temporary histogram to investigate http://crbug.com/500556. Records whether, + when the handler for a button press on the network error page runs, which of + the following are or are not true: The URL Blink reports for the page is not + the internal error page URL or the NetErrorHelper core has no error + information for the current page. </summary> </histogram> @@ -53433,7 +53359,7 @@ <owner>mmenke@chromium.org</owner> <summary> The number of main frame 4xx/5xx responses that have content, to determine - if it's worth hooking up an error page for those that don't. Intended to be + if it's worth hooking up an error page for those that don't. Intended to be removed from the binary soon. </summary> </histogram> @@ -53506,7 +53432,7 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - System error code that a file Flush failed with. The code is OS dependent, + System error code that a file Flush failed with. The code is OS dependent, so when looking at the histogram don't mix OSes. </summary> </histogram> @@ -53517,8 +53443,8 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - System error code that a file GetSize failed with. The code is OS - dependent, so when looking at the histogram don't mix OSes. + System error code that a file GetSize failed with. The code is OS dependent, + so when looking at the histogram don't mix OSes. </summary> </histogram> @@ -53528,8 +53454,8 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - System error code that a file Open failed with. The code is OS dependent, - so when looking at the histogram don't mix OSes. + System error code that a file Open failed with. The code is OS dependent, so + when looking at the histogram don't mix OSes. </summary> </histogram> @@ -53539,8 +53465,8 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - System error code that a file Read failed with. The code is OS dependent, - so when looking at the histogram don't mix OSes. + System error code that a file Read failed with. The code is OS dependent, so + when looking at the histogram don't mix OSes. </summary> </histogram> @@ -53550,8 +53476,8 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - System error code that a file Seek failed with. The code is OS dependent, - so when looking at the histogram don't mix OSes. + System error code that a file Seek failed with. The code is OS dependent, so + when looking at the histogram don't mix OSes. </summary> </histogram> @@ -53561,7 +53487,7 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - System error code that a file SetEof failed with. The code is OS dependent, + System error code that a file SetEof failed with. The code is OS dependent, so when looking at the histogram don't mix OSes. </summary> </histogram> @@ -53572,7 +53498,7 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - System error code that a file Write failed with. The code is OS dependent, + System error code that a file Write failed with. The code is OS dependent, so when looking at the histogram don't mix OSes. </summary> </histogram> @@ -53583,10 +53509,10 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - System error code range that a file Flush failed with. Any value other than + System error code range that a file Flush failed with. Any value other than 0 indicates that we have received errors in a range outside of the one in - which we recorded the specific errors in Net.FileError_Flush. The code is - OS dependent, so when looking at the histogram don't mix OSes. + which we recorded the specific errors in Net.FileError_Flush. The code is OS + dependent, so when looking at the histogram don't mix OSes. </summary> </histogram> @@ -53596,9 +53522,9 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - System error code range that a file GetSize failed with. Any value other + System error code range that a file GetSize failed with. Any value other than 0 indicates that we have received errors in a range outside of the one - in which we recorded the specific errors in Net.FileError_GetSize. The code + in which we recorded the specific errors in Net.FileError_GetSize. The code is OS dependent, so when looking at the histogram don't mix OSes. </summary> </histogram> @@ -53609,9 +53535,9 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - System error code range that a file Open failed with. Any value other than - 0 indicates that we have received errors in a range outside of the one in - which we recorded the specific errors in Net.FileError_Open. The code is OS + System error code range that a file Open failed with. Any value other than 0 + indicates that we have received errors in a range outside of the one in + which we recorded the specific errors in Net.FileError_Open. The code is OS dependent, so when looking at the histogram don't mix OSes. </summary> </histogram> @@ -53622,9 +53548,9 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - System error code range that a file Read failed with. Any value other than - 0 indicates that we have received errors in a range outside of the one in - which we recorded the specific errors in Net.FileError_Read. The code is OS + System error code range that a file Read failed with. Any value other than 0 + indicates that we have received errors in a range outside of the one in + which we recorded the specific errors in Net.FileError_Read. The code is OS dependent, so when looking at the histogram don't mix OSes. </summary> </histogram> @@ -53635,9 +53561,9 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - System error code range that a file Seek failed with. Any value other than - 0 indicates that we have received errors in a range outside of the one in - which we recorded the specific errors in Net.FileError_Seek. The code is OS + System error code range that a file Seek failed with. Any value other than 0 + indicates that we have received errors in a range outside of the one in + which we recorded the specific errors in Net.FileError_Seek. The code is OS dependent, so when looking at the histogram don't mix OSes. </summary> </histogram> @@ -53648,10 +53574,10 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - System error code range that a file SetEof failed with. Any value other - than 0 indicates that we have received errors in a range outside of the one - in which we recorded the specific errors in Net.FileError_SetEof. The code - is OS dependent, so when looking at the histogram don't mix OSes. + System error code range that a file SetEof failed with. Any value other than + 0 indicates that we have received errors in a range outside of the one in + which we recorded the specific errors in Net.FileError_SetEof. The code is + OS dependent, so when looking at the histogram don't mix OSes. </summary> </histogram> @@ -53661,10 +53587,10 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - System error code range that a file Write failed with. Any value other than + System error code range that a file Write failed with. Any value other than 0 indicates that we have received errors in a range outside of the one in - which we recorded the specific errors in Net.FileError_Write. The code is - OS dependent, so when looking at the histogram don't mix OSes. + which we recorded the specific errors in Net.FileError_Write. The code is OS + dependent, so when looking at the histogram don't mix OSes. </summary> </histogram> @@ -53675,7 +53601,7 @@ <owner>bnc@chromium.org</owner> <summary> Track usage of alternative services forced by the force-alt-protocols - command line flag. Triggered each time alternative services are queried for + command line flag. Triggered each time alternative services are queried for a given origin and the command line flag would make a difference (that is, there is no advertised alternative service for that origin). </summary> @@ -54071,7 +53997,7 @@ <owner>mmenke@chromium.org</owner> <summary> Records the frequency with which a number of hacky HTTP header parsing rules - are invoked. This histogram should be removed after we have enough data to + are invoked. This histogram should be removed after we have enough data to know if we can remove the hacks. </summary> </histogram> @@ -54240,8 +54166,8 @@ </obsolete> <owner>bnc@chromium.org</owner> <summary> - Application protocol used in HTTP response. Recorded every time a - URLRequest completes. + Application protocol used in HTTP response. Recorded every time a URLRequest + completes. </summary> </histogram> @@ -54265,7 +54191,7 @@ <owner>mmenke@chromium.org</owner> <summary> Application protocol used in HTTP responses to requests for resources other - than main frames. Does not include internal Chrome requests. Only includes + than main frames. Does not include internal Chrome requests. Only includes requests that went over the network. </summary> </histogram> @@ -54381,7 +54307,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> The count of handleable socket errors (connection abort/close/reset) per - socket reuse type. Socket late binding is disabled. + socket reuse type. Socket late binding is disabled. </summary> </histogram> @@ -54393,7 +54319,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> The count of handleable socket errors (connection abort/close/reset) per - socket reuse type. Socket late binding is enabled. + socket reuse type. Socket late binding is enabled. </summary> </histogram> @@ -54781,7 +54707,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> How often automatically retrying to download a subresource in response to - specific HTTP network errors returns another network error. Histogram + specific HTTP network errors returns another network error. Histogram includes only the error code that triggered the retry. </summary> </histogram> @@ -54980,12 +54906,12 @@ Currently, the most common (only?) motivations are SELF_REFERAL, LEARNED_REFERAL and OMNIBOX. The SELF_REFERAL indicates that we made sure a second connection was available for a resource that either was never before - seen, or has historically had no subresources. The LEARNED_REFERAL - indicates that we "learned" that a subresource was commonly - needed, and that motivated the TCP/IP preconnect. The OMNIBOX motivation - happens when a search is being suggested, and we preconnect to the search - provider. (WARNING: Prior to version 7.517.*, enums 7, 8, and 9 may be - confused, as EARLY_LOAD_MOTIVATED was inserted new 6 value.) + seen, or has historically had no subresources. The LEARNED_REFERAL indicates + that we "learned" that a subresource was commonly needed, and that + motivated the TCP/IP preconnect. The OMNIBOX motivation happens when a + search is being suggested, and we preconnect to the search provider. + (WARNING: Prior to version 7.517.*, enums 7, 8, and 9 may be confused, as + EARLY_LOAD_MOTIVATED was inserted new 6 value.) </details> </histogram> @@ -55139,7 +55065,7 @@ <histogram name="Net.Prefetch.PrefilterBytesReadFromNetwork" units="bytes"> <owner>jkarlin@chromium.org</owner> <summary> - Number of bytes read from the network on behalf of prefetch requests. This + Number of bytes read from the network on behalf of prefetch requests. This is prefilter, so before any decompression. </summary> <details> @@ -55208,7 +55134,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Time from the start of the http transaction until the first byte of the - response for high priority (currently frame and subframe) requests. Only + response for high priority (currently frame and subframe) requests. Only times under 10 minutes are recorded. </summary> </histogram> @@ -55231,8 +55157,8 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Time from the start of the http transaction until the first byte of the - response for low priority (non-frame/subframe) requests. Only times under - 10 minutes are recorded. + response for low priority (non-frame/subframe) requests. Only times under 10 + minutes are recorded. </summary> </histogram> @@ -55517,8 +55443,8 @@ <summary> The time taken from requesting a PAC script to receiving the first byte of the response body on successful fetches. This does not include time spent - doing proxy auto-discovery, or failed attempts at retrieving PAC scripts. - If the response body was empty, this measures the total time to fetch the + doing proxy auto-discovery, or failed attempts at retrieving PAC scripts. If + the response body was empty, this measures the total time to fetch the (empty) response body. </summary> </histogram> @@ -55838,7 +55764,7 @@ <owner>ckrasic@chromium.org</owner> <summary> For each indexed representation decoded, records the time since the - corresponding entry was added to the dynamic table. This data is being + corresponding entry was added to the dynamic table. This data is being collected to help analyze a proposed solution to HPACK induced head of line blocking. </summary> @@ -55856,7 +55782,7 @@ <owner>ckrasic@chromium.org</owner> <summary> For each indexed representation encoded, records the time since the - corresponding entry was added to the dynamic table. This data is being + corresponding entry was added to the dynamic table. This data is being collected to help analyze a proposed solution to HPACK induced head of line blocking. </summary> @@ -56038,14 +55964,14 @@ <summary> This histogram summarizes information about a 21 packet sequence, indicating for each of the 21 possible prefixes of this pattern, how many packets were - received in that prefix. The first range uses buckets 0 and 1, and it - describes the 1st packet in the sequence. It indicates if the first packet - was missing (bucket 0), or the first packet was present (bucket 1). The + received in that prefix. The first range uses buckets 0 and 1, and it + describes the 1st packet in the sequence. It indicates if the first packet + was missing (bucket 0), or the first packet was present (bucket 1). The second range uses buckets 2 through 4, and describes the first 2 packets in - the prefix of this sequence. It indicates if there were no packets received + the prefix of this sequence. It indicates if there were no packets received in the first two packets (bucket 2), or there was one out of two packets received (bucket 3), or if there was two out of tow received (bucket 4). - etc. etc. Reading this histogram may require post-processing in a spread + etc. etc. Reading this histogram may require post-processing in a spread sheet, but can indicate the potential value of using FEC packets to convey data. </summary> @@ -56059,8 +55985,8 @@ <owner>rch@chromium.org</owner> <summary> Each of the 64 buckets represents a different binary pattern of 6 - consecutive packets that were received by the client. The LSB of the bucket - number corresponds to the reception of the oldest packet. A bit in the + consecutive packets that were received by the client. The LSB of the bucket + number corresponds to the reception of the oldest packet. A bit in the bucket-number being 1 indicates the packet was received, and a 0 means the packet was never received (by the client). </summary> @@ -56146,7 +56072,7 @@ expires_after="2018-08-30"> <owner>rch@chromium.org</owner> <summary> - True if the QUIC session is closed during the call to InitializeSession, + True if the QUIC session is closed during the call to InitializeSession, logged for each session just after InitializeSession is called. </summary> </histogram> @@ -56515,7 +56441,7 @@ <histogram name="Net.QuicSession.MtuProbesSent" expires_after="2018-08-30"> <owner>rch@chromium.org</owner> <summary> - The number of MTU probes sent by the client during the session. Logged when + The number of MTU probes sent by the client during the session. Logged when the connection is destroyed. </summary> </histogram> @@ -56532,7 +56458,7 @@ <owner>ckrasic@chromium.org</owner> <summary> The number of pending stream requests when a new stream request is added to - the pending list. Pending streams are those which could not be created + the pending list. Pending streams are those which could not be created immediately because there were too many active streams. </summary> </histogram> @@ -56618,7 +56544,7 @@ <owner>rch@chromium.org</owner> <summary> The ratio of the number of missing packets, to the maximum packet sequence - number received, for QUIC connections longer than 21 packets received via + number received, for QUIC connections longer than 21 packets received via </summary> </histogram> @@ -56638,8 +56564,8 @@ <histogram name="Net.QuicSession.PacketRetransmitsPerMille" units="permille"> <owner>ckrasic@chromium.org</owner> <summary> - The number of packets retransmitted per 1000. Only sessions with - packets_sent >= 100 are included. Recorded in session destructor. + The number of packets retransmitted per 1000. Only sessions with + packets_sent >= 100 are included. Recorded in session destructor. </summary> </histogram> @@ -57870,8 +57796,8 @@ units="count"> <owner>bnc@chromium.org</owner> <summary> - Status of checking if a SPDY domain can handle a IP match. If a match is - found, we successfully used the IP Pooling. If a match is not found, we + Status of checking if a SPDY domain can handle a IP match. If a match is + found, we successfully used the IP Pooling. If a match is not found, we could have used IP Pooling, except the TLS Cert didn't match the IP-pooled domain. </summary> @@ -57906,7 +57832,7 @@ <histogram name="Net.SpdyResponseCode" enum="HttpResponseCode"> <owner>bnc@chromium.org</owner> <summary> - HTTP status codes received in HTTP/2 HEADERS frames. If a stream contains + HTTP status codes received in HTTP/2 HEADERS frames. If a stream contains one or more informational (1xx) response preceeding the main response, each status code is logged separately. </summary> @@ -58175,7 +58101,7 @@ <histogram name="Net.SpdyStreamTime" units="ms"> <owner>bnc@chromium.org</owner> <summary> - The time of a Spdy stream. Measured from sending the first chunk to + The time of a Spdy stream. Measured from sending the first chunk to receiving the last chunk of data. </summary> </histogram> @@ -58191,8 +58117,8 @@ <histogram name="Net.SpdySynStreamCompressionPercentage" units="%"> <obsolete> Deprecated on 2016-11-28, because SPDY/3 and, accordingly, SYN_STREAM frames - are no longer used. Compression values are now calculated slightly - differently. Replaced by Net.SpdyHeadersCompressionPercentage. + are no longer used. Compression values are now calculated slightly + differently. Replaced by Net.SpdyHeadersCompressionPercentage. </obsolete> <owner>bnc@chromium.org</owner> <summary> @@ -58204,7 +58130,7 @@ <obsolete> Deprecated on 2014-09-11, because the uploaded values were changing as protocols were removed, therefore statistics couldn't be combined across - different builds. Replaced by Net.SpdyVersion2. + different builds. Replaced by Net.SpdyVersion2. </obsolete> <owner>rch@chromium.org</owner> <summary> @@ -58215,12 +58141,12 @@ <histogram name="Net.SpdyVersion2" enum="SpdyProtocolVersion"> <obsolete> Deprecated on 2016-02-01, because the incorrect bucket count caused data - corruption. Replaced by Net.SpdyVersion3. + corruption. Replaced by Net.SpdyVersion3. </obsolete> <owner>bnc@chromium.org</owner> <summary> - The SPDY protocol version that is used to talk to SPDY servers. Logged - every time a SPDY session is initialized. + The SPDY protocol version that is used to talk to SPDY servers. Logged every + time a SPDY session is initialized. </summary> </histogram> @@ -58230,8 +58156,8 @@ </obsolete> <owner>bnc@chromium.org</owner> <summary> - The SPDY protocol version that is used to talk to SPDY servers. Logged - every time a SPDY session is initialized. + The SPDY protocol version that is used to talk to SPDY servers. Logged every + time a SPDY session is initialized. </summary> </histogram> @@ -58873,7 +58799,7 @@ <histogram name="Net.TCP_Connection_Latency" units="ms"> <owner>mmenke@chromium.org</owner> <summary> - Time from when the Connect() starts until it completes. Only times under 10 + Time from when the Connect() starts until it completes. Only times under 10 minutes are logged. </summary> </histogram> @@ -58882,7 +58808,7 @@ <owner>mgersh@chromium.org</owner> <summary> Time from when the Connect() starts until it completes when the network - address only contains IPv4 addresses. Only times under 10 minutes are + address only contains IPv4 addresses. Only times under 10 minutes are logged. </summary> </histogram> @@ -58891,7 +58817,7 @@ <owner>mgersh@chromium.org</owner> <summary> Time from when the Connect() starts until it completes when the IPv4 - fallback connection won the race against IPv6. Only times under 10 minutes + fallback connection won the race against IPv6. Only times under 10 minutes are logged. </summary> </histogram> @@ -58900,7 +58826,7 @@ <owner>mgersh@chromium.org</owner> <summary> Time from when the Connect() starts until it completes when we race an IPv6 - connection against an IPv4 connection with a 300ms delay. Only times under + connection against an IPv4 connection with a 300ms delay. Only times under 10 minutes are logged. </summary> </histogram> @@ -58909,7 +58835,7 @@ <owner>mgersh@chromium.org</owner> <summary> Time from when the Connect() starts until it completes when the network - address only contains IPv6 addresses. Only times under 10 minutes are + address only contains IPv6 addresses. Only times under 10 minutes are logged. </summary> </histogram> @@ -59035,8 +58961,8 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Effective bandwidth in KByte/Second of transactions logged to - Transaction_Latency histogram. Note that only samples durations greater - than zero ms, and less than 1 hour are tallied into this ratio. + Transaction_Latency histogram. Note that only samples durations greater than + zero ms, and less than 1 hour are tallied into this ratio. </summary> </histogram> @@ -59081,7 +59007,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Time from the when the network transaction is requested, until the first - byte of the header is received. Only items under 10 minutes are logged. + byte of the header is received. Only items under 10 minutes are logged. </summary> </histogram> @@ -59138,7 +59064,7 @@ <summary> When an existing TCP/IP connection is NOT reused, the time from when a network transaction is requested until last byte received by the new network - stack. Only items under 10 minutes are logged. + stack. Only items under 10 minutes are logged. </summary> </histogram> @@ -59149,7 +59075,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Time from when a network transaction is requested until last byte received - by the new network stack. Only items under 10 minutes are logged. + by the new network stack. Only items under 10 minutes are logged. </summary> </histogram> @@ -59171,7 +59097,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Time from first byte sent until last byte received with old WinHTTP network - stack. Only items under 1 hour are logged. + stack. Only items under 1 hour are logged. </summary> </histogram> @@ -59748,9 +59674,9 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Chrome sends 4 UDP packets in a row to test to see if there is a - probabalistic dependency in packet loss for consecutive packets. We record - a bit vector of packets received, where the least significant bit is a 1 if - the first packet was received, etc. For example, if packets 1 and 3 are + probabalistic dependency in packet loss for consecutive packets. We record a + bit vector of packets received, where the least significant bit is a 1 if + the first packet was received, etc. For example, if packets 1 and 3 are received, but packets 2 and 4 are lost, then we'd record a sample of binary 0101B, or 5. </summary> @@ -59763,9 +59689,9 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Chrome sends 6 UDP packets in a row to test to see if there is a - probabalistic dependency in packet loss for consecutive packets. We record - a bit vector of packets received, where the least significant bit is a 1 if - the first packet was received, etc. For example, if all packets other than + probabalistic dependency in packet loss for consecutive packets. We record a + bit vector of packets received, where the least significant bit is a 1 if + the first packet was received, etc. For example, if all packets other than packet 2 and 4 are responded to, then we'd have a sample (in binary) of 110101B, or 53. </summary> @@ -59838,9 +59764,9 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Chrome sends 6 UDP packets in a row to test to see if there is a - probabalistic dependency in packet loss for consecutive packets. We record - a bit vector of packets received, where the least significant bit is a 1 if - the first packet was received, etc. For example, if all packets other than + probabalistic dependency in packet loss for consecutive packets. We record a + bit vector of packets received, where the least significant bit is a 1 if + the first packet was received, etc. For example, if all packets other than packet 2 and 4 are responded to, then we'd have a sample (in binary) of 110101B, or 53. </summary> @@ -60218,7 +60144,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Chrome OS network metric sampling the time spent using Cellular to transport - data. These data are mostly useful when summed and compared to TimeOnline + data. These data are mostly useful when summed and compared to TimeOnline for other network technologies (e.g. WiFi vs Cellular). </summary> </histogram> @@ -60272,7 +60198,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Chrome OS network metric sampling the time spent using Ethernet to transport - data. These data are mostly useful when summed and compared to TimeOnline + data. These data are mostly useful when summed and compared to TimeOnline for other network technologies (e.g. WiFi vs Cellular). </summary> </histogram> @@ -60379,7 +60305,7 @@ <owner>benchan@chromium.org</owner> <summary> Chrome OS network metric that tracks the number of DHCP option failures - encountered by Shill. This indicates that Shill is using minimal DHCP + encountered by Shill. This indicates that Shill is using minimal DHCP options due to suspected MTU issues on the return path from the DHCP server back to the client. </summary> @@ -60493,7 +60419,7 @@ <owner>benchan@chromium.org</owner> <summary> Chrome OS network metric sampling the time spent using cellular to transport - data. These data are mostly useful when summed and compared to TimeOnline + data. These data are mostly useful when summed and compared to TimeOnline for other network technologies (e.g. WiFi vs Cellular). </summary> </histogram> @@ -60661,7 +60587,7 @@ <owner>pstew@chromium.org</owner> <summary> Chrome OS network diagnostic metric sampling the MTU value proposed by the - DHCP server. A sample is emitted each time the DHCP client completes + DHCP server. A sample is emitted each time the DHCP client completes negotiation with a server. </summary> </histogram> @@ -60670,7 +60596,7 @@ <owner>pstew@chromium.org</owner> <summary> Chrome OS network diagnostic metric sampling the current state of the DHCP - client. A sample is emitted each time the DHCP client state changes. + client. A sample is emitted each time the DHCP client state changes. </summary> </histogram> @@ -60679,7 +60605,7 @@ <owner>benchan@chromium.org</owner> <summary> Chrome OS network metric that tracks the number of DHCP option failures - encountered by Shill for each network technology. This indicates that Shill + encountered by Shill for each network technology. This indicates that Shill is using minimal DHCP options due to suspected MTU issues on the return path from the DHCP server back to the client. </summary> @@ -60702,7 +60628,7 @@ <owner>benchan@chromium.org</owner> <summary> Chrome OS network metric that tracks the number of DHCP option failures - encountered by Shill. This indicates that Shill is using minimal DHCP + encountered by Shill. This indicates that Shill is using minimal DHCP options due to suspected MTU issues on the return path from the DHCP server back to the client. </summary> @@ -60818,7 +60744,7 @@ <owner>benchan@chromium.org</owner> <summary> Chrome OS network metric sampling the time spent using Ethernet to transport - data. These data are mostly useful when summed and compared to TimeOnline + data. These data are mostly useful when summed and compared to TimeOnline for other network technologies (e.g. WiFi vs Cellular). </summary> </histogram> @@ -60860,7 +60786,7 @@ <owner>gdk@chromium.org</owner> <summary> Chrome OS network diagnostic metric sampling the MTU value provided by the - upstream PPP peer. A sample is emitted each time the client successfully + upstream PPP peer. A sample is emitted each time the client successfully negotiates an MTU value via PPP. </summary> </histogram> @@ -61029,10 +60955,10 @@ <owner>cernekee@chromium.org</owner> <summary> Chrome OS network metric sampling the time spent using VPN to transport - data. These data are mostly useful when summed and compared to TimeOnline - for other network technologies (e.g. WiFi vs Cellular). A sample is emitted + data. These data are mostly useful when summed and compared to TimeOnline + for other network technologies (e.g. WiFi vs Cellular). A sample is emitted every time the system transitions from primary connectivity through a VPN to - some other type of connectivity. The value of the sample is the time delta + some other type of connectivity. The value of the sample is the time delta in seconds from the instant the system transitioned to VPN connectivity. </summary> </histogram> @@ -61118,15 +61044,15 @@ <histogram name="Network.Shill.WiFi.ApDisconnectReason" enum="WiFiReasonCode"> <owner>kirtika@chromium.org</owner> <summary> - Chrome OS network usage metric. Reason code reported when the AP - disconnects a WiFi connection. + Chrome OS network usage metric. Reason code reported when the AP disconnects + a WiFi connection. </summary> </histogram> <histogram name="Network.Shill.WiFi.ApDisconnectType" enum="WiFiStatusType"> <owner>kirtika@chromium.org</owner> <summary> - Chrome OS network usage metric. Broad category of reason AP disconnected a + Chrome OS network usage metric. Broad category of reason AP disconnected a WiFi connection. </summary> </histogram> @@ -61134,8 +61060,8 @@ <histogram name="Network.Shill.Wifi.ApMode" enum="WiFiApMode"> <owner>kirtika@chromium.org</owner> <summary> - Chrome OS network usage metric. The AP mode setting for each successful - WiFi connection. + Chrome OS network usage metric. The AP mode setting for each successful WiFi + connection. </summary> </histogram> @@ -61178,7 +61104,7 @@ <histogram name="Network.Shill.Wifi.Channel" enum="NetworkChannelType"> <owner>kirtika@chromium.org</owner> <summary> - Chrome OS network usage metric. The channel used for each successful WiFi + Chrome OS network usage metric. The channel used for each successful WiFi connection. </summary> </histogram> @@ -61187,7 +61113,7 @@ enum="WiFiReasonCode"> <owner>kirtika@chromium.org</owner> <summary> - Chrome OS network usage metric. Reason code reported when the client + Chrome OS network usage metric. Reason code reported when the client disconnects a WiFi connection. </summary> </histogram> @@ -61195,8 +61121,8 @@ <histogram name="Network.Shill.WiFi.ClientDisconnectType" enum="WiFiStatusType"> <owner>kirtika@chromium.org</owner> <summary> - Chrome OS network usage metric. Broad category of reason client - disconnected a WiFi connection. + Chrome OS network usage metric. Broad category of reason client disconnected + a WiFi connection. </summary> </histogram> @@ -61235,7 +61161,7 @@ <owner>kirtika@chromium.org</owner> <summary> Chrome OS network metric that tracks the number of DHCP option failures - encountered by Shill. This indicates that Shill is using minimal DHCP + encountered by Shill. This indicates that Shill is using minimal DHCP options due to suspected MTU issues on the return path from the DHCP server back to the client. </summary> @@ -61385,7 +61311,7 @@ <histogram name="Network.Shill.Wifi.PhyMode" enum="NetworkPhyModeType"> <owner>kirtika@chromium.org</owner> <summary> - Chrome OS network usage metric. The channel type used for each successful + Chrome OS network usage metric. The channel type used for each successful WiFi connection. </summary> </histogram> @@ -61422,7 +61348,7 @@ <summary> Chrome OS network diagnostic metric sampling the number of 802.11 wireless networks known by the connection manager at the time a configuration profile - has been loaded. A configuration profile is loaded at each system startup, + has been loaded. A configuration profile is loaded at each system startup, and when a user logs in. </summary> </histogram> @@ -61492,7 +61418,7 @@ <histogram name="Network.Shill.Wifi.Security" enum="NetworkSecurityType"> <owner>kirtika@chromium.org</owner> <summary> - Chrome OS network usage metric. The security setting for each successful + Chrome OS network usage metric. The security setting for each successful WiFi connection. </summary> </histogram> @@ -61562,7 +61488,7 @@ <owner>kirtika@chromium.org</owner> <summary> Time spent in suspended state, on a resume, for the case when wake on wifi - is disabled (WoWOff), and after resume, the NIC is found to be already + is disabled (WoWOff), and after resume, the NIC is found to be already connected. </summary> </histogram> @@ -61573,7 +61499,7 @@ <owner>kirtika@chromium.org</owner> <summary> Time spent in suspended state, on a resume, for the case when wake on wifi - is enabled (WoWOff), and after resume, the NIC is found to be disconnected. + is enabled (WoWOff), and after resume, the NIC is found to be disconnected. </summary> </histogram> @@ -61583,7 +61509,7 @@ <owner>kirtika@chromium.org</owner> <summary> Time spent in suspended state, on a resume, for the case when wake on wifi - is enabled (WoWOn), and after resume, the NIC is found to be already + is enabled (WoWOn), and after resume, the NIC is found to be already connected. </summary> </histogram> @@ -61594,7 +61520,7 @@ <owner>kirtika@chromium.org</owner> <summary> Time spent in suspended state, on a resume, for the case when wake on wifi - is enabled (WoWOn), and after resume, the NIC is found to be disconnected. + is enabled (WoWOn), and after resume, the NIC is found to be disconnected. </summary> </histogram> @@ -61602,7 +61528,7 @@ <owner>kirtika@chromium.org</owner> <summary> Chrome OS network metric sampling the time spent using WiFi to transport - data. These data are mostly useful when summed and compared to TimeOnline + data. These data are mostly useful when summed and compared to TimeOnline for other network technologies (e.g. WiFi vs Cellular). </summary> </histogram> @@ -61789,7 +61715,7 @@ <owner>benchan@chromium.org</owner> <summary> Chrome OS network metric that tracks the number of DHCP option failures - encountered by Shill. This indicates that Shill is using minimal DHCP + encountered by Shill. This indicates that Shill is using minimal DHCP options due to suspected MTU issues on the return path from the DHCP server back to the client. </summary> @@ -61948,7 +61874,7 @@ <histogram name="Network.Wifi.Channel" enum="NetworkChannelType"> <owner>cast-analytics@google.com</owner> <summary> - Chrome OS network usage metric. The channel used for each successful WiFi + Chrome OS network usage metric. The channel used for each successful WiFi connection. </summary> </histogram> @@ -61956,7 +61882,7 @@ <histogram name="Network.Wifi.PhyMode" enum="NetworkPhyModeType"> <owner>cast-analytics@google.com</owner> <summary> - Chrome OS network usage metric. The channel type used for each successful + Chrome OS network usage metric. The channel type used for each successful WiFi connection. </summary> </histogram> @@ -61972,7 +61898,7 @@ <histogram name="Network.Wifi.Security" enum="NetworkSecurityType"> <owner>cast-analytics@google.com</owner> <summary> - Chrome OS network usage metric. The security setting for each successful + Chrome OS network usage metric. The security setting for each successful WiFi connection. </summary> </histogram> @@ -61984,7 +61910,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Chrome OS network metric sampling the time spent using WiFi to transport - data. These data are mostly useful when summed and compared to TimeOnline + data. These data are mostly useful when summed and compared to TimeOnline for other network technologies (e.g. WiFi vs Cellular). </summary> </histogram> @@ -63303,7 +63229,7 @@ <owner>justincohen@chromium.org</owner> <owner>newt@chromium.org</owner> <summary> - Action taken by the user on the Most Visited NTP pane. If the user switches + Action taken by the user on the Most Visited NTP pane. If the user switches panes during this use of the NTP, this action is sometimes not recorded. Ask mpearson@ for details. </summary> @@ -63731,7 +63657,7 @@ Android: The score of the snippets card on the NTP, that is clicked through to the host website of the content. The recorded score is from the moment the snippet was fetched, it could have changed since. In each "_x" - suffix of the histogram, only snippets on positions \lt;=x are tracked. We + suffix of the histogram, only snippets on positions \lt;=x are tracked. We track the position the snippet had in the list when NTP was loaded. This tracked position is thus different from the position observed by the user whenever before scrolling down to the given snippet, the user discards some @@ -63748,7 +63674,7 @@ Android: The score of the snippets card on the NTP, that is clicked through to the host website of the content. The recorded score is from the moment the snippet was fetched, it could have changed since. In each "_x" - suffix of the histogram, only snippets on positions \lt;=x are tracked. We + suffix of the histogram, only snippets on positions \lt;=x are tracked. We track the position the snippet had in the list when NTP was loaded. This tracked position is thus different from the position observed by the user whenever before scrolling down to the given snippet, the user discards some @@ -63863,12 +63789,11 @@ visible by scrolling through the NTP. Each snippet is recorded at most once for a given instance of NTP and a given data set of snippets that is shown. The recorded score is from the moment the snippet was fetched, it could have - changed since. In each "_x" suffix of the histogram, only - snippets on positions \lt;=x are tracked. By this, we mean the position the - snippet had in the list when NTP was loaded. This tracked position is thus - different from the position observed by the user whenever before scrolling - down to the given snippet, the user discards some snippets in the top of the - list. + changed since. In each "_x" suffix of the histogram, only snippets + on positions \lt;=x are tracked. By this, we mean the position the snippet + had in the list when NTP was loaded. This tracked position is thus different + from the position observed by the user whenever before scrolling down to the + given snippet, the user discards some snippets in the top of the list. </summary> </histogram> @@ -63883,13 +63808,13 @@ visible by scrolling through the NTP. Each snippet is recorded at most once for a given instance of NTP and a given data set of snippets that is shown. The recorded score is from the moment the snippet was fetched, it could have - changed since. In each "_x" suffix of the histogram, only - snippets on positions \lt;=x are tracked. By this, we mean the position the - snippet had in the list when NTP was loaded. This tracked position is thus - different from the position observed by the user whenever before scrolling - down to the given snippet, the user discards some snippets in the top of the - list. In contrast to CardShownScore, this histogram has a proper maximal - value of 100 000. + changed since. In each "_x" suffix of the histogram, only snippets + on positions \lt;=x are tracked. By this, we mean the position the snippet + had in the list when NTP was loaded. This tracked position is thus different + from the position observed by the user whenever before scrolling down to the + given snippet, the user discards some snippets in the top of the list. In + contrast to CardShownScore, this histogram has a proper maximal value of 100 + 000. </summary> </histogram> @@ -64335,7 +64260,7 @@ <histogram name="Notifications.Actions" enum="NotificationActionType"> <owner>dewittj@chromium.org</owner> <summary> - The actions taken on notifications, recorded every time they happen. This + The actions taken on notifications, recorded every time they happen. This histogram will record every single event that happens separately. </summary> </histogram> @@ -64537,7 +64462,7 @@ <owner>thomasanderson@chromium.org</owner> <summary> - Whether the notification server supports the capability in question. (Linux + Whether the notification server supports the capability in question. (Linux only) Logged when the proxy to /org/Freedesktop/Notifications is set up successfully, which happens at most once on startup. </summary> @@ -64588,7 +64513,7 @@ enum="LinuxNotificationBridgeStatusCode"> <owner>thomasanderson@chromium.org</owner> <summary> - The status code for initializing NotificationPlatformBridgeLinux. (Linux + The status code for initializing NotificationPlatformBridgeLinux. (Linux only) Logged on each start up. </summary> </histogram> @@ -64692,7 +64617,7 @@ <owner>dewittj@chromium.org</owner> <summary> The actions taken on notifications, recorded once per notification, when it - is closed. This differs from the Notifications.Actions histogram in that + is closed. This differs from the Notifications.Actions histogram in that multiple events of the same type on a single notification will only record a single UMA event. </summary> @@ -64746,7 +64671,7 @@ <owner>thomasanderson@chromium.org</owner> <summary> Indicates if Chrome is using system notifications or the Chrome notification - center. Logged on each start up. + center. Logged on each start up. </summary> </histogram> @@ -65422,7 +65347,7 @@ Count of the number of times renderers were notified of the changes in the network quality estimator. This metric makes sense to compare in frequency relative to other events like the number of page loads or the number of - renderers seen. It is expected that we will see at least 1 notification per + renderers seen. It is expected that we will see at least 1 notification per renderer (on average), and less than 100. </summary> </histogram> @@ -65448,7 +65373,7 @@ <histogram name="NQE.RTT.HangingRequest" units="ms"> <owner>tbansal@chromium.org</owner> <summary> - HTTP RTT observation received by the network quality estimator. Recorded + HTTP RTT observation received by the network quality estimator. Recorded when the request is detected as hanging. </summary> </histogram> @@ -65465,7 +65390,7 @@ <histogram name="NQE.RTT.NotAHangingRequest.HttpRTT" units="ms"> <owner>tbansal@chromium.org</owner> <summary> - HTTP RTT observation received by the network quality estimator. Recorded + HTTP RTT observation received by the network quality estimator. Recorded when the request is detected as not hanging because it was comparable to the HTTP RTT estimate. </summary> @@ -65474,7 +65399,7 @@ <histogram name="NQE.RTT.NotAHangingRequest.MinHttpBound" units="ms"> <owner>tbansal@chromium.org</owner> <summary> - HTTP RTT observation received by the network quality estimator. Recorded + HTTP RTT observation received by the network quality estimator. Recorded when the request is detected as not hanging because the RTT value was lower than the minimum threshold RTT needed to be categorized as a hanging request. @@ -65484,7 +65409,7 @@ <histogram name="NQE.RTT.NotAHangingRequest.TransportRTT" units="ms"> <owner>tbansal@chromium.org</owner> <summary> - HTTP RTT observation received by the network quality estimator. Recorded + HTTP RTT observation received by the network quality estimator. Recorded when the request is detected as not hanging because it was comparable to the transport RTT estimate. </summary> @@ -65504,7 +65429,7 @@ <owner>bengr@chromium.org</owner> <owner>tbansal@chromium.org</owner> <summary> - Rough estimate of the round trip time at the URLRequest layer. Recorded by + Rough estimate of the round trip time at the URLRequest layer. Recorded by the network quality estimator every time the effective connection type is computed. </summary> @@ -65934,7 +65859,7 @@ There are several causes for the Chrome Custom Tabs API calls to be ignored, this tracks the potential causes so we can see how often the prerenderer - doesn't prerender due to these being switched off. Since this is checked + doesn't prerender due to these being switched off. Since this is checked elsewhere (CCTAPI), this only catches the user switching off the third party cookies or navigation prediction after the CCT API has checked. </summary> @@ -66222,7 +66147,7 @@ <owner>fgorski@chromium.org</owner> <summary> Reports whether a web page complies with all requirements for it to be - allowed to be saved as an offline page. This is reported only on Android, + allowed to be saved as an offline page. This is reported only on Android, after a successful main frame navigation is finished. </summary> </histogram> @@ -67111,7 +67036,7 @@ <owner>petewil@chromium.org</owner> <summary> When publishing an archive, we create the download directory if it doesn't - already exist. If we get an error, we record it here. + already exist. If we get an error, we record it here. </summary> </histogram> @@ -67119,7 +67044,7 @@ enum="PopularOSErrno"> <owner>petewil@chromium.org</owner> <summary> - When publishing an offline page, the move file step can fail. This returns + When publishing an offline page, the move file step can fail. This returns the reason for failure as a linux errno. </summary> </histogram> @@ -67136,8 +67061,8 @@ enum="OfflinePagesPublishSource"> <owner>petewil@chromium.org</owner> <summary> - When publishing an offline page, a page might not be found. This returns - the publishing path that was used (ex: by Guid or by OfflineId). + When publishing an offline page, a page might not be found. This returns the + publishing path that was used (ex: by Guid or by OfflineId). </summary> </histogram> @@ -67638,11 +67563,11 @@ <owner>mpearson@chromium.org</owner> <summary> Recorded every time the omnibox is focussed and a recent URL from the user's - clipboard is suggested. The value indicates the estimated age of the - clipboard. (If Chrome observed the clipboard modification, this age is - exact. If Chrome did not observe the modification, then it's a conservative + clipboard is suggested. The value indicates the estimated age of the + clipboard. (If Chrome observed the clipboard modification, this age is + exact. If Chrome did not observe the modification, then it's a conservative estimate: the last time Chrome observed a clipboard modification, which is - certainly older than the current clipboard. If Chrome never observed a + certainly older than the current clipboard. If Chrome never observed a clipboard modification, no clipboard suggestion is shown, meaning this histogram will never be emitted to.) @@ -67654,12 +67579,12 @@ <owner>mpearson@chromium.org</owner> <summary> Recorded every time the omnibox is focussed and a recent URL from the user's - clipboard is suggested. The number emitted is the number of times the URL + clipboard is suggested. The number emitted is the number of times the URL has been suggested within the same session including the current time. Thus, the third time it is shown, we'll emit a three to this histogram, and this - histogram will have previously seen emits of one and two. If the clipboard + histogram will have previously seen emits of one and two. If the clipboard content was the same during a previous run of Chrome and this URL was - suggested during that run, those impressions are not counted. Also, if the + suggested during that run, those impressions are not counted. Also, if the clipboard content changes during a particular run of Chrome to another URL, the omnibox is focused and that URL is suggested, then content changes back and Chrome starts suggesting the older URL again, the counts start again @@ -67667,12 +67592,12 @@ consecutively. This value is useful to compare with the number of times a clipboard - suggestion has been shown when it is clicked. This value can be obtained + suggestion has been shown when it is clicked. This value can be obtained from OmniboxEvent records in which the selected suggestion is from Clipboard - provider. In those cases, look in the Clipboard provider's ProviderInfo - field for |times_returned_results_in_session|. Note that at the time of - this writing that OmniboxEvent logs aren't recorded in incognito whereas - histograms are. Thus, the total counts will not be comparable, though the + provider. In those cases, look in the Clipboard provider's ProviderInfo + field for |times_returned_results_in_session|. Note that at the time of this + writing that OmniboxEvent logs aren't recorded in incognito whereas + histograms are. Thus, the total counts will not be comparable, though the distributions should be. </summary> </histogram> @@ -67682,14 +67607,14 @@ <owner>mpearson@chromium.org</owner> <summary> Recorded every time the omnibox is focussed and a recent URL from the user's - clipboard is suggested. The value indicates whether the current URL was + clipboard is suggested. The value indicates whether the current URL was shown (which would appear above the clipboard URL suggestion) or was absent (which ought to only happen when the omnibox is empty / the user is on the NTP). On Android, the total count for this histogram can be usefully compared with the count of the user action FocusLocation in order to determine the rate at - which a clipboard URL suggestion is shown in the omnibox. To determine the + which a clipboard URL suggestion is shown in the omnibox. To determine the same rate on iOS, one needs to compare this histogram's count with the sum of the user actions MobileFocusedOmniboxOnNtp, MobileFocusedFakeboxOnNtp, and MobileFocusedOmniboxNotOnNtp. @@ -67761,7 +67686,7 @@ <owner>mpearson@chromium.org</owner> <summary> The length of time between when a user focused on the omnibox and opened an - omnibox match (which could be what they typed or a suggestion). This is + omnibox match (which could be what they typed or a suggestion). This is recorded regardless of whether the omnibox dropdown (a.k.a. popup) is open. </summary> </histogram> @@ -67774,7 +67699,7 @@ <owner>mpearson@chromium.org</owner> <summary> The length of time between when a user focused on the omnibox and opened an - omnibox match (which could be what they typed or a suggestion). This is + omnibox match (which could be what they typed or a suggestion). This is recorded regardless of whether the omnibox dropdown (a.k.a. popup) is open. It is not recorded if a match is opened without triggering a focus event, e.g., when a user drags a URL to the omnibox to navigate. @@ -67788,7 +67713,7 @@ <owner>mpearson@chromium.org</owner> <summary> The length of time between when a user focused on the omnibox and opened an - omnibox match (which could be what they typed or a suggestion). This is + omnibox match (which could be what they typed or a suggestion). This is recorded regardless of whether the omnibox dropdown (a.k.a. popup) is open. It is not recorded if a match is opened without triggering a focus event, e.g., when a user drags a URL to the omnibox to navigate. @@ -67814,7 +67739,7 @@ <owner>mpearson@chromium.org</owner> <summary> Whether there was at least one legal default match without an - |inline_autocompletion|. Recorded every time + |inline_autocompletion|. Recorded every time AutocompleteResult::SortAndCull() is called, which could happen multiple times on each keystroke. </summary> @@ -67835,7 +67760,7 @@ <owner>mpearson@chromium.org</owner> <summary> The kind of input the user provided when using the omnibox to go somewhere. - The type can be misleading. For example if the user typed 'http:/', it gets + The type can be misleading. For example if the user typed 'http:/', it gets marked as a query because it cannot be opened as a URL even though the user probably wanted and selected a URL from the list of suggestions. </summary> @@ -67847,7 +67772,7 @@ Whether an omnibox interaction is a paste-and-search/paste-and-go action. (This histogram records both of these in the "True" bucket for this histogram because both of these are referred to as paste-and-go in the - code.) These typically involve right-clicking in the omnibox and selecting + code.) These typically involve right-clicking in the omnibox and selecting that option from the dropdown. </summary> </histogram> @@ -67856,8 +67781,8 @@ <owner>mpearson@chromium.org</owner> <summary> Whether the omnibox popup (a.k.a. dropdown) is open at the time the user - used the omnibox to go somewhere. It can be closed if, for instance, the - user clicked in the omnibox and hit return to reload the same page. Also, + used the omnibox to go somewhere. It can be closed if, for instance, the + user clicked in the omnibox and hit return to reload the same page. Also, because paste-and-search/paste-and-go actions ignore the current content of the omnibox dropdown (if it is open) when they happen, we pretend the dropdown is closed when logging these. @@ -67868,7 +67793,7 @@ <owner>mpearson@chromium.org</owner> <summary> Whether the user deleted text immediately before selecting an omnibox - suggestion. This is usually the result of pressing backspace or delete. + suggestion. This is usually the result of pressing backspace or delete. </summary> </histogram> @@ -67881,8 +67806,8 @@ <owner>mpearson@chromium.org</owner> <summary> The number of terms in the text the user entered in the omnibox when they - used the omnibox to go somewhere. Terms are defined by splitting on - whitespace. All values larger than 6 are recorded in bucket 6. + used the omnibox to go somewhere. Terms are defined by splitting on + whitespace. All values larger than 6 are recorded in bucket 6. </summary> </histogram> @@ -68058,7 +67983,7 @@ <histogram name="Omnibox.SearchEngine" enum="OmniboxSearchEngine"> <obsolete> - Made obsolete around Chrome 32. Use Omnibox.SearchEngineType instead. + Made obsolete around Chrome 32. Use Omnibox.SearchEngineType instead. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> @@ -68109,7 +68034,7 @@ <histogram name="Omnibox.SearchProviderMatches"> <owner>mpearson@chromium.org</owner> <summary> - The number of matches returned by SearchProvider. Emitted on every call to + The number of matches returned by SearchProvider. Emitted on every call to SearchProvider::Start(), which effectively means every key stroke in the omnibox. </summary> @@ -68119,8 +68044,8 @@ <owner>mpearson@chromium.org</owner> <summary> The index of the item that the user selected in the omnibox popup (a.k.a. - dropdown) list. 0 means the inline suggestion shown within the omnibox. - This is also the same suggestion shown as the top item in the dropdown. The + dropdown) list. 0 means the inline suggestion shown within the omnibox. This + is also the same suggestion shown as the top item in the dropdown. The second item in the dropdown will be recorded as bucket 1. The selected position is always set to 0 when the popup is closed at the time of navigation or if the user did a paste-and-search or paste-and-go action. @@ -68424,7 +68349,7 @@ <owner>mpearson@chromium.org</owner> <summary> The length of the text the user entered in the omnibox when they used the - omnibox to go somewhere. Switched on March 27 2018 from an bucketing where + omnibox to go somewhere. Switched on March 27 2018 from an bucketing where every typed length is emitted exactly (up to 500) to ordinary exponential bucketing. </summary> @@ -68448,8 +68373,8 @@ The scheme of the destination URL for the selected omnibox suggestion. This could be a what-you-typed suggestion (if the user fully typed a URL), an inline autocompletion, or something in the dropdown, anything as long as - it's a URL navigation, not a search query. Excludes omnibox URL navigations - that are effectively reloads as well as cut-and-pastes of URLs. Also does + it's a URL navigation, not a search query. Excludes omnibox URL navigations + that are effectively reloads as well as cut-and-pastes of URLs. Also does not take into account any redirects that destination URL may do before finally serving a page. In other words, it's the scheme of the first request in a possible chain. @@ -68476,10 +68401,10 @@ <owner>kenjibaheux@chromium.org</owner> <owner>mpearson@chromium.org</owner> <summary> - Counts the number of times that the user text is cleared. IME users are + Counts the number of times that the user text is cleared. IME users are sometimes in the situation that IME was unintentionally turned on and failed - to input latin alphabets (ASCII characters) or the opposite case. In that - case, users may delete all the text and the user text gets cleared. This + to input latin alphabets (ASCII characters) or the opposite case. In that + case, users may delete all the text and the user text gets cleared. This histogram helps us estimate how often this scenario happens. Note that since we don't currently correlate "text cleared" events @@ -68507,11 +68432,11 @@ <owner>mpearson@chromium.org</owner> <summary> Whether the user has settings configured so that the current page URL can be - sent to the suggest server to request contextual suggestions. For example, + sent to the suggest server to request contextual suggestions. For example, this is only supported for users who have Google as their default search engine (unmodified version of Google), have search suggest enabled, are signed-in and syncing without a custom passphrase, and don't have an - incognito window open. There are other criteria too. Recorded on focus in + incognito window open. There are other criteria too. Recorded on focus in the omnibox if there is default search provider and we've constructed a suggest URL. @@ -68519,12 +68444,12 @@ will go into the "generally ineligible" bucket. Likewise, if the current page is a search results page, we don't allow contextual suggestions either so focus events on those pages go in the "generally - ineligible" bucket. The difference between "eligible" and + ineligible" bucket. The difference between "eligible" and "generally eligible but not this time" depends only the properties of the current URL. Recorded regardless of whether contextual or non-contextual zero suggest is - currently enabled on the user's platform. However, if zero suggest (in all + currently enabled on the user's platform. However, if zero suggest (in all forms) is entirely disabled, the user will be perpetually ineligible. </summary> </histogram> @@ -68534,11 +68459,11 @@ <owner>mpearson@chromium.org</owner> <summary> Whether the user has settings configured so that the current page URL could - be sent to the suggest server to request contextual suggestions. For + be sent to the suggest server to request contextual suggestions. For example, this is only supported for users who have Google as their default search engine (unmodified version of Google), have search suggest enabled, - and are signed-in and syncing without a custom passphrase. There are other - criteria too. Recorded on profile open. Note that opening an incognito + and are signed-in and syncing without a custom passphrase. There are other + criteria too. Recorded on profile open. Note that opening an incognito window (if none are currently open under the given profile) counts as opening a new profile. @@ -68547,10 +68472,10 @@ ineligible because they have an incognito window open (it's impossible to have an incognito window open for a given profile at the time of profile open) and also cannot be declared ineligible because the user is viewing a - search results page. (We test this on-profile-open using an arbitrary URL.) + search results page. (We test this on-profile-open using an arbitrary URL.) Recorded regardless of whether contextual or non-contextual zero suggest is - currently enabled on the user's platform. However, if zero suggest (in all + currently enabled on the user's platform. However, if zero suggest (in all forms) is entirely disabled, the user will be perpetually ineligible. </summary> </histogram> @@ -68559,8 +68484,8 @@ <owner>hfung@chromium.org</owner> <summary> The number of most visited suggestions returned when ZeroSuggest would have - triggered. The suggestions appear when the user has focused but not - modified the omnibox. + triggered. The suggestions appear when the user has focused but not modified + the omnibox. </summary> </histogram> @@ -69143,7 +69068,7 @@ <histogram name="P2P.Client.Canceled.WaitingTimeSeconds" units="seconds"> <owner>zeuthen@chromium.org</owner> <summary> - The wall-clock time spent until a lookup was canceled. This is reported + The wall-clock time spent until a lookup was canceled. This is reported every time p2p is used to find a candidate but the request was canceled. </summary> </histogram> @@ -69171,7 +69096,7 @@ <summary> The wall-clock time spent waiting for the LAN-wide number of p2p downloads (i.e. the sum of p2p downloads from each peer on the LAN) to drop below the - threshold. This is reported after examining responses from all peers on the + threshold. This is reported after examining responses from all peers on the LAN and picking a candidate. </summary> </histogram> @@ -69255,7 +69180,7 @@ <summary> When a client resumes a download, the HTTP request includes range specifier to skip the bytes it already has. This metric conveys this as a percentage - of the file size. This is reported every time a file is served, even if the + of the file size. This is reported every time a file is served, even if the request does not include a range specifier (in which case 0 is reported). </summary> </histogram> @@ -69887,7 +69812,7 @@ <summary> The percent of completed resources loaded from network in a page load that use data reduction proxy when the main resource was loaded through data - reduction proxy. Recorded per page load when the user navigates away, hides + reduction proxy. Recorded per page load when the user navigates away, hides the tab, or backgrounds the app. </summary> </histogram> @@ -71309,7 +71234,7 @@ </obsolete> <owner>ksakamoto@chromium.org</owner> <summary> - The time from navigation start to first "contentful" paint. This + The time from navigation start to first "contentful" paint. This metric is being phased out in favor of the PageLoad.PaintTiming equivalent and will be deprecated in M54. </summary> @@ -71936,7 +71861,7 @@ <owner>battre@chromium.org</owner> <summary> Records attempts to submit a password on a form in an about:blank frame, - indicating whether this attempt is for a main frame or subframe. Recorded + indicating whether this attempt is for a main frame or subframe. Recorded once per form submission. </summary> </histogram> @@ -72988,7 +72913,7 @@ Records successful fills of prefilled username values known as placeholders and unsuccessful fills that were blocked because the prefilled value was not identified as a placeholder. Recorded once per PasswordAutofillAgent - instance, when attempting to fill a password form that contains a username + instance, when attempting to fill a password form that contains a username value which was prepopulated by the website. </summary> </histogram> @@ -73406,7 +73331,7 @@ were `suppressed` credentials, meaning stored credentials that were not filled because they were for an origin that was similar to, but not exactly (or PSL) matching the origin of the observed form (see the suffix - description for the possible classes of such near-matches). If there were + description for the possible classes of such near-matches). If there were such credentials, the histogram also records whether the username and password of such suppressed credentials matched those submitted. </summary> @@ -74943,7 +74868,7 @@ <owner>bsimonnet@chromium.org</owner> <summary> Count of crashes (user, kernel, and unclean shutdowns) during the previous - day, or the most recent day the device was in use. Reported at most once a + day, or the most recent day the device was in use. Reported at most once a day. </summary> </histogram> @@ -74953,9 +74878,9 @@ <owner>bsimonnet@chromium.org</owner> <summary> Count of crashes (user, kernel, and unclean shutdowns) during the previous - epoch-week, or the most recent epoch-week the device was in use. Reported - at most once a week. Epoch-weeks divide the time in 7-day intervals - starting at the UNIX epoch. + epoch-week, or the most recent epoch-week the device was in use. Reported at + most once a week. Epoch-weeks divide the time in 7-day intervals starting at + the UNIX epoch. </summary> </histogram> @@ -74963,10 +74888,10 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Chrome OS (ARM Chromebooks using Exynos 5250 only) Adaptive Support Voltage - Group, recorded once per bootup. Indicates which "bin" the SoC is + Group, recorded once per bootup. Indicates which "bin" the SoC is part of, which sets the voltage that different rails on the system will run - at. The values 0-11 are valid. A value of 12 indicates an error parsing - dmesg and should be investigated. See also Platform.LotIdEnum. + at. The values 0-11 are valid. A value of 12 indicates an error parsing + dmesg and should be investigated. See also Platform.LotIdEnum. </summary> </histogram> @@ -75048,7 +74973,7 @@ <summary> CPU frequency as percent of the baseline frequency, sampled every 30s. This may be throttled down from 100% due to power dissipation issues (too high - temperature). It may also be throttled up (turbo), but the kernel does not + temperature). It may also be throttled up (turbo), but the kernel does not report the actual turbo frequency, so we put such samples in the 101% bucket. </summary> @@ -75058,7 +74983,7 @@ <owner>sonnyrao@chromium.org</owner> <owner>cast-analytics@google.com</owner> <summary> - Peak total (single core) CPU usage for the last sample interval. The sample + Peak total (single core) CPU usage for the last sample interval. The sample interval may vary from seconds to several minutes. </summary> </histogram> @@ -75105,8 +75030,8 @@ <owner>jwerner@chromium.org</owner> <owner>vapier@chromium.org</owner> <summary> - Generic event of interest from Chrome OS. Intended mainly to help assess - the frequency of rare error conditions. + Generic event of interest from Chrome OS. Intended mainly to help assess the + frequency of rare error conditions. </summary> </histogram> @@ -75124,7 +75049,7 @@ <owner>semenzato@chromium.org</owner> <owner>bsimonnet@chromium.org</owner> <summary> - Total CPU time accumulated since the last version update. Reported at most + Total CPU time accumulated since the last version update. Reported at most once a day. </summary> </histogram> @@ -75143,7 +75068,7 @@ <owner>bsimonnet@chromium.org</owner> <summary> Total use time (device ON and not asleep) in the previous day, or the most - recent day the device was in use. Reported at most once a day. + recent day the device was in use. Reported at most once a day. </summary> </histogram> @@ -75151,7 +75076,7 @@ <owner>kitching@google.com</owner> <summary> Ratio of time a detachable base keyboard is active, i.e. when the USB - interface is not auto-suspended. Reported every 30 seconds when the base is + interface is not auto-suspended. Reported every 30 seconds when the base is connected. </summary> </histogram> @@ -75160,7 +75085,7 @@ <owner>kitching@google.com</owner> <summary> For devices with a detachable base: whether or not the base is connected on - boot. Recorded by upstart task on boot. + boot. Recorded by upstart task on boot. </summary> </histogram> @@ -75176,14 +75101,14 @@ <summary> Detachable base firmware updates can be configured to only occur on boot. In this mode, any update will be considered "pending" until the - system is rebooted, at which point the update may take place. Every time a + system is rebooted, at which point the update may take place. Every time a detachable base is connected to the system, a metric representing the - pending update status is recorded. Its possible values are as follows: (0) + pending update status is recorded. Its possible values are as follows: (0) communication error; (1) no update available; (2) critical update available; - or (3) non-critical update available. The definition of - "critical" is up to the software performing updates, and would - typically be used in the case of a security issue, or broken functionality - in a previous firmware version. + or (3) non-critical update available. The definition of "critical" + is up to the software performing updates, and would typically be used in the + case of a security issue, or broken functionality in a previous firmware + version. </summary> </histogram> @@ -75359,8 +75284,8 @@ enum="IntelMaxMicroArchitecture"> <owner>fbarchard@chromium.org</owner> <summary> - The maximum supported micro-architecture on an Intel platform. This value - is logged at program start time. + The maximum supported micro-architecture on an Intel platform. This value is + logged at program start time. </summary> </histogram> @@ -75369,7 +75294,7 @@ <owner>bsimonnet@chromium.org</owner> <summary> Count of kernel crashes during the previous day, or the most recent day the - device was in use. Reported at most once a day. + device was in use. Reported at most once a day. </summary> </histogram> @@ -75388,7 +75313,7 @@ <owner>bsimonnet@chromium.org</owner> <summary> Count of kernel crashes since the last OS update, normalized as number - crashes per year of CPU time. Reported daily. + crashes per year of CPU time. Reported daily. </summary> </histogram> @@ -75405,7 +75330,7 @@ <owner>bsimonnet@chromium.org</owner> <summary> Count of kernel crashes during the previous epoch-week, or the most recent - epoch-week the device was in use. Reported at most once a week. Epoch-weeks + epoch-week the device was in use. Reported at most once a week. Epoch-weeks divide the time in 7-day intervals starting at the UNIX epoch. </summary> </histogram> @@ -75414,7 +75339,7 @@ <owner>semenzato@chromium.org</owner> <owner>bsimonnet@chromium.org</owner> <summary> - Time elapsed between the last two kernel crashes. Sent after every kernel + Time elapsed between the last two kernel crashes. Sent after every kernel crash. </summary> </histogram> @@ -75422,13 +75347,13 @@ <histogram name="Platform.KernelWarningHashes" expires_after="2018-08-30"> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - The 32-bit hash of a kernel warning. This is the hash of the + The 32-bit hash of a kernel warning. This is the hash of the "file:line" string corresponding to the location of the warning, for instance: "/mnt/host/source/src/third_party/kernel/files/drivers - /gpu/drm/i915/intel_dp.c:351" (ignore spurious spaces). The hash is + /gpu/drm/i915/intel_dp.c:351" (ignore spurious spaces). The hash is produced by this code: while (*string) hash = (hash << 5) + hash + - *string++; Separately each warning is also collected (with its hash) via - the crash reporter, but only its first occurrence in each boot session. + *string++; Separately each warning is also collected (with its hash) via the + crash reporter, but only its first occurrence in each boot session. </summary> </histogram> @@ -75444,10 +75369,10 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Chrome OS (ARM Chromebooks using Exynos 5250 only) indication about whether - we're part of a special lot ID. Special lot IDs are groups of chips that + we're part of a special lot ID. Special lot IDs are groups of chips that have special case handling in the kernel for the Adaptive Support Voltage - code (the normal logic doesn't work). See also Platform.AsvGroup. Note - that fused devices are never part of a special lot (currently) and only some + code (the normal logic doesn't work). See also Platform.AsvGroup. Note that + fused devices are never part of a special lot (currently) and only some unfused lots are "special". </summary> </histogram> @@ -75605,10 +75530,10 @@ <owner>vpalatin@google.com</owner> <summary> USB device ID of the charger plugged into a Spring device (if any), sent - once a minute. The Device ID is composed from the following 4 8-bit + once a minute. The Device ID is composed from the following 4 8-bit registers of the TSU6721 chip: ADC (07h), Device Type 3 (15h), Device Type 2 - (0Bh), Device Type 1 (0Ah). Device Type 1/2/3 is a bitmap and most of bits - are mutually exclusive (excepted VBUS debounce). ADC is the 5-bit value of + (0Bh), Device Type 1 (0Ah). Device Type 1/2/3 is a bitmap and most of bits + are mutually exclusive (excepted VBUS debounce). ADC is the 5-bit value of the ID pin, but for most types (as in Device Type), there are only one or two possible ID pin connections/values. The datasheet can be found here: http://www.ti.com/lit/ds/symlink/tsu6721.pdf. @@ -75654,7 +75579,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75665,7 +75590,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75676,7 +75601,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75687,7 +75612,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75698,7 +75623,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75709,7 +75634,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75720,7 +75645,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75731,7 +75656,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75742,7 +75667,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75753,7 +75678,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75764,7 +75689,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75775,7 +75700,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75786,7 +75711,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75797,7 +75722,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75808,7 +75733,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75819,7 +75744,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75831,7 +75756,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75843,7 +75768,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75855,7 +75780,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75867,7 +75792,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75879,7 +75804,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75891,7 +75816,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75903,7 +75828,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75915,7 +75840,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75927,7 +75852,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75939,7 +75864,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75951,7 +75876,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75963,7 +75888,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75975,7 +75900,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75987,7 +75912,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -75999,7 +75924,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76011,7 +75936,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. + scroll event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76022,7 +75947,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a tab - switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76033,7 +75958,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a tab - switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76044,7 +75969,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a tab - switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76055,7 +75980,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a tab - switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76066,7 +75991,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a tab - switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76077,7 +76002,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a tab - switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76088,7 +76013,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a tab - switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76099,7 +76024,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a tab - switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76110,7 +76035,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a tab - switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76121,7 +76046,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a tab - switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76132,7 +76057,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a tab - switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76143,7 +76068,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a tab - switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76154,7 +76079,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a tab - switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76165,7 +76090,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a tab - switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76176,7 +76101,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a tab - switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76187,7 +76112,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> CPU utilization for the specified swap group and time interval after a tab - switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76199,7 +76124,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76211,7 +76136,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76223,7 +76148,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76235,7 +76160,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76247,7 +76172,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76259,7 +76184,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76271,7 +76196,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76283,7 +76208,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76295,7 +76220,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76307,7 +76232,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76319,7 +76244,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76331,7 +76256,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76343,7 +76268,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76355,7 +76280,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76367,7 +76292,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76379,7 +76304,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Page faults/second for the specified swap group and time interval after a - tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. + tab switch event. See src/chrome/browser/chromeos/swap_metrics.cc. </summary> </histogram> @@ -76558,7 +76483,7 @@ <owner>semenzato@chromium.org</owner> <summary> Each sample is the result code of a TPM authorized command issued through - tcsd. Success is 0. For the other error codes, see + tcsd. Success is 0. For the other error codes, see /usr/include/tss/tpm_error.h. </summary> </histogram> @@ -76567,7 +76492,7 @@ <owner>dkrahn@chromium.org</owner> <summary> Each sample is the value of the TPM dictionary attack counter reported at - boot and hourly while running. Any non-zero value is unexpected. + boot and hourly while running. Any non-zero value is unexpected. </summary> </histogram> @@ -76584,7 +76509,7 @@ <owner>semenzato@chromium.org</owner> <summary> Each sample is the result code of a TPM command issued through tcsd. Success - is 0. For the other error codes, see /usr/include/tss/tpm_error.h. + is 0. For the other error codes, see /usr/include/tss/tpm_error.h. </summary> </histogram> @@ -76641,18 +76566,18 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - Retries needed to enable a FET on tps65090 (AKA tpschrome). Tps65090 is a - power management unit (PMU) used on many ARM Chromebooks. Until version ES7 + Retries needed to enable a FET on tps65090 (AKA tpschrome). Tps65090 is a + power management unit (PMU) used on many ARM Chromebooks. Until version ES7 was rolled into production we would sometimes run into a problem where FET1 (the FET used to switch on and off the backlight) wouldn't turn on properly. This problem was especially prevalent when the voltage was high (like when - the device was plugged into the wall). Retrying by turning the FET off and + the device was plugged into the wall). Retrying by turning the FET off and on again is nearly always effective, so the kernel will retry up to 5 times - (currently) and will also log the fact that it needed to retry. On newest + (currently) and will also log the fact that it needed to retry. On newest kernels (kernel 3.8 and up) a kernel warning will be logged with WARN_ON if the FET still failed to turn on after 5 tries. Refer to the kernel warning - reports to find that information. For more details about this bug refer to - http://crbug.com/338657 and http://crosbug.com/p/16009. Note that we log + reports to find that information. For more details about this bug refer to + http://crbug.com/338657 and http://crosbug.com/p/16009. Note that we log retries on all 7 FETs even though we've only ever seen failures of FET1. </summary> </histogram> @@ -76662,7 +76587,7 @@ <owner>bsimonnet@chromium.org</owner> <summary> Count of crashes (unclean shutdown) during the previous day, or the most - recent day the device was in use. Reported at most once a day. + recent day the device was in use. Reported at most once a day. </summary> </histogram> @@ -76671,7 +76596,7 @@ <owner>bsimonnet@chromium.org</owner> <summary> Count of crashes (user) during the previous day, or the most recent day the - device was in use. Reported at most once a day. + device was in use. Reported at most once a day. </summary> </histogram> @@ -76720,8 +76645,8 @@ <histogram name="Platform.ZramCompressedSize" units="MB"> <owner>semenzato@google.com</owner> <summary> - Compressed swap size in megabytes. This is the actual amount of RAM used by - the system to compress memory (i.e. after compression). Snapshot every 30s. + Compressed swap size in megabytes. This is the actual amount of RAM used by + the system to compress memory (i.e. after compression). Snapshot every 30s. </summary> </histogram> @@ -76740,17 +76665,17 @@ <histogram name="Platform.ZramSavings" units="MB"> <owner>semenzato@google.com</owner> <summary> - RAM savings in megabytes from using memory compression. This is the - difference between the RAM size before and after compression. Snapshot - every 30s. + RAM savings in megabytes from using memory compression. This is the + difference between the RAM size before and after compression. Snapshot every + 30s. </summary> </histogram> <histogram name="Platform.ZramZeroPages" units="pages"> <owner>semenzato@google.com</owner> <summary> - Number of zero-filled pages that the OS is compressing. A large number - suggests wasteful allocation. Snapshot every 30s. + Number of zero-filled pages that the OS is compressing. A large number + suggests wasteful allocation. Snapshot every 30s. </summary> </histogram> @@ -76915,7 +76840,7 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - Time from "begin" to "commit." "Begin"== + Time from "begin" to "commit." "Begin"== "request" if user requested, and "start" otherwise. "Request"== time when user requested document. "Start"== time when renderer requested load of document, after any unload of last @@ -77268,7 +77193,7 @@ </obsolete> <owner>pmeenan@chromium.org</owner> <summary> - Time from "begin" to "first paint." "Begin"== + Time from "begin" to "first paint." "Begin"== "request" if user requested, and "start" otherwise. "Request"== time when user requested document. "Start"== time when renderer requested load of document, after any unload of last @@ -77298,7 +77223,7 @@ <summary> Time from "big" to "first paint after load." "Begin"== "request" if user requested, and - "start" otherwise. "Request"== time when user requested + "start" otherwise. "Request"== time when user requested document. "Start"== time when renderer requested load of document, after any unload of last document. "First paint after load"== time after onload() when first paint operation is performed. @@ -77312,7 +77237,7 @@ <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Time from "commit" to "finish." "Commit"== - time when renderer got first byte of document. "Finish"==after + time when renderer got first byte of document. "Finish"==after onload() and all resources are loaded. </summary> </histogram> @@ -77988,8 +77913,8 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - Time from "request" to "finish." "Request" == - time when user requested document. "Finish" == after onload() and + Time from "request" to "finish." "Request" == + time when user requested document. "Finish" == after onload() and all resources are loaded. </summary> </histogram> @@ -78195,7 +78120,7 @@ <owner>wfh@chromium.org</owner> <summary> Records whether NPAPI plugins are supported by the platform, and if so, - whether they are enabled or disabled. Recorded once at browser startup. + whether they are enabled or disabled. Recorded once at browser startup. </summary> </histogram> @@ -78324,7 +78249,7 @@ <histogram name="Power.BatteryChargeHealth" units="%"> <owner>derat@chromium.org</owner> <summary> - Chrome OS battery charge health percentage. Sampled once when device starts + Chrome OS battery charge health percentage. Sampled once when device starts charging. </summary> </histogram> @@ -78336,14 +78261,14 @@ </obsolete> <owner>jeremy@chromium.org</owner> <summary> - The percentage of battery capacity used per hour relative to a full - battery. Reported once when the power adaptor is plugged back in after the - system is on battery power for more than 30 minutes. If at any point the - system is suspended or all Chrome renderers are closed the measurement is - not recorded. Anytime the user unplugs the power adaptor, a new measurement - will begin being recorded. Collection of this histogram only starts after 30 + The percentage of battery capacity used per hour relative to a full battery. + Reported once when the power adaptor is plugged back in after the system is + on battery power for more than 30 minutes. If at any point the system is + suspended or all Chrome renderers are closed the measurement is not + recorded. Anytime the user unplugs the power adaptor, a new measurement will + begin being recorded. Collection of this histogram only starts after 30 minutes of uptime at which point the clock starts (assuming the user is on - battery power at that point). The system will need to remain unplugged for + battery power at that point). The system will need to remain unplugged for at least another 30 minutes in order for any measurement to be recorded. Values are normalized to a percent per hour scale. This measurement is tied tightly to hardware model/OS and is not comparable across different hardware @@ -78366,11 +78291,11 @@ </obsolete> <owner>jeremy@chromium.org</owner> <summary> - The percent of depleted battery capacity relative to a full battery over - the first 15 minutes after battery power collection information starts. + The percent of depleted battery capacity relative to a full battery over the + first 15 minutes after battery power collection information starts. Collection of this histogram only starts after 30 minutes of uptime at which point the clock starts (assuming the user is on battery power at that - point). The system will need to remain unplugged for at least another 15 + point). The system will need to remain unplugged for at least another 15 minutes in order for any measurement to be recorded. Values are normalized to a percent per hour scale. This measurement is tied tightly to hardware model/OS and is not comparable across different hardware configurations. @@ -78384,11 +78309,11 @@ </obsolete> <owner>jeremy@chromium.org</owner> <summary> - The percent of depleted battery capacity relative to a full battery over - the first 30 minutes after battery power collection information starts. + The percent of depleted battery capacity relative to a full battery over the + first 30 minutes after battery power collection information starts. Collection of this histogram only starts after 30 minutes of uptime at which point the clock starts (assuming the user is on battery power at that - point). The system will need to remain unplugged for at least another 30 + point). The system will need to remain unplugged for at least another 30 minutes in order for any measurement to be recorded. Values are normalized to a percent per hour scale. This measurement is tied tightly to hardware model/OS and is not comparable across different hardware configurations. @@ -78402,11 +78327,11 @@ </obsolete> <owner>jeremy@chromium.org</owner> <summary> - The percent of depleted battery capacity relative to a full battery over - the first 5 minutes after battery power collection information starts. + The percent of depleted battery capacity relative to a full battery over the + first 5 minutes after battery power collection information starts. Collection of this histogram only starts after 30 minutes of uptime at which point the clock starts (assuming the user is on battery power at that - point). The system will need to remain unplugged for at least another 5 + point). The system will need to remain unplugged for at least another 5 minutes in order for any measurement to be recorded. Values are normalized to a percent per hour scale. This measurement is tied tightly to hardware model/OS and is not comparable across different hardware configurations. @@ -78498,7 +78423,7 @@ <owner>dianders@chromium.org</owner> <summary> Chrome OS (Snow RO firmware 2695.90.0 only) number of 8K chunks that were - fixed (memory corruption corrected) for each suspend/resume cycle. Expect 0 + fixed (memory corruption corrected) for each suspend/resume cycle. Expect 0 around 97% of the time and a non-zero value around 3% of the time. </summary> </histogram> @@ -78507,8 +78432,8 @@ <owner>dianders@chromium.org</owner> <summary> Chrome OS (Snow RO firmware 2695.90.0 only) number of 4-byte words that were - fixed (memory corruption corrected) for each suspend/resume cycle. Expect 0 - around 97% of the time and a non-zero value around 3% of the time. Would be + fixed (memory corruption corrected) for each suspend/resume cycle. Expect 0 + around 97% of the time and a non-zero value around 3% of the time. Would be exactly equal to Power.BitfixChunks if there were only one corrupted word in each chunk but is sometimes several times higher. </summary> @@ -78613,9 +78538,9 @@ <histogram name="Power.DarkResumeWakeupsPerHour"> <owner>chirantan@chromium.org</owner> <summary> - The number of times a system woke up in dark resume in an hour. Note that + The number of times a system woke up in dark resume in an hour. Note that this value is scaled up or down to an hour based on the amount of time the - system spent in suspend. So if the system suspended for 20 minutes and woke + system spent in suspend. So if the system suspended for 20 minutes and woke up 3 times, it would report a value of 9. </summary> </histogram> @@ -78917,7 +78842,7 @@ <owner>derat@chromium.org</owner> <summary> The number of times that the Automatic Light Sensor (ALS) adjusted the - brightness during a session. Values for this metric are clamped to 10k + brightness during a session. Values for this metric are clamped to 10k count, so the last bucket should be considered to be including all metrics above 10k. </summary> @@ -79078,7 +79003,7 @@ <owner>derat@chromium.org</owner> <summary> The percentage of aborted fan attempts out of total fan attempts per - session, where an abort is due to hysteresis. This value is computed from + session, where an abort is due to hysteresis. This value is computed from boot and sent when powerd starts and then every 15 minutes afterwards. </summary> </histogram> @@ -79896,7 +79821,7 @@ <summary> Time from when a prerendered page is started to when it is first used due to user navigation. If the page is never used, it is not included in this - histogram. This only refers to prerenders based on the local predictor. + histogram. This only refers to prerenders based on the local predictor. </summary> </histogram> @@ -79960,11 +79885,11 @@ <owner>kouhei@chromium.org</owner> <summary> Number of bytes transferred on the network for URLRequests (not including - HTTP/TLS/TCP/IP overhead). Reported on event of a PrerenderContents - deletion. Includes prerender bytes. Bytes are only counted when - prerendering is enabled and not in a control group. The sum of the - distribution for a single user represents all of that user's network - transfers for resource for that time period while prerendering was enabled. + HTTP/TLS/TCP/IP overhead). Reported on event of a PrerenderContents + deletion. Includes prerender bytes. Bytes are only counted when prerendering + is enabled and not in a control group. The sum of the distribution for a + single user represents all of that user's network transfers for resource for + that time period while prerendering was enabled. </summary> </histogram> @@ -80001,11 +79926,11 @@ <owner>kouhei@chromium.org</owner> <summary> Number of bytes transferred on the network for URLRequests (not including - HTTP/TLS/TCP/IP overhead). Reported on event of a PrerenderContents - deletion. Includes prerender bytes. Bytes are only counted when - prerendering is enabled and not in a control group. The sum of the - distribution for a single user represents all of that user's network - transfers for resource for that time period while prerendering was enabled. + HTTP/TLS/TCP/IP overhead). Reported on event of a PrerenderContents + deletion. Includes prerender bytes. Bytes are only counted when prerendering + is enabled and not in a control group. The sum of the distribution for a + single user represents all of that user's network transfers for resource for + that time period while prerendering was enabled. </summary> </histogram> @@ -80193,7 +80118,7 @@ <histogram name="Prerender.PerceivedPageLoadTime_Control" units="ms"> <obsolete> - Deprecated 03/24/11. Replaced by + Deprecated 03/24/11. Replaced by Prerender.PerceivedPLT_ContentPrefetchPrerenderControl. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> @@ -80210,7 +80135,7 @@ <histogram name="Prerender.PerceivedPageLoadTime_PrerenderMatchControl" units="ms"> <obsolete> - Deprecated 03/24/11. Replaced by + Deprecated 03/24/11. Replaced by Prerender.PerceivedPLTMatched_ContentPrefetchPrerenderControl. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> @@ -80227,7 +80152,7 @@ <histogram name="Prerender.PerceivedPageLoadTime_PrerenderMatchTreatment" units="ms"> <obsolete> - Deprecated 03/24/11. Replaced by + Deprecated 03/24/11. Replaced by Prerender.PerceivedPLTMatched_ContentPrefetchPrerender. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> @@ -80243,7 +80168,7 @@ <histogram name="Prerender.PerceivedPageLoadTime_Treatment" units="ms"> <obsolete> - Deprecated 03/24/11. Replaced by + Deprecated 03/24/11. Replaced by Prerender.PerceivedPLT_ContentPrefetchPrerender. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> @@ -80259,7 +80184,7 @@ <histogram name="Prerender.PerceivedPageLoadTime_WindowControl" units="ms"> <obsolete> - Deprecated 03/24/11. Replaced by + Deprecated 03/24/11. Replaced by Prerender.PerceivedPLTWindowed_ContentPrefetchPrerenderControl. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> @@ -80275,7 +80200,7 @@ <histogram name="Prerender.PerceivedPageLoadTime_WindowTreatment" units="ms"> <obsolete> - Deprecated 03/24/11. Replaced by + Deprecated 03/24/11. Replaced by Prerender.PerceivedPLTWindowed_ContentPrefetchPrerender. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> @@ -80329,8 +80254,8 @@ portion of load prior to navigation. "FirstAfterMiss" means the first pageload after a prerender miss. - There are two types: Any, and Non-overlapping. The latter only applies to - page loads initiated after the prerender. This variable records cases where + There are two types: Any, and Non-overlapping. The latter only applies to + page loads initiated after the prerender. This variable records cases where only Any triggered. </summary> </histogram> @@ -80346,8 +80271,8 @@ portion of load prior to navigation. "FirstAfterMiss" means the first pageload after a prerender miss. - There are two types: Any, and Non-overlapping. The latter only applies to - page loads initiated after the prerender. This variable records cases where + There are two types: Any, and Non-overlapping. The latter only applies to + page loads initiated after the prerender. This variable records cases where both triggered. </summary> </histogram> @@ -80380,8 +80305,8 @@ portion of load prior to navigation. "FirstAfterMiss" means the first pageload after a prerender miss. - There are two types: Any, and Non-overlapping. The latter only applies to - page loads initiated after the prerender. This variable records cases where + There are two types: Any, and Non-overlapping. The latter only applies to + page loads initiated after the prerender. This variable records cases where only Non-overlapping triggered. </summary> </histogram> @@ -80722,7 +80647,7 @@ <histogram name="Prerender.TimeUntilUsed" units="ms"> <obsolete> - deprecated Nov 16 2012. See Prerender.TimeUntilUsed2, which has a larger + deprecated Nov 16 2012. See Prerender.TimeUntilUsed2, which has a larger range. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> @@ -81002,14 +80927,14 @@ <owner>skau@chromium.org</owner> <summary> Record if the request for IPP attributes was successful during printer - setup. This only occurs for setup attempts of IPP and IPPS printers. + setup. This only occurs for setup attempts of IPP and IPPS printers. </summary> </histogram> <histogram name="Printing.CUPS.JobResult" enum="PrintJobResult"> <owner>skau@chromium.org</owner> <summary> - The final status of every print job that was succesfully queued. Only used + The final status of every print job that was succesfully queued. Only used on Chrome OS. </summary> </histogram> @@ -81018,7 +80943,7 @@ <owner>skau@chromium.org</owner> <summary> Records the source of PostScript Printer Description files used during - printer setup. Entries are recorded for every attempted configuration. Only + printer setup. Entries are recorded for every attempted configuration. Only recorded on Chrome OS. </summary> </histogram> @@ -81026,16 +80951,16 @@ <histogram name="Printing.CUPS.PrinterAdded" enum="PrinterProtocol"> <owner>skau@chromium.org</owner> <summary> - The protocol for a printer that was added. Used to track printer churn by - protocol. Only on Chrome OS. + The protocol for a printer that was added. Used to track printer churn by + protocol. Only on Chrome OS. </summary> </histogram> <histogram name="Printing.CUPS.PrinterRemoved" enum="PrinterProtocol"> <owner>skau@chromium.org</owner> <summary> - The protocol for a printer that was removed. Used to track printer churn by - protocol. Only on Chrome OS. + The protocol for a printer that was removed. Used to track printer churn by + protocol. Only on Chrome OS. </summary> </histogram> @@ -81043,32 +80968,31 @@ <owner>skau@chromium.org</owner> <summary> The number of printers shown in the discovered printers dialog during - printer set up. Only recorded on Chrome OS. + printer set up. Only recorded on Chrome OS. </summary> </histogram> <histogram name="Printing.CUPS.PrinterSetupResult" enum="PrinterSetupResult"> <owner>skau@chromium.org</owner> <summary> - The success or error code for the setup of a CUPS printer. Recorded when - setup is attempted through the settings dialogs. Only recorded on Chrome - OS. + The success or error code for the setup of a CUPS printer. Recorded when + setup is attempted through the settings dialogs. Only recorded on Chrome OS. </summary> </histogram> <histogram name="Printing.CUPS.PrintJobsQueued" units="count"> <owner>skau@chromium.org</owner> <summary> - The size of the print queue when a print job is initially queued. When the - first job is started, a zero is recorded. Only used on Chrome OS. + The size of the print queue when a print job is initially queued. When the + first job is started, a zero is recorded. Only used on Chrome OS. </summary> </histogram> <histogram name="Printing.CUPS.ProtocolUsed" enum="PrinterProtocol"> <owner>skau@chromium.org</owner> <summary> - Records the protocol for a selected printer in Chrome OS. Used to track - usage of the various printer protocols. Since a selection occurs when print + Records the protocol for a selected printer in Chrome OS. Used to track + usage of the various printer protocols. Since a selection occurs when print preview is opened, this will count at least one every time that happens if a CUPS printer was selected. </summary> @@ -82694,7 +82618,7 @@ <owner>calamity@chromium.org</owner> <summary> The number of days since the evicted origin was last accessed. Logged when - the origin is evicted. + the origin is evicted. </summary> </histogram> @@ -83228,7 +83152,7 @@ <histogram name="Renderer2.RequestToFinish"> <obsolete> - Deprecated 6/15/09. Replaced by Renderer2.RequestToFinish_L + Deprecated 6/15/09. Replaced by Renderer2.RequestToFinish_L </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> @@ -83361,7 +83285,7 @@ <histogram name="Renderer4.BeginToCommit" units="ms"> <owner>wiltzius@chromium.org</owner> <summary> - Time from "begin" to "commit." "Begin"== + Time from "begin" to "commit." "Begin"== "request" if user requested, and "start" otherwise. "Request"== time when user requested document. "Start"== time when renderer requested load of document, after any unload of last @@ -83383,7 +83307,7 @@ <histogram name="Renderer4.BeginToFirstPaint" units="ms"> <owner>wiltzius@chromium.org</owner> <summary> - Time from "begin" to "first paint." "Begin"== + Time from "begin" to "first paint." "Begin"== "request" if user requested, and "start" otherwise. "Request"== time when user requested document. "Start"== time when renderer requested load of document, after any unload of last @@ -83397,7 +83321,7 @@ <summary> Time from "big" to "first paint after load." "Begin"== "request" if user requested, and - "start" otherwise. "Request"== time when user requested + "start" otherwise. "Request"== time when user requested document. "Start"== time when renderer requested load of document, after any unload of last document. "First paint after load"== time after onload() when first paint operation is performed. @@ -83418,7 +83342,7 @@ <owner>wiltzius@chromium.org</owner> <summary> Time from "commit" to "finish." "Commit"== - time when renderer got first byte of document. "Finish"==after + time when renderer got first byte of document. "Finish"==after onload() and all resources are loaded. </summary> </histogram> @@ -83602,7 +83526,7 @@ <histogram name="Renderer4.GpuImageUploadState.FirstRefWasted" enum="BooleanWasted"> <obsolete> - Deprecated as of 06/2017. No longer generated. + Deprecated as of 06/2017. No longer generated. </obsolete> <owner>vmpstr@chromium.org</owner> <summary> @@ -83614,7 +83538,7 @@ <histogram name="Renderer4.GpuImageUploadState.Used" enum="BooleanUsage"> <obsolete> - Deprecated as of 06/2017. No longer generated. + Deprecated as of 06/2017. No longer generated. </obsolete> <owner>vmpstr@chromium.org</owner> <summary> @@ -83766,7 +83690,7 @@ <histogram name="Renderer4.LCDText.PercentageOfAALayers" units="%"> <obsolete> - Deprecated as of 02/2015. No longer generated. + Deprecated as of 02/2015. No longer generated. </obsolete> <owner>wiltzius@chromium.org</owner> <summary> @@ -83779,12 +83703,12 @@ <histogram name="Renderer4.LCDText.PercentageOfCandidateLayers" units="%"> <obsolete> - Deprecated as of 02/2015. No longer generated. + Deprecated as of 02/2015. No longer generated. </obsolete> <owner>wiltzius@chromium.org</owner> <summary> The ratio of CC Layers which are candidates for LCDText AA / total picture - or content Layers. Recorded in LayerTreeHost, after + or content Layers. Recorded in LayerTreeHost, after LayerTreeHostCommon::CalculateDrawProperties() has computed the properties we need. Only recorded for the first 50 frames of every page. </summary> @@ -83905,8 +83829,8 @@ <histogram name="Renderer4.RequestToFinish" units="ms"> <owner>wiltzius@chromium.org</owner> <summary> - Time from "request" to "finish." "Request"== - time when user requested document. "Finish"==after onload() and + Time from "request" to "finish." "Request"== + time when user requested document. "Finish"==after onload() and all resources are loaded. </summary> </histogram> @@ -84089,7 +84013,7 @@ <owner>wiltzius@chromium.org</owner> <summary> Number of pixels uploaded to texture memory and not known opaque, normalized - to the viewport size. This is collected once per commit from WebKit to the + to the viewport size. This is collected once per commit from WebKit to the compositor. </summary> </histogram> @@ -84539,7 +84463,7 @@ <owner>altimin@chromium.org</owner> <summary> Total duration of dedicated worker tasks (thread time) split by per thread - type. Reported each time when task is completed and current accumulated + type. Reported each time when task is completed and current accumulated duration is longer than 1ms. Note that this metric discards tasks longer than 30 seconds because they are @@ -84781,7 +84705,7 @@ <owner>altimin@chromium.org</owner> <summary> Total duration of dedicated worker tasks (wall time) split by per thread - type. Reported each time when task is completed and current accumulated + type. Reported each time when task is completed and current accumulated duration is longer than 1ms. Note that this metric discards tasks longer than 30 seconds because they are @@ -86896,7 +86820,7 @@ The result of reading/parsing/accepting a new proto for the FileTypePolices repo of file extensions and their meta data. - This is for the file types loaded from the component-update system. This + This is for the file types loaded from the component-update system. This includes both those loaded from disk shortly after startup, and those received over the network when the component version changes </summary> @@ -86909,7 +86833,7 @@ Number of file types (aka file extensions) present in the FileTypePolicies proto loaded. - This is for the file types loaded from the component-update system. This + This is for the file types loaded from the component-update system. This includes both those loaded from disk shortly after startup, and those received over the network when the component version changes </summary> @@ -86920,9 +86844,9 @@ <owner>nparker@chromium.org</owner> <summary> Integer version number citing which version of the proto data chrome just - loaded. Latest version is in download_file_types.asciipb. + loaded. Latest version is in download_file_types.asciipb. - This is for the file types loaded from the component-update system. This + This is for the file types loaded from the component-update system. This includes both those loaded from disk shortly after startup, and those received over the network when the component version changes </summary> @@ -86935,7 +86859,7 @@ The result of reading/parsing/accepting a new proto for the FileTypePolices repo of file extensions and their meta data. - This is for the file types loaded from the resource bundle packaged with + This is for the file types loaded from the resource bundle packaged with Chrome, which is always loaded at startup. </summary> </histogram> @@ -86947,7 +86871,7 @@ Number of file types (aka file extensions) present in the FileTypePolicies proto loaded. - This is for the file types loaded from the resource bundle packaged with + This is for the file types loaded from the resource bundle packaged with Chrome, which is always loaded at startup. </summary> </histogram> @@ -86957,9 +86881,9 @@ <owner>nparker@chromium.org</owner> <summary> Integer version number citing which version of the proto data chrome just - loaded. Latest version is in download_file_types.asciipb. + loaded. Latest version is in download_file_types.asciipb. - This is for the file types loaded from the resource bundle packaged with + This is for the file types loaded from the resource bundle packaged with Chrome, which is always loaded at startup. </summary> </histogram> @@ -88086,7 +88010,7 @@ <histogram name="SB2.BuildReadBytes" units="bytes"> <obsolete> - Deprecated because it was exceeding the range. Replaced by + Deprecated because it was exceeding the range. Replaced by SB2.BuildReadKilobytes. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> @@ -88120,7 +88044,7 @@ <histogram name="SB2.BuildWriteBytes" units="bytes"> <obsolete> - Deprecated because it was exceeding the range. Replaced by + Deprecated because it was exceeding the range. Replaced by SB2.BuildWriteKilobytes. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> @@ -88183,7 +88107,7 @@ <histogram name="SB2.DatabaseBytes" units="bytes"> <obsolete> - Deprecated because it was exceeding the range. Replaced by + Deprecated because it was exceeding the range. Replaced by SB2.DatabaseKilobytes. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> @@ -88349,7 +88273,7 @@ <owner>felt@chromium.org</owner> <summary> Whether the user has Safe Browsing extended reporting enabled at the time a - Safe Browsing warning was dismissed. This tracks the fraction of all SB + Safe Browsing warning was dismissed. This tracks the fraction of all SB interstitials that had reporting enabled. </summary> </histogram> @@ -88415,7 +88339,7 @@ <histogram name="SB2.FilterSize" units="bytes"> <obsolete> - Deprecated because it was exceeding the range. Replaced by + Deprecated because it was exceeding the range. Replaced by SB2.FilterKilobytes. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> @@ -88439,7 +88363,7 @@ </obsolete> <owner>vakh@chromium.org</owner> <summary> - Collection of boolean events for SafeBrowsingFileStore instances. Includes + Collection of boolean events for SafeBrowsingFileStore instances. Includes corruptions detected, old versions detected, and various failures detected. </summary> </histogram> @@ -88496,8 +88420,8 @@ Track return status from GetHash attempts (STATUS_200, STATUS_204, NETWORK_ERROR, HTTP_ERROR, BACKOFF_ERROR), whether parsing a 200 result failed (PARSE_ERROR), and dispensation of returned values (EMPTY, HIT, - MISS). EMPTY means the response had no full hashes, and should contain all - of the 204 responses plus all *_ERROR cases. HIT means that one of the full + MISS). EMPTY means the response had no full hashes, and should contain all + of the 204 responses plus all *_ERROR cases. HIT means that one of the full hashes matched. MISS means that none of the hashes matched (there was a prefix collision). (PARSE_ERROR, NETWORK_ERROR, HTTP_ERROR, and BACKOFF_ERROR were added in M36.) @@ -88513,8 +88437,8 @@ Track return status from GetHash attempts (STATUS_200, STATUS_204, NETWORK_ERROR, HTTP_ERROR, BACKOFF_ERROR), whether parsing a 200 result failed (PARSE_ERROR), and dispensation of returned values (EMPTY, HIT, - MISS). EMPTY means the response had no full hashes, and should contain all - of the 204 responses plus all *_ERROR cases. HIT means that one of the full + MISS). EMPTY means the response had no full hashes, and should contain all + of the 204 responses plus all *_ERROR cases. HIT means that one of the full hashes matched. MISS means that none of the hashes matched (there was a prefix collision). (PARSE_ERROR, NETWORK_ERROR, HTTP_ERROR, and BACKOFF_ERROR were added in M36.) @@ -88524,8 +88448,8 @@ <histogram name="SB2.GetHashServerMiss"> <obsolete> Deprecated in favor of SB2.GetHashResult FULL_HASH_* and - SB2.BloomFilterFalsePositives. It is unclear if this histogram ever - reported useful data. + SB2.BloomFilterFalsePositives. It is unclear if this histogram ever reported + useful data. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> @@ -88596,7 +88520,7 @@ <owner>felt@chromium.org</owner> <summary> The time between when we show the SafeBrowsing malware interstitial and the - user expanding the "see more info" section of the page. (Only + user expanding the "see more info" section of the page. (Only applies to field trial version 2 of the interstitial.) </summary> </histogram> @@ -88678,7 +88602,7 @@ </obsolete> <owner>vakh@chromium.org</owner> <summary> - Indicates how sharded safe-browsing on-disk stores are. Values like 0 to 4 + Indicates how sharded safe-browsing on-disk stores are. Values like 0 to 4 are reasonable. </summary> </histogram> @@ -88696,7 +88620,7 @@ <owner>felt@chromium.org</owner> <summary> The time between when we show the SafeBrowsing phishing interstitial and the - user expanding the "see more info" section of the page. (Only + user expanding the "see more info" section of the page. (Only applies to field trial version 2 of the interstitial.) </summary> </histogram> @@ -88740,7 +88664,7 @@ <owner>vakh@chromium.org</owner> <summary> The size of the PrefixSet storage in bits, divided by the number of prefixes - represented. Should almost always be 16. + represented. Should almost always be 16. </summary> </histogram> @@ -88777,7 +88701,7 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - For debugging PrefixSet. How many extra results GetPrefixes returns. + For debugging PrefixSet. How many extra results GetPrefixes returns. </summary> </histogram> @@ -88787,7 +88711,7 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - For debugging PrefixSet. How many fewer results GetPrefixes returns. + For debugging PrefixSet. How many fewer results GetPrefixes returns. </summary> </histogram> @@ -88809,7 +88733,7 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - For debugging PrefixSet. How far unsorted deltas are from expected value. + For debugging PrefixSet. How far unsorted deltas are from expected value. </summary> </histogram> @@ -88819,7 +88743,7 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - For debugging PrefixSet. Distance of unsorted elements from expected + For debugging PrefixSet. Distance of unsorted elements from expected location. </summary> </histogram> @@ -88830,8 +88754,8 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - For debugging PrefixSet. How far into the results unsorted elements were - found. Interesting values would be 0%, 50%, or 100%. + For debugging PrefixSet. How far into the results unsorted elements were + found. Interesting values would be 0%, 50%, or 100%. </summary> </histogram> @@ -88841,8 +88765,8 @@ </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> - For debugging PrefixSet. Size of unsorted sets. To see if there is a - problem with a particular size of dataset. + For debugging PrefixSet. Size of unsorted sets. To see if there is a problem + with a particular size of dataset. </summary> </histogram> @@ -88920,7 +88844,7 @@ <owner>nparker@chromium.org</owner> <summary> Number of outstanding calls for URLs getting classified through - RemoteSafeBrowsingDatabaseManager. The size of the queue is logged before + RemoteSafeBrowsingDatabaseManager. The size of the queue is logged before initiating each request. </summary> </histogram> @@ -88996,9 +88920,9 @@ <owner>nparker@chromium.org</owner> <summary> Result of URL-classification API calls from Chrome via - RemoteSafeBrowsingApiHandler. Logged after each URL is judged - safe/not-safe, or hits a deadline. The INTERNAL_ERROR cases are further - classified under SB2.RemoteCall.InternalErrorStatusCode. + RemoteSafeBrowsingApiHandler. Logged after each URL is judged safe/not-safe, + or hits a deadline. The INTERNAL_ERROR cases are further classified under + SB2.RemoteCall.InternalErrorStatusCode. </summary> </histogram> @@ -89006,7 +88930,7 @@ enum="SB2RemoteCallThreatSubType"> <owner>nparker@chromium.org</owner> <summary> - The threat sub-type annotated for URLs classified as PHA via remote calls + The threat sub-type annotated for URLs classified as PHA via remote calls through RemoteSafeBrowsingApiHandler. "PHA" classifications generate "malware" interstitials. </summary> @@ -89025,12 +88949,12 @@ <histogram name="SB2.ReportingIsEnabled" enum="BooleanEnabled"> <obsolete> - Deprecated 06/2014. Replaced by SB2.ExtendedReportingIsEnabled. + Deprecated 06/2014. Replaced by SB2.ExtendedReportingIsEnabled. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> Whether the user has Safe Browsing extended reporting enabled at the time a - Safe Browsing warning was dismissed. This tracks the fraction of all SB + Safe Browsing warning was dismissed. This tracks the fraction of all SB interstitials that had reporting enabled. </summary> </histogram> @@ -89068,7 +88992,7 @@ <histogram name="SB2.SetReportingEnabled" enum="BooleanEnabled"> <obsolete> - Deprecated 06/2014. Replaced by SB2.SetExtendedReportingEnabled. + Deprecated 06/2014. Replaced by SB2.SetExtendedReportingEnabled. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> @@ -89221,11 +89145,11 @@ <owner>vakh@chromium.org</owner> <summary> Older versions of the safe-browsing code incorrectly added additional - SBPrefix items when receiving full hashes. This caused errors when - calculating when to send gethash requests to the server. An additional pass - over the data has been added to remove the excess prefixes. This histogram + SBPrefix items when receiving full hashes. This caused errors when + calculating when to send gethash requests to the server. An additional pass + over the data has been added to remove the excess prefixes. This histogram tracks progress of that code for purposes of informing a decision on when to - remove the additional pass. See http://crbug.com/361248 . + remove the additional pass. See http://crbug.com/361248 . </summary> </histogram> @@ -89268,7 +89192,7 @@ <owner>nparker@chromium.org</owner> <summary> The original number of archived_binaries found in a DMG-like file when it's - scanned, if at least one is found. The actual number sent in the download + scanned, if at least one is found. The actual number sent in the download request may be capped below this value. </summary> </histogram> @@ -89531,7 +89455,7 @@ <owner>vakh@chromium.org</owner> <summary> The original number of archived_binaries found in a rar-like file when it's - scanned, if at least one is found. The actual number sent in the download + scanned, if at least one is found. The actual number sent in the download request may be capped below this value. </summary> </histogram> @@ -89615,7 +89539,7 @@ <owner>nparker@chromium.org</owner> <summary> The original number of archived_binaries found in a zip-like file when it's - scanned, if at least one is found. The actual number sent in the download + scanned, if at least one is found. The actual number sent in the download request may be capped below this value. </summary> </histogram> @@ -89709,7 +89633,7 @@ <histogram name="SBClientMalware.SentReports" enum="SBClientMalwareSentReports"> <owner>noelutz@chromium.org</owner> <summary> - Measures the success rate of sending malware reports. Sending a report can + Measures the success rate of sending malware reports. Sending a report can fail due to a client reaching the limit on the number of reports it can send per day or due to the report failing to be serialized. </summary> @@ -89723,12 +89647,12 @@ <histogram name="SBClientMalware.UnexpectedPageId" enum="BooleanHit"> <obsolete> - Deprecated 03/2014. That part of the code got deleted. + Deprecated 03/2014. That part of the code got deleted. </obsolete> <owner>noelutz@chromium.org</owner> <summary> Counts the number of times the page ID that completed the page load does not - match the browse info page ID. We expect that number to be zero. + match the browse info page ID. We expect that number to be zero. </summary> </histogram> @@ -89816,7 +89740,7 @@ <owner>gab@chromium.org</owner> <summary> The time that it took to resume DOM feature extraction for the phishing - classifier. Longer times may indicate that the page DOM changed between + classifier. Longer times may indicate that the page DOM changed between chunks of work and the extractor had to re-traverse up to the saved position. </summary> @@ -89850,7 +89774,7 @@ <owner>nparker@chromium.org</owner> <summary> The number of features which were omitted from phishing classification - because they were added with an illegal value. This would indicate a bug. + because they were added with an illegal value. This would indicate a bug. </summary> </histogram> @@ -89861,14 +89785,14 @@ <owner>mattm@chromium.org</owner> <summary> The number of times that the phishing detection service could not be - initialized due to an error parsing the private IP networks. This would + initialized due to an error parsing the private IP networks. This would indicate a bug. </summary> </histogram> <histogram name="SBClientPhishing.InvalidWhitelistExpression"> <obsolete> - Deprecated 12/2011. Whitelist entries are no longer part of + Deprecated 12/2011. Whitelist entries are no longer part of ClientPhishingResponse. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> @@ -89978,7 +89902,7 @@ <owner>noelutz@chromium.org</owner> <summary> The number of times that the limit on the number of phishing classifier - features for a page was reached. This may indicate a bug, or that + features for a page was reached. This may indicate a bug, or that kMaxFeatureSize is too small. </summary> </histogram> @@ -91442,7 +91366,7 @@ </obsolete> <summary> The number of dictionaries advertised in an HTTP GET transaction that - supports SDCH. Note that only non-zero advertisements are logged. + supports SDCH. Note that only non-zero advertisements are logged. </summary> </histogram> @@ -91452,7 +91376,7 @@ </obsolete> <summary> The reason why a blacklist blocking a request from advertising SDCH was - implemented. There is one entry in this histogram per inhibited request. + implemented. There is one entry in this histogram per inhibited request. </summary> </histogram> @@ -91473,7 +91397,7 @@ Deprecated 2017-9. </obsolete> <summary> - The fate, both on input and output, of dictionary requests. There is + The fate, both on input and output, of dictionary requests. There is intended to be two entries in this histogram for each Get-Dictionary seen (except failed requests are not currently tracked). </summary> @@ -91495,7 +91419,7 @@ </obsolete> <summary> Duration in time from when a request was made, until all bytes were - received. During the running of an SDCH latency experiment, these packets + received. During the running of an SDCH latency experiment, these packets were part of an SDCH encoded transmission made after the link had proven it was capable of handling SDCH compression. </summary> @@ -91507,7 +91431,7 @@ </obsolete> <summary> Duration in time from when a request was made, until all bytes were - received. During the running of an SDCH latency experiment, these packets + received. During the running of an SDCH latency experiment, these packets were part of a holdback, which precluded SDCH despite the fact that the link had proven it was capable of handling SDCH compression. </summary> @@ -91519,9 +91443,9 @@ </obsolete> <summary> Duration in time from the first byte of a request was received, until all - bytes were received. During the running of an SDCH latency experiment, - these packets were part of an SDCH encoded transmission made after the link - had proven it was capable of handling SDCH compression. + bytes were received. During the running of an SDCH latency experiment, these + packets were part of an SDCH encoded transmission made after the link had + proven it was capable of handling SDCH compression. </summary> </histogram> @@ -91531,9 +91455,9 @@ </obsolete> <summary> Duration in time from the first byte of a request was received, until all - bytes were received. During the running of an SDCH latency experiment, - these packets were part of a holdback, which precluded SDCH despite the fact - that the link had proven it was capable of handling SDCH compression. + bytes were received. During the running of an SDCH latency experiment, these + packets were part of a holdback, which precluded SDCH despite the fact that + the link had proven it was capable of handling SDCH compression. </summary> </histogram> @@ -91543,7 +91467,7 @@ </obsolete> <summary> Duration in time from when a request was made, until all bytes were - received. During the running of an SDCH latency experiment, these packets + received. During the running of an SDCH latency experiment, these packets were part of an SDCH encoded transmission made after the link had proven it was capable of handling SDCH compression. </summary> @@ -91555,7 +91479,7 @@ </obsolete> <summary> Duration in time from when a request was made, until all bytes were - received. During the running of an SDCH latency experiment, these packets + received. During the running of an SDCH latency experiment, these packets were part of a holdback, which precluded SDCH despite the fact that the link had proven it was capable of handling SDCH compression. </summary> @@ -91568,9 +91492,9 @@ <summary> Sampling only transmissions with 5 or more packets, the duration between receipt of the 1st **NON**-SDCH encoded packet to receipt of the 2nd packet, - for processing by the SDCH filter. Packet count boundaries are calculated + for processing by the SDCH filter. Packet count boundaries are calculated each time a read from the filter is called, assuming 1430 bytes of data per - packet since the last boundary calculation. This *tends* to properly count + packet since the last boundary calculation. This *tends* to properly count small packets, but can err if small packets come at roughly the same time. During the running of an SDCH latency experiment, these packets were part of a holdback, which precluded SDCH despite the fact that the link had proven @@ -91584,7 +91508,7 @@ </obsolete> <summary> The duration between receipt of the 1st holdback (non-SDCH encoded) packet - and receipt of the last packet. Only groups that are part of the holdback + and receipt of the last packet. Only groups that are part of the holdback (i.e., could have been sdch encoded) are sampled. </summary> </histogram> @@ -91596,9 +91520,9 @@ <summary> Sampling only transmissions with 5 or more packets, the duration between receipt of the 2nd **NON**-SDCH encoded packet to receipt of the 3rd packet, - for processing by the SDCH filter. Packet count boundaries are calculated + for processing by the SDCH filter. Packet count boundaries are calculated each time a read from the filter is called, assuming 1430 bytes of data per - packet since the last boundary calculation. This *tends* to properly count + packet since the last boundary calculation. This *tends* to properly count small packets, but can err if small packets come at roughly the same time. During the running of an SDCH latency experiment, these packets were part of a holdback, which precluded SDCH despite the fact that the link had proven @@ -91613,9 +91537,9 @@ <summary> Sampling only transmissions with 5 or more packets, the duration between receipt of the 3rd **NON**-SDCH encoded packet to receipt of the 4th packet, - for processing by the SDCH filter. Packet count boundaries are calculated + for processing by the SDCH filter. Packet count boundaries are calculated each time a read from the filter is called, assuming 1430 bytes of data per - packet since the last boundary calculation. This *tends* to properly count + packet since the last boundary calculation. This *tends* to properly count small packets, but can err if small packets come at roughly the same time. During the running of an SDCH latency experiment, these packets were part of a holdback, which precluded SDCH despite the fact that the link had proven @@ -91630,9 +91554,9 @@ <summary> Sampling only transmissions with 5 or more packets, the duration between receipt of the 4th **NON**-SDCH encoded packet to receipt of the 5th packet, - for processing by the SDCH filter. Packet count boundaries are calculated + for processing by the SDCH filter. Packet count boundaries are calculated each time a read from the filter is called, assuming 1430 bytes of data per - packet since the last boundary calculation. This *tends* to properly count + packet since the last boundary calculation. This *tends* to properly count small packets, but can err if small packets come at roughly the same time. During the running of an SDCH latency experiment, these packets were part of a holdback, which precluded SDCH despite the fact that the link had proven @@ -91646,12 +91570,12 @@ </obsolete> <summary> If SDCH decoding was disabled client side, this records how many URLs were - processed by the SDCH filter before disabling this feature. The most common + processed by the SDCH filter before disabling this feature. The most common number is 1, which happens when there is one home-page tab that contains SDCH encoded data, for which there is no dictionary loaded into the Chrome - process (yet), since Chrome was just restarted. Large values in this + process (yet), since Chrome was just restarted. Large values in this histogram are indicative of flaky decompression, that works for a while, and - then is disabled. Values of 2 or 3 may appear if a user has more than one + then is disabled. Values of 2 or 3 may appear if a user has more than one home page with a query, and restarts there browser. </summary> </histogram> @@ -91673,9 +91597,9 @@ <summary> Sampling only transmissions with 5 or more packets, the duration between receipt of the 1st SDCH encoded packet and receipt of the 2nd packet, for - processing by the SDCH filter. Packet count boundaries are calculated each + processing by the SDCH filter. Packet count boundaries are calculated each time a read from the filter is called, assuming 1430 bytes of data per - packet since the last boundary calculation. This *tends* to properly count + packet since the last boundary calculation. This *tends* to properly count small packets, but can err if small packets come at roughly the same time. </summary> </histogram> @@ -91697,9 +91621,9 @@ <summary> Sampling only transmissions with 5 or more packets, the duration between receipt of the 2nd SDCH encoded packet and receipt of the 3rd packet, for - processing by the SDCH filter. Packet count boundaries are calculated each + processing by the SDCH filter. Packet count boundaries are calculated each time a read from the filter is called, assuming 1430 bytes of data per - packet since the last boundary calculation. This *tends* to properly count + packet since the last boundary calculation. This *tends* to properly count small packets, but can err if small packets come at roughly the same time. </summary> </histogram> @@ -91713,7 +91637,7 @@ receipt of the 3rd SDCH encoded packet and receipt of the 4th packet, for processing by the SDCH filter. Packet count boundaries are calculated each time a read from the filter is called, assuming 1430 bytes of data per - packet since the last boundary calculation. This *tends* to properly count + packet since the last boundary calculation. This *tends* to properly count small packets, but can err if small packets come at roughly the same time. </summary> </histogram> @@ -91727,7 +91651,7 @@ receipt of the 4th SDCH encoded packet and receipt of the 5th packet, for processing by the SDCH filter. Packet count boundaries are calculated each time a read from the filter is called, assuming 1430 bytes of data per - packet since the last boundary calculation. This *tends* to properly count + packet since the last boundary calculation. This *tends* to properly count small packets, but can err if small packets come at roughly the same time. </summary> </histogram> @@ -91769,7 +91693,7 @@ <summary> The duration between putting the first byte of a request (such as a GET) on the wire, until the last by of compressed SDCH encoded content is received - (with durations over 10 minutes discarded). During a planned latency + (with durations over 10 minutes discarded). During a planned latency experiment, some clients will receive encoded SDCH data, and other will received mere gzip'ed data (that passes through the SDCH filter unchanged). </summary> @@ -91783,7 +91707,7 @@ An approximation to the total number of SDCH encoded packets received for processing by the SDCH filter. Packet count boundaries are calculated each time a read from the filter is called, assuming 1430 bytes of data per - packet since the last boundary calculation. This *tends* to properly count + packet since the last boundary calculation. This *tends* to properly count small packets, but can err if small packets come at roughly the same time. </summary> </histogram> @@ -91795,7 +91719,7 @@ <summary> The ratio of the number of bytes read from the network (or cache) and fed to the filter chain (usually the gunzip filter) vs. the number of bytes emitted - by the SDCH filter to be rendered. This is commonly described as the SDCH + by the SDCH filter to be rendered. This is commonly described as the SDCH compression ratio. </summary> </histogram> @@ -91807,9 +91731,9 @@ <summary> Sampling only transmissions with 5 or more packets, the duration between receipt of the 1st **NON**-SDCH encoded packet to receipt of the 2nd packet, - for processing by the SDCH filter. Packet count boundaries are calculated + for processing by the SDCH filter. Packet count boundaries are calculated each time a read from the filter is called, assuming 1430 bytes of data per - packet since the last boundary calculation. This *tends* to properly count + packet since the last boundary calculation. This *tends* to properly count small packets, but can err if small packets come at roughly the same time. </summary> </histogram> @@ -91831,9 +91755,9 @@ <summary> Sampling only transmissions with 5 or more packets, the duration between receipt of the 2nd **NON**-SDCH encoded packet to receipt of the 3rd packet, - for processing by the SDCH filter. Packet count boundaries are calculated + for processing by the SDCH filter. Packet count boundaries are calculated each time a read from the filter is called, assuming 1430 bytes of data per - packet since the last boundary calculation. This *tends* to properly count + packet since the last boundary calculation. This *tends* to properly count small packets, but can err if small packets come at roughly the same time. </summary> </histogram> @@ -91845,9 +91769,9 @@ <summary> Sampling only transmissions with 5 or more packets, the duration between receipt of the 3rd **NON**-SDCH encoded packet to receipt of the 4th packet, - for processing by the SDCH filter. Packet count boundaries are calculated + for processing by the SDCH filter. Packet count boundaries are calculated each time a read from the filter is called, assuming 1430 bytes of data per - packet since the last boundary calculation. This *tends* to properly count + packet since the last boundary calculation. This *tends* to properly count small packets, but can err if small packets come at roughly the same time. </summary> </histogram> @@ -91859,9 +91783,9 @@ <summary> Sampling only transmissions with 5 or more packets, the duration between receipt of the 4th **NON**-SDCH encoded packet to receipt of the 5th packet, - for processing by the SDCH filter. Packet count boundaries are calculated + for processing by the SDCH filter. Packet count boundaries are calculated each time a read from the filter is called, assuming 1430 bytes of data per - packet since the last boundary calculation. This *tends* to properly count + packet since the last boundary calculation. This *tends* to properly count small packets, but can err if small packets come at roughly the same time. </summary> </histogram> @@ -91874,7 +91798,7 @@ The duration between putting the first byte of a request (such as a GET) on the wire, until the last by gzip compressed content is received and passed-through unchanged by the SDCH filter (with durations over 10 minutes - discarded). During a planned latency experiment, some clients will receive + discarded). During a planned latency experiment, some clients will receive encoded SDCH data, and other will received mere gzip'ed data (that passes through the SDCH filter unchanged). </summary> @@ -91888,7 +91812,7 @@ The total number of **NON**-SDCH encoded packets received for processing by the SDCH filter in one URL fetch. Packet count boundaries are calculated each time a read from the filter is called, assuming 1430 bytes of data per - packet since the last boundary calculation. This *tends* to properly count + packet since the last boundary calculation. This *tends* to properly count small packets, but can err if small packets come at roughly the same time. </summary> </histogram> @@ -91990,9 +91914,9 @@ Deprecated 2017-9. </obsolete> <summary> - Attempted SDCH decoding can fail at the Read() filter processing stage. In + Attempted SDCH decoding can fail at the Read() filter processing stage. In some of those cases, the request is corrupted enough that it must be either - retried or failed completely. This histogram records the details of why the + retried or failed completely. This histogram records the details of why the request was considered corrupted, for results returned from the cache. </summary> </histogram> @@ -92003,9 +91927,9 @@ Deprecated 2017-9. </obsolete> <summary> - Attempted SDCH decoding can fail at the Read() filter processing stage. In + Attempted SDCH decoding can fail at the Read() filter processing stage. In some of those cases, the request is corrupted enough that it must be either - retried or failed completely. This histogram records the details of why the + retried or failed completely. This histogram records the details of why the request was considered corrupted for results returned from the network. </summary> </histogram> @@ -92039,7 +91963,7 @@ </obsolete> <summary> If/when a ProblemCode UNFLUSHED_CONTENT reports that the SDCH filter is - still buffering output of the VCDIFF decoder that has never been read, this + still buffering output of the VCDIFF decoder that has never been read, this histogram reports the number of bytes that were received over the net (or from the cache) and fed to the start of the filter chain (usually to the gunzip filter). @@ -92064,7 +91988,7 @@ </obsolete> <summary> If/when a ProblemCode UNFLUSHED_CONTENT reports that the SDCH filter is - still buffering output of the VCDIFF decoder that has never been read, this + still buffering output of the VCDIFF decoder that has never been read, this histogram reports the number of bytes that were output by the VCDIFF decoder (and sent toward the renderer). </summary> @@ -92075,7 +91999,7 @@ Use Sdch3.UsageInterval2 instead. </obsolete> <summary> - The amount of time from the last time an SDCH dictionary was used. For the + The amount of time from the last time an SDCH dictionary was used. For the first use of a dictionary, the maximum time is used. </summary> </histogram> @@ -92085,7 +92009,7 @@ Deprecated 2017-9. </obsolete> <summary> - The amount of time from the last time an SDCH dictionary was used. Not + The amount of time from the last time an SDCH dictionary was used. Not recorded on first dictionary use. First use is recorded as Sdch3.FirstUseInterval. </summary> @@ -92129,7 +92053,7 @@ <owner>twellington@chromium.org</owner> <summary> Logs that the UX has entered a state where features are available to be - recorded to Ranker. A value of true indicates that the available features + recorded to Ranker. A value of true indicates that the available features include outcomes, false if they are just features at inference-time. Use to correlate with what actually gets recorded in the Search. ContextualSearch.Ranker.Recorded histogram. Recorded when a tap gesture is @@ -92264,7 +92188,7 @@ Records whether throttling for Unified Consent was done for all requests. Recorded when the user taps on text and the system would like the server to suggest what to search for using page context, regardless of feature-enabled - state. Recorded multiple times for each request. Supports the rollout of + state. Recorded multiple times for each request. Supports the rollout of Unified Consent for Contextual Search. Implemented for Android. </summary> </histogram> @@ -92321,7 +92245,7 @@ <owner>twellington@chromium.org</owner> <summary> The duration that the panel was peeking before being opened when triggered - by a tap at the bottom of the screen where it overlaps the Bar. Logged when + by a tap at the bottom of the screen where it overlaps the Bar. Logged when the panel is closed after being opened. Implemented for Android. </summary> </histogram> @@ -92805,7 +92729,7 @@ <owner>twellington@chromium.org</owner> <summary> The outcome of the promo broken down by original triggering gesture. Logged - for each view of the promo. Implemented for Android. + for each view of the promo. Implemented for Android. </summary> </histogram> @@ -92815,7 +92739,7 @@ <owner>twellington@chromium.org</owner> <summary> Whether the promo was seen, broken down by original triggering gesture. - Logged each time the promo was activated. Implemented for Android. + Logged each time the promo was activated. Implemented for Android. </summary> </histogram> @@ -93121,7 +93045,7 @@ <owner>twellington@chromium.org</owner> <summary> The duration of a tap that triggered a Contextual Search when the user does - not open the panel. Implemented for Android. Logged when the panel closes + not open the panel. Implemented for Android. Logged when the panel closes after being triggered by a tap. </summary> </histogram> @@ -93131,7 +93055,7 @@ <owner>twellington@chromium.org</owner> <summary> The duration of a tap that triggered a Contextual Search when the user does - open the panel. Implemented for Android. Logged when the panel closes after + open the panel. Implemented for Android. Logged when the panel closes after being triggered by a tap and subsequently opened. </summary> </histogram> @@ -93271,7 +93195,7 @@ <owner>mahmoudi@chromium.org</owner> <owner>twellington@chromium.org</owner> <summary> - For each contextual search that is triggered by tap, records whether the + For each contextual search that is triggered by tap, records whether the translation conditions are met. Implemented for Android. </summary> </histogram> @@ -93286,7 +93210,7 @@ <histogram name="Search.DefaultSearchProvider" enum="OmniboxSearchEngine"> <obsolete> - Made obsolete around Chrome 32. Use Search.DefaultSearchProviderType + Made obsolete around Chrome 32. Use Search.DefaultSearchProviderType instead. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> @@ -93302,9 +93226,9 @@ <owner>csharp@chromium.org</owner> <summary> The type of the default search engine that is loaded when a profile is - opened or after a profile reset. Note that at least one profile is opened - on startup. Due to an error, there was a period from roughly May 9 2014 to - May 23 2014 during which this was not being logged. + opened or after a profile reset. Note that at least one profile is opened on + startup. Due to an error, there was a period from roughly May 9 2014 to May + 23 2014 during which this was not being logged. </summary> </histogram> @@ -94221,7 +94145,7 @@ <owner>mek@chromium.org</owner> <summary> Records the proportion of foreign fetch events that are handled compared to - the number of events that are fired for a ServiceWorker. Recorded each time + the number of events that are fired for a ServiceWorker. Recorded each time the ServiceWorker is stopped when at least one event was fired. </summary> </histogram> @@ -95152,7 +95076,7 @@ and when it notifies the loader's client that the body has started loading. This is different from SubresourceStartBlobReadingDelay in that notifying the client about the Response may take place some time later than when the - blob body reading begins. This will be triggered for every successful + blob body reading begins. This will be triggered for every successful subresource load handled by a ServiceWorker with servification enabled. </summary> </histogram> @@ -95161,7 +95085,7 @@ <owner>wanderview@chromium.org</owner> <summary> The time between when the ServiceWorkerSubresourceLoader receives a Response - with a blob body and when the main blob data starts to get read. This will + with a blob body and when the main blob data starts to get read. This will be triggered for every successful subresource load handled by a ServiceWorker with ServiceWorker servification enabled. </summary> @@ -95198,7 +95122,7 @@ <owner>kinuko@chromium.org</owner> <summary> Records the ratio of unhandled events to all events that are dispatched to - each ServiceWorker. Recorded when each ServiceWorkerVersion is destructed. + each ServiceWorker. Recorded when each ServiceWorkerVersion is destructed. </summary> </histogram> @@ -95408,12 +95332,12 @@ <owner>chrisha@chromium.org</owner> <summary> The length of a session (launch/foregrounding to backgrounding) in - milliseconds. See Session.TotalDurationMax1Day for the same histogram with - a higher maximum value. (The one's maximum is 1 hour.) + milliseconds. See Session.TotalDurationMax1Day for the same histogram with a + higher maximum value. (The one's maximum is 1 hour.) Desktop: This also takes into account user interaction and audio events. Starting from M55 the session length is recorded by discounting for default - inactivity timeout. Also, until M69, there was a bug that caused + inactivity timeout. Also, until M69, there was a bug that caused double-counting of some sessions. Android: There is a known issue where JavaScript dialogs and other things @@ -95587,10 +95511,10 @@ Desktop: This also takes into account user interaction and audio events. Starting from M55 the session length is recorded by discounting for default - inactivity timeout. Also, until M69, there was a bug that caused + inactivity timeout. Also, until M69, there was a bug that caused double-counting of some sessions. - Android: This histogram isn't logged on Android. See instead + Android: This histogram isn't logged on Android. See instead Session.TotalDuration. </summary> </histogram> @@ -95830,7 +95754,7 @@ <owner>creis@chromium.org</owner> <summary> How often history navigations in subframes restore a different URL than the - frame's default src URL. This indicates how much users rely on subframe + frame's default src URL. This indicates how much users rely on subframe session history items. </summary> </histogram> @@ -95846,12 +95770,12 @@ <histogram name="SessionRestore.RestoredTab.TimeSinceActive" units="ms"> <owner>chrisha@chromium.org</owner> <summary> - The time since a restored tab was last active. This is the cumulative - amount of time that has passed since the tab was last visible. Time accrues - while a browser is active and the tab remains inactive. If the tab is - restored and remains inactive in a subsequent browsing session the time - continues to accrue. Visible tabs report a value of 0 for this. This is - recorded at the moment the tab is restored during a session restore. + The time since a restored tab was last active. This is the cumulative amount + of time that has passed since the tab was last visible. Time accrues while a + browser is active and the tab remains inactive. If the tab is restored and + remains inactive in a subsequent browsing session the time continues to + accrue. Visible tabs report a value of 0 for this. This is recorded at the + moment the tab is restored during a session restore. </summary> </histogram> @@ -95860,7 +95784,7 @@ <summary> Records the length of unique names that include frame paths, for subframes that are restoring a different URL than the frame's default src URL during a - history navigation. Large values here would indicate a possible challenge + history navigation. Large values here would indicate a possible challenge for the plan to truncate frame unique names (to save memory). </summary> </histogram> @@ -96063,7 +95987,7 @@ <histogram name="Settings.DefaultSearchProvider" enum="OmniboxSearchEngine"> <obsolete> - Deprecated in Chrome 30. Use Search.DefaultSearchProviderType instead. + Deprecated in Chrome 30. Use Search.DefaultSearchProviderType instead. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> @@ -96120,7 +96044,7 @@ <histogram name="Settings.HomePageDomain" enum="OmniboxSearchEngine"> <obsolete> - Deprecated in Chrome 30. Replaced by Settings.HomePageEngineType. + Deprecated in Chrome 30. Replaced by Settings.HomePageEngineType. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> @@ -96136,8 +96060,8 @@ <summary> Tries to pretend the home page URL is a search URL, and records the search engine type of that URL by comparing the TLD+1 of the home page URL with - those of the different known search engines. Recorded when a profile is - opened, if a home page URL has been set. Note that at least one profile is + those of the different known search engines. Recorded when a profile is + opened, if a home page URL has been set. Note that at least one profile is opened on startup. </summary> </histogram> @@ -96301,8 +96225,8 @@ <summary> Tries to pretend pinned tab URLs are search URLs, and records the search engine types of those URLs by comparing the TLD+1s of the URLs with those of - the different known search engines. Recorded when a profile is opened, if - there are pinned tabs. Note that at least one profile is opened on startup. + the different known search engines. Recorded when a profile is opened, if + there are pinned tabs. Note that at least one profile is opened on startup. </summary> </histogram> @@ -96346,10 +96270,10 @@ <histogram name="Settings.SearchPageMatchCount"> <owner>dschuyler@chromium.org</owner> <summary> - The number of search page hits within the chrome://settings page. This is + The number of search page hits within the chrome://settings page. This is especially important when the count is zero (i.e. we returned no hits for a - given search in settings). A search is considered complete via timeout - since there is no concrete way to define the end of a search (the search is + given search in settings). A search is considered complete via timeout since + there is no concrete way to define the end of a search (the search is incremental). </summary> </histogram> @@ -96359,17 +96283,17 @@ <summary> If there is no further activity in the search box for 1 second, this records one tick each time a settings section is shown as a result of searching - withing the chrome://settings page. If multiple matches are found within - the same section, the section match is only recorded once. + withing the chrome://settings page. If multiple matches are found within the + same section, the section match is only recorded once. </summary> </histogram> <histogram name="Settings.SearchSubpageMatchCount"> <owner>dschuyler@chromium.org</owner> <summary> - The number of search subpage hits within the chrome://settings page. This - is different from Settings.SearchPageMatchCount in that it is tracking hits - in subpages rather than top level pages. See also + The number of search subpage hits within the chrome://settings page. This is + different from Settings.SearchPageMatchCount in that it is tracking hits in + subpages rather than top level pages. See also Settings.SearchPageMatchCount. </summary> </histogram> @@ -96440,7 +96364,7 @@ <histogram name="Settings.StartupPageDomains" enum="OmniboxSearchEngine"> <obsolete> - Deprecated in Chrome 30. Replaced by Settings.StartupPageEngineTypes. + Deprecated in Chrome 30. Replaced by Settings.StartupPageEngineTypes. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> @@ -96456,8 +96380,8 @@ <summary> Tries to pretend the startup page URLs are search URLs, and records the search engine types of those URLs by comparing the TLD+1s of the URLs with - those of the different known search engines. Recorded when a profile is - opened, if startup page URLs have been set. Note that at least one profile + those of the different known search engines. Recorded when a profile is + opened, if startup page URLs have been set. Note that at least one profile is opened on startup. </summary> </histogram> @@ -96524,7 +96448,7 @@ <owner>dschuyler@chromium.org</owner> <summary> The time between when the chrome://settings page is opened to the first time - a search is done within that page. This is intended to evaluate how long a + a search is done within that page. This is intended to evaluate how long a user looks for a setting before giving up and searching for it. </summary> </histogram> @@ -97647,7 +97571,7 @@ <owner>mlerman@chromium.org</owner> <summary> Records the time it took to check only a portion of external connections - whenever the reconciler performs a reconciliation. This means that either a + whenever the reconciler performs a reconciliation. This means that either a network error occured while checking some sites or the site did not respond before the check timeout. </summary> @@ -98114,17 +98038,17 @@ <histogram name="SimpleCache.FileDescriptorLimitHard" units="file descriptors"> <owner>morlovich@chromium.org</owner> <summary> - The maximum limit of how many file descriptors a process can open. Emitted - each time the browser is launched, if the limit could be retrieved. (This - is the highest value we could raise the current limit to if we liked.) + The maximum limit of how many file descriptors a process can open. Emitted + each time the browser is launched, if the limit could be retrieved. (This is + the highest value we could raise the current limit to if we liked.) </summary> </histogram> <histogram name="SimpleCache.FileDescriptorLimitSoft" units="file descriptors"> <owner>morlovich@chromium.org</owner> <summary> - The current limit of how many file descriptors a process can open. Emitted - each time the browser is launched, if the limit could be retrieved. (We can + The current limit of how many file descriptors a process can open. Emitted + each time the browser is launched, if the limit could be retrieved. (We can raise this to the maximum limit if we like, without root access.) </summary> </histogram> @@ -98133,8 +98057,8 @@ enum="SimpleCache.FileDescriptorLimitStatus"> <owner>morlovich@chromium.org</owner> <summary> - The result of trying to get the file descriptor limit. Emitted each time - the browser is launched. + The result of trying to get the file descriptor limit. Emitted each time the + browser is launched. </summary> </histogram> @@ -98164,7 +98088,7 @@ <owner>morlovich@chromium.org</owner> <summary> How the header size has changed in a Simple Cache entry, emitted every time - a write operation occurs on the header stream. (This includes the initial + a write operation occurs on the header stream. (This includes the initial write, rewrites, and other writes that we couldn't classify.) </summary> </histogram> @@ -98908,7 +98832,7 @@ <histogram name="SiteIsolation.BrowsingInstanceCount"> <owner>creis@chromium.org</owner> <summary> - The count of all current BrowsingInstances. Recorded once per UMA ping. + The count of all current BrowsingInstances. Recorded once per UMA ping. </summary> </histogram> @@ -98924,8 +98848,8 @@ <owner>alexmos@chromium.org</owner> <summary> True if the --isolate-origins mode was enabled from the command line, - about:flags, or enterprise policy. Recorded on browser startup and then - once every 24 hours. + about:flags, or enterprise policy. Recorded on browser startup and then once + every 24 hours. </summary> </histogram> @@ -98933,8 +98857,8 @@ <owner>alexmos@chromium.org</owner> <summary> True if the --site-per-process mode was enabled from the command line, - about:flags, or enterprise policy. Recorded on browser startup and then - once every 24 hours. + about:flags, or enterprise policy. Recorded on browser startup and then once + every 24 hours. </summary> </histogram> @@ -98942,7 +98866,7 @@ <owner>creis@chromium.org</owner> <summary> The upper bound of the predicted renderer process count if we isolated all - sites, subject to the process limit. Recorded once per UMA ping. + sites, subject to the process limit. Recorded once per UMA ping. </summary> </histogram> @@ -98950,8 +98874,8 @@ <owner>creis@chromium.org</owner> <summary> The lower bound of the predicted renderer process count if we isolated all - sites, subject to the process limit. Happens to be the number of unique - sites. Recorded once per UMA ping. + sites, subject to the process limit. Happens to be the number of unique + sites. Recorded once per UMA ping. </summary> </histogram> @@ -98959,7 +98883,7 @@ <owner>creis@chromium.org</owner> <summary> The predicted renderer process count if we isolated all sites and if there - were no process limit. Recorded once per UMA ping. + were no process limit. Recorded once per UMA ping. </summary> </histogram> @@ -98967,7 +98891,7 @@ <owner>creis@chromium.org</owner> <summary> The predicted total process count if we isolated all sites, subject to the - process limit. Recorded once per UMA ping. + process limit. Recorded once per UMA ping. </summary> </histogram> @@ -98975,8 +98899,7 @@ <owner>nick@chromium.org</owner> <summary> The upper bound of the predicted renderer process count if we isolated only - Chrome extensions, subject to the process limit. Recorded once per UMA - ping. + Chrome extensions, subject to the process limit. Recorded once per UMA ping. </summary> </histogram> @@ -98992,7 +98915,7 @@ <owner>nick@chromium.org</owner> <summary> The predicted renderer process count if we isolated only Chrome extensions - and if there were no process limit. Recorded once per UMA ping. + and if there were no process limit. Recorded once per UMA ping. </summary> </histogram> @@ -99000,7 +98923,7 @@ <owner>nick@chromium.org</owner> <summary> The predicted total process count if we isolated only Chrome extensions, - subject to the process limit. Recorded once per UMA ping. + subject to the process limit. Recorded once per UMA ping. </summary> </histogram> @@ -99008,7 +98931,7 @@ <owner>creis@chromium.org</owner> <summary> The upper bound of the predicted renderer process count if we isolated only - HTTPS (not HTTP) sites, subject to the process limit. Recorded once per UMA + HTTPS (not HTTP) sites, subject to the process limit. Recorded once per UMA ping. </summary> </histogram> @@ -99017,8 +98940,8 @@ <owner>creis@chromium.org</owner> <summary> The lower bound of the predicted renderer process count if we isolated only - HTTPS (not HTTP) sites, subject to the process limit. Happens to be the - number of isolated sites. Recorded once per UMA ping. + HTTPS (not HTTP) sites, subject to the process limit. Happens to be the + number of isolated sites. Recorded once per UMA ping. </summary> </histogram> @@ -99026,7 +98949,7 @@ <owner>creis@chromium.org</owner> <summary> The predicted renderer process count if we isolated only HTTPS (not HTTP) - sites and if there were no process limit. Recorded once per UMA ping. + sites and if there were no process limit. Recorded once per UMA ping. </summary> </histogram> @@ -99034,7 +98957,7 @@ <owner>creis@chromium.org</owner> <summary> The predicted total process count if we isolated only HTTPS (not HTTP) - sites, subject to the process limit. Recorded once per UMA ping. + sites, subject to the process limit. Recorded once per UMA ping. </summary> </histogram> @@ -99042,7 +98965,7 @@ <owner>creis@chromium.org</owner> <summary> The upper bound of the estimated renderer process count if we isolated no - sites, subject to the process limit. Recorded once per UMA ping. + sites, subject to the process limit. Recorded once per UMA ping. </summary> </histogram> @@ -99050,8 +98973,8 @@ <owner>creis@chromium.org</owner> <summary> The lower bound of the predicted renderer process count if we isolated no - sites, subject to the process limit. Happens to be the number of isolated - sites. Recorded once per UMA ping. + sites, subject to the process limit. Happens to be the number of isolated + sites. Recorded once per UMA ping. </summary> </histogram> @@ -99059,7 +98982,7 @@ <owner>creis@chromium.org</owner> <summary> The predicted renderer process count if we isolated no sites and if there - were no process limit. Recorded once per UMA ping. + were no process limit. Recorded once per UMA ping. </summary> </histogram> @@ -99067,16 +98990,16 @@ <owner>creis@chromium.org</owner> <summary> The predicted total process count if we isolated no sites, subject to the - process limit. Recorded once per UMA ping. + process limit. Recorded once per UMA ping. </summary> </histogram> <histogram name="SiteIsolation.IsolateOrigins.Size" units="origins"> <owner>alexmos@chromium.org</owner> <summary> - The number of currently enabled isolated origins. This includes origins + The number of currently enabled isolated origins. This includes origins specified via the --isolate-origins command-line flag as well as those - configured via enterprise policy. Recorded on browser startup. + configured via enterprise policy. Recorded on browser startup. </summary> </histogram> @@ -99093,21 +99016,21 @@ <histogram name="SiteIsolation.OutOfProcessIframes"> <owner>nasko@chromium.org</owner> <summary> - The count of all out-of-process iframes. Recorded once per UMA ping. + The count of all out-of-process iframes. Recorded once per UMA ping. </summary> </histogram> <histogram name="SiteIsolation.ProxyCount"> <owner>nick@chromium.org</owner> <summary> - The count of all RenderFrameProxyHosts. Recorded once per UMA ping. + The count of all RenderFrameProxyHosts. Recorded once per UMA ping. </summary> </histogram> <histogram name="SiteIsolation.ProxyCountPerBrowsingInstance"> <owner>nick@chromium.org</owner> <summary> - The count of RenderFrameProxyHosts in each BrowsingInstance. Recorded each + The count of RenderFrameProxyHosts in each BrowsingInstance. Recorded each UMA ping, once per BrowsingInstance. </summary> </histogram> @@ -99151,7 +99074,7 @@ Sampled with a resource type (0-17) when the response is allowed. Note that this histogram is not reimplemented in the NetworkService version - of Cross-Origin Read Blocking feature. This should be okay since we hope to + of Cross-Origin Read Blocking feature. This should be okay since we hope to gather enough data before NetworkService ships. TODO(lukasza): Around Q4 2018: Remove code after we've gathered enough data. @@ -100565,8 +100488,8 @@ <owner>shess@chromium.org</owner> <summary> Records specific failure and success cases in sql::Recovery implementation, - to determine which cases warrant further development. This histogram tracks - detected errors, some of which may cause multiple results. See recovery.cc + to determine which cases warrant further development. This histogram tracks + detected errors, some of which may cause multiple results. See recovery.cc for details. </summary> </histogram> @@ -100611,7 +100534,7 @@ <histogram name="Sqlite.UpdateTime" units="ms"> <owner>shess@chromium.org</owner> <summary> - Record times for statements which could update the database file. Includes + Record times for statements which could update the database file. Includes commit and autocommit time. </summary> </histogram> @@ -101668,7 +101591,7 @@ <summary> [Desktop] Measures the elapsed time for a single task to execute on UI if it was not possible to execute it under 1/60s within certain limits, 10 second - after first WebContents was painted at least once. This is recorded at most + after first WebContents was painted at least once. This is recorded at most once per Chrome launch. Used as a measure of responsiveness on startup. </summary> </histogram> @@ -101681,7 +101604,7 @@ <summary> [Desktop] Measures the elapsed time for a single task to execute on UI if it was not possible to execute it under 1/60s within certain limits, 1 second - after first WebContents was painted at least once. This is recorded at most + after first WebContents was painted at least once. This is recorded at most once per Chrome launch. Used as a measure of responsiveness on startup. </summary> </histogram> @@ -101706,7 +101629,7 @@ <owner>gayane@chromium.org</owner> <summary> [Desktop] Measures the elapsed time it takes for a task to execute on UI - under 1/60s, 10 second after the first WebContents was painted. This is + under 1/60s, 10 second after the first WebContents was painted. This is recorded at most once per Chrome launch. Used as a measure of responsiveness on startup. </summary> @@ -102367,7 +102290,7 @@ <owner>dmurph@chromium.org</owner> <summary> Records the total in-memory storage size of blobs before a blob item is - appended. Can be subtracted by Storage.Blob.StorageSizeBeforeAppend to find + appended. Can be subtracted by Storage.Blob.StorageSizeBeforeAppend to find the true distribution of blob storage sizes. </summary> </histogram> @@ -102376,8 +102299,8 @@ <owner>dmurph@chromium.org</owner> <summary> Records the total in-memory storage size of blobs before a blob item is - appended. Can be subtracted from Storage.Blob.StorageSizeAfterAppend to - find the true distribution of blob storage sizes. + appended. Can be subtracted from Storage.Blob.StorageSizeAfterAppend to find + the true distribution of blob storage sizes. </summary> </histogram> @@ -102412,8 +102335,8 @@ <owner>dmurph@chromium.org</owner> <summary> The size in KB of items (or parts of items) appended to blobs that come from - the slicing of other blobs. This happens when using Blob.slice, where we - are using a part of an item in the original blob (not the whole item). + the slicing of other blobs. This happens when using Blob.slice, where we are + using a part of an item in the original blob (not the whole item). </summary> </histogram> @@ -102887,10 +102810,10 @@ enum="SubresourceFilterVerifyStatus" expires_after="2019-02-01"> <owner>ericrobinson@chromium.org</owner> <summary> - The result of the IndexRulesetMatcher Verify method. Either pass if both - the checksum and verifier succeeded, or a value indicating which combination - of them failed. Note that a zero checksum indicates that the checksum has - not yet been stored during indexing (for rulesets indexed prior to the + The result of the IndexRulesetMatcher Verify method. Either pass if both the + checksum and verifier succeeded, or a value indicating which combination of + them failed. Note that a zero checksum indicates that the checksum has not + yet been stored during indexing (for rulesets indexed prior to the checksumming code). </summary> </histogram> @@ -102948,8 +102871,8 @@ <summary> For pages that trigger Safe Browsing activations (not including dry runs), records the position in the redirect chain for the page the activation was - triggered by. If SubresourceFilterConsiderRedirects is disabled, then - always returns "Only navigation". + triggered by. If SubresourceFilterConsiderRedirects is disabled, then always + returns "Only navigation". </summary> </histogram> @@ -103642,7 +103565,7 @@ <owner>zea@chromium.org</owner> <summary> Compares sync's has_setup_completed pref against the set of types actually - restored from the sync DB. Mismatches should be rare. + restored from the sync DB. Mismatches should be rare. </summary> </histogram> @@ -103900,7 +103823,7 @@ </obsolete> <owner>zea@chromium.org</owner> <summary> - Whether or not we detected missing credentials during startup. This may be + Whether or not we detected missing credentials during startup. This may be related to crbug.com/121755. </summary> </histogram> @@ -104326,7 +104249,7 @@ <histogram name="Sync.FirstBackendInitializeSuccess" enum="BooleanSuccess"> <obsolete> - Deprecated 11/2011. Was counted incorrectly. Replaced by + Deprecated 11/2011. Was counted incorrectly. Replaced by Sync.BackendInitializeFirstTimeSuccess. </obsolete> <owner>zea@chromium.org</owner> @@ -104632,7 +104555,7 @@ MEMORY_PRESSURE_LEVEL_CRITICAL warning before the sync service shut down cleanly. The sync service emits this number the next time the user's sync service is started, which will likely happen the next time the user's - profile is opened after a Chrome restart. This count is emitted once per + profile is opened after a Chrome restart. This count is emitted once per user/profile. Things like browser crashes that implicitly bring down all users' sync services will cause unclean shutdown tags to appear on all open profiles, meaning that there will be multiple emissions to this histogram as @@ -104647,7 +104570,7 @@ MEMORY_PRESSURE_LEVEL_CRITICAL warning before the sync service shut down uncleanly. The sync service emits this number the next time the user's sync service is started, which will likely happen the next time the user's - profile is opened after a Chrome restart. This count is emitted once per + profile is opened after a Chrome restart. This count is emitted once per user/profile. Things like browser crashes that implicitly bring down all users' sync services will cause unclean shutdown tags to appear on all open profiles, meaning that there will be multiple emissions to this histogram as @@ -104683,6 +104606,11 @@ <histogram base="true" name="Sync.ModelTypeCount3" units="entries" expires_after="2020-03-01"> + <obsolete> + Deprecated as of 9/2018. Replaced by Sync.ModelTypeCount4 which fixes a + off-by-one bug that the root node get also recorded for directory data + types. + </obsolete> <owner>jkrcal@chromium.org</owner> <summary> Counts the number of entries for each model type. For directory types, the @@ -104692,6 +104620,19 @@ </summary> </histogram> +<histogram base="true" name="Sync.ModelTypeCount4" units="entries" + expires_after="2020-04-01"> + <owner>jkrcal@chromium.org</owner> + <owner>mastiz@chromium.org</owner> + <summary> + Counts the number of entries for each model type. For directory types, the + count is based on the directory contents (excl. the root node), for USS + types, the count is based on metadata entries for the type. Recorded after + sync configuration. This metric is used for monitoring general health of + sync client-side code. + </summary> +</histogram> + <histogram base="true" name="Sync.ModelTypeEntityChange" enum="SyncEntityChange" expires_after="2020-02-01"> <owner>jkrcal@chromium.org</owner> @@ -105122,7 +105063,7 @@ <histogram name="Sync.RestoreBackendInitializeSucess" enum="BooleanSuccess"> <obsolete> - Deprecated 11/2011. Was counted incorrectly. Replaced by + Deprecated 11/2011. Was counted incorrectly. Replaced by Sync.BackendInitializeRestoreSuccess. </obsolete> <owner>zea@chromium.org</owner> @@ -105188,14 +105129,14 @@ <histogram name="Sync.ServiceInitialConfigureTime" units="ms"> <owner>zea@chromium.org</owner> <summary> - Time spent on first-time configure. May include time spent on retries. + Time spent on first-time configure. May include time spent on retries. </summary> </histogram> <histogram name="Sync.ServiceSubsequentConfigureTime" units="ms"> <owner>zea@chromium.org</owner> <summary> - Time spent on non-first-time configure. May include time spent on retries. + Time spent on non-first-time configure. May include time spent on retries. </summary> </histogram> @@ -106525,9 +106466,9 @@ <owner>georgesak@chromium.org</owner> <summary> Cumulative number of tabs discarded due to low memory conditions, recorded - once per tab discard event. For example, a user who had 3 tabs discarded - records a count in the 1 bin, 2 bin and 3 bin. Thus each bin N is the - number of sessions where users experienced N or more tab discard events. + once per tab discard event. For example, a user who had 3 tabs discarded + records a count in the 1 bin, 2 bin and 3 bin. Thus each bin N is the number + of sessions where users experienced N or more tab discard events. </summary> </histogram> @@ -107172,9 +107113,9 @@ <owner>jamescook@chromium.org</owner> <summary> Cumulative number of tabs discarded due to low memory conditions, recorded - once per tab discard event. For example, a user who had 3 tabs discarded - records a count in the 1 bin, 2 bin and 3 bin. Thus each bin N is the - number of sessions where users experienced N or more tab discard events. + once per tab discard event. For example, a user who had 3 tabs discarded + records a count in the 1 bin, 2 bin and 3 bin. Thus each bin N is the number + of sessions where users experienced N or more tab discard events. </summary> </histogram> @@ -107193,13 +107134,13 @@ <histogram name="Tabs.Discard.InitialTime" units="seconds"> <obsolete> - Deprecated May 4, 2012. Replaced by Tabs.Discard.InitialTime2 because this - stat had too low of a range maximum. No longer tracked. + Deprecated May 4, 2012. Replaced by Tabs.Discard.InitialTime2 because this + stat had too low of a range maximum. No longer tracked. </obsolete> <owner>jamescook@chromium.org</owner> <summary> Time in seconds between system startup and when the first tab is discarded - due to low memory conditions. Higher is better. + due to low memory conditions. Higher is better. </summary> </histogram> @@ -107212,20 +107153,20 @@ <owner>jamescook@chromium.org</owner> <summary> Time in seconds between system startup and when the first tab is discarded - due to low memory conditions. Higher is better. Range maximum is + due to low memory conditions. Higher is better. Range maximum is approximately one day. </summary> </histogram> <histogram name="Tabs.Discard.IntervalTime" units="seconds"> <obsolete> - Deprecated May 4, 2012. Replaced by Tabs.Discard.IntervalTime2 because this - stat had too low of a range maximum. No longer tracked. + Deprecated May 4, 2012. Replaced by Tabs.Discard.IntervalTime2 because this + stat had too low of a range maximum. No longer tracked. </obsolete> <owner>jamescook@chromium.org</owner> <summary> Time in seconds between tab discard events after the first one, recorded - once per discard event. Higher is better. + once per discard event. Higher is better. </summary> </histogram> @@ -107238,8 +107179,8 @@ <owner>jamescook@chromium.org</owner> <summary> Time in milliseconds between tab discard events after the first one, - recorded once per discard event. Should occur no faster than once every 750 - ms. Higher is better. + recorded once per discard event. Should occur no faster than once every 750 + ms. Higher is better. </summary> </histogram> @@ -107254,9 +107195,9 @@ <histogram name="Tabs.Discard.MemAnonymousMB" units="MB"> <obsolete> - Deprecated December 7, 2012. Replaced by Tabs.Discard.MemAllocatedMB - because this stat has insufficient precision in the 2-4 GB range and does - not properly account for graphics memory on ARM. + Deprecated December 7, 2012. Replaced by Tabs.Discard.MemAllocatedMB because + this stat has insufficient precision in the 2-4 GB range and does not + properly account for graphics memory on ARM. </obsolete> <owner>jamescook@chromium.org</owner> <summary> @@ -107298,10 +107239,10 @@ <owner>jamescook@chromium.org</owner> <summary> Cumulative number of times a tab was reloaded because it was discarded and - the user clicked on it later, recorded once per reload event. For example, - a user who clicks on 3 discarded tabs will record a count in the 1 bin, 2 - bin, and 3 bin. Thus each bin N is the number of sessions where users - experienced N or more reload events. Compare to Tabs.Discard.DiscardCount. + the user clicked on it later, recorded once per reload event. For example, a + user who clicks on 3 discarded tabs will record a count in the 1 bin, 2 bin, + and 3 bin. Thus each bin N is the number of sessions where users experienced + N or more reload events. Compare to Tabs.Discard.DiscardCount. </summary> </histogram> @@ -107439,9 +107380,9 @@ <owner>jamescook@chromium.org</owner> <summary> Cumulative number of times a tab crashed with "Aw, Snap!", - recorded once per tab crash event. For example, a user who crashed 3 tabs - will record a count in the 1 bin, 2 bin, and 3 bin. Thus each bin N is the - number of sessions where users experienced N or more crash events. The user + recorded once per tab crash event. For example, a user who crashed 3 tabs + will record a count in the 1 bin, 2 bin, and 3 bin. Thus each bin N is the + number of sessions where users experienced N or more crash events. The user may not have actually seen the sad tab page, as it might have been an inactive tab. Compare to Tabs.SadTab.CrashDisplayed. </summary> @@ -107451,10 +107392,10 @@ <owner>jamescook@chromium.org</owner> <summary> Cumulative number of times a tab crashed with "Aw, Snap!" and the - user saw the page, recorded once per tab crash event. For example, a user - who crashed 3 tabs will record a count in the 1 bin, 2 bin, and 3 bin. Thus + user saw the page, recorded once per tab crash event. For example, a user + who crashed 3 tabs will record a count in the 1 bin, 2 bin, and 3 bin. Thus each bin N is the number of sessions where users experienced N or more crash - events. Compare to Tabs.SadTab.CrashCreated. + events. Compare to Tabs.SadTab.CrashCreated. </summary> </histogram> @@ -107472,9 +107413,9 @@ <summary> Cumulative number of times a tab was killed with a "He's dead, Jim!" page, which is usually due to the renderer being killed, recorded - once per tab kill event. For example, a user who loses 3 tabs will record a - count in the 1 bin, 2 bin, and 3 bin. Thus each bin N is the number of - sessions where users experienced N or more kill events. The user may not + once per tab kill event. For example, a user who loses 3 tabs will record a + count in the 1 bin, 2 bin, and 3 bin. Thus each bin N is the number of + sessions where users experienced N or more kill events. The user may not have actually seen the sad tab page, as it might have been an inactive tab. Compare to Tabs.SadTab.KillDisplayed. This can happen due to out of memory, malformed IPC messages, or a SIGINT/TERM/KILL signal sent by a user. @@ -107486,11 +107427,11 @@ <summary> Cumulative number of times a tab was killed with a "He's dead, Jim!" page due to the kernel out-of-memory killer, recorded once per - tab kill event. For example, a user who loses 3 tabs will record a count in - the 1 bin, 2 bin, and 3 bin. Thus each bin N is the number of sessions - where users experienced N or more kill events. The user may not have - actually seen the sad tab page, as it might have been an inactive tab. - Compare to Tabs.SadTab.KillDisplayed. + tab kill event. For example, a user who loses 3 tabs will record a count in + the 1 bin, 2 bin, and 3 bin. Thus each bin N is the number of sessions where + users experienced N or more kill events. The user may not have actually seen + the sad tab page, as it might have been an inactive tab. Compare to + Tabs.SadTab.KillDisplayed. </summary> </histogram> @@ -107501,7 +107442,7 @@ Jim!" page and the user saw the page, recorded once per tab kill event. For example, a user who loses 3 tabs will record a count in the 1 bin, 2 bin, and 3 bin. Thus each bin N is the number of sessions where users - experienced N or more kill events. Compare to Tabs.SadTab.CrashCreated. + experienced N or more kill events. Compare to Tabs.SadTab.CrashCreated. </summary> </histogram> @@ -107510,10 +107451,10 @@ <summary> Cumulative number of times a tab was killed with a "He's dead, Jim!" page due to the kernel out-of-memory killer and the user saw the - page, recorded once per tab kill event. For example, a user who loses 3 - tabs will record a count in the 1 bin, 2 bin, and 3 bin. Thus each bin N is - the number of sessions where users experienced N or more kill events. - Compare to Tabs.SadTab.CrashCreated. + page, recorded once per tab kill event. For example, a user who loses 3 tabs + will record a count in the 1 bin, 2 bin, and 3 bin. Thus each bin N is the + number of sessions where users experienced N or more kill events. Compare to + Tabs.SadTab.CrashCreated. </summary> </histogram> @@ -107521,8 +107462,8 @@ <owner>wfh@chromium.org</owner> <summary> Cumulative number of times a tab crashed with "Aw, Snap!", - recorded once per tab oom event. For example, a user who ran out of memory - in 3 tabs will record a count in the 1 bin, 2 bin, and 3 bin. Thus each bin + recorded once per tab oom event. For example, a user who ran out of memory + in 3 tabs will record a count in the 1 bin, 2 bin, and 3 bin. Thus each bin N is the number of sessions where users experienced N or more oom events. The user may not have actually seen the sad tab page, as it might have been an inactive tab. Compare to Tabs.SadTab.OomDisplayed. @@ -107533,10 +107474,10 @@ <owner>wfh@chromium.org</owner> <summary> Cumulative number of times a tab ran out of memory with "Aw, - Snap!" and the user saw the page, recorded once per tab oom event. For + Snap!" and the user saw the page, recorded once per tab oom event. For example, a user who ran out of memory in 3 tabs will record a count in the 1 - bin, 2 bin, and 3 bin. Thus each bin N is the number of sessions where - users experienced N or more oom events. Compare to Tabs.SadTab.OomCreated. + bin, 2 bin, and 3 bin. Thus each bin N is the number of sessions where users + experienced N or more oom events. Compare to Tabs.SadTab.OomCreated. </summary> </histogram> @@ -107553,10 +107494,10 @@ <summary> The number of times a tab was reloaded because it was killed (usually by the kernel OOM killer) and the user clicked on it later, recorded once per - reload event. For example, a user who clicks on 3 discarded tabs will - record a count in the 1 bin, 2 bin, and 3 bin. Thus each bin N is the - number of sessions where users experienced N or more reload events. Compare - to Tabs.Discard.DiscardCount. + reload event. For example, a user who clicks on 3 discarded tabs will record + a count in the 1 bin, 2 bin, and 3 bin. Thus each bin N is the number of + sessions where users experienced N or more reload events. Compare to + Tabs.Discard.DiscardCount. </summary> </histogram> @@ -109158,7 +109099,7 @@ value) matches the language determined by CLD. Beyond directly matching or mismatching the HTML language, CLD can complement the HTML language. For example, suppose the HTML language is 'zh' (general Chinese), a language - code that the Translate server does not support. In this case, CLD can + code that the Translate server does not support. In this case, CLD can detect a subcode like '-TW' or '-CN', resulting in language codes 'zh-TW' and 'zh-CN', which the Translate server supports. This is referred to as "complementing a language subcode". @@ -109421,9 +109362,9 @@ <owner>kenjibaheux@google.com</owner> <summary> Logs an unsupported source language detected during initiation of the - Translate feature. This is reported when the language detector successfully + Translate feature. This is reported when the language detector successfully detects the language of the webpage, but the language is not supported by - the translation server because it is too minor. This metric allows us to + the translation server because it is too minor. This metric allows us to assess how important the unsupported language is for Google translate. </summary> </histogram> @@ -110540,7 +110481,7 @@ <histogram name="UMA.Unacceptable_Log_Discarded"> <obsolete> - Deprecated as of May, 2012 (i.e. Chrome 21+). Replaced by the + Deprecated as of May, 2012 (i.e. Chrome 21+). Replaced by the UMA.UploadResponseStatus.XML and UMA.UploadResponseStatus.Protobuf histograms. </obsolete> @@ -110563,12 +110504,12 @@ <histogram name="UMA.UploadCreation" enum="BooleanSuccess"> <obsolete> - Deprecated as of August 2015. This failure case no longer exists. + Deprecated as of August 2015. This failure case no longer exists. </obsolete> <owner>asvitkine@chromium.org</owner> <summary> For each attempted UMA upload, log whether the upload was successfully - constructed. An upload might fail to be constructed, for example, if we try + constructed. An upload might fail to be constructed, for example, if we try to upload before the system is fully initialized; or if serialization of the data fails. </summary> @@ -111385,7 +111326,7 @@ <owner>kouhei@chromium.org</owner> <summary> Measures the time elapsed on Chrome OS between when Chrome is started, and - when the login prompt is again visible after a logout. This statistic is + when the login prompt is again visible after a logout. This statistic is only collected when preceeded by a logout. </summary> </histogram> @@ -111425,9 +111366,9 @@ <owner>kouhei@chromium.org</owner> <summary> Measures the time elapsed on Chrome OS between initiating a logout and the - next time the login prompt is visible again. This statistic is not - collected if the machine is shutdown between the logout initiation and the - prompt becoming visible. + next time the login prompt is visible again. This statistic is not collected + if the machine is shutdown between the logout initiation and the prompt + becoming visible. </summary> </histogram> @@ -111449,14 +111390,14 @@ <summary> Measures the time elapsed on Chrome OS between when all user-associated processes have been terminated during the logout process and when Chrome is - started again to show the login screen. Since at least ChromeOS M62, + started again to show the login screen. Since at least ChromeOS M62, equivalent to Uptime.XTerminatedToChromeExecAfterLogout. </summary> </histogram> <histogram name="Uptime.ProcessesTerminatedToXTerminatedAfterLogout" units="ms"> <obsolete> - Deprecated 05/2018 in Issue 721891 with removal of X11. Replaced by + Deprecated 05/2018 in Issue 721891 with removal of X11. Replaced by Uptime.OtherProcessesTerminatedToChromeExecAfterLogout in ChromeOS M69. Equal to 0 since at least ChromeOS M62. </obsolete> @@ -111465,7 +111406,7 @@ <summary> Measures the time elapsed on Chrome OS between when all user-associated processes (including the X server) have been terminated during the logout - process. This statistic is not collected if the logout is part of a restart + process. This statistic is not collected if the logout is part of a restart or shutdown. </summary> </histogram> @@ -111484,7 +111425,7 @@ <histogram name="Uptime.XTerminatedToChromeExecAfterLogout" units="ms"> <obsolete> Replaced by Uptime.OtherProcessesTerminatedToChromeExecAfterLogout in - ChromeOS M69. Equivalent to the new name since at least ChromeOS M62. + ChromeOS M69. Equivalent to the new name since at least ChromeOS M62. </obsolete> <owner>hajimehoshi@chromium.org</owner> <owner>kouhei@chromium.org</owner> @@ -111936,7 +111877,7 @@ units="microseconds"> <owner>leszeks@chromium.org</owner> <summary> - Total time spent in compiling a script (incl. parsing/caching) when the + Total time spent in compiling a script (incl. parsing/caching) when the compilation tried to deserialize it from the code cache, but failed. Warning: This metric may include reports from clients with low-resolution @@ -113879,7 +113820,7 @@ <histogram name="VRDisplayPresentResult" enum="VRPresentationResult"> <owner>billorr@chromium.org</owner> <summary> - The result of calls to VRDisplay::requestPresent(). Reported twice per + The result of calls to VRDisplay::requestPresent(). Reported twice per requestPresent() call, once to record the call, and once to record the result. </summary> @@ -113901,7 +113842,7 @@ <histogram name="VRSessionNavigationCount"> <owner>billorr@chromium.org</owner> <summary> - Count of navigations while in a VR session. Logged when a new disjoint + Count of navigations while in a VR session. Logged when a new disjoint session has begun, or when the session has ended in a non-continuable way. </summary> </histogram> @@ -113909,7 +113850,7 @@ <histogram name="VRSessionTime" units="ms"> <owner>billorr@chromium.org</owner> <summary> - The duration of the VR session. Logged when a new disjoint session has + The duration of the VR session. Logged when a new disjoint session has begun, or when the session has ended in a non-continuable way. </summary> </histogram> @@ -113926,15 +113867,15 @@ <histogram name="VRSessionVideoCount"> <owner>billorr@chromium.org</owner> <summary> - Number of videos watched in a VR session. Logged when a new disjoint - session has begun, or when the session has ended in a non-continuable way. + Number of videos watched in a VR session. Logged when a new disjoint session + has begun, or when the session has ended in a non-continuable way. </summary> </histogram> <histogram name="VRSessionVideoTime" units="ms"> <owner>billorr@chromium.org</owner> <summary> - The duration of a single session spent watching video in VR. Logged when a + The duration of a single session spent watching video in VR. Logged when a new disjoint session has begun, or when the session has ended in a non-continuable way. </summary> @@ -114768,9 +114709,8 @@ <owner>hongchan@chromium.org</owner> <summary> The ratio of the buffer sample rate from createBuffer() to the context - sample rate. This indicates if the buffer needs to be resampled. Recorded - for every call to createBuffer(). Probably many (tens or hundreds) per - page. + sample rate. This indicates if the buffer needs to be resampled. Recorded + for every call to createBuffer(). Probably many (tens or hundreds) per page. </summary> </histogram> @@ -114779,9 +114719,8 @@ <owner>hongchan@chromium.org</owner> <summary> The ratio of the buffer sample rate from createBuffer() to the context - sample rate. This indicates if the buffer needs to be resampled. Recorded - for every call to createBuffer(). Probably many (tens or hundreds) per - page. + sample rate. This indicates if the buffer needs to be resampled. Recorded + for every call to createBuffer(). Probably many (tens or hundreds) per page. </summary> </histogram> @@ -114809,7 +114748,7 @@ <owner>hongchan@chromium.org</owner> <summary> The callback buffer size (in audio frames) for WebAudio rendering between - the WebAudio graph and the audio device thread. This can differ from the + the WebAudio graph and the audio device thread. This can differ from the value recommended by the audio hardware due to internal constraints in WebAudio. Recorded for every WebAudio AudioContext that is created. </summary> @@ -114820,39 +114759,39 @@ <owner>hongchan@chromium.org</owner> <summary> The buffer size (in audio frames) for WebAudio rendering recommended by the - audio hardware. Recorded for every WebAudio AudioContext that is created. + audio hardware. Recorded for every WebAudio AudioContext that is created. </summary> </histogram> <histogram name="WebAudio.AudioParam.ValueSetterConflictCount"> <obsolete> - Removed 02/2018 in Issue 764396. Information no longer needed or recorded. + Removed 02/2018 in Issue 764396. Information no longer needed or recorded. </obsolete> <owner>rtoy@chromium.org</owner> <owner>hongchan@chromium.org</owner> <summary> The number of times the AudioParam value setter was called that also - conflicts with an ongoing AudioParam automation. Updated when the realtime + conflicts with an ongoing AudioParam automation. Updated when the realtime AudioContext is closed. </summary> </histogram> <histogram name="WebAudio.AudioParam.ValueSetterConflictPercentage"> <obsolete> - Removed 02/2018 in Issue 764396. Information no longer needed or recorded. + Removed 02/2018 in Issue 764396. Information no longer needed or recorded. </obsolete> <owner>rtoy@chromium.org</owner> <owner>hongchan@chromium.org</owner> <summary> The percentage of number of calls to an AudioParam value setter that conflicts with an ongoing AudioParam automation to the total number of calls - to the value setter. Updated once when an AudioContext is closed. + to the value setter. Updated once when an AudioContext is closed. </summary> </histogram> <histogram name="WebAudio.AudioParam.ValueSetterCount"> <obsolete> - Removed 02/2018 in Issue 764396. Information no longer needed or recorded. + Removed 02/2018 in Issue 764396. Information no longer needed or recorded. </obsolete> <owner>rtoy@chromium.org</owner> <owner>hongchan@chromium.org</owner> @@ -114942,9 +114881,9 @@ <owner>rtoy@chromium.org</owner> <owner>hongchan@chromium.org</owner> <summary> - The order of the WebAudio IIRFilterNode. The order is one less than the + The order of the WebAudio IIRFilterNode. The order is one less than the number of feedback coefficients used in the denominator of the IIRFilter - transfer function. Recorded each time an IIRFilter is constructed. + transfer function. Recorded each time an IIRFilter is constructed. </summary> </histogram> @@ -114977,7 +114916,7 @@ <owner>hongchan@chromium.org</owner> <summary> The sample rate (in Hz) specified for the offline audio context. Recorded - for every offline context created. Probably only a few per page, but could + for every offline context created. Probably only a few per page, but could be potentially much more (thousands). </summary> </histogram> @@ -114987,7 +114926,7 @@ <owner>hongchan@chromium.org</owner> <summary> The sample rate (in Hz) specified for the offline audio context. Recorded - for every offline context created. Probably only a few per page, but could + for every offline context created. Probably only a few per page, but could be potentially much more (thousands). </summary> </histogram> @@ -114997,7 +114936,7 @@ <owner>hongchan@chromium.org</owner> <summary> The panning model for the PannerNode. Recorded once with the default value - at creation and once again whenver it is changed. Once changed, it is + at creation and once again whenver it is changed. Once changed, it is unlikely to be changed again. If there are any PannerNodes created at all, then there is probably one for each source (AudioBufferSourceNode, OscillatorNode, or other source). @@ -115164,7 +115103,7 @@ <histogram name="WebCore.FeatureObserver" enum="FeatureObserver"> <obsolete> As of M57 this has been superseded by Blink.UseCounter.Features which fixes - a number of issues. See https://crbug.com/676837. + a number of issues. See https://crbug.com/676837. </obsolete> <owner>rbyers@chromium.org</owner> <summary> @@ -115178,7 +115117,7 @@ enum="MappedCSSProperties"> <obsolete> As of M57 this has been superseded by Blink.UseCounter.CSSProperties which - fixes a number of issues. See https://crbug.com/676837. + fixes a number of issues. See https://crbug.com/676837. </obsolete> <owner>mikelawther@chromium.org</owner> <summary> @@ -115198,6 +115137,10 @@ </histogram> <histogram name="WebCore.Framebust" enum="FramebustPermissions"> + <obsolete> + Deprecated in September 2018 for a version that also tracks if the frame is + an ad frame. + </obsolete> <owner>japhet@chromium.org</owner> <summary> Records instances of child frames navigating the top frame. Includes whether @@ -115207,6 +115150,17 @@ </summary> </histogram> +<histogram name="WebCore.Framebust2" enum="FramebustPermissionsPlusAds"> + <owner>japhet@chromium.org, jkarlin@chromium.org</owner> + <summary> + Records instances of child frames navigating the top frame. Includes whether + or not the navigation would have been permitted if not for our special case + for 'framebusting', the practice of ensuring a given document is never + displayed in a frame. It also includes whether the frame that initiated the + navigation was an ad frame or not. + </summary> +</histogram> + <histogram name="WebCore.IndexedDB.BackingStore.ConsistencyError" enum="IDBLevelDBBackingStoreInternalErrorType"> <owner>dgrogan@chromium.org</owner> @@ -115698,7 +115652,7 @@ <owner>dmurph@chromium.org</owner> <summary> Records if a v2 schema has blob keys in the database, which means the - database is corrupt. These databases will eventually be wiped as corrupt. + database is corrupt. These databases will eventually be wiped as corrupt. Recorded when the IndexedDB backing store for an origin is first opened, which happens when a IndexedDB database connection is opened or when database names are fetched. Note: The backing store stays alive for @@ -116745,7 +116699,7 @@ <owner>guoweis@chromium.org</owner> <summary> The maximum consecutive discarded bytes caused by not enough buffer - available in WebRTC's socket implementation. This happens when WebRTC + available in WebRTC's socket implementation. This happens when WebRTC IpcPacketSocket's throttling mechanism kicks in. </summary> </histogram> @@ -116754,7 +116708,7 @@ <owner>guoweis@chromium.org</owner> <summary> The maximum consecutive discarded bytes caused by not enough buffer - available in WebRTC's socket implementation. This happens when WebRTC + available in WebRTC's socket implementation. This happens when WebRTC IpcPacketSocket's throttling mechanism kicks in. The maximum bucket is expanded from previous version to provide more insight when upper layer feeds a lot of packets. @@ -117877,7 +117831,7 @@ <owner>pthatcher@chromium.org</owner> <summary> Whether RTCP-mux is used for the PeerConnection (both the local and remote - description enable RTCP-mux). Recorded after SetLocalDescription and + description enable RTCP-mux). Recorded after SetLocalDescription and SetRemoteDescription are called, once per PeerConnection. </summary> </histogram> @@ -120055,8 +120009,8 @@ </obsolete> <owner>chengx@chromium.org</owner> <summary> - This metric records whether the folder JumpListIcons exists; and if it - does, whether it is empty or non-empty. + This metric records whether the folder JumpListIcons exists; and if it does, + whether it is empty or non-empty. </summary> </histogram> @@ -120067,8 +120021,8 @@ </obsolete> <owner>chengx@chromium.org</owner> <summary> - This metric records whether the folder JumpListIconsOld exists; and if - it does, whether it is empty or non-empty. + This metric records whether the folder JumpListIconsOld exists; and if it + does, whether it is empty or non-empty. </summary> </histogram> @@ -121172,18 +121126,6 @@ name="Blink.LazyLoad.CrossOriginFrames.InitialDeferralAction"/> </histogram_suffixes> -<histogram_suffixes name="BlinkMainFrameUpdateTimeSuffixes" separator="."> - <suffix name="1msTo5ms" label="Ratio when main frame between 1ms and 5ms."/> - <suffix name="LessThan1ms" label="Ratio when main frame shorter than 1ms."/> - <suffix name="MoreThan5ms" label="Ratio when main frame longer than 5ms."/> - <affected-histogram name="Blink.MainFrame.CompositingCommitRatio"/> - <affected-histogram name="Blink.MainFrame.CompositingRatio"/> - <affected-histogram name="Blink.MainFrame.IntersectionRatio"/> - <affected-histogram name="Blink.MainFrame.PaintRatio"/> - <affected-histogram name="Blink.MainFrame.PrePaintRatio"/> - <affected-histogram name="Blink.MainFrame.StyleAndLayoutRatio"/> -</histogram_suffixes> - <histogram_suffixes name="BlinkVisibleLoadTimeSuffixes" separator="."> <suffix name="2G" label="2G effective connection type"/> <suffix name="3G" label="3G effective connection type"/> @@ -123240,32 +123182,32 @@ <suffix name="Removed" label="Captures only draw quads that have removed by draw occlusion."> <obsolete> - Deprecated as of 03/2018. We'd learned enough from this metric and it - made no sense to keep it around. + Deprecated as of 03/2018. We'd learned enough from this metric and it made + no sense to keep it around. </obsolete> </suffix> <suffix name="Resized" label="Captures only draw quads that have changed size by draw occlusion."> <obsolete> - Deprecated as of 03/2018. We'd learned enough from this metric and it - made no sense to keep it around. + Deprecated as of 03/2018. We'd learned enough from this metric and it made + no sense to keep it around. </obsolete> </suffix> <suffix name="Skipped" label="Captures only draw quads that are too small to apply draw occlusion."> <obsolete> - Deprecated as of 03/2018. We'd learned enough from this metric and it - made no sense to keep it around. + Deprecated as of 03/2018. We'd learned enough from this metric and it made + no sense to keep it around. </obsolete> </suffix> <suffix name="Smaller" label="Captures only draw quads that are smaller than the layer occlusion minimum size (160x160)."> <obsolete> - Deprecated as of 03/2018. We'd learned enough from this metric and it - made no sense to keep it around. + Deprecated as of 03/2018. We'd learned enough from this metric and it made + no sense to keep it around. </obsolete> </suffix> <suffix name="With.Complex.Transform" @@ -128748,8 +128690,8 @@ </histogram_suffixes> <histogram_suffixes name="PasswordGenerated" separator="."> - <suffix name="AutoGenerated"/> - <suffix name="UserCreated"/> + <suffix base="true" name="AutoGenerated"/> + <suffix base="true" name="UserCreated"/> <affected-histogram name="PasswordManager.AccountsPerSite"/> <affected-histogram name="PasswordManager.TimesPasswordUsed"/> <affected-histogram name="PasswordManager.TotalAccounts"/> @@ -131168,7 +131110,7 @@ <histogram_suffixes name="ServiceWorkerCache.Cache" separator="."> <suffix name="Batch"> <obsolete> - Deprecated as of 08/2018. Replaced by ServiceWorkerCache.Cache.Put and + Deprecated as of 08/2018. Replaced by ServiceWorkerCache.Cache.Put and ServiceWorkerCache.Cache.Delete. </obsolete> </suffix> @@ -131177,7 +131119,7 @@ Cache, which deletes matching entries in the cache."/> <suffix name="Keys"> <obsolete> - Deprecated as of 08/2018. Replaced by ServiceWorkerCache.Cache.Keys2 in + Deprecated as of 08/2018. Replaced by ServiceWorkerCache.Cache.Keys2 in order to use a larger maximum value. </obsolete> </suffix> @@ -131186,7 +131128,7 @@ Cache, which returns all of the keys in the cache."/> <suffix name="Match"> <obsolete> - Deprecated as of 08/2018. Replaced by ServiceWorkerCache.Cache.Match2 in + Deprecated as of 08/2018. Replaced by ServiceWorkerCache.Cache.Match2 in order to use a larger maximum value. </obsolete> </suffix> @@ -131195,7 +131137,7 @@ Cache, which does a lookup."/> <suffix name="MatchAll"> <obsolete> - Deprecated as of 08/2018. Replaced by ServiceWorkerCache.Cache.MatchAll2 + Deprecated as of 08/2018. Replaced by ServiceWorkerCache.Cache.MatchAll2 in order to use a larger maximum value. </obsolete> </suffix> @@ -131270,7 +131212,7 @@ CacheStorage, which returns all of the cache names."/> <suffix name="Match"> <obsolete> - Deprecated as of 08/2018. Replaced by + Deprecated as of 08/2018. Replaced by ServiceWorkerCache.CacheStorage.Match2 in order to use a larger maximum value. </obsolete> @@ -132012,7 +131954,12 @@ Deprecated 8/2018. Replaced by Sync.ModelTypeCount3. </obsolete> </affected-histogram> - <affected-histogram name="Sync.ModelTypeCount3"/> + <affected-histogram name="Sync.ModelTypeCount3"> + <obsolete> + Deprecated 8/2018. Replaced by Sync.ModelTypeCount3. + </obsolete> + </affected-histogram> + <affected-histogram name="Sync.ModelTypeCount4"/> <affected-histogram name="Sync.ModelTypeEntityChange"/> <affected-histogram name="Sync.ModelTypeMemoryKB"/> </histogram_suffixes>
diff --git a/tools/metrics/histograms/pretty_print_test.py b/tools/metrics/histograms/pretty_print_test.py new file mode 100755 index 0000000..2df6cfc --- /dev/null +++ b/tools/metrics/histograms/pretty_print_test.py
@@ -0,0 +1,53 @@ +#!/usr/bin/env python +# 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. + +import unittest + +import pretty_print + + +ORIGINAL_XML = """ +<histogram-configuration> +<histograms> + <histogram name="Test.Histogram" units="things"> + <owner>person@chromium.org</owner> + <summary>A long line that should be formatted in a way that does not result + in extra whitespace between words. + </summary> + </histogram> +</histograms> +</histogram-configuration> +""".strip() + + +PRETTY_XML = """ +<histogram-configuration> + +<histograms> + +<histogram name="Test.Histogram" units="things"> + <owner>person@chromium.org</owner> + <summary> + A long line that should be formatted in a way that does not result in extra + whitespace between words. + </summary> +</histogram> + +</histograms> + +</histogram-configuration> +""".strip() + + +class PrettyPrintHistogramsXmlTest(unittest.TestCase): + + def testWhitespaceWrapping(self): + result = pretty_print.PrettyPrintHistograms(ORIGINAL_XML) + self.maxDiff = None + self.assertMultiLineEqual(PRETTY_XML, result.strip()) + + +if __name__ == '__main__': + unittest.main()
diff --git a/tools/metrics/rappor/rappor.xml b/tools/metrics/rappor/rappor.xml index 70aaf02..f65a54c 100644 --- a/tools/metrics/rappor/rappor.xml +++ b/tools/metrics/rappor/rappor.xml
@@ -1099,7 +1099,7 @@ <owner>nzolghadr@chromium.org</owner> <owner>tdresser@chromium.org</owner> <summary> - The eTLD+1 of the website visited, along with the time between initial + The eTLD+1 of the website visited, along with the time between initial creation of a wheel event and the start of the frame swap on the GPU service caused by the generated ScrollUpdate gesture event if that ScrollUpdate is the first such event in a given scroll gesture event sequence. If no swap @@ -1188,14 +1188,14 @@ content script. Note that gathering of this data is not reimplemented in the NetworkService - version of Cross-Origin Read Blocking feature. This should be okay since we + version of Cross-Origin Read Blocking feature. This should be okay since we hope to gather enough data before NetworkService ships. TODO(lukasza): Around Q4 2018: Remove code after we've gathered enough data. DEPRECATED: This metric incorrectly covers more than just requests from content scripts - for example it also covers requests from GuestViews - (initiated by a Chrome App injecting scripts into GuestView). For now + (initiated by a Chrome App injecting scripts into GuestView). For now GuestView is outside the scope of Site Isolation so this metric has been replaced by Extensions.CrossOriginFetchFromContentScript2. </summary> @@ -1211,7 +1211,7 @@ content script. Note that gathering of this data is not reimplemented in the NetworkService - version of Cross-Origin Read Blocking feature. This should be okay since we + version of Cross-Origin Read Blocking feature. This should be okay since we hope to gather enough data before NetworkService ships. TODO(lukasza): Around Q4 2018: Remove code after we've gathered enough data. @@ -1229,8 +1229,7 @@ <owner>dfalcantara@chromium.org</owner> <summary> The eTLD+1 of a URL that was launched from the Android Home screen into a - tab. This explicitly does not count relaunches via the Android Recents - menu. + tab. This explicitly does not count relaunches via the Android Recents menu. </summary> </rappor-metric> @@ -1238,7 +1237,7 @@ <owner>dfalcantara@chromium.org</owner> <summary> The eTLD+1 of a URL that was launched from the Android Home screen into a - WebappActivity. This explicitly does not count relaunches via the Android + WebappActivity. This explicitly does not count relaunches via the Android Recents menu. </summary> </rappor-metric> @@ -1907,7 +1906,7 @@ <owner>kcarattini@chromium.org</owner> <summary> **DEPRECATED. No longer reported as of M52. The domain+registry of a URL - that requested the MidiSysEx API. + that requested the MidiSysEx API. </summary> <string-field name="Scheme"> <summary> @@ -2123,8 +2122,8 @@ <summary> The domain and registry of the URL from where Flash SWF or SPL content is being loaded from, while attempting to launch a Flash (NPAPI or PPAPI) - plugin that is installed and enabled. Recorded when the plugin frame - appears for each Flash object found in the page, even if the plugin is + plugin that is installed and enabled. Recorded when the plugin frame appears + for each Flash object found in the page, even if the plugin is click-to-play. </summary> </rappor-metric> @@ -2442,7 +2441,7 @@ <rappor-metric name="Settings.HomePage2" type="ETLD_PLUS_ONE"> <owner>holte@chromium.org</owner> <summary> - The eTLD+1 of the prefs::kHomePage setting. Recorded when a profile is + The eTLD+1 of the prefs::kHomePage setting. Recorded when a profile is loaded if the URL is valid and prefs::kHomePageIsNewTabPage is false. </summary> </rappor-metric> @@ -2689,9 +2688,9 @@ <rappor-metric name="interstitial.ssl.domain" type="COARSE_RAPPOR_TYPE"> <owner>nparker@chromium.org</owner> <summary> - ** DEPRECATED. Replaced by insterstitial.ssl2.domain on 2015-07-07 since - the type changed.** The domain+registry of a URL that triggered an SSL - interstitial. Domains for bad-clock warnings are not reported. + ** DEPRECATED. Replaced by insterstitial.ssl2.domain on 2015-07-07 since the + type changed.** The domain+registry of a URL that triggered an SSL + interstitial. Domains for bad-clock warnings are not reported. </summary> </rappor-metric>
diff --git a/tools/metrics/ukm/ukm.xml b/tools/metrics/ukm/ukm.xml index a9878e6f..9976527 100644 --- a/tools/metrics/ukm/ukm.xml +++ b/tools/metrics/ukm/ukm.xml
@@ -547,11 +547,11 @@ </event> <event name="Blink.UpdateTime"> - <owner>schenney@chromium.org</owner> + <owner>vmpstr@chromium.org</owner> <summary> Metrics that measure various update times in Blink. This includes paint, - compositing, and layout update times. The metrics are recorded once per 30 - seconds and at the destruction of the local frame root. + compositing, and layout update times. The metrics are recorded once per + second and at the destruction of the local frame root. </summary> <metric name="Compositing.Average"> <summary> @@ -559,87 +559,34 @@ event period. </summary> </metric> - <metric name="Compositing.AverageRatio"> - <summary> - The average over frames within the sample window of the ratio of time - taken in the compositing phase to the total time for the main frame. An - int in the range [0,100]. - </summary> - </metric> <metric name="Compositing.WorstCase"> <summary> The longest single time taken by the compositing phase in microseconds in the event period. </summary> </metric> - <metric name="Compositing.WorstCaseRatio"> - <summary> - The highest proportion of a frame ever used by the compositing phase - within the sample window. An int in the range [0,100]. - </summary> - </metric> <metric name="CompositingCommit.Average"> <summary> The average time taken by the compositing commit at the end of the blink lifecycle, in microseconds in the event period. </summary> </metric> - <metric name="CompositingCommit.AverageRatio"> - <summary> - The average over frames within the sample window of the ratio of time - taken by the compositing commit at the end of the blink lifecycle to the - total time for the main frame. An int in the range [0,100]. - </summary> - </metric> <metric name="CompositingCommit.WorstCase"> <summary> The longest single time taken by the compositing commit at the end of the blink lifecycle, in microseconds in the event period. </summary> </metric> - <metric name="CompositingCommit.WorstCaseRatio"> - <summary> - The highest proportion of a frame ever taken by the compositing commit at - the end of the blink lifecycle to the total time for the main frame. An - int in the range [0,100]. - </summary> - </metric> <metric name="IntersectionObservation.Average"> <summary> The average time taken to compute IntersectionObserver observations in microseconds in the event period. </summary> </metric> - <metric name="IntersectionObservation.AverageRatio"> - <summary> - The average over frames within the sample window of the ratio of time - taken compute IntersectionObserver observations to the total time for the - main frame. An int in the range [0,100]. - </summary> - </metric> <metric name="IntersectionObservation.WorstCase"> <summary> - The longest single time taken to compute IntersectionObserver observations - in microseconds in the event period. - </summary> - </metric> - <metric name="IntersectionObservation.WorstCaseRatio"> - <summary> - The highest proportion of a frame ever taken to compute - IntersectionObserver observations within the sample window. An int in the - range [0,100]. - </summary> - </metric> - <metric name="MainFrame.Average"> - <summary> - The average time between a BeginMainFrame and the commit of paint results, - in microseconds. - </summary> - </metric> - <metric name="MainFrame.WorstCase"> - <summary> - The longest single time between a BeginMainFrame and the commit of paint - results, in microseconds. + The longest single time taken by to compute IntersectionObserver + observations in microseconds in the event period. </summary> </metric> <metric name="Paint.Average"> @@ -648,75 +595,36 @@ period. </summary> </metric> - <metric name="Paint.AverageRatio"> - <summary> - The average over frames within the sample window of the ratio of time - taken in the paint phase to the total time for the main frame. An int in - the range [0,100]. - </summary> - </metric> <metric name="Paint.WorstCase"> <summary> The longest single time taken by the paint phase in microseconds in the event period. </summary> </metric> - <metric name="Paint.WorstCaseRatio"> - <summary> - The highest proportion of a frame ever used by the paint phase within the - sample window. An int in the range [0,100]. - </summary> - </metric> <metric name="PrePaint.Average"> <summary> The average time taken by the pre-paint phase in microseconds in the event period. </summary> </metric> - <metric name="PrePaint.AverageRatio"> - <summary> - The average over frames within the sample window of the ratio of time - taken in the pre-paint phase to the total time for the main frame. An int - in the range [0,100]. - </summary> - </metric> <metric name="PrePaint.WorstCase"> <summary> The longest single time taken by the pre-paint phase in microseconds in the event period. </summary> </metric> - <metric name="PrePaint.WorstCaseRatio"> - <summary> - The highest proportion of a frame ever used by the pre-paint phase within - the sample window. An int in the range [0,100]. - </summary> - </metric> <metric name="StyleAndLayout.Average"> <summary> The average time taken by the style and layout phases in microseconds in the event period. </summary> </metric> - <metric name="StyleAndLayout.AverageRatio"> - <summary> - The average over frames within the sample window of the ratio of time - taken to update style and layout to the total time for the main frame. An - int in the range [0,100]. - </summary> - </metric> <metric name="StyleAndLayout.WorstCase"> <summary> The longest single time taken by the style and layout phases in microseconds in the event period. </summary> </metric> - <metric name="StyleAndLayout.WorstCaseRatio"> - <summary> - The highest proportion of a frame ever used to compute style and layout - within the sample window. An int in the range [0,100]. - </summary> - </metric> </event> <event name="Blink.UseCounter"> @@ -814,7 +722,7 @@ <owner>donnd@chromium.org</owner> <summary> Metrics related to a Contextual Search Tap event on a page, for use with - Ranker. These metrics are recorded each time the user triggers the + Ranker. These metrics are recorded each time the user triggers the Contextual Search UI via a tap gesture (when enabled). </summary> <metric name="DidOptIn"> @@ -846,8 +754,8 @@ <metric name="FontSize"> <summary> Emits a value from 0-10 representing the effective font size on the - screen. A value of 0 means the font size cannot be obtained. A value of - 1 represents a very small font and a value of 10 represents a large font. + screen. A value of 0 means the font size cannot be obtained. A value of 1 + represents a very small font and a value of 10 represents a large font. </summary> </metric> <metric name="IsEntity"> @@ -860,7 +768,7 @@ <metric name="IsEntityEligible"> <summary> Emits a 1 or 0 to indicate whether the IsEntity boolean ever had a chance - of being true or not. When we're dealing with languages other than ones + of being true or not. When we're dealing with languages other than ones where our simple entity-detection can work this signal is false. </summary> </metric> @@ -933,19 +841,19 @@ <metric name="OutcomeWasQuickActionClicked"> <summary> Emits a 1 or 0 to indicate whether the user clicked within the overlay - panel when a Quick-Action was shown. This is a secondary outcome metric. + panel when a Quick-Action was shown. This is a secondary outcome metric. </summary> </metric> <metric name="OutcomeWasQuickAnswerSeen"> <summary> Emits a 1 or 0 to indicate whether the user could see a Quick-Answer - caption within the overlay panel. This is a tertiary outcome metric. + caption within the overlay panel. This is a tertiary outcome metric. </summary> </metric> <metric name="PortionOfElement"> <summary> Emits an integer in the range 0-10 inclusive that expresses the portion of - the enclosing element that is the word tapped. A zero will be emitted if + the enclosing element that is the word tapped. A zero will be emitted if the ratio cannot be calculated. A value of 10 means the word spans the entire element, and a value of 1 means the word is 10% or less than the entire element. @@ -1043,7 +951,7 @@ <owner>zea@chromium.org</owner> <summary> Metrics related to Contextual Suggestions shown in the Chrome Assistive - Surface, aka EoC shown in CAS. These metrics are recorded each time the + Surface, aka EoC shown in CAS. These metrics are recorded each time the Contextual Suggestions UI is dismissed. Each record always contains a value for every metric known at the time of the implementation. </summary> @@ -1074,15 +982,15 @@ <metric name="FetchState"> <summary> Emits an integer in the range 0-7 to indicate the ending state of the data - fetcher and results returned. A value of 0 indicates not-started, a 7 - indicates fetch-completed with suggestions. See the code for details. + fetcher and results returned. A value of 0 indicates not-started, a 7 + indicates fetch-completed with suggestions. See the code for details. </summary> </metric> <metric name="ShowDurationBucketMin"> <summary> Emits an integer in the range 0-N to indicate the duration that the sheet - was shown before a positive or negative action was taken. A value of 0 - indicates that the UI was never shown. A value greater than 0 indicates + was shown before a positive or negative action was taken. A value of 0 + indicates that the UI was never shown. A value greater than 0 indicates that some user interaction occurred taking at least the indicated number of milliseconds, but less than twice that amount. This exponential bucketing is done for privacy reasons, and uses the UKM @@ -2719,8 +2627,8 @@ </metric> <metric name="IsSilent"> <summary> - Boolean value representing whether default notification indicators - (sound, vibration, light) should be suppressed. + Boolean value representing whether default notification indicators (sound, + vibration, light) should be suppressed. </summary> </metric> <metric name="NumActionButtonClicks"> @@ -4987,7 +4895,7 @@ <summary> The approximate amount of time the user spends in presentation in seconds. Times are reported accurately when low, for example, under a minute, and - get rounded to minutes and then hours as they get larger. This is done by + get rounded to minutes and then hours as they get larger. This is done by SessionTracker::GetRoundedDurationInSeconds. </summary> </metric>
diff --git a/tools/perf/benchmarks/system_health_smoke_test.py b/tools/perf/benchmarks/system_health_smoke_test.py index db76010..b1fb71e 100644 --- a/tools/perf/benchmarks/system_health_smoke_test.py +++ b/tools/perf/benchmarks/system_health_smoke_test.py
@@ -65,6 +65,9 @@ # crbug.com/816482 'benchmarks.system_health_smoke_test.SystemHealthBenchmarkSmokeTest.system_health.memory_desktop/load:news:nytimes', # pylint: disable=line-too-long + + # crbug.com/885320 + 'benchmarks.system_health_smoke_test.SystemHealthBenchmarkSmokeTest.system_health.memory_desktop/browse:search:google:2018', # pylint: disable=line-too-long })
diff --git a/tools/perf/page_sets/data/system_health_desktop.json b/tools/perf/page_sets/data/system_health_desktop.json index 697f862..147fa5f 100644 --- a/tools/perf/page_sets/data/system_health_desktop.json +++ b/tools/perf/page_sets/data/system_health_desktop.json
@@ -150,6 +150,9 @@ "load:search:amazon": { "DEFAULT": "system_health_desktop_000.wprgo" }, + "load:search:amazon:2018": { + "DEFAULT": "system_health_desktop_af501c33ad.wprgo" + }, "load:search:baidu": { "DEFAULT": "system_health_desktop_000.wprgo" },
diff --git a/tools/perf/page_sets/data/system_health_desktop_af501c33ad.wprgo.sha1 b/tools/perf/page_sets/data/system_health_desktop_af501c33ad.wprgo.sha1 new file mode 100644 index 0000000..370b5403 --- /dev/null +++ b/tools/perf/page_sets/data/system_health_desktop_af501c33ad.wprgo.sha1
@@ -0,0 +1 @@ +af501c33add88ebd1673a3f8be18b091566b138e \ No newline at end of file
diff --git a/tools/perf/page_sets/system_health/loading_stories.py b/tools/perf/page_sets/system_health/loading_stories.py index 5a7171f9..752d3ae 100644 --- a/tools/perf/page_sets/system_health/loading_stories.py +++ b/tools/perf/page_sets/system_health/loading_stories.py
@@ -51,6 +51,13 @@ SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY +class LoadAmazonDesktopStory2018(_LoadingStory): + NAME = 'load:search:amazon:2018' + URL = 'https://www.amazon.com/s/?field-keywords=pixel' + TAGS = [story_tags.YEAR_2018] + SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY + + class LoadTaobaoDesktopStory(_LoadingStory): NAME = 'load:search:taobao' URL = 'https://world.taobao.com/'
diff --git a/tools/traffic_annotation/summary/annotations.xml b/tools/traffic_annotation/summary/annotations.xml index 1856bae..ed07de7 100644 --- a/tools/traffic_annotation/summary/annotations.xml +++ b/tools/traffic_annotation/summary/annotations.xml
@@ -71,7 +71,7 @@ <item id="data_reduction_proxy_warmup" hash_code="8250451" type="0" content_hash_code="6321249" os_list="linux,windows" file_path="components/data_reduction_proxy/core/browser/warmup_url_fetcher.cc"/> <item id="desktop_ios_promotion" hash_code="13694792" type="0" content_hash_code="19776951" os_list="windows" file_path="chrome/browser/ui/desktop_ios_promotion/sms_service.cc"/> <item id="device_geolocation_request" hash_code="77673751" type="0" deprecated="2017-10-20" content_hash_code="97181773" file_path=""/> - <item id="device_management_service" hash_code="117782019" type="0" content_hash_code="83379536" os_list="linux,windows" file_path="components/policy/core/common/cloud/device_management_service.cc"/> + <item id="device_management_service" hash_code="117782019" type="0" content_hash_code="127535409" os_list="linux,windows" file_path="components/policy/core/common/cloud/device_management_service.cc"/> <item id="devtools_free_data_source" hash_code="22774132" type="0" content_hash_code="35733000" os_list="linux,windows" file_path="chrome/browser/ui/webui/devtools_ui.cc"/> <item id="devtools_handle_front_end_messages" hash_code="135636011" type="0" content_hash_code="76808593" os_list="linux,windows" file_path="content/shell/browser/shell_devtools_bindings.cc"/> <item id="devtools_hard_coded_data_source" hash_code="111565057" type="0" content_hash_code="75183720" os_list="linux,windows" file_path="chrome/browser/ui/webui/devtools_ui.cc"/> @@ -102,22 +102,22 @@ <item id="family_info" hash_code="30913825" type="0" content_hash_code="25369370" os_list="linux,windows" file_path="chrome/browser/supervised_user/child_accounts/family_info_fetcher.cc"/> <item id="favicon_loader" hash_code="112189210" type="0" content_hash_code="70773116" os_list="linux,windows" file_path="content/renderer/loader/web_url_loader_impl.cc"/> <item id="feed_image_fetcher" hash_code="87439531" type="0" content_hash_code="26756208" os_list="linux,windows" file_path="components/feed/core/feed_image_manager.cc"/> - <item id="gaia_auth_check_connection_info" hash_code="4598626" type="0" content_hash_code="66079543" os_list="linux,windows" file_path="google_apis/gaia/gaia_auth_fetcher.cc"/> + <item id="gaia_auth_check_connection_info" hash_code="4598626" type="0" content_hash_code="57347000" os_list="linux,windows" file_path="google_apis/gaia/gaia_auth_fetcher.cc"/> <item id="gaia_auth_exchange_cookies" hash_code="134289752" type="0" deprecated="2018-09-11" content_hash_code="66433230" file_path=""/> - <item id="gaia_auth_exchange_device_id" hash_code="39877119" type="0" content_hash_code="65202631" os_list="linux,windows" file_path="google_apis/gaia/gaia_auth_fetcher.cc"/> - <item id="gaia_auth_fetch_for_uber" hash_code="97978464" type="0" content_hash_code="130774179" os_list="linux,windows" file_path="google_apis/gaia/gaia_auth_fetcher.cc"/> - <item id="gaia_auth_get_user_info" hash_code="82167736" type="0" content_hash_code="135299745" os_list="linux,windows" file_path="google_apis/gaia/gaia_auth_fetcher.cc"/> - <item id="gaia_auth_list_accounts" hash_code="35565745" type="0" content_hash_code="99073020" os_list="linux,windows" file_path="google_apis/gaia/gaia_auth_fetcher.cc"/> - <item id="gaia_auth_log_out" hash_code="116426676" type="0" content_hash_code="24242295" os_list="linux,windows" file_path="google_apis/gaia/gaia_auth_fetcher.cc"/> - <item id="gaia_auth_login" hash_code="91597383" type="0" content_hash_code="35266004" os_list="linux,windows" file_path="google_apis/gaia/gaia_auth_fetcher.cc"/> - <item id="gaia_auth_merge_sessions" hash_code="26216847" type="0" content_hash_code="135075995" os_list="linux,windows" file_path="google_apis/gaia/gaia_auth_fetcher.cc"/> - <item id="gaia_auth_multilogin" hash_code="31445884" type="0" content_hash_code="100356591" os_list="linux,windows" file_path="google_apis/gaia/gaia_auth_fetcher.cc"/> - <item id="gaia_auth_revoke_token" hash_code="133982351" type="0" content_hash_code="34117647" os_list="linux,windows" file_path="google_apis/gaia/gaia_auth_fetcher.cc"/> + <item id="gaia_auth_exchange_device_id" hash_code="39877119" type="0" content_hash_code="61857947" os_list="linux,windows" file_path="google_apis/gaia/gaia_auth_fetcher.cc"/> + <item id="gaia_auth_fetch_for_uber" hash_code="97978464" type="0" content_hash_code="28006265" os_list="linux,windows" file_path="google_apis/gaia/gaia_auth_fetcher.cc"/> + <item id="gaia_auth_get_user_info" hash_code="82167736" type="0" content_hash_code="4695017" os_list="linux,windows" file_path="google_apis/gaia/gaia_auth_fetcher.cc"/> + <item id="gaia_auth_list_accounts" hash_code="35565745" type="0" content_hash_code="93669150" os_list="linux,windows" file_path="google_apis/gaia/gaia_auth_fetcher.cc"/> + <item id="gaia_auth_log_out" hash_code="116426676" type="0" content_hash_code="91154233" os_list="linux,windows" file_path="google_apis/gaia/gaia_auth_fetcher.cc"/> + <item id="gaia_auth_login" hash_code="91597383" type="0" content_hash_code="111911548" os_list="linux,windows" file_path="google_apis/gaia/gaia_auth_fetcher.cc"/> + <item id="gaia_auth_merge_sessions" hash_code="26216847" type="0" content_hash_code="30423843" os_list="linux,windows" file_path="google_apis/gaia/gaia_auth_fetcher.cc"/> + <item id="gaia_auth_multilogin" hash_code="31445884" type="0" content_hash_code="77730858" os_list="linux,windows" file_path="google_apis/gaia/gaia_auth_fetcher.cc"/> + <item id="gaia_auth_revoke_token" hash_code="133982351" type="0" content_hash_code="96665330" os_list="linux,windows" file_path="google_apis/gaia/gaia_auth_fetcher.cc"/> <item id="gaia_cookie_manager_external_cc_result" hash_code="4300475" type="0" content_hash_code="31188375" os_list="linux,windows" file_path="components/signin/core/browser/gaia_cookie_manager_service.cc"/> - <item id="gaia_oauth_client_get_token_info" hash_code="32585152" type="0" content_hash_code="52875646" os_list="linux,windows" file_path="google_apis/gaia/gaia_oauth_client.cc"/> - <item id="gaia_oauth_client_get_tokens" hash_code="5637379" type="0" content_hash_code="31899027" os_list="linux,windows" file_path="google_apis/gaia/gaia_oauth_client.cc"/> - <item id="gaia_oauth_client_get_user_info" hash_code="83476155" type="0" content_hash_code="120213592" os_list="linux,windows" file_path="google_apis/gaia/gaia_oauth_client.cc"/> - <item id="gaia_oauth_client_refresh_token" hash_code="82462683" type="0" content_hash_code="80497552" os_list="linux,windows" file_path="google_apis/gaia/gaia_oauth_client.cc"/> + <item id="gaia_oauth_client_get_token_info" hash_code="32585152" type="0" content_hash_code="128143346" os_list="linux,windows" file_path="google_apis/gaia/gaia_oauth_client.cc"/> + <item id="gaia_oauth_client_get_tokens" hash_code="5637379" type="0" content_hash_code="12099176" os_list="linux,windows" file_path="google_apis/gaia/gaia_oauth_client.cc"/> + <item id="gaia_oauth_client_get_user_info" hash_code="83476155" type="0" content_hash_code="35159007" os_list="linux,windows" file_path="google_apis/gaia/gaia_oauth_client.cc"/> + <item id="gaia_oauth_client_refresh_token" hash_code="82462683" type="0" content_hash_code="22305252" os_list="linux,windows" file_path="google_apis/gaia/gaia_oauth_client.cc"/> <item id="gcd_rest_client" hash_code="105985951" type="0" content_hash_code="70710803" os_list="mac" file_path="remoting/host/gcd_rest_client.cc"/> <item id="gcm_channel_status_request" hash_code="18300705" type="0" content_hash_code="53862393" os_list="linux,windows" file_path="components/gcm_driver/gcm_channel_status_request.cc"/> <item id="gcm_checkin" hash_code="65957842" type="0" content_hash_code="98259579" os_list="linux,windows" file_path="google_apis/gcm/engine/checkin_request.cc"/> @@ -155,9 +155,9 @@ <item id="ntp_contextual_suggestions_fetch" hash_code="95711309" type="0" content_hash_code="107035434" os_list="linux,windows" file_path="components/ntp_snippets/contextual/contextual_suggestions_fetch.cc"/> <item id="ntp_icon_source" hash_code="29197139" type="0" content_hash_code="16399294" os_list="linux,windows" file_path="chrome/browser/search/ntp_icon_source.cc"/> <item id="ntp_snippets_fetch" hash_code="15418154" type="0" content_hash_code="10078959" os_list="linux,windows" file_path="components/ntp_snippets/remote/json_request.cc"/> - <item id="oauth2_access_token_fetcher" hash_code="27915688" type="0" content_hash_code="75964905" os_list="linux,windows" file_path="google_apis/gaia/oauth2_access_token_fetcher_impl.cc"/> + <item id="oauth2_access_token_fetcher" hash_code="27915688" type="0" content_hash_code="33501872" os_list="linux,windows" file_path="google_apis/gaia/oauth2_access_token_fetcher_impl.cc"/> <item id="oauth2_api_call_flow" hash_code="29188932" type="2" content_hash_code="108831236" os_list="linux,windows" policy_fields="-1" file_path="google_apis/gaia/oauth2_api_call_flow.cc"/> - <item id="oauth2_mint_token_flow" hash_code="1112842" type="1" second_id="29188932" content_hash_code="88275010" os_list="linux,windows" semantics_fields="1,2,3,4,5" policy_fields="3,4" file_path="google_apis/gaia/oauth2_mint_token_flow.cc"/> + <item id="oauth2_mint_token_flow" hash_code="1112842" type="1" second_id="29188932" content_hash_code="91581432" os_list="linux,windows" semantics_fields="1,2,3,4,5" policy_fields="3,4" file_path="google_apis/gaia/oauth2_mint_token_flow.cc"/> <item id="ocsp_start_url_request" hash_code="60921996" type="0" content_hash_code="24127780" os_list="linux" file_path="net/cert_net/nss_ocsp.cc"/> <item id="offline_prefetch" hash_code="19185953" type="0" content_hash_code="57248156" os_list="linux,windows" file_path="components/offline_pages/core/prefetch/prefetch_request_fetcher.cc"/> <item id="omnibox_documentsuggest" hash_code="6055066" type="0" content_hash_code="126973249" os_list="linux,windows" file_path="components/omnibox/browser/document_suggestions_service.cc"/> @@ -246,8 +246,8 @@ <item id="ssl_hmac_channel_authenticator" hash_code="106124561" type="0" content_hash_code="93707499" os_list="linux,windows" file_path="remoting/protocol/ssl_hmac_channel_authenticator.cc"/> <item id="ssl_name_mismatch_lookup" hash_code="114468207" type="0" content_hash_code="97619078" os_list="linux,windows" file_path="chrome/browser/ssl/common_name_mismatch_handler.cc"/> <item id="stream_message_pipe_adapter" hash_code="71837756" type="0" content_hash_code="131019242" os_list="linux,windows" file_path="remoting/protocol/stream_message_pipe_adapter.cc"/> - <item id="suggestions_image_manager" hash_code="13211343" type="0" content_hash_code="84009264" os_list="linux,windows" file_path="components/suggestions/image_manager.cc"/> - <item id="suggestions_service" hash_code="35370363" type="0" content_hash_code="32109901" os_list="linux,windows" file_path="components/suggestions/suggestions_service_impl.cc"/> + <item id="suggestions_image_manager" hash_code="13211343" type="0" content_hash_code="36271280" os_list="linux,windows" file_path="components/suggestions/image_manager.cc"/> + <item id="suggestions_service" hash_code="35370363" type="0" content_hash_code="66296423" os_list="linux,windows" file_path="components/suggestions/suggestions_service_impl.cc"/> <item id="supervised_user_refresh_token_fetcher" hash_code="136117054" type="0" deprecated="2018-04-18" content_hash_code="101636136" file_path=""/> <item id="supervised_user_url_filter" hash_code="14257952" type="0" content_hash_code="30470003" os_list="linux,windows" file_path="chrome/browser/supervised_user/supervised_user_url_filter.cc"/> <item id="supervised_users_blacklist" hash_code="78544924" type="0" content_hash_code="10924669" os_list="linux,windows" file_path="chrome/browser/supervised_user/supervised_user_service.cc"/> @@ -259,14 +259,14 @@ <item id="test" hash_code="3556498" type="0" reserved="1" os_list="linux,windows" file_path=""/> <item id="test_partial" hash_code="22096011" type="0" reserved="1" os_list="linux,windows" file_path=""/> <item id="tethering_handler_socket" hash_code="113065062" type="0" content_hash_code="986296" os_list="linux,windows" file_path="content/browser/devtools/protocol/tethering_handler.cc"/> - <item id="thumbnail_source" hash_code="135251783" type="0" content_hash_code="56854283" os_list="linux,windows" file_path="chrome/browser/search/thumbnail_source.cc"/> + <item id="thumbnail_source" hash_code="135251783" type="0" content_hash_code="31086298" os_list="linux,windows" file_path="chrome/browser/search/thumbnail_source.cc"/> <item id="translate_url_fetcher" hash_code="137116619" type="0" content_hash_code="104217506" os_list="linux,windows" file_path="components/translate/core/browser/translate_url_fetcher.cc"/> <item id="ui_devtools_server" hash_code="4986170" type="0" content_hash_code="62670263" os_list="linux,windows" file_path="components/ui_devtools/devtools_server.cc"/> <item id="undefined" hash_code="45578882" type="0" reserved="1" os_list="linux,windows" file_path=""/> <item id="unwanted_software_report" hash_code="43759504" type="0" content_hash_code="111455033" os_list="windows" file_path="chrome/chrome_cleaner/logging/reporter_logging_service.cc"/> <item id="url_fetcher_downloader" hash_code="113231892" type="0" content_hash_code="61085066" os_list="linux,windows" file_path="components/update_client/url_fetcher_downloader.cc"/> <item id="url_prevision_fetcher" hash_code="118389509" type="0" content_hash_code="66145513" os_list="linux,windows" file_path="content/browser/media/url_provision_fetcher.cc"/> - <item id="user_info_fetcher" hash_code="22265491" type="0" content_hash_code="16526506" os_list="linux,windows" file_path="components/policy/core/common/cloud/user_info_fetcher.cc"/> + <item id="user_info_fetcher" hash_code="22265491" type="0" content_hash_code="72016232" os_list="linux,windows" file_path="components/policy/core/common/cloud/user_info_fetcher.cc"/> <item id="web_history_counter" hash_code="137457845" type="1" second_id="110307337" content_hash_code="49663381" os_list="linux,windows" semantics_fields="2,3,4" policy_fields="4" file_path="components/browsing_data/core/counters/history_counter.cc"/> <item id="web_history_expire" hash_code="60946824" type="1" second_id="110307337" content_hash_code="92626030" os_list="linux,windows" semantics_fields="2,3,4" policy_fields="4" file_path="components/history/core/browser/browsing_history_service.cc"/> <item id="web_history_expire_between_dates" hash_code="126122632" type="1" second_id="110307337" content_hash_code="34304787" os_list="linux,windows" semantics_fields="2,3,4" policy_fields="4" file_path="components/history/core/browser/history_service.cc"/>
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h index 92ed2ff0..bcbdfc13a 100644 --- a/ui/compositor/compositor.h +++ b/ui/compositor/compositor.h
@@ -407,7 +407,6 @@ void DidPresentCompositorFrame( uint32_t frame_token, const gfx::PresentationFeedback& feedback) override {} - void RecordEndOfFrameMetrics(base::TimeTicks frame_begin_time) override {} // cc::LayerTreeHostSingleThreadClient implementation. void DidSubmitCompositorFrame() override;
diff --git a/ui/file_manager/file_manager/background/js/volume_manager_impl.js b/ui/file_manager/file_manager/background/js/volume_manager_impl.js index 940b9cd..35924f1 100644 --- a/ui/file_manager/file_manager/background/js/volume_manager_impl.js +++ b/ui/file_manager/file_manager/background/js/volume_manager_impl.js
@@ -364,6 +364,15 @@ rootType = VolumeManagerCommon.RootType.DRIVE_OTHER; isReadOnly = true; isRootEntry = entry.fullPath === '/other'; + } else if ( + entry.fullPath === '/.files-by-id' || + entry.fullPath.indexOf('/.files-by-id/') === 0) { + rootType = VolumeManagerCommon.RootType.DRIVE_OTHER; + + // /.files-by-id/<id> is read-only, but /.files-by-id/<id>/foo is + // read-write. + isReadOnly = entry.fullPath.split('/').length < 4; + isRootEntry = entry.fullPath === '/.files-by-id'; } else { // Accessing Drive files outside of /drive/root and /drive/other is not // allowed, but can happen. Therefore returning null.
diff --git a/ui/file_manager/file_manager/background/js/volume_manager_unittest.js b/ui/file_manager/file_manager/background/js/volume_manager_unittest.js index d9bba9d..542aa3d6 100644 --- a/ui/file_manager/file_manager/background/js/volume_manager_unittest.js +++ b/ui/file_manager/file_manager/background/js/volume_manager_unittest.js
@@ -297,6 +297,30 @@ assertFalse(teamDriveLocationInfo.isReadOnly); assertTrue(teamDriveLocationInfo.isRootEntry); + var driveFilesByIdDirectoryEntry = new MockDirectoryEntry( + new MockFileSystem('drive:drive-foobar%40chromium.org-hash'), + '/.files-by-id/123'); + var driveFilesByIdDirectoryLocationInfo = + volumeManager.getLocationInfo(driveFilesByIdDirectoryEntry); + assertEquals( + VolumeManagerCommon.RootType.DRIVE_OTHER, + driveFilesByIdDirectoryLocationInfo.rootType); + assertFalse(driveFilesByIdDirectoryLocationInfo.hasFixedLabel); + assertTrue(driveFilesByIdDirectoryLocationInfo.isReadOnly); + assertFalse(driveFilesByIdDirectoryLocationInfo.isRootEntry); + + var driveFilesByIdEntry = new MockFileEntry( + new MockFileSystem('drive:drive-foobar%40chromium.org-hash'), + '/.files-by-id/123/foo.txt'); + var driveFilesByIdLocationInfo = + volumeManager.getLocationInfo(driveFilesByIdEntry); + assertEquals( + VolumeManagerCommon.RootType.DRIVE_OTHER, + driveFilesByIdLocationInfo.rootType); + assertFalse(driveFilesByIdLocationInfo.hasFixedLabel); + assertFalse(driveFilesByIdLocationInfo.isReadOnly); + assertFalse(driveFilesByIdLocationInfo.isRootEntry); + var androidRoot = new MockFileEntry(new MockFileSystem('android_files:0'), '/'); var androidRootLocationInfo =
diff --git a/ui/file_manager/file_manager/test/js/test_util.js b/ui/file_manager/file_manager/test/js/test_util.js index 9642706..4535c59 100644 --- a/ui/file_manager/file_manager/test/js/test_util.js +++ b/ui/file_manager/file_manager/test/js/test_util.js
@@ -140,19 +140,19 @@ */ test.ENTRIES = { hello: new test.TestEntryInfo( - test.EntryType.FILE, 'text.txt', 'hello.txt', - 'text/plain', test.SharedOption.NONE, 'Sep 4, 1998, 12:34 PM', - 'hello.txt', '51 bytes', 'Plain text'), + test.EntryType.FILE, 'text.txt', 'hello.txt', 'text/plain', + test.SharedOption.NONE, 'Sep 4, 1998, 12:34 PM', 'hello.txt', '51 bytes', + 'Plain text'), world: new test.TestEntryInfo( - test.EntryType.FILE, 'video.ogv', 'world.ogv', - 'video/ogg', test.SharedOption.NONE, 'Jul 4, 2012, 10:35 AM', - 'world.ogv', '59 KB', 'OGG video'), + test.EntryType.FILE, 'video.ogv', 'world.ogv', 'video/ogg', + test.SharedOption.NONE, 'Jul 4, 2012, 10:35 AM', 'world.ogv', '59 KB', + 'OGG video'), unsupported: new test.TestEntryInfo( - test.EntryType.FILE, 'random.bin', 'unsupported.foo', - 'application/x-foo', test.SharedOption.NONE, 'Jul 4, 2012, 10:36 AM', - 'unsupported.foo', '8 KB', 'FOO file'), + test.EntryType.FILE, 'random.bin', 'unsupported.foo', 'application/x-foo', + test.SharedOption.NONE, 'Jul 4, 2012, 10:36 AM', 'unsupported.foo', + '8 KB', 'FOO file'), desktop: new test.TestEntryInfo( test.EntryType.FILE, 'image.png', 'My Desktop Background.png', @@ -162,83 +162,75 @@ // An image file without an extension, to confirm that file type detection // using mime types works fine. image2: new test.TestEntryInfo( - test.EntryType.FILE, 'image2.png', 'image2', - 'image/png', test.SharedOption.NONE, 'Jan 18, 2038, 1:02 AM', - 'image2', '4 KB', 'PNG image'), + test.EntryType.FILE, 'image2.png', 'image2', 'image/png', + test.SharedOption.NONE, 'Jan 18, 2038, 1:02 AM', 'image2', '4 KB', + 'PNG image'), image3: new test.TestEntryInfo( - test.EntryType.FILE, 'image3.jpg', 'image3.jpg', - 'image/jpeg', test.SharedOption.NONE, 'Jan 18, 2038, 1:02 AM', - 'image3.jpg', '3 KB', 'JPEG image'), + test.EntryType.FILE, 'image3.jpg', 'image3.jpg', 'image/jpeg', + test.SharedOption.NONE, 'Jan 18, 2038, 1:02 AM', 'image3.jpg', '3 KB', + 'JPEG image'), // An ogg file without a mime type, to confirm that file type detection using // file extensions works fine. beautiful: new test.TestEntryInfo( - test.EntryType.FILE, 'music.ogg', 'Beautiful Song.ogg', - '', test.SharedOption.NONE, 'Nov 12, 2086, 12:00 PM', - 'Beautiful Song.ogg', '14 KB', 'OGG audio'), + test.EntryType.FILE, 'music.ogg', 'Beautiful Song.ogg', '', + test.SharedOption.NONE, 'Nov 12, 2086, 12:00 PM', 'Beautiful Song.ogg', + '14 KB', 'OGG audio'), photos: new test.TestEntryInfo( - test.EntryType.DIRECTORY, '', 'photos', - '', test.SharedOption.NONE, 'Jan 1, 1980, 11:59 PM', - 'photos', '--', 'Folder'), + test.EntryType.DIRECTORY, '', 'photos', '', test.SharedOption.NONE, + 'Jan 1, 1980, 11:59 PM', 'photos', '--', 'Folder'), testDocument: new test.TestEntryInfo( test.EntryType.FILE, '', 'Test Document', - 'application/vnd.google-apps.document', - test.SharedOption.NONE, 'Apr 10, 2013, 4:20 PM', - 'Test Document.gdoc', '--', 'Google document'), + 'application/vnd.google-apps.document', test.SharedOption.NONE, + 'Apr 10, 2013, 4:20 PM', 'Test Document.gdoc', '--', 'Google document'), testSharedDocument: new test.TestEntryInfo( test.EntryType.FILE, '', 'Test Shared Document', - 'application/vnd.google-apps.document', - test.SharedOption.SHARED, 'Mar 20, 2013, 10:40 PM', - 'Test Shared Document.gdoc', '--', 'Google document'), + 'application/vnd.google-apps.document', test.SharedOption.SHARED, + 'Mar 20, 2013, 10:40 PM', 'Test Shared Document.gdoc', '--', + 'Google document'), newlyAdded: new test.TestEntryInfo( - test.EntryType.FILE, 'music.ogg', 'newly added file.ogg', - 'audio/ogg', test.SharedOption.NONE, 'Sep 4, 1998, 12:00 AM', - 'newly added file.ogg', '14 KB', 'OGG audio'), + test.EntryType.FILE, 'music.ogg', 'newly added file.ogg', 'audio/ogg', + test.SharedOption.NONE, 'Sep 4, 1998, 12:00 AM', 'newly added file.ogg', + '14 KB', 'OGG audio'), directoryA: new test.TestEntryInfo( - test.EntryType.DIRECTORY, '', 'A', - '', test.SharedOption.NONE, 'Jan 1, 2000, 1:00 AM', - 'A', '--', 'Folder'), + test.EntryType.DIRECTORY, '', 'A', '', test.SharedOption.NONE, + 'Jan 1, 2000, 1:00 AM', 'A', '--', 'Folder'), directoryB: new test.TestEntryInfo( - test.EntryType.DIRECTORY, '', 'A/B', - '', test.SharedOption.NONE, 'Jan 1, 2000, 1:00 AM', - 'B', '--', 'Folder'), + test.EntryType.DIRECTORY, '', 'A/B', '', test.SharedOption.NONE, + 'Jan 1, 2000, 1:00 AM', 'B', '--', 'Folder'), directoryC: new test.TestEntryInfo( - test.EntryType.DIRECTORY, '', 'A/B/C', - '', test.SharedOption.NONE, 'Jan 1, 2000, 1:00 AM', - 'C', '--', 'Folder'), + test.EntryType.DIRECTORY, '', 'A/B/C', '', test.SharedOption.NONE, + 'Jan 1, 2000, 1:00 AM', 'C', '--', 'Folder'), directoryD: new test.TestEntryInfo( - test.EntryType.DIRECTORY, '', 'D', - '', test.SharedOption.NONE, 'Jan 1, 2000, 1:00 AM', - 'D', '--', 'Folder'), + test.EntryType.DIRECTORY, '', 'D', '', test.SharedOption.NONE, + 'Jan 1, 2000, 1:00 AM', 'D', '--', 'Folder'), directoryE: new test.TestEntryInfo( - test.EntryType.DIRECTORY, '', 'D/E', - '', test.SharedOption.NONE, 'Jan 1, 2000, 1:00 AM', - 'E', '--', 'Folder'), + test.EntryType.DIRECTORY, '', 'D/E', '', test.SharedOption.NONE, + 'Jan 1, 2000, 1:00 AM', 'E', '--', 'Folder'), directoryF: new test.TestEntryInfo( - test.EntryType.DIRECTORY, '', 'D/E/F', - '', test.SharedOption.NONE, 'Jan 1, 2000, 1:00 AM', - 'F', '--', 'Folder'), + test.EntryType.DIRECTORY, '', 'D/E/F', '', test.SharedOption.NONE, + 'Jan 1, 2000, 1:00 AM', 'F', '--', 'Folder'), zipArchive: new test.TestEntryInfo( - test.EntryType.FILE, 'archive.zip', 'archive.zip', - 'application/x-zip', test.SharedOption.NONE, 'Jan 1, 2014, 1:00 AM', - 'archive.zip', '533 bytes', 'Zip archive'), + test.EntryType.FILE, 'archive.zip', 'archive.zip', 'application/x-zip', + test.SharedOption.NONE, 'Jan 1, 2014, 1:00 AM', 'archive.zip', + '533 bytes', 'Zip archive'), hiddenFile: new test.TestEntryInfo( - test.EntryType.FILE, 'text.txt', '.hiddenfile.txt', - 'text/plain', test.SharedOption.NONE, 'Sep 30, 2014, 3:30 PM', - '.hiddenfile.txt', '51 bytes', 'Plain text'), + test.EntryType.FILE, 'text.txt', '.hiddenfile.txt', 'text/plain', + test.SharedOption.NONE, 'Sep 30, 2014, 3:30 PM', '.hiddenfile.txt', + '51 bytes', 'Plain text'), mhtml: new test.TestEntryInfo( test.EntryType.FILE, 'text.txt', 'hello.mhtml', 'text/html',
diff --git a/ui/keyboard/keyboard_controller.cc b/ui/keyboard/keyboard_controller.cc index 8e325f5..e8218c7 100644 --- a/ui/keyboard/keyboard_controller.cc +++ b/ui/keyboard/keyboard_controller.cc
@@ -294,6 +294,8 @@ } else { visual_bounds_in_screen_ = gfx::Rect(); } + + ui_->EnsureCaretInWorkArea(GetWorkspaceOccludedBounds()); } void KeyboardController::MoveKeyboard(const gfx::Rect& new_bounds) { @@ -422,7 +424,6 @@ for (KeyboardControllerObserver& observer : observer_list_) observer.OnKeyboardHidden(reason == HIDE_REASON_SYSTEM_TEMPORARY); - ui_->EnsureCaretInWorkArea(gfx::Rect()); break; } @@ -488,7 +489,6 @@ // Notify observers after animation finished to prevent reveal desktop // background during animation. NotifyKeyboardBoundsChanging(GetKeyboardWindow()->bounds()); - ui_->EnsureCaretInWorkArea(GetWorkspaceOccludedBounds()); } void KeyboardController::SetContainerBehaviorInternal(
diff --git a/ui/ozone/platform/wayland/DEPS b/ui/ozone/platform/wayland/DEPS index 73360bcf..06292b5 100644 --- a/ui/ozone/platform/wayland/DEPS +++ b/ui/ozone/platform/wayland/DEPS
@@ -1,5 +1,6 @@ include_rules = [ "+ui/base/ui_features.h", # UI features doesn't bring in all of ui/base. + "+ui/base/ui_base_features.h", "+ui/base/ime/composition_text.h", "+ui/base/ime/linux/linux_input_method_context.h", "+ui/base/ime/linux/linux_input_method_context_factory.h",
diff --git a/ui/ozone/platform/wayland/ozone_platform_wayland.cc b/ui/ozone/platform/wayland/ozone_platform_wayland.cc index c19c251..f845a6b 100644 --- a/ui/ozone/platform/wayland/ozone_platform_wayland.cc +++ b/ui/ozone/platform/wayland/ozone_platform_wayland.cc
@@ -31,6 +31,7 @@ #endif #if defined(WAYLAND_GBM) +#include "ui/base/ui_base_features.h" #include "ui/ozone/common/linux/gbm_wrapper.h" #include "ui/ozone/platform/wayland/gpu/drm_render_node_handle.h" #include "ui/ozone/platform/wayland/gpu/drm_render_node_path_finder.h" @@ -115,8 +116,17 @@ LOG(FATAL) << "Failed to initialize Wayland platform"; #if defined(WAYLAND_GBM) - if (!args.single_process) + if (!args.single_process) { + if (!features::IsOzoneDrmMojo()) { + // Override kEnableOzoneDrmMojo to the enabled state, because + // Ozone/Wayland relies on the mojo communication when running in + // !single_process. + // TODO(msisov, rjkroege): Remove after http://crbug.com/806092. + base::FeatureList::GetInstance()->InitializeFromCommandLine( + features::kEnableOzoneDrmMojo.name, std::string()); + } connector_.reset(new WaylandConnectionConnector(connection_.get())); + } #endif cursor_factory_.reset(new BitmapCursorFactoryOzone);